(self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[980],{31199:function(G,w,e){"use strict";var y=e(28991),b=e(81253),A=e(85893),T=e(67294),B=e(31649),K=["fieldProps","min","proFieldProps","max"],l=function(o,m){var $=o.fieldProps,n=o.min,M=o.proFieldProps,i=o.max,u=(0,b.Z)(o,K);return(0,A.jsx)(B.Z,(0,y.Z)({mode:"edit",valueType:"digit",fieldProps:(0,y.Z)({min:n,max:i},$),ref:m,filedConfig:{defaultProps:{width:"100%"}},proFieldProps:M},u))};w.Z=T.forwardRef(l)},64317:function(G,w,e){"use strict";var y=e(28991),b=e(81253),A=e(85893),T=e(22270),B=e(67294),K=e(66758),l=e(31649),N=["fieldProps","children","params","proFieldProps","mode","valueEnum","request","showSearch","options"],o=["fieldProps","children","params","proFieldProps","mode","valueEnum","request","options"],m=B.forwardRef(function(u,z){var J=u.fieldProps,H=u.children,ee=u.params,Q=u.proFieldProps,te=u.mode,V=u.valueEnum,re=u.request,F=u.showSearch,X=u.options,k=(0,b.Z)(u,N),O=(0,B.useContext)(K.Z);return(0,A.jsx)(l.Z,(0,y.Z)((0,y.Z)({mode:"edit",valueEnum:(0,T.h)(V),request:re,params:ee,valueType:"select",filedConfig:{customLightMode:!0},fieldProps:(0,y.Z)({options:X,mode:te,showSearch:F,getPopupContainer:O.getPopupContainer},J),ref:z,proFieldProps:Q},k),{},{children:H}))}),$=B.forwardRef(function(u,z){var J=u.fieldProps,H=u.children,ee=u.params,Q=u.proFieldProps,te=u.mode,V=u.valueEnum,re=u.request,F=u.options,X=(0,b.Z)(u,o),k=(0,y.Z)({options:F,mode:te||"multiple",labelInValue:!0,showSearch:!0,showArrow:!1,autoClearSearchValue:!0,optionLabelProp:"label"},J),O=(0,B.useContext)(K.Z);return(0,A.jsx)(l.Z,(0,y.Z)((0,y.Z)({mode:"edit",valueEnum:(0,T.h)(V),request:re,params:ee,valueType:"select",filedConfig:{customLightMode:!0},fieldProps:(0,y.Z)({getPopupContainer:O.getPopupContainer},k),ref:z,proFieldProps:Q},X),{},{children:H}))}),n=m,M=$,i=n;i.SearchSelect=M,i.displayName="ProFormComponent",w.Z=i},5966:function(G,w,e){"use strict";var y=e(28991),b=e(81253),A=e(85893),T=e(31649),B=["fieldProps","proFieldProps"],K=["fieldProps","proFieldProps"],l="text",N=function(n){var M=n.fieldProps,i=n.proFieldProps,u=(0,b.Z)(n,B);return(0,A.jsx)(T.Z,(0,y.Z)({mode:"edit",valueType:l,fieldProps:M,filedConfig:{valueType:l},proFieldProps:i},u))},o=function(n){var M=n.fieldProps,i=n.proFieldProps,u=(0,b.Z)(n,K);return(0,A.jsx)(T.Z,(0,y.Z)({mode:"edit",valueType:"password",fieldProps:M,proFieldProps:i,filedConfig:{valueType:l}},u))},m=N;m.Password=o,m.displayName="ProFormComponent",w.Z=m},63472:function(G){G.exports={card:"card___3dWIJ",anttabs:"anttabs___2_Orv",errorIcon:"errorIcon___1pp9M",anticon:"anticon___1oiIS",errorPopover:"errorPopover___CUFc7",errorListItem:"errorListItem___1hPkI",errorField:"errorField___3rSLf",editable:"editable___3cDnK"}},16286:function(G,w,e){"use strict";e.r(w),e.d(w,{default:function(){return Ie}});var y=e(57338),b=e(25084),A=e(57663),T=e(71577),B=e(62350),K=e(75443),l=e(2824),N=e(34792),o=e(48086),m=e(3182),$=e(94043),n=e.n($),M=e(49101),i=e(67294),u=e(78009),z=e(85224),J=e(16894),H=e(12826),ee=e(71194),Q=e(50146),te=e(13062),V=e(71230),re=e(89032),F=e(15746),X=e(952),k=e(5966),O=e(64317),ie=e(31199),Ae=e(63472),t=e(85893),D={name:"\u7269\u6599\u540D\u79F0",stockUint:"\u5E93\u5B58\u5355\u4F4D",specs:"\u7269\u6599\u89C4\u683C",code:"\u7269\u6599\u7F16\u7801",aittribute:"\u7269\u6599\u5C5E\u6027",typeID:"\u7269\u6599\u7C7B\u522B",status:"\u7269\u6599\u72B6\u6001",price:"\u6210\u672C\u4EF7",netrecovery:"\u51C0\u6599\u7387(%)",OutstockUint:"\u51FA\u5E93\u5355\u4F4D",proportion:"\u6362\u7B97\u6BD4\u4F8B(%)"},me=[],Ce=function(r){var d=r.modalVisible,Y=r.onCancel,a=(0,i.useState)(function(){return me.map(function(S){return S.id})}),C=(0,l.Z)(a,2),le=C[0],oe=C[1],q=(0,i.useState)(),ne=(0,l.Z)(q,2),de=ne[0],ce=ne[1],ue=(0,i.useState)(function(){return me}),L=(0,l.Z)(ue,2),ve=L[0],se=L[1],x=function(){r.values.membersList!=null&&(oe(r.values.membersList.map(function(R){return R.id})),se(r.values.membersList))};(0,i.useEffect)(function(){x()},[d]);var pe=[{title:"\u4E3B\u952E",dataIndex:"id",tip:"key",hideInSearch:!0,hideInTable:!0},{title:"\u6761\u7801",dataIndex:"code",width:"30%",formItemProps:{rules:[{required:!0,whitespace:!0,message:"\u7269\u6599\u7F16\u7801"},{max:8,whitespace:!0,message:"\u6700\u957F\u4E3A 8 \u4F4D"},{min:4,whitespace:!0,message:"\u6700\u5C0F\u4E3A 4 \u4F4D"}]}},{title:"\u5305\u88C5\u5355\u4F4D",key:"packUnit",dataIndex:"packUnit",valueType:"select",fieldProps:{options:r.uintListData},formItemProps:{rules:[{required:!0,whitespace:!0,message:"\u5305\u88C5\u5355\u4F4D"}]}},{title:"\u6BD4\u4F8B",dataIndex:"proportion",valueType:"digit",formItemProps:{rules:[{required:!0,whitespace:!0,message:"\u6362\u7B97\u6BD4\u4F8B"}]}},{title:"\u64CD\u4F5C",valueType:"option",width:250}];return(0,t.jsx)(Q.Z,{destroyOnClose:!0,title:r.values.id?"\u7F16\u8F91\u7269\u6599":"\u65B0\u5EFA\u7269\u6599",width:1e3,visible:d,onCancel:function(){return Y()},footer:null,maskClosable:!1,children:(0,t.jsxs)(X.ZP,{layout:"horizontal",hideRequiredMark:!0,initialValues:r.values,onFinish:r.onFinish,children:[(0,t.jsxs)(V.Z,{gutter:16,children:[(0,t.jsx)(F.Z,{lg:8,md:12,sm:24,children:(0,t.jsx)(k.Z,{label:D.code,name:"code",rules:[{required:!0,max:50}],placeholder:"\u8BF7\u8F93\u5165\u539F\u6599\u7F16\u7801",onChange:function(R){ce(R.target.value)}})}),(0,t.jsxs)(F.Z,{lg:8,md:12,sm:24,children:[(0,t.jsx)(k.Z,{name:"id",hidden:!0}),(0,t.jsx)(k.Z,{label:D.name,name:"name",rules:[{required:!0,max:50}],placeholder:"\u8BF7\u8F93\u5165\u539F\u6599\u540D\u79F0"})]}),(0,t.jsx)(F.Z,{lg:8,md:12,sm:24,children:(0,t.jsx)(k.Z,{label:D.specs,name:"specs",rules:[{required:!0,max:500}],placeholder:"\u8BF7\u8F93\u5165\u89C4\u683C\u578B\u53F7"})})]}),(0,t.jsxs)(V.Z,{gutter:16,children:[(0,t.jsx)(F.Z,{lg:8,md:12,sm:24,children:(0,t.jsx)(O.Z,{label:D.aittribute,name:"aittribute",rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u7269\u6599\u5C5E\u6027"}],options:[{value:"0",label:"\u6210\u54C1"},{value:"1",label:"\u534A\u6210\u54C1"},{value:"2",label:"\u6613\u8017\u54C1"}],placeholder:"\u8BF7\u9009\u62E9\u7269\u6599\u5C5E\u6027"})}),(0,t.jsx)(F.Z,{lg:8,md:12,sm:24,children:(0,t.jsx)(ie.Z,{label:D.price,name:"price",placeholder:"\u8BF7\u8F93\u5165\u6210\u672C\u4EF7",min:1})}),(0,t.jsx)(F.Z,{lg:8,md:12,sm:24,children:(0,t.jsx)(ie.Z,{label:D.netrecovery,name:"netrecovery",min:1,max:100,placeholder:"\u8BF7\u8F93\u5165\u51C0\u6599\u7387"})})]}),(0,t.jsxs)(V.Z,{gutter:16,children:[(0,t.jsx)(F.Z,{lg:8,md:12,sm:24,children:(0,t.jsx)(O.Z,{label:D.typeID,name:"typeID",rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u7269\u6599\u7C7B\u522B"}],request:(0,m.Z)(n().mark(function S(){return n().wrap(function(Z){for(;;)switch(Z.prev=Z.next){case 0:return Z.abrupt("return",r.typeListData);case 1:case"end":return Z.stop()}},S)})),placeholder:"\u8BF7\u9009\u62E9\u7269\u6599\u7C7B\u522B"})}),(0,t.jsx)(F.Z,{lg:8,md:12,sm:24,children:(0,t.jsx)(O.Z,{label:D.stockUint,name:"stockUint",rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u5355\u4F4D"}],request:(0,m.Z)(n().mark(function S(){return n().wrap(function(Z){for(;;)switch(Z.prev=Z.next){case 0:return Z.abrupt("return",r.uintListData);case 1:case"end":return Z.stop()}},S)})),placeholder:"\u8BF7\u9009\u62E9\u5355\u4F4D"})}),(0,t.jsx)(F.Z,{lg:8,md:12,sm:24,children:(0,t.jsx)(O.Z,{label:D.OutstockUint,name:"outstockUint",rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u51FA\u5E93\u5355\u4F4D"}],request:(0,m.Z)(n().mark(function S(){return n().wrap(function(Z){for(;;)switch(Z.prev=Z.next){case 0:return Z.abrupt("return",r.uintListData);case 1:case"end":return Z.stop()}},S)})),placeholder:"\u8BF7\u9009\u62E9\u51FA\u5E93\u5355\u4F4D"})}),(0,t.jsx)(F.Z,{lg:8,md:12,sm:24,children:(0,t.jsx)(ie.Z,{label:D.proportion,name:"proportion",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u51FA\u5165\u5E93\u6362\u7B97\u6BD4\u4F8B"}],placeholder:"\u8BF7\u8F93\u5165\u6362\u7B97\u6BD4\u4F8B"})}),(0,t.jsx)(F.Z,{lg:8,md:12,sm:24,children:(0,t.jsx)(O.Z,{label:D.status,name:"status",rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u72B6\u6001"}],options:[{value:"0",label:"\u6B63\u5E38"},{value:"1",label:"\u505C\u7528"}],placeholder:"\u8BF7\u9009\u62E9\u72B6\u6001"})})]})]})})},xe=Ce,ae=e(11849),I=e(48971),U={getTypeList:function(r,d){return(0,I.WY)("/kitchen/api/product-type/type-list",{method:"GET",params:(0,ae.Z)({},r)})},GetDicList:function(r){return(0,I.WY)("/kitchen/api/dict-data/dic-list/".concat(r),{method:"Get"})},getUintList:function(r,d){return(0,I.WY)("/kitchen/api/unit/uint-list",{method:"GET",params:(0,ae.Z)({},r)})},addProduct:function(r,d){return(0,I.WY)("/kitchen/api/product/",{method:"POST",data:(0,ae.Z)({},r)})},updateProduct:function(r,d){return(0,I.WY)("/kitchen/api/product/",{method:"PUT",data:(0,ae.Z)({},r)})},removeProduct:function(r){return(0,I.WY)("/kitchen/api/product",{method:"DELETE",data:r})},getpage:function(r,d){return(0,I.WY)("/kitchen/api/product/product-list",{method:"Post",data:r})},getproductdetailed:function(r,d){return(0,I.WY)("/kitchen/api/product-code-server/product-list",{method:"Post",data:r})},updateStatus:function(r){return(0,I.WY)("/kitchen/api/product/product-status",{method:"put",data:r})},BatchList:function(r){return(0,I.WY)("/kitchen/api/product/product-code/".concat(r),{method:"get"})}},Se=function(){var h=(0,m.Z)(n().mark(function r(d){return n().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.prev=0,a.next=3,U.addProduct(d).then(function(C){C.data?o.default.success("\u6DFB\u52A0\u6210\u529F"):o.default.error("\u6DFB\u52A0\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01")});case 3:return a.abrupt("return",!0);case 6:return a.prev=6,a.t0=a.catch(0),o.default.error("\u6DFB\u52A0\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01"),a.abrupt("return",!1);case 10:case"end":return a.stop()}},r,null,[[0,6]])}));return function(d){return h.apply(this,arguments)}}(),De=function(){var h=(0,m.Z)(n().mark(function r(d){return n().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.prev=0,a.next=3,U.updateProduct(d).then(function(C){C.data?o.default.success("\u4FEE\u6539\u6210\u529F"):o.default.error("\u4FEE\u6539\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01")});case 3:return a.abrupt("return",!0);case 6:return a.prev=6,a.t0=a.catch(0),o.default.error("\u4FEE\u6539\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01"),a.abrupt("return",!1);case 10:case"end":return a.stop()}},r,null,[[0,6]])}));return function(d){return h.apply(this,arguments)}}(),je=function(){var h=(0,m.Z)(n().mark(function r(d){return n().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:if(d){a.next=2;break}return a.abrupt("return",!0);case 2:return a.prev=2,a.next=5,U.removeProduct(d.map(function(C){return C.id})).then(function(C){if(C.data)return o.default.success("\u5220\u9664\u6210\u529F\uFF0C\u5373\u5C06\u5237\u65B0"),!0;o.default.error("\u5220\u9664\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5")});case 5:return a.abrupt("return",!0);case 8:return a.prev=8,a.t0=a.catch(2),o.default.error("\u5220\u9664\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5"),a.abrupt("return",!1);case 12:case"end":return a.stop()}},r,null,[[2,8]])}));return function(d){return h.apply(this,arguments)}}(),Te=function(){var r=(0,i.useState)(),d=(0,l.Z)(r,2),Y=d[0],a=d[1],C=(0,i.useState)({}),le=(0,l.Z)(C,2),oe=le[0],q=le[1],ne=(0,i.useState)(),de=(0,l.Z)(ne,2),ce=de[0],ue=de[1],L=(0,i.useRef)(),ve=(0,i.useState)(),se=(0,l.Z)(ve,2),x=se[0],pe=se[1],S=(0,i.useState)([]),R=(0,l.Z)(S,2),Z=R[0],Le=R[1],be=(0,i.useState)([]),he=(0,l.Z)(be,2),Ke=he[0],Be=he[1],Me=(0,i.useState)(),fe=(0,l.Z)(Me,2),_=fe[0],Pe=fe[1],Oe=(0,i.useState)(),Ze=(0,l.Z)(Oe,2),ge=Ze[0],Ue=Ze[1],Re=(0,i.useState)(),Fe=(0,l.Z)(Re,2),Ee=Fe[0],We=Fe[1];(0,i.useEffect)(function(){var E=function(){var c=(0,m.Z)(n().mark(function p(f){var g,P;return n().wrap(function(j){for(;;)switch(j.prev=j.next){case 0:return j.next=2,U.getUintList();case 2:g=j.sent,P=[],g.data.length>0&&g.data.forEach(function(W){P.push({stockuint:W.id,text:W.name,value:W.id,label:W.name})}),Ue(P);case 6:case"end":return j.stop()}},p)}));return function(f){return c.apply(this,arguments)}}(),v=function(){var c=(0,m.Z)(n().mark(function p(f){var g,P;return n().wrap(function(j){for(;;)switch(j.prev=j.next){case 0:return j.next=2,U.getTypeList();case 2:g=j.sent,P=[],g.data.length>0&&g.data.forEach(function(W){P.push({typeid:W.id,text:W.name,value:W.id,label:W.name})}),We(P);case 6:case"end":return j.stop()}},p)}));return function(f){return c.apply(this,arguments)}}();E(),v();function s(){U.GetDicList("BatchingType").then(function(c){var p=c.data,f={};if(c.succeeded){var g=[];p.forEach(function(P){f[P.code]={text:P.remark},g.push({batchingType:P.code,text:P.remark,value:P.code,label:P.remark})}),Be(f),Le(g)}})}s()},[]);var ye=[{title:"\u4E3B\u952E",dataIndex:"id",tip:"key",hideInSearch:!0,hideInTable:!0,render:function(v,s){return(0,t.jsx)("a",{onClick:function(){pe(s),ue(!0)},children:v})}},{title:"\u7269\u6599\u540D\u79F0",dataIndex:"name",ellipsis:!0,formItemProps:{rules:[{required:!0,message:"\u540D\u79F0\u4E3A\u5FC5\u586B\u9879"}]}},{title:"\u7269\u6599\u7F16\u7801",dataIndex:"code",ellipsis:!0},{title:"\u7269\u6599\u89C4\u683C",dataIndex:"specs"},{title:"\u6210\u672C\u4EF7",dataIndex:"price"},{title:"\u51C0\u6599\u7387(%)",dataIndex:"netrecovery"},{title:"\u7269\u6599\u5C5E\u6027",dataIndex:"aittribute",valueEnum:{0:{text:"\u6210\u54C1"},1:{text:"\u534A\u6210\u54C1"},2:{text:"\u6613\u8017\u54C1"}}},{title:"\u7269\u6599\u7C7B\u522B",dataIndex:"typeID",valueType:"select",fieldProps:{options:Ee}},{title:"\u5E93\u5B58\u5355\u4F4D",dataIndex:"stockUint",valueType:"select",fieldProps:{options:ge}},{title:"\u72B6\u6001",dataIndex:"status",hideInForm:!0,valueEnum:{0:{text:"\u6B63\u5E38",status:"Processing"},1:{text:"\u505C\u7528",status:"Success"}}},{title:"\u521B\u5EFA\u65F6\u95F4",dataIndex:"createAt",valueType:"date",hideInForm:!0},{title:"\u64CD\u4F5C",dataIndex:"option",valueType:"option",render:function(v,s){return[(0,t.jsxs)("a",{onClick:function(){a(!0),q(s)},children:[" ","\u66F4\u65B0"]}),(0,t.jsxs)("a",{onClick:function(){s.status=s.status==0?1:0,U.updateStatus(s).then(function(p){p.data&&L.current.reload()})},children:[" ",s.status==0?"\u505C\u7528":"\u542F\u7528"]},"primary"),(0,t.jsx)(K.Z,{type:"primary",title:"\u786E\u8BA4\u5220\u9664\u5417\uFF1F",okText:"\u662F",cancelText:"\u5426",onConfirm:function(){U.removeProduct([s]).then(function(p){p.data?(o.default.success("\u5220\u9664\u6210\u529F\uFF0C\u5373\u5C06\u5237\u65B0"),L.current.reload()):o.default.error("\u5220\u9664\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5")})},onCancel:function(){},children:(0,t.jsx)("a",{href:"#",children:"\u5220\u9664"})},"primary")]}}];return(0,t.jsxs)(u.ZP,{children:[(0,t.jsx)(J.ZP,{headerTitle:"\u7269\u6599\u5217\u8868",actionRef:L,rowKey:"id",search:{labelWidth:120},toolBarRender:function(){return[(0,t.jsxs)(T.Z,{type:"primary",onClick:function(){a(!0)},children:[(0,t.jsx)(M.Z,{})," \u65B0\u5EFA"]},"primary")]},request:function(){var E=(0,m.Z)(n().mark(function v(s){var c,p;return n().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:return c=[],p=0,g.next=4,U.getpage(s).then(function(P){c=P.data.data,p=P.data.total});case 4:return g.abrupt("return",{data:c,success:!0,total:p});case 5:case"end":return g.stop()}},v)}));return function(v){return E.apply(this,arguments)}}(),columns:ye,rowSelection:{onChange:function(v,s){Pe(s)}}}),(_==null?void 0:_.length)>0&&(0,t.jsx)(z.Z,{extra:(0,t.jsxs)("div",{children:["\u5DF2\u9009\u62E9"," ",(0,t.jsx)("a",{style:{fontWeight:600},children:_.length})," ","\u9879 \xA0\xA0"]}),children:(0,t.jsx)(T.Z,{type:"primary",onClick:(0,m.Z)(n().mark(function E(){var v,s;return n().wrap(function(p){for(;;)switch(p.prev=p.next){case 0:return p.next=2,je(_);case 2:Pe([]),(v=L.current)===null||v===void 0||(s=v.reloadAndRest)===null||s===void 0||s.call(v);case 4:case"end":return p.stop()}},E)})),children:"\u6279\u91CF\u5220\u9664"})}),(0,t.jsx)(xe,{dicData:Z,uintListData:ge,typeListData:Ee,onFinish:function(){var E=(0,m.Z)(n().mark(function v(s){var c;return n().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:if(c=!1,q({}),!s.id){f.next=8;break}return f.next=5,De(s);case 5:c=f.sent,f.next=11;break;case 8:return f.next=10,Se(s);case 10:c=f.sent;case 11:c&&(a(!1),L.current&&L.current.reload()),L.current.reload();case 13:case"end":return f.stop()}},v)}));return function(v){return E.apply(this,arguments)}}(),onCancel:function(){a(!1),q({})},modalVisible:Y,values:oe||{}}),(0,t.jsx)(b.Z,{width:600,visible:ce,onClose:function(){pe(void 0),ue(!1)},closable:!1,children:(x==null?void 0:x.name)&&(0,t.jsx)(H.ZP,{column:2,title:x==null?void 0:x.name,request:(0,m.Z)(n().mark(function E(){return n().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return s.abrupt("return",{data:x||{}});case 1:case"end":return s.stop()}},E)})),params:{id:x==null?void 0:x.name},columns:ye})})]})},Ie=Te}}]);