????

Your IP : 3.14.12.254


Current Path : C:/inetpub/vhost/lantha.gdtsolutions.vn/wwwtest/wwwroot/static/js/
Upload File :
Current File : C:/inetpub/vhost/lantha.gdtsolutions.vn/wwwtest/wwwroot/static/js/4219.e586a163.chunk.js

"use strict";(self.webpackChunkgdt=self.webpackChunkgdt||[]).push([[2522,4219],{15004:(e,t,h)=>{h.d(t,{A:()=>I});var a=h(9950),n=h(10077),i=h(55413),o=h(1254),l=h(44414);const s=e=>{switch(e.trangThai){case"yeu_cau_moi":return(0,l.jsx)(o.A,{color:"primary",children:"Y\xeau c\u1ea7u m\u1edbi"});case"da_xuat_kho":return(0,l.jsx)(o.A,{color:"info",children:"\u0110\xe3 xu\u1ea5t kho"});case"da_nhap_kho":return(0,l.jsx)(o.A,{color:"success",children:"\u0110\xe3 nh\u1eadp kho"});case"tu_choi":return(0,l.jsx)(o.A,{color:"danger",children:"T\u1eeb ch\u1ed1i"});default:return""}},u=[{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"}},{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,l.jsx)(s,{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"}];var d=h(4370),r=h(67116),c=h(23931),g=h(30616),p=h(28412),T=h(32385),K=h(62181),y=h(39051),_=h(18383);const C=a.createRef(),f=()=>C.current&&C.current.onQueryChange();class I extends a.Component{constructor(e){super(e),this.setSearchPhieuChuyenKho=e=>{13===e.charCode&&this.setState({searchPhieuChuyenKho:e.target.value},(()=>f()))},this.onChangeDate=(e,t,h)=>{this.setState({tuNgay:t?(0,_.A)(t,"yyyy-MM-dd"):null,denNgay:h?(0,_.A)(h,"yyyy-MM-dd")+"T23:59:59.000":null},(()=>f()))},this.state={openTaoPhieu:!1,modeDialog:null,phieuNhapSelected:null,dataKhoXuat:[],dataKhoNhap:[],dataDonViTinh:[],KhoXuatId:null,KhoNhapId:null,searchPhieuChuyenKho:null,trangThaiPhieu:"yeu_cau_moi",dataCountTrangThai:{yeu_cau_moi:0,da_xuat_kho:0,da_nhap_kho:0,tu_choi:0}},this.Index_TaoPhieu=a.createRef(),this.FilterCard=a.createRef(),this.countTrangThai=this.countTrangThai.bind(this)}componentDidMount(){this.countTrangThai(),this.getDataDonViTinh(),this.getDataKhoXuat(),this.getDataKhoNhap()}componentDidUpdate(e,t){const{searchPhieuChuyenKho:h,KhoNhapId:a}=this.state;h===t.searchPhieuChuyenKho&&a===t.KhoNhapId||this.countTrangThai()}countTrangThai(){const{searchPhieuChuyenKho:e,KhoNhapId:t,KhoXuatId:h}=this.state,{CurrentKho:a}=this.props;let n=[];n.push("(IsDeleted eq false or IsDeleted eq null)"),h&&n.push(`KhoXuat_Id eq ${h}`),a.IsKhoTong?t&&n.push(`KhoNhap_Id eq ${t}`):n.push(`KhoNhap_Id eq ${a.Id}`),e&&n.push(`(substringof('${e}', NguoiTao) or substringof('${e}', MaPhieu) \n    or substringof('${e}', Sale_XuatHang/MaXuatHang) or substringof('${e}', Sale_NhapHang/MaNhapHang))`),(0,d.Pq)(`Sale_ChuyenKho?$filter=${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,d.Pq)("DM_DonViTinh","GET",null).then((e=>this.setState({dataDonViTinh:e.value}))).catch((e=>(0,r.a3)("Kh\xf4ng th\u1ec3 l\u1ea5y d\u1eef li\u1ec7u kho!")))}getDataKhoXuat(){(0,d.Pq)("DM_Kho?$filter=IsKhoTong eq true","GET",null).then((e=>this.setState({dataKhoXuat:e.value}))).catch((e=>(0,r.a3)("Kh\xf4ng th\u1ec3 l\u1ea5y d\u1eef li\u1ec7u kho!")))}getDataKhoNhap(){(0,d.Pq)("DM_Kho?$filter=IsKhoTong eq false or IsKhoTong eq null","GET",null).then((e=>this.setState({dataKhoNhap:e.value}))).catch((e=>(0,r.a3)("Kh\xf4ng th\u1ec3 l\u1ea5y d\u1eef li\u1ec7u kho!")))}deletePhieuChuyenKho(e){(0,d.Pq)(`ChuyenKhos/XoaDonChuyenKho?idDonChuyenKho=${e}`,"DELETE",null,!1).then((t=>(0,r.nw)("X\xf3a phi\u1ebfu chuy\u1ec3n kho "+e+" th\xe0nh c\xf4ng!","Th\xf4ng b\xe1o").then((()=>{f(),this.FilterCard.current.updateCountRadioList()})))).catch((e=>(0,r.a3)(e.Message,"Th\xf4ng b\xe1o")))}setKhoXuat(e){const{KhoNhapId:t}=this.state;e===t&&e?this.setState({KhoXuatId:null},(()=>(0,r.AB)("Kho xu\u1ea5t ph\u1ea3i kh\xe1c kho nh\u1eadp"))):this.setState({KhoXuatId:e},(()=>f()))}setKhoNhap(e){const{KhoXuatId:t}=this.state;e===t&&e?this.setState({KhoNhapId:null},(()=>(0,r.AB)("Kho nh\u1eadp ph\u1ea3i kh\xe1c kho xu\u1ea5t"))):this.setState({KhoNhapId:e},(()=>f()))}setTrangThaiPhieu(e){this.setState({trangThaiPhieu:e},(()=>f()))}render(){const{modeDialog:e,openTaoPhieu:t,phieuNhapSelected:h,dataKhoXuat:a,dataKhoNhap:s,dataDonViTinh:d,searchPhieuChuyenKho:_,KhoXuatId:I,KhoNhapId:x,trangThaiPhieu:N,tuNgay:b,denNgay:D}=this.state,{CurrentKho:k}=this.props;let m=[];N&&m.push(`TrangThai eq '${N}'`),m.push("(IsDeleted eq false or IsDeleted eq null)"),I&&m.push(`KhoXuat_Id eq ${I}`),k.IsKhoTong?x&&m.push(`KhoNhap_Id eq ${x}`):m.push(`KhoNhap_Id eq ${k.Id}`),b&&D&&m.push(`(NgayTao gt (datetime'${b}') and NgayTao lt (datetime'${D}'))`),_&&m.push(`(substringof('${_}', NguoiTao) or substringof('${_}', MaPhieu) \n    or substringof('${_}', Sale_XuatHang/MaXuatHang) or substringof('${_}', Sale_NhapHang/MaNhapHang))`);let S=m.length>1?m.slice(1).join(" and "):"";return(0,l.jsxs)(g.A,{children:[(0,l.jsxs)(p.A,{NoTabs:!0,PageBaoCao:!0,children:[(0,l.jsx)(c.A,{md:"12",className:"p-0 mb-2",children:(0,l.jsx)(K.A,{showDKD:!0,title:"T\xecm ki\u1ebfm",defaultValue:_,onKeyPress:e=>this.setSearchPhieuChuyenKho(e),placeholder:"T\xecm ki\u1ebfm theo m\xe3 ch\u1ee9ng t\u1eeb"})}),(0,l.jsx)(K.A,{className:"mb-2",title:"Th\u1eddi gian",type:"date-report",onChangeDate:this.onChangeDate,status:!0,defaultValueDate:y.Eb.ToanThoiGian}),(0,l.jsx)(c.A,{md:"12",className:"p-0 mb-2",children:(0,l.jsx)(K.A,{ref:this.FilterCard,type:"radio-list",title:"Tr\u1ea1ng th\xe1i",dataCount:{url:"Sale_ChuyenKho",filterBy:"TrangThai",where:S},data:[{label:(0,l.jsx)(o.A,{color:"primary",children:"Y\xeau c\u1ea7u m\u1edbi"}),value:"yeu_cau_moi"},{label:(0,l.jsx)(o.A,{color:"info",children:"\u0110\xe3 xu\u1ea5t kho "}),value:"da_xuat_kho"},{label:(0,l.jsx)(o.A,{color:"success",children:"\u0110\xe3 nh\u1eadp kho"}),value:"da_nhap_kho"},{label:(0,l.jsx)(o.A,{color:"danger",children:"T\u1eeb ch\u1ed1i"}),value:"tu_choi"}],value:N,onChange:(e,t)=>this.setTrangThaiPhieu(t)})}),k.IsKhoTong&&(0,l.jsx)(c.A,{md:"12",className:"p-0 mb-2",children:(0,l.jsx)(K.A,{type:"dropdown-list",title:"Kho",placeholder:"Ch\u1ecdn kho nh\u1eadp: ",options:s,valueField:"Id",textField:"Ten",value:x,onChange:e=>this.setKhoNhap(e)})})]}),(0,l.jsxs)(T.A,{NoTabs:!0,children:[(0,l.jsx)(n.A,{tableRef:C,title:"Danh s\xe1ch phi\u1ebfu chuy\u1ec3n kho",where:m.join(" and "),url:"Sale_ChuyenKho",columns:u,selectType:"withColumns",onAdd:{hidden:e=>"tu_choi"===N,onClick:e=>{this.setState({openTaoPhieu:!0,modeDialog:"add"},(()=>this.Index_TaoPhieu.current.reset()))}},onEdit:{disabled:e=>k.IsKhoTong||"da_xuat_kho"===e.TrangThai||"da_nhap_kho"===e.TrangThai,onClick:(e,t)=>this.setState({openTaoPhieu:!0,phieuNhapSelected:t,modeDialog:"edit"})},onDelete:{disabled:e=>k.IsKhoTong||"yeu_cau_moi"!==e.TrangThai||"tu_choi"===e.TrangThai,onClick:(e,t)=>(0,r.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,l.jsx)(i.A,{ref:this.Index_TaoPhieu,reloadList:f,modeDialog:e,phieuNhapSelected:h,dataKhoXuat:a,dataKhoNhap:s,dataDonViTinh:d,updateCountRadioList:()=>this.FilterCard.current.updateCountRadioList(),openTaoPhieu:t,CurrentKho:k,onCloseTaoPhieu:()=>this.setState({openTaoPhieu:!1})})]})]})}}},81401:(e,t,h)=>{h.r(t),h.d(t,{default:()=>s});var a=h(9950),n=h(15004),i=h(76115),o=h(53744),l=h(44414);class s extends a.Component{constructor(e){super(e)}render(){return(0,l.jsx)(a.Fragment,{children:o.b9.DiemKinhDoanhId&&o.b9.Kho_Id&&o.b9.IsKhoTong?(0,l.jsx)(n.A,{CurrentKho:{Id:o.b9.Kho_Id,IsKhoTong:o.b9.IsKhoTong}}):(0,l.jsx)(i.A,{color:"warning",children:"Ch\u1ee9c n\u0103ng chuy\u1ec3n kho ch\u1ec9 d\xe0nh cho kho t\u1ed5ng"})})}}}}]);