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

2 строки
20 KiB

  1. (self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[1633,7975,1322],{83325:function(Ne,ae,r){"use strict";r.r(ae),r.d(ae,{default:function(){return ke}});var Te=r(57663),A=r(71577),F=r(39428),J=r(3182),We=r(49111),fe=r(19650),Ye=r(71153),me=r(60331),Ae=r(34792),i=r(48086),Z=r(2824),re=r(49101),h=r(67294),he=r(78009),te=r(53779),Je=r(71194),L=r(50146),Ue=r(77576),ue=r(12028),$e=r(9715),S=r(55843),Le=r(47673),$=r(4107),ze=r(43358),V=r(34041),t=r(85893),pe=function(e){var b,R=V.Z.Option,C=V.Z.OptGroup;return(0,t.jsx)(L.Z,{title:e.values.id?"\u7F16\u8F91":"\u65B0\u5EFA",width:640,visible:e.createModalVisible,bodyStyle:{padding:"32px 40px 48px"},footer:null,onCancel:function(){e.onCancel()},destroyOnClose:!0,children:(0,t.jsxs)(S.Z,{layout:"vertical",preserve:!1,initialValues:e.values,onFinish:e.onFinish,children:[(0,t.jsx)(S.Z.Item,{name:"id",hidden:!0,children:(0,t.jsx)($.Z,{})}),(0,t.jsx)(S.Z.Item,{name:"code",label:"\u914D\u65B9\u7F16\u7801",children:(0,t.jsx)($.Z,{placeholder:"\u914D\u65B9\u7F16\u7801"})}),(0,t.jsx)(S.Z.Item,{name:"name",label:"\u914D\u65B9\u540D\u79F0",children:(0,t.jsx)($.Z,{placeholder:"\u914D\u65B9\u540D\u79F0"})}),(0,t.jsx)(S.Z.Item,{name:"bomTypeList",label:"\u914D\u65B9\u7C7B\u578B",children:(0,t.jsx)(V.Z,{mode:"multiple",allowClear:!0,children:e==null||(b=e.bomtype)===null||b===void 0?void 0:b.map(function(u,d){return(0,t.jsx)(V.Z.Option,{index:u.id,value:u.id,children:u.name},u.id)})})}),(0,t.jsx)(S.Z.Item,{name:"isMain",label:"\u914D\u65B9\u7C7B\u578B",children:(0,t.jsx)(ue.Z,{checkedChildren:"\u4E3B\u6599",unCheckedChildren:"\u8F85\u6599"})}),(0,t.jsx)(S.Z.Item,{children:(0,t.jsx)(A.Z,{type:"primary",htmlType:"submit",children:"\u4FDD\u5B58"})})]})})},ve=pe,Ke=r(77883),oe=r(85986),Ce=function(e){var b=V.Z.Option,R=V.Z.OptGroup;return(0,t.jsx)(L.Z,{title:"\u6DFB\u52A0\u914D\u65B9\u539F\u6599",width:640,visible:e.createModalVisible,bodyStyle:{padding:"32px 40px 48px"},footer:null,onCancel:function(){e.onCancel()},destroyOnClose:!0,children:(0,t.jsxs)(S.Z,{layout:"vertical",preserve:!1,initialValues:e.values,onFinish:e.onFinish,children:[(0,t.jsx)(S.Z.Item,{name:"BatchingId",label:"\u539F\u6599\u540D\u79F0",rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u539F\u6599\u540D\u79F0"}],children:(0,t.jsx)(V.Z,{placeholder:"\u8BF7\u9009\u62E9\u539F\u6599\u540D\u79F0",showSearch:!0,optionFilterProp:"children",filterOption:function(u,d){return d.children.toLowerCase().indexOf(u.toLowerCase())>=0},children:e.stockGoodsData.map(function(C,u){return(0,t.jsx)(b,{index:u,value:C.id,children:C.name},C.id)})})}),(0,t.jsx)(S.Z.Item,{name:"bomQty",label:"\u914D\u65B9\u7528\u91CF",children:(0,t.jsx)(oe.Z,{placeholder:"\u914D\u65B9\u7528\u91CF",min:0})}),(0,t.jsx)(S.Z.Item,{name:"isReplace",label:"\u662F\u5426\u53EF\u4EE5\u66FF\u6362",children:(0,t.jsx)(ue.Z,{checkedChildren:"\u5426",unCheckedChildren:"\u662F"})}),(0,t.jsx)(S.Z.Item,{children:(0,t.jsx)(A.Z,{type:"primary",htmlType:"submit",children:"\u4FDD\u5B58"})})]})})},ye=Ce,xe=function(e){var b=function(d){var y=JSON.parse(JSON.stringify(e.values));y.push(y[d]),e.onUpdateBom(y)},R=function(d){if(!(e.values.length<=1)){var y=JSON.parse(JSON.stringify(e.values));y.splice(d,1),e.onUpdateBom(y)}},C=function(){e.onFinish(e.values)};return(0,t.jsxs)(L.Z,{width:540,visible:e.visible,bodyStyle:{padding:"32px 40px 48px"},footer:null,onCancel:function(){e.onCancel()},title:"\u914D\u65B9\u7528\u91CF",children:[(0,t.jsx)("div",{className:"formual-form-card",children:e.values.map(function(u,d){return(0,t.jsxs)("div",{className:"formual-form-list",children:[(0,t.jsxs)("div",{className:"form-list-copy",children:[(0,t.jsx)(A.Z,{onClick:function(){return b(d)},children:"\u590D\u5236\u4E00\u4EFD\u914D\u65B9\u7528\u91CF"}),(0,t.jsx)(A.Z,{style:{marginLeft:"10px"},danger:!0,onClick:function(){return R(d)},children:"\u5220\u9664\u914D\u65B9\u7528\u91CF"})]}),(0,t.jsxs)("div",{className:"form-list-item form-list-total",children:[(0,t.jsx)("span",{className:"form-input-label",children:"\u603B\u91CF"}),(0,t.jsx)($.Z,{placeholder:"\u8BF7\u8F93\u5165\u603B\u91CF",value:u.bomWeight,onChange:function(E){var M=JSON.parse(JSON.stringify(e.values));M[d].bomWeight=E.target.value,e.onUpdateBom(M)}})]}),u.bomMaterials.map(function(y,E){return(0,t.jsx)("div",{className:"form-list-detail",children:(0,t.jsxs)("div",{className:"form-detail-card",children:[(0,t.jsxs)("div",{className:"form-list-item formmual-name",children:[(0,t.jsx)("span",{className:"form-input-label",children:"\u540D\u79F0"}),(0,t.jsx)($.Z,{placeholder:"\u7269\u6599\u540D\u79F0",value:y.name,onChange:function(k){var P=JSON.parse(JSON.stringify(e.values));P[d].bomMaterials[E].name=k.target.value,e.onUpdateBom(P)}})]}),(0,t.jsxs)("div",{className:"form-list-item formmual-company",children:[(0,t.jsx)("span",{className:"form-input-label",children:"\u6570\u91CF"}),(0,t.jsx)($.Z,{placeholder:"\u7269\u6599\u6570\u91CF",value:y.num,onChange:function(k){var P=JSON.parse(JSON.stringify(e.values));P[d].bomMaterials[E].num=k.target.value,e.onUpdateBom(P)}})]})]})},y.id)})]},d)})}),(0,t.jsx)(A.Z,{type:"primary",onClick:C,style:{float:"right"},children:"\u4FDD\u5B58"})]})},ge=xe,j=r(48971),w={add:function(e){return(0,j.WY)("/kitchen/api/bom/add",{method:"Post",data:e})},update:function(e){return(0,j.WY)("/kitchen/api/bom/update",{method:"Post",data:e})},delete:function(e){return(0,j.WY)("/kitchen/api/bom/delete",{method:"Post",data:e})},getpage:function(e){return(0,j.WY)("/kitchen/api/bom/getpage",{method:"Post",data:e})},postStockGoods:function(){return(0,j.WY)("/kitchen/api/frachisee-stock-adjust/product-list",{method:"Get"})},addentry:function(e){return(0,j.WY)("/kitchen/api/bom/addentry",{method:"Post",data:e})},deleteentry:function(e){return(0,j.WY)("/kitchen/api/bom/deleteentry",{method:"Post",data:e})},Enable:function(e){return(0,j.WY)("/kitchen/api/GoodsBom/enable",{method:"Post",data:e})},getentrypage:function(e){return(0,j.WY)("/kitchen/api/bom/getentrypage",{method:"Post",data:e})},getbomtypepage:function(e){return(0,j.WY)("/kitchen/api/bom/getbomtypepage",{method:"Post",data:e})},addBomConsumptionInfo:function(e){return(0,j.WY)("/kitchen/api/bom/addBomConsumptionInfo",{method:"Post",data:e})},getomConsumptionInfo:function(e){return(0,j.WY)("/kitchen/api/bom/getomConsumptionInfo?bomId=".concat(e),{method:"get",data:e})}},Be=function(e){var b=V.Z.Option,R=V.Z.OptGroup;return(0,t.jsx)(L.Z,{title:e.values.id?"\u7F16\u8F91":"\u65B0\u5EFA",width:640,visible:e.createModalVisible,bodyStyle:{padding:"32px 40px 48px"},footer:null,onCancel:function(){e.onCancel()},destroyOnClose:!0,children:(0,t.jsxs)(S.Z,{layout:"vertical",preserve:!1,initialValues:e.values,onFinish:e.onFinish,children:[(0,t.jsx)(S.Z.Item,{name:"id",hidden:!0,children:(0,t.jsx)($.Z,{})}),(0,t.jsx)(S.Z.Item,{name:"itemId",label:"\u539F\u6599\u540D\u79F0",rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u539F\u6599\u540D\u79F0"}],children:(0,t.jsx)(V.Z,{disabled:!!e.values.id,placeholder:"\u8BF7\u9009\u62E9\u539F\u6599\u540D\u79F0",children:e.stockGoodsData.map(function(C,u){return(0,t.jsx)(V.Z.Option,{index:u,value:C.id,children:C.name},C.id)})})}),(0,t.jsx)(S.Z.Item,{name:"price",label:"\u4EF7\u683C",defaultValue:e.values.price,children:(0,t.jsx)(oe.Z,{placeholder:"\u4EF7\u683C",min:0})}),(0,t.jsx)(S.Z.Item,{children:(0,t.jsx)(A.Z,{type:"primary",htmlType:"submit",children:"\u4FDD\u5B58"})})]})})},Ze=Be,H={goodsBoms:function(e){return(0,j.WY)("/kitchen/api/GoodsBom/GetBomReplac",{method:"Post",data:e})},updateGoodsBom:function(e){return(0,j.WY)("/kitchen/api/GoodsBom/EditReplac",{method:"PUT",data:e})},addGoodsBom:function(e){return(0,j.WY)("/kitchen/api/GoodsBom/AddReplac",{method:"POST",data:e})},goodList:function(e){return(0,j.WY)("/kitchen/api/goods/goodss",{method:"Post",data:e})},postStockGoods:function(){return(0,j.WY)("/kitchen/api/frachisee-stock-adjust/product-list",{method:"Get"})}},Se=function(e){var b=(0,h.useState)(!1),R=(0,Z.Z)(b,2),C=R[0],u=R[1],d=(0,h.useRef)(),y=(0,h.useState)(),E=(0,Z.Z)(y,2),M=E[0],k=E[1],P=(0,h.useState)([]),W=(0,Z.Z)(P,2),G=W[0],x=W[1],D=(0,h.useState)([]),p=(0,Z.Z)(D,2),N=p[0],z=p[1],X=(0,h.useState)([]),T=(0,Z.Z)(X,2),U=T[0],q=T[1];(0,h.useEffect)(function(){function s(){H.postStockGoods().then(function(g){var m=g.data;m.forEach(function(v){v.text=v.name,v.stockGoodsId=v.id}),q(m)})}s()},[]);function ne(s){try{return H.addGoodsBom({itemId:s.itemId,price:s.price,goodsbomId:e.values.id,replaceId:e.values.batchingId}).then(function(g){g.data?(i.default.success("\u6DFB\u52A0\u6210\u529F"),d.current.reload()):i.default.error("\u6DFB\u52A0\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01")}),!0}catch(g){return i.default.error("\u6DFB\u52A0\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01"),!1}}function K(s){console.log("\u4F20\u53C2\u6570\u636E",s);try{return H.updateGoodsBom({id:s.id,status:s.status,itemId:s.itemId,price:s.price,goodsbomId:e.values.id,replaceId:e.values.stockGoodsCode}).then(function(g){g.data?i.default.success("\u914D\u7F6E\u6210\u529F"):i.default.error("\u914D\u7F6E\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01"),d.current.reload()}),!0}catch(g){return i.default.error("\u914D\u7F6E\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01"),!1}}function ie(){if(!G)return!0;try{return H.removeGoodsBom(G.map(function(s){return s.id})).then(function(s){s.data?i.default.success("\u5220\u9664\u6210\u529F\uFF0C\u5373\u5C06\u5237\u65B0"):i.default.error("\u5220\u9664\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5"),d.current.reload()}),!0}catch(s){return i.default.error("\u5220\u9664\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5"),!1}}var _=[{title:"\u4E3B\u952E",dataIndex:"id",hideInTable:!0,hideInSearch:!0,tip:"\u89C4\u5219\u540D\u79F0\u662F\u552F\u4E00\u7684 key",render:function(g,m){return(0,t.jsx)("a",{onClick:function(){k(m),setShowDetail(!0)},children:g})}},{title:"\u539F\u6599\u540D\u79F0",dataIndex:"name",hideInForm:!0,hideInSearch:!0},{title:"\u5546\u54C1\u4EF7\u683C",dataIndex:"price",valueType:"money"},{title:"\u72B6\u6001",dataIndex:"status",hideInForm:!0,valueEnum:{0:{text:"\u6B63\u5E38",status:"Processing"},1:{text:"\u505C\u7528",status:"Error"},2:{text:"\u5220\u9664",status:"Error"}}},{title:"\u64CD\u4F5C",dataIndex:"option",valueType:"option",render:function(g,m){return[m.status===0&&(0,t.jsx)("a",{onClick:function(){m.status="1",K(m)},children:"\u505C\u7528"},"link"),(m.status===1||m.status===2)&&(0,t.jsx)("a",{onClick:function(){m.status="0",K(m)},children:"\u542F\u7528"},"warn"),(0,t.jsx)("a",{type:"primary",onClick:function(){k(m),u(!0)},children:"\u66F4\u65B0"},"primary")]}}];return(0,t.jsxs)(L.Z,{width:1200,bodyStyle:{padding:"32px 40px 48px"},destroyOnClose:!0,title:"\u914D\u65B9\u7269\u6599\u66FF\u6362",visible:e.createModalVisible,footer:!1,onCancel:function(){return e.onCancel()},maskClosable:!1,children:[(0,t.jsx)(te.ZP,{headerTitle:"\u66FF\u6362\u7269\u6599\u5217\u8868",actionRef:d,rowKey:"id",pagination:{defaultPageSize:20},search:!1,toolBarRender:function(){return[(0,t.jsxs)(A.Z,{type:"primary",onClick:function(){return u(!0)},children:[(0,t.jsx)(re.Z,{})," \u65B0\u589E\u914D\u65B9\u66FF\u6362\u7269\u6599"]},"create")]},request:function(){var s=(0,J.Z)((0,F.Z)().mark(function g(m){var v,Q;return(0,F.Z)().wrap(function(Y){for(;;)switch(Y.prev=Y.next){case 0:return v=[],Q=0,e.values.id!=null&&(m.goodsbomId=e.values.id,m.replaceId=e.values.stockGoodsCode),Y.next=5,H.goodsBoms(m).then(function(ee){v=ee.data.data,Q=ee.data.total});case 5:return Y.abrupt("return",{data:v,success:!0,total:Q});case 6:case"end":return Y.stop()}},g)}));return function(g){return s.apply(this,arguments)}}(),columns:_}),(0,t.jsx)(Ze,{stockGoodsData:U,onFinish:function(){var s=(0,J.Z)((0,F.Z)().mark(function g(m){var v;return(0,F.Z)().wrap(function(O){for(;;)switch(O.prev=O.next){case 0:if(v=!1,!m.id){O.next=7;break}return O.next=4,K(m);case 4:v=O.sent,O.next=10;break;case 7:return O.next=9,ne(m);case 9:v=O.sent;case 10:v&&(u(!1),k(void 0),d.current&&d.current.reload());case 11:case"end":return O.stop()}},g)}));return function(g){return s.apply(this,arguments)}}(),onCancel:function(){u(!1),k(void 0)},createModalVisible:C,values:M||{}})]})},je=Se,Fe=function(e){var b=(0,h.useRef)(),R=(0,h.useState)(!1),C=(0,Z.Z)(R,2),u=C[0],d=C[1],y=(0,h.useState)(),E=(0,Z.Z)(y,2),M=E[0],k=E[1];function P(x){try{return w.deleteentry({id:x.id}).then(function(D){D.data?i.default.success("\u914D\u7F6E\u6210\u529F"):i.default.error("\u914D\u7F6E\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01"),b.current.reload()}),!0}catch(D){return i.default.error("\u914D\u7F6E\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01"),!1}}function W(x,D){try{return w.Enable({id:x.id,IsReplace:D}).then(function(p){p.data?i.default.success("\u64CD\u4F5C\u6210\u529F"):i.default.error("\u64CD\u4F5C\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01"),b.current.reload()}),!0}catch(p){return i.default.error("\u64CD\u4F5C\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01"),!1}}var G=[{title:"\u4E3B\u952E",dataIndex:"id",hideInTable:!0,hideInSearch:!0,tip:"\u89C4\u5219\u540D\u79F0\u662F\u552F\u4E00\u7684 key",render:function(D,p){return(0,t.jsx)("a",{onClick:function(){k(p),setShowDetail(!0)},children:D})}},{title:"\u539F\u6599\u540D\u79F0",dataIndex:"batchingName",hideInForm:!0,hideInSearch:!0},{title:"\u914D\u65B9\u7528\u91CF",dataIndex:"bomQty",hideInSearch:!0,width:120},{title:"\u662F\u5426\u53EF\u4EE5\u66FF\u6362",dataIndex:"isReplace",hideInForm:!0,valueEnum:{false:{text:"\u4E0D\u53EF\u66FF\u6362",status:"Processing"},true:{text:"\u53EF\u66FF\u6362",status:"Success"}}},{title:"\u64CD\u4F5C",dataIndex:"option",valueType:"option",render:function(D,p){return[p.isReplace&&(0,t.jsx)("a",{onClick:function(){d(!0),k(p)},children:"\u66FF\u6362\u7269\u6599"},"link1"),p.isReplace&&(0,t.jsx)("a",{onClick:function(){W(p,0)},children:"\u7981\u7528\u66FF\u6362"},"link2"),!p.isReplace&&(0,t.jsx)("a",{onClick:function(){W(p,1)},children:"\u542F\u7528\u66FF\u6362"},"link3"),(0,t.jsx)("a",{onClick:function(){P(p)},children:"\u5220\u9664"},"link4")]}}];return(0,t.jsxs)(L.Z,{title:"\u67E5\u770B"+e.values.name+"\u914D\u65B9\u539F\u6599",width:640,visible:e.createModalVisible,bodyStyle:{padding:"32px 40px 48px"},footer:null,onCancel:function(){e.onCancel()},destroyOnClose:!0,children:[(0,t.jsx)(te.ZP,{headerTitle:"\u5546\u54C1\u914D\u65B9\u4FE1\u606F\u67E5\u8BE2",actionRef:b,rowKey:"id",pagination:{defaultPageSize:20},search:!1,toolBarRender:function(){return[]},request:function(){var x=(0,J.Z)((0,F.Z)().mark(function D(p){var N,z;return(0,F.Z)().wrap(function(T){for(;;)switch(T.prev=T.next){case 0:return N=[],z=0,e.values.id!=null&&(p.bomId=e.values.id),T.next=5,w.getentrypage(p).then(function(U){N=U.data.data,z=U.data.total});case 5:return T.abrupt("return",{data:N,success:!0,total:z});case 6:case"end":return T.stop()}},D)}));return function(D){return x.apply(this,arguments)}}(),columns:G}),(0,t.jsx)(je,{onCancel:function(){d(!1),k(void 0)},createModalVisible:u,values:M||{}})]})},be=Fe,Ie=function(e){var b=(0,h.useState)(!1),R=(0,Z.Z)(b,2),C=R[0],u=R[1],d=(0,h.useState)(!1),y=(0,Z.Z)(d,2),E=y[0],M=y[1],k=(0,h.useState)(),P=(0,Z.Z)(k,2),W=P[0],G=P[1],x=(0,h.useRef)(),D=(0,h.useState)([]),p=(0,Z.Z)(D,2),N=p[0],z=p[1],X=(0,h.useState)(),T=(0,Z.Z)(X,2),U=T[0],q=T[1],ne=(0,h.useState)(),K=(0,Z.Z)(ne,2),ie=K[0],_=K[1],s=(0,h.useState)(!1),g=(0,Z.Z)(s,2),m=g[0],v=g[1],Q=(0,h.useState)([]),O=(0,Z.Z)(Q,2),Y=O[0],ee=O[1],De=(0,h.useState)({}),se=(0,Z.Z)(De,2),Qe=se[0],Ge=se[1],Oe=(0,h.useState)([]),le=(0,Z.Z)(Oe,2),Re=le[0],de=le[1];(0,h.useEffect)(function(){function c(){w.postStockGoods().then(function(n){var o=n.data;o.forEach(function(a){a.text=a.name,a.stockGoodsId=a.value}),z(o)}),w.getbomtypepage({current:1,pagesize:1e3}).then(function(n){ee(n.data.data);var o={};a(n.data.data);function a(B){for(var l in B)o[B[l].id]={text:B[l].name},B[l].children&&a(B[l].children)}Ge(o)})}c()},[]);function Ee(c){try{return w.add(JSON.stringify(c)).then(function(n){n.data?(i.default.success("\u6DFB\u52A0\u6210\u529F"),x.current.reload()):i.default.error("\u6DFB\u52A0\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01")}),!0}catch(n){return i.default.error("\u6DFB\u52A0\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01"),!1}}function Me(c){try{return w.update(JSON.stringify(c)).then(function(n){n.data?i.default.success("\u4FEE\u6539\u6210\u529F"):i.default.error("\u4FEE\u6539\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01"),x.current.reload()}),!0}catch(n){return i.default.error("\u4FEE\u6539\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01"),!1}}function Pe(c){try{return w.addentry(JSON.stringify(c)).then(function(n){n.data?(i.default.success("\u6DFB\u52A0\u6210\u529F"),x.current.reload()):i.default.error("\u6DFB\u52A0\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01")}),!0}catch(n){return i.default.error("\u6DFB\u52A0\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01"),!1}}var Ve=[{title:"\u4E3B\u952E",dataIndex:"id",hideInTable:!0,hideInSearch:!0,tip:"\u89C4\u5219\u540D\u79F0\u662F\u552F\u4E00\u7684 key",render:function(n,o){return(0,t.jsx)("a",{onClick:function(){G(o),setShowDetail(!0)},children:n})}},{title:"\u914D\u65B9\u7F16\u7801",dataIndex:"code",hideInForm:!0,hideInSearch:!0},{title:"\u914D\u65B9\u540D\u79F0",dataIndex:"name",hideInForm:!0,hideInSearch:!0},{title:"\u914D\u65B9\u5206\u7C7B",dataIndex:"bomTypeList",search:!1,width:450,render:function(n,o){return(0,t.jsx)(fe.Z,{children:Y.filter(function(a){var B=o.bomTypeList.find(function(I){return I===a.id}),l=Y.find(function(I){return I.id===B});return l!=null||void 0}).map(function(a){return(0,t.jsx)(me.Z,{color:"#87d068",children:a.name},a.id)})})}},{title:"\u914D\u65B9\u7C7B\u578B",dataIndex:"isMain",hideInForm:!0,valueEnum:{false:{text:"\u8F85\u6599\u914D\u65B9",status:"Processing"},true:{text:"\u4E3B\u6599\u914D\u65B9",status:"Success"}}},{title:"\u64CD\u4F5C",dataIndex:"option",valueType:"option",render:function(n,o){return[(0,t.jsx)("a",{type:"primary",onClick:function(){u(!0),G(o)},children:"\u66F4\u65B0"},"primary3"),(0,t.jsx)("a",{type:"primary",onClick:function(){G(o),M(!0)},children:"\u6DFB\u52A0\u914D\u65B9\u7269\u6599"},"BomConsumption"),(0,t.jsx)("a",{type:"primary",onClick:(0,J.Z)((0,F.Z)().mark(function a(){var B;return(0,F.Z)().wrap(function(I){for(;;)switch(I.prev=I.next){case 0:return I.next=2,w.getomConsumptionInfo(o.id);case 2:B=I.sent,de(B.data),G(o),v(!0);case 6:case"end":return I.stop()}},a)})),children:"\u914D\u65B9\u7528\u91CF"},"primary2"),(0,t.jsx)("a",{type:"primary",onClick:function(){q(o),_(!0)},children:"\u67E5\u770B\u914D\u65B9"},"primary1")]}}],we=function(n){de(n)};return(0,t.jsxs)(he.ZP,{children:[(0,t.jsx)(te.ZP,{headerTitle:"\u914D\u65B9\u5217\u8868",actionRef:x,rowKey:"id",pagination:{defaultPageSize:20},search:!1,toolBarRender:function(){return[(0,t.jsxs)(A.Z,{type:"primary",onClick:function(){return u(!0)},children:[(0,t.jsx)(re.Z,{})," \u65B0\u589E\u914D\u65B9"]},"create")]},request:function(){var c=(0,J.Z)((0,F.Z)().mark(function n(o){var a,B;return(0,F.Z)().wrap(function(I){for(;;)switch(I.prev=I.next){case 0:return a=[],B=0,I.next=4,w.getpage(o).then(function(ce){a=ce.data.data,B=ce.data.total});case 4:return I.abrupt("return",{data:a,success:!0,total:B});case 5:case"end":return I.stop()}},n)}));return function(n){return c.apply(this,arguments)}}(),columns:Ve}),(0,t.jsx)(ye,{onFinish:function(){var c=(0,J.Z)((0,F.Z)().mark(function n(o){var a;return(0,F.Z)().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return o.bomId=W.id,a=!1,G(void 0),l.next=5,Pe(o);case 5:a=l.sent,a&&M(!1),x.current.reload();case 8:case"end":return l.stop()}},n)}));return function(n){return c.apply(this,arguments)}}(),onCancel:function(){M(!1),G(void 0)},createModalVisible:E,stockGoodsData:N}),U&&Object.keys(U).length?(0,t.jsx)(be,{onCancel:function(){_(!1),q({})},createModalVisible:ie,values:U}):null,(0,t.jsx)(ve,{bomtype:Y,onFinish:function(){var c=(0,J.Z)((0,F.Z)().mark(function n(o){var a;return(0,F.Z)().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:if(a=!1,!o.id){l.next=7;break}return l.next=4,Me(o);case 4:a=l.sent,l.next=10;break;case 7:return l.next=9,Ee(o);case 9:a=l.sent;case 10:a&&(u(!1),G(void 0),x.current&&x.current.reload()),x.current.reload();case 12:case"end":return l.stop()}},n)}));return function(n){return c.apply(this,arguments)}}(),onCancel:function(){u(!1),G(void 0)},createModalVisible:C,values:W||{}}),(0,t.jsx)(ge,{onFinish:function(){var c=(0,J.Z)((0,F.Z)().mark(function n(o){return(0,F.Z)().wrap(function(B){for(;;)switch(B.prev=B.next){case 0:w.addBomConsumptionInfo({bomId:W.id,bomConsumptionInfo:o}).then(function(l){l.data?(v(!1),i.default.success("\u6210\u529F")):i.default.error("\u6DFB\u52A0\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01")}),console.log(o);case 2:case"end":return B.stop()}},n)}));return function(n){return c.apply(this,arguments)}}(),visible:m,values:Re,onUpdateBom:we,onCancel:function(){v(!1)}})]})},ke=Ie}}]);