Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

8234.205c9e4e.async.js 14 KiB

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