????
Current Path : C:/inetpub/vhost/qlk.nextform.vn/www/wwwroot/static/js/ |
Current File : C:/inetpub/vhost/qlk.nextform.vn/www/wwwroot/static/js/7427.89e3c180.chunk.js |
"use strict";(self.webpackChunkgdt=self.webpackChunkgdt||[]).push([[7427],{53832:(e,n,a)=>{a.d(n,{A:()=>P});a(9950);var i=a(76152),l=a(23931),t=a(48274),d=a(46499),o=a(31409),h=a(9326),s=a(69754),c=a(44754),r=a(97159),u=a(65907),m=a(47495),v=a(60666),g=a(53139),p=a(62267),D=a(94265),f=a(17790),x=a(36841),N=a(71739),b=a(73613),T=a(70537),_=a(44414);const j=e=>{var n;let{data:a,onChange:i,value:l,isDetail:t,mustLabel:d,options:h,onClickQuickAdd:j}=e;const I=e=>"Nh\u1eadp ".concat(e.toLowerCase());let P=t&&"data-select"!==a.type?"label":a.type;if(d)return(0,_.jsx)("span",{children:l});switch(P){case"label":return(0,_.jsx)("span",{children:"datetime"===a.type?(0,x.Yq)(l):"radio-list"===a.type?a.data&&(null===(n=a.data.find((e=>e.value===l)))||void 0===n?void 0:n.label):l});case"textbox":default:return(0,_.jsx)(o.A,{autoComplete:a.autoComplete||"off",disabled:!!a.disabled&&a.disabled,name:a.field_name,value:null==l?"":l,onChange:e=>i&&i(e.target.name,e.target.value),placeholder:I(a.title)});case"password":return(0,_.jsx)(g._2,{name:a.field_name,value:null==l?"":l,onChange:e=>i&&i(e.target.name,e.target.value),placeholder:I(a.title)});case"textarea":return(0,_.jsx)(c.A,{autoComplete:a.autoComplete||"off",rows:a.rows||"3",disabled:!!a.disabled&&a.disabled,name:a.field_name,value:null==l?"":l,onChange:e=>i&&i(e.target.name,e.target.value),placeholder:I(a.title)});case"datetime":return(0,_.jsxs)("div",{className:a.icon?"form-control-icon":"",style:{pointerEvents:a.isDetail?"none":"auto"},children:[(0,_.jsx)(s.A,{autoComplete:a.autoComplete||"off",name:a.field_name,value:a.defaultValue||l,onChange:e=>i&&i(a.field_name,e),placeholderText:a.placeholder||I(a.title)}),a.icon&&(0,_.jsx)(b.A,{fa:"calendar"})]});case"data-select":return a.dataSelect&&(0,_.jsx)(_.Fragment,{children:(0,_.jsx)(r.A,{isDetail:t,isMulti:!!a.dataSelect.isMulti&&a.dataSelect.isMulti,disabled:!!a.disabled&&a.disabled,url:a.dataSelect.url,odata:a.dataSelect.odata,where:a.dataSelect.where,group_by:a.dataSelect.group_by,columns:a.dataSelect.columns,valueField:a.dataSelect.value_field,textField:a.dataSelect.text_field,textFieldSub:a.dataSelect.text_field_sub,options:h||a.dataSelect.options,value:l,placeholder:a.dataSelect.placeholder,addItem:!!a.addItem&&a.addItem,urlAddItem:a.urlAddItem,columnAddItem:a.columnAddItem,onChange:(e,n)=>{i&&i(a.field_name,e,n)},onClickQuickAdd:j})});case"data-select-async":return a.dataSelect&&(0,_.jsx)(T.rb,{disabled:!!a.disabled&&a.disabled,value:l||"",url:a.dataSelect.url,column:a.dataSelect.column,isResultValue:a.dataSelect.isResultValue,options:a.dataSelect.options,whereOne:a.dataSelect.whereOne,where:a.dataSelect.where,addItem:!!a.addItem&&a.addItem,urlAddItem:a.urlAddItem,columnAddItem:a.columnAddItem,onClickQuickAdd:j,urlGetAPIId:a.dataSelect.urlGetAPIId,fieldSearchAPI:a.dataSelect.fieldSearchAPI,onChange:e=>{e?i(a.field_name,e.value):i(null)}});case"numeric":case"currency":return(0,_.jsx)(v.A,{autoComplete:a.autoComplete||"off",id:"ctl_".concat(a.field_name),className:"number-format",disabled:!!a.disabled&&a.disabled,value:l,placeholder:"0",thousandSeparator:a.thousandSeparator,decimalSeparator:a.decimalSeparator,onValueChange:e=>{i&&i(a.field_name,e.value)},onFocus:e=>e.target.select()});case"radio-list":return(0,_.jsx)(u.A,{name:a.field_name,disabled:!!a.disabled&&a.disabled,data:a.data,value:l,onChange:n=>i&&e.onChange(a.field_name,n)});case"checkbox":return(0,_.jsx)(N.A,{type:"checkbox",name:a.field_name,disabled:!!a.disabled&&a.disabled,checked:l,onChange:n=>i&&e.onChange(a.field_name,n),label:a.label||""});case"checkbox-list":return(0,_.jsx)(m.A,{name:a.field_name,disabled:!!a.disabled&&a.disabled,data:a.data,value:l,onChange:n=>i&&e.onChange(a.field_name,n)});case"select-year":return(0,_.jsx)(p.A,{disabled:!!a.disabled&&a.disabled,value:l,onChange:n=>{i&&e.onChange(a.field_name,n&&n.value)},placeholder:I(a.title)});case"select-custom":return(0,_.jsx)(D.A,{value:l,onChange:n=>{i&&e.onChange(a.field_name,n&&n.value)},options:e.data.options});case"select-month":return(0,_.jsx)(f.A,{value:l,onChange:n=>{i&&e.onChange(a.field_name,n&&n.value)}})}},I=e=>{let{inline:n}=e;const{data:a,value:o,onChange:s,onChangeRender:c,inline_equal:r,style:u,styleTitle:m,styleRow:v,isDetail:g,className:p}=e;n="break"!==n&&(!!n||!(!g&&"label"!==a.type));return a&&"hidden"!==a.type&&(0,_.jsxs)(i.A,{style:v,row:!0,className:"form-control-".concat(a.field_name).concat(g?" isDetail":""," ").concat(p||""),children:[!0!==a.hidden_label&&(0,_.jsx)(l.A,{md:!1===n?"12":r?"6":"4",children:a.required?(0,_.jsx)(d.A,{style:m,children:a.title}):(0,_.jsx)(t.A,{style:m,children:a.title})}),(0,_.jsx)(l.A,{md:!1===n||!0===a.hidden_label?"12":r?"6":"8",style:u,children:(0,_.jsx)("div",{className:"form-control-value",style:a.width&&{maxWidth:a.width},children:a.render?a.render(o,c):a.lookup?(0,_.jsx)(h.A,{name:a.field_name,value:o,onChange:e=>s&&s(e.target.name,e.target.value),placeholder:(D=a.title,"Nh\u1eadp ".concat(D.toLowerCase())),children:Object.keys(a.lookup).map(((e,n)=>(0,_.jsx)("option",{value:e,children:a.lookup[e]},n)))}):j(e)})})]});var D};I.defaultProps={inline:!1};const P=I},24957:(e,n,a)=>{a.d(n,{A:()=>d});a(9950);var i=a(71766),l=a(44414);const t=e=>{const{disabled:n,name:a,label:t,checked:d,type:o,children:h,className:s,...c}=e;return(0,l.jsxs)("label",{className:s||"radio",children:[(0,l.jsx)(i.A,{...c,type:"radio",name:a,checked:d,disabled:n,children:h}),(0,l.jsx)("span",{className:n?"disabled":"",children:t})]})};t.defaultProps={};const d=t},48274:(e,n,a)=>{a.d(n,{A:()=>d});a(9950);var i=a(55627),l=a(44414);const t=e=>{const{children:n,...a}=e;return(0,l.jsx)(i.A,{...a,children:n})};t.defaultProps={size:"sm"};const d=t},46499:(e,n,a)=>{a.d(n,{A:()=>c});var i,l=a(57528),t=(a(9950),a(86006)),d=a(48274),o=a(44414);const h=t.Ay.span(i||(i=(0,l.A)(["\n color: red;\n"]))),s=e=>{const{text:n,children:a,...i}=e;return(0,o.jsxs)(d.A,{...i,children:[(0,o.jsx)("b",{children:a})," ",(0,o.jsx)(h,{children:n})]})};s.defaultProps={text:"*"};const c=s},3908:(e,n,a)=>{a.d(n,{m:()=>i.A});a(48274);var i=a(46499)},47495:(e,n,a)=>{a.d(n,{A:()=>o});var i=a(9950),l=a(71739),t=a(44414);class d extends i.Component{constructor(e){super(e),this.handleChange=(e,n)=>{let{selected:a}=this.state;var i=a.indexOf(e);i<0?a.push(e):a.splice(i,1),this.setState({selected:a}),this.props.onChange(a)},this.state={selected:[]}}componentDidUpdate(e,n){this.props.value!==this.state.selected&&this.setState({selected:this.props.value})}render(){const{name:e,disabled:n,data:a}=this.props;return console.log(a),a&&a.map(((a,i)=>(console.log(a),(0,t.jsx)(l.A,{name:e,disabled:n||a.disabled,value:a.value,label:a.label,checked:this.state.selected&&this.state.selected.indexOf(a.value)>=0&&!a.disabled,onChange:e=>this.handleChange(a.value,e)},i))))}}const o=d},65907:(e,n,a)=>{a.d(n,{A:()=>o});var i=a(9950),l=a(24957),t=a(44414);class d extends i.Component{constructor(e){super(e),this.state={value:e.value}}componentDidUpdate(e,n){this.props.value!==this.state.value&&this.setState({value:this.props.value})}render(){const{name:e,disabled:n,data:a,className:i}=this.props;return a&&a.map(((a,d)=>(0,t.jsx)(l.A,{className:i,name:e,disabled:n||a.disabled,value:a.value,label:a.label,checked:this.state.value==a.value&&!a.disabled,onChange:e=>{this.state.value!==e.target.value&&(this.setState({value:e.target.value}),this.props.onChange(e.target.value))}},d)))}}const o=d},17790:(e,n,a)=>{a.d(n,{A:()=>o});var i=a(9950),l=a(82050),t=a(44414);class d extends i.Component{render(){const{value:e,onChange:n}=this.props;return(0,t.jsx)(l.A,{value:e||"",onChange:n,options:(()=>{let e=[];for(var n=1;n<=12;n++)e.push({value:n,label:"Th\xe1ng ".concat(n)});return e})(),valueRef:"value",labelRef:"label",placeholder:"Ch\u1ecdn th\xe1ng"})}}d.defaultProps={placeholder:"Ch\u1ecdn..."};const o=d},62267:(e,n,a)=>{a.d(n,{A:()=>o});var i=a(9950),l=a(82050),t=a(44414);class d extends i.Component{render(){const{value:e,onChange:n,isDetail:a,disabled:i}=this.props,d=(()=>{const e=(new Date).getFullYear();let n=[];for(var a=e-5;a<=e+2;a++)n.push({value:a,label:"N\u0103m ".concat(a)});return n})(),o=e||"";return a?(0,t.jsx)("div",{style:{textAlign:"center"},children:o?"N\u0103m "+o:""}):(0,t.jsx)(l.A,{disabled:i,value:o,onChange:n,options:d,valueRef:"value",labelRef:"label",placeholder:"Ch\u1ecdn n\u0103m"})}}d.defaultProps={placeholder:"Ch\u1ecdn..."};const o=d},18499:(e,n,a)=>{a.d(n,{A:()=>s});var i=a(9950),l=a(83803),t=a(428),d=a(4370),o=a(67116),h=a(44414);class s extends i.Component{constructor(e){super(e),this.componentDidMount=()=>{const{data:e,url:n,columns:a,where:i,initRowData:l}=this.props;e?this.setState({data:e}):(0,d.Pq)("".concat(n,"?").concat(t.xz(a,i,!0,this.props.selectType)),"GET",null).then((e=>{e.value&&(l&&e.value.forEach((e=>l.forEach((n=>e[n.name]=n.value)))),this.setState({data:e.value}))})).catch((e=>console.log(e)))},this.addRowToTable=e=>{this.setState({data:[e,...this.state.data]})},this.handleAddRowTable=e=>new Promise(((n,a)=>{if(t.nl(this.props.columns,e)){var i;null!==this&&void 0!==this&&null!==(i=this.props)&&void 0!==i&&i.addActionAgree&&this.props.addActionAgree();try{if("CSDLG_KKG"===this.props.loaiHoSo){this.state.data.find((n=>n.HHDV_ID===e.HHDV_ID))?((0,o.AB)("Tr\xf9ng d\u1eef li\u1ec7u"),a()):this.setState({data:[e,...this.state.data]},n(e))}else this.setState({data:[e,...this.state.data]},n(e))}catch{a()}}else{var l;a(),null!==this&&void 0!==this&&null!==(l=this.props)&&void 0!==l&&l.addActionAgree&&this.props.addActionAgree()}})),this.handleUpdateRowTable=(e,n)=>new Promise(((a,i)=>{if(t.nl(this.props.columns,e))try{let i=[...this.state.data];i[i.indexOf(n)]=e,this.setState({data:i},a(e))}catch{i()}else i()})),this.handleDeleteRowTable=e=>new Promise(((n,a)=>{try{let a=[...this.state.data];a.splice(a.indexOf(e),1),this.setState({data:a},n())}catch{a()}})),this.getRowData=()=>{const{initRowData:e}=this.props;if(e){let n=[...this.state.data];return n.forEach((n=>e.forEach((e=>n[e.name]=e.value)))),n}return this.state.data&&[...this.state.data]},this.state={data:[]}}render(){const{addMoreRows:e,title:n,columns:a,pageSize:i,tableRef:t}=this.props;return(0,h.jsx)(l.A,{addMoreRows:e,pageSize:i,title:n,tableRef:t,columns:a,data:this.state.data,editable:{onRowAdd:e=>this.handleAddRowTable(e),onRowUpdate:(e,n)=>this.handleUpdateRowTable(e,n),onRowDelete:e=>this.handleDeleteRowTable(e)}})}}s.defaultProps={addMoreRows:!1,title:"",columns:[],pageSize:10,searchLength:1}},67220:(e,n,a)=>{a.d(n,{$:()=>g,A:()=>p});var i=a(9950),l=a(58195),t=a(14113),d=a(99308),o=a(85907),h=a(59051),s=a.n(h),c=a(85560),r=a(70694),u=a(36841),m=a(44414);const v=i.createRef(),g=()=>v.current&&v.current.componentDidMount(),p=e=>{let{open:n,data:a,close:i}=e;return(0,m.jsx)(m.Fragment,{children:(0,m.jsxs)(l.A,{size:"xl",isOpen:n,toggle:i,children:[(0,m.jsx)(t.A,{toggle:i,children:"Th\xf4ng tin Th\xe0nh Ph\u1ea9m"}),(0,m.jsxs)(d.A,{children:[(0,m.jsxs)("div",{className:"btn-reselect-bussines d-block",children:[(0,m.jsxs)("div",{className:"d-flex mb-3 align-items-center",children:[(0,m.jsx)("h6",{className:"mb-0 text-muted col-5",children:"T\xean Th\xe0nh ph\u1ea9m :"}),(0,m.jsx)("p",{className:"mb-0",children:null===a||void 0===a?void 0:a.TenThanhPham})]}),(0,m.jsxs)("div",{className:"d-flex mb-3 align-items-center",children:[(0,m.jsx)("h6",{className:"mb-0 text-muted col-5",children:"Lo\u1ea1i Th\xe0nh ph\u1ea9m :"}),(0,m.jsx)("p",{className:"mb-0",children:null===a||void 0===a?void 0:a.TenNhomSanPhamDichVu})]}),(0,m.jsxs)("div",{className:"d-flex mb-3 align-items-center",children:[(0,m.jsx)("h6",{className:"mb-0 text-muted col-5",children:"Ng\xe0y \xe1p d\u1ee5ng :"}),(0,m.jsx)("p",{className:"mb-0",children:(null===a||void 0===a?void 0:a.NgayApDung)&&s()(null===a||void 0===a?void 0:a.NgayApDung).format("DD-MM-YYYY")})]}),(0,m.jsxs)("div",{className:"d-flex align-items-center",children:[(0,m.jsx)("h6",{className:"mb-0 text-muted col-5",children:"\u0110i\u1ec3m kinh doanh :"}),(0,m.jsx)("p",{className:"mb-0",children:null===a||void 0===a?void 0:a.TenChiNhanh})]})]}),(0,m.jsxs)("div",{className:"mt-4",children:[(0,m.jsx)(c.A,{title:(0,m.jsx)("h6",{children:"Chi ph\xed nguy\xean v\u1eadt li\u1ec7u"}),tableRef:v,url:"DinhLuongNguyenVatLieu",where:"ThanhPham_Id eq ".concat(null===a||void 0===a?void 0:a.ThanhPham_Id," and DiemKinhDoanh_Id eq ").concat(null===a||void 0===a?void 0:a.DiemKinhDoanh_Id),columns:r.ak.filter((e=>e.isNVL||1===(null===e||void 0===e?void 0:e.isEdit)))}),(0,m.jsx)("div",{className:"mt-4",children:(0,m.jsx)(c.A,{title:(0,m.jsx)("h6",{children:"Chi ph\xed kh\xe1c"}),url:"DinhLuongKhac_ChiPhi",where:"ThanhPham_Id eq ".concat(null===a||void 0===a?void 0:a.ThanhPham_Id," and DiemKinhDoanh_Id eq ").concat(null===a||void 0===a?void 0:a.DiemKinhDoanh_Id),columns:r.Op})})]})]}),(0,m.jsxs)(o.A,{className:"p-4",children:[(0,m.jsx)("h5",{className:"ml-2 mb-0",children:"Gi\xe1 v\u1ed1n Th\xe0nh ph\u1ea9m:"})," ",null!==a&&void 0!==a&&a.TongChiPhi?(0,m.jsxs)("h5",{className:"mb-0",children:[(0,u.vv)(null===a||void 0===a?void 0:a.TongChiPhi)," VN\u0110"]}):(0,m.jsx)("h5",{className:"mb-0",children:"0"})]})]})})}},70694:(e,n,a)=>{a.d(n,{MV:()=>f,Op:()=>x,S9:()=>v,ak:()=>D,sB:()=>N});var i=a(9950),l=a(4370),t=a(36841),d=a(67116),o=a(81921),h=a(4843),s=a(67220),c=a(73613),r=a(18849),u=a(11214),m=a(44414);const v=e=>{D.map((n=>{"NguyenVatLieu_Id"===(null===n||void 0===n?void 0:n.field)&&(n.dataSelect.url="DinhLuongNguyenVatLieu/GetListNguyenVatLieu?DiemKinhDoanh_Id=".concat(e,"&"))}))},g=e=>{let{priceOld:n,priceNew:a,chiPhi:i,Id:o,getListNVL:s}=e;return(0,m.jsx)(m.Fragment,{children:(0,m.jsxs)("div",{className:"d-block",children:[(0,m.jsxs)("div",{children:[(0,m.jsx)("p",{className:"mb-0",children:(0,t.vv)(n)}),(0,m.jsxs)("p",{style:{color:"red"},className:"mb-0 font-weight-bold",children:["Gi\xe1 m\u1edbi : ",(0,t.vv)(a)," "]})]}),(0,m.jsx)("div",{className:"pt-2 border-top",children:(0,m.jsx)("button",{onClick:()=>(0,d.A1)("B\u1ea1n c\xf3 ch\u1eafc ch\u1eafn mu\u1ed1n c\u1eadp nh\u1eadt gi\xe1 m\u1edbi kh\xf4ng?","Th\xf4ng b\xe1o").then((()=>{(0,l.Pq)("DinhLuongNguyenVatLieu(".concat(o,")"),"PATCH",JSON.stringify({DonGia:"".concat(a),ChiPhi:"".concat(i)})).then((e=>{s()})),(0,h.emptyListNVLDefalut)()})),className:"btn-update-new-price ml-2",children:(0,m.jsxs)("div",{className:"d-flex align-items-center",children:[(0,m.jsx)("p",{className:"mb-0 mr-2",children:" C\u1eadp nh\u1eadt gi\xe1 m\u1edbi"}),(0,m.jsx)("div",{className:"icon-btn-update-new-price",children:(0,m.jsx)(c.A,{fa:"refresh"})})]})})})]})})},p=e=>{let{rowData:n}=e;const[a,l]=(0,i.useState)(null);return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(r.A,{onClick:()=>l(n),className:"ml-auto btn-open-spdd",children:(0,m.jsx)(c.A,{fa:"list-ol"})}),a&&(0,m.jsx)(u.A,{data:null===a||void 0===a?void 0:a.DM_SanPhamDichVu1,Id:null===a||void 0===a?void 0:a.NguyenVatLieu_Id,close:()=>l(null)})]})},D=[{title:"Id",field:"Id",type:"numeric",dataID:!0,hidden:!0,isNVL:!0,editable:"never"},{title:"Ng\xe0y tao",field:"NgayTao",type:"datetime",isThanhPham:!0},{title:"Ng\u01b0\u1eddi tao",field:"NguoiTao",type:"string",isThanhPham:!0},{title:"Th\xe0nh ph\u1ea9m",field:"ThanhPham_Id",isThanhPham:!0,type:"data-select",dataCheck:!0,nameRef:"ThanhPham",customCol:!0,dataSelect:{url:"DM_SanPhamDichVu",column:{field:"Id",label:"TenSanPham"},dialogOdata:!1,dataRef:[]},render:e=>(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)("div",{children:e.TenThanhPham}),(null===e||void 0===e?void 0:e.IsThayDoi)&&(0,m.jsx)("p",{style:{backgroundColor:"red",fontSize:"11px"},className:"mb-0 font-weight-bold badge badge-danger pt-1 mt-1",children:"\u0110\u01a1n gi\xe1 NVL c\xf3 thay \u0111\u1ed5i"})]})},{field:"TenThanhPham",title:"T\xean th\xe0nh ph\u1ea9m",isThanhPham:!0,dataCheck:!0,type:"string",searchable:!0,hidden:!0},{title:"Gi\xe1 v\u1ed1n Th\xe0nh ph\u1ea9m",field:"TongChiPhi",type:"numeric",isThanhPham:!0,render:e=>(0,t.vv)(e.TongChiPhi)},{title:"Ng\xe0y \xe1p d\u1ee5ng",field:"NgayApDung",isThanhPham:!0,type:"date",searchable:!0},{title:"\u0110i\u1ec3m kinh doanh",field:"TenChiNhanh",isThanhPham:!0},{hidden:!0,field:"DM_SanPhamDichVu1.DM_NhomSanPhamDichVu.Id",isThanhPham:!0},{field:"DM_SanPhamDichVu1.DM_NhomSanPhamDichVu.Ten",isNVL:!0,hidden:!0},{field:"DM_SanPhamDichVu1.DM_NhomSanPhamDichVu.Id",isNVL:!0,hidden:!0},{field:"DM_NguyenVatLieu.Name",isNVL:!0,hidden:!0},{title:"T\xean S\u1ea3n ph\u1ea9m \u0111\u1ea1i di\u1ec7n",field:"NguyenVatLieu_Id",isNVL:!0,type:"data-select",dataCheck:!0,customCol:!0,nameRef:"DM_SanPhamDichVu1",dataSelect:{notOdata:!0,isOdata:!1,isResultValue:!0,urlGetAPIId:"nguyenVatLieu_Id",fieldSearchAPI:"ten",column:{field:"Id",label:"TenNguyenVatLieu"},dialogOdata:!1,dataRef:["DM_DonViTinh.Ten","Sale_TonKho.GiaVon","DM_LoaiSanPham.TenLoai","DM_NhomSanPhamDichVu.Ten","DM_NhomSanPhamDichVu.Id"]},render:e=>{var n,a,i,l,t;return(0,m.jsx)(m.Fragment,{children:(0,m.jsxs)("div",{className:"d-flex align-items-center",children:[(0,m.jsx)("b",{children:null!==e&&void 0!==e&&null!==(n=e.DM_SanPhamDichVu1)&&void 0!==n&&n.TenNguyenVatLieu?null===e||void 0===e||null===(a=e.DM_SanPhamDichVu1)||void 0===a?void 0:a.TenNguyenVatLieu:null===e||void 0===e||null===(i=e.DM_NguyenVatLieu)||void 0===i?void 0:i.Name}),((null===e||void 0===e||null===(l=e.DM_SanPhamDichVu1)||void 0===l?void 0:l.TenNguyenVatLieu)||(null===e||void 0===e||null===(t=e.DM_NguyenVatLieu)||void 0===t?void 0:t.Name))&&(0,m.jsx)(p,{rowData:e})]})})}},{field:"DM_SanPhamDichVu1.DM_LoaiSanPham.TenLoai",type:"string",hidden:!0},{title:"Th\xe0nh ph\u1ea9m",field:"ThanhPham_Id",isNVL:!0,hidden:!0},{title:"\u0110i\u1ec3m kinh doanh",field:"DiemKinhDoanh_Id",isNVL:!0,hidden:!0},{title:"\u0110\u01a1n gi\xe1 NVL",field:"DonGia",type:"numeric",isEdit:1,editable:"never",render:e=>{var n,a,i,l,d;return h.listNVL.length?(0,t.vv)(null===(n=h.listNVL[0][null===e||void 0===e?void 0:e.NguyenVatLieu_Id])||void 0===n?void 0:n.GiaVon)===(0,t.vv)(null===(a=h.listNVL[0][null===e||void 0===e?void 0:e.NguyenVatLieu_Id])||void 0===a?void 0:a.GiaCu)?(0,m.jsx)(m.Fragment,{children:(0,t.vv)(null===(i=h.listNVL[0][null===e||void 0===e?void 0:e.NguyenVatLieu_Id])||void 0===i?void 0:i.GiaVon)}):(0,m.jsx)(g,{priceOld:null===(l=h.listNVL[0][null===e||void 0===e?void 0:e.NguyenVatLieu_Id])||void 0===l?void 0:l.GiaCu,priceNew:null===(d=h.listNVL[0][null===e||void 0===e?void 0:e.NguyenVatLieu_Id])||void 0===d?void 0:d.GiaVon,chiPhi:+h.listNVL[0][null===e||void 0===e?void 0:e.NguyenVatLieu_Id].GiaVon*e.SoLuong,Id:null===e||void 0===e?void 0:e.Id,getListNVL:()=>{(0,h.getListNVLDefault)(e.DiemKinhDoanh_Id,e.ThanhPham_Id).then((()=>{(0,o.u)(),(0,h.reloadTableDLNVL)(),(0,s.$)()}))}}):(0,m.jsx)(m.Fragment,{children:"\u0110ang t\u1ea3i..."})}},{title:"\u0110\u01a1n gi\xe1 NVL",field:"DM_SanPhamDichVu1.Sale_TonKho[0].GiaVon",fieldExpand:"DM_SanPhamDichVu1.Sale_TonKho.GiaVon",type:"numeric",isEdit:2,editable:"never",render:e=>(0,t.vv)(h.listNVL[0][null===e||void 0===e?void 0:e.NguyenVatLieu_Id].GiaVon)},{title:"Gi\xe1 v\u1ed1n NVL",field:"DM_SanPhamDichVu1.Sale_TonKho[0].GiaVon",fieldExpand:"DM_SanPhamDichVu1.Sale_TonKho.GiaVon",type:"numeric",isNVL:!0,hidden:!0,editable:"never"},{field:"DM_SanPhamDichVu1.Sale_TonKho.GiaVon",type:"numeric",hidden:!0,isNVL:!0},{field:"DM_SanPhamDichVu1.TenSanPham",type:"string",hidden:!0,isNVL:!0},{field:"DM_SanPhamDichVu1.DonGia",type:"string",hidden:!0,isNVL:!0},{title:"\u0110\u1ecbnh l\u01b0\u1ee3ng",field:"SoLuong",type:"numeric",isNVL:!0,searchable:!0,render:e=>(0,t.vv)(e.SoLuong)},{title:"\u0110\u01a1n v\u1ecb t\xednh",field:"DM_SanPhamDichVu1.DM_DonViTinh.Ten",type:"string",isNVL:!0,editable:"never",render:e=>{var n,a,i;return(null===e||void 0===e||null===(n=e.DM_SanPhamDichVu1)||void 0===n||null===(a=n.DM_DonViTinh)||void 0===a?void 0:a.Ten)||(null===e||void 0===e||null===(i=e.DM_SanPhamDichVu1)||void 0===i?void 0:i.TenDonViTinh)}},{title:"\u0110\u01a1n gi\xe1",field:"DonGia",type:"string",isNVL:!0,hidden:!0},{title:"Chi ph\xed",isNVL:!0,field:"ChiPhi",type:"numeric",editable:"never",render:e=>{let n=e.Id?+(null===e||void 0===e?void 0:e.DonGia)*+(null===e||void 0===e?void 0:e.SoLuong):+h.listNVL[0][null===e||void 0===e?void 0:e.NguyenVatLieu_Id].GiaVon*e.SoLuong;return(0,m.jsx)(m.Fragment,{children:n?(0,t.vv)(n.toFixed(0)):0})}}],f=e=>{let{defaultValue:n,id:a}=e;const[t,d]=(0,i.useState)(null===n||void 0===n?void 0:n.Name);return(0,i.useEffect)((()=>{(null===n||void 0===n?void 0:n.Id)!==a&&(0,l.Pq)("DinhLuongKhacs(".concat(a,")")).then((e=>{d(e.Name)}))}),[n,a]),t||""},x=[{title:"Id",field:"Id",type:"numeric",dataID:!0,hidden:!0,editable:"never"},{title:"T\xean chi ph\xed",field:"DinhLuongKhac_Id",isNVL:!0,type:"data-select",dataCheck:!0,nameRef:"DinhLuongKhac.Name",dataSelect:{url:"DinhLuongKhacs",dialogOdata:!1,column:{field:"Id",label:"Name"}},render:e=>(0,m.jsx)(f,{defaultValue:null===e||void 0===e?void 0:e.DinhLuongKhac,id:null===e||void 0===e?void 0:e.DinhLuongKhac_Id})},{field:"DinhLuongKhac.Name",type:"string",hidden:!0},{field:"DinhLuongKhac.Id",type:"string",hidden:!0},{title:"Chi ph\xed",field:"ChiPhi",type:"numeric",isThanhPham:!0,render:e=>(0,t.vv)(e.ChiPhi)}],N=e=>({NhomSanPhamDichVu_Id:{title:"Lo\u1ea1i th\xe0nh ph\u1ea9m",type:"data-select",dataSelect:{url:"DM_NhomSanPhamDichVu",value_field:"Id",text_field:"Ten",placeholder:"Ch\u1ecdn lo\u1ea1i th\xe0nh ph\u1ea9m",where:"Loai eq 'ThanhPham'"}},ThanhPham_Id:{field_name:"ThanhPham_Id",required:!0,title:"Th\xe0nh ph\u1ea9m",type:"data-select",dataSelect:{url:"DM_SanPhamDichVu",value_field:"Id",text_field:"TenSanPham",placeholder:"Ch\u1ecdn th\xe0nh ph\u1ea9m",where:e?"Loai eq 'ThanhPham' and NhomSanPhamDichVu_Id eq ".concat(e," and IsDeleted ne true"):"Loai eq 'ThanhPham' and IsDeleted ne true"}},DiemKinhDoanh_Id:{field_name:"DiemKinhDoanh_Id",title:"\u0110i\u1ec3m kinh doanh",type:"data-select",required:!0,dataSelect:{url:"DiemKinhDoanhs",value_field:"Id",text_field:"Ten",placeholder:"Ch\u1ecdn \u0110i\u1ec3m kinh doanh"}},NgayApDung:{field_name:"NgayApDung",title:"Ng\xe0y \xe1p d\u1ee5ng",type:"datetime"}})},81921:(e,n,a)=>{a.d(n,{A:()=>_,u:()=>b});var i=a(58195),l=a(18849),t=a(99308),d=a(9950),o=a(18499),h=a(70694),s=a(53832),c=a(4370),r=a(67116),u=a(53744),m=a(765),v=a(78042),g=a(37684),p=a(73613),D=a(15296),f=a(4843),x=a(44414);const N=d.createRef(),b=()=>N.current&&N.current.componentDidMount(),T=d.createRef(),_=e=>{let{open:n,close:a,dataProps:b,reloadTable:_,diemKD:j,setDiemKD:I}=e;const[P,S]=(0,d.useState)(b),[y,V]=(0,d.useState)(null===b||void 0===b?void 0:b.NhomSanPhamDichVu_Id),[C,A]=(0,d.useState)(!1),[L,M]=(0,d.useState)(!0),w=(0,h.sB)(y);(0,d.useEffect)((()=>{v.Ze?(null===b||void 0===b?void 0:b.DiemKinhDoanh_Id)&&I({Id:null===b||void 0===b?void 0:b.DiemKinhDoanh_Id,Name:null===b||void 0===b?void 0:b.TenChiNhanh}):I({Id:u.lg.DiemKinhDoanhId,Name:u.lg.TenDiemKinhDoanh})}),[b,I]),(0,d.useEffect)((()=>{(null===j||void 0===j?void 0:j.Id)&&M(!1)}),[b,j]);const K=(e,n)=>{S({...P,[e]:n})};null!==b&&void 0!==b&&b.ThanhPham_Id&&(w.ThanhPham_Id.disabled=!0,w.DiemKinhDoanh_Id.disabled=!0,w.NhomSanPhamDichVu_Id.disabled=!0);const k=(0,d.useCallback)((()=>{(0,h.S9)(j.Id),a()}),[a,j]),R=(0,d.useCallback)((()=>{var e,n;let a=null===N||void 0===N||null===(e=N.current)||void 0===e?void 0:e.getRowData(),i=null===T||void 0===T||null===(n=T.current)||void 0===n?void 0:n.getRowData(),l=[],t=[];a.forEach((e=>{var n;e.NguyenVatLieu_Id&&l.push({NguyenVatLieu_Id:e.NguyenVatLieu_Id,SoLuong:+e.SoLuong||0,ChiPhi:+(null===(n=f.listNVL[0][null===e||void 0===e?void 0:e.NguyenVatLieu_Id])||void 0===n?void 0:n.GiaVon)*e.SoLuong||0})})),i.forEach((e=>{t.push({DinhLuongKhac_Id:e.DinhLuongKhac_Id,ChiPhi:+e.ChiPhi})})),null!==P&&void 0!==P&&P.ThanhPham_Id?l.length&&l.filter((e=>e.SoLuong)).length?(0,c.Pq)(b?"DinhLuongNguyenVatLieu/EditNguyenVatLieu":"DinhLuongNguyenVatLieu/ThemNguyenVatlieu","POST",JSON.stringify({ThanhPham_Id:null===P||void 0===P?void 0:P.ThanhPham_Id,ListNguyenVatLieu:l,ListNguyenVatLieu_Khac:t,NgayApDung:new Date(null===P||void 0===P?void 0:P.NgayApDung),NgayTao:null===P||void 0===P?void 0:P.NgayTao,NguoiTao:null===P||void 0===P?void 0:P.NguoiTao,DiemKinhDoanh_Id:j.Id}),!1).then((e=>{k(),(0,r.nw)(b?"C\u1eadp nh\u1eadt th\xe0nh c\xf4ng":"Th\xeam m\u1edbi th\xe0nh c\xf4ng"),_()})).catch((e=>(0,r.a3)(e))):(0,r.AB)("Vui l\xf2ng ki\u1ec3m tra danh s\xe1ch Chi ph\xed nguy\xean v\u1eadt li\u1ec7u v\xe0 \u0110\u1ecbnh l\u01b0\u1ee3ng kh\xe1c 0!"):(0,r.AB)("Vui l\xf2ng nh\u1eadp Th\xe0nh ph\u1ea9m")}),[P,b,j.Id,k,_]);return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(g.A,{Loai:"SanPham",open:C,onClose:()=>A(!1)}),(0,x.jsxs)(i.A,{size:"xl",isOpen:n,toggle:k,children:[(0,x.jsxs)("div",{className:"d-flex align-items-center p-3 border-bottom rounded-top",children:[(0,x.jsx)("h5",{className:"mr-auto mb-0",children:b?"C\u1eadp nh\u1eadt \u0110\u1ecbnh L\u01b0\u1ee3ng Nguy\xean V\u1eadt Li\u1ec7u":"Th\xeam m\u1edbi \u0110\u1ecbnh L\u01b0\u1ee3ng Nguy\xean V\u1eadt Li\u1ec7u"}),(0,x.jsxs)("div",{className:"d-flex g-2",children:[(0,x.jsx)(l.A,{className:"mr-2",color:"success",onClick:R,children:"L\u01b0u"}),(0,x.jsx)(l.A,{onClick:k,children:"\u0110\xf3ng"})]})]}),(0,x.jsx)(t.A,{children:(0,x.jsxs)("div",{className:"position-relative",children:[(0,x.jsx)(D.A,{dataProps:b,isChoose:L,diemKD:j,setDiemKD:I,setIsChoose:M,getURL:()=>(0,h.S9)()}),(0,x.jsxs)("div",{className:"d-block",children:[!!j.Id&&!b&&(0,x.jsx)(x.Fragment,{children:(0,x.jsxs)("div",{onClick:()=>v.Ze&&M(!0),className:"btn-reselect-bussines mb-3",children:[(0,x.jsxs)("p",{className:"mb-0",children:["B\u1ea1n \u0111ang th\xeam m\u1edbi \u0111\u1ecbnh l\u01b0\u1ee3ng cho \u0110i\u1ec3m kinh doanh :"," ",(0,x.jsxs)("strong",{className:"title-name-bussines",children:[" ",j.Name]})]}),v.Ze&&(0,x.jsx)("div",{className:"btn-change-select-bussines",children:(0,x.jsx)(p.A,{fa:"refresh"})})]})}),(0,x.jsxs)("div",{className:"row",children:[(0,x.jsx)("div",{className:"col-6",children:b?(0,x.jsx)(m.x9,{title:"Lo\u1ea1i th\xe0nh ph\u1ea9m",value:null===P||void 0===P?void 0:P.TenNhomSanPhamDichVu}):(0,x.jsx)(s.A,{data:w.NhomSanPhamDichVu_Id,value:y,onChange:(e,n)=>V(n)})}),(0,x.jsx)("div",{className:"col-6",children:b?(0,x.jsx)(m.x9,{required:!0,title:"T\xean th\xe0nh ph\u1ea9m :",value:null===P||void 0===P?void 0:P.TenThanhPham}):(0,x.jsx)(s.A,{data:w.ThanhPham_Id,value:null===P||void 0===P?void 0:P.ThanhPham_Id,onChange:K})}),(0,x.jsx)("div",{className:"col-6",children:(0,x.jsx)(s.A,{data:null===w||void 0===w?void 0:w.NgayApDung,value:null===P||void 0===P?void 0:P.NgayApDung,onChange:K})}),"dieuhanh"===u.lg.MaVaiTro&&(0,x.jsx)("div",{className:"col-6",children:b&&(0,x.jsx)(m.x9,{required:!0,title:"\u0110i\u1ec3m kinh doanh :",value:null===P||void 0===P?void 0:P.TenChiNhanh})})]}),(0,x.jsx)("div",{className:"form-btn-add-quickly",children:(0,x.jsxs)(l.A,{onClick:()=>A(!0),className:"btn-add-quickly",children:[(0,x.jsx)(p.A,{style:{fontSize:"17px"},fa:"plus-circle"}),"Th\xeam nhanh S\u1ea3n ph\u1ea9m"]})}),f.listNVL[0]&&(0,x.jsx)(o.A,{ref:N,title:(0,x.jsx)("h6",{children:"Chi ph\xed nguy\xean v\u1eadt li\u1ec7u"}),url:"DinhLuongNguyenVatLieu",where:"ThanhPham_Id eq ".concat(null===P||void 0===P?void 0:P.ThanhPham_Id," and DiemKinhDoanh_Id eq ").concat(null===P||void 0===P?void 0:P.DiemKinhDoanh_Id),columns:h.ak.filter((e=>e.isNVL||(null===e||void 0===e?void 0:e.isEdit)===(null!==b&&void 0!==b&&b.ThanhPham_Id?1:2))),addMoreRows:!0,addActionAgree:()=>(0,h.S9)(j.Id,b?null===b||void 0===b?void 0:b.ThanhPham_Id:null),data:!(b||0===b)&&[]}),(0,x.jsx)("div",{className:"mt-4",children:(0,x.jsx)(o.A,{ref:T,title:(0,x.jsx)("h6",{children:"Chi ph\xed kh\xe1c"}),url:"DinhLuongKhac_ChiPhi",where:"ThanhPham_Id eq ".concat(null===P||void 0===P?void 0:P.ThanhPham_Id," and DiemKinhDoanh_Id eq ").concat(null===P||void 0===P?void 0:P.DiemKinhDoanh_Id),columns:h.Op,addMoreRows:!0,data:!(b||0===b)&&[]})})]})]})})]})]})}},4843:(e,n,a)=>{a.r(n),a.d(n,{default:()=>j,emptyListNVLDefalut:()=>b,getListNVLDefault:()=>N,listNVL:()=>x,reloadTableDLNVL:()=>_});var i=a(9950),l=a(70694),t=a(85560),d=a(81921),o=a(67220),h=a(67116),s=a(4370),c=a(53139),r=a(97159),u=a(78042),m=a(44414);const v=e=>{let{getValue:n,value:a,isNVL:i,diemKD:l,setDiemKD:t}=e;return(0,m.jsx)(m.Fragment,{children:(0,m.jsxs)("div",{className:"form-search-nvl",children:[(0,m.jsxs)("div",{style:{gap:"0.3rem"},className:"col-5 d-flex m-0 p-0 ml-auto",children:[i&&(0,m.jsx)(r.A,{url:"DM_NhomSanPhamDichVu",valueField:"Id",textField:"Ten",where:"Loai eq 'ThanhPham'",value:a.Nhom,onChange:e=>n((n=>({...n,Nhom:e}))),placeholder:"Ch\u1ecdn nh\xf3m s\u1ea3n ph\u1ea9m"}),(0,m.jsx)(c.Sm,{onKeyPress:e=>{"Enter"===e.key&&n((n=>({...n,Ten:e.target.value})))},style:{fontWeight:"500"},placeholder:"T\xecm ki\u1ebfm"})]}),(0,m.jsx)(g,{diemKD:l,setDiemKD:t})]})})},g=e=>{let{diemKD:n,setDiemKD:a}=e;const[t,d]=(0,i.useState)([]);return(0,i.useEffect)((()=>{(0,s.Pq)("DiemKinhDoanhs").then((e=>d(e.value)))}),[]),(0,m.jsx)(m.Fragment,{children:(0,m.jsxs)("div",{className:"form-choose-diem-kinh-doanh ".concat(u.Ze?"form-choose-diem-kinh-doanh-hover":""),children:[(0,m.jsx)("p",{className:"mb-0 ".concat(n.Id?"text-secondary":"item-not-choose-diem-kinh-doanh"),children:n.Id?"\u0110i\u1ec3m kinh doanh:":"Ch\u1ecdn \u0111i\u1ec3m kinh doanh"}),t.map((e=>(0,m.jsx)(m.Fragment,{children:(0,m.jsx)("div",{className:"item-form-choose-diem-kinh-doanh ".concat(n.Id===e.Id?"active":""),onClick:()=>{u.Ze&&a({Id:e.Id,Name:e.Ten}),(0,l.S9)(e.Id)},children:e.Ten})})))]})})};var p=a(53744),D=a(73613),f=a(765);const x=[],N=(e,n,a)=>new Promise((async(i,t)=>{(0,l.S9)(e,n||null),(0,s.Pq)("DinhLuongNguyenVatLieu/GetListNguyenVatLieu?DiemKinhDoanh_Id=".concat(e).concat(n?"&ThanhPham_Id=".concat(n):""),"GET",null,!1).then((e=>{x.push((0,f.Jz)(e.value,"Id")),a&&a(),i()})).catch((e=>t(e)))})),b=()=>{x.pop()},T=i.createRef(),_=()=>T.current&&T.current.onQueryChange(),j=()=>{const[e,n]=(0,i.useState)(),[a,c]=(0,i.useState)(),[r,g]=(0,i.useState)({Ten:"",Nhom:null}),[f,x]=(0,i.useState)({Id:u.Ze?null:p.lg.DiemKinhDoanhId,Name:u.Ze?"":p.lg.TenDiemKinhDoanh});(0,i.useEffect)((()=>{_()}),[r,f]);const j=(e,n)=>{e&&N(f.Id,null===e||void 0===e?void 0:e.ThanhPham_Id,n)};return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsxs)("div",{style:{zIndex:1},className:"d-block position-relative",children:[(0,m.jsx)(v,{getValue:g,value:r,diemKD:f,setDiemKD:x,isNVL:!0}),f.Id?(0,m.jsx)(t.A,{tableRef:T,title:"\u0110\u1ecbnh L\u01b0\u1ee3ng Nguy\xean V\u1eadt Li\u1ec7u",urlExt:"DinhLuongNguyenVatLieu/GetNguyenVatLieu?Ten=".concat(r.Ten,"&NhomThanhPham=").concat(r.Nhom).concat(u.Ze?"&DiemKinhDoanh_Id=".concat(f.Id):"&DiemKinhDoanh_Id=".concat(p.lg.DiemKinhDoanhId)),SearchAdvanced:()=>(0,m.jsx)("div",{className:"mt-5"}),columns:l.ak.filter((e=>e.isThanhPham)),selectType:"withColumns",onAdd:u.Ze?{onClick:e=>j(!0,(()=>n(!0)))}:{disabled:!0},onEdit:u.Ze?{onClick:(e,a)=>j(a,(()=>n(a)))}:null,onDelete:u.Ze?{onClick:(e,n)=>(0,h.A1)("B\u1ea1n ch\u1eafc ch\u1eafc mu\u1ed1n x\xf3a th\xe0nh ph\u1ea9m n\xe0y?","Th\xf4ng b\xe1o").then((()=>(e=>{(0,s.Pq)("DinhLuongNguyenVatLieu/DeleteNguyenVatLieu?ThanhPham_Id=".concat(e.ThanhPham_Id,"&DiemKinhDoanh_Id=").concat(e.DiemKinhDoanh_Id),"DELETE",null,!1).then((e=>{(0,h.nw)("X\xf3a th\xe0nh c\xf4ng"),_()}))})(n)))}:null,onRowClick:(e,n)=>j(n,(()=>c(n)))}):(0,m.jsx)(m.Fragment,{children:(0,m.jsxs)("div",{className:"form-empty-diem-kinh-doanh",children:[(0,m.jsx)(D.A,{fa:"safari"}),"H\xe3y ch\u1ecdn \u0110i\u1ec3m kinh doanh"]})})]}),!!e&&(0,m.jsx)(d.A,{diemKD:f,setDiemKD:x,open:!!e,close:()=>{n(!1),b()},dataProps:e&&!0!==e?e:null,reloadTable:_}),(0,m.jsx)(o.A,{open:!!a,data:a,close:()=>{c(null),b()}})]})}},68315:(e,n,a)=>{a.d(n,{Ay:()=>d,RB:()=>h});a(9950);var i=a(36841),l=a(73613),t=(a(14944),a(44414));const d=e=>{let{list:n,choose:a,hiddenDonGia:i}=e;return(0,t.jsx)(t.Fragment,{children:n.length?(0,t.jsx)("div",{className:"form-list-pro-qr",children:n.map(((e,n)=>(0,t.jsx)(t.Fragment,{children:(0,t.jsx)(o,{onClick:e=>a&&a(e),item:e,index:n,hiddenDonGia:i})})))}):(0,t.jsx)(s,{style:{marginTop:"4rem"}})})},o=e=>{let{item:n,index:a,onClick:l,hiddenDonGia:d}=e;return(0,t.jsx)(t.Fragment,{children:(0,t.jsxs)("div",{onClick:()=>l(n,a),className:"item-pro-qr",children:[(0,t.jsx)(h,{url:n.HinhAnh150}),(0,t.jsx)("p",{className:"mb-1 mt-2",children:(0,i.yv)(n.TenSanPham,2,"...","","hover",a)}),(0,t.jsx)("i",{style:{color:"#b1b1b1",fontSize:"12px"},children:n.MaSanPham}),(0,t.jsxs)("p",{className:"font-weight-light d-flex mb-3",children:["\u0110\u01a1n v\u1ecb t\xednh :"," ",(0,t.jsx)("p",{className:"font-weight-bold ml-1 mb-0",children:n.DonViTinh})]}),!d&&(0,t.jsxs)("h6",{className:"mb-0",style:{fontWeight:"bolder",color:"#4680fe"},children:[(0,i.vv)(n.GiaBan)," VN\u0110"]})]},a)})},h=e=>{let{url:n,style:a}=e;return(0,t.jsx)(t.Fragment,{children:(0,t.jsx)("img",{style:a,src:n?"/api"+n:"assets/default.jpg",className:"img-item-pro-qr",alt:""})})},s=e=>{let{style:n}=e;return(0,t.jsx)(t.Fragment,{children:(0,t.jsxs)("div",{style:n,className:"bg-no-product text-secondary",children:[(0,t.jsx)(l.A,{style:{fontSize:"90px"},fa:"dropbox"}),(0,t.jsx)("p",{children:"Kh\xf4ng c\xf3 h\xe0ng h\xf3a"})]})})}},15296:(e,n,a)=>{a.d(n,{A:()=>o});var i=a(9950),l=a(4370),t=a(73613),d=(a(87297),a(44414));const o=e=>{let{setDiemKD:n,setIsChoose:a,diemKD:o,dataProps:s,isChoose:c,getURL:r}=e;const[u,m]=(0,i.useState)([]);return(0,i.useEffect)((()=>{(0,l.Pq)("DiemKinhDoanhs").then((e=>m(e.value)))}),[]),(0,d.jsx)(d.Fragment,{children:(0,d.jsxs)("div",{className:"form-choose-business ".concat(!s&&c&&"form-choose-business-open"),children:[(null===o||void 0===o?void 0:o.Id)&&(0,d.jsxs)("div",{onClick:()=>a(!1),className:"btn-tiep-tuc",children:["Ti\u1ebfp t\u1ee5c ",(0,d.jsx)(t.A,{fa:"angle-double-right"})]}),!!u.length&&(0,d.jsxs)("div",{className:"d-block",children:[(0,d.jsx)("h2",{children:"Ch\u1ecdn \u0110i\u1ec3m kinh doanh c\u1ea7n th\xeam m\u1edbi:"}),(0,d.jsx)("div",{className:"mt-5 list-business",children:u.map((e=>(0,d.jsx)(d.Fragment,{children:(0,d.jsx)(h,{data:e,setDiemKD:n,diemKD:o,setIsChoose:a,getURL:()=>r()})})))})]})]})})},h=e=>{let{data:n,setDiemKD:a,setIsChoose:i,diemKD:l,getURL:t}=e;return(0,d.jsx)(d.Fragment,{children:(0,d.jsxs)("div",{onClick:()=>{a({Id:n.Id,Name:n.Ten}),t(n.Id),i(!1)},className:"item-business ".concat((null===n||void 0===n?void 0:n.Id)===(null===l||void 0===l?void 0:l.Id)?"item-business-active":""),children:[(0,d.jsx)("input",{checked:(null===n||void 0===n?void 0:n.Id)===(null===l||void 0===l?void 0:l.Id),type:"checkbox"}),null===n||void 0===n?void 0:n.Ten]})})}},75132:(e,n,a)=>{a.d(n,{Gj:()=>s,QA:()=>u,UP:()=>d,ai:()=>r,lT:()=>c,vT:()=>o});a(9950);var i=a(36841),l=a(70694),t=a(44414);const d=[],o=e=>{c.map((n=>{"ThanhPham_Id"===(null===n||void 0===n?void 0:n.field)&&(n.dataSelect.url="ChiTietCombo/GetListThanhPham?DiemKinhDoanh_Id=".concat(e,"&"))}))},h=e=>{c.map((n=>{if("ThanhPham_Id"===(null===n||void 0===n?void 0:n.field))if(n.dataSelect.url.includes("NhomSanPhamDichVu_Id")){let a=n.dataSelect.url.slice(0,n.dataSelect.url.search("NhomSanPhamDichVu_Id"));n.dataSelect.url=a+="NhomSanPhamDichVu_Id=".concat(e,"&")}else n.dataSelect.url+="NhomSanPhamDichVu_Id=".concat(e,"&")}))},s=[{title:"Id",field:"Id",type:"numeric",dataID:!0,hidden:!0,editable:"never",cellStyle:{textAlign:"center"}},{title:"Ng\xe0y tao",field:"NgayTao",type:"datetime"},{title:"Ng\u01b0\u1eddi tao",field:"NguoiTao",type:"string"},{title:"Th\xe0nh ph\u1ea9m",field:"SanPhamDichVu_Id",type:"data-select",dataCheck:!0,cellStyle:{textAlign:"left"},customCol:!0,dataSelect:{url:"DM_SanPhamDichVu",column:{field:"Id",label:"TenSanPham"},dialogOdata:!1,dataRef:[]},render:e=>"".concat(e.TenCombo)},{title:"Gi\xe1 v\u1ed1n Combo",field:"TongChiPhi",type:"numeric",render:e=>(0,i.vv)(e.TongChiPhi)},{title:"Ng\xe0y \xe1p d\u1ee5ng",field:"NgayApDung",type:"date",searchable:!0,cellStyle:{textAlign:"left"}},{title:"\u0110i\u1ec3m kinh doanh",field:"TenChiNhanh",type:"string"}],c=[{title:"Id",field:"Id",type:"numeric",dataID:!0,hidden:!0,editable:"never",cellStyle:{textAlign:"center"}},{field:"DM_SanPhamDichVu.DM_NhomSanPhamDichVu.Ten",hidden:!0},{field:"DM_SanPhamDichVu.DM_NhomSanPhamDichVu.Id",hidden:!0},{title:"Lo\u1ea1i th\xe0nh Ph\u1ea9m",field:"DM_SanPhamDichVu.DM_NhomSanPhamDichVu.Id",fieldExpand:"DM_SanPhamDichVu.DM_NhomSanPhamDichVu.Id",type:"data-select",isEdit:1,customCol:!0,dataSelect:{url:"DM_NhomSanPhamDichVu",column:{field:"Id",label:"Ten"},whereOne:[{field:"Loai",expression:"eq",value:"'ThanhPham'"}],dialogOdata:!1},render:e=>{var n,a,i;return(null===e||void 0===e||null===(n=e.DM_SanPhamDichVu)||void 0===n?void 0:n.LoaiNhomThanhPham)||(null===e||void 0===e||null===(a=e.DM_SanPhamDichVu)||void 0===a||null===(i=a.DM_NhomSanPhamDichVu)||void 0===i?void 0:i.Ten)},onChange:(e,n)=>h(n)},{title:"Lo\u1ea1i th\xe0nh Ph\u1ea9m",field:"DM_SanPhamDichVu.LoaiThanhPham_Id",fieldExpand:"DM_SanPhamDichVu1.DM_NhomSanPhamDichVu.Id",type:"data-select",isEdit:2,customCol:!0,dataSelect:{url:"DM_NhomSanPhamDichVu",column:{field:"Id",label:"Ten"},whereOne:[{field:"Loai",expression:"eq",value:"'ThanhPham'"}],dialogOdata:!1},render:e=>{var n,a,i;return(null===e||void 0===e||null===(n=e.DM_SanPhamDichVu)||void 0===n?void 0:n.LoaiNhomThanhPham)||(null===e||void 0===e||null===(a=e.DM_SanPhamDichVu)||void 0===a||null===(i=a.DM_NhomSanPhamDichVu)||void 0===i?void 0:i.Ten)},onChange:(e,n)=>h(n)},{title:"T\xean th\xe0nh ph\u1ea9m",field:"ThanhPham_Id",isNVL:!0,type:"data-select",nameRef:"DM_SanPhamDichVu",dataCheck:!0,cellStyle:{width:"10rem"},customCol:!0,dataSelect:{notOdata:!0,isOdata:!1,isResultValue:!0,urlGetAPIId:"SanPham_Id",fieldSearchAPI:"tenSanPham",column:{field:"Id",label:"TenThanhPham"},dialogOdata:!1,dataRef:["DM_DonViTinh.Ten","DM_LoaiSanPham.TenLoai","DM_NhomSanPhamDichVu.Ten","DM_NhomSanPhamDichVu.Id"]},render:e=>{var n,a;return(null===e||void 0===e||null===(n=e.DM_SanPhamDichVu)||void 0===n?void 0:n.TenSanPham)||(null===e||void 0===e||null===(a=e.DM_SanPhamDichVu)||void 0===a?void 0:a.TenThanhPham)}},{field:"DM_SanPhamDichVu.TenSanPham",type:"string",hidden:!0},{title:"Gi\xe1 v\u1ed1n Th\xe0nh ph\u1ea9m",field:"DM_SanPhamDichVu.Sale_ChiTietBangGia[0].GiaVon",fieldExpand:"DM_SanPhamDichVu.Sale_ChiTietBangGia.GiaVon",type:"numeric",editable:"never",render:e=>(null===e||void 0===e?void 0:e.ThanhPham_Id)&&d.length&&(0,i.vv)(d[0][null===e||void 0===e?void 0:e.ThanhPham_Id].GiaVon)},{title:"\u0110\u1ecbnh l\u01b0\u1ee3ng",field:"SoLuong",type:"numeric",searchable:!0,render:e=>(0,i.vv)(null===e||void 0===e?void 0:e.SoLuong)},{title:"\u0110\u01a1n v\u1ecb t\xednh",field:"DM_SanPhamDichVu.DM_DonViTinh.Ten",type:"string",isNVL:!0,editable:"never",render:e=>{var n,a;return e.DM_SanPhamDichVu.TenDonViTinh||(null===e||void 0===e||null===(n=e.DM_SanPhamDichVu)||void 0===n||null===(a=n.DM_DonViTinh)||void 0===a?void 0:a.Ten)}},{title:"Chi ph\xed",isNVL:!0,field:"ChiPhi",type:"numeric",editable:"never",render:e=>{let n=(null===e||void 0===e?void 0:e.ThanhPham_Id)&&d.length&&+d[0][null===e||void 0===e?void 0:e.ThanhPham_Id].GiaVon*+(null===e||void 0===e?void 0:e.SoLuong);return n?(0,i.vv)(n.toFixed(0)):0}}],r=[{title:"Id",field:"Id",type:"numeric",dataID:!0,hidden:!0,editable:"never"},{title:"T\xean chi ph\xed",field:"ChiPhi_Id",isNVL:!0,type:"data-select",dataCheck:!0,nameRef:"DinhLuongKhac.Name",dataSelect:{url:"DinhLuongKhacs",dialogOdata:!1,column:{field:"Id",label:"Name"}},render:e=>(0,t.jsx)(l.MV,{defaultValue:null===e||void 0===e?void 0:e.DinhLuongKhac,id:null===e||void 0===e?void 0:e.ChiPhi_Id})},{field:"DinhLuongKhac.Name",type:"string",hidden:!0},{field:"DinhLuongKhac.Id",type:"string",hidden:!0},{title:"Chi ph\xed",field:"ChiPhi",type:"numeric",isThanhPham:!0,render:e=>(0,i.vv)(e.ChiPhi)}],u=e=>({NhomSanPhamDichVu_Id:{title:"Lo\u1ea1i Combo",type:"data-select",dataSelect:{url:"DM_NhomSanPhamDichVu",value_field:"Id",text_field:"Ten",placeholder:"Ch\u1ecdn lo\u1ea1i Combo",where:"Loai eq 'Combo'"}},SanPhamDichVu_Id:{field_name:"SanPhamDichVu_Id",title:"Combo",type:"data-select",required:!0,dataSelect:{url:"DM_SanPhamDichVu",value_field:"Id",text_field:"TenSanPham",placeholder:"Ch\u1ecdn Combo",where:e?"Loai eq 'Combo' and NhomSanPhamDichVu_Id eq ".concat(e," and IsDeleted ne true"):"Loai eq 'Combo' and IsDeleted ne true"}},DiemKinhDoanh_Id:{field_name:"DiemKinhDoanh_Id",title:"\u0110i\u1ec3m kinh doanh",type:"data-select",required:!0,dataSelect:{url:"DiemKinhDoanhs",value_field:"Id",text_field:"Ten",placeholder:"Ch\u1ecdn \u0110i\u1ec3m kinh doanh"}},NgayApDung:{field_name:"NgayApDung",title:"Ng\xe0y \xe1p d\u1ee5ng",type:"datetime"},DonGia:{field_name:"DonGia",title:"\u0110\u01a1n gi\xe1",type:"numeric"},ChiPhi:{field_name:"ChiPhi",title:"Chi ph\xed",type:"numeric"},TongGiaThanh:{field_name:"TongGiaThanh",title:"T\u1ed5ng gi\xe1 th\xe0nh",type:"numeric"}})},765:(e,n,a)=>{a.d(n,{Ay:()=>_,Jz:()=>T,x9:()=>j});var i=a(9950),l=a(4370),t=a(67116),d=a(58195),o=a(18849),h=a(99308),s=a(76152),c=a(23931),r=a(55627),u=a(53832),m=a(18499),v=a(75132),g=a(53744),p=a(15296),D=a(73613),f=a(3908),x=a(78042),N=a(44414);const b=i.createRef(),T=(e,n)=>e.reduce(((e,a)=>({...e,[a[n]]:a})),{}),_=e=>{let{open:n,close:a,dataProps:s,reloadTable:c,diemKD:r,setDiemKD:f}=e;const _=(0,i.useRef)(),[I,P]=(0,i.useState)(null===s||void 0===s?void 0:s.NhomSanPhamDichVu_Id),[S,y]=(0,i.useState)(s),[V,C]=(0,i.useState)(!0),A=(0,v.QA)(I);(0,i.useEffect)((()=>{x.Ze?(null===s||void 0===s?void 0:s.DiemKinhDoanh_Id)&&f({Id:null===s||void 0===s?void 0:s.DiemKinhDoanh_Id,Name:null===s||void 0===s?void 0:s.TenChiNhanh}):f({Id:g.lg.DiemKinhDoanhId,Name:g.lg.TenDiemKinhDoanh})}),[s,f]),(0,i.useEffect)((()=>{(null===r||void 0===r?void 0:r.Id)&&(0,l.Pq)("ChiTietCombo/GetListThanhPham?DiemKinhDoanh_Id=".concat(r.Id),"GET",null,!1).then((e=>{v.UP.push(T(e.value,"Id"))})),(null===r||void 0===r?void 0:r.Id)&&C(!1),(null===r||void 0===r?void 0:r.Id)&&(0,v.vT)(r.Id)}),[r]);const L=(e,n)=>{y({...S,[e]:n})};null!==s&&void 0!==s&&s.SanPhamDichVu_Id&&(A.SanPhamDichVu_Id.disabled=!0,A.DiemKinhDoanh_Id.disabled=!0,A.NhomSanPhamDichVu_Id.disabled=!0);const M=(0,i.useCallback)((()=>{(0,v.vT)(r.Id),a(),s&&f({Id:null,Name:""})}),[a,s,r,f]),w=(0,i.useCallback)((()=>{var e,n;let a=null===_||void 0===_||null===(e=_.current)||void 0===e?void 0:e.getRowData(),i=null===b||void 0===b||null===(n=b.current)||void 0===n?void 0:n.getRowData(),d=[],o=[];a.forEach((e=>{e.ThanhPham_Id&&d.push({ThanhPham_Id:e.ThanhPham_Id,SoLuong:+e.SoLuong||0,ChiPhi:+v.UP[0][null===e||void 0===e?void 0:e.ThanhPham_Id].GiaVon*+(null===e||void 0===e?void 0:e.SoLuong)||0})})),i.forEach((e=>{o.push({ChiPhi_Id:e.ChiPhi_Id,ChiPhi:+e.ChiPhi})})),r.Id?null!==S&&void 0!==S&&S.SanPhamDichVu_Id?d.length?(0,l.Pq)(s?"ChiTietCombo/EditChitietCombo":"ChiTietCombo/ThemCombo","POST",JSON.stringify({SanPhamDichVu_Id:null===S||void 0===S?void 0:S.SanPhamDichVu_Id,ListThanhPham:d,ListChiPhiKhac:o,NgayApDung:new Date(null===S||void 0===S?void 0:S.NgayApDung),NgayTao:null===S||void 0===S?void 0:S.NgayTao,NguoiTao:null===S||void 0===S?void 0:S.NguoiTao,DonGia:null===S||void 0===S?void 0:S.DonGia,ChiPhi:null===S||void 0===S?void 0:S.ChiPhi,TongGiaThanh:null===S||void 0===S?void 0:S.TongGiaThanh,DiemKinhDoanh_Id:r.Id}),!1).then((e=>{M(),(0,t.nw)(s?"C\u1eadp nh\u1eadt th\xe0nh c\xf4ng":"Th\xeam m\u1edbi th\xe0nh c\xf4ng"),c()})).catch((e=>(0,t.a3)(e))):(0,t.AB)("Vui l\xf2ng th\xeam danh s\xe1ch Chi ph\xed th\xe0nh ph\u1ea9m"):(0,t.AB)("Vui l\xf2ng nh\u1eadp Combo"):(0,t.AB)("Vui l\xf2ng ch\u1ecdn \u0110i\u1ec3m Kinh Doanh")}),[S,s,M,c,r]);return(0,N.jsx)(N.Fragment,{children:(0,N.jsxs)(d.A,{size:"xl",isOpen:n,toggle:M,children:[(0,N.jsxs)("div",{className:"d-flex align-items-center p-3 border-bottom rounded-top",children:[(0,N.jsx)("h5",{className:"mr-auto mb-0",children:s?"C\u1eadp nh\u1eadt \u0110\u1ecbnh l\u01b0\u1ee3ng su\u1ea5t \u0103n (Combo)":"Th\xeam m\u1edbi \u0110\u1ecbnh l\u01b0\u1ee3ng su\u1ea5t \u0103n (Combo)"}),(0,N.jsxs)("div",{className:"d-flex g-2",children:[(0,N.jsx)(o.A,{className:"mr-2",color:"success",onClick:w,children:"L\u01b0u"}),(0,N.jsx)(o.A,{onClick:M,children:"\u0110\xf3ng"})]})]}),(0,N.jsx)(h.A,{children:(0,N.jsxs)("div",{className:"position-relative",children:[(0,N.jsx)(p.A,{dataProps:s,isChoose:V,diemKD:r,setDiemKD:f,getURL:()=>(0,v.vT)(),setIsChoose:C}),(0,N.jsxs)("div",{className:"d-block form-body-qlcombo",children:[!!r.Id&&!s&&(0,N.jsx)(N.Fragment,{children:(0,N.jsxs)("div",{onClick:()=>x.Ze&&C(!0),className:"btn-reselect-bussines mb-3",children:[(0,N.jsxs)("p",{className:"mb-0",children:["B\u1ea1n \u0111ang th\xeam m\u1edbi \u0111\u1ecbnh l\u01b0\u1ee3ng cho \u0110i\u1ec3m kinh doanh :"," ",(0,N.jsxs)("strong",{className:"title-name-bussines",children:[" ",r.Name]})]}),x.Ze&&(0,N.jsx)("div",{className:"btn-change-select-bussines",children:(0,N.jsx)(D.A,{fa:"refresh"})})]})}),(0,N.jsxs)("div",{className:"row",children:[(0,N.jsx)("div",{className:"col-6",children:s?(0,N.jsx)(j,{title:"Lo\u1ea1i Combo",value:s.TenLoai}):(0,N.jsx)(u.A,{data:A.NhomSanPhamDichVu_Id,value:I,onChange:(e,n)=>P(n)})}),(0,N.jsx)("div",{className:"col-6",children:s?(0,N.jsx)(j,{required:!0,title:"Combo",value:s.TenCombo}):(0,N.jsx)(u.A,{data:A.SanPhamDichVu_Id,value:null===S||void 0===S?void 0:S.SanPhamDichVu_Id,onChange:L})}),(0,N.jsx)("div",{className:"col-6",children:(0,N.jsx)(u.A,{data:null===A||void 0===A?void 0:A.NgayApDung,value:null===S||void 0===S?void 0:S.NgayApDung,onChange:L})}),"dieuhanh"===g.lg.MaVaiTro&&s&&(0,N.jsx)("div",{className:"col-6",children:s?(0,N.jsx)(j,{required:!0,title:"\u0110i\u1ec3m kinh doanh",value:s.TenChiNhanh}):(0,N.jsx)(u.A,{data:null===A||void 0===A?void 0:A.DiemKinhDoanh_Id,value:null===S||void 0===S?void 0:S.DiemKinhDoanh_Id,onChange:L})})]}),(0,N.jsx)(m.A,{ref:_,title:(0,N.jsx)("h6",{children:"Chi ph\xed th\xe0nh ph\u1ea9m"}),url:"ChiTietComboes",where:"SanPhamDichVu_Id eq ".concat(null===S||void 0===S?void 0:S.SanPhamDichVu_Id," and DiemKinhDoanh_Id eq ").concat(null===S||void 0===S?void 0:S.DiemKinhDoanh_Id),columns:v.lT.filter((e=>e.isEdit!==(s?2:1))),addMoreRows:!0,addActionAgree:()=>(0,v.vT)(r.Id),data:!(s||0===s)&&[]}),(0,N.jsx)("div",{className:"mt-4",children:(0,N.jsx)(m.A,{ref:b,title:(0,N.jsx)("h6",{children:"Chi ph\xed kh\xe1c"}),url:"ChiTietSuatAn_ChiPhi",where:"SanPham_Id eq ".concat(null===S||void 0===S?void 0:S.SanPhamDichVu_Id," and DiemKinhDoanh_Id eq ").concat(null===S||void 0===S?void 0:S.DiemKinhDoanh_Id),columns:v.ai,addMoreRows:!0,data:!(s||0===s)&&[]})})]})]})})]})})},j=e=>{let{title:n,value:a,required:i}=e;return(0,N.jsx)(N.Fragment,{children:(0,N.jsxs)(s.A,{children:[(0,N.jsx)(c.A,{className:"m-0 p-0",md:12,children:i?(0,N.jsx)(f.m,{children:n}):(0,N.jsx)(r.A,{children:n})}),(0,N.jsx)(c.A,{md:12,children:(0,N.jsx)("div",{className:"form-control-value",children:a})})]})})}},78042:(e,n,a)=>{a.d(n,{Jw:()=>o,Ze:()=>d});var i=a(59051),l=a.n(i),t=a(53744);const d="dieuhanh"===t.lg.MaVaiTro,o=(t.lg.TenHienThi,t.lg.DiemKinhDoanhId,l()().format())},57120:(e,n,a)=>{a.r(n),a.d(n,{default:()=>T});var i=a(9950),l=a(4370),t=a(67116),d=a(85560),o=a(75132),h=a(765),s=a(58195),c=a(14113),r=a(99308),u=a(85907),m=a(59051),v=a.n(m),g=a(36841),p=a(44414);const D=e=>{let{open:n,data:a,close:t}=e;return(0,i.useEffect)((()=>{(null===a||void 0===a?void 0:a.DiemKinhDoanh_Id)&&(0,l.Pq)("ChiTietCombo/GetListThanhPham?DiemKinhDoanh_Id=".concat(null===a||void 0===a?void 0:a.DiemKinhDoanh_Id),"GET",null,!1).then((e=>{o.UP.push((0,h.Jz)(e.value,"Id"))}))}),[a]),(0,p.jsx)(p.Fragment,{children:(0,p.jsxs)(s.A,{size:"xl",isOpen:n,toggle:t,children:[(0,p.jsx)(c.A,{toggle:t,children:"Th\xf4ng tin \u0110\u1ecbnh l\u01b0\u1ee3ng su\u1ea5t \u0103n (Combo)"}),(0,p.jsxs)(r.A,{children:[(0,p.jsxs)("div",{className:"btn-reselect-bussines d-block",children:[(0,p.jsxs)("div",{className:"d-flex mb-3 align-items-center",children:[(0,p.jsx)("h6",{className:"mb-0 text-muted col-5",children:"T\xean su\u1ea5t \u0103n (Combo) :"}),(0,p.jsx)("p",{className:"mb-0",children:null===a||void 0===a?void 0:a.TenCombo})]}),(0,p.jsxs)("div",{className:"d-flex mb-3 align-items-center",children:[(0,p.jsx)("h6",{className:"mb-0 text-muted col-5",children:"Lo\u1ea1i Combo :"}),(0,p.jsx)("p",{className:"mb-0",children:null===a||void 0===a?void 0:a.TenLoai})]}),(0,p.jsxs)("div",{className:"d-flex mb-3 align-items-center",children:[(0,p.jsx)("h6",{className:"mb-0 text-muted col-5",children:"Ng\xe0y \xe1p d\u1ee5ng :"}),(0,p.jsx)("p",{className:"mb-0",children:(null===a||void 0===a?void 0:a.NgayApDung)&&v()(null===a||void 0===a?void 0:a.NgayApDung).format("DD-MM-YYYY")})]}),(0,p.jsxs)("div",{className:"d-flex align-items-center",children:[(0,p.jsx)("h6",{className:"mb-0 text-muted col-5",children:"\u0110i\u1ec3m kinh doanh :"}),(0,p.jsx)("p",{className:"mb-0",children:null===a||void 0===a?void 0:a.TenChiNhanh})]})]}),(0,p.jsxs)("div",{className:"mt-4",children:[(0,p.jsx)(d.A,{title:(0,p.jsx)("h6",{children:"Chi ph\xed th\xe0nh ph\u1ea9m"}),url:"ChiTietComboes",where:"SanPhamDichVu_Id eq ".concat(null===a||void 0===a?void 0:a.SanPhamDichVu_Id," and DiemKinhDoanh_Id eq ").concat(null===a||void 0===a?void 0:a.DiemKinhDoanh_Id),columns:o.lT.filter((e=>1!==e.isEdit))}),(0,p.jsx)("div",{className:"mt-4",children:(0,p.jsx)(d.A,{title:(0,p.jsx)("h6",{children:"Chi ph\xed kh\xe1c"}),url:"ChiTietSuatAn_ChiPhi",where:"SanPham_Id eq ".concat(null===a||void 0===a?void 0:a.SanPhamDichVu_Id," and DiemKinhDoanh_Id eq ").concat(null===a||void 0===a?void 0:a.DiemKinhDoanh_Id),columns:o.ai})})]})]}),(0,p.jsxs)(u.A,{className:"p-4",children:[(0,p.jsx)("h5",{className:"ml-2 mb-0",children:"Gi\xe1 v\u1ed1n Combo:"})," ",null!==a&&void 0!==a&&a.TongChiPhi?(0,p.jsxs)("h5",{className:"mb-0",children:[(0,g.vv)(null===a||void 0===a?void 0:a.TongChiPhi)," VN\u0110"]}):(0,p.jsx)("h5",{className:"mb-0",children:"0"})]})]})})};a(87297);var f=a(78042),x=a(53744);const N=i.createRef(),b=()=>N.current&&N.current.onQueryChange(),T=()=>{const[e,n]=(0,i.useState)(),[a,s]=(0,i.useState)(),[c,r]=(0,i.useState)({Id:null,Name:""});return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)("div",{className:"d-block",children:(0,p.jsx)(d.A,{tableRef:N,title:"\u0110\u1ecbnh L\u01b0\u1ee3ng Su\u1ea5t \u0102n (Combo)",urlExt:"ChiTietCombo/GetChitietCombo?".concat(f.Ze?"":"&DiemKinhDoanh_Id=".concat(x.lg.DiemKinhDoanhId)),columns:o.Gj,SearchAdvanced:()=>(0,p.jsx)("div",{className:""}),selectType:"withColumns",onAdd:{onClick:e=>n(!0)},onEdit:{onClick:(e,a)=>n(a)},onDelete:{onClick:(e,n)=>(0,t.A1)("B\u1ea1n ch\u1eafc ch\u1eafc mu\u1ed1n x\xf3a su\u1ea5t \u0103n n\xe0y kh\xf4ng?","Th\xf4ng b\xe1o").then((()=>(e=>{(0,l.Pq)("ChiTietCombo/DeleteChitietCombo?SanPhamDichVu_Id=".concat(null===e||void 0===e?void 0:e.SanPhamDichVu_Id,"&DiemKinhDoanh_Id=").concat(null===e||void 0===e?void 0:e.DiemKinhDoanh_Id),"DELETE",null,!1).then((e=>{(0,t.nw)("X\xf3a th\xe0nh c\xf4ng"),b()}))})(n)))},onRowClick:(e,n)=>s(n)})}),!!e&&(0,p.jsx)(h.Ay,{diemKD:c,setDiemKD:r,open:!!e,close:()=>n(!1),dataProps:e&&!0!==e?e:null,reloadTable:b}),(0,p.jsx)(D,{open:!!a,data:a,close:()=>s(null)})]})}},11214:(e,n,a)=>{a.d(n,{A:()=>c});var i=a(9950),l=a(58195),t=a(73613),d=a(71911),o=a(85560),h=a(36841),s=a(44414);const c=e=>{let{data:n,close:a,Id:h}=e;const[c,u]=(0,i.useState)(null);return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(l.A,{size:"xl",isOpen:!!n,toggle:a,children:(0,s.jsxs)("div",{className:"p-5",children:[(0,s.jsxs)("div",{className:"d-flex",children:[(0,s.jsx)("h2",{style:{borderBottom:"solid 2px rgb(0, 140, 255)"},className:"mb-4 pb-1 pr-1",children:"Danh s\xe1ch nguy\xean v\u1eadt li\u1ec7u"}),(0,s.jsx)("div",{onClick:a,className:"btn-close-detail-spdd ml-auto",children:(0,s.jsx)(t.A,{fa:"close"})})]}),(0,s.jsx)("div",{style:{gap:"1.5rem"},className:"d-flex mt-2",children:(0,s.jsxs)("div",{className:"d-block outline-form-quantity-pro",children:[(0,s.jsxs)("div",{style:{color:"#0075d5"},className:"form-quantity-pro text-uppercase",children:[(0,s.jsx)("div",{className:"icon-quanlity-pro",children:(0,s.jsx)(t.A,{fa:"cutlery"})}),(0,s.jsx)("p",{className:"mb-1 mt-1 h5",children:(0,s.jsx)("strong",{children:(null===n||void 0===n?void 0:n.Name)||(null===n||void 0===n?void 0:n.TenSanPham)})})]}),(0,s.jsx)("p",{className:"mb-0",children:"S\u1ea3n ph\u1ea9m \u0111\u1ea1i di\u1ec7n."})]})}),(0,s.jsx)("div",{className:"mt-3",children:(0,s.jsx)(o.A,{title:"Danh s\xe1ch s\u1ea3n ph\u1ea9m theo Nh\xe0 cung c\u1ea5p",url:"DM_SanPhamDichVu",where:"SanPhamDaiDien_Id eq ".concat(h),columns:d.Yn})}),(0,s.jsx)("div",{className:"mt-3",children:(0,s.jsx)(o.A,{title:"Gi\xe1 v\u1ed1n",url:"DM_NVL_DiemKinhDoanh",where:"NguyenVatLieu_Id eq ".concat(h),columns:d.Z9,onRowClick:(e,n)=>u(n.DM_DiemKinhDoanh)})})]})}),(0,s.jsx)(r,{Id:h,dataDkd:c,close:()=>u(null)})]})},r=e=>{let{Id:n,dataDkd:a,close:i}=e;return(0,s.jsx)(s.Fragment,{children:(0,s.jsx)(l.A,{isOpen:null===a||void 0===a?void 0:a.Id,toggle:i,children:(0,s.jsx)("div",{className:"p-3",children:(0,s.jsx)(o.A,{url:"Sale_TonKho",title:null===a||void 0===a?void 0:a.Ten,columns:[{title:"T\xean nguy\xean v\u1eadt li\u1ec7u",field:"DM_SanPhamDichVu.TenSanPham"},{title:"Gi\xe1 v\u1ed1n",field:"GiaVon",render:e=>"".concat((0,h.vv)(null===e||void 0===e?void 0:e.GiaVon)," VN\u0110")},{title:"T\u1ed3n kho",field:"SoLuongTon",render:e=>"".concat((0,h.vv)(null===e||void 0===e?void 0:e.SoLuongTon))}],where:"DM_SanPhamDichVu/SanPhamDaiDien_Id eq ".concat(n," and DM_Kho/DiemKinhDoanh_Id eq ").concat(null===a||void 0===a?void 0:a.Id)})})})})}},71911:(e,n,a)=>{a.d(n,{Yn:()=>h,Z9:()=>s,ne:()=>o});a(9950);var i=a(97159),l=a(68315),t=a(36841),d=a(44414);const o=e=>[{title:"Id",field:"Id",type:"numeric",dataID:!0,hidden:!0,editable:"never",cellStyle:{textAlign:"center"}},{title:"T\xean",field:"Name",type:"string",searchable:!0},{title:"\u0110\u01a1n v\u1ecb t\xednh",field:"DM_DonViTinh.Ten",type:"string",dataRef:["DonViTinh_Id"],dataCheck:!0,editComponent:e=>(0,d.jsx)(i.A,{url:"DM_DonViTinh",valueField:"Id",textField:"Ten",value:e.value,onChange:n=>n?e.onChange(n):e.onChange(null),placeholder:"Ch\u1ecdn \u0111\u01a1n v\u1ecb t\xednh"})}],h=[{title:"H\xecnh \u1ea3nh",field:"HinhAnh",type:"img",width:1,render:e=>(0,d.jsx)(l.RB,{style:{width:"2rem",height:"2rem",borderRadius:"50%"},url:e.HinhAnh})},{title:"M\xe3 s\u1ea3n ph\u1ea9m",field:"MaSanPham",width:2,searchable:!0,styleFormMenu:{position:"absolute",right:"1rem",color:"#464646",top:"1rem",background:"white",padding:"0.2rem 1rem",borderRadius:"5px",boxShadow:"rgba(60, 64, 67, 0.3) 0px 1px 2px 0px, rgba(60, 64, 67, 0.15) 0px 1px 3px 1px inset"}},{title:"T\xean nguy\xean v\u1eadt li\u1ec7u",field:"TenSanPham",width:3,searchable:!0},{title:"Lo\u1ea1i nguy\xean v\u1eadt li\u1ec7u",subTitle:"Lo\u1ea1i NVL",field:"DM_NhomSanPhamDichVu.Ten",width:2},{title:"Nh\xe0 cung c\u1ea5p",subTitle:"NCC",field:"DM_LienHe.Ten",width:2}],s=[{title:"Kho",field:"DM_DiemKinhDoanh.Ten"},{title:"Kho",field:"DM_DiemKinhDoanh.Id",hidden:!0},{title:"Gi\xe1 v\u1ed1n",field:"GiaVon_NVL",render:e=>"".concat((0,t.vv)(null===e||void 0===e?void 0:e.GiaVon_NVL)," VN\u0110")},{title:"S\u1ed1 l\u01b0\u1ee3ng t\u1ed3n",field:"SoLuongTon",render:e=>"".concat((0,t.vv)(null===e||void 0===e?void 0:e.SoLuongTon))}]},50651:(e,n,a)=>{a.d(n,{A:()=>v});var i=a(58168),l=a(98587),t=a(9950),d=a(11942),o=a.n(d),h=a(48738),s=a.n(h),c=a(44208),r=["className","cssModule","color","body","inverse","outline","tag","innerRef"],u={tag:c.Wx,inverse:o().bool,color:o().string,body:o().bool,outline:o().bool,className:o().string,cssModule:o().object,innerRef:o().oneOfType([o().object,o().string,o().func])},m=function(e){var n=e.className,a=e.cssModule,d=e.color,o=e.body,h=e.inverse,u=e.outline,m=e.tag,v=e.innerRef,g=(0,l.A)(e,r),p=(0,c.qO)(s()(n,"card",!!h&&"text-white",!!o&&"card-body",!!d&&(u?"border":"bg")+"-"+d),a);return t.createElement(m,(0,i.A)({},g,{className:p,ref:v}))};m.propTypes=u,m.defaultProps={tag:"div"};const v=m},76991:(e,n,a)=>{a.d(n,{A:()=>v});var i=a(58168),l=a(98587),t=a(9950),d=a(11942),o=a.n(d),h=a(48738),s=a.n(h),c=a(44208),r=["className","cssModule","innerRef","tag"],u={tag:c.Wx,className:o().string,cssModule:o().object,innerRef:o().oneOfType([o().object,o().string,o().func])},m=function(e){var n=e.className,a=e.cssModule,d=e.innerRef,o=e.tag,h=(0,l.A)(e,r),u=(0,c.qO)(s()(n,"card-body"),a);return t.createElement(o,(0,i.A)({},h,{className:u,ref:d}))};m.propTypes=u,m.defaultProps={tag:"div"};const v=m},27220:(e,n,a)=>{a.d(n,{A:()=>v});var i=a(58168),l=a(98587),t=a(9950),d=a(11942),o=a.n(d),h=a(48738),s=a.n(h),c=a(44208),r=["className","cssModule","tag"],u={tag:c.Wx,className:o().string,cssModule:o().object},m=function(e){var n=e.className,a=e.cssModule,d=e.tag,o=(0,l.A)(e,r),h=(0,c.qO)(s()(n,"card-footer"),a);return t.createElement(d,(0,i.A)({},o,{className:h}))};m.propTypes=u,m.defaultProps={tag:"div"};const v=m},23931:(e,n,a)=>{a.d(n,{A:()=>f});var i=a(58168),l=a(98587),t=a(9950),d=a(11942),o=a.n(d),h=a(48738),s=a.n(h),c=a(44208),r=["className","cssModule","widths","tag"],u=o().oneOfType([o().number,o().string]),m=o().oneOfType([o().bool,o().number,o().string,o().shape({size:o().oneOfType([o().bool,o().number,o().string]),order:u,offset:u})]),v={tag:c.Wx,xs:m,sm:m,md:m,lg:m,xl:m,className:o().string,cssModule:o().object,widths:o().array},g={tag:"div",widths:["xs","sm","md","lg","xl"]},p=function(e,n,a){return!0===a||""===a?e?"col":"col-"+n:"auto"===a?e?"col-auto":"col-"+n+"-auto":e?"col-"+a:"col-"+n+"-"+a},D=function(e){var n=e.className,a=e.cssModule,d=e.widths,o=e.tag,h=(0,l.A)(e,r),u=[];d.forEach((function(n,i){var l=e[n];if(delete h[n],l||""===l){var t=!i;if((0,c.Gv)(l)){var d,o=t?"-":"-"+n+"-",r=p(t,n,l.size);u.push((0,c.qO)(s()(((d={})[r]=l.size||""===l.size,d["order"+o+l.order]=l.order||0===l.order,d["offset"+o+l.offset]=l.offset||0===l.offset,d)),a))}else{var m=p(t,n,l);u.push(m)}}})),u.length||u.push("col");var m=(0,c.qO)(s()(n,u),a);return t.createElement(o,(0,i.A)({},h,{className:m}))};D.propTypes=v,D.defaultProps=g;const f=D},76152:(e,n,a)=>{a.d(n,{A:()=>v});var i=a(58168),l=a(98587),t=a(9950),d=a(11942),o=a.n(d),h=a(48738),s=a.n(h),c=a(44208),r=["className","cssModule","row","disabled","check","inline","tag"],u={children:o().node,row:o().bool,check:o().bool,inline:o().bool,disabled:o().bool,tag:c.Wx,className:o().string,cssModule:o().object},m=function(e){var n=e.className,a=e.cssModule,d=e.row,o=e.disabled,h=e.check,u=e.inline,m=e.tag,v=(0,l.A)(e,r),g=(0,c.qO)(s()(n,!!d&&"row",h?"form-check":"form-group",!(!h||!u)&&"form-check-inline",!(!h||!o)&&"disabled"),a);return"fieldset"===m&&(v.disabled=o),t.createElement(m,(0,i.A)({},v,{className:g}))};m.propTypes=u,m.defaultProps={tag:"div"};const v=m},55627:(e,n,a)=>{a.d(n,{A:()=>f});var i=a(58168),l=a(98587),t=a(9950),d=a(11942),o=a.n(d),h=a(48738),s=a.n(h),c=a(44208),r=["className","cssModule","hidden","widths","tag","check","size","for"],u=o().oneOfType([o().number,o().string]),m=o().oneOfType([o().bool,o().string,o().number,o().shape({size:u,order:u,offset:u})]),v={children:o().node,hidden:o().bool,check:o().bool,size:o().string,for:o().string,tag:c.Wx,className:o().string,cssModule:o().object,xs:m,sm:m,md:m,lg:m,xl:m,widths:o().array},g={tag:"label",widths:["xs","sm","md","lg","xl"]},p=function(e,n,a){return!0===a||""===a?e?"col":"col-"+n:"auto"===a?e?"col-auto":"col-"+n+"-auto":e?"col-"+a:"col-"+n+"-"+a},D=function(e){var n=e.className,a=e.cssModule,d=e.hidden,o=e.widths,h=e.tag,u=e.check,m=e.size,v=e.for,g=(0,l.A)(e,r),D=[];o.forEach((function(n,i){var l=e[n];if(delete g[n],l||""===l){var t,d=!i;if((0,c.Gv)(l)){var o,h=d?"-":"-"+n+"-";t=p(d,n,l.size),D.push((0,c.qO)(s()(((o={})[t]=l.size||""===l.size,o["order"+h+l.order]=l.order||0===l.order,o["offset"+h+l.offset]=l.offset||0===l.offset,o))),a)}else t=p(d,n,l),D.push(t)}}));var f=(0,c.qO)(s()(n,!!d&&"sr-only",!!u&&"form-check-label",!!m&&"col-form-label-"+m,D,!!D.length&&"col-form-label"),a);return t.createElement(h,(0,i.A)({htmlFor:v},g,{className:f}))};D.propTypes=v,D.defaultProps=g;const f=D},85907:(e,n,a)=>{a.d(n,{A:()=>v});var i=a(58168),l=a(98587),t=a(9950),d=a(11942),o=a.n(d),h=a(48738),s=a.n(h),c=a(44208),r=["className","cssModule","tag"],u={tag:c.Wx,className:o().string,cssModule:o().object},m=function(e){var n=e.className,a=e.cssModule,d=e.tag,o=(0,l.A)(e,r),h=(0,c.qO)(s()(n,"modal-footer"),a);return t.createElement(d,(0,i.A)({},o,{className:h}))};m.propTypes=u,m.defaultProps={tag:"div"};const v=m},70349:(e,n,a)=>{a.d(n,{A:()=>p});var i=a(58168),l=a(98587),t=a(9950),d=a(11942),o=a.n(d),h=a(48738),s=a.n(h),c=a(44208),r=["className","cssModule","noGutters","tag","form","widths"],u=o().oneOfType([o().number,o().string]),m={tag:c.Wx,noGutters:o().bool,className:o().string,cssModule:o().object,form:o().bool,xs:u,sm:u,md:u,lg:u,xl:u},v={tag:"div",widths:["xs","sm","md","lg","xl"]},g=function(e){var n=e.className,a=e.cssModule,d=e.noGutters,o=e.tag,h=e.form,u=e.widths,m=(0,l.A)(e,r),v=[];u.forEach((function(n,a){var i=e[n];if(delete m[n],i){var l=!a;v.push(l?"row-cols-"+i:"row-cols-"+n+"-"+i)}}));var g=(0,c.qO)(s()(n,d?"no-gutters":null,h?"form-row":"row",v),a);return t.createElement(o,(0,i.A)({},m,{className:g}))};g.propTypes=m,g.defaultProps=v;const p=g},15255:(e,n,a)=>{var i;a.d(n,{A:()=>r});var l=new Uint8Array(16);function t(){if(!i&&!(i="undefined"!==typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!==typeof msCrypto&&"function"===typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return i(l)}const d=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;const o=function(e){return"string"===typeof e&&d.test(e)};for(var h=[],s=0;s<256;++s)h.push((s+256).toString(16).substr(1));const c=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,a=(h[e[n+0]]+h[e[n+1]]+h[e[n+2]]+h[e[n+3]]+"-"+h[e[n+4]]+h[e[n+5]]+"-"+h[e[n+6]]+h[e[n+7]]+"-"+h[e[n+8]]+h[e[n+9]]+"-"+h[e[n+10]]+h[e[n+11]]+h[e[n+12]]+h[e[n+13]]+h[e[n+14]]+h[e[n+15]]).toLowerCase();if(!o(a))throw TypeError("Stringified UUID is invalid");return a};const r=function(e,n,a){var i=(e=e||{}).random||(e.rng||t)();if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,n){a=a||0;for(var l=0;l<16;++l)n[a+l]=i[l];return n}return c(i)}},14944:()=>{},87297:()=>{}}]);