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.188.137.209
Current Path : /var/www/qpms/assets/ |
| Current File : /var/www/qpms/assets/AcceptQpRequest-DQzH8VRU.js |
import{v as y,E as h,M as E,x as b,y as j,r as g,t,B as p,J as w,N as P,D as S,L as R}from"./index-CDn4Wprz.js";import{S as x}from"./index-BzpRcNiH.js";import{R as A}from"./HomeOutlined-lu-wn02m.js";import{R as m}from"./index-DKSJlvhU.js";import{F as C}from"./Table-UiRZYFRj.js";import"./index-bKPvE33f.js";import"./index-iIYbe4vH.js";import"./responsiveObserver-TKOKauOe.js";const T=e=>async(o,u)=>{try{let l=localStorage.getItem("dbname");const i=u();o({type:"SET_LOADER"});const d=await y.get("app.php?a=getQPDetails&db="+l+"&teachcode="+i.loginfo.userData.fregno+"&type="+e);if(typeof d.data!="object")h("Error","Something went wrong, Please try again later");else if(d.data.error_code===0){let r=d.data.data.map((c,s)=>({...c,key:s,fslno:s+1}));o({type:"QP_DETAILS",payload:r})}else o({type:"CLEAR_QP_DETAILS",payload:[]});o({type:"UNSET_LOADER"})}catch(l){console.log(l.message)}},L=(e,o,u,l)=>async(i,d)=>{try{let r=localStorage.getItem("dbname");const c=d();i({type:"SET_BTN_LOADER"});const s=await y.post("app.php?a=acceptQPRequest&db="+r+"&userid="+c.loginfo.userData.fregno+"&collcode="+c.loginfo.userData.fcollcode+"&mobile="+c.loginfo.userData.fmobile,e);s.data.error_code===-2?E.confirm({title:"Warning",content:"Please update bank details before you proceed, Click ok to update bank details",okButtonProps:{style:{backgroundColor:"#8231d3",borderColor:"#8231d3"}},onOk(){o("/qpsettings/bank-details")},onCancel(){console.log("Cancelled")}}):s.data.error_code===0?u(l):h("Info",s.data.data.msg),i({type:"UNSET_BTN_LOADER"})}catch(r){h("Error",r.message)}},Q=e=>{const o=j(),[u,l]=g.useState([]),[i,d]=g.useState("Pending");let r="https://qp-scheme.s3.ap-south-1.amazonaws.com/";g.useEffect(()=>{e.getQPDetails(i)},[]),g.useEffect(()=>{l(e.qpAcceptData)},[e.qpAcceptData]);const c=n=>{d(n.target.value),e.getQPDetails(n.target.value)},s=async(n,a)=>{const f=new FormData;f.append("status",a),f.append("data",JSON.stringify(n)),await e.acceptQPRequest(f,o,e.getQPDetails,i)},D=[{title:"Sl. No.",dataIndex:"fslno",align:"center",width:"5%"},{title:"QP Code",dataIndex:"fqpcode",align:"center",width:"10%"},{title:"Subject Name",dataIndex:"fsubname",width:"20%"},{title:"Max. Marks",dataIndex:"fvalmax",align:"center",hidden:e.user.fusertype==="T"&&!0,width:"5%"},{title:"Set. No.",dataIndex:"fset",align:"center",width:"5%"},{title:"Syllabus with COs",render:(n,a)=>t.jsx("a",{href:r+a.FQPSYLLABUS,target:"_blank",download:!0,children:"Download"}),align:"center",width:"10%"},{title:"Last Date",data:"flastdate",align:"center",width:"10%"},{title:"Question Paper Pattern",render:(n,a)=>t.jsx("a",{href:r+a.FQPPATREN,target:"_blank",download:!0,children:"Download"}),align:"center",width:"10%"},{title:"Scheme Pattern",render:(n,a)=>t.jsx("a",{href:r+a.fschpattern,target:"_blank",download:!0,children:"Download"}),align:"center",hidden:e.user.funivcode!=="030"&&!0,width:"10%"},{title:e.user.funivcode=="030"?"Accept":"Accept / Reject",render:(n,a)=>t.jsx("div",{children:a.flastdate_status=="F"?t.jsxs(x,{children:[a.fstatus!=="ACCEPTED"&&t.jsx(p,{type:"primary",size:"medium",loading:e.btnLoading,onClick:()=>s(a,"ACCEPTED"),children:t.jsx(w,{})}),a.fstatus!=="REJECTED"&&e.user.funivcode!="030"&&t.jsx(p,{type:"primary",danger:!0,size:"medium",loading:e.btnLoading,onClick:()=>s(a,"REJECTED"),children:t.jsx(P,{})})]}):t.jsx(p,{type:"primary",danger:!0,size:"medium",children:"Last Date Over"})}),align:"center",width:"10%"},{title:"Status",dataIndex:"fstatus",align:"center",width:"10%"}];return t.jsxs(S,{style:{margin:"6rem 10px 10px"},title:t.jsx("h6",{children:"Accept Question Paper Request"}),extra:t.jsx(x,{children:t.jsx(R,{to:"/",children:t.jsxs(p,{type:"primary",danger:!0,children:[t.jsx(A,{})," Exit"]})})}),children:[t.jsxs(m.Group,{style:{marginBottom:"10px"},value:i,onChange:n=>c(n),children:[t.jsx(m,{value:"Pending",children:"Pending"}),t.jsx(m,{value:"Accepted",children:"Accepted"}),e.user.funivcode!="030"&&t.jsx(m,{value:"Rejected",children:"Rejected"})]}),t.jsx(C,{bordered:!0,dataSource:u,columns:D,scroll:{x:1300,y:450,marginTop:"10px"},pagination:!1})]})},_=e=>({qpAcceptData:e.qpAcceptDetails,btnLoading:e.loader.btnLoading,user:e.loginfo.userData}),z=b(_,{getQPDetails:T,acceptQPRequest:L})(Q);export{z as default};
|