You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

2 lines
16 KiB

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