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 : 18.226.187.60
Current Path : /var/www/qpms/assets/ |
| Current File : /var/www/qpms/assets/GenerateBill-DJfw7-QM.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-B1vCiLdb.js";import{g as Y,e as Z}from"./UploadQpPattern-DKIQcOZK.js";import{a as F,p as ee,s as te}from"./sem-BK69X1ab.js";import{g as _,s as v}from"./datatable-CUbHEgW_.js";import{S as ae}from"./index-Bg4J2mA-.js";import{R as re}from"./SaveOutlined-C3juO6wQ.js";import{R as se}from"./HomeOutlined-URzAi1xv.js";import{R as L,C as h}from"./row-BpBokYu2.js";import{F as le}from"./Table-DAx1ImL3.js";import{C as P}from"./index-CQr3Towi.js";import"./responsiveObserver-MZZXoO8e.js";import"./index-BYuc-nPv.js";import"./index-Bk72D_Kc.js";const oe=()=>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 l=d.data.data.map((y,o)=>({...y,key:o,fslno:o+1}));a({type:"GENERATE_BILL",payload:l})}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,l,y)=>async(o,S)=>{try{const x=S();let w=localStorage.getItem("dbname");o({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="+l+"&ftoDate="+y);if(o({type:"UNSET_LOADER"}),p.data.error_code===0){const C=p.data.data.map((m,T)=>({...m,key:T,fslno:T+1}));o({type:"TEACH_VAL_DET",payload:C})}else o({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 l=await R.post("/app.php?a=saveValBillDet&db="+d,a);s({type:"UNSET_LOADER"}),l.data.error_code===0?i("success",l.data.data.msg):i("info",l.data.data.msg)}catch(c){console.log("error",c.message)}},ie=a=>{const[s,g]=n.useState(""),[c,d]=n.useState("All"),[l,y]=n.useState("All"),[o,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,l,o,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",l),e.append("freportopt",o),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:l,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:o,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(le,{bordered:!0,dataSource:b,columns:J,scroll:{y:500,x:1200},size:"small",pagination:ee})]})},de=a=>({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:oe})(ie);export{Se as default};
|