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