????

Your IP : 18.217.0.242


Current Path : C:/inetpub/vhost/qlk.nextform.vn/www/wwwroot/static/js/
Upload File :
Current File : C:/inetpub/vhost/qlk.nextform.vn/www/wwwroot/static/js/6708.794825fd.chunk.js

"use strict";(self.webpackChunkgdt=self.webpackChunkgdt||[]).push([[6708],{37746:(e,n,t)=>{t.d(n,{A:()=>o});var a=t(9950),s=t(78854),i=t(9330),l=t(44414);const h=a.forwardRef(((e,n)=>(0,l.jsx)(i.A,{direction:"up",ref:n,...e})));function o(e){const{children:n,onClose:t,open:a,className:i}=e;return(0,l.jsx)(s.A,{className:i,fullScreen:!0,open:a,onClose:t,TransitionComponent:h,children:n})}},82376:(e,n,t)=>{t.d(n,{A:()=>T});var a=t(9950),s=t(37746),i=t(69994),l=t(87092),h=t(29312),o=t(81270),r=t(39886),c=t(33322),d=t(44414);const u=(0,i.A)((e=>(0,l.A)({appBar:{position:"relative",backgroundColor:"rgb(3,56,99)"},toolbar:{minHeight:40},title:{marginLeft:e.spacing(2),flex:1}})));function m(e){const n=u(),{renderCustom:t,renderButton:a,title:s,onClose:i}=e;return(0,d.jsx)(h.A,{className:n.appBar,children:(0,d.jsxs)(o.A,{className:n.toolbar,variant:"dense",children:[t,(0,d.jsx)(r.A,{variant:"h6",className:n.title,children:s}),a,(0,d.jsx)(c.A,{onClick:i,children:"\u0110\xf3ng"})]})})}var g=t(77766);function p(e){return(0,d.jsx)(g.A,{style:{backgroundColor:"#eee",paddingTop:20,overflow:"unset"},children:e.children})}function x(e){const{renderCustom:n,renderButton:t,children:i,title:l,onClose:h,open:o,className:r}=e;return(0,a.useEffect)((()=>{}),[o]),(0,d.jsxs)(s.A,{className:r,open:o,onClose:h,children:[(0,d.jsx)(m,{renderCustom:n,renderButton:t,title:l,onClose:h}),(0,d.jsx)(p,{children:i})]})}const T=a.memo(x)},38886:(e,n,t)=>{t.d(n,{A:()=>r});var a,s=t(57528),i=(t(9950),t(86006)),l=t(36841),h=t(44414);const o=e=>{let{label:n,value:t,className:a,style:s}=e;return(0,h.jsxs)(c,{style:s,className:"comp-thanh-tien "+a,children:[(0,h.jsxs)("span",{className:"mr-2",children:[n,":"]}),(0,h.jsx)("span",{children:(0,l.vv)(t)})]})},r=o,c=i.Ay.div(a||(a=(0,s.A)(["\n    span:first-child{\n        font-weight: 500\n    }\n    span:last-child{\n        letter-spacing: 0.2px\n    }\n"])));o.defaultProps={className:"pull-right",label:"Th\xe0nh ti\u1ec1n",value:0}},22161:(e,n,t)=>{t.d(n,{A:()=>l});var a=t(9950),s=t(73613),i=t(44414);const l=e=>{const n=(0,a.useRef)(),{onSearch:t,className:l,placeholder:h}=e;(0,a.useEffect)((()=>{window.addEventListener("keydown",o),window.addEventListener("keyup",r)}),[]);const o=e=>{if(114===e.which)return e.preventDefault(),!1},r=e=>{114===e.which&&n.current&&n.current.focus()};return(0,i.jsxs)("div",{className:"search-box-XH pull-right "+(l||""),children:[(0,i.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:h||"T\xecm s\u1ea3n ph\u1ea9m theo m\xe3 ho\u1eb7c t\xean (F3)"}),(0,i.jsx)("span",{className:"btn-tim-kiem-XH",children:(0,i.jsx)(s.A,{fa:"search"})})]})}},96708:(e,n,t)=>{t.r(n),t.d(n,{default:()=>Z});var a=t(9950),s=t(76115),i=t(53744),l=t(18383),h=t(30616),o=t(28412),r=t(62181),c=t(32385),d=t(85560),u=t(7175);const m={value:"luu_tam",label:"L\u01b0u t\u1ea1m"},g={value:"hoan_thanh",label:"Ho\xe0n th\xe0nh"};var p=t(44414);const x=[{field:"Id",type:"numeric",dataID:!0,hidden:!0,editable:"never"},{title:"Ng\xe0y ch\u1ee9ng t\u1eeb",field:"NgayTao",type:"datetime",editable:"never",defaultSort:"desc",cellStyle:{textAlign:"left"}},{title:"M\xe3 ch\u1ee9ng t\u1eeb",field:"MaXuatHuy",type:"string"},{title:"T\u1ed5ng gi\xe1 tr\u1ecb h\u1ee7y",field:"TongGiaTri",type:"currency"},{title:"Kho h\u1ee7y",field:"DM_Kho.Ten",type:"string",dataRef:["Kho_Id"]},{title:"Tr\u1ea1ng th\xe1i",field:"TrangThai",type:"string",cellStyle:{textAlign:"center"},render:e=>{switch(e.TrangThai){case m.value:return(0,p.jsx)(u.default,{color:"primary",children:m.label});case g.value:return(0,p.jsx)(u.default,{color:"success",children:g.label});default:return(0,p.jsx)(u.default,{color:"danger",children:"L\u1ed7i"})}}}];t(29079);var T=t(39051),j=t(18849),f=t(70349),y=t(23931),v=t(67116),C=t(82376),D=t(73613),N=t(4370),S=t(57528),A=t(50651),b=t(75490),w=t(76991),I=t(27220),H=t(86006),k=t(36841),_=t(53139),P=t(38886),M=t(22161),E=t(45248),L=t(15986),G=t(73032),V=t(53832),K=t(8434);const X={MaXuatHuy:{field_name:"MaXuatHuy",title:"M\xe3 ch\u1ee9ng t\u1eeb:",displayWarning:"M\xe3 ch\u1ee9ng t\u1eeb",type:"label"},NgayTao:{field_name:"NgayTao",title:"Ng\xe0y ch\u1ee9ng t\u1eeb:",displayWarning:"Ng\xe0y ch\u1ee9ng t\u1eeb",type:"datetime",icon:!0,isDetail:!0,defaultValue:new Date},GhiChu:{field_name:"GhiChu",title:"Ghi ch\xfa:",type:"textarea",rows:"4"},NhaCungCap_Id:{field_name:"NhaCungCap_Id",title:"Nh\xe0 cung c\u1ea5p:",type:"data-select",required:!0,dataSelect:{url:"DM_LienHe",where:"NhomLienHe_Id eq '".concat(K.M.NCC,"' and IsDeleted ne ",!0),column:["Id","Ten"],value_field:"Id",text_field:"Ten",placeholder:"Ch\u1ecdn nh\xe0 cung c\u1ea5p.."}},NhomDonViTinh_Id:{field_name:"NhomDonViTinh_Id",title:"Nh\xf3m \u0111\u01a1n v\u1ecb t\xednh:",type:"data-select",dataSelect:{url:"DM_NhomDonViTinh",column:["MaNhom","TenNhom"],value_field:"MaNhom",text_field:"TenNhom",placeholder:"Ch\u1ecdn nh\xf3m \u0111\u01a1n v\u1ecb t\xednh"}}},q=e=>{const{data:n,onChange:t,isDetail:a,ID:s}=e;return(0,p.jsxs)(G.default,{md:"6",className:"mb-0",children:[(0,p.jsxs)(L.default,{children:[s&&(0,p.jsx)(V.A,{data:X.MaXuatHuy,value:n.MaXuatHuy,inline:!1,style:{paddingTop:4}}),(0,p.jsx)(V.A,{data:X.NgayTao,value:n.NgayTao,isDetail:a,inline:!1})]}),(0,p.jsx)(L.default,{children:(0,p.jsx)(V.A,{data:X.GhiChu,value:n.GhiChu,isDetail:a,onChange:t,inline:!1})})]})};var F;const R=(0,a.forwardRef)(((e,n)=>{const{OnAddDataChiTiet:t,ID:s,handleChange:i,data:l,toggleLDH:h,OnToggleLDH:o,TongGiaTri:r}=e,[c,d]=(0,a.useState)([]),[u,m]=(0,a.useState)([]);(0,a.useImperativeHandle)(n,(()=>({add(e){let n={...e,SanPhamXuatHuy_Id:e.Id,SoLuong:1,GiaTriHuy:e.GiaVon};d([...c,n])}}))),(0,a.useEffect)((()=>{s&&g()}),[s]),(0,a.useEffect)((()=>{m(c),t&&t(c)}),[c]);const g=()=>{(0,N.Pq)("ChiTietXuatHuys?$filter=XuatHuy_Id eq ".concat(s,"&$expand=DM_SanPhamDichVu,DM_DonViTinh"),"GET",null).then((e=>d(e.value.map(((e,n)=>({...e,TenSanPham:e.DM_SanPhamDichVu.TenSanPham,DonViTinh:e.DM_DonViTinh.Ten})))))).catch((e=>(0,v.a3)("Kh\xf4ng th\u1ec3 t\u1ea3i d\u1eef li\u1ec7u chi ti\u1ebft xu\u1ea5t h\u1ee7y","Th\xf4ng b\xe1o")))};return(0,p.jsxs)(A.A,{children:[(0,p.jsxs)(b.A,{children:[(0,p.jsx)("b",{children:"Chi ti\u1ebft phi\u1ebfu xu\u1ea5t h\xe0ng"}),(0,p.jsx)(E.A,{displayColTimKiemSanPham:h,toggledisplayColTimKiemSanPham:()=>o&&o()}),(0,p.jsx)(M.A,{className:"mr-2",onSearch:e=>(e=>{let n=c.filter((n=>n.TenSanPham.toUpperCase().includes(e.toUpperCase().trim())));m(n)})(e)})]}),(0,p.jsxs)(w.A,{children:[(0,p.jsx)(q,{data:l,onChange:i,ID:s}),(0,p.jsxs)("table",{width:"100%",children:[(0,p.jsx)("thead",{children:(0,p.jsxs)("tr",{children:[(0,p.jsx)("td",{children:"STT"}),(0,p.jsx)("td",{children:"T\xean h\xe0ng"}),(0,p.jsx)("td",{children:"\u0110VT"}),(0,p.jsx)("td",{style:{width:150},children:"SL h\u1ee7y"}),(0,p.jsx)("td",{children:"Gi\xe1 v\u1ed1n"}),(0,p.jsx)("td",{children:"Gi\xe1 tr\u1ecb h\u1ee7y"}),(0,p.jsx)("td",{})]})}),(0,p.jsx)("tbody",{children:u&&u.map(((e,n)=>(0,p.jsxs)("tr",{children:[(0,p.jsx)("td",{children:n+1}),(0,p.jsx)("td",{className:"text-left",children:e.TenSanPham}),(0,p.jsx)("td",{children:e.DonViTinh}),(0,p.jsx)("td",{className:"text-right",children:(0,p.jsx)(_.YI,{min:"1",onFocus:e=>e.target.select(),value:parseFloat(e.SoLuong),onChange:e=>((e,n)=>{let t=c.slice(),a=t[n];a={...a,SoLuong:e,GiaTriHuy:parseInt(e||0)*parseFloat(a.GiaVon)},t[n]=a,d(t)})(e.target.value,n)})}),(0,p.jsx)("td",{children:(0,k.vv)(e.GiaVon)}),(0,p.jsx)("td",{children:(0,k.vv)(e.GiaTriHuy)}),(0,p.jsx)("td",{className:"text-center",children:(0,p.jsx)(B,{onClick:()=>(e=>{let n=c.filter(((n,t)=>t!==e));d(n)})(n),children:(0,p.jsx)(D.A,{fa:"times",style:{cursor:"pointer",color:"#f64846",fontSize:"15px"}})})})]},n)))})]})]}),(0,p.jsx)(I.A,{children:(0,p.jsx)(P.A,{label:"T\u1ed5ng gi\xe1 tr\u1ecb h\u1ee7y",value:r})})]})})),B=H.Ay.span(F||(F=(0,S.A)(["\n"])));var O=t(78873);const U=(0,a.forwardRef)(((e,n)=>{const t=e=>{if(115===e.which)return e.preventDefault(),!1;13===e.which?(u&&(null===u||void 0===u?void 0:u.length)>0&&h(u[g]),I()):40===e.which?g<u.length-1&&x(++g):38===e.which&&g>0&&x(--g)},s=e=>{115===e.which&&I()},{NhanVienBanHang_Id:l,OnAddItem:h,OnCheckExsist:o}=e,r=(0,a.useRef)(),[c,d]=(0,a.useState)([]),[u,m]=(0,a.useState)([]);let[g,x]=(0,a.useState)(0);const[T,j]=(0,a.useState)(""),[f,y]=(0,a.useState)(null),[C,S]=(0,a.useState)(null);(0,a.useEffect)((()=>(window.addEventListener("keydown",t),window.addEventListener("keyup",s),()=>{window.removeEventListener("keydown",t),window.removeEventListener("keyup",s)})),[t,s]),(0,a.useEffect)((()=>{n.current.getData()}),[l]),(0,a.useEffect)((()=>{H("")}),[c]),(0,a.useEffect)((()=>{n.current.getData()}),[C,f]),(0,a.useImperativeHandle)(n,(()=>({getData(){(0,N.Pq)("SanPham/ThongTinSanPhamTonKho?diemKinhDoanhId=".concat(i.b9.DiemKinhDoanhId,"&nccId=").concat(f||"","&nhomDonViTinh=").concat(C||""),"GET",null,!1).then((e=>d(e.filter((e=>parseInt(e.SoLuongTon||0)>0))))).catch((e=>(0,v.a3)("Kh\xf4ng th\u1ec3 t\u1ea3i d\u1eef li\u1ec7u xu\u1ea5t h\xe0ng","Th\xf4ng b\xe1o")))}})));const I=()=>{r.current&&r.current.focus()},H=e=>{j(e),x(0),m(c.filter((n=>n.MaSanPham.toUpperCase().includes(e.toUpperCase().trim())||n.TenSanPham.toUpperCase().includes(e.toUpperCase().trim())))),0===c.length&&(r.current.value="")},_=u||c;return(0,p.jsx)(a.Fragment,{children:(0,p.jsxs)(A.A,{className:"tim-kiem-san-pham xuat-huy",children:[(0,p.jsx)(b.A,{children:(0,p.jsx)("b",{children:"T\xecm ki\u1ebfm s\u1ea3n ph\u1ea9m"})}),(0,p.jsxs)(w.A,{children:[(0,p.jsx)(V.A,{inline:!0,data:X.NhaCungCap_Id,value:f,styleRow:{fontSize:"14px"},onChange:(e,n)=>y(n)}),(0,p.jsx)(V.A,{inline:!0,data:X.NhomDonViTinh_Id,value:C,styleRow:{fontSize:"14px"},onChange:(e,n)=>S(n)}),(0,p.jsxs)("div",{className:"search-box pull-right",children:[(0,p.jsx)("input",{ref:r,className:"form-control-sm form-control",defaultValue:T,onChange:e=>H(e.target.value.trim()),placeholder:"T\xecm \u0111\u01a1n h\xe0ng theo m\xe3 ho\u1eb7c t\xean kh\xe1ch h\xe0ng... (F4)"}),(0,p.jsx)("span",{className:"btn-tim-kiem",children:(0,p.jsx)(D.A,{fa:"search"})})]}),(0,p.jsx)("div",{className:"search-results",children:(0,p.jsx)("div",{className:"list-result",children:(null===_||void 0===_?void 0:_.length)>0?_.map(((e,n)=>(0,p.jsxs)("div",{className:n===g?"list-item focus-one":"list-item",onMouseEnter:()=>x(n),children:[(0,p.jsx)("div",{className:"image",children:(0,p.jsx)("img",{src:e.HinhAnh?"api/"+e.HinhAnh:"assets/default.jpg",width:"45",alt:""})}),(0,p.jsxs)("div",{className:"info",onClick:()=>{h(e)},children:[(0,p.jsxs)("div",{style:{position:"relative"},children:[(0,p.jsx)("span",{children:e.MaSanPham})," - ",e.TenSanPham,(0,p.jsx)(O.A,{color:"success",style:{position:"absolute",top:0,right:0,display:o(e)?"block":"none"},children:"\u0110\xe3 th\xeam"})]}),(0,p.jsxs)("div",{children:[(0,p.jsxs)("span",{children:["Gi\xe1 NC: ",(0,k.vv)(e.GiaNhapCuoi)]}),(0,p.jsxs)("span",{children:["T\u1ed3n: ",e.SoLuongTon||e.SoLuongTonQuyDoi?(0,p.jsxs)(p.Fragment,{children:[e.SoLuongTon?e.SoLuongTon:0,"/",e.SoLuongTonQuyDoi?e.SoLuongTonQuyDoi:0]}):(0,p.jsx)(O.A,{color:"danger",children:"H\u1ebft h\xe0ng"})]}),(0,p.jsxs)("span",{children:["KH \u0111\u1eb7t: ",e.SoLuongTreoCoBan?e.SoLuongTreoCoBan:0,"/",e.SoLuongTreoQuyDoi?e.SoLuongTreoQuyDoi:0]})]})]})]},e.Id))):u?(0,p.jsxs)("div",{className:"list-item",style:{minHeight:"150px",justifyContent:"center"},children:[" ","Kh\xf4ng c\xf3 k\u1ebft qu\u1ea3 ph\xf9 h\u1ee3p!"]}):""})})]})]})})})),Q=e=>{const n=(0,a.useRef)(),t=(0,a.useRef)(),{open:s,onClose:l,ID:h,OnReloadTable:o}=e,[r,c]=(0,a.useState)({}),[d,u]=(0,a.useState)(!0);(0,a.useEffect)((()=>{h&&T()}),[h]),(0,a.useEffect)((()=>{r.chiTiet&&b()}),[r.chiTiet]);const x=h?"S\u1eeda phi\u1ebfu xu\u1ea5t h\u1ee7y":"T\u1ea1o phi\u1ec3u xu\u1ea5t h\u1ee7y",T=()=>{(0,N.Pq)("XuatHuys(".concat(h,")"),"GET",null).then((e=>c({...r,...e}))).catch((e=>(0,v.a3)("Kh\xf4ng th\u1ec3 t\u1ea3i d\u1eef li\u1ec7u xu\u1ea5t h\u1ee7y","Th\xf4ng b\xe1o")))},S=e=>{if(A()){let n=h?"XuatHuy/CapNhatXuatHuy":"XuatHuy/TaoPhieuXuatHuy",t=h?"C\u1eadp nh\u1eadt phi\u1ebfu xu\u1ea5t h\u1ee7y th\xe0nh c\xf4ng":"T\u1ea1o phi\u1ebfu xu\u1ea5t h\u1ee7y th\xe0nh c\xf4ng",a={Id:h||"",...r,Kho_Id:i.b9.Kho_Id,TrangThai:e};(0,N.Pq)(n,"POST",JSON.stringify(a),!1).then((e=>{o(),(0,v.nw)(t,"Th\xf4ng b\xe1o"),l()})).catch((e=>(0,v.a3)(e.Message,"Th\xf4ng b\xe1o")))}},A=()=>!(r.chiTiet.length<1)||((0,v.AB)("Ch\u01b0a nh\u1eadp chi ti\u1ebft phi\u1ebfu xu\u1ea5t h\u1ee7y","Th\xf4ng b\xe1o"),!1),b=()=>{let e=0,n=r.chiTiet||[];n.forEach(((t,a)=>{e+=parseFloat(t.GiaTriHuy||0),a===n.length-1&&c({...r,TongGiaTri:e})}))};return(0,p.jsx)(C.A,{className:"custom-modal",title:x,open:s,onClose:l,renderButton:(0,p.jsxs)(a.Fragment,{children:[(0,p.jsxs)(j.A,{className:"mr-2",size:"sm",color:"primary",onClick:()=>S(m.value),children:[(0,p.jsx)(D.A,{fa:"save"})," ","L\u01b0u t\u1ea1m"]}),(0,p.jsxs)(j.A,{className:"mr-2",size:"sm",color:"success",onClick:()=>S(g.value),children:[(0,p.jsx)(D.A,{fa:"save"})," ","Ho\xe0n th\xe0nh"]})]}),children:(0,p.jsxs)(f.A,{className:"tao-phieu-nhap-hang custom-modal modal-nhap-kho",children:[(0,p.jsx)(y.A,{md:d?"8":"12",className:"chi-tiet-nhap-hang",children:(0,p.jsx)(R,{ref:n,ID:h,data:r,handleChange:(e,n)=>{r[e]=n,c({...r})},toggleLDH:d,TongGiaTri:r.TongGiaTri||0,OnToggleLDH:()=>u(!d),OnAddDataChiTiet:e=>(e=>{c({...r,chiTiet:e})})(e)})}),(0,p.jsx)(y.A,{md:"4",className:d?"tim-kiem-san-pham show":"tim-kiem-san-pham hide",children:(0,p.jsx)(U,{ref:t,OnAddItem:e=>n.current.add(e),OnCheckExsist:e=>{}})})]})})},z=e=>{const{ID:n,data:t,TongGiaTri:s}=e,[i,l]=(0,a.useState)([]),[h,o]=(0,a.useState)([]);(0,a.useEffect)((()=>{n&&r()}),[n]),(0,a.useEffect)((()=>{o(i)}),[i]);const r=()=>{(0,N.Pq)("ChiTietXuatHuys?$filter=XuatHuy_Id eq ".concat(n,"&$expand=DM_SanPhamDichVu,DM_DonViTinh"),"GET",null).then((e=>l(e.value.map(((e,n)=>({...e,TenSanPham:e.DM_SanPhamDichVu.TenSanPham,DonViTinh:e.DM_DonViTinh.Ten})))))).catch((e=>(0,v.a3)("Kh\xf4ng th\u1ec3 t\u1ea3i d\u1eef li\u1ec7u chi ti\u1ebft xu\u1ea5t h\u1ee7y","Th\xf4ng b\xe1o")))};return(0,p.jsxs)(A.A,{children:[(0,p.jsxs)(b.A,{children:[(0,p.jsx)("b",{children:"Chi ti\u1ebft phi\u1ebfu xu\u1ea5t h\xe0ng"}),(0,p.jsx)(M.A,{className:"mr-2",onSearch:e=>(e=>{let n=i.filter((n=>n.TenSanPham.toUpperCase().includes(e.toUpperCase().trim())));o(n)})(e)})]}),(0,p.jsxs)(w.A,{children:[(0,p.jsx)(q,{data:t,isDetail:!0,ID:n}),(0,p.jsxs)("table",{width:"100%",children:[(0,p.jsx)("thead",{children:(0,p.jsxs)("tr",{children:[(0,p.jsx)("td",{children:"STT"}),(0,p.jsx)("td",{children:"T\xean h\xe0ng"}),(0,p.jsx)("td",{children:"\u0110VT"}),(0,p.jsx)("td",{style:{width:150},children:"SL h\u1ee7y"}),(0,p.jsx)("td",{children:"Gi\xe1 v\u1ed1n"}),(0,p.jsx)("td",{children:"Gi\xe1 tr\u1ecb h\u1ee7y"})]})}),(0,p.jsx)("tbody",{children:h&&h.map(((e,n)=>(0,p.jsxs)("tr",{children:[(0,p.jsx)("td",{children:n+1}),(0,p.jsx)("td",{children:e.TenSanPham}),(0,p.jsx)("td",{children:e.DonViTinh}),(0,p.jsx)("td",{className:"text-right",children:(0,k.vv)(e.SoLuong)}),(0,p.jsx)("td",{children:(0,k.vv)(e.GiaVon)}),(0,p.jsx)("td",{children:(0,k.vv)(e.GiaTriHuy)})]},n)))})]})]}),(0,p.jsx)(I.A,{children:(0,p.jsx)(P.A,{label:"T\u1ed5ng gi\xe1 tr\u1ecb h\u1ee7y",value:s})})]})},$=e=>{const{open:n,onClose:t,ID:s}=e,[i,l]=(0,a.useState)({});(0,a.useEffect)((()=>{s&&h()}),[s]);const h=()=>{(0,N.Pq)("XuatHuys(".concat(s,")"),"GET",null).then((e=>l({...i,...e}))).catch((e=>(0,v.a3)("Kh\xf4ng th\u1ec3 t\u1ea3i d\u1eef li\u1ec7u xu\u1ea5t h\u1ee7y","Th\xf4ng b\xe1o")))};return(0,p.jsx)(C.A,{className:"custom-modal",title:"Th\xf4ng tin phi\u1ebfu xu\u1ea5t h\u1ee7y",open:n,onClose:t,children:(0,p.jsx)(f.A,{className:"tao-phieu-nhap-hang custom-modal modal-nhap-kho",children:(0,p.jsx)(y.A,{md:"12",className:"chi-tiet-nhap-hang",children:(0,p.jsx)(z,{ID:s,data:i,TongGiaTri:i.TongGiaTri||0})})})})},Y=a.createRef(),W=()=>Y.current&&Y.current.onQueryChange(),J=e=>{const[n,t]=(0,a.useState)(""),[s,u]=(0,a.useState)([]),[m,j]=(0,a.useState)(null),[f,y]=(0,a.useState)(null),[C,D]=(0,a.useState)(!1),[S,A]=(0,a.useState)(!1),[b,w]=(0,a.useState)(0),[I,H]=(0,a.useState)(0),[k,_]=(0,a.useState)(i.lg.MaTaiKhoan);(0,a.useEffect)((()=>{W()}),[s]),(0,a.useLayoutEffect)((()=>{D(0!==b)}),[b]),(0,a.useEffect)((()=>{A(0!==I)}),[I]),(0,a.useEffect)((()=>{let e=[];e.push("IsDeleted ne true"),n&&e.push("substringof('".concat(n,"', MaXuatHuy)")),m&&f&&e.push("(NgayTao gt (datetime'".concat(m,"') and NgayTao lt (datetime'").concat(f,"'))")),k&&e.push("NguoiTao eq '".concat(k,"'")),u([...e])}),[n,m,f,k]);return(0,p.jsxs)(h.A,{className:"Module-XH",children:[(0,p.jsxs)(o.A,{NoTabs:!0,PageBaoCao:!0,children:[(0,p.jsx)(r.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,p.jsx)(r.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(i.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:k,onChange:e=>_(e)}),(0,p.jsx)(r.A,{className:"mb-2",title:"Th\u1eddi gian",type:"date-report",onChangeDate:(e,n,t)=>{j(n?(0,l.A)(n,"yyyy-MM-dd"):null),y(t?(0,l.A)(t,"yyyy-MM-dd")+"T23:59:59.000":null)},status:!0,defaultValueDate:T.Eb.ToanThoiGian})]}),(0,p.jsxs)(c.A,{NoTabs:!0,children:[(0,p.jsx)(d.A,{tableRef:Y,title:"Danh s\xe1ch phi\u1ebfu xu\u1ea5t h\u1ee7y",url:"XuatHuys",columns:x,where:s.join(" and "),selectType:"withColumns",onAdd:{disabled:!1,onClick:(e,n)=>w(null)},onEdit:{disabled:e=>e.TrangThai===g.value,onClick:(e,n)=>w(n.Id)},onDelete:{onClick:(e,n)=>(0,v.A1)("B\u1ea1n ch\u1eafc ch\u1eafn mu\u1ed1n x\xf3a phi\u1ebfu xu\u1ea5t h\u1ee7y n\xe0y?","Th\xf4ng b\xe1o").then((()=>{return e=n.Id,void(0,N.Pq)("XuatHuy/XoaXuatHuy?xuatHuy_Id=".concat(e),"DELETE",null,!1).then((n=>{W(),(0,v.nw)("X\xf3a phi\u1ebfu xu\u1ea5t h\u1ee7y ".concat(e," th\xe0nh c\xf4ng!"),"Th\xf4ng b\xe1o")})).catch((e=>(0,v.a3)(e.Message,"Th\xf4ng b\xe1o")));var e}))},onRowClick:(e,n)=>H(n.Id)}),C&&(0,p.jsx)(Q,{ID:b,open:C,OnReloadTable:()=>W(),onClose:()=>w(0)}),S&&(0,p.jsx)($,{ID:I,open:S,onClose:()=>H(0)})]})]})};class Z extends a.Component{constructor(e){super(e),this.state={}}render(){return(0,p.jsx)(a.Fragment,{children:i.b9.Kho_Id?(0,p.jsx)(J,{CurrentKho:{Id:i.b9.Kho_Id,IsKhoTong:i.b9.IsKhoTong,DiemKinhDoanh_Id:i.b9.DiemKinhDoanhId}}):(0,p.jsx)(s.A,{color:"warning",children:"B\u1ea1n ch\u01b0a c\xf3 quy\u1ec1n s\u1eed d\u1ee5ng ch\u1ee9c n\u0103ng n\xe0y"})})}}},45248:(e,n,t)=>{t.d(n,{A:()=>l});var a=t(9950),s=t(73613),i=t(44414);class l extends a.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,i.jsxs)("span",{className:"d-flex pull-right btn-expand",style:{alignItems:"center"},onClick:e,children:[(0,i.jsx)(s.A,{fa:n?"arrow-circle-right":"arrow-circle-left"})," "," (F2)"]})}}},8434:(e,n,t)=>{t.d(n,{M:()=>a});const a={KH:"khachhang",NCC:"nhacungcap"}},32385:(e,n,t)=>{t.d(n,{A:()=>l});var a=t(9950),s=t(23931),i=t(44414);class l extends a.Component{render(){let{children:e,className:n,FilterSearchAdvanced:t,FilterNoHeader:a,NoTabs:l}=this.props,h=[];return n&&h.push(n),h.push("filter-datatable"),t&&h.push("filter-search-advanced"),a&&h.push("filter-no-header"),l&&h.push("filter-no-tabs"),(0,i.jsx)(s.A,{className:h.join(" "),md:"9",children:e})}}l.defaultProps={className:"",FilterSearchAdvanced:"",FilterNoHeader:"",NoTabs:""}},29079:()=>{}}]);