|
- (self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[7657,1322],{17997:function(tt,he,s){"use strict";s.r(he),s.d(he,{default:function(){return Gt}});var N=s(57663),G=s(71577),Z=s(2824),r=s(39428),Ke=s(34792),f=s(48086),c=s(3182),ne=s(49101),m=s(67294),ie=s(78009),Ze=s(85224),ee=s(16894),Ue=s(71194),Q=s(50146),rt=s(77883),ae=s(85986),Ne=s(62999),se=s(54680),j=s(9715),p=s(55843),te=s(47673),d=s(4107),ce=s(43358),P=s(34041),n=s(85893),nt=function(t){var u=P.Z.Option,e=P.Z.OptGroup;return(0,n.jsx)(Q.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)(p.Z,{layout:"Horizontal",labelCol:{span:4},preserve:!1,initialValues:t.values,onFinish:t.onFinish,children:[(0,n.jsx)(p.Z.Item,{name:"id",hidden:!0,children:(0,n.jsx)(d.Z,{})}),(0,n.jsx)(p.Z.Item,{label:"\u8BBE\u5907\u540D\u79F0",name:"deviceName",rules:[{required:!0,max:50}],children:(0,n.jsx)(d.Z,{})}),(0,n.jsx)(p.Z.Item,{label:"\u8BBE\u5907\u7C7B\u578B",name:"deviceTypeKey",rules:[{required:!0}],children:(0,n.jsx)(P.Z,{children:t.dicData.map(function(i,l){return(0,n.jsx)(P.Z.Option,{index:l,value:i.code,children:i.value},i.code)})})}),(0,n.jsx)(p.Z.Item,{name:"orgId",label:"\u5F52\u5C5E\u95E8\u5E97",rules:[{required:!0}],children:(0,n.jsx)(se.Z,{style:{width:"100%"},dropdownStyle:{maxHeight:400,overflow:"auto"},treeData:t.OrgData,placeholder:"\u5F52\u5C5E\u95E8\u5E97",treeDefaultExpandAll:!0})}),(0,n.jsx)(p.Z.Item,{label:"\u8BBE\u5907\u5206\u7C7B",name:"deviceTypeId",rules:[{required:!0}],children:(0,n.jsx)(P.Z,{children:t.storeType.map(function(i,l){return(0,n.jsx)(P.Z.Option,{index:l,value:i.id,children:i.text},i.id)})})}),(0,n.jsx)(p.Z.Item,{noStyle:!0,shouldUpdate:function(l,k){return l.deviceTypeKey!==k.deviceTypeKey},children:function(l){var k,H=l.getFieldValue;return H("deviceTypeKey")==="TMC"?(0,n.jsx)(p.Z.Item,{name:"deviceVersion",label:"\u8BBE\u5907\u7248\u672C",initialValue:"WorryFreeEdition",children:(0,n.jsx)(P.Z,{children:(k=t.deviceVersions)===null||k===void 0?void 0:k.map(function(M,X){return(0,n.jsx)(P.Z.Option,{index:X,value:M.code,children:M.name},M.code)})})}):null}}),(0,n.jsx)(p.Z.Item,{label:"\u8BBE\u5907\u5750\u6807",name:"deviceLoc",children:(0,n.jsx)(d.Z,{placeholder:"104.070734,30.575041"})}),(0,n.jsx)(p.Z.Item,{label:"\u72B6\u6001",name:"status",rules:[{required:!0}],children:(0,n.jsx)(P.Z,{placeholder:"\u8BF7\u9009\u62E9\u72B6\u6001",children:(0,n.jsxs)(e,{children:[(0,n.jsx)(P.Z.Option,{value:0,children:"\u6B63\u5E38"}),(0,n.jsx)(P.Z.Option,{value:1,children:"\u505C\u7528"})]})})}),(0,n.jsx)(p.Z.Item,{label:"\u8BBE\u5907\u901A\u9053\u6570\u91CF",name:"materialQuantity",children:(0,n.jsx)(ae.Z,{})}),(0,n.jsx)(p.Z.Item,{label:"\u8BBE\u5907\u8BE6\u7EC6\u5730\u5740",name:"deviceAddr",children:(0,n.jsx)(d.Z,{placeholder:"\u6210\u90FD\u5E02\u6B66\u4FAF\u533A\u6842\u6EAA\u8857\u9053\u73AF\u7403\u4E2D\u5FC3N5-9111C"})}),(0,n.jsx)(p.Z.Item,{children:(0,n.jsx)(G.Z,{type:"primary",htmlType:"submit",children:"\u4FDD\u5B58"})})]})})},at=nt,le=s(11849),b=s(48971);function ut(a){return ge.apply(this,arguments)}function ge(){return ge=(0,c.Z)((0,r.Z)().mark(function a(t){return(0,r.Z)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,b.WY)("/kitchen/api/Device/GetDeviceInfoPage",{method:"POST",data:t}));case 1:case"end":return e.stop()}},a)})),ge.apply(this,arguments)}function it(a){return Se.apply(this,arguments)}function Se(){return Se=(0,c.Z)((0,r.Z)().mark(function a(t){return(0,r.Z)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,b.WY)("/kitchen/api/dict-data/dic-list/".concat(t),{method:"Get"}));case 1:case"end":return e.stop()}},a)})),Se.apply(this,arguments)}function st(a){return De.apply(this,arguments)}function De(){return De=(0,c.Z)((0,r.Z)().mark(function a(t){return(0,r.Z)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,b.WY)("/kitchen/api/Device/AddDeviceInfo",{method:"POST",data:t}));case 1:case"end":return e.stop()}},a)})),De.apply(this,arguments)}function ct(a){return ke.apply(this,arguments)}function ke(){return ke=(0,c.Z)((0,r.Z)().mark(function a(t){return(0,r.Z)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,b.WY)("/kitchen/api/Device/PushDeviceGoods?DeviceId="+t,{method:"Get"}));case 1:case"end":return e.stop()}},a)})),ke.apply(this,arguments)}function ze(a){return we.apply(this,arguments)}function we(){return we=(0,c.Z)((0,r.Z)().mark(function a(t){return(0,r.Z)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,b.WY)("/kitchen/api/Device/UpdateDeviceInfo",{method:"POST",data:t}));case 1:case"end":return e.stop()}},a)})),we.apply(this,arguments)}function lt(a){return Ce.apply(this,arguments)}function Ce(){return Ce=(0,c.Z)((0,r.Z)().mark(function a(t){return(0,r.Z)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,b.WY)("/kitchen/api/Device/CopyDevice",{method:"POST",data:t}));case 1:case"end":return e.stop()}},a)})),Ce.apply(this,arguments)}function ot(a){return Fe.apply(this,arguments)}function Fe(){return Fe=(0,c.Z)((0,r.Z)().mark(function a(t){return(0,r.Z)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,b.WY)("\u200B\u200B/kitchen/api/Device/DelDeviceInfo",{method:"POST",data:t}));case 1:case"end":return e.stop()}},a)})),Fe.apply(this,arguments)}function dt(a){return je.apply(this,arguments)}function je(){return je=(0,c.Z)((0,r.Z)().mark(function a(t){return(0,r.Z)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,b.WY)("\u200B/kitchen/api/Device/GetDeviceType",{method:"GET"}));case 1:case"end":return e.stop()}},a)})),je.apply(this,arguments)}function ft(){return Ie.apply(this,arguments)}function Ie(){return Ie=(0,c.Z)((0,r.Z)().mark(function a(){return(0,r.Z)().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return u.abrupt("return",(0,b.WY)("\u200B/kitchen/api/Device/GetDeviceVersions",{method:"post"}));case 1:case"end":return u.stop()}},a)})),Ie.apply(this,arguments)}function Kt(a,t){return be.apply(this,arguments)}function be(){return be=_asyncToGenerator(_regeneratorRuntime().mark(function a(t,u){return _regeneratorRuntime().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return i.abrupt("return",request("/kitchen/api/Device/GetDeviceGoods",{method:"POST",data:_objectSpread({},t)}));case 1:case"end":return i.stop()}},a)})),be.apply(this,arguments)}function pt(a){return Ee.apply(this,arguments)}function Ee(){return Ee=(0,c.Z)((0,r.Z)().mark(function a(t){return(0,r.Z)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,b.WY)("/kitchen/api/Device/AddDeviceGood",{method:"POST",data:(0,le.Z)({},t)}));case 1:case"end":return e.stop()}},a)})),Ee.apply(this,arguments)}function Ut(a){return Be.apply(this,arguments)}function Be(){return Be=_asyncToGenerator(_regeneratorRuntime().mark(function a(t){return _regeneratorRuntime().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",request("/kitchen/\u200Bapi/Device/GetGoods",{method:"POST",data:_objectSpread({},t)}));case 1:case"end":return e.stop()}},a)})),Be.apply(this,arguments)}function ht(a){return Oe.apply(this,arguments)}function Oe(){return Oe=(0,c.Z)((0,r.Z)().mark(function a(t){return(0,r.Z)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,b.WY)("/kitchen/\u200Bapi/Device/GetByDeviceGoods",{method:"POST",data:(0,le.Z)({},t)}));case 1:case"end":return e.stop()}},a)})),Oe.apply(this,arguments)}function vt(a){return Te.apply(this,arguments)}function Te(){return Te=(0,c.Z)((0,r.Z)().mark(function a(t){return(0,r.Z)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,b.WY)("/kitchen/api/Device/GetDeviceStorePage",{method:"POST",data:t}));case 1:case"end":return e.stop()}},a)})),Te.apply(this,arguments)}function mt(a){return xe.apply(this,arguments)}function xe(){return xe=(0,c.Z)((0,r.Z)().mark(function a(t){return(0,r.Z)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,b.WY)("/kitchen/api/Device/DelStockAdjust?Id=".concat(t),{method:"DELETE"}));case 1:case"end":return e.stop()}},a)})),xe.apply(this,arguments)}function yt(a){return Ae.apply(this,arguments)}function Ae(){return Ae=(0,c.Z)((0,r.Z)().mark(function a(t){return(0,r.Z)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,b.WY)("/kitchen/api/Device/AddUpdateDeviceStocAsync",{method:"POST",data:t}));case 1:case"end":return e.stop()}},a)})),Ae.apply(this,arguments)}function Zt(a){return $e.apply(this,arguments)}function $e(){return $e=(0,c.Z)((0,r.Z)().mark(function a(t){return(0,r.Z)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,b.WY)("/kitchen/api/Device/AddUpdateDeviceStocAsync",{method:"put",data:t}));case 1:case"end":return e.stop()}},a)})),$e.apply(this,arguments)}function gt(a){return Ge.apply(this,arguments)}function Ge(){return Ge=(0,c.Z)((0,r.Z)().mark(function a(t){return(0,r.Z)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,b.WY)("/kitchen/api/deviceconfig/getlocs?Code=".concat(t),{method:"GET"}));case 1:case"end":return e.stop()}},a)})),Ge.apply(this,arguments)}function St(a){return Pe.apply(this,arguments)}function Pe(){return Pe=(0,c.Z)((0,r.Z)().mark(function a(t){return(0,r.Z)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,b.WY)("/kitchen/api/Device/GetProductList",{method:"post",data:t}));case 1:case"end":return e.stop()}},a)})),Pe.apply(this,arguments)}function Dt(a){return Me.apply(this,arguments)}function Me(){return Me=(0,c.Z)((0,r.Z)().mark(function a(t){return(0,r.Z)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,b.WY)("/kitchen/\u200Bapi/FoodMenu/tree",{data:(0,le.Z)({},t)}));case 1:case"end":return e.stop()}},a)})),Me.apply(this,arguments)}function kt(a){return Re.apply(this,arguments)}function Re(){return Re=(0,c.Z)((0,r.Z)().mark(function a(t){return(0,r.Z)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,b.WY)("/kitchen/api/Device/PushDevice?DeviceId=".concat(t),{method:"post"}));case 1:case"end":return e.stop()}},a)})),Re.apply(this,arguments)}function wt(a){return We.apply(this,arguments)}function We(){return We=(0,c.Z)((0,r.Z)().mark(function a(t){return(0,r.Z)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,b.WY)("/kitchen/api/Device/CheckStockAdjust?DeviceId=".concat(t),{method:"POST"}));case 1:case"end":return e.stop()}},a)})),We.apply(this,arguments)}var Ct=s(3408),Nt=s(49111),Ft=s(19650),ve=s(86582),zt=s(62350),ue=s(24565),jt=function(t){var u=(0,m.useRef)(),e=(0,m.useState)([]),i=(0,Z.Z)(e,2),l=i[0],k=i[1],H=(0,m.useState)(!0),M=(0,Z.Z)(H,2),X=M[0],_=M[1],q=(0,m.useState)([]),J=(0,Z.Z)(q,2),re=J[0],T=J[1],x=(0,m.useState)(""),w=(0,Z.Z)(x,2),o=w[0],h=w[1],y=[{title:"\u83DC\u8C31\u5217\u8868",dataIndex:"foodMenuId",valueType:"treeSelect",hideInTable:!0,fieldProps:{options:re,value:o,onChange:function(B){h(B)}}},{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"}],K=function(){var E=(0,c.Z)((0,r.Z)().mark(function B(){var C,I,v;return(0,r.Z)().wrap(function($){for(;;)switch($.prev=$.next){case 0:if((C=t.device)!==null&&C!==void 0&&C.id){$.next=2;break}return $.abrupt("return");case 2:return I=[],l.forEach(function(z){I.push({foodId:z})}),$.next=6,pt({foodss:I,deviceId:t.device.id});case 6:v=$.sent,v.data?(f.default.success("\u8BBE\u5907\u5546\u54C1\u66F4\u65B0\u6210\u529F\uFF01"),t.onOk()):f.default.error(JSON.stringify(v.errors)||"\u4E0A\u67B6\u5931\u8D25");case 8:case"end":return $.stop()}},B)}));return function(){return E.apply(this,arguments)}}(),A=function(){var E=(0,c.Z)((0,r.Z)().mark(function B(){var C;return(0,r.Z)().wrap(function(v){for(;;)switch(v.prev=v.next){case 0:return v.next=2,Dt();case 2:C=v.sent,C.statusCode===200&&C.data.length>0&&(h(C.data[0].value),T(C.data));case 4:case"end":return v.stop()}},B)}));return function(){return E.apply(this,arguments)}}();return(0,m.useEffect)(function(){A()},[]),(0,m.useEffect)(function(){u.current&&u.current.reload()},[o]),(0,n.jsx)(Q.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:K,maskClosable:!1,children:(0,n.jsx)(ee.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,c.Z)((0,r.Z)().mark(function B(){var C;return(0,r.Z)().wrap(function(v){for(;;)switch(v.prev=v.next){case 0:return console.log(t.device.id),v.next=3,ct(t.device.id);case 3:C=v.sent,C.data?(f.default.success("\u540C\u6B65\u6210\u529F\uFF01"),u.current.reload()):f.default.error(C.errors||"\u540C\u6B65\u5931\u8D25\uFF01");case 5:case"end":return v.stop()}},B)})),children:(0,n.jsx)(G.Z,{type:"primary",children:"\u540C\u6B65\u5546\u54C1\u5230\u8BBE\u5907"},"primary")},"primary-async")]},request:function(){var E=(0,c.Z)((0,r.Z)().mark(function B(C){var I,v,L,$,z;return(0,r.Z)().wrap(function(V){for(;;)switch(V.prev=V.next){case 0:if(o){V.next=2;break}return V.abrupt("return",[]);case 2:return V.next=4,ht((0,le.Z)((0,le.Z)({},C),{},{foolMenuId:o,storeId:t.device.orgId,foodName:C.goodsName||""}));case 4:if(I=V.sent,I.statusCode!==200){V.next=10;break}return I.data.total>0?($=new Set([].concat((0,ve.Z)(l),(0,ve.Z)(I.data.data.checkedIds))),z=[],$.forEach(function(oe){z.push(oe)}),k(z)):k([]),V.abrupt("return",{data:((v=I.data)===null||v===void 0||(L=v.data)===null||L===void 0?void 0:L.data)||[],success:!0,total:I.data.total});case 10:return V.abrupt("return",[]);case 11:case"end":return V.stop()}},B)}));return function(B){return E.apply(this,arguments)}}(),columns:y,rowSelection:{type:"checkbox",selectedRowKeys:l,onSelect:function(B,C){var I=(0,ve.Z)(l),v=I.findIndex(function(L){return L===B.goodsId});C?v<0&&I.push(B.goodsId):v>-1&&I.splice(v,1),k(I)},onSelectAll:function(B,C,I){var v=(0,ve.Z)(l);B?C.forEach(function(L){if(!!L){var $=v.findIndex(function(z){return z===L.goodsId});$<0&&v.push(L.goodsId)}}):I.forEach(function(L){var $=v.findIndex(function(z){return z===L.goodsId});$>-1&&v.splice($,1)}),k(v)}},tableAlertOptionRender:function(){return(0,n.jsx)(Ft.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 k([])},okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",children:(0,n.jsx)("a",{children:"\u53D6\u6D88\u9009\u62E9"})})})}})})},It=jt,He="message",bt=function(t){var u,e=p.Z.useForm(),i=(0,Z.Z)(e,1),l=i[0],k=(0,m.useState)([]),H=(0,Z.Z)(k,2),M=H[0],X=H[1],_=(0,m.useState)([]),q=(0,Z.Z)(_,2),J=q[0],re=q[1],T=function(){var o=(0,c.Z)((0,r.Z)().mark(function h(){var y;return(0,r.Z)().wrap(function(A){for(;;)switch(A.prev=A.next){case 0:return A.next=2,l.validateFields();case 2:if(y=A.sent,y.DeviceId=t.device.id,!y.id){A.next=9;break}return A.next=7,Zt(y).then(function(E){f.default.destroy(He),E.data?(f.default.success("\u4FEE\u6539\u6210\u529F"),t.onOk()):f.default.error("\u4FEE\u6539\u5931\u8D25"+E.errors)});case 7:A.next=11;break;case 9:return A.next=11,yt(y).then(function(E){f.default.destroy(He),E.data?(f.default.success("\u6DFB\u52A0\u6210\u529F"),t.onOk()):f.default.error("\u6DFB\u52A0\u5931\u8D25"+E.errors)});case 11:case"end":return A.stop()}},h)}));return function(){return o.apply(this,arguments)}}(),x=function(){var o=(0,c.Z)((0,r.Z)().mark(function h(){return(0,r.Z)().wrap(function(K){for(;;)switch(K.prev=K.next){case 0:gt(t.device.deviceTypeKey).then(function(A){X(A.data)});case 1:case"end":return K.stop()}},h)}));return function(){return o.apply(this,arguments)}}(),w=function(){var o=(0,c.Z)((0,r.Z)().mark(function h(){return(0,r.Z)().wrap(function(K){for(;;)switch(K.prev=K.next){case 0:St({DeviceId:t.device.id}).then(function(A){re(A.data)});case 1:case"end":return K.stop()}},h)}));return function(){return o.apply(this,arguments)}}();return(0,m.useEffect)(function(){var o;(o=t.stockMaterial)!==null&&o!==void 0&&o.id&&l.setFieldsValue(t.stockMaterial),x(),w()},[]),(0,n.jsx)(Q.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:T,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:T,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",children:(0,n.jsx)(G.Z,{type:"primary",children:"\u786E\u5B9A"},"submit")})],children:(0,n.jsxs)(p.Z,{layout:"vertical",preserve:!1,form:l,children:[(0,n.jsx)(p.Z.Item,{name:"id",hidden:!0,children:(0,n.jsx)(d.Z,{})}),(0,n.jsx)(p.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)(P.Z,{placeholder:"\u8BF7\u9009\u62E9\u539F\u6599\u540D\u79F0",showSearch:!0,optionFilterProp:"children",filterOption:function(h,y){return y.children.toLowerCase().indexOf(h.toLowerCase())>=0},children:J==null?void 0:J.map(function(o,h){return(0,n.jsx)(P.Z.Option,{index:h,value:o.id,children:o.name},o.id)})})}),(0,n.jsx)(p.Z.Item,{name:"batching_Loc",label:"\u5E93\u5B58\u4F4D\u7F6E",rules:[{required:!0}],defaultValue:"0",children:(0,n.jsx)(P.Z,{placeholder:"\u8BF7\u9009\u62E9\u5E93\u5B58\u4F4D\u7F6E",children:M==null?void 0:M.map(function(o,h){return(0,n.jsx)(P.Z.Option,{index:h,value:o.loc,children:o.loc},o.loc)})})}),(0,n.jsx)(p.Z.Item,{name:"batching_Count",label:"\u539F\u6599\u6570\u91CF",rules:[{required:!0}],defaultValue:"0",children:(0,n.jsx)(ae.Z,{style:{width:"100%"},min:0,placeholder:"\u8BF7\u8F93\u5165\u539F\u6599\u6570\u91CF"})})]})})},Et=bt,Bt=function(t){var u=(0,m.useRef)(),e=(0,m.useState)(!1),i=(0,Z.Z)(e,2),l=i[0],k=i[1],H=(0,m.useState)(),M=(0,Z.Z)(H,2),X=M[0],_=M[1],q=[{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(x,w){return[(0,n.jsx)("a",{onClick:function(){_(w),k(!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 re(w)},children:(0,n.jsx)("a",{href:"#",children:"\u5220\u9664"})},"primary")]}}],J=function(){t.onOk()},re=function(){var T=(0,c.Z)((0,r.Z)().mark(function x(w){var o;return(0,r.Z)().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:return y.next=2,mt(w.id);case 2:o=y.sent,o.data?(f.default.success("\u5220\u9664\u6210\u529F"),u.current.reload()):f.default.error("\u5220\u9664\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5");case 4:case"end":return y.stop()}},x)}));return function(w){return T.apply(this,arguments)}}();return(0,m.useEffect)(function(){},[]),(0,n.jsxs)(Q.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:J,maskClosable:!1,children:[(0,n.jsx)(ee.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,c.Z)((0,r.Z)().mark(function x(){var w;return(0,r.Z)().wrap(function(h){for(;;)switch(h.prev=h.next){case 0:return h.next=2,wt(t.device.id);case 2:w=h.sent,w.data?(f.default.success("\u83B7\u53D6\u5B9E\u65F6\u5E93\u5B58\u4F1A\u6210\u529F\uFF01"),u.current.reload()):f.default.error(w.errors||"\u83B7\u53D6\u5B9E\u65F6\u5E93\u5B58\u4F1A\u5931\u8D25\uFF01");case 4:case"end":return h.stop()}},x)})),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,c.Z)((0,r.Z)().mark(function x(){var w;return(0,r.Z)().wrap(function(h){for(;;)switch(h.prev=h.next){case 0:return h.next=2,kt(t.device.id);case 2:w=h.sent,w.data?(f.default.success("\u540C\u6B65\u6210\u529F\uFF01"),u.current.reload()):f.default.error(w.errors||"\u540C\u6B65\u5931\u8D25\uFF01");case 4:case"end":return h.stop()}},x)})),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(){_(void 0),k(!0)},children:[(0,n.jsx)(ne.Z,{})," \u65B0\u589E\u5E93\u5B58\u539F\u6599"]},"primary")]},request:function(){var T=(0,c.Z)((0,r.Z)().mark(function x(w){var o;return(0,r.Z)().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:return y.next=2,vt(w);case 2:if(o=y.sent,o.statusCode!==200){y.next=5;break}return y.abrupt("return",{data:o.data.data,success:!0,total:o.data.total});case 5:return y.abrupt("return",[]);case 6:case"end":return y.stop()}},x)}));return function(x){return T.apply(this,arguments)}}(),columns:q}),l&&(0,n.jsx)(Et,{device:t.device,stockMaterial:X,open:l,onOk:function(){k(!1),u.current.reload()},onCancel:function(){return k(!1)}})]})},Ot=Bt,me="message",Tt=function(){var a=(0,c.Z)((0,r.Z)().mark(function t(u){return(0,r.Z)().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return i.prev=0,f.default.loading("\u6B63\u5728\u6DFB\u52A0",me),i.next=4,st(JSON.stringify(u)).then(function(l){return f.default.destroy(me),l.data?(f.default.success("\u6DFB\u52A0\u6210\u529F"),!0):(f.default.error("\u6DFB\u52A0\u5931\u8D25"),!1)});case 4:i.next=10;break;case 6:return i.prev=6,i.t0=i.catch(0),f.default.error("\u6DFB\u52A0\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01"),i.abrupt("return",!1);case 10:case"end":return i.stop()}},t,null,[[0,6]])}));return function(u){return a.apply(this,arguments)}}(),xt=function(){var a=(0,c.Z)((0,r.Z)().mark(function t(u){return(0,r.Z)().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return i.prev=0,f.default.loading("\u6B63\u5728\u4FEE\u6539",me),i.next=4,ze(JSON.stringify(u)).then(function(l){return f.default.destroy(me),l.data?(f.default.success("\u4FEE\u6539\u6210\u529F"),!0):(f.default.success("\u4FEE\u6539\u5931\u8D25"),!1)});case 4:i.next=10;break;case 6:return i.prev=6,i.t0=i.catch(0),f.default.error("\u4FEE\u6539\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01"),i.abrupt("return",!1);case 10:case"end":return i.stop()}},t,null,[[0,6]])}));return function(u){return a.apply(this,arguments)}}(),At=function(){var a=(0,c.Z)((0,r.Z)().mark(function t(u){var e;return(0,r.Z)().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.prev=0,f.default.loading("\u6B63\u5728\u5220\u9664"),e=[],u.forEach(function(k){e.push(k.id)}),l.next=6,ot(e).then(function(k){return k.data?(f.default.success("\u5220\u9664\u6210\u529F"),!0):(f.default.success("\u5220\u9664\u5931\u8D25"),!1)});case 6:l.next=12;break;case 8:return l.prev=8,l.t0=l.catch(0),f.default.error("\u5220\u9664\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01"),l.abrupt("return",!1);case 12:case"end":return l.stop()}},t,null,[[0,8]])}));return function(u){return a.apply(this,arguments)}}(),$t=function(){var t=(0,m.useState)(),u=(0,Z.Z)(t,2),e=u[0],i=u[1],l=(0,m.useState)([]),k=(0,Z.Z)(l,2),H=k[0],M=k[1],X=(0,m.useState)([]),_=(0,Z.Z)(X,2),q=_[0],J=_[1],re=(0,m.useState)([]),T=(0,Z.Z)(re,2),x=T[0],w=T[1],o=(0,m.useState)([]),h=(0,Z.Z)(o,2),y=h[0],K=h[1],A=(0,m.useState)([]),E=(0,Z.Z)(A,2),B=E[0],C=E[1],I=(0,m.useState)([]),v=(0,Z.Z)(I,2),L=v[0],$=v[1],z=(0,m.useState)(),Le=(0,Z.Z)(z,2),V=Le[0],oe=Le[1],Pt=(0,m.useState)(!1),Je=(0,Z.Z)(Pt,2),Qe=Je[0],Ye=Je[1];(0,m.useEffect)(function(){var R=function(){dt().then(function(F){var O={},Y=[];F.data.forEach(function(S){Y.push({text:S.name,id:S.id}),O[S.id]={text:S.name}}),M(Y),i(O)})};function W(){(0,Ct.FM)().then(function(D){F(D.data);function F(S){for(var U in S)S[U].type==2||S[U].type==3?S[U].disabled=!1:S[U].disabled=!0,S[U].children&&F(S[U].children)}J(D.data);var O={};Y(D.data);function Y(S){for(var U in S)O[S[U].disabled]=!0,O[S[U].value]={text:S[U].title},S[U].children&&Y(S[U].children)}w(O)})}W(),R();function g(){it("DeviceClientType").then(function(D){var F=D.data,O={};if(D.succeeded){var Y=[];F.forEach(function(S){O[S.code]={text:S.code},Y.push({code:S.code,value:S.code})}),K(O),C(Y)}})}g(),Mt()},[]);var Mt=function(){var R=(0,c.Z)((0,r.Z)().mark(function W(){var g;return(0,r.Z)().wrap(function(F){for(;;)switch(F.prev=F.next){case 0:return F.next=2,ft();case 2:g=F.sent,g.statusCode==200?$(g.data):f.default.error("\u83B7\u53D6\u8BBE\u5907\u7248\u672C\u5931\u8D25");case 4:case"end":return F.stop()}},W)}));return function(){return R.apply(this,arguments)}}(),Rt=(0,m.useState)(!1),Xe=(0,Z.Z)(Rt,2),Wt=Xe[0],ye=Xe[1],de=(0,m.useRef)(),Lt=(0,m.useState)(),_e=(0,Z.Z)(Lt,2),Ve=_e[0],fe=_e[1],Yt=(0,m.useState)([]),qe=(0,Z.Z)(Yt,2),pe=qe[0],et=qe[1],Vt=[{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:"\u8BBE\u5907\u7C7B\u578B",dataIndex:"deviceTypeKey",valueEnum:y,hideInSearch:!0},{title:"\u5F52\u5C5E\u95E8\u5E97",dataIndex:"orgId",search:!1,valueEnum:x},{title:"\u8BBE\u5907\u5206\u7C7B",dataIndex:"deviceTypeId",valueEnum:e},{title:"\u72B6\u6001",dataIndex:"status",valueEnum:{0:{text:"\u6B63\u5E38",status:"Processing"},1:{text:"\u505C\u7528",status:"Success"}},hideInSearch:!0},{title:"\u8BBE\u5907\u901A\u9053\u6570\u91CF",dataIndex:"materialQuantity",valueType:"textarea",search:!1},{title:"\u8BBE\u5907\u552F\u4E00key",dataIndex:"autoKey",search:!1},{title:"\u5F52\u5C5E\u95E8\u5E97\u552F\u4E00key",dataIndex:"orgKey",search:!1},{title:"\u64CD\u4F5C",dataIndex:"option",valueType:"option",fixed:"right",width:400,render:function(W,g){return[(0,n.jsx)("a",{onClick:function(){ye(!0),fe(g)},children:"\u66F4\u65B0"},"update"),(0,n.jsx)("a",{onClick:function(){g.status=g.status==0?1:0,ze(g).then(function(F){F.data&&de.current.reload()})},children:g.status==0?"\u505C\u7528":"\u6B63\u5E38"},"status"),(0,n.jsx)("a",{onClick:function(){lt({id:g.id}).then(function(F){F.data&&de.current.reload()})},children:"\u590D\u5236"},"copy"),(0,n.jsx)("a",{onClick:function(){fe(g),oe(!0)},children:"\u7ED1\u5B9A\u5546\u54C1"},"upload-goods"),(0,n.jsx)("a",{onClick:function(){fe(g),Ye(!0)},children:"\u5E93\u5B58\u539F\u6599"},"add")]}}];return(0,n.jsxs)(ie.ZP,{children:[(0,n.jsx)(ee.ZP,{headerTitle:"\u8BBE\u5907\u4FE1\u606F",actionRef:de,rowKey:"id",search:{labelWidth:120},scroll:{x:2e3},toolBarRender:function(){return[(0,n.jsxs)(G.Z,{type:"primary",onClick:function(){ye(!0)},children:[(0,n.jsx)(ne.Z,{})," \u65B0\u5EFA"]},"primary"),(0,n.jsx)(G.Z,{onClick:(0,c.Z)((0,r.Z)().mark(function W(){var g,D;return(0,r.Z)().wrap(function(O){for(;;)switch(O.prev=O.next){case 0:return O.next=2,At(pe);case 2:et([]),(g=de.current)===null||g===void 0||(D=g.reloadAndRest)===null||D===void 0||D.call(g);case 4:case"end":return O.stop()}},W)})),children:"\u5220\u9664"})]},request:function(){var R=(0,c.Z)((0,r.Z)().mark(function W(g){var D,F;return(0,r.Z)().wrap(function(Y){for(;;)switch(Y.prev=Y.next){case 0:return D=[],F=0,Y.next=4,ut(g).then(function(S){D=S.data.data,F=S.data.total});case 4:return Y.abrupt("return",{data:D,success:!0,total:F});case 5:case"end":return Y.stop()}},W)}));return function(W){return R.apply(this,arguments)}}(),columns:Vt,rowSelection:{onChange:function(W,g){et(g)}}}),(pe==null?void 0:pe.length)>0&&(0,n.jsx)(Ze.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:H,OrgData:q,dicData:B,onFinish:function(){var R=(0,c.Z)((0,r.Z)().mark(function W(g){var D;return(0,r.Z)().wrap(function(O){for(;;)switch(O.prev=O.next){case 0:D=!1,g.id?D=xt(g):D=Tt(g),D&&(ye(!1),fe(void 0),de.current.reload());case 3:case"end":return O.stop()}},W)}));return function(W){return R.apply(this,arguments)}}(),onCancel:function(){ye(!1),fe(void 0)},createModalVisible:Wt,deviceVersions:L,values:Ve||{}}),V&&(0,n.jsx)(It,{open:V,device:Ve,onOk:function(){return oe(!1)},onCancel:function(){return oe(!1)}}),Qe&&(0,n.jsx)(Ot,{open:Qe,device:Ve,onOk:function(){return Ye(!1)},onCancel:function(){return Ye(!1)}})]})},Gt=$t},3408:function(tt,he,s){"use strict";s.d(he,{lM:function(){return Ke},IH:function(){return c},mm:function(){return Ze},eP:function(){return Ue},FM:function(){return Ne}});var N=s(39428),G=s(11849),Z=s(3182),r=s(48971);function Ke(j,p){return f.apply(this,arguments)}function f(){return f=(0,Z.Z)((0,N.Z)().mark(function j(p,te){return(0,N.Z)().wrap(function(ce){for(;;)switch(ce.prev=ce.next){case 0:return ce.abrupt("return",(0,r.WY)("/kitchen/api/sysOrg\u200B/page",{method:"GET",params:(0,G.Z)({},p)}));case 1:case"end":return ce.stop()}},j)})),f.apply(this,arguments)}function c(j){return ne.apply(this,arguments)}function ne(){return ne=(0,Z.Z)((0,N.Z)().mark(function j(p){return(0,N.Z)().wrap(function(d){for(;;)switch(d.prev=d.next){case 0:return d.abrupt("return",(0,r.WY)("/kitchen/api/sysOrg/add",{method:"POST",data:(0,G.Z)({},p)}));case 1:case"end":return d.stop()}},j)})),ne.apply(this,arguments)}function m(j){return ie.apply(this,arguments)}function ie(){return ie=_asyncToGenerator(_regeneratorRuntime().mark(function j(p){return _regeneratorRuntime().wrap(function(d){for(;;)switch(d.prev=d.next){case 0:return d.abrupt("return",request("\u200B/kitchen/api\u200B/sysOrg\u200B/list",{method:"POST",data:_objectSpread({},p)}));case 1:case"end":return d.stop()}},j)})),ie.apply(this,arguments)}function Ze(j){return ee.apply(this,arguments)}function ee(){return ee=(0,Z.Z)((0,N.Z)().mark(function j(p){return(0,N.Z)().wrap(function(d){for(;;)switch(d.prev=d.next){case 0:return d.abrupt("return",(0,r.WY)("\u200B/kitchen/api\u200B/sysOrg\u200B/delete",{method:"POST",data:(0,G.Z)({},p)}));case 1:case"end":return d.stop()}},j)})),ee.apply(this,arguments)}function Ue(j){return Q.apply(this,arguments)}function Q(){return Q=(0,Z.Z)((0,N.Z)().mark(function j(p){return(0,N.Z)().wrap(function(d){for(;;)switch(d.prev=d.next){case 0:return d.abrupt("return",(0,r.WY)("\u200B/kitchen/api\u200B/sysOrg\u200B/edit",{method:"POST",data:(0,G.Z)({},p)}));case 1:case"end":return d.stop()}},j)})),Q.apply(this,arguments)}function rt(j){return ae.apply(this,arguments)}function ae(){return ae=_asyncToGenerator(_regeneratorRuntime().mark(function j(p){return _regeneratorRuntime().wrap(function(d){for(;;)switch(d.prev=d.next){case 0:return d.abrupt("return",request("/kitchen\u200B/api\u200B/sysOrg\u200B/detail",{method:"POST",data:_objectSpread({},p)}));case 1:case"end":return d.stop()}},j)})),ae.apply(this,arguments)}function Ne(j){return se.apply(this,arguments)}function se(){return se=(0,Z.Z)((0,N.Z)().mark(function j(p){return(0,N.Z)().wrap(function(d){for(;;)switch(d.prev=d.next){case 0:return d.abrupt("return",(0,r.WY)("\u200B/kitchen/api\u200B/sysOrg\u200B/tree",{data:(0,G.Z)({},p)}));case 1:case"end":return d.stop()}},j)})),se.apply(this,arguments)}}}]);
|