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.138.137.244


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

import{v as B,E as i,x as W,r as n,t,D as q,B as E,R as K,L as X,G as j,F as R}from"./index-CBe1QwHL.js";import{g as Y,e as Z}from"./UploadQpPattern-dTrjNFca.js";import{a as k,p as ee,s as te}from"./sem-BK69X1ab.js";import{g as F,s as _}from"./datatable-C5nk-HjN.js";import{S as ae}from"./index-BamOSC-o.js";import{R as re}from"./SaveOutlined-wxy8iewI.js";import{R as se}from"./HomeOutlined-9C486Ty5.js";import{R as v,C as h}from"./row-XwVfMbzo.js";import{F as le}from"./Table-8v4kaeGs.js";import{C as L}from"./index-BtHL6WL_.js";import"./responsiveObserver-BsQaiDWu.js";import"./index-PczNG-it.js";import"./index--rFW8HEL.js";const oe=()=>async(a,s)=>{try{const g=s();let c=localStorage.getItem("dbname");a({type:"SET_LOADER"});const d=await B.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 B.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 B.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([]),[P,V]=n.useState(!1);n.useEffect(()=>{a.getQpDeggrp()},[]);const O=a.deggrp.map(e=>({key:e.fdeggrp,label:e.fdescpn,value:e.fdeggrp})),I=a.degree.map(e=>({key:e.fdegree,label:e.fdescpn,value:e.fdegree})),N=[...k,...I],G=[...k,...te],H=[{key:"teacher",label:"Teacher",value:"teacher"},{key:"moderator",label:"Moderator",value:"moderator"}],z=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)},Q=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),V(!0)},U=async(e,r)=>{let u=b.map(D=>(D.fteachcode==r.fteachcode&&(D.fcheck=e),D));A(u)},$=async e=>{let r=b.map(u=>(u.fcheck=e,u));A(r)},M=[{title:"Sl. No.",dataIndex:"fslno",align:"center",width:"5%"},{title:"Teach Code",dataIndex:"fteachcode",...F("fteachcode","fteachcode"),sorter:(e,r)=>_(e,r,"fteachcode"),sortDirections:["descend","ascend"],align:"center",width:"25%"},{title:t.jsx("div",{style:{textAlign:"center"},children:"Teacher Name"}),dataIndex:"fteachname",...F("fteachname"),sorter:(e,r)=>_(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(L,{onChange:e=>{let r=e.target.checked?"T":"F";$(r)}})]}),render:(e,r)=>t.jsx(L,{checked:r.fcheck=="T",onChange:u=>{let D=u.target.checked?"T":"F";U(D,r)}}),align:"center",width:"5%"}];n.useEffect(()=>{A(a.teachValData)},[a.teachValData]);const J=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(q,{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:()=>J(),children:[t.jsx(re,{}),"Save"]}),t.jsxs(E,{size:"mini",children:[t.jsx(K,{}),"View"]}),t.jsx(X,{to:"/",children:t.jsxs(E,{size:"mini",type:"primary",danger:!0,children:[t.jsx(se,{}),"Exit"]})})]}),children:[t.jsxs(v,{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:O,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:N,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:G,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:H,onChange:e=>f("reporttype",e)})]})]}),t.jsxs(v,{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:z,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(R,{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(R,{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.jsx(E,{type:"primary",style:{marginBottom:"10px"},onClick:()=>Q(),children:"View"})]})]}),P&&t.jsx(le,{bordered:!0,dataSource:b,columns:M,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=W(de,{getQpDeggrp:Y,viewTeachBillDet:ne,saveValBillDet:ce,getQpDegree:Z,getTeachers:oe})(ie);export{Se as default};