0xV3NOMx
Linux ip-172-26-7-228 5.4.0-1103-aws #111~18.04.1-Ubuntu SMP Tue May 23 20:04:10 UTC 2023 x86_64



Your IP : 3.144.15.34


Current Path : /var/www/qpms/assets/
Upload File :
Current File : /var/www/qpms/assets/GenerateBill-XXjEuQFz.js

import{v as R,E as i,x as q,r as n,t,D as K,B as E,R as B,L as X,G as j,F as k}from"./index-CaXVb0k8.js";import{g as Y,e as Z}from"./UploadQpPattern-DSdL3SMl.js";import{a as F,p as ee,s as te}from"./sem-BK69X1ab.js";import{g as _,s as v}from"./datatable-Cpia3kpp.js";import{S as ae}from"./index-BVj1xRcQ.js";import{R as re}from"./SaveOutlined-DFqGSJx4.js";import{R as se}from"./HomeOutlined-Cg-zLljH.js";import{R as L,C as h}from"./row-BJr7Zhyy.js";import{F as oe}from"./Table-5DUqtndG.js";import{C as P}from"./index-CisBFiX8.js";import"./responsiveObserver-J5UVIshT.js";import"./index-DOdOsbxf.js";import"./index-BpF0Xclz.js";const le=()=>async(a,s)=>{try{const g=s();let c=localStorage.getItem("dbname");a({type:"SET_LOADER"});const d=await R.get("/app.php?a=getTeahcerData&db="+c);if(a({type:"UNSET_LOADER"}),d.data.error_code===0){const o=d.data.data.map((y,l)=>({...y,key:l,fslno:l+1}));a({type:"GENERATE_BILL",payload:o})}else a({type:"CLEAR_GENERATE_BILL",payload:[]}),i("info",d.data.data.msg)}catch(g){console.log("error",g.message)}},ne=(a,s,g,c,d,o,y)=>async(l,S)=>{try{const x=S();let w=localStorage.getItem("dbname");l({type:"SET_LOADER"});const p=await R.get("/app.php?a=getTeachValDet&db="+w+"&fdeggrp="+a+"&fdegree="+s+"&fsem="+g+"&freportopt="+c+"&fteacher="+d+"&ffrmDate="+o+"&ftoDate="+y);if(l({type:"UNSET_LOADER"}),p.data.error_code===0){const C=p.data.data.map((m,T)=>({...m,key:T,fslno:T+1}));l({type:"TEACH_VAL_DET",payload:C})}else l({type:"CLEAR_TEACH_VAL_DET",payload:[]}),i("info",p.data.data.msg)}catch(x){console.log("error",x.message)}},ce=a=>async(s,g)=>{try{const c=g();let d=localStorage.getItem("dbname");s({type:"SET_LOADER"});const o=await R.post("/app.php?a=saveValBillDet&db="+d,a);s({type:"UNSET_LOADER"}),o.data.error_code===0?i("success",o.data.data.msg):i("info",o.data.data.msg)}catch(c){console.log("error",c.message)}},ie=a=>{const[s,g]=n.useState(""),[c,d]=n.useState("All"),[o,y]=n.useState("All"),[l,S]=n.useState("teacher"),[x,w]=n.useState("All"),[p,C]=n.useState(""),[m,T]=n.useState(""),[b,A]=n.useState([]),[V,O]=n.useState(!1);n.useEffect(()=>{a.getQpDeggrp()},[]);const I=a.deggrp.map(e=>({key:e.fdeggrp,label:e.fdescpn,value:e.fdeggrp})),N=a.degree.map(e=>({key:e.fdegree,label:e.fdescpn,value:e.fdegree})),G=[...F,...N],H=[...F,...te],z=[{key:"teacher",label:"Teacher",value:"teacher"},{key:"moderator",label:"Moderator",value:"moderator"}],Q=a.billgenerate.map(e=>({key:e.fteachcode,label:e.teachername,value:e.fteachcode})),f=async(e,r)=>{e=="deggrp"&&(g(r),a.getQpDegree(r),await a.getTeachers()),e=="degree"&&d(r),e=="sem"&&y(r),e=="reporttype"&&S(r),e=="teach"&&w(r),e=="frmDate"&&C(r),e=="toDate"&&T(r)},U=async()=>{if(s==="")return i("info","Please Select Exam"),!1;if(p==="")return i("info","Please Enter From Date"),!1;if(m==="")return i("info","Please Enter From To"),!1;await a.viewTeachBillDet(s,c,o,l,x,p,m),O(!0)},$=async(e,r)=>{let u=b.map(D=>(D.fteachcode==r.fteachcode&&(D.fcheck=e),D));A(u)},M=async e=>{let r=b.map(u=>(u.fcheck=e,u));A(r)},J=[{title:"Sl. No.",dataIndex:"fslno",align:"center",width:"5%"},{title:"Teach Code",dataIndex:"fteachcode",..._("fteachcode","fteachcode"),sorter:(e,r)=>v(e,r,"fteachcode"),sortDirections:["descend","ascend"],align:"center",width:"25%"},{title:t.jsx("div",{style:{textAlign:"center"},children:"Teacher Name"}),dataIndex:"fteachname",..._("fteachname"),sorter:(e,r)=>v(e,r,"fteachname"),sortDirections:["descend","ascend"],width:"55%"},{title:"Total Sets",dataIndex:"ftotscrp",align:"center",width:"10%"},{title:t.jsxs("div",{style:{textAlign:"center"},children:["Action"," ",t.jsx(P,{onChange:e=>{let r=e.target.checked?"T":"F";M(r)}})]}),render:(e,r)=>t.jsx(P,{checked:r.fcheck=="T",onChange:u=>{let D=u.target.checked?"T":"F";$(D,r)}}),align:"center",width:"5%"}];n.useEffect(()=>{A(a.teachValData)},[a.teachValData]);const W=async()=>{if(s==="")return i("info","Please Select Exam"),!1;if(p==="")return i("info","Please Enter From Date"),!1;if(m==="")return i("info","Please Enter From To"),!1;const e=new FormData;e.append("fdeggrp",s),e.append("fdegree",c),e.append("fsem",o),e.append("freportopt",l),e.append("fteacher",x),e.append("ffrmDate",p),e.append("ftoDate",m),e.append("fuser",a.userDet.fteachname),e.append("finData",JSON.stringify(b)),await a.saveValBillDet(e)};return t.jsxs(K,{style:{margin:"6rem 10px 10px"},title:t.jsx("h6",{children:"Generate Teacher/Moderator Bill Report"}),extra:t.jsxs(ae,{children:[t.jsxs(E,{type:"primary",size:"mini",style:{backgroundColor:"green"},onClick:()=>W(),children:[t.jsx(re,{}),"Save"]}),t.jsxs(E,{size:"mini",children:[t.jsx(B,{}),"View Report"]}),t.jsx(X,{to:"/",children:t.jsxs(E,{size:"mini",type:"primary",danger:!0,children:[t.jsx(se,{}),"Exit"]})})]}),children:[t.jsxs(L,{gutter:10,children:[t.jsxs(h,{xs:24,sm:24,md:12,lg:6,xl:6,xxl:6,children:[t.jsx("label",{children:"Exam"}),t.jsx(j,{showSearch:!0,optionFilterProp:"label",style:{marginBottom:"10px",width:"100%"},value:s,options:I,onChange:e=>f("deggrp",e)})]}),t.jsxs(h,{xs:24,sm:24,md:12,lg:6,xl:6,xxl:6,children:[t.jsx("label",{children:"Degree"}),t.jsx(j,{showSearch:!0,mode:"multiple",optionFilterProp:"label",style:{marginBottom:"10px",width:"100%"},value:c,options:G,onChange:e=>f("degree",e)})]}),t.jsxs(h,{xs:12,sm:12,md:6,lg:3,xl:3,xxl:3,children:[t.jsx("label",{children:"Sem"}),t.jsx(j,{showSearch:!0,optionFilterProp:"label",style:{marginBottom:"10px",width:"100%"},options:H,value:o,onChange:e=>f("sem",e)})]}),t.jsxs(h,{xs:12,sm:12,md:6,lg:3,xl:3,xxl:3,children:[t.jsx("label",{children:"Report Type"}),t.jsx(j,{showSearch:!0,optionFilterProp:"label",style:{marginBottom:"10px",width:"100%"},value:l,options:z,onChange:e=>f("reporttype",e)})]})]}),t.jsxs(L,{gutter:10,children:[t.jsxs(h,{xs:24,sm:24,md:12,lg:6,xl:6,xxl:6,children:[t.jsx("label",{children:"Teacher"}),t.jsx(j,{showSearch:!0,mode:"multiple",optionFilterProp:"label",style:{marginBottom:"10px",width:"100%"},value:x,options:Q,onChange:e=>f("teach",e)})]}),t.jsxs(h,{xs:12,sm:12,md:6,lg:3,xl:3,xxl:3,children:[t.jsx("label",{children:"Date From"}),t.jsx(k,{type:"date",optionFilterProp:"label",style:{marginBottom:"10px",width:"100%"},value:p,onChange:e=>f("frmDate",e.target.value)})]}),t.jsxs(h,{xs:12,sm:12,md:6,lg:3,xl:3,xxl:3,children:[t.jsx("label",{children:"To"}),t.jsx(k,{type:"date",optionFilterProp:"label",style:{marginBottom:"10px",width:"100%"},value:m,onChange:e=>f("toDate",e.target.value)})]}),t.jsxs(h,{xs:24,sm:24,md:12,lg:6,xl:6,xxl:6,children:[t.jsx("p",{style:{marginTop:"20px"}}),t.jsxs(E,{type:"primary",style:{marginBottom:"10px"},onClick:()=>U(),children:[t.jsx(B,{}),"View"]})]})]}),V&&t.jsx(oe,{bordered:!0,dataSource:b,columns:J,scroll:{y:500,x:1200},size:"small",pagination:ee})]})},de=a=>(console.log(),{deggrp:a.deggrp,teachValData:a.teachBillDet,userDet:a.loginfo.userData,degree:a.degree,billgenerate:a.billgenerate}),Se=q(de,{getQpDeggrp:Y,viewTeachBillDet:ne,saveValBillDet:ce,getQpDegree:Z,getTeachers:le})(ie);export{Se as default};