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


Current Path : /var/www/qpms/assets/
Upload File :
Current File : /var/www/qpms/assets/BankDetails-BniS7QNP.js

import{v as g,E as o,x as u,r as x,t as a,D as h,L as p,B as d,F as c}from"./index-CaXVb0k8.js";import{S as b}from"./index-BVj1xRcQ.js";import{R as B}from"./HomeOutlined-Cg-zLljH.js";import{R as i,C as m}from"./row-BJr7Zhyy.js";import"./responsiveObserver-J5UVIshT.js";const j=e=>async(n,t)=>{try{const r=t();let s=localStorage.getItem("dbname");n({type:"SET_BTN_LOADER"});const l=await g.post("/app.php?a=saveBankDetails&db="+s+"&regno="+r.loginfo.userData.fregno,e);n({type:"UNSET_BTN_LOADER"}),l.data.error_code===0?(o("success",l.data.data.msg),n({type:"SAVE_QP_BANK_DETAILS",payload:l.data.data.msg})):o("info",l.data.data.msg)}catch(r){o("error",r.message)}},y=()=>async(e,n)=>{try{const t=n();console.log(t.loginfo.userData,"HII");let r=localStorage.getItem("dbname");e({type:"SET_LOADER"});const s=await g.get("/app.php?a=getBankDetails&db="+r+"&regno="+t.loginfo.userData.fregno);e({type:"UNSET_LOADER"}),s.data.error_code===0&&e({type:"GET_QP_BANK_DETAILS",payload:s.data.data})}catch(t){o("error",t.message)}},E=e=>{const[n,t]=x.useState({bankname:"",accno:"",ifsc:"",pan:""});x.useEffect(()=>{r()},[]),x.useEffect(()=>{t({...n,bankname:e.bankDetails.fbankname,accno:e.bankDetails.faccno,ifsc:e.bankDetails.fifsccode,pan:e.bankDetails.fpanno})},[e.bankDetails]);const r=async()=>{await e.getBankDetails()},s=f=>{const{name:k,value:D}=f.target;t({...n,[k]:D.toUpperCase()})},l=()=>{if(n.bankname==""){o("info","Enter bank name");return}if(n.accno==""){o("info","Enter account number");return}if(n.ifsc==""){o("info","Enter IFSC code");return}e.saveBankDetails(n)};return a.jsxs(h,{style:{margin:"6rem 10px 10px"},title:a.jsx("h6",{children:"Bank Details"}),extra:a.jsx(b,{children:a.jsx(p,{to:"/",children:a.jsxs(d,{type:"primary",danger:!0,children:[a.jsx(B,{})," Exit"]})})}),children:[a.jsx(i,{children:a.jsxs(m,{xs:24,sm:24,md:12,lg:8,xl:8,xxl:8,children:[a.jsx("label",{children:"Bank Name"}),a.jsx(c,{style:{marginBottom:"10px"},name:"bankname",value:n.bankname,maxLength:200,onChange:s})]})}),a.jsx(i,{children:a.jsxs(m,{xs:24,sm:24,md:12,lg:8,xl:8,xxl:8,children:[a.jsx("label",{children:"Account Number"}),a.jsx(c,{style:{marginBottom:"10px"},name:"accno",value:n.accno,maxLength:20,onChange:s})]})}),a.jsx(i,{children:a.jsxs(m,{xs:24,sm:24,md:12,lg:8,xl:8,xxl:8,children:[a.jsx("label",{children:"IFSC Code"}),a.jsx(c,{style:{marginBottom:"10px"},name:"ifsc",value:n.ifsc,maxLength:20,onChange:s})]})}),a.jsx(i,{children:a.jsxs(m,{xs:24,sm:24,md:12,lg:8,xl:8,xxl:8,children:[a.jsx("label",{children:"Pancard Number"}),a.jsx(c,{style:{marginBottom:"10px"},name:"pan",value:n.pan,maxLength:10,onChange:s})]})}),a.jsx(d,{type:"primary",onClick:()=>l(),loading:e.loading,children:"Save"})]})},S=e=>({token:e.loginfo.userData,saveBankDet:e.saveBankDet,loading:e.loader.btnLoading,bankDetails:e.getBankDet}),I=u(S,{saveBankDetails:j,getBankDetails:y})(E);export{I as default};