25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.
 
 
 

2 satır
13 KiB

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