包含后厨 团餐 门店分支
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
33 KiB

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