????

Your IP : 216.73.216.152


Current Path : C:/inetpub/vhost/xaydung.gdtsolutions.vn/build/static/js/
Upload File :
Current File : C:/inetpub/vhost/xaydung.gdtsolutions.vn/build/static/js/6848.614397ae.chunk.js

"use strict";(self.webpackChunk_qlxd_frontend=self.webpackChunk_qlxd_frontend||[]).push([[6848],{16848:(e,n,a)=>{a.r(n),a.d(n,{default:()=>C,formUpdate:()=>T});var t=a(82210),i=a(73161),l=a(79617),o=a(27532),h=a(57299),u=a(46881),d=a(35065),s=a(20136),r=a(14658),c=a(6058);const T={NoiDung:{field_name:"NoiDung",title:"T\xean kho\u1ea3n chi",type:"textbox",required:!0},TienThanhToan:{field_name:"TienThanhToan",title:"Ti\u1ec1n thanh to\xe1n",type:"currency",thousandSeparator:".",decimalSeparator:",",required:!0},ThoiGian:{field_name:"ThoiGian",title:"Th\u1eddi gian",type:"datetime",required:!0},IsSoQuy:{field_name:"IsSoQuy",title:"L\u1ea5y ti\u1ec1n t\u1eeb s\u1ed5 qu\u1ef9",type:"checkbox",disabled:!1},DMKhoanChiId:{field_name:"DMKhoanChiId",type:"textbox"}};function C(e){let{open:n,dataSelected:a,onClose:C,title:g,IdNhomKhoanChi:I,IdKhoanChi:y,afterCreate:f,IdDuAn:p}=e;const[x,S]=(0,t.useState)({}),k=(0,t.useCallback)(((e,n)=>{S("DuAnId"!==e?a=>({...a,[e]:n}):e=>({...{...e},DuAnId:n?n.value:null,Name:n?n.label:""}))}),[]),A=(0,t.useCallback)((()=>{y&&r.sk.getAllKhoanChi(y).then((e=>{S((n=>(T.IsSoQuy.disabled=!0,!0===e.IsSoQuy?{...n,...e,IsSoQuy:!0}:{...n,...e,IsSoQuy:!1})))}))}),[y]);(0,t.useEffect)((()=>{y?A():T.IsSoQuy.disabled=!1}),[y,A]);const b=(0,t.useCallback)((()=>{const e={data:x,formUpdate:T},n=Object.values(T).filter((e=>e.required));for(let a=0;a<n.length;a++){const t=n[a];let i=e.data&&e.data[t.field_name]||null;if(null===i||""===i||void 0===i||0===i.length)return(0,d.AB)('Vui l\xf2ng nh\u1eadp "'+t.title+'"'),!1}return!0}),[x]),m=(0,t.useCallback)((()=>{let e={NoiDung:x.NoiDung,TienThanhToan:x.TienThanhToan,ThoiGian:x.ThoiGian,DuAnId:p,DMKhoanChiId:a.Id,IsSoQuy:x.IsSoQuy};y?r.sk.capNhatKhoanChi(y,e).then((e=>{(0,d.nw)("C\u1eadp nh\u1eadt th\xe0nh c\xf4ng"),f&&f(),C()})):x.IsSoQuy?b()&&r.sk.getKhoanChiSoQuy(e).then((e=>{f&&f(),C()})).catch((e=>{(0,d.a3)(e.Message)})):b()&&r.sk.addKhoanChi(e).then((e=>{f&&f(),C()})).catch((e=>(0,d.a3)(e.Message)))}),[x,p,a,y,f,C,b]);return(0,c.jsx)("div",{children:(0,c.jsxs)(i.A,{isOpen:n,toggle:C,children:[(0,c.jsx)(l.A,{children:g}),(0,c.jsxs)(o.A,{children:[(0,c.jsx)(s.A,{data:T.NoiDung,value:x&&x.NoiDung||null,onChange:k}),(0,c.jsx)(s.A,{data:T.TienThanhToan,value:x&&x.TienThanhToan||null,onChange:k}),(0,c.jsx)(s.A,{data:T.ThoiGian,value:x&&x.ThoiGian||null,onChange:k}),(0,c.jsx)(s.A,{data:T.IsSoQuy,value:x&&x.IsSoQuy||null,onChange:k})]}),(0,c.jsxs)(h.A,{children:[(0,c.jsx)(u.A,{onClick:m,color:"primary",children:"L\u01b0u"}),(0,c.jsx)(u.A,{onClick:C,color:"danger",children:"\u0110\xf3ng"})]})]})})}}}]);
//# sourceMappingURL=6848.614397ae.chunk.js.map