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.118.120.13
Current Path : /var/www/qpms/assets/ |
| Current File : /var/www/qpms/assets/GenerateBill-BgDS7P2t.js |
import{x as X,r as l,t,D as Y,B as m,L as S,R as Z,G as i,F as w,E as c}from"./index-BGN0ZMlx.js";import{g as ee,e as te}from"./UploadQpPattern-Em67LlSc.js";import{a as T,p as ae,b as re}from"./sem-DLpF_ddZ.js";import{v as le,s as se,g as ne}from"./GenerateBill-CMq9p37Z.js";import{g as C,s as k}from"./datatable-DO2-ZaDk.js";import{S as oe}from"./index-Cvv7jmnp.js";import{R as ie}from"./SaveOutlined-CMdc2l5p.js";import{R as ce}from"./HomeOutlined-D4-Nsiyp.js";import{R as B,C as s}from"./row-AWds_3hu.js";import{F as de}from"./Table-DrjpZi7U.js";import{C as F}from"./index-CRTM9snO.js";import"./responsiveObserver-lGxp52mZ.js";import"./index-cLl6_n2r.js";import"./index-BzT3oaCy.js";const pe=r=>{const[d,v]=l.useState(""),[f,P]=l.useState("All"),[u,E]=l.useState("All"),[y,A]=l.useState("Teacher"),[j,R]=l.useState("All"),[p,V]=l.useState(""),[h,O]=l.useState(""),[x,D]=l.useState([]),[I,G]=l.useState(!1),[b,z]=l.useState("Pending");l.useEffect(()=>{r.getQpDeggrp()},[]);const Q=r.deggrp.map(e=>({key:e.fdeggrp,label:e.fdescpn,value:e.fdeggrp})),H=r.degree.map(e=>({key:e.fdegree,label:e.fdescpn,value:e.fdegree})),L=[...T,...H],M=[...T,...re],N=[{key:"teacher",label:"Teacher",value:"Teacher"},{key:"moderator",label:"Moderator",value:"Moderator"}],$=[{key:"all",label:"All",value:"All"},{key:"Generated",label:"Generated",value:"Generated"},{key:"Pending",label:"Pending",value:"Pending"}],J=r.billgenerate.map(e=>({key:e.fteachcode,label:e.teachername,value:e.fteachcode})),n=async(e,a)=>{e=="deggrp"&&(v(a),r.getQpDegree(a),await r.getTeachers()),e=="degree"&&P(a),e=="sem"&&E(a),e=="reporttype"&&A(a),e=="teach"&&R(a),e=="frmDate"&&V(a),e=="toDate"&&O(a)},W=async()=>{if(d==="")return c("info","Please Select Exam"),!1;if(p==="")return c("info","Please Enter From Date"),!1;if(h==="")return c("info","Please Enter From To"),!1;await r.viewTeachBillDet(d,f,u,y,j,p,h,b),G(!0)},_=async(e,a)=>{let o=x.map(g=>(g.fteachcode==a.fteachcode&&(g.fcheck=e),g));D(o)},q=async e=>{let a=x.map(o=>(o.fcheck=e,o));D(a)},K=[{title:"Sl. No.",dataIndex:"fslno",align:"center",width:"5%"},{title:"Teach Code",dataIndex:"fteachcode",...C("fteachcode","fteachcode"),sorter:(e,a)=>k(e,a,"fteachcode"),sortDirections:["descend","ascend"],align:"center",width:"25%"},{title:t.jsx("div",{style:{textAlign:"center"},children:"Teacher Name"}),dataIndex:"fteachname",...C("fteachname"),sorter:(e,a)=>k(e,a,"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(F,{onChange:e=>{let a=e.target.checked?"T":"F";q(a)}})]}),render:(e,a)=>t.jsx(F,{checked:a.fcheck=="T",onChange:o=>{let g=o.target.checked?"T":"F";_(g,a)}}),align:"center",width:"5%"}];l.useEffect(()=>{D(r.teachValData)},[r.teachValData]);const U=async()=>{if(d==="")return c("info","Please Select Exam"),!1;if(p==="")return c("info","Please Enter From Date"),!1;if(h==="")return c("info","Please Enter From To"),!1;const e=new FormData;e.append("fdeggrp",d),e.append("fdegree",f),e.append("fsem",u),e.append("freportopt",y),e.append("fteacher",j),e.append("ffrmDate",p),e.append("ftoDate",h),e.append("fdisptyp",b),e.append("fuser",r.userDet.fteachname),e.append("finData",JSON.stringify(x)),await r.saveValBillDet(e)};return t.jsxs(Y,{style:{margin:"6rem 10px 10px"},title:t.jsx("h6",{children:"Generate Teacher/Moderator Bill Report"}),extra:t.jsxs(oe,{children:[t.jsxs(m,{type:"primary",size:"mini",style:{backgroundColor:"green"},onClick:()=>U(),children:[t.jsx(ie,{}),"Save"]}),t.jsx(S,{to:"/generatedBill",children:t.jsxs(m,{size:"mini",children:[t.jsx(Z,{}),"View"]})}),t.jsx(S,{to:"/",children:t.jsxs(m,{size:"mini",type:"primary",danger:!0,children:[t.jsx(ce,{}),"Exit"]})})]}),children:[t.jsxs(B,{gutter:10,children:[t.jsxs(s,{xs:24,sm:24,md:12,lg:6,xl:6,xxl:6,children:[t.jsx("label",{children:"Exam"}),t.jsx(i,{showSearch:!0,optionFilterProp:"label",style:{marginBottom:"10px",width:"100%"},value:d,options:Q,onChange:e=>n("deggrp",e)})]}),t.jsxs(s,{xs:24,sm:24,md:12,lg:6,xl:6,xxl:6,children:[t.jsx("label",{children:"Degree"}),t.jsx(i,{showSearch:!0,mode:"multiple",optionFilterProp:"label",style:{marginBottom:"10px",width:"100%"},value:f,options:L,onChange:e=>n("degree",e)})]}),t.jsxs(s,{xs:12,sm:12,md:6,lg:3,xl:3,xxl:3,children:[t.jsx("label",{children:"Sem"}),t.jsx(i,{showSearch:!0,optionFilterProp:"label",style:{marginBottom:"10px",width:"100%"},options:M,value:u,onChange:e=>n("sem",e)})]}),t.jsxs(s,{xs:12,sm:12,md:6,lg:3,xl:3,xxl:3,children:[t.jsx("label",{children:"Report Type"}),t.jsx(i,{showSearch:!0,optionFilterProp:"label",style:{marginBottom:"10px",width:"100%"},value:y,options:N,onChange:e=>n("reporttype",e)})]})]}),t.jsxs(B,{gutter:10,children:[t.jsxs(s,{xs:24,sm:24,md:12,lg:6,xl:6,xxl:6,children:[t.jsx("label",{children:"Teacher"}),t.jsx(i,{showSearch:!0,mode:"multiple",optionFilterProp:"label",style:{marginBottom:"10px",width:"100%"},value:j,options:J,onChange:e=>n("teach",e)})]}),t.jsxs(s,{xs:12,sm:12,md:6,lg:3,xl:3,xxl:3,children:[t.jsx("label",{children:"Date From"}),t.jsx(w,{type:"date",optionFilterProp:"label",style:{marginBottom:"10px",width:"100%"},value:p,onChange:e=>n("frmDate",e.target.value)})]}),t.jsxs(s,{xs:12,sm:12,md:6,lg:3,xl:3,xxl:3,children:[t.jsx("label",{children:"To"}),t.jsx(w,{type:"date",optionFilterProp:"label",style:{marginBottom:"10px",width:"100%"},value:h,onChange:e=>n("toDate",e.target.value)})]}),t.jsxs(s,{xs:12,sm:12,md:6,lg:3,xl:3,xxl:3,children:[t.jsx("label",{children:"Display Type"}),t.jsx(i,{showSearch:!0,optionFilterProp:"label",style:{marginBottom:"10px",width:"100%"},value:b,options:$,onChange:e=>z(e)})]}),t.jsxs(s,{xs:12,sm:12,md:6,lg:3,xl:3,xxl:3,children:[t.jsx("p",{style:{marginTop:"20px"}}),t.jsx(m,{type:"primary",style:{marginBottom:"10px"},onClick:()=>W(),children:"Submit"})]})]}),I&&t.jsx(de,{bordered:!0,dataSource:x,columns:K,scroll:{y:500,x:1200},size:"small",pagination:ae})]})},he=r=>({deggrp:r.deggrp,teachValData:r.teachBillDet,userDet:r.loginfo.userData,degree:r.degree,billgenerate:r.billgenerate}),Be=X(he,{getQpDeggrp:ee,viewTeachBillDet:le,saveValBillDet:se,getQpDegree:te,getTeachers:ne})(pe);export{Be as default};
|