包含后厨 团餐 门店分支
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

2 lines
32 KiB

  1. (self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[657],{17997:function(ct,fe,i){"use strict";i.r(fe),i.d(fe,{default:function(){return Yt}});var U=i(57663),G=i(71577),a=i(39428),ne=i(34792),Z=i(48086),s=i(3182),S=i(2824),ee=i(49101),v=i(67294),ie=i(28790),me=i(85224),te=i(16894),Ke=i(71194),_=i(50146),lt=i(88983),ae=i(47933),Ue=i(49111),ue=i(19650),T=i(48736),R=i(27049),re=i(43358),d=i(34041),ce=i(9715),Y=i(55843),qt=i(47673),he=i(4107),le=i(11849),F=i(48971);function ot(r){return Ze.apply(this,arguments)}function Ze(){return Ze=(0,s.Z)((0,a.Z)().mark(function r(t){return(0,a.Z)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,F.WY)("/saasbase/api/device/page",{method:"POST",data:t}));case 1:case"end":return e.stop()}},r)})),Ze.apply(this,arguments)}function dt(){return ye.apply(this,arguments)}function ye(){return ye=(0,s.Z)((0,a.Z)().mark(function r(){return(0,a.Z)().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return u.abrupt("return",(0,F.WY)("/saasbase/api/product/list",{method:"Get"}));case 1:case"end":return u.stop()}},r)})),ye.apply(this,arguments)}function pt(r){return ge.apply(this,arguments)}function ge(){return ge=(0,s.Z)((0,a.Z)().mark(function r(t){return(0,a.Z)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,F.WY)("/saasbase/api/device/add",{method:"POST",data:t}));case 1:case"end":return e.stop()}},r)})),ge.apply(this,arguments)}function ft(r){return Se.apply(this,arguments)}function Se(){return Se=(0,s.Z)((0,a.Z)().mark(function r(t){return(0,a.Z)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,F.WY)("/saasbase/api/device/PushDeviceGoods?DeviceId="+t,{method:"Get"}));case 1:case"end":return e.stop()}},r)})),Se.apply(this,arguments)}function ze(r){return we.apply(this,arguments)}function we(){return we=(0,s.Z)((0,a.Z)().mark(function r(t){return(0,a.Z)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,F.WY)("/saasbase/api/device/update",{method:"POST",data:t}));case 1:case"end":return e.stop()}},r)})),we.apply(this,arguments)}function ea(r){return De.apply(this,arguments)}function De(){return De=_asyncToGenerator(_regeneratorRuntime().mark(function r(t){return _regeneratorRuntime().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",request("/saasbase/api/device/CopyDevice",{method:"POST",data:t}));case 1:case"end":return e.stop()}},r)})),De.apply(this,arguments)}function ht(r){return be.apply(this,arguments)}function be(){return be=(0,s.Z)((0,a.Z)().mark(function r(t){return(0,a.Z)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,F.WY)("\u200B\u200B/saasbase/api/device/delete",{method:"POST",data:t}));case 1:case"end":return e.stop()}},r)})),be.apply(this,arguments)}function vt(){return ke.apply(this,arguments)}function ke(){return ke=(0,s.Z)((0,a.Z)().mark(function r(){return(0,a.Z)().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return u.abrupt("return",(0,F.WY)("\u200B/saasbase/api/device/getdevicetypelist",{method:"GET"}));case 1:case"end":return u.stop()}},r)})),ke.apply(this,arguments)}function mt(r){return Ce.apply(this,arguments)}function Ce(){return Ce=(0,s.Z)((0,a.Z)().mark(function r(t){return(0,a.Z)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,F.WY)("\u200B/saasbase/api/device/adddevicetype",{method:"POST",data:t}));case 1:case"end":return e.stop()}},r)})),Ce.apply(this,arguments)}function Zt(){return Fe.apply(this,arguments)}function Fe(){return Fe=(0,s.Z)((0,a.Z)().mark(function r(){return(0,a.Z)().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return u.abrupt("return",(0,F.WY)("\u200B/saasbase/api/devicevesion/getdevicevesionlist",{method:"GET"}));case 1:case"end":return u.stop()}},r)})),Fe.apply(this,arguments)}function ta(r,t){return je.apply(this,arguments)}function je(){return je=_asyncToGenerator(_regeneratorRuntime().mark(function r(t,u){return _regeneratorRuntime().wrap(function(M){for(;;)switch(M.prev=M.next){case 0:return M.abrupt("return",request("/saasbase/api/device/GetDeviceGoods",{method:"POST",data:_objectSpread({},t)}));case 1:case"end":return M.stop()}},r)})),je.apply(this,arguments)}function yt(r){return Ie.apply(this,arguments)}function Ie(){return Ie=(0,s.Z)((0,a.Z)().mark(function r(t){return(0,a.Z)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,F.WY)("/saasbase/api/device/AddDeviceGood",{method:"POST",data:(0,le.Z)({},t)}));case 1:case"end":return e.stop()}},r)})),Ie.apply(this,arguments)}function aa(r){return Be.apply(this,arguments)}function Be(){return Be=_asyncToGenerator(_regeneratorRuntime().mark(function r(t){return _regeneratorRuntime().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",request("/saasbase/\u200Bapi/device/GetGoods",{method:"POST",data:_objectSpread({},t)}));case 1:case"end":return e.stop()}},r)})),Be.apply(this,arguments)}function gt(r){return Te.apply(this,arguments)}function Te(){return Te=(0,s.Z)((0,a.Z)().mark(function r(t){return(0,a.Z)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,F.WY)("/saasbase/\u200Bapi/device/GetByDeviceGoods",{method:"POST",data:(0,le.Z)({},t)}));case 1:case"end":return e.stop()}},r)})),Te.apply(this,arguments)}function St(r){return Ae.apply(this,arguments)}function Ae(){return Ae=(0,s.Z)((0,a.Z)().mark(function r(t){return(0,a.Z)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,F.WY)("/saasbase/api/device/GetDeviceStorePage",{method:"POST",data:t}));case 1:case"end":return e.stop()}},r)})),Ae.apply(this,arguments)}function wt(r){return Ee.apply(this,arguments)}function Ee(){return Ee=(0,s.Z)((0,a.Z)().mark(function r(t){return(0,a.Z)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,F.WY)("/saasbase/api/device/DelStockAdjust?Id=".concat(t),{method:"DELETE"}));case 1:case"end":return e.stop()}},r)})),Ee.apply(this,arguments)}function Dt(r){return xe.apply(this,arguments)}function xe(){return xe=(0,s.Z)((0,a.Z)().mark(function r(t){return(0,a.Z)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,F.WY)("/saasbase/api/device/AddUpdateDeviceStocAsync",{method:"POST",data:t}));case 1:case"end":return e.stop()}},r)})),xe.apply(this,arguments)}function bt(r){return Oe.apply(this,arguments)}function Oe(){return Oe=(0,s.Z)((0,a.Z)().mark(function r(t){return(0,a.Z)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,F.WY)("/saasbase/api/device/AddUpdateDeviceStocAsync",{method:"put",data:t}));case 1:case"end":return e.stop()}},r)})),Oe.apply(this,arguments)}function kt(r){return Pe.apply(this,arguments)}function Pe(){return Pe=(0,s.Z)((0,a.Z)().mark(function r(t){return(0,a.Z)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,F.WY)("/saasbase/api/deviceconfig/getlocs?Code=".concat(t),{method:"GET"}));case 1:case"end":return e.stop()}},r)})),Pe.apply(this,arguments)}function Ct(r){return $e.apply(this,arguments)}function $e(){return $e=(0,s.Z)((0,a.Z)().mark(function r(t){return(0,a.Z)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,F.WY)("/saasbase/api/device/GetProductList",{method:"post",data:t}));case 1:case"end":return e.stop()}},r)})),$e.apply(this,arguments)}function Ft(r){return Ge.apply(this,arguments)}function Ge(){return Ge=(0,s.Z)((0,a.Z)().mark(function r(t){return(0,a.Z)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,F.WY)("/saasbase/\u200Bapi/FoodMenu/tree",{data:(0,le.Z)({},t)}));case 1:case"end":return e.stop()}},r)})),Ge.apply(this,arguments)}function jt(r){return Re.apply(this,arguments)}function Re(){return Re=(0,s.Z)((0,a.Z)().mark(function r(t){return(0,a.Z)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,F.WY)("/saasbase/api/device/PushDevice?DeviceId=".concat(t),{method:"post"}));case 1:case"end":return e.stop()}},r)})),Re.apply(this,arguments)}function It(r){return Me.apply(this,arguments)}function Me(){return Me=(0,s.Z)((0,a.Z)().mark(function r(t){return(0,a.Z)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,F.WY)("/saasbase/api/device/CheckStockAdjust?DeviceId=".concat(t),{method:"POST"}));case 1:case"end":return e.stop()}},r)})),Me.apply(this,arguments)}function Je(r){return We.apply(this,arguments)}function We(){return We=(0,s.Z)((0,a.Z)().mark(function r(t){return(0,a.Z)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,F.WY)("/saasbase/api/DeviceVesion/GetDeviceVesion?productId=".concat(t),{method:"Get"}));case 1:case"end":return e.stop()}},r)})),We.apply(this,arguments)}function Bt(r){return Ye.apply(this,arguments)}function Ye(){return Ye=(0,s.Z)((0,a.Z)().mark(function r(t){return(0,a.Z)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,F.WY)("/saasbase/api/goods/TechnologyTemplateExport?deviceId=".concat(t),{method:"post"}));case 1:case"end":return e.stop()}},r)})),Ye.apply(this,arguments)}var n=i(85893),Tt=function(t){var u=(0,v.useState)([]),e=(0,S.Z)(u,2),M=e[0],P=e[1],$=(0,v.useState)(0),z=(0,S.Z)($,2),V=z[0],q=z[1],Q=(0,v.useState)(""),J=(0,S.Z)(Q,2),L=J[0],X=J[1],x=(0,v.useRef)(null);(0,v.useEffect)(function(){console.log(t.values),Object.keys(t.values).length>0&&Je(t.values.productId).then(function(c){P(c.data)})},[t.values]);var O=function(w){Je(w).then(function(j){P(j.data)})},k=function(w){X(w.target.value)},p=function(w){console.log("radio checked",w.target.value),q(w.target.value)},h=function(w){w.preventDefault(),X("");var j={name:L};mt(j).then(function(b){b.succeeded?(Z.default.success("\u6DFB\u52A0\u6210\u529F"),t.initDeviceType()):Z.default.error(b.errors)})};return(0,n.jsx)(_.Z,{title:t.values.id?"\u7F16\u8F91":"\u65B0\u5EFA",width:640,visible:t.createModalVisible,bodyStyle:{padding:"32px 40px 48px"},footer:null,onCancel:function(){t.onCancel()},destroyOnClose:!0,children:(0,n.jsxs)(Y.Z,{layout:"Horizontal",labelCol:{span:4},preserve:!1,initialValues:t.values,onFinish:t.onFinish,children:[(0,n.jsx)(Y.Z.Item,{name:"id",hidden:!0,children:(0,n.jsx)(he.Z,{})}),(0,n.jsx)(Y.Z.Item,{label:"\u8BBE\u5907\u540D\u79F0",name:"deviceName",rules:[{required:!0,max:50}],children:(0,n.jsx)(he.Z,{})}),(0,n.jsx)(Y.Z.Item,{label:"\u6240\u5C5E\u4EA7\u54C1",name:"productId",rules:[{required:!0}],children:(0,n.jsx)(d.Z,{onChange:O,children:t.dicData.map(function(c,w){return(0,n.jsx)(d.Z.Option,{index:w,value:c.id,children:c.label},c.id)})})}),(0,n.jsx)(Y.Z.Item,{label:"\u4EA7\u54C1\u7248\u672C",name:"productVersionId",rules:[{required:!0}],children:(0,n.jsx)(d.Z,{children:M.map(function(c,w){return(0,n.jsx)(d.Z.Option,{index:w,value:c.id,children:c.vesion},c.id)})})}),(0,n.jsx)(Y.Z.Item,{label:"\u8BBE\u5907\u6807\u7B7E",name:"deviceTypeId",rules:[{required:!1}],children:(0,n.jsx)(d.Z,{style:{width:"100%"},placeholder:"\u8BF7\u9009\u8BBE\u5907\u6807\u7B7E",options:t.storeType,dropdownRender:function(w){return(0,n.jsxs)(n.Fragment,{children:[w,(0,n.jsx)(R.Z,{style:{margin:"8px 0"}}),(0,n.jsxs)(ue.Z,{style:{padding:"0 8px 4px"},children:[(0,n.jsx)(he.Z,{placeholder:"\u8BF7\u8F93\u5165\u8BBE\u5907\u6807\u7B7E",ref:x,value:L,onChange:k,onKeyDown:function(b){return b.stopPropagation()}}),(0,n.jsx)(G.Z,{type:"text",icon:(0,n.jsx)(ee.Z,{}),onClick:h,children:"\u65B0\u589E"})]})]})}})}),(0,n.jsx)(Y.Z.Item,{label:"\u652F\u6301\u529F\u80FD",name:"technologyOrBom",rules:[{required:!0}],children:(0,n.jsxs)(ae.ZP.Group,{onChange:p,value:V,children:[(0,n.jsx)(ae.ZP,{value:0,children:"\u5DE5\u827A"}),(0,n.jsx)(ae.ZP,{value:1,children:"\u914D\u65B9"})]})}),(0,n.jsx)(Y.Z.Item,{children:(0,n.jsx)(G.Z,{type:"primary",htmlType:"submit",children:"\u4FDD\u5B58"})})]})})},At=Tt,Et=i(20173),ve=i(86582),ra=i(62350),se=i(24565),xt=function(t){var u=(0,v.useRef)(),e=(0,v.useState)([]),M=(0,S.Z)(e,2),P=M[0],$=M[1],z=(0,v.useState)(!0),V=(0,S.Z)(z,2),q=V[0],Q=V[1],J=(0,v.useState)([]),L=(0,S.Z)(J,2),X=L[0],x=L[1],O=(0,v.useState)(""),k=(0,S.Z)(O,2),p=k[0],h=k[1],c=[{title:"\u83DC\u8C31\u5217\u8868",dataIndex:"foodMenuId",valueType:"treeSelect",hideInTable:!0,fieldProps:{options:X,value:p,onChange:function(E){h(E)}}},{title:"\u5546\u54C1id",dataIndex:"goodsId",tip:"\u89C4\u5219\u540D\u79F0\u662F\u552F\u4E00\u7684 key",hideInSearch:!0,hideInTable:!0},{title:"\u5546\u54C1\u540D\u79F0",dataIndex:"goodsName"}],w=function(){var b=(0,s.Z)((0,a.Z)().mark(function E(){var I,A,y;return(0,a.Z)().wrap(function(W){for(;;)switch(W.prev=W.next){case 0:if((I=t.device)!==null&&I!==void 0&&I.id){W.next=2;break}return W.abrupt("return");case 2:return A=[],P.forEach(function(H){A.push({foodId:H})}),W.next=6,yt({foodss:A,deviceId:t.device.id});case 6:y=W.sent,y.data?(Z.default.success("\u8BBE\u5907\u5546\u54C1\u66F4\u65B0\u6210\u529F\uFF01"),t.onOk()):Z.default.error(JSON.stringify(y.errors)||"\u4E0A\u67B6\u5931\u8D25");case 8:case"end":return W.stop()}},E)}));return function(){return b.apply(this,arguments)}}(),j=function(){var b=(0,s.Z)((0,a.Z)().mark(function E(){var I;return(0,a.Z)().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:return y.next=2,Ft();case 2:I=y.sent,I.statusCode===200&&I.data.length>0&&(h(I.data[0].value),x(I.data));case 4:case"end":return y.stop()}},E)}));return function(){return b.apply(this,arguments)}}();return(0,v.useEffect)(function(){j()},[]),(0,v.useEffect)(function(){u.current&&u.current.reload()},[p]),(0,n.jsx)(_.Z,{width:900,bodyStyle:{padding:"32px 40px 48px"},destroyOnClose:!0,title:"\u3010".concat(t.device.deviceName,"\u3011\u7ED1\u5B9A\u5546\u54C1"),visible:t.open,onCancel:function(){return t.onCancel()},onOk:w,maskClosable:!1,children:(0,n.jsx)(te.ZP,{actionRef:u,rowKey:"goodsId",pagination:{defaultPageSize:10},params:{deviceId:t.device.id},toolBarRender:function(){return[(0,n.jsx)(se.Z,{type:"primary",title:"\u786E\u8BA4\u540C\u6B65\u5417\uFF1F",okText:"\u662F",cancelText:"\u5426",onConfirm:(0,s.Z)((0,a.Z)().mark(function E(){var I;return(0,a.Z)().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:return console.log(t.device.id),y.next=3,ft(t.device.id);case 3:I=y.sent,I.data?(Z.default.success("\u540C\u6B65\u6210\u529F\uFF01"),u.current.reload()):Z.default.error(I.errors||"\u540C\u6B65\u5931\u8D25\uFF01");case 5:case"end":return y.stop()}},E)})),children:(0,n.jsx)(G.Z,{type:"primary",children:"\u540C\u6B65\u5546\u54C1\u5230\u8BBE\u5907"},"primary")},"primary-async")]},request:function(){var b=(0,s.Z)((0,a.Z)().mark(function E(I){var A,y,N,W,H;return(0,a.Z)().wrap(function(K){for(;;)switch(K.prev=K.next){case 0:if(p){K.next=2;break}return K.abrupt("return",[]);case 2:return K.next=4,gt((0,le.Z)((0,le.Z)({},I),{},{foolMenuId:p,storeId:t.device.orgId,foodName:I.goodsName||""}));case 4:if(A=K.sent,A.statusCode!==200){K.next=10;break}return A.data.total>0?(W=new Set([].concat((0,ve.Z)(P),(0,ve.Z)(A.data.data.checkedIds))),H=[],W.forEach(function(Le){H.push(Le)}),$(H)):$([]),K.abrupt("return",{data:((y=A.data)===null||y===void 0||(N=y.data)===null||N===void 0?void 0:N.data)||[],success:!0,total:A.data.total});case 10:return K.abrupt("return",[]);case 11:case"end":return K.stop()}},E)}));return function(E){return b.apply(this,arguments)}}(),columns:c,rowSelection:{type:"checkbox",selectedRowKeys:P,onSelect:function(E,I){var A=(0,ve.Z)(P),y=A.findIndex(function(N){return N===E.goodsId});I?y<0&&A.push(E.goodsId):y>-1&&A.splice(y,1),$(A)},onSelectAll:function(E,I,A){var y=(0,ve.Z)(P);E?I.forEach(function(N){if(!!N){var W=y.findIndex(function(H){return H===N.goodsId});W<0&&y.push(N.goodsId)}}):A.forEach(function(N){var W=y.findIndex(function(H){return H===N.goodsId});W>-1&&y.splice(W,1)}),$(y)}},tableAlertOptionRender:function(){return(0,n.jsx)(ue.Z,{size:16,children:(0,n.jsx)(se.Z,{title:"\u6B64\u64CD\u4F5C\u4F1A\u53D6\u6D88\u6240\u6709\u9009\u4E2D\u9879\uFF0C\u786E\u5B9A\u8981\u53D6\u6D88\u5417\uFF1F",onConfirm:function(){return $([])},okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",children:(0,n.jsx)("a",{children:"\u53D6\u6D88\u9009\u62E9"})})})}})})},Ot=xt,na=i(77883),Pt=i(85986),He="message",$t=function(t){var u,e=Y.Z.useForm(),M=(0,S.Z)(e,1),P=M[0],$=(0,v.useState)([]),z=(0,S.Z)($,2),V=z[0],q=z[1],Q=(0,v.useState)([]),J=(0,S.Z)(Q,2),L=J[0],X=J[1],x=function(){var p=(0,s.Z)((0,a.Z)().mark(function h(){var c;return(0,a.Z)().wrap(function(j){for(;;)switch(j.prev=j.next){case 0:return j.next=2,P.validateFields();case 2:if(c=j.sent,c.DeviceId=t.device.id,!c.id){j.next=9;break}return j.next=7,bt(c).then(function(b){Z.default.destroy(He),b.data?(Z.default.success("\u4FEE\u6539\u6210\u529F"),t.onOk()):Z.default.error("\u4FEE\u6539\u5931\u8D25"+b.errors)});case 7:j.next=11;break;case 9:return j.next=11,Dt(c).then(function(b){Z.default.destroy(He),b.data?(Z.default.success("\u6DFB\u52A0\u6210\u529F"),t.onOk()):Z.default.error("\u6DFB\u52A0\u5931\u8D25"+b.errors)});case 11:case"end":return j.stop()}},h)}));return function(){return p.apply(this,arguments)}}(),O=function(){var p=(0,s.Z)((0,a.Z)().mark(function h(){return(0,a.Z)().wrap(function(w){for(;;)switch(w.prev=w.next){case 0:kt(t.device.deviceTypeKey).then(function(j){q(j.data)});case 1:case"end":return w.stop()}},h)}));return function(){return p.apply(this,arguments)}}(),k=function(){var p=(0,s.Z)((0,a.Z)().mark(function h(){return(0,a.Z)().wrap(function(w){for(;;)switch(w.prev=w.next){case 0:Ct({DeviceId:t.device.id}).then(function(j){X(j.data)});case 1:case"end":return w.stop()}},h)}));return function(){return p.apply(this,arguments)}}();return(0,v.useEffect)(function(){var p;(p=t.stockMaterial)!==null&&p!==void 0&&p.id&&P.setFieldsValue(t.stockMaterial),O(),k()},[]),(0,n.jsx)(_.Z,{width:700,destroyOnClose:!0,title:"".concat((u=t.stockMaterial)!==null&&u!==void 0&&u.id?"\u7F16\u8F91"+t.stockMaterial.batching_Name:"\u65B0\u589E"),visible:t.open,onCancel:t.onCancel,onOk:x,footer:[(0,n.jsx)(G.Z,{onClick:t.onCancel,children:"\u53D6\u6D88"},"back"),(0,n.jsx)(se.Z,{title:"\u70B9\u51FB\u540C\u6B65\u5E93\u5B58\u6216\u91CD\u542F\u8BBE\u5907\u540E\u751F\u6548\uFF01\uFF01\uFF01",onConfirm:x,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",children:(0,n.jsx)(G.Z,{type:"primary",children:"\u786E\u5B9A"},"submit")})],children:(0,n.jsxs)(Y.Z,{layout:"vertical",preserve:!1,form:P,children:[(0,n.jsx)(Y.Z.Item,{name:"id",hidden:!0,children:(0,n.jsx)(he.Z,{})}),(0,n.jsx)(Y.Z.Item,{name:"batching_Id",label:"\u539F\u6599\u540D\u79F0",rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u539F\u6599\u540D\u79F0"}],children:(0,n.jsx)(d.Z,{placeholder:"\u8BF7\u9009\u62E9\u539F\u6599\u540D\u79F0",showSearch:!0,optionFilterProp:"children",filterOption:function(h,c){return c.children.toLowerCase().indexOf(h.toLowerCase())>=0},children:L==null?void 0:L.map(function(p,h){return(0,n.jsx)(d.Z.Option,{index:h,value:p.id,children:p.name},p.id)})})}),(0,n.jsx)(Y.Z.Item,{name:"batching_Loc",label:"\u5E93\u5B58\u4F4D\u7F6E",rules:[{required:!0}],defaultValue:"0",children:(0,n.jsx)(d.Z,{placeholder:"\u8BF7\u9009\u62E9\u5E93\u5B58\u4F4D\u7F6E",children:V==null?void 0:V.map(function(p,h){return(0,n.jsx)(d.Z.Option,{index:h,value:p.loc,children:p.loc},p.loc)})})}),(0,n.jsx)(Y.Z.Item,{name:"batching_Count",label:"\u539F\u6599\u6570\u91CF",rules:[{required:!0}],defaultValue:"0",children:(0,n.jsx)(Pt.Z,{style:{width:"100%"},min:0,placeholder:"\u8BF7\u8F93\u5165\u539F\u6599\u6570\u91CF"})})]})})},Gt=$t,Rt=function(t){var u=(0,v.useRef)(),e=(0,v.useState)(!1),M=(0,S.Z)(e,2),P=M[0],$=M[1],z=(0,v.useState)(),V=(0,S.Z)(z,2),q=V[0],Q=V[1],J=[{title:"\u4E3B\u952E",dataIndex:"id",hideInSearch:!0,hideInTable:!0,tip:"\u89C4\u5219\u540D\u79F0\u662F\u552F\u4E00\u7684 key"},{title:"\u7269\u6599",dataIndex:"batching_Name",valueType:"textarea"},{title:"\u6570\u91CF",dataIndex:"batching_Count",valueType:"textarea"},{title:"\u5E93\u4F4D",dataIndex:"batching_Loc"},{title:"\u64CD\u4F5C",dataIndex:"option",valueType:"option",render:function(O,k){return[(0,n.jsx)("a",{onClick:function(){Q(k),$(!0)},children:"\u4FEE\u6539"},"config"),(0,n.jsx)(se.Z,{type:"primary",title:"\u786E\u8BA4\u5220\u9664\u5417\uFF1F",okText:"\u662F",cancelText:"\u5426",onConfirm:function(){return X(k)},children:(0,n.jsx)("a",{href:"#",children:"\u5220\u9664"})},"primary")]}}],L=function(){t.onOk()},X=function(){var x=(0,s.Z)((0,a.Z)().mark(function O(k){var p;return(0,a.Z)().wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return c.next=2,wt(k.id);case 2:p=c.sent,p.data?(Z.default.success("\u5220\u9664\u6210\u529F"),u.current.reload()):Z.default.error("\u5220\u9664\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5");case 4:case"end":return c.stop()}},O)}));return function(k){return x.apply(this,arguments)}}();return(0,v.useEffect)(function(){},[]),(0,n.jsxs)(_.Z,{width:700,destroyOnClose:!0,title:"\u3010".concat(t.device.deviceName,"\u3011\u5E93\u5B58\u539F\u6599"),visible:t.open,onCancel:function(){return t.onCancel()},onOk:L,maskClosable:!1,children:[(0,n.jsx)(te.ZP,{actionRef:u,rowKey:"id",search:!1,params:{deviceId:t.device.id},toolBarRender:function(){return[(0,n.jsx)(se.Z,{type:"primary",title:"\u83B7\u53D6\u5B9E\u65F6\u5E93\u5B58\u4F1A\u8986\u76D6\u672C\u6B21\u8865\u8D27\u6570\u636E",okText:"\u662F",cancelText:"\u5426",onConfirm:(0,s.Z)((0,a.Z)().mark(function O(){var k;return(0,a.Z)().wrap(function(h){for(;;)switch(h.prev=h.next){case 0:return h.next=2,It(t.device.id);case 2:k=h.sent,k.data?(Z.default.success("\u83B7\u53D6\u5B9E\u65F6\u5E93\u5B58\u4F1A\u6210\u529F\uFF01"),u.current.reload()):Z.default.error(k.errors||"\u83B7\u53D6\u5B9E\u65F6\u5E93\u5B58\u4F1A\u5931\u8D25\uFF01");case 4:case"end":return h.stop()}},O)})),children:(0,n.jsx)(G.Z,{type:"primary",children:"\u83B7\u53D6\u5B9E\u65F6\u5E93\u5B58"},"primary")},"primary-async-time"),(0,n.jsx)(se.Z,{type:"primary",title:"\u786E\u8BA4\u540C\u6B65\u5417\uFF1F",okText:"\u662F",cancelText:"\u5426",onConfirm:(0,s.Z)((0,a.Z)().mark(function O(){var k;return(0,a.Z)().wrap(function(h){for(;;)switch(h.prev=h.next){case 0:return h.next=2,jt(t.device.id);case 2:k=h.sent,k.data?(Z.default.success("\u540C\u6B65\u6210\u529F\uFF01"),u.current.reload()):Z.default.error(k.errors||"\u540C\u6B65\u5931\u8D25\uFF01");case 4:case"end":return h.stop()}},O)})),children:(0,n.jsx)(G.Z,{type:"primary",children:"\u540C\u6B65\u5E93\u5B58"},"primary")},"primary-async"),(0,n.jsxs)(G.Z,{type:"primary",onClick:function(){Q(void 0),$(!0)},children:[(0,n.jsx)(ee.Z,{})," \u65B0\u589E\u5E93\u5B58\u539F\u6599"]},"primary")]},request:function(){var x=(0,s.Z)((0,a.Z)().mark(function O(k){var p;return(0,a.Z)().wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return c.next=2,St(k);case 2:if(p=c.sent,p.statusCode!==200){c.next=5;break}return c.abrupt("return",{data:p.data.data,success:!0,total:p.data.total});case 5:return c.abrupt("return",[]);case 6:case"end":return c.stop()}},O)}));return function(O){return x.apply(this,arguments)}}(),columns:J}),P&&(0,n.jsx)(Gt,{device:t.device,stockMaterial:q,open:P,onOk:function(){$(!1),u.current.reload()},onCancel:function(){return $(!1)}})]})},Mt=Rt,ua=i(96486),sa="message",Wt=function(){var t=(0,v.useState)(),u=(0,S.Z)(t,2),e=u[0],M=u[1],P=(0,v.useState)([]),$=(0,S.Z)(P,2),z=$[0],V=$[1],q=(0,v.useState)([]),Q=(0,S.Z)(q,2),J=Q[0],L=Q[1],X=(0,v.useState)([]),x=(0,S.Z)(X,2),O=x[0],k=x[1],p=(0,v.useState)([]),h=(0,S.Z)(p,2),c=h[0],w=h[1],j=(0,v.useState)([]),b=(0,S.Z)(j,2),E=b[0],I=b[1],A=(0,v.useState)([]),y=(0,S.Z)(A,2),N=y[0],W=y[1],H=(0,v.useState)([]),Ve=(0,S.Z)(H,2),K=Ve[0],Le=Ve[1],Vt=(0,v.useState)(),Qe=(0,S.Z)(Vt,2),Xe=Qe[0],_e=Qe[1],Lt=(0,v.useState)(!1),qe=(0,S.Z)(Lt,2),et=qe[0],tt=qe[1],Nt=(0,v.useState)(!1),at=(0,S.Z)(Nt,2),Kt=at[0],oe=at[1],de=(0,v.useRef)(),Ut=(0,v.useState)(),rt=(0,S.Z)(Ut,2),Ne=rt[0],nt=rt[1],zt=(0,v.useState)([]),ut=(0,S.Z)(zt,2),pe=ut[0],st=ut[1];(0,v.useEffect)(function(){function B(){(0,Et.FM)().then(function(o){g(o.data);function g(m){for(var C in m)m[C].type==2||m[C].type==3?m[C].disabled=!1:m[C].disabled=!0,m[C].children&&g(m[C].children)}L(o.data);var l={};f(o.data);function f(m){for(var C in m)l[m[C].disabled]=!0,l[m[C].value]={text:m[C].title},m[C].children&&f(m[C].children)}k(l)})}B(),it();function D(){dt().then(function(o){var g=o.data,l={};if(o.succeeded){var f=[];g.forEach(function(m){l[m.name]={text:m.name},f.push({id:m.id,label:m.name,text:m.name})}),w(l),I(f)}})}D(),Jt()},[]);var it=function(){vt().then(function(D){var o={},g=[];D.data.forEach(function(l){g.push({label:l.name,text:l.name,value:l.id}),o[l.id]={text:l.name}}),V(g),M(o)})},Jt=function(){var B=(0,s.Z)((0,a.Z)().mark(function D(){var o;return(0,a.Z)().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.next=2,Zt();case 2:o=l.sent,o.statusCode==200?Le(o.data):Z.default.error("\u83B7\u53D6\u8BBE\u5907\u7248\u672C\u5931\u8D25");case 4:case"end":return l.stop()}},D)}));return function(){return B.apply(this,arguments)}}(),Ht=[{title:"\u4E3B\u952E",dataIndex:"id",hideInSearch:!0,hideInTable:!0,tip:"\u89C4\u5219\u540D\u79F0\u662F\u552F\u4E00\u7684 key"},{title:"\u8BBE\u5907\u540D\u79F0",dataIndex:"deviceName",valueType:"textarea"},{title:"\u6240\u5C5E\u4EA7\u54C1",dataIndex:"productName",valueEnum:c,hideInSearch:!0},{title:"\u4EA7\u54C1\u7248\u672C",dataIndex:"productVersionName",search:!1},{title:"\u652F\u6301\u529F\u80FD",dataIndex:"technologyOrBom",search:!1,valueEnum:{0:{text:"\u5DE5\u827A"},1:{text:"\u914D\u65B9"}}},{title:"\u8BBE\u5907\u6807\u7B7E",dataIndex:"deviceTypeId",valueEnum:e},{title:"\u72B6\u6001",dataIndex:"status",valueEnum:{0:{text:"\u542F\u7528",status:"Processing"},1:{text:"\u7981\u7528",status:"Success"}},hideInSearch:!0},{title:"\u8BBE\u5907\u552F\u4E00key",dataIndex:"autoKey",search:!1},{title:"\u64CD\u4F5C",dataIndex:"option",valueType:"option",fixed:"right",width:400,render:function(D,o){return[(0,n.jsx)("a",{onClick:function(){oe(!0),nt(o)},children:"\u66F4\u65B0"},"update"),(0,n.jsx)("a",{onClick:(0,s.Z)((0,a.Z)().mark(function g(){return(0,a.Z)().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:return de.current.reload(),o.status=o.status?0:1,f.next=4,ze(o).then(function(m){m.succeeded?Z.default.success("\u914D\u7F6E\u6210\u529F"):Z.default.error("\u914D\u7F6E\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01")});case 4:case"end":return f.stop()}},g)})),children:o.status==0?"\u505C\u7528":"\u6B63\u5E38"},"status"),(0,n.jsx)("a",{onClick:(0,s.Z)((0,a.Z)().mark(function g(){var l,f;return(0,a.Z)().wrap(function(C){for(;;)switch(C.prev=C.next){case 0:return C.next=2,Bt(o.id);case 2:if(l=C.sent,l!=""){C.next=6;break}return Z.default.error("\u5F53\u524D\u6A21\u677F\u4E0D\u5B58\u5728\uFF01"),C.abrupt("return");case 6:f=document.createElement("a"),f.href=l,f.click();case 9:case"end":return C.stop()}},g)})),children:"\u5BFC\u51FA\u5DE5\u827A\u6A21\u7248"},"add")]}}],Qt=function(){var B=(0,s.Z)((0,a.Z)().mark(function D(o){return(0,a.Z)().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.next=2,pt(JSON.stringify(o)).then(function(f){if(f.succeeded)Z.default.success("\u6DFB\u52A0\u6210\u529F"),oe(!1),de.current.reload();else return Z.default.error(f.errors),!1});case 2:case"end":return l.stop()}},D)}));return function(o){return B.apply(this,arguments)}}(),Xt=function(){var B=(0,s.Z)((0,a.Z)().mark(function D(o){return(0,a.Z)().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.next=2,ze(JSON.stringify(o)).then(function(f){if(f.succeeded)Z.default.success("\u6DFB\u52A0\u6210\u529F"),oe(!1),de.current.reload();else return Z.default.error(f.errors),!1});case 2:case"end":return l.stop()}},D)}));return function(o){return B.apply(this,arguments)}}(),_t=function(){var B=(0,s.Z)((0,a.Z)().mark(function D(o){var g;return(0,a.Z)().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:return f.prev=0,Z.default.loading("\u6B63\u5728\u5220\u9664"),g=[],o.forEach(function(m){g.push(m.id)}),f.next=6,ht(g).then(function(m){return m.data?(Z.default.success("\u5220\u9664\u6210\u529F"),!0):(Z.default.success("\u5220\u9664\u5931\u8D25"),!1)});case 6:f.next=12;break;case 8:return f.prev=8,f.t0=f.catch(0),Z.default.error("\u5220\u9664\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01"),f.abrupt("return",!1);case 12:case"end":return f.stop()}},D,null,[[0,8]])}));return function(o){return B.apply(this,arguments)}}();return(0,n.jsxs)(ie.ZP,{host:!0,header:{title:"",breadcrumb:{}},children:[(0,n.jsx)(te.ZP,{headerTitle:"\u8BBE\u5907\u4FE1\u606F",actionRef:de,rowKey:"id",pagination:{defaultPageSize:10},search:{labelWidth:120},scroll:{x:2e3},toolBarRender:function(){return[(0,n.jsxs)(G.Z,{type:"primary",onClick:function(){oe(!0)},children:[(0,n.jsx)(ee.Z,{})," \u65B0\u5EFA"]},"primary"),(0,n.jsx)(G.Z,{onClick:(0,s.Z)((0,a.Z)().mark(function D(){var o,g;return(0,a.Z)().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:return f.next=2,_t(pe);case 2:st([]),(o=de.current)===null||o===void 0||(g=o.reloadAndRest)===null||g===void 0||g.call(o);case 4:case"end":return f.stop()}},D)})),children:"\u5220\u9664"})]},request:function(){var B=(0,s.Z)((0,a.Z)().mark(function D(o){var g,l;return(0,a.Z)().wrap(function(m){for(;;)switch(m.prev=m.next){case 0:return g=[],l=0,m.next=4,ot(o).then(function(C){g=C.data.data,l=C.data.total});case 4:return m.abrupt("return",{data:g,success:!0,total:l});case 5:case"end":return m.stop()}},D)}));return function(D){return B.apply(this,arguments)}}(),columns:Ht,rowSelection:{onChange:function(D,o){st(o)}}}),(pe==null?void 0:pe.length)>0&&(0,n.jsx)(me.Z,{extra:(0,n.jsxs)("div",{children:["\u5DF2\u9009\u62E9"," ",(0,n.jsx)("a",{style:{fontWeight:600},children:pe.length})," ","\u9879 \xA0\xA0"]})}),(0,n.jsx)(At,{storeType:z,OrgData:J,dicData:E,initDeviceType:it,onFinish:function(){var B=(0,s.Z)((0,a.Z)().mark(function D(o){return(0,a.Z)().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:o.id?Xt(o):Qt(o);case 1:case"end":return l.stop()}},D)}));return function(D){return B.apply(this,arguments)}}(),onCancel:function(){oe(!1),nt(void 0)},createModalVisible:Kt,deviceVersions:K,values:Ne||{}}),Xe&&(0,n.jsx)(Ot,{open:Xe,device:Ne,onOk:function(){return _e(!1)},onCancel:function(){return _e(!1)}}),et&&(0,n.jsx)(Mt,{open:et,device:Ne,onOk:function(){return tt(!1)},onCancel:function(){return tt(!1)}})]})},Yt=Wt},20173:function(ct,fe,i){"use strict";i.d(fe,{lM:function(){return Z},IH:function(){return S},mm:function(){return me},eP:function(){return Ke},FM:function(){return Ue}});var U=i(39428),G=i(11849),a=i(3182),ne=i(48971);function Z(T,R){return s.apply(this,arguments)}function s(){return s=(0,a.Z)((0,U.Z)().mark(function T(R,re){return(0,U.Z)().wrap(function(ce){for(;;)switch(ce.prev=ce.next){case 0:return ce.abrupt("return",(0,ne.WY)("/saasbase/api/organize/page",{method:"POST",data:(0,G.Z)({},R)}));case 1:case"end":return ce.stop()}},T)})),s.apply(this,arguments)}function S(T){return ee.apply(this,arguments)}function ee(){return ee=(0,a.Z)((0,U.Z)().mark(function T(R){return(0,U.Z)().wrap(function(d){for(;;)switch(d.prev=d.next){case 0:return d.abrupt("return",(0,ne.WY)("/saasbase/api/organize/addorg",{method:"POST",data:(0,G.Z)({},R)}));case 1:case"end":return d.stop()}},T)})),ee.apply(this,arguments)}function v(T){return ie.apply(this,arguments)}function ie(){return ie=_asyncToGenerator(_regeneratorRuntime().mark(function T(R){return _regeneratorRuntime().wrap(function(d){for(;;)switch(d.prev=d.next){case 0:return d.abrupt("return",request("\u200B/kitchen/api\u200B/organize/getorglist",{method:"POST",data:_objectSpread({},R)}));case 1:case"end":return d.stop()}},T)})),ie.apply(this,arguments)}function me(T){return te.apply(this,arguments)}function te(){return te=(0,a.Z)((0,U.Z)().mark(function T(R){return(0,U.Z)().wrap(function(d){for(;;)switch(d.prev=d.next){case 0:return d.abrupt("return",(0,ne.WY)("\u200B/kitchen/api\u200B/organize/deleteorg",{method:"POST",data:(0,G.Z)({},R)}));case 1:case"end":return d.stop()}},T)})),te.apply(this,arguments)}function Ke(T){return _.apply(this,arguments)}function _(){return _=(0,a.Z)((0,U.Z)().mark(function T(R){return(0,U.Z)().wrap(function(d){for(;;)switch(d.prev=d.next){case 0:return d.abrupt("return",(0,ne.WY)("\u200B/saasbase/api\u200B/organize/updateorg",{method:"POST",data:(0,G.Z)({},R)}));case 1:case"end":return d.stop()}},T)})),_.apply(this,arguments)}function lt(T){return ae.apply(this,arguments)}function ae(){return ae=_asyncToGenerator(_regeneratorRuntime().mark(function T(R){return _regeneratorRuntime().wrap(function(d){for(;;)switch(d.prev=d.next){case 0:return d.abrupt("return",request("/saasbase/api\u200B/sysOrg\u200B/detail",{method:"POST",data:_objectSpread({},R)}));case 1:case"end":return d.stop()}},T)})),ae.apply(this,arguments)}function Ue(T){return ue.apply(this,arguments)}function ue(){return ue=(0,a.Z)((0,U.Z)().mark(function T(R){return(0,U.Z)().wrap(function(d){for(;;)switch(d.prev=d.next){case 0:return d.abrupt("return",(0,ne.WY)("\u200B/saasbase/api\u200B/organize/tree",{method:"GET",data:(0,G.Z)({},R)}));case 1:case"end":return d.stop()}},T)})),ue.apply(this,arguments)}}}]);