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.145.105.85
Current Path : /var/www/qpms/assets/ |
| Current File : /var/www/qpms/assets/BankDetails-C_qOmQuP.js |
import{v as g,E as l,x as h,r as x,t as a,D as u,L as p,B as d,F as i}from"./index-Dyw5MJqL.js";import{S as b}from"./index-CzmTCSqS.js";import{R as B}from"./HomeOutlined-C2tOOkr5.js";import{R as c,C as m}from"./row-T0EnmRWC.js";import"./responsiveObserver-CbmTM_W9.js";const j=e=>async(n,o)=>{const r=o();let t=localStorage.getItem("dbname");n({type:"SET_BTN_LOADER"}),await g.post("/app.php?a=saveBankDetails&db="+t+"®no="+r.loginfo.userData.fregno,e).then(s=>{s.data.error_code===0?(l("success",s.data.data.msg),n({type:"SAVE_QP_BANK_DETAILS",payload:s.data.data.msg})):l("info",s.data.data.msg),n({type:"UNSET_BTN_LOADER"})}).catch(s=>{n({type:"UNSET_BTN_LOADER"}),l("error",s)})},E=()=>async(e,n)=>{const o=n();let r=localStorage.getItem("dbname");e({type:"SET_LOADER"}),await g.get("/app.php?a=getBankDetails&db="+r+"®no="+o.loginfo.userData.fregno).then(t=>{t.data.error_code===0&&(e({type:"GET_QP_BANK_DETAILS",payload:t.data.data}),e({type:"UNSET_LOADER"}))}).catch(t=>{l("error",t)})},y=e=>{const[n,o]=x.useState({bankname:"",accno:"",ifsc:"",pan:""});x.useEffect(()=>{r()},[]),x.useEffect(()=>{o({...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()},t=f=>{const{name:k,value:D}=f.target;o({...n,[k]:D.toUpperCase()})},s=()=>{if(n.bankname==""){l("info","Enter bank name");return}if(n.accno==""){l("info","Enter account number");return}if(n.ifsc==""){l("info","Enter IFSC code");return}e.saveBankDetails(n)};return a.jsxs(u,{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(c,{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(i,{style:{marginBottom:"10px"},name:"bankname",value:n.bankname,maxLength:200,onChange:t})]})}),a.jsx(c,{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(i,{style:{marginBottom:"10px"},name:"accno",value:n.accno,maxLength:20,onChange:t})]})}),a.jsx(c,{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(i,{style:{marginBottom:"10px"},name:"ifsc",value:n.ifsc,maxLength:20,onChange:t})]})}),a.jsx(c,{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(i,{style:{marginBottom:"10px"},name:"pan",value:n.pan,maxLength:10,onChange:t})]})}),a.jsx(d,{type:"primary",onClick:()=>s(),loading:e.loading,children:"Save"})]})},S=e=>({token:e.loginfo.userData,saveBankDet:e.saveBankDet,loading:e.loader.btnLoading,bankDetails:e.getBankDet}),T=h(S,{saveBankDetails:j,getBankDetails:E})(y);export{T as default};
|