????
Current Path : C:/inetpub/vhost/lantha.gdtsolutions.vn/wwwtest/wwwroot/static/js/ |
Current File : C:/inetpub/vhost/lantha.gdtsolutions.vn/wwwtest/wwwroot/static/js/7076.f8c925a4.chunk.js |
"use strict";(self.webpackChunkgdt=self.webpackChunkgdt||[]).push([[7076],{428:(e,t,a)=>{a.d(t,{A5:()=>c,G5:()=>n,Is:()=>m,UI:()=>o,V$:()=>p,Yv:()=>r,Z5:()=>h,e9:()=>u,gn:()=>i,jB:()=>s,xz:()=>g});a(67116);const n=e=>e.filter((e=>e.dataID))[0],o=e=>n(e).field,i=e=>e&&e.includes("."),l=e=>e.split(".").join("/"),d=(e,t)=>e?t.field:t,r=(e,t,a)=>{const o=n(t);return`${e}(${"guid"===o.type?"guid":""}'${a[o.field]}')`},s=function(e,t,a){return arguments.length>3&&void 0!==arguments[3]&&arguments[3]?`substringof('${a}', ${e})`:`${e} eq ${((e,t)=>"string"===e?`'${t}'`:"datetime"===e?`datetime'${t}'`:"guid"===e?`guid'${t}'`:`${t}`)(t,a)}`},c=(e,t)=>{if(e.filters&&e.filters.length>0){const t=e.filters.filter((e=>e.column.field&&e.column.type)).map((e=>{const t=`${i(e.column.field)?e.column.dataRef?e.column.dataRef[0]:l(e.column.field):e.column.field}`;return s(t,e.column.type,e.value)}));return t&&t.join(" and ")}if(e.search&&e.search.length>=1){const a=t.filter((e=>e.searchable&&e.field&&e.type)).map((t=>{const a=`${i(t.field)?l(t.field):t.field}`;return s(a,t.type,e.search,!0)}));return a&&a.join(" or ")}return""},h=(e,t)=>`$top=${t}&$skip=${e*t}&$inlinecount=allpages`,p=(e,t)=>`&$orderby=${i(e)?l(e):e} ${t}`,u=function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],a=e.filter((e=>i(d(t,e))));return 0===a.length?"":`&$expand=${function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],a=[];return e.forEach(((e,n)=>{let o=d(t,e).split(".").reverse().splice(1).reverse().join("/");0===n?a.push(o):a.some((e=>e===o))||a.push(o)})),a.join(",")}(a,t)}`},m=function(e){const t=function(e,t){let a=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return t?"withColumns"===t?`${e.reduce(((e,t,n,o)=>{let r=d(a,t),s=`${e}`;return i(r)?s+=`${void 0===t.dataRef?"":t.dataRef[0]+","}${l(r)}`:s+=`${r}`,`${s}${n===o.length-1?"":","}`}),"")}`:"":`${e.filter((e=>i(e.field))).reduce(((e,t)=>`${e},${l(d(a,t))}`),"*")}`}(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:"withColumns",!(arguments.length>2&&void 0!==arguments[2])||arguments[2]);return t?`&$select=${t}`:""},g=function(e,t){let a=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"withColumns";return`${u(e,a)}${m(e,n,a)}${t?"&$filter="+t:""}`}},10077:(e,t,a)=>{a.d(t,{A:()=>b});var n=a(9950),o=a(15255);const i={body:{emptyDataSourceMessage:"Kh\xf4ng c\xf3 d\u1eef li\u1ec7u \u0111\u1ec3 hi\u1ec3n th\u1ecb",addTooltip:"Th\xeam",editTooltip:"S\u1eeda",deleteTooltip:"X\xf3a",editRow:{deleteText:"B\u1ea1n c\xf3 ch\u1eafc ch\u1eafn x\xf3a d\xf2ng n\xe0y kh\xf4ng?",cancelTooltip:"H\u1ee7y",saveTooltip:"L\u01b0u"}},toolbar:{exportTitle:"Xu\u1ea5t file",searchTooltip:"T\xecm ki\u1ebfm",showColumnsTitle:"Hi\u1ec7n c\u1ed9t",addRemoveColumns:"Th\xeam v\xe0 hi\u1ec3n th\u1ecb c\xe1c c\u1ed9t",searchPlaceholder:"T\xecm ki\u1ebfm"},pagination:{labelRowsPerPage:"S\u1ed1 d\xf2ng cho 1 trang",labelRowsSelect:"d\xf2ng",labelDisplayedRows:" {from}-{to} c\u1ee7a {count}",firstTooltip:"Trang \u0111\u1ea7u ti\xean",previousTooltip:"Trang tr\u01b0\u1edbc",nextTooltip:"Trang sau",lastTooltip:"Trang cu\u1ed1i c\xf9ng"},header:{actions:"Thao t\xe1c"}};var l=a(44414);const d=n.lazy((()=>Promise.all([a.e(9818),a.e(8185),a.e(3130),a.e(783),a.e(7930),a.e(7608),a.e(7476),a.e(484),a.e(7925),a.e(5060),a.e(2026),a.e(8190),a.e(537),a.e(1105)]).then(a.bind(a,38671)))),r=n.lazy((()=>Promise.all([a.e(9818),a.e(3130),a.e(783),a.e(7930),a.e(5060),a.e(5897)]).then(a.bind(a,46350)))),s=n.lazy((()=>Promise.all([a.e(9818),a.e(3435)]).then(a.bind(a,33435)))),c={color:"#000",padding:"2px",fontSize:"12px",fontWeight:"bold",textAlign:"center",backgroundColor:"powderblue",borderLeft:"0.5px solid rgb(224, 224, 224)",zIndex:99},h={even:"#FFF",odd:"rgb(247, 248, 255)"},p={fontSize:"12px",borderLeft:"0.5px solid rgba(224, 224, 224, 1)"};class u extends n.Component{render(){const{addMoreRows:e,pageSize:t,search:a,CustumToolbar:n,CustumCell:o,SearchAdvanced:h,onRowClick:u,dataCount:m,rowStyle:g,rowsPerPage:f,page:b,...C}=this.props;return(0,l.jsx)(d,{...C,addMoreRows:e,localization:i,options:{exportButton:!1,search:a,actionsColumnIndex:-1,pageSize:t,headerStyle:c,rowStyle:g},onRowClick:void 0===u?void 0:(e,t)=>u(e,t),components:(()=>{let e={Toolbar:e=>(0,l.jsx)(r,{...e,SearchAdvanced:h}),Cell:e=>(0,l.jsx)(s,{...e,style:p})};return n&&(e.Toolbar=n),o&&(e.Cell=o),e})()})}}u.defaultProps={rowStyle:(e,t,a)=>({backgroundColor:t%2===0?h.even:h.odd}),pageSize:10,search:!0};var m=a(428),g=a(4370),f=a(67116);class b extends n.Component{render(){const{tableRef:e,url:t,title:a,columns:n,pageSize:i,detailPanel:d,where:r,search:s,selectType:c,rowStyle:h,onAdd:p,onEdit:b,onDelete:C,onActions:S,onRowClick:v,SearchAdvanced:y,CustumToolbar:x,CustumCell:T,urlExt:R,unRefresDatatable:w,notCreateUUID:D,messageCustomDetele:k}=this.props,A=e=>n.filter((e=>m.gn(e.field)&&e.dataRef)).map((e=>({column:e,field_split:e.field.split(".")}))).forEach((t=>{delete e[t.field_split[0]]})),$=e=>{let t=n.filter((e=>e.dataCheck));for(var a=0;a<t.length;a++)if(m.gn(t[a].field)&&t[a].dataRef){if(null===e[t[a].dataRef[0]]||void 0===e[t[a].dataRef[0]]||""===e[t[a].field])return(0,f.AB)("Vui l\xf2ng nh\u1eadp d\u1eef li\u1ec7u c\u1ed9t "+t[a].title),!1}else if(void 0===e[t[a].field]||null===e[t[a].field]||""===e[t[a].field])return(0,f.AB)("Vui l\xf2ng nh\u1eadp d\u1eef li\u1ec7u c\u1ed9t "+t[a].title),!1;return!0};return(0,l.jsx)(u,{search:s,pageSize:i,title:a,columns:n,tableRef:e,SearchAdvanced:y,CustumToolbar:x,CustumCell:T,data:e=>R?(0,g.g3)((e=>`${R}${r?"?"+r:"&"}skip=${e.page*e.pageSize}&take=${e.pageSize}`)(e),"GET",null,!1).then((t=>({data:void 0===t.value?[]:t.value,page:e.page,totalCount:Number(t.count)}))):(0,g.g3)((e=>{let a=`${t}?${m.Z5(e.page,e.pageSize)}`;a+=`${m.e9(n)}${m.Is(n,c)}`,e.orderBy&&void 0!==e.orderBy&&e.orderDirection&&""!==e.orderDirection&&(a+=m.V$(e.orderBy.field,e.orderDirection));let o=m.A5(e,n);return a+=o?r?`&$filter=(${o}) and ${r}`:`&$filter=${o}`:r?"&$filter="+r:"",a})(e)).then((t=>({data:void 0===t.value?[]:t.value,page:e.page,totalCount:Number(t["odata.count"])}))),rowStyle:h,detailPanel:d,editable:(()=>{let e={};return p&&void 0===p.onClick&&!1===p.disabled&&(void 0===p.onRowAdd?e.onRowAdd=e=>new Promise(((a,i)=>{let l=m.G5(n);l.type&&"numeric"!==l.type&&(D?delete e[m.UI(n)]:l.dataIdCustom||(e[m.UI(n)]=(0,o.A)())),A(e),p.defaultValues&&p.defaultValues.forEach((t=>e[t.field]=t.value)),$(e)?(0,g.g3)(`${t}`,"POST",JSON.stringify(e)).then((e=>a(e))).catch((e=>{e.json().then((e=>(0,f.AB)(e.value))),i(e)})).finally((()=>{this.props.updateCountRadioList&&this.props.updateCountRadioList(),this.props.addCallback&&this.props.addCallback()})):i()})).then((e=>this.props.addCallbackWithResponse&&this.props.addCallbackWithResponse(e))).catch((e=>console.log(e))):e.onRowAdd=e=>p.onRowAdd(e)),b&&void 0===b.onClick&&(b.hidden&&("function"===typeof b.hidden?e.onUpdateHidden=e=>b.hidden(e):e.onUpdateHidden=b.hidden),b.disabled&&(e.isEditable=e=>b.disabled(e)),void 0===b.onRowUpdate?e.onRowUpdate=(e,a)=>new Promise(((o,i)=>{A(e),$(e)?(0,g.g3)(m.Yv(t,n,a),"PATCH",JSON.stringify(e)).then((()=>o())).catch((e=>{e.json().then((e=>(0,f.AB)(e.value))),i(e)})).finally((()=>{this.props.updateCountRadioList&&this.props.updateCountRadioList(),this.props.updateCallback&&this.props.updateCallback()})):i()})):e.onRowUpdate=(e,t)=>b.onRowUpdate(e,t)),C&&void 0===C.onClick&&(C.hidden&&("function"===typeof C.hidden?e.onDeleteHidden=e=>C.hidden(e):e.onDeleteHidden=C.hidden),C.disabled&&(e.isDeletable=e=>C.disabled(e)),void 0===C.onRowDelete?e.onRowDelete=e=>new Promise(((a,o)=>(0,g.g3)(m.Yv(t,n,e),"DELETE").then((()=>{C.messageSuccess?a(null,C.messageSuccess):a("X\xf3a d\u1eef li\u1ec7u th\xe0nh c\xf4ng !")})).catch((e=>{k?(0,f.a3)(k,"Th\xf4ng b\xe1o"):(0,f.a3)("X\xf3a d\u1eef li\u1ec7u kh\xf4ng th\xe0nh c\xf4ng !"),C.messageError?o(e,C.messageError):o("X\xf3a d\u1eef li\u1ec7u th\u1ea5t b\u1ea1i !")})).finally((()=>{this.props.updateCountRadioList&&this.props.updateCountRadioList(),this.props.deleteCallback&&this.props.deleteCallback()})))):e.onRowDelete=e=>C.onRowDelete(e)),e})(),actions:(()=>{let e=[];return S&&S.map((t=>e.push(t))),p&&p.onClick&&(p.icon="add_box",p.tooltip="Th\xeam",p.isAdd=!0,p.isFreeAction=!0,e.push(p)),b&&b.onClick&&(b.icon="edit",b.tooltip="S\u1eeda",b.isEdit=!0,e.push(b)),C&&C.onClick&&(C.icon="delete",C.tooltip="X\xf3a",C.isDelete=!0,e.push(C)),e})(),onRowClick:void 0===v?void 0:(e,t)=>v(e,t)})}}b.defaultProps={title:"",columns:[],pageSize:10,search:!0,tableRef:n.createRef()}},15255:(e,t,a)=>{var n;a.d(t,{A:()=>h});var o=new Uint8Array(16);function i(){if(!n&&!(n="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 n(o)}const l=/^(?:[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 d=function(e){return"string"===typeof e&&l.test(e)};for(var r=[],s=0;s<256;++s)r.push((s+256).toString(16).substr(1));const c=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,a=(r[e[t+0]]+r[e[t+1]]+r[e[t+2]]+r[e[t+3]]+"-"+r[e[t+4]]+r[e[t+5]]+"-"+r[e[t+6]]+r[e[t+7]]+"-"+r[e[t+8]]+r[e[t+9]]+"-"+r[e[t+10]]+r[e[t+11]]+r[e[t+12]]+r[e[t+13]]+r[e[t+14]]+r[e[t+15]]).toLowerCase();if(!d(a))throw TypeError("Stringified UUID is invalid");return a};const h=function(e,t,a){var n=(e=e||{}).random||(e.rng||i)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,t){a=a||0;for(var o=0;o<16;++o)t[a+o]=n[o];return t}return c(n)}},32385:(e,t,a)=>{a.d(t,{A:()=>l});var n=a(9950),o=a(23931),i=a(44414);class l extends n.Component{render(){let{children:e,className:t,FilterSearchAdvanced:a,FilterNoHeader:n,NoTabs:l}=this.props,d=[];return t&&d.push(t),d.push("filter-datatable"),a&&d.push("filter-search-advanced"),n&&d.push("filter-no-header"),l&&d.push("filter-no-tabs"),(0,i.jsx)(o.A,{className:d.join(" "),md:"9",children:e})}}l.defaultProps={className:"",FilterSearchAdvanced:"",FilterNoHeader:"",NoTabs:""}},83940:(e,t,a)=>{a.r(t),a.d(t,{default:()=>_});var n=a(9950),o=a(10077),i=a(70537),l=a(58195),d=a(14113),r=a(99308),s=a(85907),c=a(80045),h=a(58168),p=a(2803),u=a(33720),m=a(37751),g=a(53755),f=a(52521),b=n.forwardRef((function(e,t){var a=e.children,o=e.classes,i=e.className,l=e.color,d=void 0===l?"default":l,r=e.component,s=void 0===r?"button":r,u=e.disabled,m=void 0!==u&&u,b=e.disableElevation,C=void 0!==b&&b,S=e.disableFocusRipple,v=void 0!==S&&S,y=e.endIcon,x=e.focusVisibleClassName,T=e.fullWidth,R=void 0!==T&&T,w=e.size,D=void 0===w?"medium":w,k=e.startIcon,A=e.type,$=void 0===A?"button":A,I=e.variant,P=void 0===I?"text":I,z=(0,c.A)(e,["children","classes","className","color","component","disabled","disableElevation","disableFocusRipple","endIcon","focusVisibleClassName","fullWidth","size","startIcon","type","variant"]),N=k&&n.createElement("span",{className:(0,p.A)(o.startIcon,o["iconSize".concat((0,f.A)(D))])},k),V=y&&n.createElement("span",{className:(0,p.A)(o.endIcon,o["iconSize".concat((0,f.A)(D))])},y);return n.createElement(g.A,(0,h.A)({className:(0,p.A)(o.root,o[P],i,"inherit"===d?o.colorInherit:"default"!==d&&o["".concat(P).concat((0,f.A)(d))],"medium"!==D&&[o["".concat(P,"Size").concat((0,f.A)(D))],o["size".concat((0,f.A)(D))]],C&&o.disableElevation,m&&o.disabled,R&&o.fullWidth),component:s,disabled:m,focusRipple:!v,focusVisibleClassName:(0,p.A)(o.focusVisible,x),ref:t,type:$},z),n.createElement("span",{className:o.label},N,a,V))}));const C=(0,u.A)((function(e){return{root:(0,h.A)({},e.typography.button,{boxSizing:"border-box",minWidth:64,padding:"6px 16px",borderRadius:e.shape.borderRadius,color:e.palette.text.primary,transition:e.transitions.create(["background-color","box-shadow","border"],{duration:e.transitions.duration.short}),"&:hover":{textDecoration:"none",backgroundColor:(0,m.X4)(e.palette.text.primary,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"},"&$disabled":{backgroundColor:"transparent"}},"&$disabled":{color:e.palette.action.disabled}}),label:{width:"100%",display:"inherit",alignItems:"inherit",justifyContent:"inherit"},text:{padding:"6px 8px"},textPrimary:{color:e.palette.primary.main,"&:hover":{backgroundColor:(0,m.X4)(e.palette.primary.main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},textSecondary:{color:e.palette.secondary.main,"&:hover":{backgroundColor:(0,m.X4)(e.palette.secondary.main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},outlined:{padding:"5px 15px",border:"1px solid ".concat("light"===e.palette.type?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)"),"&$disabled":{border:"1px solid ".concat(e.palette.action.disabledBackground)}},outlinedPrimary:{color:e.palette.primary.main,border:"1px solid ".concat((0,m.X4)(e.palette.primary.main,.5)),"&:hover":{border:"1px solid ".concat(e.palette.primary.main),backgroundColor:(0,m.X4)(e.palette.primary.main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},outlinedSecondary:{color:e.palette.secondary.main,border:"1px solid ".concat((0,m.X4)(e.palette.secondary.main,.5)),"&:hover":{border:"1px solid ".concat(e.palette.secondary.main),backgroundColor:(0,m.X4)(e.palette.secondary.main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},"&$disabled":{border:"1px solid ".concat(e.palette.action.disabled)}},contained:{color:e.palette.getContrastText(e.palette.grey[300]),backgroundColor:e.palette.grey[300],boxShadow:e.shadows[2],"&:hover":{backgroundColor:e.palette.grey.A100,boxShadow:e.shadows[4],"@media (hover: none)":{boxShadow:e.shadows[2],backgroundColor:e.palette.grey[300]},"&$disabled":{backgroundColor:e.palette.action.disabledBackground}},"&$focusVisible":{boxShadow:e.shadows[6]},"&:active":{boxShadow:e.shadows[8]},"&$disabled":{color:e.palette.action.disabled,boxShadow:e.shadows[0],backgroundColor:e.palette.action.disabledBackground}},containedPrimary:{color:e.palette.primary.contrastText,backgroundColor:e.palette.primary.main,"&:hover":{backgroundColor:e.palette.primary.dark,"@media (hover: none)":{backgroundColor:e.palette.primary.main}}},containedSecondary:{color:e.palette.secondary.contrastText,backgroundColor:e.palette.secondary.main,"&:hover":{backgroundColor:e.palette.secondary.dark,"@media (hover: none)":{backgroundColor:e.palette.secondary.main}}},disableElevation:{boxShadow:"none","&:hover":{boxShadow:"none"},"&$focusVisible":{boxShadow:"none"},"&:active":{boxShadow:"none"},"&$disabled":{boxShadow:"none"}},focusVisible:{},disabled:{},colorInherit:{color:"inherit",borderColor:"currentColor"},textSizeSmall:{padding:"4px 5px",fontSize:e.typography.pxToRem(13)},textSizeLarge:{padding:"8px 11px",fontSize:e.typography.pxToRem(15)},outlinedSizeSmall:{padding:"3px 9px",fontSize:e.typography.pxToRem(13)},outlinedSizeLarge:{padding:"7px 21px",fontSize:e.typography.pxToRem(15)},containedSizeSmall:{padding:"4px 10px",fontSize:e.typography.pxToRem(13)},containedSizeLarge:{padding:"8px 22px",fontSize:e.typography.pxToRem(15)},sizeSmall:{},sizeLarge:{},fullWidth:{width:"100%"},startIcon:{display:"inherit",marginRight:8,marginLeft:-4,"&$iconSizeSmall":{marginLeft:-2}},endIcon:{display:"inherit",marginRight:-4,marginLeft:8,"&$iconSizeSmall":{marginRight:-2}},iconSizeSmall:{"& > *:first-child":{fontSize:18}},iconSizeMedium:{"& > *:first-child":{fontSize:20}},iconSizeLarge:{"& > *:first-child":{fontSize:22}}}}),{name:"MuiButton"})(b);var S=a(16272),v=a(73613),y=a(67116),x=a(4370),T=a(53744),R=a(44414),w={Id:{field_name:"Id",title:"M\xe3 thi\u1ebft b\u1ecb \u0111\u1ecdc QR Code: ",type:"label"},Ten:{field_name:"Ten",title:"T\xean thi\u1ebft b\u1ecb \u0111\u1ecdc QR Code: ",type:"textbox",required:!0},SanPhamDichVu_Id:{field_name:"SanPhamDichVu_Id",title:(0,R.jsxs)("b",{children:["S\u1ea3n ph\u1ea9m d\u1ecbch v\u1ee5: ",(0,R.jsx)("span",{style:{color:"red"},children:"*"})]}),type:"data-select",dataSelect:{options:[],column:["Id","TenSanPham"],value_field:"Id",text_field:"TenSanPham"}},ChucNangBanHang:{field_name:"ChucNangBanHang",title:"Lo\u1ea1i thi\u1ebft b\u1ecb:",type:"radio-list",data:[{value:"true",label:"POS B\xe1n h\xe0ng"},{value:"false",label:"D\u1ecbch v\u1ee5 WC"}]}};class D extends n.Component{constructor(e){super(e),this.getDataSanPhamDichVuTheoWC=()=>{(0,x.Pq)("SanPham/CheckSanPhamVeSinh","GET",null,!1).then((e=>this.setState({dataSanPhamDichVuTheoWC:e},(()=>{w.SanPhamDichVu_Id.dataSelect.options=this.state.dataSanPhamDichVuTheoWC})))).catch((e=>(0,y.a3)("\u0110\xe3 x\u1ea3y ra l\u1ed7i!","Th\xf4ng b\xe1o")))},this.setStateData=(e,t)=>{var{data:a}=this.state;a[e]=t,this.setState({data:a})},this.handleChange=(e,t)=>{if("ChucNangBanHang"===e){"true"===t&&this.setStateData("SanPhamDichVu_Id",null);let e="true"===t;this.setStateData("ChucNangBanHang",e)}else this.setStateData(e,t)},this.handleValidate=e=>{const t=Object.values(w).filter((e=>e.required));let{data:a}=this.state;for(let n=0;n<t.length;n++){const e=t[n];let o=a[e.field_name];if(null===o||""===o||void 0===o||0===o.length)return(0,y.AB)('Vui l\xf2ng nh\u1eadp "'+e.title+'"'),!1}return!0},this.state={data:{Id:null,Ten:"",SanPhamDichVu_Id:null,ChucNangBanHang:!0,DiemKinhDoanh_Id:"",dataSanPhamDichVuTheoWC:[]}},this.save=this.save.bind(this)}componentDidMount(){this.getDataSanPhamDichVuTheoWC()}componentDidUpdate(e,t){var a,n;(null===(a=e.rowSelected)||void 0===a?void 0:a.Id)!==(null===(n=this.props.rowSelected)||void 0===n?void 0:n.Id)&&this.setState({data:{Id:this.props.rowSelected.Id,Ten:this.props.rowSelected.Ten,SanPhamDichVu_Id:this.props.rowSelected.SanPhamDichVu_Id,ChucNangBanHang:this.props.rowSelected.ChucNangBanHang}})}save(){if(this.handleValidate()){let{data:e}=this.state;if(e.ChucNangBanHang||e.SanPhamDichVu_Id){e.DiemKinhDoanh_Id=T.b9.DiemKinhDoanhId;let t=e.Id?"ThietBiDocQRCode/ChinhSua":"ThietBiDocQRCode/TaoMoi",a=e.Id?"C\u1eadp nh\u1eadt th\xe0nh c\xf4ng thi\u1ebft b\u1ecb \u0111\u1ecdc QR Code!":"Th\xeam th\xe0nh c\xf4ng thi\u1ebft b\u1ecb \u0111\u1ecdc QR Code!";(0,x.Pq)(t,"POST",JSON.stringify(e),!1).then((e=>(0,y.nw)(a))).then((()=>{this.props.onReloadTable(),this.props.onClose()})).catch((e=>(0,y.a3)("\u0110\xe3 x\u1ea3y ra l\u1ed7i!")))}else(0,y.AB)("Vui l\xf2ng ch\u1ecdn S\u1ea3n ph\u1ea9m d\u1ecbch v\u1ee5","Th\xf4ng b\xe1o")}}reset(){this.setState({data:{Id:null,Ten:"",SanPhamDichVu_Id:null,ChucNangBanHang:!0}})}render(){const{data:e}=this.state,{rowSelected:t,onClose:a,openModal:n}=this.props;let o=t?"Ch\u1ec9nh s\u1eeda thi\u1ebft b\u1ecb \u0111\u1ecdc QR Code":"Th\xeam thi\u1ebft b\u1ecb \u0111\u1ecdc QR Code";return(0,R.jsxs)(l.A,{isOpen:n,className:"modal-them-sua-thiet-bi",children:[(0,R.jsx)(d.A,{children:o}),(0,R.jsxs)(r.A,{children:[(0,R.jsx)(S.A,{data:w.ChucNangBanHang,value:`${e.ChucNangBanHang}`||"true",onChange:this.handleChange}),(0,R.jsx)(S.A,{data:w.Ten,value:e.Ten,onChange:this.handleChange}),e.ChucNangBanHang?"":(0,R.jsx)(S.A,{data:w.SanPhamDichVu_Id,value:e.SanPhamDichVu_Id,onChange:this.handleChange})]}),(0,R.jsxs)(s.A,{children:[(0,R.jsxs)(C,{className:"cus-btn bg-success",style:{color:"white",marginRight:"10px"},onClick:this.save,children:[(0,R.jsx)(v.A,{fa:"save"})," L\u01b0u"]}),(0,R.jsxs)(C,{className:"cus-btn bg-dark",style:{color:"white"},onClick:()=>{a()},children:[(0,R.jsx)(v.A,{fa:"ban"})," B\u1ecf qua"]})]})]})}}const k=D;var A=a(30616),$=a(28412),I=a(32385),P=a(23931),z=a(62181),N=[{field:"Id",type:"numeric",dataID:!0,hidden:!0,editable:"never"},{title:"T\xean",field:"Ten",type:"string",searchable:!0,cellStyle:{minWidth:100,textAlign:"left"}},{title:"S\u1ea3n ph\u1ea9m d\u1ecbch v\u1ee5",field:"DM_SanPhamDichVu.TenSanPham",type:"string",dataRef:["SanPhamDichVu_Id"],dataCheck:!0,editComponent:e=>(0,R.jsx)(i.rb,{url:"DM_SanPhamDichVu",column:{field:"Id",label:"TenSanPham",type:"int"},value:e.value,onChange:t=>t?e.onChange(t.value):e.onChange(null)}),cellStyle:{minWidth:100,textAlign:"left"},defaultSort:"asc"},{title:"\u0110i\u1ec3m kinh doanh",field:"DM_DiemKinhDoanh.Ten",type:"string",dataRef:["DiemKinhDoanh_Id"],dataCheck:!0,editComponent:e=>(0,R.jsx)(i.rb,{url:"DiemKinhDoanhs",column:{field:"Id",label:"Ten",type:"int"},value:e.value,onChange:t=>t?e.onChange(t.value):e.onChange(null)}),cellStyle:{minWidth:100,textAlign:"left"},defaultSort:"asc"},{title:"Lo\u1ea1i thi\u1ebft b\u1ecb",field:"ChucNangBanHang",type:"boolean",cellStyle:{textAlign:"left"},render:e=>e.ChucNangBanHang?"POS B\xe1n h\xe0ng":"D\u1ecbch v\u1ee5 WC"}];const V=n.createRef(),j=()=>V.current&&V.current.onQueryChange();class B extends n.Component{constructor(e){super(e),this.setSearch=e=>{13===e.charCode&&this.setState({search:e.target.value},(()=>j()))},this.state={openModal:!1,rowSelected:null,search:null},this.CreateAndUpdate=n.createRef()}render(){const{rowSelected:e,openModal:t,search:a}=this.state;let n=[];return a&&n.push(`substringof('${a}', Ten)`),T.b9&&n.push(`DiemKinhDoanh_Id eq ${T.b9.DiemKinhDoanhId}`),(0,R.jsxs)(A.A,{children:[(0,R.jsx)($.A,{NoTabs:!0,children:(0,R.jsx)(P.A,{md:"12",className:"p-0 mb-2",children:(0,R.jsx)(z.A,{title:"T\xecm ki\u1ebfm",defaultValue:a,onKeyPress:e=>this.setSearch(e),placeholder:"T\xecm ki\u1ebfm theo t\xean..."})})}),(0,R.jsxs)(I.A,{NoTabs:!0,children:[(0,R.jsx)(o.A,{tableRef:V,title:"Danh s\xe1ch thi\u1ebft b\u1ecb \u0111\u1ecdc QR Code",url:"DM_ThietBiDocQRCode",where:n.join(" and "),columns:N,selectType:"withColumns",onAdd:{onClick:()=>{this.CreateAndUpdate.current.reset(),this.setState({openModal:!0})}},onEdit:{onClick:(e,t)=>this.setState({openModal:!0,rowSelected:t})},onDelete:{}}),(0,R.jsx)(k,{ref:this.CreateAndUpdate,rowSelected:e,onClose:()=>this.setState({openModal:!1}),openModal:t,onReloadTable:j})]})]})}}class _ extends n.Component{render(){return(0,R.jsx)(B,{})}}},85907:(e,t,a)=>{a.d(t,{A:()=>m});var n=a(58168),o=a(98587),i=a(9950),l=a(11942),d=a.n(l),r=a(48738),s=a.n(r),c=a(44208),h=["className","cssModule","tag"],p={tag:c.Wx,className:d().string,cssModule:d().object},u=function(e){var t=e.className,a=e.cssModule,l=e.tag,d=(0,o.A)(e,h),r=(0,c.qO)(s()(t,"modal-footer"),a);return i.createElement(l,(0,n.A)({},d,{className:r}))};u.propTypes=p,u.defaultProps={tag:"div"};const m=u}}]);