????
Current Path : C:/inetpub/vhost/qlk.nextform.vn/www/wwwroot/static/js/ |
Current File : C:/inetpub/vhost/qlk.nextform.vn/www/wwwroot/static/js/1530.8311e431.chunk.js |
(self.webpackChunkgdt=self.webpackChunkgdt||[]).push([[1530,7556],{38886:(e,n,t)=>{"use strict";t.d(n,{A:()=>d});var i,a=t(57528),s=(t(9950),t(86006)),h=t(36841),l=t(44414);const r=e=>{let{label:n,value:t,className:i,style:a}=e;return(0,l.jsxs)(o,{style:a,className:"comp-thanh-tien "+i,children:[(0,l.jsxs)("span",{className:"mr-2",children:[n,":"]}),(0,l.jsx)("span",{children:(0,h.vv)(t)})]})},d=r,o=s.Ay.div(i||(i=(0,a.A)(["\n span:first-child{\n font-weight: 500\n }\n span:last-child{\n letter-spacing: 0.2px\n }\n"])));r.defaultProps={className:"pull-right",label:"Th\xe0nh ti\u1ec1n",value:0}},20287:(e,n,t)=>{"use strict";t.r(n),t.d(n,{default:()=>ge});var i=t(9950),a=t(76115),s=t(53744),h=t(15347),l=t.n(h),r=t(85560),d=t(28412),o=t(62181),c=t(32385),u=t(30616),g=t(44414);const x=[{field:"Id",type:"numeric",dataID:!0,hidden:!0,editable:"never"},{title:"M\xe3 ch\u1ee9ng t\u1eeb",field:"MaXuatHang",type:"string",searchable:!0,editable:"never",cellStyle:{textAlign:"left"}},{title:"Ng\u01b0\u1eddi t\u1ea1o",field:"SYS_TaiKhoan.TenHienThi",type:"string",searchable:!0,hidden:!1,editable:"never",cellStyle:{textAlign:"left"}},{title:"Ng\xe0y ch\u1ee9ng t\u1eeb",field:"NgayXuat",type:"datetime",editable:"never",defaultSort:"desc",cellStyle:{textAlign:"left"}},{title:"Ng\u01b0\u1eddi t\u1ea1o",field:"NguoiTao",type:"string",searchable:!0,editable:"never",hidden:!0,cellStyle:{textAlign:"left"}},{title:"M\xe3 \u0111\u01a1n h\xe0ng",hidden:!0,field:"Sale_DonHang.MaDonHang",type:"string",dataRef:["DonHangId"],dataCheck:!0,searchable:!0,cellStyle:{textAlign:"left"}},{title:"Kho xu\u1ea5t",field:"Sale_ChiTietXuatHang.DM_Kho.*",type:"string",searchable:!0,cellStyle:{textAlign:"left"},editable:"never",render:e=>{var n;return(0,g.jsx)("span",{children:null===(n=e.Sale_ChiTietXuatHang[0])||void 0===n?void 0:n.DM_Kho.Ten})}},{title:"H\xecnh th\u1ee9c thanh to\xe1n",hidden:!0,field:"DM_HinhThucThanhToan.Ten",type:"string",dataRef:["HinhThucThanhToan_ID"],dataCheck:!0,searchable:!0,cellStyle:{textAlign:"left"}},{title:"Th\xe0nh ti\u1ec1n",field:"ThanhTien",type:"currency",editable:"never",cellStyle:{textAlign:"right"}},{title:"Ghi ch\xfa",hidden:!0,field:"GhiChu",type:"string",editable:"never",cellStyle:{textAlign:"left",width:"200px"}},{title:"\u0110\u01a1n h\xe0ng",field:"Sale_DonHang.*",type:"string",editable:"never",hidden:!0},{title:"Chi ti\u1ebft xu\u1ea5t h\xe0ng",field:"Sale_ChiTietXuatHang.*",type:"string",editable:"never",hidden:!0},{title:"Chi ti\u1ebft xu\u1ea5t h\xe0ng",field:"Sale_ChiTietXuatHang.DM_SanPhamDichVu.*",type:"string",editable:"never",hidden:!0},{title:"Chi ti\u1ebft xu\u1ea5t h\xe0ng",field:"Sale_ChiTietXuatHang.DM_DonViTinh.*",type:"string",editable:"never",hidden:!0},{title:"IsDeleted",field:"IsDeleted",type:"boolean",hidden:!0,editable:"never",cellStyle:{textAlign:"center"}},{title:"TuDong",field:"TuDong",type:"boolean",hidden:!0,editable:"never",cellStyle:{textAlign:"center"}}];var m,p=t(18849),j=t(70349),T=t(23931),f=t(82376),y=t(73613),v=t(50651),D=t(75490),b=t(76991),N=t(27220),A=t(36841),C=t(67116),H=t(4370),S=t(38886),P=t(45248),M=t(22161),I=t(57528),_=t(86006),k=t(85148);const G=(0,i.forwardRef)(((e,n)=>{const{OnDeleteChiTiet:t,OnReloadListDonHang:a,OnAddDataListHoaDon:s,isDetail:h}=e,[r,d]=(0,i.useState)([]),[o,c]=(0,i.useState)(!1),[u,x]=l()(null,(e=>{c(!!e)}));(0,i.useEffect)((()=>{s&&s(r)}),[r]),(0,i.useImperativeHandle)(n,(()=>({setData(e){d(e)},add(e){d([...r,e])},checkExsistDonHang:e=>r.find((n=>n.MaDonHang===e.MaDonHang)),detele(e){d(r.filter((n=>n.MaDonHang!==e.MaDonHang))),t&&t(e)},deteleAll(){d([])}})));const m=e=>{let{Item:t}=e;return(0,g.jsx)(w,{onClick:()=>{a&&a(),n.current.detele(t)},children:(0,g.jsx)(y.A,{fa:"times-circle"})})},p=r.length?r.map((e=>(0,g.jsx)(g.Fragment,{children:(0,g.jsxs)("span",{style:{position:"relative"},children:[(0,g.jsx)("span",{style:{cursor:"pointer"},onClick:()=>(e=>{let n="DonHangs?$expand=DM_DiemKinhDoanh,DM_HinhThucThanhToan,Sale_DonTraHang&$select=Id,NgayTao,NguoiTao,MaDonHang,DM_DiemKinhDoanh/Ten,DM_DiemKinhDoanh/Id,TienHang,GiamGia,PTGiamGia,ThanhTien,DM_HinhThucThanhToan/Ten,DM_HinhThucThanhToan/Id,Phieu_Id,Sale_DonTraHang/*,DaTraHang,IsDeleted,LyDoHuy\n &$filter=MaDonHang eq '".concat(e,"'");(0,H.Pq)(n,"GET",null).then((e=>x(e.value[0]))).catch((e=>{(0,C.a3)("L\u1ea5y d\u1eef li\u1ec7u \u0111\u01a1n h\xe0ng kh\xf4ng th\xe0nh c\xf4ng!","Th\xf4ng b\xe1o")}))})(e.MaDonHang),children:e.MaDonHang}),!h&&(0,g.jsx)(m,{Item:e})]})}))):[];return(0,g.jsxs)(i.Fragment,{children:[(0,g.jsx)(j.A,{children:(0,g.jsxs)(T.A,{md:"12",children:[(0,g.jsx)("label",{style:{fontWeight:500},className:"mb-0",children:"Danh s\xe1ch \u0111\u01a1n h\xe0ng: "}),(0,g.jsxs)("span",{children:[" ",p.length?p.map(((e,n)=>{let t=e;return n!==p.length-1&&(t=(0,g.jsxs)(i.Fragment,{children:[t,", "]},n)),t})):"Ch\u01b0a c\xf3"]})]})}),o&&u&&(0,g.jsx)(k.A,{className:"Module-XH-xem-detail-don-hang",isDetailTheKho:!0,data:u,IdDonHang:u.Id,openDetail:o,closeDetail:()=>x(null)})]})})),w=_.Ay.span(m||(m=(0,I.A)(["\nposition: absolute;\n right: -8px;\n top: -14px;\n color: red;\n cursor: pointer;\n"])));var X=t(53832),L=t(18503),K={MaXuatHang:{field_name:"MaXuatHang",title:"M\xe3 ch\u1ee9ng t\u1eeb:",displayWarning:"M\xe3 ch\u1ee9ng t\u1eeb",type:"label"},PhuongThucGiaoHang:{field_name:"PhuongThucGiaoHang",title:"Ph\u01b0\u01a1ng th\u1ee9c giao h\xe0ng:",displayWarning:"Ph\u01b0\u01a1ng th\u1ee9c giao h\xe0ng",type:"radio-list",required:!0,data:[{value:"1",label:"C\xf3 nh\xe2n vi\xean giao h\xe0ng"},{value:"0",label:"Kh\xe1ch h\xe0ng t\u1ef1 nh\u1eadn"}]},NhanVienGiaoHang_Id:{field_name:"NhanVienGiaoHang_Id",title:"Nh\xe2n vi\xean giao h\xe0ng:",displayWarning:"Nh\xe2n vi\xean giao h\xe0ng",type:"data-select",required:!0,dataSelect:{url:"DM_NhanVien",where:"MaPhongBan eq '".concat(L.I.GiaoHang,"' and IsDeleted ne true"),column:["Id","TenNhanVien"],value_field:"Id",text_field:"TenNhanVien"}},NgayXuat:{field_name:"NgayXuat",title:"Ng\xe0y ch\u1ee9ng t\u1eeb:",displayWarning:"Ng\xe0y ch\u1ee9ng t\u1eeb",type:"datetime",icon:!0,isDetail:!0},DonHang_TuNgay:{field_name:"DonHang_TuNgay",title:"T\u1eeb ng\xe0y:",type:"datetime",icon:!0,isDetail:!0,placeholder:"T\u1eeb ng\xe0y"},DonHang_DenNgay:{field_name:"DonHang_DenNgay",title:"\u0110\u1ebfn ng\xe0y:",type:"datetime",icon:!0,isDetail:!0,placeholder:"\u0110\u1ebfn ng\xe0y"},ThanhTien:{field_name:"ThanhTien",title:"Th\xe0nh ti\u1ec1n:",displayWarning:"Th\xe0nh ti\u1ec1n",type:"label"},GhiChu:{field_name:"GhiChu",title:"Ghi ch\xfa:",displayWarning:"Ghi ch\xfa",type:"textarea",rows:"5"},LoaiDonHang:{field_name:"LoaiDonHang",title:"Lo\u1ea1i \u0111\u01a1n h\xe0ng:",type:"data-select",dataSelect:{options:[{MaLoai:"khach-le",TenLoai:"\u0110\u01a1n b\xe1n l\u1ebb"},{MaLoai:"khach-quen",TenLoai:"\u0110\u01a1n b\xe1n s\u1ec9"}],value_field:"MaLoai",text_field:"TenLoai",placeholder:"Ch\u1ecdn lo\u1ea1i \u0111\u01a1n h\xe0ng..."}}};const E=e=>{const{data:n,onChange:t,isDetail:i}=e;return(0,g.jsxs)(j.A,{md:"6",className:"mb-0",children:[(0,g.jsxs)(T.A,{children:[i&&(0,g.jsx)(X.A,{data:K.MaXuatHang,value:n.MaXuatHang,isDetail:i}),(0,g.jsx)(X.A,{data:K.NgayXuat,value:(null===n||void 0===n?void 0:n.NgayXuat)||new Date,inline:!!i}),!i&&(0,g.jsx)(X.A,{data:K.PhuongThucGiaoHang,value:null===n||void 0===n?void 0:n.PhuongThucGiaoHang,onChange:t,inline:!1}),!i&&"1"===(null===n||void 0===n?void 0:n.PhuongThucGiaoHang)&&(0,g.jsx)(X.A,{data:K.NhanVienGiaoHang_Id,value:null===n||void 0===n?void 0:n.NhanVienGiaoHang_Id,onChange:t,isDetail:i})]}),(0,g.jsxs)(T.A,{children:[i?n.NhanVienGiaoHang_Id?(0,g.jsx)(X.A,{data:K.NhanVienGiaoHang_Id,value:null===n||void 0===n?void 0:n.NhanVienGiaoHang_Id,onChange:t,isDetail:i}):(0,g.jsxs)(j.A,{children:[(0,g.jsx)(T.A,{md:"4",children:(0,g.jsx)("span",{style:{fontWeight:500},children:"Nh\xe2n vi\xean giao h\xe0ng:"})}),(0,g.jsx)(T.A,{md:"8",children:"Kh\xf4ng c\xf3"})]}):null,(0,g.jsx)(X.A,{data:K.GhiChu,value:null===n||void 0===n?void 0:n.GhiChu,isDetail:i,onChange:t})]})]})};var V=t(58195),O=t(14113),B=t(99308),F=t(21205);function q(e){const{openXemPhieu:n,closeXemPhieu:t,dataXemPhieu:a,data:s}=e;return(0,g.jsxs)(V.A,{zIndex:1300,isOpen:n,toggle:t,size:"lg",children:[(0,g.jsx)(O.A,{toggle:t,children:"Xem phi\u1ebfu"}),(0,g.jsxs)(B.A,{children:[(0,g.jsx)("div",{className:"text-center mb-3",style:{fontSize:"20px"},children:(0,g.jsx)("b",{children:"PHI\u1ebeU XU\u1ea4T H\xc0NG THEO NVGH"})}),a&&(0,g.jsxs)(F.A,{size:"sm",bordered:!0,className:"table-phieu-xuat",children:[(0,g.jsx)("thead",{children:(0,g.jsxs)("tr",{children:[(0,g.jsx)("th",{children:"STT"}),(0,g.jsx)("th",{children:"M\xe3 h\xe0ng"}),(0,g.jsx)("th",{children:"T\xean h\xe0ng"}),(0,g.jsx)("th",{children:"H\xe0ng \u0111i"}),(0,g.jsx)("th",{children:"H\xe0ng v\u1ec1"}),(0,g.jsx)("th",{children:"Th\u1ef1c \u0111i"})]})}),(0,g.jsxs)("tbody",{children:[a.listNhomLoaiSanPham.map(((e,n)=>(0,g.jsxs)(i.Fragment,{children:[e.listChiTietPhieuXuat.map(((e,n)=>(0,g.jsxs)("tr",{children:[(0,g.jsx)("td",{className:"td-stt",children:n+1}),(0,g.jsx)("td",{children:e.MaSanPham}),(0,g.jsx)("td",{children:e.TenSanPham}),(0,g.jsx)("td",{className:"text-center",children:e.SoLuongThungChai}),(0,g.jsx)("td",{}),(0,g.jsx)("td",{})]},n))),(0,g.jsxs)("tr",{children:[(0,g.jsx)("td",{}),(0,g.jsx)("td",{}),(0,g.jsx)("td",{children:(0,g.jsx)("b",{children:e.TenLoai})}),(0,g.jsx)("td",{className:"text-center",children:(0,g.jsx)("b",{children:e.TongHang})}),(0,g.jsx)("td",{}),(0,g.jsx)("td",{})]},n)]}))),(0,g.jsxs)("tr",{children:[(0,g.jsx)("td",{}),(0,g.jsx)("td",{}),(0,g.jsx)("td",{children:(0,g.jsx)("b",{children:"T\u1ed4NG H\xc0NG:"})}),(0,g.jsx)("td",{className:"text-center",children:(0,g.jsx)("b",{children:a.TongHangThungChai})}),(0,g.jsx)("td",{}),(0,g.jsx)("td",{})]}),(0,g.jsxs)("tr",{children:[(0,g.jsx)("td",{})," ",(0,g.jsx)("td",{})," ",(0,g.jsx)("td",{children:(0,g.jsx)("b",{children:"T\u1ed4NG T\u1ea2I TR\u1eccNG:"})})," ",(0,g.jsx)("td",{})," ",(0,g.jsx)("td",{})," ",(0,g.jsx)("td",{})]}),(0,g.jsxs)("tr",{children:[(0,g.jsx)("td",{}),(0,g.jsx)("td",{}),(0,g.jsx)("td",{children:(0,g.jsx)("b",{children:"T\u1ed5ng s\u1ed1:"})}),(0,g.jsx)("td",{className:"text-center",children:(0,g.jsx)("b",{children:a.TongHangThungChai})}),(0,g.jsx)("td",{}),(0,g.jsx)("td",{})]})]})]}),(0,g.jsxs)("div",{children:[(0,g.jsxs)("b",{children:["Xu\u1ea5t cho ",s.thongTinHoaDon.length," h\xf3a \u0111\u01a1n: "]}),s.thongTinHoaDon.map((e=>(0,g.jsxs)("span",{style:{marginRight:12},children:[e.MaDonHang,";"]})))]})]})]})}const R=(0,i.forwardRef)(((e,n)=>{const t=(0,i.useRef)(),{OnAddDataChiTiet:a,OnAddDataListHoaDon:s,ID:h,toggleLDH:l,OnToggleLDH:r,OnReloadListDonHang:d,isDetail:o,data:c,onChange:u}=e,[x,m]=(0,i.useState)([]),[j,T]=(0,i.useState)([]),[f,y]=(0,i.useState)([]),[I,_]=(0,i.useState)(!1),[k,w]=(0,i.useState)(null);(0,i.useEffect)((()=>{X()}),[]),(0,i.useEffect)((()=>{h&&(0,H.Pq)("XuatHang/GetPhieuXuat?phieuXuatId=".concat(h),"GET",null,!1).then((e=>{m(e.ChiTiet),t.current.setData(e.HoaDon)})).catch((e=>(0,C.a3)("Kh\xf4ng th\u1ec3 t\u1ea3i d\u1eef li\u1ec7u chi ti\u1ebft khuy\u1ebfn m\xe3i","Th\xf4ng b\xe1o")))}),[h]),(0,i.useEffect)((()=>{T(x),a&&a(x)}),[x]);const X=()=>{(0,H.Pq)("XuatHang/GetDonHangs?khachHang=","GET",null,!1).then((e=>y(e))).catch((e=>(0,C.a3)("Kh\xf4ng th\u1ec3 t\u1ea3i d\u1eef li\u1ec7u xu\u1ea5t h\xe0ng","Th\xf4ng b\xe1o")))};(0,i.useImperativeHandle)(n,(()=>({checkExsistDonHang:e=>t.current.checkExsistDonHang(e),add(e){if(this.checkExsistDonHang(e))(0,C.AB)("\u0110\u01a1n h\xe0ng n\xe0y \u0111\xe3 \u0111\u01b0\u1ee3c th\xeam","Th\xf4ng b\xe1o");else{t.current.add(e);let n=x.slice();e.ChiTiet.length&&e.ChiTiet.forEach(((t,i)=>{let{value:a,index:s}=L(n,t);a?(a.SoLuong=parseFloat(a.SoLuong)+parseFloat(t.SoLuong),n[s]=a):n.push(t),i===e.ChiTiet.length-1&&m(n.sort((0,A.qx)("TenSanPham","desc")))}))}},deteleAllChiTiet(){t.current.deteleAll(),m([])}})));const L=(e,n)=>({value:e.find((e=>e.SanPhamDichVuId===n.SanPhamDichVuId)),index:e.findIndex((e=>e.SanPhamDichVuId===n.SanPhamDichVuId))});return(0,g.jsxs)(v.A,{children:[(0,g.jsxs)(D.A,{children:[(0,g.jsx)("b",{children:"Th\xf4ng tin phi\u1ebfu xu\u1ea5t"}),(0,g.jsx)(P.A,{displayColTimKiemSanPham:l,toggledisplayColTimKiemSanPham:()=>r&&r()}),(0,g.jsx)(M.A,{className:"mr-2",onSearch:e=>(e=>{let n=x.filter((n=>n.TenSanPham.toUpperCase().includes(e.toUpperCase().trim())));T(n)})(e)})]}),(0,g.jsxs)(b.A,{children:[(0,g.jsx)(E,{data:c,onChange:u,isDetail:o}),(0,g.jsx)(G,{ref:t,isDetail:o,OnReloadListDonHang:()=>d&&d(),OnDeleteChiTiet:e=>(async e=>{let n=f.slice().find((n=>n.MaDonHang===e.MaDonHang)),t=x.map((e=>e));n.ChiTiet.forEach((async(n,i)=>{let{value:a}=await L(t,n);if(a){let e=parseFloat(a.SoLuong||0),i=parseFloat(n.SoLuong||0);a.SoLuong=e-i,0===a.SoLuong&&(t=t.filter((e=>0!==e.SoLuong)))}i===e.ChiTiet.length-1&&m(t)}))})(e),OnAddDataListHoaDon:e=>s&&s(e)}),(0,g.jsxs)("table",{width:"100%",children:[(0,g.jsx)("thead",{children:(0,g.jsxs)("tr",{children:[(0,g.jsx)("td",{children:"STT"}),(0,g.jsx)("td",{children:"M\xe3 h\xe0ng"}),(0,g.jsx)("td",{children:"T\xean h\xe0ng"}),(0,g.jsx)("td",{children:"\u0110VT"}),(0,g.jsx)("td",{children:"S\u1ed1 l\u01b0\u1ee3ng"})]})}),(0,g.jsx)("tbody",{children:j&&j.map(((e,n)=>(0,g.jsxs)("tr",{children:[(0,g.jsx)("td",{children:n+1}),(0,g.jsx)("td",{className:"text-left",children:e.MaSanPham}),(0,g.jsx)("td",{className:"text-left",children:e.TenSanPham}),(0,g.jsx)("td",{className:"text-left",children:e.DonViTinh}),(0,g.jsxs)("td",{className:"text-right",style:{maxWidth:"100px"},children:[" ",e.SoLuong]})]},n)))})]})]}),(0,g.jsxs)(N.A,{className:j&&0!==j.length?"card-footer-xuat-hang":"",children:[j&&0!==j.length&&!o&&(0,g.jsx)(p.A,{color:"primary",onClick:()=>(e=>{let n={...e,chiTietPhieuXuat:e.chiTietPhieuXuat.filter((e=>0!==e.SoLuong))};(0,H.Pq)("XuatHang/XemPhieuXuatHang","POST",JSON.stringify(n),!1).then((e=>{_(!0),w(e)})).catch((e=>(0,C.a3)(e.Message)))})(c),children:"Xem phi\u1ebfu"}),(0,g.jsx)(S.A,{value:c.ThanhTien||0})]}),I&&(0,g.jsx)(q,{openXemPhieu:I,closeXemPhieu:()=>_(!1),dataXemPhieu:k,data:c})]})}));t(29079);var U=t(18383),z=t(78873);const W=(0,i.forwardRef)(((e,n)=>{const t=e=>{if(115===e.which)return e.preventDefault(),!1;13===e.which?(x&&(null===x||void 0===x?void 0:x.length)>0&&h(x[p]),L()):40===e.which?p<x.length-1&&f(++p):38===e.which&&p>0&&f(--p)},a=e=>{115===e.which&&L()},{NhanVienBanHang_Id:s,OnAddItem:h,OnCheckExsist:r,donHangDate:d}=e,o=(0,i.useRef)(),[c,u]=(0,i.useState)([]),[x,m]=(0,i.useState)([]);let[p,f]=(0,i.useState)(0);const[N,S]=(0,i.useState)(""),[P,M]=(0,i.useState)(!1),[I,_]=l()(null,(e=>{M(!!e)})),[G,w]=(0,i.useState)(null);(0,i.useEffect)((()=>(window.addEventListener("keydown",t),window.addEventListener("keyup",a),()=>{window.removeEventListener("keydown",t),window.removeEventListener("keyup",a)})),[t,a]),(0,i.useEffect)((()=>{n.current.getData()}),[G]),(0,i.useEffect)((()=>{E("")}),[c]),(0,i.useImperativeHandle)(n,(()=>({getData(){(0,H.Pq)("XuatHang/GetDonHangs?khachHang=".concat(G),"GET",null,!1).then((e=>u(e))).catch((e=>(0,C.a3)("Kh\xf4ng th\u1ec3 t\u1ea3i d\u1eef li\u1ec7u xu\u1ea5t h\xe0ng","Th\xf4ng b\xe1o")))}})));const L=()=>{o.current&&o.current.focus()},E=e=>{S(e),f(0),m(c.filter((n=>{var t;return(null===(t=n.MaDonHang)||void 0===t?void 0:t.toUpperCase().includes(e.toUpperCase().trim()))||n.DonHangId===e.trim()||n.KhachHang.toUpperCase().includes(e.toUpperCase().trim())||n.NhanVien.toUpperCase().includes(e.toUpperCase().trim())}))),0===c.length&&(o.current.value="")},V=(e,n)=>{((e,n)=>{w(n)})(0,n)},O=x||c;return(0,g.jsxs)(i.Fragment,{children:[(0,g.jsxs)(v.A,{className:"tim-kiem-san-pham phieu-xuat",children:[(0,g.jsx)(D.A,{children:(0,g.jsx)("b",{children:"T\xecm ki\u1ebfm \u0111\u01a1n h\xe0ng"})}),(0,g.jsxs)(b.A,{children:[(0,g.jsxs)("div",{className:"search-box pull-right",children:[(0,g.jsx)("input",{ref:o,className:"form-control-sm form-control",defaultValue:N,onChange:e=>E(e.target.value.trim()),placeholder:"T\xecm \u0111\u01a1n h\xe0ng theo m\xe3 ho\u1eb7c t\xean kh\xe1ch h\xe0ng... (F4)"}),(0,g.jsx)("span",{className:"btn-tim-kiem",children:(0,g.jsx)(y.A,{fa:"search"})})]}),(0,g.jsxs)(j.A,{style:{pointerEvents:"none",marginTop:35},children:[(0,g.jsx)(T.A,{md:"6",children:(0,g.jsx)(X.A,{data:K.DonHang_TuNgay,value:d.DonHang_TuNgay,inline:!1})}),(0,g.jsx)(T.A,{md:"6",children:(0,g.jsx)(X.A,{data:K.DonHang_DenNgay,value:d.DonHang_DenNgay,inline:!1})}),(0,g.jsx)(T.A,{md:"12",style:{pointerEvents:"auto"},children:(0,g.jsx)(X.A,{data:K.LoaiDonHang,value:G,onChange:(e,n)=>V(0,n),inline:!1})})]}),(0,g.jsx)("div",{className:"search-results",children:(0,g.jsx)("div",{className:"list-result",children:(null===O||void 0===O?void 0:O.length)>0?O.map(((e,n)=>(0,g.jsxs)("div",{className:n===p?"list-item focus-one":"list-item",onMouseEnter:()=>f(n),children:[(0,g.jsxs)("div",{className:"info",onClick:()=>{h(e)},children:[(0,g.jsxs)("div",{style:{position:"relative"},children:[(0,g.jsx)("span",{children:e.DonHangId})," - ",e.MaDonHang,(0,g.jsx)(z.A,{color:"success",style:{position:"absolute",top:0,right:40,display:r(e)?"block":"none"},children:"\u0110\xe3 th\xeam"})]}),(0,g.jsxs)("div",{children:[(0,g.jsxs)("span",{className:"d-block mr-4",children:["Kh\xe1ch h\xe0ng: ",e.KhachHang," - (Nh\xe2n vi\xean: ",e.NhanVien,")"]}),(0,g.jsxs)("span",{className:"d-block ml-0",children:["Ng\xe0y t\u1ea1o: ",(0,U.A)(new Date(e.NgayTao),"dd/MM/yyyy HH:mm")]}),(0,g.jsxs)("span",{className:"d-block ml-0",children:["Th\xe0nh ti\u1ec1n: ",(0,A.vv)(e.ThanhTien)]})]})]}),(0,g.jsx)("div",{className:"pl-2 pt-2 pb-2",onClick:()=>(e=>{let n="DonHangs?$expand=DM_DiemKinhDoanh,DM_HinhThucThanhToan,Sale_DonTraHang&$select=Id,NgayTao,NguoiTao,MaDonHang,DM_DiemKinhDoanh/Ten,DM_DiemKinhDoanh/Id,TienHang,GiamGia,PTGiamGia,ThanhTien,DM_HinhThucThanhToan/Ten,DM_HinhThucThanhToan/Id,Phieu_Id,Sale_DonTraHang/*,DaTraHang,IsDeleted,LyDoHuy\n &$filter=MaDonHang eq '".concat(e,"'");(0,H.Pq)(n,"GET",null).then((e=>_(e.value[0]))).catch((e=>{(0,C.a3)("L\u1ea5y d\u1eef li\u1ec7u \u0111\u01a1n h\xe0ng kh\xf4ng th\xe0nh c\xf4ng!","Th\xf4ng b\xe1o")}))})(e.MaDonHang),children:(0,g.jsx)(z.A,{style:{fontSize:"10px"},color:"info",children:"Xem \u0111\u01a1n h\xe0ng"})})]},e.Id))):x?(0,g.jsxs)("div",{className:"list-item",style:{minHeight:"150px",justifyContent:"center"},children:[" ","Kh\xf4ng c\xf3 k\u1ebft qu\u1ea3 ph\xf9 h\u1ee3p!"]}):""})})]})]}),P&&I&&(0,g.jsx)(k.A,{isDetailTheKho:!0,data:I,IdDonHang:I.Id,openDetail:P,closeDetail:()=>_(null)})]})})),$=e=>{const n=(0,i.useRef)(),t=(0,i.useRef)(),{open:a,onClose:s,ID:h,OnReloadTable:l}=e,[r,d]=(0,i.useState)({}),[o,c]=(0,i.useState)(!0);(0,i.useEffect)((()=>{m()}),[r.thongTinHoaDon]),(0,i.useEffect)((()=>{n.current&&n.current.deteleAllChiTiet()}),[r.NhanVienBanHang_Id]);const u=h?"C\u1eadp nh\u1eadt phi\u1ebfu xu\u1ea5t h\xe0ng":"Th\xeam phi\u1ebfu xu\u1ea5t h\xe0ng",x=(e,n)=>{((e,n)=>{r[e]=n,"0"===r.PhuongThucGiaoHang?(K.NhanVienGiaoHang_Id.required=!1,r.NhanVienGiaoHang_Id=null):K.NhanVienGiaoHang_Id.required=!0,d({...r})})(e,n)},m=()=>{if(r.thongTinHoaDon&&r.thongTinHoaDon.length){let e=[];e=r.thongTinHoaDon.map((e=>new Date(e.NgayTao).getTime()));const{min:n,max:t}=v(e);d({...r,DonHang_TuNgay:n,DonHang_DenNgay:t})}else d({...r,DonHang_TuNgay:null,DonHang_DenNgay:null})},v=e=>{let n=0,t=0;return e.forEach(((e,i)=>{0===i&&(n=t=e),e<n?n=e:e>t&&(t=e)})),{min:n,max:t}},D=()=>{if((()=>{const e=Object.values(K).filter((e=>e.required));for(let n=0;n<e.length;n++){const t=e[n];let i=r[t.field_name];if(null===i||""===i||void 0===i||0===i.length)return(0,C.AB)('Vui l\xf2ng nh\u1eadp "'+t.displayWarning+'"'),!1}return!0})()&&(r.thongTinHoaDon&&r.thongTinHoaDon.length>0||((0,C.AB)("Vui l\xf2ng nh\u1eadp chi ti\u1ebft phi\u1ebfu xu\u1ea5t h\xe0ng","Th\xf4ng b\xe1o"),0))){let e=h?"KhuyenMai/CapNhatKhuyenMai":"XuatHang/TaoDonXuatHang",n=h?"C\u1eadp nh\u1eadt phi\u1ebfu xu\u1ea5t th\xe0nh c\xf4ng":"T\u1ea1o phi\u1ebfu xu\u1ea5t th\xe0nh c\xf4ng",t={Id:h||"",...r,chiTietPhieuXuat:r.chiTietPhieuXuat.filter((e=>0!==e.SoLuong)),DonHang_TuNgay:(0,A.Fv)(r.DonHang_TuNgay),DonHang_DenNgay:(0,A.Fv)(r.DonHang_DenNgay)};(0,H.Pq)(e,"POST",JSON.stringify(t),!1).then((e=>{l(),(0,C.nw)(n,"Th\xf4ng b\xe1o"),s()})).catch((e=>(0,C.a3)(e.Message,"Th\xf4ng b\xe1o")))}},b=e=>{if(e&&e.length>0){let n=0;e.forEach(((t,i)=>{n+=t.ThanhTien?parseInt(t.ThanhTien):0,i===e.length-1&&(r.ThanhTien=n,d({...r}))}))}else r.ThanhTien=0,d({...r})};return(0,g.jsx)(f.A,{className:"custom-modal Create-XHTC",title:u,open:a,onClose:s,renderButton:(0,g.jsxs)(p.A,{className:"mr-2",size:"sm",color:"success",onClick:()=>D(),children:[(0,g.jsx)(y.A,{fa:"save"})," ","L\u01b0u phi\u1ebfu"]}),children:(0,g.jsxs)(j.A,{className:"tao-phieu-nhap-hang custom-modal modal-nhap-kho",children:[(0,g.jsx)(T.A,{md:o?"8":"12",className:"chi-tiet-nhap-hang",children:(0,g.jsx)(R,{ref:n,ID:h,data:r,onChange:(e,n)=>x(e,n),toggleLDH:o,OnToggleLDH:()=>c(!o),OnReloadListDonHang:()=>t.current.getData(),OnAddDataChiTiet:e=>(e=>{d({...r,chiTietPhieuXuat:e})})(e),OnAddDataListHoaDon:e=>(e=>{b(e),r.thongTinHoaDon=e,d({...r})})(e)})}),(0,g.jsx)(T.A,{md:"4",className:o?"tim-kiem-san-pham show":"tim-kiem-san-pham hide",children:n.current&&(0,g.jsx)(W,{donHangDate:{DonHang_TuNgay:r.DonHang_TuNgay,DonHang_DenNgay:r.DonHang_DenNgay},ref:t,OnAddItem:e=>n.current.add(e),OnCheckExsist:e=>n.current.checkExsistDonHang(e),NhanVienBanHang_Id:r.NhanVienBanHang_Id})})]})})};var J=t(38804),Y=t(16328),Q=t(33151),Z=t(68879),ee=t(34731),ne=t(53031),te=(t(43613),t(45418)),ie=t.n(te),ae=t(55627);function se(e){const{isOpen:n,isClose:t,title:a,phieuId:s}=e,h=(0,i.useRef)(),[l,r]=(0,i.useState)([]),d=(0,i.useCallback)((e=>{e&&(0,H.Pq)("XuatHang/PhieuGiaoNhanVaThanhToan?phieuXuatId=".concat(e),"GET",null,!1).then((e=>r(e))).catch((e=>(0,C.a3)("L\u1ed7i")))}),[]);(0,i.useEffect)((()=>{d(s)}),[d,s]);const o=e=>(0,g.jsxs)(i.Fragment,{children:[(0,g.jsxs)("div",{className:"text-center headerTop",children:[(0,g.jsx)("b",{children:e.header.TieuDe}),(0,g.jsx)("br",{}),(0,g.jsxs)("b",{children:["Ng\xe0y giao h\xe0ng: ",e.header.thongTinGiaoNhan.NgayGiao]})]}),(0,g.jsxs)("div",{className:"hearderBody",children:[(0,g.jsxs)(j.A,{className:"mb-4",children:[(0,g.jsxs)(T.A,{xs:"8",children:[(0,g.jsx)("div",{className:"mb-1 height-0",children:(0,g.jsxs)("b",{children:["Nh\xe0 ph\xe2n ph\u1ed1i: ",e.header.thongTinDonVi.NhaPhanPhoi]})})," ",(0,g.jsx)("br",{}),(0,g.jsx)("div",{className:"mb-1 height-0",children:(0,g.jsxs)("b",{children:["\u0110\u1ecba ch\u1ec9: ",e.header.thongTinDonVi.DiaChi]})})," ",(0,g.jsx)("br",{}),(0,g.jsx)("div",{className:"mb-1 height-0",children:(0,g.jsxs)("b",{children:["Kh\xe1ch h\xe0ng: ",e.header.thongTinKhachHang.TenKhachHang]})})," ",(0,g.jsx)("br",{}),(0,g.jsx)("div",{className:"mb-1 height-0",children:(0,g.jsxs)("b",{children:["\u0110/c GH: ",e.header.thongTinKhachHang.DiaChi]})})," ",(0,g.jsx)("br",{}),(0,g.jsx)("div",{className:"mb-1 height-0",children:(0,g.jsx)("b",{children:"C\xf4ng n\u1ee3 ti\u1ec1n:"})})]}),(0,g.jsxs)(T.A,{xs:"4",children:[(0,g.jsx)("div",{className:"mb-1 height-0",children:(0,g.jsxs)("b",{children:["\u0110T: ",e.header.thongTinDonVi.DienThoai]})})," ",(0,g.jsx)("br",{}),(0,g.jsx)("div",{className:"mb-1 height-0",children:(0,g.jsx)("b",{})})," ",(0,g.jsx)("br",{}),(0,g.jsx)("div",{className:"mb-1 height-0",children:(0,g.jsxs)("b",{children:["\u0110T: ",e.header.thongTinKhachHang.DienThoai]})})," ",(0,g.jsx)("br",{}),(0,g.jsx)("div",{className:"mb-1 height-0",children:(0,g.jsxs)("b",{children:["NVBH: ",e.header.phieuGiaoNhan.NVBH]})})," ",(0,g.jsx)("br",{}),(0,g.jsx)("div",{className:"mb-1 height-0",children:(0,g.jsx)("b",{children:"\u0110T NNVBH:"})})]})]}),(0,g.jsxs)(j.A,{children:[(0,g.jsx)(T.A,{xs:"3",children:(0,g.jsx)("span",{children:(0,g.jsxs)("b",{children:["Phi\u1ebfu xu\u1ea5t kho: ",e.header.thongTinGiaoNhan.PhieuXuatKho]})})}),(0,g.jsx)(T.A,{xs:"3",children:(0,g.jsx)("span",{children:(0,g.jsxs)("b",{children:["H\xf3a \u0111\u01a1n s\u1ed1: ",e.body.thongTinGiao.MaHoaDon]})})}),(0,g.jsx)(T.A,{xs:"3",children:(0,g.jsx)("span",{children:(0,g.jsxs)("b",{children:["Ng\xe0y \u0111\u1eb7t h\xe0ng: ",e.body.thongTinGiao.NgayTao]})})}),(0,g.jsx)(T.A,{xs:"3",children:(0,g.jsx)("span",{children:(0,g.jsxs)("b",{children:["NVGH: ",e.header.thongTinGiaoNhan.NVGH]})})})]})]})]}),c=e=>(0,g.jsx)(i.Fragment,{children:(0,g.jsx)("div",{className:"body-hangMua",children:(0,g.jsxs)(F.A,{size:"sm",bordered:!0,children:[(0,g.jsx)("thead",{children:(0,g.jsxs)("tr",{children:[(0,g.jsx)("th",{children:"STT"}),(0,g.jsx)("th",{children:"M\xe3 SP"}),(0,g.jsx)("th",{children:"T\xean SP"}),(0,g.jsx)("th",{children:"SL"}),(0,g.jsx)("th",{children:"Gi\xe1 tr\u01b0\u1edbc CK"}),(0,g.jsx)("th",{children:"Chi\u1ebft kh\u1ea5u"}),(0,g.jsx)("th",{children:"Gi\xe1 sau CK"}),(0,g.jsx)("th",{children:"Th\xe0nh ti\u1ec1n"})]})}),(0,g.jsx)("tbody",{children:e.body.thongTinGiao.chiTietMuas.map(((e,n)=>(0,g.jsxs)("tr",{children:[(0,g.jsx)("td",{children:n+1}),(0,g.jsx)("td",{children:e.MaSanPham}),(0,g.jsx)("td",{children:e.TenSanPham}),(0,g.jsx)("td",{children:e.SoLuong}),(0,g.jsx)("td",{children:e.DonGia}),(0,g.jsx)("td",{children:e.GiamGia}),(0,g.jsx)("td",{children:e.DonGiaSauCK}),(0,g.jsx)("td",{children:e.ThanhTien})]},n)))})]})})}),u=(e,n,t,a)=>(0,g.jsx)(i.Fragment,{children:(0,g.jsx)("div",{className:"body-hangMua",children:(0,g.jsxs)(F.A,{size:"sm",bordered:!0,children:[(0,g.jsx)("thead",{children:(0,g.jsxs)("tr",{children:[(0,g.jsx)("th",{children:"STT"}),(0,g.jsx)("th",{children:"M\xe3 SP"}),(0,g.jsx)("th",{children:"T\xean SP"}),(0,g.jsx)("th",{children:"SL"}),(0,g.jsx)("th",{children:"Gi\xe1 tr\u01b0\u1edbc CK"}),(0,g.jsx)("th",{children:"Chi\u1ebft kh\u1ea5u"}),(0,g.jsx)("th",{children:"Gi\xe1 sau CK"}),(0,g.jsx)("th",{children:"Th\xe0nh ti\u1ec1n"})]})}),(0,g.jsx)("tbody",{children:e.body.thongTinGiao.chiTietMuas.splice(0,n).map(((e,i)=>(0,g.jsxs)("tr",{children:[(0,g.jsx)("td",{children:t?a?i+n:i+1+n:i+1}),(0,g.jsx)("td",{children:e.MaSanPham}),(0,g.jsx)("td",{children:e.TenSanPham}),(0,g.jsx)("td",{children:e.SoLuong}),(0,g.jsx)("td",{children:e.DonGia}),(0,g.jsx)("td",{children:e.GiamGia}),(0,g.jsx)("td",{children:e.DonGiaSauCK}),(0,g.jsx)("td",{children:e.ThanhTien})]},i)))})]})})}),x=e=>(0,g.jsxs)(i.Fragment,{children:[(0,g.jsx)(j.A,{className:"mb-2",children:(0,g.jsxs)(T.A,{className:"d-flex-custom",children:[(0,g.jsxs)("div",{children:[(0,g.jsx)("div",{children:(0,g.jsx)("b",{children:"T\u1ed5ng ti\u1ec1n chi\u1ebft kh\u1ea5u"})}),(0,g.jsx)("div",{children:(0,g.jsx)("b",{children:e.body.thongTinGiao.TienHang})})]}),(0,g.jsxs)("div",{children:[(0,g.jsx)("div",{children:(0,g.jsx)("b",{children:"Chi\u1ebft kh\u1ea5u ti\u1ec1n"})}),(0,g.jsx)("div",{children:(0,g.jsx)("b",{children:e.body.thongTinGiao.GiamGia})})]}),(0,g.jsxs)("div",{children:[(0,g.jsx)("div",{children:(0,g.jsx)("b",{children:"T\u1ed5ng h\xe0ng"})}),(0,g.jsx)("div",{children:(0,g.jsx)("b",{children:e.body.thongTinGiao.TongHangThungChai})})]}),(0,g.jsxs)("div",{children:[(0,g.jsx)("div",{children:(0,g.jsx)("b",{children:"T\u1ed5ng ti\u1ec1n ph\u1ea3i tr\u1ea3"})}),(0,g.jsx)("div",{children:(0,g.jsx)("b",{children:e.body.thongTinGiao.ThanhTien})})]})]})}),(0,g.jsx)(j.A,{children:(0,g.jsx)(T.A,{className:"bangChu",children:(0,g.jsx)("div",{children:(0,g.jsxs)("b",{children:["B\u1eb1ng ch\u1eef: ",e.body.thongTinGiao.ThanhTienBangChu]})})})})]}),m=e=>(0,g.jsx)(i.Fragment,{children:0!==e.body.thongTinGiao.chiTietHangKhuyenMais.length&&(0,g.jsxs)("div",{className:"body-hangKM",children:[(0,g.jsx)(ae.A,{children:(0,g.jsx)("b",{children:"H\xe0ng khuy\u1ebfn m\xe3i"})}),(0,g.jsxs)(F.A,{size:"sm",bordered:!0,children:[(0,g.jsx)("thead",{children:(0,g.jsxs)("tr",{children:[(0,g.jsx)("th",{children:"STT"}),(0,g.jsx)("th",{children:"M\xe3 SP"}),(0,g.jsx)("th",{children:"T\xean SP"}),(0,g.jsx)("th",{children:"SL"}),(0,g.jsx)("th",{children:"Ch\u01b0\u01a1ng tr\xecnh KM"})]})}),(0,g.jsx)("tbody",{children:e.body.thongTinGiao.chiTietHangKhuyenMais.map(((e,n)=>(0,g.jsxs)("tr",{children:[(0,g.jsx)("td",{children:n+1}),(0,g.jsx)("td",{children:e.MaSanPham}),(0,g.jsx)("td",{children:e.TenSanPham}),(0,g.jsx)("td",{children:e.SoLuong}),(0,g.jsx)("td",{children:e.ChuongTrinhKhuyenMai})]},n)))})]})]})});let D=0;const N=(0,i.useCallback)((()=>(D++,(0,g.jsxs)(i.Fragment,{children:[(0,g.jsx)(j.A,{className:"mb-2",children:(0,g.jsxs)(T.A,{className:"d-flex-custom",children:[(0,g.jsxs)("div",{children:[(0,g.jsx)("div",{children:(0,g.jsx)("b",{children:"Ng.Mua H\xe0ng"})}),(0,g.jsx)("div",{children:(0,g.jsx)("i",{children:"K\xfd v\xe0 ghi r\xf5 h\u1ecd t\xean"})})]}),(0,g.jsxs)("div",{children:[(0,g.jsx)("div",{children:(0,g.jsx)("b",{children:"Th\u1ee7 kho"})}),(0,g.jsx)("div",{children:(0,g.jsx)("i",{children:"K\xfd v\xe0 ghi r\xf5 h\u1ecd t\xean"})})]}),(0,g.jsxs)("div",{children:[(0,g.jsx)("div",{children:(0,g.jsx)("b",{children:"NV Giao Nh\u1eadn"})}),(0,g.jsx)("div",{children:(0,g.jsx)("i",{children:"K\xfd v\xe0 ghi r\xf5 h\u1ecd t\xean"})})]})]})}),(0,g.jsx)(j.A,{children:(0,g.jsx)(T.A,{style:{position:"absolute",bottom:"21px",right:"10px"},className:"text-right",children:(0,g.jsxs)("b",{children:["Trang: ",D]})})})]}))),[D]),A=(0,i.useCallback)((()=>l.map(((e,n)=>{let t="";if(e.body.thongTinGiao.chiTietMuas.length+e.body.thongTinGiao.chiTietHangKhuyenMais.length>4){let a=e.body.thongTinGiao.chiTietMuas.length,s=a%2;t=a>8?(0,g.jsxs)(i.Fragment,{children:[(0,g.jsx)(v.A,{id:"print-document",className:"print-document",children:(0,g.jsx)(b.A,{children:(0,g.jsxs)("div",{className:"heigth-cardBody",id:"heigth-cardBody",children:[o(e),u(e,parseInt(a/2)),x(e),N()]})})},n),(0,g.jsx)(v.A,{id:"print-document",className:"print-document",children:(0,g.jsx)(b.A,{children:(0,g.jsxs)("div",{className:"heigth-cardBody",id:"heigth-cardBody",children:[o(e),u(e,parseInt(a/2)+s,!0,s),x(e),N()]})})},n),0!==e.body.thongTinGiao.chiTietHangKhuyenMais.length&&(0,g.jsx)(v.A,{id:"print-document",className:"print-document",children:(0,g.jsx)(b.A,{children:(0,g.jsxs)("div",{className:"heigth-cardBody",id:"heigth-cardBody",children:[o(e),m(e),N()]})})},n)]}):(0,g.jsxs)(i.Fragment,{children:[(0,g.jsx)(v.A,{id:"print-document",className:"print-document",children:(0,g.jsx)(b.A,{children:(0,g.jsxs)("div",{className:"heigth-cardBody",id:"heigth-cardBody",children:[o(e),c(e),x(e),N()]})})},n),0!==e.body.thongTinGiao.chiTietHangKhuyenMais.length&&(0,g.jsx)(v.A,{id:"print-document",className:"print-document",children:(0,g.jsx)(b.A,{children:(0,g.jsxs)("div",{className:"heigth-cardBody",id:"heigth-cardBody",children:[o(e),m(e),N()]})})},n)]})}else t=(0,g.jsx)(i.Fragment,{children:(0,g.jsx)(v.A,{id:"print-document",className:"print-document",children:(0,g.jsx)(b.A,{children:(0,g.jsxs)("div",{className:"heigth-cardBody",id:"heigth-cardBody",children:[o(e),c(e),x(e),m(e),N()]})})},n)});return t}))),[l,N]);return(0,g.jsx)(f.A,{open:n,className:"in-phieu-so-quy",title:a||"",onClose:t,renderButton:(0,g.jsx)(ie(),{trigger:()=>(0,g.jsxs)(p.A,{size:"sm mr-2",color:"primary",children:[" ",(0,g.jsx)(y.A,{fa:"print"})," ","In phi\u1ebfu"]}),content:()=>h.current,pageStyle:"\n @page {\n size: A5 landscape !important;\n margin: 0mm !important;\n padding: 0mm !important;\n }\n @media print {\n .print-document {\n font-size: 11px;\n display: block;\n page-break-before: always;\n }\n }\n "}),children:(0,g.jsx)("div",{ref:h,id:"componentRef",children:A()})})}const he=e=>{const{open:n,onClose:t,ID:a}=e,[s,h]=(0,i.useState)({}),[r,d]=(0,i.useState)(!1),[o,c]=l()(0,(e=>{d(0!==e)}));(0,i.useEffect)((()=>{a&&u()}),[a]);const u=()=>{(0,H.Pq)("Sale_XuatHang(".concat(a,")"),"GET",null).then((e=>h(e))).catch((e=>(0,C.a3)("Kh\xf4ng th\u1ec3 t\u1ea3i d\u1eef li\u1ec7u khuy\u1ebfn m\xe3i","Th\xf4ng b\xe1o")))};return(0,g.jsxs)(f.A,{className:"custom-modal Create-XHTC Detail",title:"Chi ti\u1ebft phi\u1ebfu xu\u1ea5t h\xe0ng",open:n,onClose:t,renderButton:s.NhanVienGiaoHang_Id?(0,g.jsx)(le,{setMaBaoCao_PX:()=>c(ne.MaBaoCaoPhieuIn.PhieuXuatHang),setMaBaoCao_PGNVTT:()=>c(ne.MaBaoCaoPhieuIn.PhieuGiaoNhanVaThanhToan)}):null,children:[(0,g.jsx)(j.A,{className:"tao-phieu-nhap-hang custom-modal modal-nhap-kho",children:(0,g.jsx)(T.A,{md:"12",className:"chi-tiet-nhap-hang",children:(0,g.jsx)(R,{data:s,isDetail:!0,ID:a})})}),r?o!==ne.MaBaoCaoPhieuIn.PhieuGiaoNhanVaThanhToan?(0,g.jsx)(ee.A,{open:r,title:"In phi\u1ebfu xu\u1ea5t "+a,onClose:()=>c(0),maBaoCao:o,phieuId:a}):(0,g.jsx)(se,{isOpen:r,title:"In phi\u1ebfu xu\u1ea5t "+a,isClose:()=>c(0),maBaoCao:o,phieuId:a}):null]})},le=e=>{const{setMaBaoCao_PX:n,setMaBaoCao_PGNVTT:t}=e,[a,s]=(0,i.useState)(!1);return(0,g.jsxs)(J.A,{isOpen:a,toggle:()=>s(!a),className:"mr-2",children:[(0,g.jsxs)(Y.A,{caret:!0,color:"primary",size:"sm",children:[(0,g.jsx)(y.A,{fa:"print"})," ","In phi\u1ebfu"]}),(0,g.jsxs)(Q.A,{children:[(0,g.jsx)(Z.A,{onClick:()=>n(),children:"Xu\u1ea5t h\xe0ng"}),(0,g.jsx)(Z.A,{onClick:()=>t(),children:"Giao nh\u1eadn v\xe0 thanh to\xe1n"})]})]})};var re=t(68754),de=t(39051);const oe=i.createRef(),ce=()=>oe.current&&oe.current.onQueryChange(),ue=e=>{const[n,t]=(0,i.useState)(""),[a,h]=(0,i.useState)([]),[m,p]=(0,i.useState)((0,U.A)(new Date,"yyyy-MM-dd")),[j,T]=(0,i.useState)((0,U.A)(new Date,"yyyy-MM-dd")+"T23:59:59.000"),[f,y]=(0,i.useState)(!1),[v,D]=(0,i.useState)(!1),[b,N]=(0,i.useState)(!1),[A,C]=(0,i.useState)(s.lg.MaTaiKhoan),[H,S]=l()(0,(e=>{D(0!==e)})),[P,M]=l()(0,(e=>{N(0!==e)}));(0,i.useEffect)((()=>{ce()}),[a]),(0,i.useEffect)((()=>{let e=[];n&&e.push("substringof('".concat(n,"', MaXuatHang)")),m&&j&&e.push("(NgayXuat gt (datetime'".concat(m,"') and NgayXuat lt (datetime'").concat(j,"'))")),A&&e.push("NguoiTao eq '".concat(A,"'")),h([...e])}),[n,m,j,A]);return(0,g.jsxs)(u.A,{className:"Module-XH",children:[(0,g.jsxs)(d.A,{NoTabs:!0,PageBaoCao:!0,children:[(0,g.jsx)(o.A,{className:"mb-2",showDKD:!0,title:"T\xecm ki\u1ebfm",defaultValue:n,onKeyPress:e=>(e=>{13===e.charCode&&t(e.target.value)})(e),placeholder:"T\xecm ki\u1ebfm m\xe3 ch\u1ee9ng t\u1eeb"}),(0,g.jsx)(o.A,{className:"mb-2",type:"dropdown-list",title:"Ng\u01b0\u1eddi t\u1ea1o",placeholder:"Ch\u1ecdn ng\u01b0\u1eddi t\u1ea1o...",url:"TaiKhoans",where:"loai_tai_khoan eq 'don_vi' and IDDonVi eq '".concat(s.lg.IDDonVi,"' and SYS_DM_VaiTro/MaVaiTro eq 'dieuhanh' or SYS_DM_VaiTro/MaVaiTro eq 'ketoan' and TinhTrangHoatDong eq true"),valueField:"MaTaiKhoan",textField:"TenHienThi",value:A,onChange:e=>C(e)}),(0,g.jsx)(o.A,{className:"mb-2",title:"Th\u1eddi gian",type:"date-report",onChangeDate:(e,n,t)=>{p(n?(0,U.A)(n,"yyyy-MM-dd"):null),T(t?(0,U.A)(t,"yyyy-MM-dd")+"T23:59:59.000":null)},status:!0,defaultValueDate:de.Eb.ToanThoiGian})]}),(0,g.jsxs)(c.A,{NoTabs:!0,children:[(0,g.jsx)(r.A,{tableRef:oe,title:"Danh s\xe1ch phi\u1ebfu xu\u1ea5t",url:"Sale_XuatHang",columns:x,where:a.join(" and "),selectType:"withColumns",onAdd:{onClick:(e,n)=>S(null)},onRowClick:(e,n)=>(e=>{new Promise(((n,t)=>{n(y(null===e.TuDong||e.TuDong))})).then((n=>{!1===e.TuDong?M(e.Id):M(e)}))})(n)}),v&&(0,g.jsx)($,{ID:H,open:v,OnReloadTable:()=>ce(),onClose:()=>S(0)}),b&&!f&&(0,g.jsx)(he,{ID:P,open:b,onClose:()=>M(0)}),b&&f&&P&&(0,g.jsx)(re.A,{modeDialog:"detail",phieuNhapSelected:P,openTaoPhieu:b,onCloseTaoPhieu:()=>M(0)})]})]})};class ge extends i.Component{render(){return(0,g.jsx)(i.Fragment,{children:s.b9.Kho_Id?(0,g.jsx)(ue,{CurrentKho:{Id:s.b9.Kho_Id,IsKhoTong:s.b9.IsKhoTong,DiemKinhDoanh_Id:s.b9.DiemKinhDoanhId}}):(0,g.jsx)(a.A,{color:"warning",children:"B\u1ea1n ch\u01b0a c\xf3 quy\u1ec1n s\u1eed d\u1ee5ng ch\u1ee9c n\u0103ng n\xe0y"})})}}},22161:(e,n,t)=>{"use strict";t.d(n,{A:()=>h});var i=t(9950),a=t(73613),s=t(44414);const h=e=>{const n=(0,i.useRef)(),{onSearch:t,className:h,placeholder:l}=e;(0,i.useEffect)((()=>{window.addEventListener("keydown",r),window.addEventListener("keyup",d)}),[]);const r=e=>{if(114===e.which)return e.preventDefault(),!1},d=e=>{114===e.which&&n.current&&n.current.focus()};return(0,s.jsxs)("div",{className:"search-box-XH pull-right "+(h||""),children:[(0,s.jsx)("input",{className:"form-control-sm form-control",ref:n,onChange:e=>{return n=e.target.value.trim(),void(t&&t(n));var n},placeholder:l||"T\xecm s\u1ea3n ph\u1ea9m theo m\xe3 ho\u1eb7c t\xean (F3)"}),(0,s.jsx)("span",{className:"btn-tim-kiem-XH",children:(0,s.jsx)(a.A,{fa:"search"})})]})}},68754:(e,n,t)=>{"use strict";t.d(n,{A:()=>y});var i=t(9950),a=t(67116),s=t(82376),h=t(4370),l=(t(29079),t(70349)),r=t(23931),d=t(50651),o=t(76991),c=t(18849),u=t(36841),g=t(53139),x=t(73613),m=t(34182),p=t(95688),j=t(44414);class T extends i.Component{constructor(e){super(e),this.handleDeletePhieuXuat=e=>{(0,a.A1)("B\u1ea1n c\xf3 ch\u1eafc ch\u1eafn mu\u1ed1n x\xf3a!","Th\xf4ng b\xe1o").then((()=>{(0,h.Pq)("XuatHang/XoaPhieuXuat?idPhieuXuat=".concat(e),"DELETE",null,!1).then((e=>{(0,a.nw)("X\xf3a phi\u1ebfu th\xe0nh c\xf4ng"),this.props.onCloseTaoPhieu&&this.props.onCloseTaoPhieu(),this.props.getDataPhieuChuyenKho&&this.props.getDataPhieuChuyenKho()})).catch((e=>{(0,a.a3)(e.Message)}))}))},this.state={}}render(){var e;const{dataKho:n,phieuNhapSelected:t,searchDataDetail:i,refTimKiemSanPham:a,isDelete:s,reloadListFix:h,dataDonViTinh:T}=this.props;return(0,j.jsx)(j.Fragment,{children:(0,j.jsxs)(l.A,{className:"tao-phieu-nhap-hang xem-phieu",children:[(0,j.jsx)(r.A,{md:"4",className:"thong-tin-phieu-nhap",children:(0,j.jsxs)(d.A,{children:[(0,j.jsx)("div",{className:"card-header",children:(0,j.jsx)("b",{children:"Th\xf4ng tin phi\u1ebfu xu\u1ea5t h\xe0ng"})}),(0,j.jsxs)(o.A,{children:[s&&(0,j.jsxs)(c.A,{color:"danger",style:{backgroundColor:"red",position:"fixed",right:"6rem",zIndex:1e4,top:"0.35rem"},className:"mr-2",size:"sm",onClick:()=>this.handleDeletePhieuXuat(t.Id),children:[(0,j.jsx)(x.A,{fa:"trash"})," X\xf3a phi\u1ebfu xu\u1ea5t"]}),(0,j.jsxs)(l.A,{className:"form-input form-lapphieu",children:[(0,j.jsxs)(r.A,{md:"12",children:[(0,j.jsxs)(l.A,{children:[(0,j.jsx)(r.A,{md:"4",children:"M\xe3 kho: "}),(0,j.jsx)(r.A,{children:null===t||void 0===t?void 0:t.Kho_Id})]}),(0,j.jsxs)(l.A,{children:[(0,j.jsx)(r.A,{md:"4",children:"M\xe3 ch\u1ee9ng t\u1eeb: "}),(0,j.jsx)(r.A,{children:null===t||void 0===t?void 0:t.MaXuatHang})]}),n&&(0,j.jsxs)(l.A,{children:[(0,j.jsx)(r.A,{md:"4",children:"Xu\u1ea5t t\u1eeb kho: "}),(0,j.jsx)(r.A,{children:(()=>{var e;return n&&n.length&&(null===t||void 0===t||null===(e=t.Sale_ChiTietXuatHang[0])||void 0===e?void 0:e.Kho_Id)&&n.find((e=>{var n;return e.Id===(null===t||void 0===t||null===(n=t.Sale_ChiTietXuatHang[0])||void 0===n?void 0:n.Kho_Id)})).Ten})()})]}),(0,j.jsxs)(l.A,{children:[(0,j.jsx)(r.A,{md:"4",children:"Gi\xe1 tr\u1ecb: "}),(0,j.jsx)(r.A,{children:(0,u.vv)(null===t||void 0===t?void 0:t.ThanhTien)})]})]}),(0,j.jsxs)(r.A,{md:"12",children:[(0,j.jsxs)(l.A,{children:[(0,j.jsx)(r.A,{md:"4",children:"Th\u1eddi gian: "}),(0,j.jsx)(r.A,{children:(0,u.Rt)(null===t||void 0===t?void 0:t.NgayXuat)})]}),(0,j.jsxs)(l.A,{children:[(0,j.jsx)(r.A,{md:"4",children:"Ghi ch\xfa: "}),(0,j.jsxs)(r.A,{children:[(0,j.jsx)(x.A,{fa:"pencil"}),(0,j.jsx)(g.fs,{rows:"5",placeholder:"Ghi ch\xfa",style:{pointerEvents:"none",paddingRight:"1.5rem"},value:null===t||void 0===t?void 0:t.GhiChu,name:"GhiChu"})]})]})]})]})]})]})}),(0,j.jsx)(r.A,{md:"8",className:"chi-tiet-nhap-hang",children:(0,j.jsxs)(d.A,{children:[(0,j.jsxs)("div",{className:"card-header",children:[(0,j.jsx)("b",{children:"Chi ti\u1ebft phi\u1ebfu xu\u1ea5t h\xe0ng"}),(0,j.jsx)(m.A,{searchDataDetail:i,ref:a})]}),(0,j.jsx)(o.A,{children:(0,j.jsx)(l.A,{md:"12",className:"form-input",children:(0,j.jsx)(r.A,{children:(0,j.jsxs)("table",{width:"100%",children:[(0,j.jsx)("thead",{children:(0,j.jsxs)("tr",{children:[(0,j.jsx)("td",{children:"STT"}),(0,j.jsx)("td",{children:"M\xe3 h\xe0ng"}),(0,j.jsx)("td",{children:"T\xean h\xe0ng"}),(0,j.jsx)("td",{children:"\u0110VT"}),(0,j.jsx)("td",{children:"S\u1ed1 l\u01b0\u1ee3ng"}),(0,j.jsx)("td",{children:"\u0110\u01a1n gi\xe1"}),(0,j.jsx)("td",{children:"Th\xe0nh ti\u1ec1n"}),(0,j.jsx)("td",{children:"Ghi ch\xfa"})]})}),(0,j.jsx)("tbody",{children:(null===t||void 0===t||null===(e=t.Sale_ChiTietXuatHang)||void 0===e?void 0:e.length)>0?null===t||void 0===t?void 0:t.Sale_ChiTietXuatHang.map(((e,n)=>{var i,a,s;return(0,j.jsxs)("tr",{children:[(0,j.jsx)("td",{children:n+1}),(0,j.jsx)("td",{className:"text-left",children:null===(i=e.DM_SanPhamDichVu)||void 0===i?void 0:i.MaSanPham}),(0,j.jsx)("td",{className:"text-left",children:null===(a=e.DM_SanPhamDichVu)||void 0===a?void 0:a.TenSanPham}),(0,j.jsx)("td",{className:"text-left",children:null===(s=T.filter((n=>{var t;return n.Id===(null===e||void 0===e||null===(t=e.DM_SanPhamDichVu)||void 0===t?void 0:t.DonViTinh_Id)}))[0])||void 0===s?void 0:s.Ten}),(0,j.jsx)("td",{className:"text-right",style:{maxWidth:"30px"},children:(0,j.jsx)(p.A,{url:"FixLoi/UpdatePhieuXuat?idPhieuXuat=".concat(t.Id,"&sanPhamDichVu_Id=").concat(e.SanPhamDichVu_Id),soLuong:(0,u.vv)(e.SoLuong),reloadList:h})}),(0,j.jsx)("td",{className:"text-right",children:(0,u.vv)(e.DonGia)}),(0,j.jsx)("td",{className:"text-right",children:(0,u.vv)(e.ThanhTien)}),(0,j.jsx)("td",{children:e.GhiChu})]},e.SanPhamDichVu_Id)})):(0,j.jsx)("tr",{})})]})})})})]})})]})})}}const f=T;class y extends i.Component{constructor(e){super(e),this.handleDeletePhieuXuat=e=>{(0,a.A1)("B\u1ea1n c\xf3 ch\u1eafc ch\u1eafn mu\u1ed1n x\xf3a!","Th\xf4ng b\xe1o").then((()=>{(0,h.Pq)("XuatHang/XoaPhieuXuat?idDonChuyenKho=".concat(e),"DELETE",null,!1).then((e=>{(0,a.nw)("X\xf3a phi\u1ebfu th\xe0nh c\xf4ng"),this.props.onCloseTaoPhieu&&this.props.onCloseTaoPhieu(),this.props.getDataPhieuChuyenKho&&this.props.getDataPhieuChuyenKho()}))}))},this.state={phieuNhapSelected:null,originalPhieuNhap:null,dataDonViTinh:[],data:{MaXuatHang:"",NgayNhap:"",HinhThucThanhToan_Id:"",ThanhTien:"",ThanhTienFormat:"",Kho_Id:"",GhiChu:"",ListChiTietPhieuNhapHang:[]}},this.TimKiemSanPham=i.createRef(),this.searchDataDetail=this.searchDataDetail.bind(this)}componentDidMount(){this.getDataDonViTinh(),"add"!==this.props.modeDialog&&this.setState({phieuNhapSelected:this.props.phieuNhapSelected,originalPhieuNhap:this.props.phieuNhapSelected})}getDataDonViTinh(){(0,h.Pq)("DM_DonViTinh","GET",null).then((e=>this.setState({dataDonViTinh:e.value}))).catch((e=>(0,a.a3)("Kh\xf4ng th\u1ec3 l\u1ea5y d\u1eef li\u1ec7u kho!")))}searchDataDetail(e){let{phieuNhapSelected:n,originalPhieuNhap:t}=this.state;if(n){let i=t.Sale_ChiTietXuatHang.filter((n=>n.DM_SanPhamDichVu.MaSanPham.toUpperCase().includes(e.toUpperCase().trim())||n.DM_SanPhamDichVu.TenSanPham.toUpperCase().includes(e.toUpperCase().trim())));this.setState({phieuNhapSelected:{...n,Sale_ChiTietXuatHang:i}})}}render(){const{openTaoPhieu:e,onCloseTaoPhieu:n,modeDialog:t,isDelete:i,fncDelete:a}=this.props,{phieuNhapSelected:h,dataDonViTinh:l}=this.state;let r=(0,j.jsx)(j.Fragment,{}),d=(0,j.jsx)(f,{phieuNhapSelected:h,dataDonViTinh:l,searchDataDetail:this.searchDataDetail,refTimKiemSanPham:this.TimKiemSanPham,onCloseTaoPhieu:n,getDataPhieuChuyenKho:this.props.getDataPhieuChuyenKho,isDelete:i}),o=(0,j.jsx)(j.Fragment,{}),u="";switch(t){case"detail":o=d,u="Xem th\xf4ng tin phi\u1ebfu xu\u1ea5t h\xe0ng";break;case"edit":o=r,u="Ch\u1ec9nh s\u1eeda phi\u1ebfu xu\u1ea5t h\xe0ng";break;case"add":o=r,u="T\u1ea1o phi\u1ebfu xu\u1ea5t h\xe0ng"}return(0,j.jsx)(s.A,{className:"custom-modal",title:u,open:e,onClose:n,renderButton:(0,j.jsx)(j.Fragment,{children:a&&(0,j.jsxs)(c.A,{color:"danger",style:{backgroundColor:"red"},className:"mr-2",size:"sm",onClick:()=>a(h.Id),children:[(0,j.jsx)(x.A,{fa:"trash"})," X\xf3a phi\u1ebfu xu\u1ea5t"]})}),children:o})}}},34182:(e,n,t)=>{"use strict";t.d(n,{A:()=>l});var i=t(9950),a=t(73613),s=t(44414);class h extends i.Component{constructor(e){super(e),this.state={},this.inputSearch=i.createRef(),this.keyUpPress=this.keyUpPress.bind(this),this.keyDownPress=this.keyDownPress.bind(this),this.searchDataSanPham=this.searchDataSanPham.bind(this)}componentDidMount(){this.inputSearch.current&&this.inputSearch.current.focus(),window.addEventListener("keydown",this.keyDownPress),window.addEventListener("keyup",this.keyUpPress)}keyDownPress(e){if(114===e.which)return e.preventDefault(),!1}keyUpPress(e){114===e.which&&this.inputSearch.current&&this.inputSearch.current.focus()}searchDataSanPham(e){this.props.searchDataDetail&&this.props.searchDataDetail(e)}render(){return(0,s.jsxs)("div",{className:"search-box pull-right",children:[(0,s.jsx)("input",{ref:this.inputSearch,className:"form-control-sm form-control",onChange:e=>this.searchDataSanPham(e.target.value.trim()),placeholder:"T\xecm h\xe0ng h\xf3a theo m\xe3 ho\u1eb7c t\xean (F3)"}),(0,s.jsx)("span",{className:"btn-tim-kiem",children:(0,s.jsx)(a.A,{fa:"search"})})]})}}const l=h},45248:(e,n,t)=>{"use strict";t.d(n,{A:()=>h});var i=t(9950),a=t(73613),s=t(44414);class h extends i.Component{constructor(e){super(e),this.state={},this.keyUpPress=this.keyUpPress.bind(this),this.keyDownPress=this.keyDownPress.bind(this)}componentDidMount(){window.addEventListener("keydown",this.keyDownPress),window.addEventListener("keyup",this.keyUpPress)}keyDownPress(e){if(113===e.which)return e.preventDefault(),!1}keyUpPress(e){113===e.which&&this.props.toggledisplayColTimKiemSanPham()}render(){const{toggledisplayColTimKiemSanPham:e,displayColTimKiemSanPham:n}=this.props;return(0,s.jsxs)("span",{className:"d-flex pull-right btn-expand",style:{alignItems:"center"},onClick:e,children:[(0,s.jsx)(a.A,{fa:n?"arrow-circle-right":"arrow-circle-left"})," "," (F2)"]})}}},18503:(e,n,t)=>{"use strict";t.d(n,{I:()=>i});const i={KinhDoanh:"kinhdoanh",GiaoHang:"giaohang"}},65476:(e,n,t)=>{"use strict";t.d(n,{A:()=>g,W:()=>u});var i=t(9950),a=t(53139),s=t(37658),h=t(18849),l=t(73613),r=t(67520),d=t(67116),o=t(4370),c=t(44414);function u(e,n){(0,i.useEffect)((()=>{const t=t=>{e.current&&!e.current.contains(t.target)&&n(t)};return document.addEventListener("mousedown",t),document.addEventListener("touchstart",t),()=>{document.removeEventListener("mousedown",t),document.removeEventListener("touchstart",t)}}),[e,n])}const g=e=>{let{defaultValue:n,isEdit:t,getEditValue:o,editValue:g}=e;const[m,p]=(0,i.useState)(null===g||void 0===g?void 0:g.Name),[j,T]=(0,i.useState)({copy:!t,outline:!t}),[f,y]=(0,i.useState)(!1),v=(0,i.useRef)();u(v,(()=>{y(!1)})),(0,i.useEffect)((()=>{j.copy&&p(n)}),[n,j]),(0,i.useEffect)((()=>{m&&!t&&y(!0),o((e=>({...e,Name:m})))}),[o,t,m]);const D=(0,i.useCallback)((()=>{y(!1)}),[]);return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(s.A,{placement:"top",target:"TooltipBtnCopy",children:"Copy d\u1eef li\u1ec7u t\u1eeb T\xean s\u1ea3n ph\u1ea9m"}),(0,c.jsxs)("div",{ref:v,className:"form-drop-represent",children:[(0,c.jsxs)("div",{style:{marginBottom:"0.8rem"},className:"d-flex align-items-center",children:[(0,c.jsx)("p",{className:"mb-0",style:{fontSize:"12px"},children:"S\u1ea3n ph\u1ea9m \u0111\u1ea1i di\u1ec7n:"}),(0,c.jsx)(h.A,{id:"PopoverFocus",type:"button",className:"ml-2 btn-info-represent",children:(0,c.jsx)(l.A,{fa:"info"})}),(0,c.jsxs)(r.pC,{placement:"bottom",target:"PopoverFocus",trigger:"focus",children:[(0,c.jsx)(r.DI,{children:(0,c.jsx)("b",{children:"GI\u1ea2I TH\xcdCH"})}),(0,c.jsxs)(r.ej,{children:[(0,c.jsxs)("div",{className:"font-weight-normal",children:["\u0110\u1ed1i v\u1edbi c\xe1c NVL c\xf3 nhi\u1ec1u Nh\xe0 cung c\u1ea5p, th\xec s\u1ebd \u0111\u01b0\u1ee3c nh\xf3m l\u1ea1i th\xe0nh 1 ",(0,c.jsx)("b",{children:"S\u1ea3n ph\u1ea9m \u0111\u1ea1i di\u1ec7n"})," duy nh\u1ea5t."]}),(0,c.jsxs)("div",{className:"font-weight-normal",children:["B\u1ea1n c\xf3 th\u1ec3 th\xeam 1 ",(0,c.jsx)("b",{children:"S\u1ea3n ph\u1ea9m \u0111\u1ea1i di\u1ec7n"})," m\u1edbi ho\xe0n to\xe0n n\u1ebfu ch\u01b0a c\xf3, ho\u1eb7c c\xf3 th\u1ec3 ch\u1ecdn trong danh s\xe1ch"," ",(0,c.jsx)("b",{children:"Danh s\xe1ch g\u1ee3i \xfd s\u1ea3n ph\u1ea9m \u0111\u1ea1i di\u1ec7n \u0111\xe3 c\xf3"})," n\u1ebfu c\xf3 s\u1eb3n."]}),(0,c.jsxs)("div",{className:"font-weight-normal",children:["Ngo\xe0i ra, n\xfat"," ",(0,c.jsx)(h.A,{className:"btn-copy-example ".concat(j.copy?"btn-copy-example-active":""),children:(0,c.jsx)(l.A,{fa:"clone"})})," ","d\xf9ng \u0111\u1ec3 ",(0,c.jsx)("b",{children:"Copy"})," d\u1eef li\u1ec7u t\u1eeb c\u1ed9t ",(0,c.jsx)("b",{children:"T\xean s\u1ea3n ph\u1ea9m"})," \u0111\u1ec3 l\xe0m"," ",(0,c.jsx)("b",{children:"S\u1ea3n ph\u1ea9m \u0111\u1ea1i di\u1ec7n"}),"."]}),(0,c.jsx)("div",{style:{fontSize:"10px"},className:"bg-light mt-3 rounded p-2",children:(0,c.jsxs)("i",{children:[(0,c.jsx)("b",{style:{color:"red"},children:"*"})," ",(0,c.jsx)("b",{children:"Ch\xfa th\xedch :"})," Danh s\xe1ch g\u1ee3i \xfd s\u1ebd \u0111\u01b0\u1ee3c d\u1ef1a theo ",(0,c.jsx)("b",{children:"T\xean s\u1ea3n ph\u1ea9m"})," ho\u1eb7c"," ",(0,c.jsx)("b",{children:"S\u1ea3n ph\u1ea9m \u0111\u1ea1i di\u1ec7n"}),"."]})})]})]})]}),(0,c.jsxs)("div",{className:"position-relative d-flex form-is-copy-represent ".concat(m&&j.outline&&"gradient-border"),onClick:()=>T({copy:!1,outline:!1}),children:[(0,c.jsx)(a.Sm,{onChange:e=>{p(e.target.value),y(!0),o((e=>({...e,Id:null})))},value:m,className:"input-drop-represent",style:{paddingRight:!g.Id&&m?"7rem":"3rem"},placeholder:"S\u1ea3n ph\u1ea9m \u0111\u1ea1i di\u1ec7n",onClick:()=>{T({copy:!1,outline:!1}),y(!0)}}),(0,c.jsxs)("div",{className:"form-action-right-input-represent",children:[m&&f&&(0,c.jsx)("div",{onClick:()=>{o({Id:null,Name:""}),p("")},className:"btn-delete-value-represent",children:(0,c.jsx)(l.A,{fa:"times"})}),0!==g.Id&&!g.Id&&m&&(0,c.jsx)("div",{className:"bager-add-quick-represent",children:"Th\xeam m\u1edbi"}),(0,c.jsx)(h.A,{className:"btn-is-copy-represent ".concat(j.copy?"active":""),id:"TooltipBtnCopy",onClick:e=>{e.stopPropagation(),t?(0,d.A1)("B\u1ea1n c\xf3 ch\u1eafc ch\u1eafn mu\u1ed1n Copy d\u1eef li\u1ec7u t\u1eeb T\xean s\u1ea3n ph\u1ea9m \u0111\u1ec3 l\xe0m S\u1ea3n ph\u1ea9m \u0111\u1ea1i di\u1ec7n?","Th\xf4ng B\xe1o").then((()=>{T((e=>({...e,copy:!0}))),y(!0)})):T((e=>({outline:!e.outline,copy:!e.copy})))},children:(0,c.jsx)(l.A,{fa:"clone"})})]}),(0,c.jsx)(x,{openList:f,valueInput:m,setValue:p,close:()=>m&&D(),getEditValue:o,offCopy:()=>T({copy:!1,outline:!1})})]})]})]})},x=e=>{let{close:n,valueInput:t,setValue:a,getEditValue:s,openList:h,offCopy:l}=e;const[r,d]=(0,i.useState)([]);(0,i.useEffect)((()=>{(0,o.Pq)("DM_NguyenVatLieu?".concat(t?"$filter=(substringof('".concat(t,"', Name))"):""),"GET",null,!0,!1).then((e=>{d(null===e||void 0===e?void 0:e.value)}))}),[t]);return(0,c.jsx)(c.Fragment,{children:(0,c.jsxs)("div",{onClick:e=>e.stopPropagation(),className:"drop-list-suggest-represent ".concat(h?"":"drop-list-suggest-represent-close"),children:[(0,c.jsx)("div",{style:{fontSize:"10px"},className:"p-2 bg-light d-flex align-items-center justify-content-between",children:(0,c.jsx)("b",{children:"Danh s\xe1ch g\u1ee3i \xfd s\u1ea3n ph\u1ea9m \u0111\u1ea1i di\u1ec7n \u0111\xe3 c\xf3"})}),r.length?(0,c.jsx)("div",{className:"list-suggest-represent",children:r.map((e=>(0,c.jsx)(c.Fragment,{children:(0,c.jsx)("div",{onClick:()=>{return s({Id:(t=e).Id,Name:t.Name}),a(t.Name),n(),void l();var t},className:"item-suggest-represent",children:e.Name})})))}):(0,c.jsx)("div",{className:"p-4 bg-white d-flex justify-content-center text-center",children:(0,c.jsxs)("i",{className:"text-secondary",children:["Kh\xf4ng t\xecm th\u1ea5y s\u1ea3n ph\u1ea9m"," ",t&&'cho t\u1eeb kh\xf3a : "'.concat(t,'"')]})})]})})}},95688:(e,n,t)=>{"use strict";t.d(n,{A:()=>d});var i=t(9950),a=t(18849),s=(t(90530),t(65476)),h=t(67116),l=t(4370),r=t(44414);const d=e=>{let{soLuong:n,url:t,reloadListFix:d}=e;const[o,c]=(0,i.useState)(!1),[u,g]=(0,i.useState)(n),x=(0,i.useRef)();(0,s.W)(x,(()=>c(!1)));return(0,r.jsx)(r.Fragment,{children:o?(0,r.jsxs)("div",{ref:x,style:{gap:"0.3rem"},className:"d-flex",children:[(0,r.jsx)("input",{placeholder:"S\u1ed1 l\u01b0\u1ee3ng",type:"number",value:u,style:{width:"100%",minWidth:"5rem",border:"none"},onChange:e=>g(e.target.value)}),(0,r.jsx)(a.A,{onClick:()=>{u?(0,h.A1)("B\u1ea1n c\xf3 ch\u1eafc ch\u1eafn mu\u1ed1n s\u1eeda s\u1ed1 l\u01b0\u1ee3ng!","Th\xf4ng b\xe1o").then((()=>{(0,l.Pq)("".concat(t,"&soLuong=").concat(u),"POST",null,!1).then((e=>{(0,h.nw)("S\u1eeda th\xe0nh c\xf4ng","Th\xf4ng b\xe1o"),d&&d()})).catch((e=>(0,h.a3)("S\u1eeda th\u1ea5t b\u1ea1i","Th\xf4ng b\xe1o")))})):(0,h.AB)("B\u1ea1n ch\u01b0a nh\u1eadp s\u1ed1 l\u01b0\u1ee3ng","Th\xf4ng b\xe1o")},className:"btn-sua-so-luong-fix bg-success",children:"L\u01b0u"}),(0,r.jsx)(a.A,{onClick:()=>{c(!1)},className:"btn-sua-so-luong-fix bg-secondary",children:"H\u1ee7y"})]}):(0,r.jsx)("div",{className:"d-flex",children:(0,r.jsx)("p",{className:"mb-0 align-items-center",children:n})})})}},76115:(e,n,t)=>{"use strict";t.d(n,{A:()=>f});var i=t(58168),a=t(98587),s=t(64467),h=t(9950),l=t(11942),r=t.n(l),d=t(48738),o=t.n(d),c=t(44208),u=t(58367),g=["className","closeClassName","closeAriaLabel","cssModule","tag","color","isOpen","toggle","children","transition","fade","innerRef"];function x(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function m(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?x(Object(t),!0).forEach((function(n){(0,s.A)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):x(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var p={children:r().node,className:r().string,closeClassName:r().string,closeAriaLabel:r().string,cssModule:r().object,color:r().string,fade:r().bool,isOpen:r().bool,toggle:r().func,tag:c.Wx,transition:r().shape(u.A.propTypes),innerRef:r().oneOfType([r().object,r().string,r().func])},j={color:"success",isOpen:!0,tag:"div",closeAriaLabel:"Close",fade:!0,transition:m(m({},u.A.defaultProps),{},{unmountOnExit:!0})};function T(e){var n=e.className,t=e.closeClassName,s=e.closeAriaLabel,l=e.cssModule,r=e.tag,d=e.color,x=e.isOpen,p=e.toggle,j=e.children,T=e.transition,f=e.fade,y=e.innerRef,v=(0,a.A)(e,g),D=(0,c.qO)(o()(n,"alert","alert-"+d,{"alert-dismissible":p}),l),b=(0,c.qO)(o()("close",t),l),N=m(m(m({},u.A.defaultProps),T),{},{baseClass:f?T.baseClass:"",timeout:f?T.timeout:0});return h.createElement(u.A,(0,i.A)({},v,N,{tag:r,className:D,in:x,role:"alert",innerRef:y}),p?h.createElement("button",{type:"button",className:b,"aria-label":s,onClick:p},h.createElement("span",{"aria-hidden":"true"},"\xd7")):null,j)}T.propTypes=p,T.defaultProps=j;const f=T},38804:(e,n,t)=>{"use strict";t.d(n,{A:()=>o});var i=t(58168),a=t(9950),s=t(11942),h=t.n(s),l=t(19260),r={children:h().node},d=function(e){return a.createElement(l.A,(0,i.A)({group:!0},e))};d.propTypes=r;const o=d},27220:(e,n,t)=>{"use strict";t.d(n,{A:()=>x});var i=t(58168),a=t(98587),s=t(9950),h=t(11942),l=t.n(h),r=t(48738),d=t.n(r),o=t(44208),c=["className","cssModule","tag"],u={tag:o.Wx,className:l().string,cssModule:l().object},g=function(e){var n=e.className,t=e.cssModule,h=e.tag,l=(0,a.A)(e,c),r=(0,o.qO)(d()(n,"card-footer"),t);return s.createElement(h,(0,i.A)({},l,{className:r}))};g.propTypes=u,g.defaultProps={tag:"div"};const x=g},68879:(e,n,t)=>{"use strict";t.d(n,{A:()=>j});var i=t(58168),a=t(98587),s=t(9417),h=t(77387),l=t(9950),r=t(11942),d=t.n(r),o=t(48738),c=t.n(o),u=t(66609),g=t(44208),x=["className","cssModule","divider","tag","header","active","text"],m={children:d().node,active:d().bool,disabled:d().bool,divider:d().bool,tag:g.Wx,header:d().bool,onClick:d().func,className:d().string,cssModule:d().object,toggle:d().bool,text:d().bool},p=function(e){function n(n){var t;return(t=e.call(this,n)||this).onClick=t.onClick.bind((0,s.A)(t)),t.getTabIndex=t.getTabIndex.bind((0,s.A)(t)),t}(0,h.A)(n,e);var t=n.prototype;return t.getRole=function(){return"listbox"===this.context.menuRole?"option":"menuitem"},t.onClick=function(e){var n=this.props,t=n.disabled,i=n.header,a=n.divider,s=n.text;t||i||a||s?e.preventDefault():(this.props.onClick&&this.props.onClick(e),this.props.toggle&&this.context.toggle(e))},t.getTabIndex=function(){var e=this.props,n=e.disabled,t=e.header,i=e.divider,a=e.text;return n||t||i||a?"-1":"0"},t.render=function(){var e=this.getTabIndex(),n=e>-1?this.getRole():void 0,t=(0,g.cJ)(this.props,["toggle"]),s=t.className,h=t.cssModule,r=t.divider,d=t.tag,o=t.header,u=t.active,m=t.text,p=(0,a.A)(t,x),j=(0,g.qO)(c()(s,{disabled:p.disabled,"dropdown-item":!r&&!o&&!m,active:u,"dropdown-header":o,"dropdown-divider":r,"dropdown-item-text":m}),h);return"button"===d&&(o?d="h6":r?d="div":p.href?d="a":m&&(d="span")),l.createElement(d,(0,i.A)({type:"button"===d&&(p.onClick||this.props.toggle)?"button":void 0},p,{tabIndex:e,role:n,className:j,onClick:this.onClick}))},n}(l.Component);p.propTypes=m,p.defaultProps={tag:"button",toggle:!0},p.contextType=u.r;const j=p},15347:(e,n,t)=>{var i;window,e.exports=(i=t(9950),function(e){var n={};function t(i){if(n[i])return n[i].exports;var a=n[i]={i:i,l:!1,exports:{}};return e[i].call(a.exports,a,a.exports,t),a.l=!0,a.exports}return t.m=e,t.c=n,t.d=function(e,n,i){t.o(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:i})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,n){if(1&n&&(e=t(e)),8&n)return e;if(4&n&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(t.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&n&&"string"!=typeof e)for(var a in e)t.d(i,a,function(n){return e[n]}.bind(null,a));return i},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},t.p="",t(t.s=1)}([function(e,n){e.exports=i},function(e,n,t){"use strict";t.r(n),t.d(n,"useStateWithCallbackInstant",(function(){return s})),t.d(n,"useStateWithCallbackLazy",(function(){return h}));var i=t(0);function a(e,n){return function(e){if(Array.isArray(e))return e}(e)||function(e,n){var t=[],i=!0,a=!1,s=void 0;try{for(var h,l=e[Symbol.iterator]();!(i=(h=l.next()).done)&&(t.push(h.value),!n||t.length!==n);i=!0);}catch(e){a=!0,s=e}finally{try{i||null==l.return||l.return()}finally{if(a)throw s}}return t}(e,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var s=function(e,n){var t=a(i.useState(e),2),s=t[0],h=t[1];return i.useLayoutEffect((function(){return n(s)}),[s,n]),[s,h]},h=function(e){var n=i.useRef(null),t=a(i.useState(e),2),s=t[0],h=t[1];return i.useEffect((function(){n.current&&(n.current(s),n.current=null)}),[s]),[s,function(e,t){return n.current=t,h(e)}]};n.default=function(e,n){var t=a(i.useState(e),2),s=t[0],h=t[1];return i.useEffect((function(){return n(s)}),[s,n]),[s,h]}}]))},90530:()=>{},29079:()=>{}}]);