????
Current Path : C:/inetpub/vhost/qlk.nextform.vn/www/wwwroot/static/js/ |
Current File : C:/inetpub/vhost/qlk.nextform.vn/www/wwwroot/static/js/5171.1184b654.chunk.js |
"use strict";(self.webpackChunkgdt=self.webpackChunkgdt||[]).push([[5171],{56188:(e,t,a)=>{a.d(t,{A:()=>S});var h=a(9950),n=a(85560),i=a(55413),o=a(43116),l=a(4370),d=a(67116),s=a(23931),u=a(30616),r=a(28412),c=a(32385),g=a(62181),p=a(39051),T=a(18383),y=a(53744),K=a(18849),_=a(58195),C=a(73613),f=a(44414);const m=[{title:"Id",field:"Id",type:"numeric",dataID:!0,hidden:!0,editable:"never",cellStyle:{textAlign:"center"}},{title:"T\xean kho",field:"Ten",type:"string",editable:"never"},{title:"Ph\u1ea7n tr\u0103m",field:"PT_ChuyenKho",type:"string",render:e=>"".concat((null===e||void 0===e?void 0:e.PT_ChuyenKho)||0," %")}],I=()=>{const[e,t]=(0,h.useState)(!1);return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("div",{className:"form-add-percecnt",children:(0,f.jsxs)(K.A,{onClick:()=>t(!0),className:"btn-open-add-percecnt",children:[(0,f.jsx)(C.A,{style:{color:"#007bff"},fa:"area-chart"})," C\xe0i \u0111\u1eb7t % t\u0103ng"]})}),(0,f.jsx)(_.A,{isOpen:e,toggle:()=>t(!1),children:(0,f.jsx)("div",{className:"p-3",children:(0,f.jsx)(n.A,{title:"C\xe0i \u0111\u1eb7t % t\u0103ng",url:"DM_Kho",columns:m,selectType:"withColumns",where:"IsKhoTong ne true",onEdit:{}})})})]})};var x=a(78042),N=a(76991);let D=[{id:"tat_ca",name:"T\u1ea5t c\u1ea3"},{id:"yeu_cau_moi",name:"Y\xeau c\u1ea7u m\u1edbi"},{id:"da_xuat_kho",name:"\u0110\xe3 xu\u1ea5t kho"},{id:"da_nhap_kho",name:"\u0110\xe3 nh\u1eadp kho"},{id:"tu_choi",name:"T\u1eeb ch\u1ed1i"}];const b=(0,h.forwardRef)(((e,t)=>{let{children:a,value:n,onChange:i,listWhere:o}=e;const[d,s]=(0,h.useState)([]),u=(0,h.useCallback)((()=>{let e=o.filter((e=>!(null!==e&&void 0!==e&&e.includes("TrangThai")))).join(" and ");(0,l.Pq)("Sale_ChuyenKho?$filter=".concat(e)).then((e=>{s(e.value)}))}),[o]);return(0,h.useImperativeHandle)(t,(()=>({updateCountRadioList(){u()}}))),(0,h.useEffect)((()=>{u()}),[u]),(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("div",{className:"form-header-tab-filter-trang-thai outline-filter-trang-thai-custom",children:D.map((e=>(0,f.jsx)(f.Fragment,{children:(0,f.jsxs)("div",{className:"item-tab-filter-trang-thai ".concat(n===e.id?"active":""),onClick:()=>i(e.id),children:[e.name," (","tat_ca"===e.id?d.length:d.filter((t=>t.TrangThai===e.id)).length,")"]})})))}),(0,f.jsx)(N.A,{className:"bg-white outline-filter-trang-thai-custom",children:a})]})})),v=h.createRef(),k=()=>v.current&&v.current.onQueryChange();class S extends h.Component{constructor(e){super(e),this.setSearchPhieuChuyenKho=e=>{13===e.charCode&&this.setState({searchPhieuChuyenKho:e.target.value},(()=>k()))},this.onChangeDate=(e,t,a)=>{this.setState({tuNgay:t?(0,T.A)(t,"yyyy-MM-dd"):null,denNgay:a?(0,T.A)(a,"yyyy-MM-dd")+"T23:59:59.000":null},(()=>k()))},this.state={openTaoPhieu:!1,modeDialog:null,phieuNhapSelected:null,dataKhoXuat:[],dataKhoNhap:[],dataDonViTinh:[],KhoXuatId:null,KhoNhapId:null,searchPhieuChuyenKho:null,trangThaiPhieu:"tat_ca",dataCountTrangThai:{yeu_cau_moi:0,da_xuat_kho:0,da_nhap_kho:0,tu_choi:0},tuNgay:(0,T.A)(new Date,"yyyy-MM-dd"),denNgay:(0,T.A)(new Date,"yyyy-MM-dd")+"T23:59:59.000"},this.Index_TaoPhieu=h.createRef(),this.FilterCard=h.createRef(),this.countTrangThai=this.countTrangThai.bind(this)}componentDidMount(){this.countTrangThai(),this.getDataDonViTinh(),this.getDataKhoXuat(),this.getDataKhoNhap()}componentDidUpdate(e,t){const{searchPhieuChuyenKho:a,KhoNhapId:h}=this.state;a===t.searchPhieuChuyenKho&&h===t.KhoNhapId||this.countTrangThai()}countTrangThai(){const{searchPhieuChuyenKho:e,KhoNhapId:t,KhoXuatId:a}=this.state,{CurrentKho:h}=this.props;let n=[];n.push("(IsDeleted eq ".concat(!1," or IsDeleted eq null)")),a&&n.push("KhoXuat_Id eq ".concat(a)),h.IsKhoTong?t&&n.push("KhoNhap_Id eq ".concat(t)):n.push("KhoNhap_Id eq ".concat(h.Id)),e&&n.push("(substringof('".concat(e,"', NguoiTao) or substringof('").concat(e,"', MaPhieu) \n or substringof('").concat(e,"', Sale_XuatHang/MaXuatHang) or substringof('").concat(e,"', Sale_NhapHang/MaNhapHang))")),(0,l.Pq)("Sale_ChuyenKho?$filter=".concat(n.join(" and "),"&$select=TrangThai"),"GET",null).then((e=>this.setState({dataCountTrangThai:{yeu_cau_moi:e.value.filter((e=>"yeu_cau_moi"===e.TrangThai)).length,da_xuat_kho:e.value.filter((e=>"da_xuat_kho"===e.TrangThai)).length,da_nhap_kho:e.value.filter((e=>"da_nhap_kho"===e.TrangThai)).length,tu_choi:e.value.filter((e=>"tu_choi"===e.TrangThai)).length}})))}getDataDonViTinh(){(0,l.Pq)("DM_DonViTinh","GET",null).then((e=>this.setState({dataDonViTinh:e.value}))).catch((e=>(0,d.a3)("Kh\xf4ng th\u1ec3 l\u1ea5y d\u1eef li\u1ec7u kho!")))}getDataKhoXuat(){(0,l.Pq)("DM_Kho?$filter=IsKhoTong eq true","GET",null).then((e=>this.setState({dataKhoXuat:e.value}))).catch((e=>(0,d.a3)("Kh\xf4ng th\u1ec3 l\u1ea5y d\u1eef li\u1ec7u kho!")))}getDataKhoNhap(){(0,l.Pq)("DM_Kho?$filter=IsKhoTong eq false or IsKhoTong eq null","GET",null).then((e=>this.setState({dataKhoNhap:e.value}))).catch((e=>(0,d.a3)("Kh\xf4ng th\u1ec3 l\u1ea5y d\u1eef li\u1ec7u kho!")))}deletePhieuChuyenKho(e){(0,l.Pq)("ChuyenKhos/XoaDonChuyenKho?idDonChuyenKho=".concat(e),"DELETE",null,!1).then((t=>(0,d.nw)("X\xf3a phi\u1ebfu chuy\u1ec3n kho "+e+" th\xe0nh c\xf4ng!","Th\xf4ng b\xe1o").then((()=>{k(),this.FilterCard.current.updateCountRadioList()})))).catch((e=>(0,d.a3)(e.Message,"Th\xf4ng b\xe1o")))}setKhoXuat(e){const{KhoNhapId:t}=this.state;e===t&&e?this.setState({KhoXuatId:null},(()=>(0,d.AB)("Kho xu\u1ea5t ph\u1ea3i kh\xe1c kho nh\u1eadp"))):this.setState({KhoXuatId:e},(()=>k()))}setKhoNhap(e){const{KhoXuatId:t}=this.state;e===t&&e?this.setState({KhoNhapId:null},(()=>(0,d.AB)("Kho nh\u1eadp ph\u1ea3i kh\xe1c kho xu\u1ea5t"))):this.setState({KhoNhapId:e},(()=>k()))}setTrangThaiPhieu(e){this.setState({trangThaiPhieu:e},(()=>k()))}render(){const{modeDialog:e,openTaoPhieu:t,phieuNhapSelected:a,dataKhoXuat:h,dataKhoNhap:l,dataDonViTinh:T,searchPhieuChuyenKho:K,KhoXuatId:_,KhoNhapId:C,trangThaiPhieu:m,tuNgay:N,denNgay:D}=this.state,{CurrentKho:S,isYeuCauChuyenKho:P,isChuyenKhoCNPhu:A}=this.props;let j=[];return"tat_ca"!==m&&j.push("TrangThai eq '".concat(m,"'")),j.push("(IsDeleted eq ".concat(!1," or IsDeleted eq null)")),_&&j.push("KhoXuat_Id eq ".concat(_)),S.IsKhoTong?C&&j.push("KhoNhap_Id eq ".concat(C)):j.push("(KhoNhap_Id eq ".concat(S.Id," or KhoXuat_Id eq ").concat(S.Id,")")),N&&D&&j.push("(NgayTao gt (datetime'".concat(N,"') and NgayTao lt (datetime'").concat(D,"'))")),K&&j.push("(substringof('".concat(K,"', NguoiTao) or substringof('").concat(K,"', MaPhieu) \n or substringof('").concat(K,"', Sale_XuatHang/MaXuatHang) or substringof('").concat(K,"', Sale_NhapHang/MaNhapHang))")),(0,f.jsxs)(u.A,{children:[(0,f.jsxs)(r.A,{NoTabs:!0,PageBaoCao:!0,children:[(0,f.jsx)(s.A,{md:"12",className:"p-0 mb-2",children:(0,f.jsx)(g.A,{showDKD:!0,title:"T\xecm ki\u1ebfm",defaultValue:K,onKeyPress:e=>this.setSearchPhieuChuyenKho(e),placeholder:"T\xecm ki\u1ebfm theo m\xe3 ch\u1ee9ng t\u1eeb"})}),(0,f.jsx)(g.A,{className:"mb-2",title:"Th\u1eddi gian",type:"date-report",onChangeDate:this.onChangeDate,status:!0,defaultValueDate:p.Eb.ThangNay}),S.IsKhoTong&&(0,f.jsx)(s.A,{md:"12",className:"p-0 mb-2",children:(0,f.jsx)(g.A,{type:"dropdown-list",title:"Kho",placeholder:"Ch\u1ecdn kho nh\u1eadp: ",options:l,valueField:"Id",textField:"Ten",value:C,onChange:e=>this.setKhoNhap(e)})})]}),(0,f.jsxs)(c.A,{NoTabs:!0,children:[x.Ze&&(0,f.jsx)(I,{}),(0,f.jsx)(b,{ref:this.FilterCard,listWhere:j,value:m,onChange:e=>this.setTrangThaiPhieu(e),children:(0,f.jsx)(n.A,{tableRef:v,title:P?"Danh s\xe1ch phi\u1ebfu y\xeau c\u1ea7u chuy\u1ec3n h\xe0ng":"Danh s\xe1ch phi\u1ebfu chuy\u1ec3n h\xe0ng",where:j.join(" and "),url:"Sale_ChuyenKho",columns:o.I,selectType:"withColumns",onAdd:{hidden:e=>"tu_choi"===m,onClick:e=>{this.setState({openTaoPhieu:!0,modeDialog:"add"},(()=>this.Index_TaoPhieu.current.reset()))}},onDelete:{disabled:e=>"yeu_cau_moi"===(null===e||void 0===e?void 0:e.TrangThai)||"tu_choi"===(null===e||void 0===e?void 0:e.TrangThai)?(null===y.lg||void 0===y.lg?void 0:y.lg.MaTaiKhoan)!==(null===e||void 0===e?void 0:e.NguoiTao):"da_nhap_kho"===(null===e||void 0===e?void 0:e.TrangThai)||"da_xuat_kho"===(null===e||void 0===e?void 0:e.TrangThai),onClick:(e,t)=>(0,d.A1)("B\u1ea1n c\xf3 ch\u1eafc ch\u1eafn mu\u1ed1n x\xf3a kh\xf4ng?","C\u1ea3nh b\xe1o").then((()=>this.deletePhieuChuyenKho(t.Id)))},onRowClick:(e,t)=>this.setState({openTaoPhieu:!0,phieuNhapSelected:t,modeDialog:"detail"})})}),t&&(0,f.jsx)(i.A,{ref:this.Index_TaoPhieu,reloadList:k,modeDialog:e,phieuNhapSelected:a,dataKhoXuat:h,dataKhoNhap:l,dataDonViTinh:T,isYeuCauChuyenKho:P,isChuyenKhoCNPhu:A,updateCountRadioList:()=>this.FilterCard.current.updateCountRadioList(),openTaoPhieu:t,CurrentKho:S,onCloseTaoPhieu:()=>this.setState({openTaoPhieu:!1})})]})]})}}},43116:(e,t,a)=>{a.d(t,{I:()=>o});a(9950);var h=a(78873),n=a(44414);const i=e=>{switch(e.trangThai){case"yeu_cau_moi":return(0,n.jsx)(h.A,{color:"primary",children:"Y\xeau c\u1ea7u m\u1edbi"});case"da_xuat_kho":return(0,n.jsx)(h.A,{color:"info",children:"\u0110\xe3 xu\u1ea5t kho"});case"da_nhap_kho":return(0,n.jsx)(h.A,{color:"success",children:"\u0110\xe3 nh\u1eadp kho"});case"tu_choi":return(0,n.jsx)(h.A,{color:"danger",children:"T\u1eeb ch\u1ed1i"});default:return""}},o=[{field:"Id",type:"numeric",dataID:!0,hidden:!0,editable:"never"},{title:"M\xe3 ch\u1ee9ng t\u1eeb",field:"MaPhieu",type:"string",searchable:!0,editable:"never",cellStyle:{textAlign:"left",width:100}},{title:"Ng\xe0y ch\u1ee9ng t\u1eeb",field:"NgayTao",type:"datetime",editable:"never",defaultSort:"desc",cellStyle:{textAlign:"left",width:130}},{title:"Ng\u01b0\u1eddi t\u1ea1o",field:"NguoiTao",type:"string",searchable:!0,hidden:!0,editable:"never",cellStyle:{textAlign:"left"}},{title:"M\xe3 ch\u1ee9ng t\u1eeb xu\u1ea5t",field:"Sale_XuatHang.MaXuatHang",type:"string",dataRef:["PhieuXuat_Id"],dataCheck:!0,hidden:!0,searchable:!0,cellStyle:{textAlign:"left"}},{title:"M\xe3 ch\u1ee9ng t\u1eeb nh\u1eadp",field:"Sale_NhapHang.MaNhapHang",type:"string",dataRef:["PhieuNhap_Id"],dataCheck:!0,hidden:!0,searchable:!0,cellStyle:{textAlign:"left"}},{title:"T\u1eeb kho",field:"DM_Kho.Ten",type:"string",dataRef:["KhoXuat_Id"],dataCheck:!0,searchable:!0,cellStyle:{textAlign:"left"}},{field:"DM_Kho.Id",type:"string",hidden:!0},{field:"DM_Kho1.Id",type:"string",hidden:!0},{title:"\u0110\u1ebfn kho",field:"DM_Kho1.Ten",type:"string",dataRef:["KhoNhap_Id"],dataCheck:!0,searchable:!0,cellStyle:{textAlign:"left"}},{title:"Tr\u1ea1ng th\xe1i",field:"TrangThai",type:"string",editable:"never",cellStyle:{textAlign:"center"},render:e=>(0,n.jsx)(i,{trangThai:e.TrangThai})},{title:"Ghi ch\xfa",field:"GhiChu",type:"string",editable:"never",hidden:!0,cellStyle:{textAlign:"left",width:"200px"}},{title:"Chi ti\u1ebft chuy\u1ec3n kho",field:"Sale_ChiTietChuyenKho.DM_SanPhamDichVu.*",type:"string",editable:"never",hidden:!0},{title:"Chi ti\u1ebft chuy\u1ec3n kho",field:"Sale_ChiTietChuyenKho.*",type:"string",editable:"never",hidden:!0},{title:"IsDelete",field:"IsDeleted",type:"boolean",hidden:!0,editable:"never"},{title:"L\xfd do",field:"LyDo",type:"string",hidden:!0,editable:"never"}]},15171:(e,t,a)=>{a.r(t),a.d(t,{default:()=>d});var h=a(9950),n=a(56188),i=a(76115),o=a(53744),l=a(44414);class d extends h.Component{constructor(e){super(e),this.state={}}render(){return(0,l.jsx)(h.Fragment,{children:o.b9.DiemKinhDoanhId&&o.b9.Kho_Id&&!o.b9.IsKhoTong?(0,l.jsx)(n.A,{isYeuCauChuyenKho:!0,CurrentKho:{Id:o.b9.Kho_Id,IsKhoTong:o.b9.IsKhoTong,DiemKinhDoanh_Id:o.b9.DiemKinhDoanhId}}):(0,l.jsx)(i.A,{color:"warning",children:"Ch\u1ee9c n\u0103ng y\xeau c\u1ea7u chuy\u1ec3n kho ch\u1ec9 d\xe0nh cho kho chi nh\xe1nh"})})}}}}]);