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.148.115.187
Current Path : /var/www/qpms/assets/ |
| Current File : /var/www/qpms/assets/BankDetails-DoU6QbCy.js |
import{v as g,E as o,x as h,r as x,t as a,D as u,L as p,B as d,F as c}from"./index-DfInnd90.js";import{S as b}from"./index-C9x9vIC2.js";import{R as B}from"./HomeOutlined-i5L7kum_.js";import{R as i,C as m}from"./row-B5MLj3Uu.js";import"./responsiveObserver-2CAuTlBi.js";const j=e=>async(n,s)=>{try{const r=s();let t=localStorage.getItem("dbname");n({type:"SET_BTN_LOADER"});const l=await g.post("/app.php?a=saveBankDetails&db="+t+"®no="+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 s=n();let r=localStorage.getItem("dbname");e({type:"SET_LOADER"});const t=await g.get("/app.php?a=getBankDetails&db="+r+"®no="+s.loginfo.userData.fregno);e({type:"UNSET_LOADER"}),t.data.error_code===0&&e({type:"GET_QP_BANK_DETAILS",payload:t.data.data})}catch(s){o("error",s.message)}},E=e=>{const[n,s]=x.useState({bankname:"",accno:"",ifsc:"",pan:""});x.useEffect(()=>{r()},[]),x.useEffect(()=>{s({...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;s({...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(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(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:t})]})}),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:t})]})}),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:t})]})}),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:t})]})}),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}),T=h(S,{saveBankDetails:j,getBankDetails:y})(E);export{T as default};
|