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
13 KiB

  1. (self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[8267],{28267:function(Be,R,i){"use strict";i.r(R),i.d(R,{default:function(){return fe}});var Fe=i(71194),V=i(50146),Ae=i(57663),B=i(71577),Ie=i(62350),x=i(24565),n=i(39428),Te=i(34792),s=i(48086),v=i(3182),D=i(2824),K=i(49101),C=i(67294),z=i(78009),H=i(16894),Ee=i(77883),X=i(85986),Pe=i(9715),b=i(55843),Me=i(47673),q=i(4107),Oe=i(43358),j=i(34041),Z=i(48971);function _(u){return A.apply(this,arguments)}function A(){return A=(0,v.Z)((0,n.Z)().mark(function u(t){return(0,n.Z)().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",(0,Z.WY)("/kitchen/api/Device/GetDeviceTMCStorePage",{method:"POST",data:t}));case 1:case"end":return r.stop()}},u)})),A.apply(this,arguments)}function ee(u){return I.apply(this,arguments)}function I(){return I=(0,v.Z)((0,n.Z)().mark(function u(t){return(0,n.Z)().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",(0,Z.WY)("/kitchen/api/Device/PushDeviceTMC?DeviceId=".concat(t),{method:"post"}));case 1:case"end":return r.stop()}},u)})),I.apply(this,arguments)}function te(u){return T.apply(this,arguments)}function T(){return T=(0,v.Z)((0,n.Z)().mark(function u(t){return(0,n.Z)().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",(0,Z.WY)("/kitchen/api/Device/PushDevice?DeviceId=".concat(t),{method:"post"}));case 1:case"end":return r.stop()}},u)})),T.apply(this,arguments)}function re(u){return E.apply(this,arguments)}function E(){return E=(0,v.Z)((0,n.Z)().mark(function u(t){return(0,n.Z)().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",(0,Z.WY)("/kitchen/api/Device/CheckStockTMCAdjust?DeviceId=".concat(t),{method:"POST"}));case 1:case"end":return r.stop()}},u)})),E.apply(this,arguments)}function ae(u){return P.apply(this,arguments)}function P(){return P=(0,v.Z)((0,n.Z)().mark(function u(t){return(0,n.Z)().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",(0,Z.WY)("/kitchen/api/Device/CheckStockTMCAdjust?DeviceId=".concat(t),{method:"POST"}));case 1:case"end":return r.stop()}},u)})),P.apply(this,arguments)}function ne(u){return M.apply(this,arguments)}function M(){return M=(0,v.Z)((0,n.Z)().mark(function u(t){return(0,n.Z)().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",(0,Z.WY)("/kitchen/api/Device/AddUpdateTMCDeviceStocAsync",{method:"POST",data:t}));case 1:case"end":return r.stop()}},u)})),M.apply(this,arguments)}function ue(u){return O.apply(this,arguments)}function O(){return O=(0,v.Z)((0,n.Z)().mark(function u(t){return(0,n.Z)().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",(0,Z.WY)("/kitchen/api/Device/GetProductListByBom",{method:"post",data:t}));case 1:case"end":return r.stop()}},u)})),O.apply(this,arguments)}function se(u){return G.apply(this,arguments)}function G(){return G=(0,v.Z)((0,n.Z)().mark(function u(t){return(0,n.Z)().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",(0,Z.WY)("/kitchen/api/Device/GetProductList",{method:"post",data:t}));case 1:case"end":return r.stop()}},u)})),G.apply(this,arguments)}function ie(u){return L.apply(this,arguments)}function L(){return L=(0,v.Z)((0,n.Z)().mark(function u(t){return(0,n.Z)().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",(0,Z.WY)("/kitchen/api/Device/AddUpdateTMCDeviceStocAsync",{method:"put",data:t}));case 1:case"end":return r.stop()}},u)})),L.apply(this,arguments)}function le(u){return W.apply(this,arguments)}function W(){return W=(0,v.Z)((0,n.Z)().mark(function u(t){return(0,n.Z)().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",(0,Z.WY)("/kitchen/api/Device/DelTMCStockAdjust?Id=".concat(t),{method:"DELETE"}));case 1:case"end":return r.stop()}},u)})),W.apply(this,arguments)}var l=i(85893),ce=function(t){var y=j.Z.Option,r=j.Z.OptGroup,Y=(0,C.useState)([]),k=(0,D.Z)(Y,2),o=k[0],F=k[1];return(0,C.useEffect)(function(){var p=function(){t.isbom?ue({DeviceId:t.DeviceId,BomIds:t.bomIds}).then(function(S){F(S.data)}):se({DeviceId:t.DeviceId}).then(function(S){F(S.data)})};p()},[]),(0,l.jsx)(V.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,l.jsxs)(b.Z,{layout:"vertical",preserve:!1,initialValues:t.values,onFinish:t.onFinish,children:[(0,l.jsx)(b.Z.Item,{name:"id",hidden:!0,children:(0,l.jsx)(q.Z,{})}),(0,l.jsx)(b.Z.Item,{name:"batching_Id",label:"\u539F\u6599\u540D\u79F0",rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u539F\u6599\u540D\u79F0"}],children:(0,l.jsx)(j.Z,{placeholder:"\u8BF7\u9009\u62E9\u539F\u6599\u540D\u79F0",showSearch:!0,optionFilterProp:"children",filterOption:function(m,S){return S.children.toLowerCase().indexOf(m.toLowerCase())>=0},children:o.map(function(p,m){return(0,l.jsx)(j.Z.Option,{index:m,value:p.id,children:p.name},p.id)})})}),(0,l.jsx)(b.Z.Item,{name:"batching_Loc",label:"\u5E93\u5B58\u4F4D\u7F6E",rules:[{required:!0}],defaultValue:"0",children:(0,l.jsx)(j.Z,{placeholder:"\u8BF7\u9009\u62E9\u5E93\u5B58\u4F4D\u7F6E",children:function(){for(var p=[],m=1;m<=t.materialQuantity;m++)p.push((0,l.jsx)(j.Z.Option,{index:m,value:m,children:m},m));return p}()})}),(0,l.jsx)(b.Z.Item,{name:"batching_Count",label:"\u539F\u6599\u6570\u91CF",rules:[{required:!0}],defaultValue:"0",children:(0,l.jsx)(X.Z,{min:0,placeholder:"\u8BF7\u8F93\u5165\u539F\u6599\u6570\u91CF"})}),(0,l.jsx)(b.Z.Item,{children:(0,l.jsx)(B.Z,{type:"primary",htmlType:"submit",children:"\u4FDD\u5B58"})})]})})},de=ce,g="message",oe=function(t){var y=(0,C.useState)(!1),r=(0,D.Z)(y,2),Y=r[0],k=r[1],o=(0,C.useRef)(),F=(0,C.useState)(),p=(0,D.Z)(F,2),m=p[0],S=p[1],he=(0,C.useState)([]),Q=(0,D.Z)(he,2),ve=Q[0],$=Q[1],pe=(0,C.useState)(0),U=(0,D.Z)(pe,2),me=U[0],ye=U[1],Ze=(0,C.useState)(),N=(0,D.Z)(Ze,2),ge=N[0],Se=N[1],Ce=function(){var h=(0,v.Z)((0,n.Z)().mark(function c(a){return(0,n.Z)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,a.DeviceId=t.values.key,a.type=t.values.type,s.default.loading("\u6B63\u5728\u6DFB\u52A0",g),e.next=6,ne(JSON.stringify(a)).then(function(d){return s.default.destroy(g),d.data?(s.default.success("\u6DFB\u52A0\u6210\u529F"),o.current.reload(),!0):(s.default.error("\u6DFB\u52A0\u5931\u8D25"+d.errors),o.current.reload(),!1)});case 6:e.next=13;break;case 8:return e.prev=8,e.t0=e.catch(0),s.default.error("\u6DFB\u52A0\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01"),o.current.reload(),e.abrupt("return",!1);case 13:case"end":return e.stop()}},c,null,[[0,8]])}));return function(a){return h.apply(this,arguments)}}(),ke=function(){var h=(0,v.Z)((0,n.Z)().mark(function c(a){return(0,n.Z)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,s.default.loading("\u6B63\u5728\u540C\u6B65",g),!t.isbom){e.next=7;break}return e.next=5,ee(a).then(function(d){return s.default.destroy(g),d.data?($([]),s.default.success("\u540C\u6B65\u6210\u529F"),o.current.reload(),!0):(s.default.success("\u540C\u6B65\u5931\u8D25"),o.current.reload(),!1)});case 5:e.next=9;break;case 7:return e.next=9,te(a).then(function(d){return s.default.destroy(g),d.data?($([]),s.default.success("\u540C\u6B65\u6210\u529F"),o.current.reload(),!0):(s.default.success("\u540C\u6B65\u5931\u8D25"),o.current.reload(),!1)});case 9:e.next=16;break;case 11:return e.prev=11,e.t0=e.catch(0),s.default.error("\u540C\u6B65\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01"),o.current.reload(),e.abrupt("return",!1);case 16:case"end":return e.stop()}},c,null,[[0,11]])}));return function(a){return h.apply(this,arguments)}}(),De=function(){var h=(0,v.Z)((0,n.Z)().mark(function c(a){return(0,n.Z)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,!t.isbom){e.next=6;break}return e.next=4,ae(a).then(function(d){return s.default.destroy(g),d.data?(s.default.success("\u83B7\u53D6\u6210\u529F"),o.current.reload(),!0):(s.default.error("\u83B7\u53D6\u5931\u8D25"+d.errors),o.current.reload(),!1)});case 4:e.next=8;break;case 6:return e.next=8,re(a).then(function(d){return s.default.destroy(g),d.data?(s.default.success("\u83B7\u53D6\u6210\u529F"),o.current.reload(),!0):(s.default.error("\u83B7\u53D6\u5931\u8D25"+d.errors),o.current.reload(),!1)});case 8:e.next=15;break;case 10:return e.prev=10,e.t0=e.catch(0),s.default.error("\u83B7\u53D6\u5931\u8D25\uFF01"),o.current.reload(),e.abrupt("return",!1);case 15:case"end":return e.stop()}},c,null,[[0,10]])}));return function(a){return h.apply(this,arguments)}}(),be=function(){var h=(0,v.Z)((0,n.Z)().mark(function c(a){return(0,n.Z)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,le(a).then(function(d){d.data?(s.default.success("\u5220\u9664\u6210\u529F\uFF0C\u5373\u5C06\u5237\u65B0"),o.current.reload()):(s.default.error("\u5220\u9664\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5"),o.current.reload())});case 3:return e.abrupt("return",!0);case 6:e.prev=6,e.t0=e.catch(0),s.default.error("\u5220\u9664\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5"),o.current.reload();case 10:case"end":return e.stop()}},c,null,[[0,6]])}));return function(a){return h.apply(this,arguments)}}(),je=function(){var h=(0,v.Z)((0,n.Z)().mark(function c(a){return(0,n.Z)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,s.default.loading("\u6B63\u5728\u4FEE\u6539",g),s.default.destroy(g),a.DeviceId=t.values.key,a.type=t.values.type,e.next=7,ie(JSON.stringify(a)).then(function(d){return s.default.destroy(g),d.data?(s.default.success("\u4FEE\u6539\u6210\u529F"),!0):(s.default.error("\u4FEE\u6539\u5931\u8D25"+d.errors),!1)});case 7:e.next=13;break;case 9:return e.prev=9,e.t0=e.catch(0),s.default.error("\u4FEE\u6539\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01"),e.abrupt("return",!1);case 13:case"end":return e.stop()}},c,null,[[0,9]])}));return function(a){return h.apply(this,arguments)}}(),we=[{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(c,a){return[(0,l.jsxs)("a",{onClick:function(){k(!0),S(a)},children:[" ","\u4FEE\u6539"]},"config"),(0,l.jsx)(x.Z,{type:"primary",title:"\u786E\u8BA4\u5220\u9664\u5417\uFF1F",okText:"\u662F",cancelText:"\u5426",onConfirm:function(){be(a.id)},onCancel:function(){},children:(0,l.jsx)("a",{href:"#",children:"\u5220\u9664"})},"primary")]}}];return(0,l.jsx)(V.Z,{width:1200,bodyStyle:{padding:"32px 40px 48px"},destroyOnClose:!0,title:(t.values==null?"":t.values.title)+"\u5E93\u5B58\u539F\u6599\u8C03\u6574",search:!1,visible:t.stockModalVisible,footer:!1,onCancel:function(){return t.onCancel()},maskClosable:!1,children:(0,l.jsxs)(z.ZP,{header:{title:"",breadcrumb:{}},children:[(0,l.jsx)(H.ZP,{headerTitle:"",actionRef:o,rowKey:"id",search:!1,toolBarRender:function(){return[(0,l.jsx)(x.Z,{type:"primary",title:"\u83B7\u53D6\u5B9E\u65F6\u5E93\u5B58\u4F1A\u8986\u76D6\u672C\u6B21\u8865\u8D27\u6570\u636E",okText:"\u662F",cancelText:"\u5426",onConfirm:function(){De(t.values.key)},onCancel:function(){},children:(0,l.jsx)(B.Z,{type:"primary",children:"\u83B7\u53D6\u5B9E\u65F6\u5E93\u5B58"},"primary")},"primary"),(0,l.jsx)(B.Z,{type:"primary",onClick:function(){if(ve.length==0)s.default.error("\u8BF7\u9009\u62E9\u9700\u8981\u540C\u6B65\u7684\u6570\u636E\uFF01\uFF01");else{var a,f;ke(t.values.key),(a=o.current)===null||a===void 0||(f=a.reloadAndRest)===null||f===void 0||f.call(a)}},children:"\u540C\u6B65\u5E93\u5B58\u539F\u6599"},"primary"),(0,l.jsxs)(B.Z,{disabled:t.isbom&&me>14,type:"primary",onClick:function(){k(!0),Se(typeof t.values=="undefined"||t.values.materialQuantity==0?14:t.values.materialQuantity)},children:[(0,l.jsx)(K.Z,{})," \u65B0\u589E\u5E93\u5B58\u539F\u6599"]},"primary")]},request:function(){var h=(0,v.Z)((0,n.Z)().mark(function c(a){var f,e;return(0,n.Z)().wrap(function(w){for(;;)switch(w.prev=w.next){case 0:return f=[],e=0,a.DeviceId=t.values.key,a.type=t.values.type,w.next=6,_(a).then(function(J){f=J.data.data,e=J.data.total,ye(e)});case 6:return w.abrupt("return",{data:f,success:!0,total:e});case 7:case"end":return w.stop()}},c)}));return function(c){return h.apply(this,arguments)}}(),columns:we,rowSelection:{onChange:function(c,a){$(a)}}}),(0,l.jsx)(de,{isbom:t.isbom,bomIds:t.bomIds,DeviceId:t.values==null?"":t.values.key,onFinish:function(){var h=(0,v.Z)((0,n.Z)().mark(function c(a){var f;return(0,n.Z)().wrap(function(d){for(;;)switch(d.prev=d.next){case 0:f=!1,a.id?f=je(a):f=Ce(a),f&&(k(!1),S(void 0),o.current.reload());case 3:case"end":return d.stop()}},c)}));return function(c){return h.apply(this,arguments)}}(),onCancel:function(){k(!1),S(void 0)},createModalVisible:Y,values:m||{},materialQuantity:ge})]})})},fe=oe}}]);