(self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[816],{53571:function(ue,D,a){"use strict";a.r(D),a.d(D,{default:function(){return de}});var h=a(57338),x=a(273),B=a(57663),G=a(71577),v=a(2824),d=a(39428),M=a(34792),y=a(48086),Z=a(3182),K=a(49101),m=a(67294),W=a(78009),F=a(85224),U=a(16894),k=a(12826),N=a(71194),P=a(50146),L=a(9715),f=a(71257),z=a(47673),S=a(4107),se=a(43358),T=a(34041),e=a(85893),s=function(o){var u=T.Z.Option,c=T.Z.OptGroup;return(0,e.jsx)(P.Z,{title:o.values.id?"\u7F16\u8F91":"\u65B0\u5EFA",width:640,visible:o.createModalVisible,bodyStyle:{padding:"32px 40px 48px"},footer:null,onCancel:function(){o.onCancel()},destroyOnClose:!0,children:(0,e.jsxs)(f.Z,{labelCol:{span:4},layout:"horizontal",preserve:!1,initialValues:o.values,onFinish:o.onFinish,children:[(0,e.jsx)(f.Z.Item,{name:"id",hidden:!0,children:(0,e.jsx)(S.Z,{})}),(0,e.jsx)(f.Z.Item,{name:"code",label:"\u5546\u54C1\u7F16\u7801",hidden:!0,rules:[{required:!0}],children:(0,e.jsx)(S.Z,{})}),(0,e.jsx)(f.Z.Item,{name:"name",label:"\u5546\u54C1\u540D\u79F0",rules:[{required:!0}],children:(0,e.jsx)(S.Z,{})}),(0,e.jsx)(f.Z.Item,{name:"price",label:"\u5546\u54C1\u4EF7\u683C",rules:[{required:!0}],children:(0,e.jsx)(S.Z,{})}),(0,e.jsx)(f.Z.Item,{name:"imgUrl",label:"\u5546\u54C1\u56FE\u7247\u5730\u5740",rules:[{required:!0}],children:(0,e.jsx)(S.Z,{})}),(0,e.jsx)(f.Z.Item,{name:"remark",label:"\u5907\u6CE8",rules:[{required:!0}],children:(0,e.jsx)(S.Z,{})}),(0,e.jsx)(f.Z.Item,{name:"goodsTypeId",label:"\u5546\u54C1\u7C7B\u578B",rules:[{required:!0}],children:(0,e.jsx)(T.Z,{children:o.goodsTypaData==null?"":o.goodsTypaData.map(function(w,r){return(0,e.jsx)(T.Z.Option,{index:r,value:w.id,children:w.goodsType_Name},w.id)})})}),(0,e.jsx)(f.Z.Item,{name:"status",label:"\u72B6\u6001",defaultValue:o.values.status,rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u72B6\u6001"}],children:(0,e.jsx)(T.Z,{placeholder:"\u8BF7\u9009\u62E9\u72B6\u6001",children:(0,e.jsxs)(c,{children:[(0,e.jsx)(T.Z.Option,{value:0,children:"\u6B63\u5E38"}),(0,e.jsx)(T.Z.Option,{value:1,children:"\u505C\u7528"})]})})}),(0,e.jsx)(f.Z.Item,{children:(0,e.jsx)(G.Z,{type:"primary",htmlType:"submit",children:"\u4FDD\u5B58"})})]})})},I=s,t=a(48971),A=a(4795),ie=function(){var E=(0,Z.Z)((0,d.Z)().mark(function o(u){var c;return(0,d.Z)().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return console.log("fields",u),c=y.default.loading("\u6B63\u5728\u6DFB\u52A0"),u.createBy="admin",r.prev=3,r.next=6,(0,A.Rq)(JSON.stringify(u)).then(function(b){b.data?y.default.success("\u6DFB\u52A0\u6210\u529F"):y.default.error("\u6DFB\u52A0\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01")});case 6:return c(),r.abrupt("return",!0);case 10:return r.prev=10,r.t0=r.catch(3),c(),y.default.error("\u6DFB\u52A0\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01"),r.abrupt("return",!1);case 15:case"end":return r.stop()}},o,null,[[3,10]])}));return function(u){return E.apply(this,arguments)}}(),V=function(){var E=(0,Z.Z)((0,d.Z)().mark(function o(u){var c;return(0,d.Z)().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return c=y.default.loading("\u6B63\u5728\u914D\u7F6E"),r.prev=1,r.next=4,(0,A.e3)({id:u.id,code:u.code,name:u.name,price:u.price,imgUrl:u.imgUrl,remark:u.remark,status:u.status,goodsTypeId:u.goodsTypeId}).then(function(b){b.data?y.default.success("\u914D\u7F6E\u6210\u529F"):y.default.error("\u914D\u7F6E\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01")});case 4:return r.abrupt("return",!0);case 7:return r.prev=7,r.t0=r.catch(1),c(),r.abrupt("return",!1);case 11:case"end":return r.stop()}},o,null,[[1,7]])}));return function(u){return E.apply(this,arguments)}}(),oe=function(){var E=(0,Z.Z)((0,d.Z)().mark(function o(u){var c;return(0,d.Z)().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(c=y.default.loading("\u6B63\u5728\u5220\u9664"),u){r.next=3;break}return r.abrupt("return",!0);case 3:return r.prev=3,r.next=6,(0,A.yR)(u.map(function(b){return b.id})).then(function(b){c(),b.data?y.default.success("\u5220\u9664\u6210\u529F\uFF0C\u5373\u5C06\u5237\u65B0"):y.default.error("\u5220\u9664\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5")});case 6:return r.abrupt("return",!0);case 9:return r.prev=9,r.t0=r.catch(3),c(),y.default.error("\u5220\u9664\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5"),r.abrupt("return",!1);case 14:case"end":return r.stop()}},o,null,[[3,9]])}));return function(u){return E.apply(this,arguments)}}(),le=function(){var o=(0,m.useState)([]),u=(0,v.Z)(o,2),c=u[0],w=u[1],r=(0,m.useState)(!1),b=(0,v.Z)(r,2),ce=b[0],J=b[1],pe=(0,m.useState)(!1),H=(0,v.Z)(pe,2),he=H[0],me=H[1],R=(0,m.useRef)(),fe=(0,m.useState)(),Q=(0,v.Z)(fe,2),C=Q[0],Y=Q[1],ge=(0,m.useState)([]),X=(0,v.Z)(ge,2),O=X[0],q=X[1],ve=(0,m.useState)(),_=(0,v.Z)(ve,2),Ce=_[0],Se=_[1],ye=(0,m.useState)(),ee=(0,v.Z)(ye,2),be=ee[0],je=ee[1],Ze=(0,m.useState)(),te=(0,v.Z)(Ze,2),xe=te[0],Te=te[1],Ie=(0,m.useState)(),re=(0,v.Z)(Ie,2),we=re[0],Be=re[1];(0,m.useEffect)(function(){function p(){(0,A.GT)({current:1,pageSize:1e7}).then(function(n){var l=n.data.data;Te(l)})}p();function i(){(0,A.fA)({current:1,pageSize:1e3}).then(function(n){var l=n.data.data;l.forEach(function(g){g.text=g.goodsType_Name,g.goodsTypeId=g.id}),w(l)})}i()},[]);var ne=[{title:"\u4E3B\u952E",dataIndex:"id",hideInTable:!0,hideInSearch:!0},{title:"\u56FE\u7247\u5730\u5740",dataIndex:"imgUrl",hideInTable:!0,hideInSearch:!0},{title:"\u7F16\u7801",dataIndex:"code",valueType:"textarea"},{title:"\u540D\u79F0",dataIndex:"name",valueType:"textarea"},{title:"\u57FA\u7840\u4EF7\u683C",dataIndex:"price",hideInForm:!0,renderText:function(i){return"".concat(i,"\xA5")},hideInSearch:!0},{title:"\u4F1A\u5458\u4EF7",dataIndex:"vipPrice",hideInForm:!0,renderText:function(i){return"".concat(i,"\xA5")},hideInSearch:!0},{title:"\u5546\u54C1\u5C0F\u7C7B",dataIndex:"goodsTypeName",hideInForm:!0,hideInSearch:!0},{title:"\u5546\u54C1\u7C7B\u578B",dataIndex:"goodsTypeId",hideInForm:!0,hideInTable:!0,valueEnum:c},{title:"\u5546\u54C1\u5C5E\u6027",dataIndex:"goodsAttribute",hideInForm:!0,valueEnum:{0:{text:"\u5355\u54C1"},1:{text:"\u5957\u9910"}}},{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:"\u521B\u5EFA\u65F6\u95F4",dataIndex:"createAt",valueType:"date"},{title:"\u64CD\u4F5C",dataIndex:"option",valueType:"option",render:function(i,n){return[(0,e.jsx)("a",{type:"primary",onClick:function(){t.m8.push({pathname:"/goods/goodsInfo",query:{isAdd:!1,values:n,tabStatus:"basis"}})},children:"\u66F4\u65B0"},"primary"),(0,e.jsx)("a",{type:"primary",onClick:function(){t.m8.push({pathname:"/goods/goodsInfo",query:{isAdd:!1,values:n,tabStatus:"goodsbom"}})},children:"\u5546\u54C1\u914D\u65B9\u8BBE\u7F6E"},"primary"),n.status===0&&(0,e.jsx)("a",{onClick:function(){n.status="1",V(n),R.current.reload()},children:"\u505C\u7528"},"link"),(n.status===1||n.status===2)&&(0,e.jsx)("a",{onClick:function(){n.status="0",V(n),R.current.reload()},children:"\u542F\u7528"},"warn"),(0,e.jsx)("a",{onClick:function(){t.m8.push({pathname:"/bom/cookingentry",query:{isAdd:!1,values:n}})},children:"\u5C0F\u7092\u914D\u7F6E"},"config")]}}];return(0,e.jsxs)(W.ZP,{children:[(0,e.jsx)(U.ZP,{headerTitle:"\u67E5\u8BE2\u8868\u683C",actionRef:R,rowKey:"id",search:{labelWidth:120},toolBarRender:function(){return[(0,e.jsxs)(G.Z,{type:"primary",onClick:function(){t.m8.push({pathname:"/goods/goodsInfo",query:{isAdd:!0,values:null,tabStatus:"basis"}})},children:[(0,e.jsx)(K.Z,{})," \u65B0\u5EFA"]},"primary")]},request:function(){var p=(0,Z.Z)((0,d.Z)().mark(function i(n){var l,g;return(0,d.Z)().wrap(function($){for(;;)switch($.prev=$.next){case 0:return l=[],n.goodsTypeId!=null&&(n.goodsTypeId=c[n.goodsTypeId].goodsTypeId),g=0,$.next=5,(0,A.lO)(n).then(function(ae){l=ae.data.data,g=ae.data.total});case 5:return $.abrupt("return",{data:l,success:!0,total:g});case 6:case"end":return $.stop()}},i)}));return function(i){return p.apply(this,arguments)}}(),columns:ne,rowSelection:{onChange:function(i,n){q(n)}}}),(O==null?void 0:O.length)>0&&(0,e.jsx)(F.Z,{extra:(0,e.jsxs)("div",{children:["\u5DF2\u9009\u62E9"," ",(0,e.jsx)("a",{style:{fontWeight:600},children:O.length})," ","\u9879 \xA0\xA0"]}),children:(0,e.jsx)(G.Z,{onClick:(0,Z.Z)((0,d.Z)().mark(function p(){var i,n;return(0,d.Z)().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:return g.next=2,oe(O);case 2:q([]),(i=R.current)===null||i===void 0||(n=i.reloadAndRest)===null||n===void 0||n.call(i);case 4:case"end":return g.stop()}},p)})),children:"\u5220\u9664"})}),(0,e.jsx)(I,{goodsTypaData:c,onFinish:function(){var p=(0,Z.Z)((0,d.Z)().mark(function i(n){var l;return(0,d.Z)().wrap(function(j){for(;;)switch(j.prev=j.next){case 0:if(l=!1,!n.id){j.next=7;break}return j.next=4,V(n);case 4:l=j.sent,j.next=10;break;case 7:return j.next=9,ie(n);case 9:l=j.sent;case 10:l&&(J(!1),Y(void 0),R.current&&R.current.reload()),R.current.reload();case 12:case"end":return j.stop()}},i)}));return function(i){return p.apply(this,arguments)}}(),onCancel:function(){J(!1),Y(void 0)},createModalVisible:ce,values:C||{}}),(0,e.jsx)(x.Z,{width:600,visible:he,onClose:function(){Y(void 0),me(!1)},closable:!1,children:(C==null?void 0:C.name)&&(0,e.jsx)(k.ZP,{column:2,title:C==null?void 0:C.name,request:(0,Z.Z)((0,d.Z)().mark(function p(){return(0,d.Z)().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",{data:C||{}});case 1:case"end":return n.stop()}},p)})),params:{id:C==null?void 0:C.name},columns:ne})})]})},de=le},4795:function(ue,D,a){"use strict";a.d(D,{lO:function(){return G},GT:function(){return d},Rq:function(){return W},e3:function(){return U},yR:function(){return N},fA:function(){return L},se:function(){return z}});var h=a(39428),x=a(3182),B=a(48971);function G(e){return v.apply(this,arguments)}function v(){return v=(0,x.Z)((0,h.Z)().mark(function e(s){return(0,h.Z)().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",(0,B.WY)("/kitchen/api/goods/goodss",{method:"Post",data:s}));case 1:case"end":return t.stop()}},e)})),v.apply(this,arguments)}function d(e){return M.apply(this,arguments)}function M(){return M=(0,x.Z)((0,h.Z)().mark(function e(s){return(0,h.Z)().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",(0,B.WY)("/kitchen/api/bom/getpage",{method:"Post",data:s}));case 1:case"end":return t.stop()}},e)})),M.apply(this,arguments)}function y(e){return Z.apply(this,arguments)}function Z(){return Z=_asyncToGenerator(_regeneratorRuntime().mark(function e(s){return _regeneratorRuntime().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",request("/kitchen/api/GoodsBom/AddBom",{method:"Post",data:s}));case 1:case"end":return t.stop()}},e)})),Z.apply(this,arguments)}function K(e){return m.apply(this,arguments)}function m(){return m=_asyncToGenerator(_regeneratorRuntime().mark(function e(s){return _regeneratorRuntime().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",request("/kitchen/api/GoodsBom/getBomInfo",{method:"Post",data:s}));case 1:case"end":return t.stop()}},e)})),m.apply(this,arguments)}function W(e){return F.apply(this,arguments)}function F(){return F=(0,x.Z)((0,h.Z)().mark(function e(s){return(0,h.Z)().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",(0,B.WY)("/kitchen/api/goods",{method:"POST",data:s}));case 1:case"end":return t.stop()}},e)})),F.apply(this,arguments)}function U(e){return k.apply(this,arguments)}function k(){return k=(0,x.Z)((0,h.Z)().mark(function e(s){return(0,h.Z)().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return console.log("\u5546\u54C1\u6570\u636E\u4FEE\u6539",s),t.abrupt("return",(0,B.WY)("/kitchen/api/goods",{method:"PUT",data:s}));case 2:case"end":return t.stop()}},e)})),k.apply(this,arguments)}function N(e){return P.apply(this,arguments)}function P(){return P=(0,x.Z)((0,h.Z)().mark(function e(s){return(0,h.Z)().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",(0,B.WY)("/kitchen/api/goods",{method:"DELETE",data:s}));case 1:case"end":return t.stop()}},e)})),P.apply(this,arguments)}function L(e){return f.apply(this,arguments)}function f(){return f=(0,x.Z)((0,h.Z)().mark(function e(s){return(0,h.Z)().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",(0,B.WY)("/kitchen/api/goods-type/goods-types",{method:"POST",data:s}));case 1:case"end":return t.stop()}},e)})),f.apply(this,arguments)}function z(e){return S.apply(this,arguments)}function S(){return S=(0,x.Z)((0,h.Z)().mark(function e(s){return(0,h.Z)().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",(0,B.WY)("/kitchen/api/goods-type/big-goods-types",{method:"POST",data:s}));case 1:case"end":return t.stop()}},e)})),S.apply(this,arguments)}function se(e){return T.apply(this,arguments)}function T(){return T=_asyncToGenerator(_regeneratorRuntime().mark(function e(s){return _regeneratorRuntime().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",request("/kitchen/api/goodstaste/getlist"));case 1:case"end":return t.stop()}},e)})),T.apply(this,arguments)}}}]);