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 line
16 KiB

  1. (self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[131],{64339:function(je,R,n){"use strict";n.r(R),n.d(R,{default:function(){return Ue}});var v=n(58024),S=n(91894),F=n(77576),N=n(12028),I=n(11849),ae=n(43185),w=n(93009),Ce=n(57663),B=n(71577),xe=n(77883),P=n(85986),ue=n(47673),T=n(4107),m=n(39428),U=n(34792),C=n(48086),b=n(3182),se=n(9715),l=n(55843),y=n(2824),$=n(43358),c=n(34041),W=n(35556),s=n(75899),h=n(84391),x=n(49101),t=n(78009),Z=n(67294),mt=n(94184),Se=n(16894),ft=n(71194),Be=n(50146),A=n(48971);function Te(f){return J.apply(this,arguments)}function J(){return J=(0,b.Z)((0,m.Z)().mark(function f(a){return(0,m.Z)().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",(0,A.WY)("/kitchen/api/goodes/GetGoodsBomPage",{method:"Post",data:a}));case 1:case"end":return r.stop()}},f)})),J.apply(this,arguments)}function Ge(f){return H.apply(this,arguments)}function H(){return H=(0,b.Z)((0,m.Z)().mark(function f(a){return(0,m.Z)().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",(0,A.WY)("/kitchen/api/bom/getpage",{method:"Post",data:a}));case 1:case"end":return r.stop()}},f)})),H.apply(this,arguments)}function Fe(f){return Q.apply(this,arguments)}function Q(){return Q=(0,b.Z)((0,m.Z)().mark(function f(a){return(0,m.Z)().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",(0,A.WY)("/kitchen/api/systemconfig/GetCosRequestSignURL",{method:"POST",data:a}));case 1:case"end":return r.stop()}},f)})),Q.apply(this,arguments)}function Ee(f){return X.apply(this,arguments)}function X(){return X=(0,b.Z)((0,m.Z)().mark(function f(a){return(0,m.Z)().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",(0,A.WY)("/kitchen/api/GoodsBom/AddBom",{method:"Post",data:a}));case 1:case"end":return r.stop()}},f)})),X.apply(this,arguments)}function Ie(f){return q.apply(this,arguments)}function q(){return q=(0,b.Z)((0,m.Z)().mark(function f(a){return(0,m.Z)().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",(0,A.WY)("/kitchen/api/goodes/DelGoodsBom?Id=".concat(a),{method:"DELETE"}));case 1:case"end":return r.stop()}},f)})),q.apply(this,arguments)}function Pe(f){return _.apply(this,arguments)}function _(){return _=(0,b.Z)((0,m.Z)().mark(function f(a){return(0,m.Z)().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",(0,A.WY)("/kitchen/api/goods-unit/type",{method:"Post",data:a}));case 1:case"end":return r.stop()}},f)})),_.apply(this,arguments)}var e=n(85893),Ae=function(a){var G=c.Z.Option,r=c.Z.OptGroup,ie=(0,Z.useState)([]),K=(0,y.Z)(ie,2),k=K[0],L=K[1];return(0,e.jsx)(Be.Z,{title:"\u5173\u8054\u5546\u54C1\u914D\u65B9",width:640,visible:a.createModalVisible,bodyStyle:{padding:"32px 40px 1px 48px"},footer:null,onCancel:function(){a.onCancel()},destroyOnClose:!0,children:(0,e.jsxs)(l.Z,{labelCol:{span:4},layout:"horizontal",preserve:!1,onFinish:a.onFinish,children:[(0,e.jsx)(l.Z.Item,{name:"BomType",label:"\u72B6\u6001",rules:[{required:!0,message:"\u914D\u65B9\u7C7B\u578B"}],children:(0,e.jsx)(c.Z,{placeholder:"\u8BF7\u9009\u914D\u65B9\u7C7B\u578B",onChange:function(O){Ge({current:1,pageSize:1e7,IsMain:O}).then(function(M){var D=M.data.data;L(D),console.log(D)})},children:(0,e.jsxs)(r,{children:[(0,e.jsx)(c.Z.Option,{value:"1",children:"\u4E3B\u6599\u914D\u65B9"}),(0,e.jsx)(c.Z.Option,{value:"0",children:"\u8F85\u6599\u914D\u65B9"})]})})}),(0,e.jsx)(l.Z.Item,{name:"bomId",label:"\u914D\u65B9\u4FE1\u606F",rules:[{required:!0,message:"\u914D\u65B9\u4FE1\u606F"}],children:(0,e.jsx)(c.Z,{showSearch:!0,optionFilterProp:"children",placeholder:"\u8BF7\u9009\u914D\u65B9\u4FE1\u606F",children:k.map(function(E,O){return(0,e.jsx)(G,{index:O,value:E.id,children:E.name},E.id)})})}),(0,e.jsxs)(l.Z.Item,{children:[(0,e.jsx)(B.Z,{htmlType:"button",style:{float:"right",left:10},onClick:a.onCancel,children:"\u53D6\u6D88"}),(0,e.jsx)(B.Z,{type:"primary",htmlType:"submit",style:{float:"right"},children:"\u4FDD\u5B58"})]})]})})},we=Ae,ee=n(4795),Oe=n(9669),De=n.n(Oe),gt=s.Z.Step,vt=c.Z.Option,oe=c.Z.OptGroup,Re=function(a){var G=l.Z.useForm(),r=(0,y.Z)(G,1),ie=r[0],K=(0,Z.useState)([]),k=(0,y.Z)(K,2),L=k[0],E=k[1],O=(0,Z.useState)([]),M=(0,y.Z)(O,2),D=M[0],$e=M[1],We=(0,Z.useState)([]),le=(0,y.Z)(We,2),de=le[0],Ke=le[1],ke=(0,Z.useState)([]),ce=(0,y.Z)(ke,2),yt=ce[0],Zt=ce[1],Le=(0,Z.useState)(),he=(0,y.Z)(Le,2),Me=he[0],te=he[1],Ye=(0,Z.useState)([]),pe=(0,y.Z)(Ye,2),bt=pe[0],Ve=pe[1],Y=(0,Z.useRef)(),ze=(0,Z.useState)("basis"),me=(0,y.Z)(ze,2),Ne=me[0],Je=me[1],He=(0,Z.useState)(a.location.query.values?a.location.query.values.imgUrl:null),fe=(0,y.Z)(He,2),V=fe[0],Qe=fe[1],Xe=(0,Z.useState)(0),ge=(0,y.Z)(Xe,2),qe=ge[0],_e=ge[1],et=function(){var o=(0,b.Z)((0,m.Z)().mark(function u(p){var d;return(0,m.Z)().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return d=C.default.loading("\u6B63\u5728\u6DFB\u52A0"),i.prev=1,a.location.query.isAdd&&(p.id=null),p.imgUrl=V||p.imgUrl,i.next=6,(0,ee.Rq)(JSON.stringify(p)).then(function(j){j.data?C.default.success("\u6DFB\u52A0\u6210\u529F"):C.default.error("\u6DFB\u52A0\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01")});case 6:return d(),i.abrupt("return",!0);case 10:return i.prev=10,i.t0=i.catch(1),d(),C.default.error("\u6DFB\u52A0\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01"),i.abrupt("return",!1);case 15:case"end":return i.stop()}},u,null,[[1,10]])}));return function(p){return o.apply(this,arguments)}}(),tt={name:"file",showUploadList:!1,multiple:!1,accept:".png, .jpg, .jpeg, .gif",headers:{"Content-Type":"application/octet-stream"},customRequest:function(u){var p=u.action,d=u.file,g=u.headers,i=u.onError,j=u.onProgress,jt=u.onSuccess,it=u.withCredentials;console.log("\u4E0A\u4F20\u56FE\u7247",d);var lt=d.name.lastIndexOf("."),dt=d.name.substr(lt+1),ye=null;return Fe({directory:"goods",fileExtension:dt,method:"PUT"}).then(function(re){p=re.allUrl;var Ze=new FileReader;Ze.readAsArrayBuffer(d),Ze.onload=function(ct){ye=ct.target.result,De().put(p,ye,{withCredentials:it,headers:g,onUploadProgress:function(be){var ht=be.total,pt=be.loaded;j({percent:Math.round(pt/ht*100).toFixed(2)},d)}}).then(function(z){console.log("onSuccess",z,d),(z.status==200||z.statusText=="OK")&&Qe(re.seeUrl)}).catch(i)}}),{abort:function(){console.log("upload progress is aborted.")}}}},nt=(0,Z.useState)({operationKey:a.location.query.tabStatus?a.location.query.tabStatus:"basis",tabActiveKey:a.location.query.tabStatus?a.location.query.tabStatus:"basis"}),ve=(0,y.Z)(nt,2),ne=ve[0],rt=ve[1];(0,Z.useEffect)(function(){Je(ne.tabActiveKey)},[ne]);var at=function(u){if(qe===1){C.default.info("\u5957\u9910\u4E0D\u80FD\u8BBE\u7F6E\u914D\u65B9");return}rt({operationKey:u,tabActiveKey:u})},ut=[{key:"basis",tab:"\u5546\u54C1\u57FA\u7840\u4FE1\u606F"},{key:"goodsbom",tab:"\u5546\u54C1\u914D\u65B9"}],st=[{title:"\u4E3B\u952E",dataIndex:"id",key:"id",hideInTable:!0,hideInSearch:!0,tip:"\u89C4\u5219\u540D\u79F0\u662F\u552F\u4E00\u7684 key"},{title:"\u914D\u65B9\u540D\u79F0",key:"name",dataIndex:"name",valueType:"textarea"},{title:"\u914D\u65B9\u7C7B\u578B",dataIndex:"isMain",hideInForm:!0,valueEnum:{false:{text:"\u8F85\u6599",status:"Processing"},true:{text:"\u4E3B\u6599",status:"Success"}}},{title:"\u64CD\u4F5C",dataIndex:"option",valueType:"option",render:function(u,p){return[(0,e.jsx)("a",{type:"primary",onClick:function(){var g=C.default.loading("\u6B63\u5728\u5220\u9664");try{return Ie(p.id),g(),C.default.success("\u5220\u9664\u6210\u529F\uFF0C\u5373\u5C06\u5237\u65B0"),Y.current.reload(),!0}catch(i){return g(),C.default.error("\u5220\u9664\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5"),Y.current.reload(),!1}},children:"\u5220\u9664"},"primary")]}}],ot={basis:(0,e.jsx)(S.Z,{title:"\u5546\u54C1\u57FA\u7840\u4FE1\u606F",style:{marginBottom:24},bordered:!1,children:(0,e.jsxs)(l.Z,{labelCol:{span:4},wrapperCol:{span:6},layout:"horizontal",preserve:!1,initialValues:a.location.query.values,onFinish:et,children:[(0,e.jsx)(l.Z.Item,{name:"id",hidden:!0,children:(0,e.jsx)(T.Z,{})}),(0,e.jsx)(l.Z.Item,{name:"code",label:"\u5546\u54C1\u7F16\u7801",hidden:!0,children:(0,e.jsx)(T.Z,{disabled:!0})}),(0,e.jsx)(l.Z.Item,{name:"name",label:"\u5546\u54C1\u540D\u79F0",rules:[{required:!0}],children:(0,e.jsx)(T.Z,{})}),(0,e.jsx)(l.Z.Item,{name:"goodsUintId",label:"\u5546\u54C1\u5355\u4F4D",rules:[{required:!0}],children:(0,e.jsx)(c.Z,{children:D==null?"":D.map(function(o,u){return(0,e.jsx)(c.Z.Option,{index:u,value:o.id,children:o.name},o.id)})})}),(0,e.jsx)(l.Z.Item,{name:"price",label:"\u5546\u54C1\u4EF7\u683C",rules:[{required:!0}],children:(0,e.jsx)(P.Z,{placeholder:"\u4EF7\u683C",min:0})}),(0,e.jsx)(l.Z.Item,{name:"vipPrice",label:"\u4F1A\u5458\u4EF7\u683C",children:(0,e.jsx)(P.Z,{placeholder:"\u4F1A\u5458\u4EF7",min:0})}),(0,e.jsx)(l.Z.Item,{name:"parentTypeID",label:"\u5546\u54C1\u5927\u7C7B",rules:[{required:!0}],children:(0,e.jsx)(c.Z,{children:de==null?"":de.map(function(o,u){return(0,e.jsx)(c.Z.Option,{index:u,value:o.id,children:o.name},o.id)})})}),(0,e.jsx)(l.Z.Item,{name:"goodsTypeId",label:"\u5546\u54C1\u5C0F\u7C7B",rules:[{required:!0}],children:(0,e.jsx)(c.Z,{children:L==null?"":L.map(function(o,u){return(0,e.jsx)(c.Z.Option,{index:u,value:o.id,children:o.goodsType_Name},o.id)})})}),(0,e.jsx)(l.Z.Item,{name:"goodsAttribute",label:"\u5546\u54C1\u5C5E\u6027",defaultValue:0,rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u5546\u54C1\u5C5E\u6027"}],children:(0,e.jsx)(c.Z,{placeholder:"\u8BF7\u9009\u62E9\u5546\u54C1\u5C5E\u6027",onChange:function(u){_e(u)},children:(0,e.jsxs)(oe,{children:[(0,e.jsx)(c.Z.Option,{value:0,children:"\u5355\u54C1"}),(0,e.jsx)(c.Z.Option,{value:1,children:"\u5957\u9910"})]})})}),(0,e.jsx)(l.Z.Item,{name:"status",label:"\u72B6\u6001",defaultValue:0,rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u72B6\u6001"}],children:(0,e.jsx)(c.Z,{placeholder:"\u8BF7\u9009\u62E9\u72B6\u6001",children:(0,e.jsxs)(oe,{children:[(0,e.jsx)(c.Z.Option,{value:0,children:"\u6B63\u5E38"}),(0,e.jsx)(c.Z.Option,{value:1,children:"\u505C\u7528"})]})})}),(0,e.jsx)(l.Z.Item,{name:"remark",label:"\u5907\u6CE8",children:(0,e.jsx)(T.Z,{})}),(0,e.jsx)(l.Z.Item,{name:"imgUrl",hidden:!0,children:(0,e.jsx)(T.Z,{})}),(0,e.jsx)(l.Z.Item,{name:"imgUrl1",label:"\u5546\u54C1\u56FE\u7247\u5730\u5740",children:(0,e.jsx)(w.Z,(0,I.Z)((0,I.Z)({},tt),{},{children:V?(0,e.jsx)("img",{src:V,alt:"avatar",style:{width:"100%"}}):(0,e.jsx)(B.Z,{icon:(0,e.jsx)(h.Z,{}),children:"\u4E0A\u4F20"})}))}),(0,e.jsx)(l.Z.Item,{label:"\u662F\u5426\u79F0\u91CD",name:"isWeigh",valuePropName:"checked",initialValue:"false",children:(0,e.jsx)(N.Z,{checkedChildren:"\u662F",unCheckedChildren:"\u5426",defaultChecked:"false"})}),(0,e.jsx)(l.Z.Item,{children:(0,e.jsx)(B.Z,{type:"primary",htmlType:"submit",children:"\u4FDD\u5B58"})})]})}),goodsbom:(0,e.jsxs)(S.Z,{title:"\u5546\u54C1\u914D\u65B9",style:{marginBottom:24},bordered:!1,children:[(0,e.jsx)(Se.ZP,{columns:st,actionRef:Y,rowKey:"id",search:!1,toolBarRender:function(){return[(0,e.jsxs)(B.Z,{type:"primary",onClick:function(){a.location.query.values.id==null||a.location.query.values.id==null?C.default.info("\u8BF7\u5148\u6DFB\u52A0\u5546\u54C1\u57FA\u7840\u4FE1\u606F!"):te(!0)},children:[(0,e.jsx)(x.Z,{})," \u9009\u62E9\u914D\u65B9"]},"primary")]},request:function(){var o=(0,b.Z)((0,m.Z)().mark(function u(p){var d,g;return(0,m.Z)().wrap(function(j){for(;;)switch(j.prev=j.next){case 0:if(!(a.location.query.values.id==null||a.location.query.values.id==null)){j.next=3;break}j.next=9;break;case 3:return p.GoodsId=a.location.query.values.id,d=0,j.next=7,Te(p);case 7:return g=j.sent,j.abrupt("return",{data:g.data.data,success:!0,total:d});case 9:case"end":return j.stop()}},u)}));return function(u){return o.apply(this,arguments)}}(),rowSelection:{onChange:function(u,p){return Ve(p)}}}),(0,e.jsx)(we,{onFinish:function(){var o=(0,b.Z)((0,m.Z)().mark(function u(p){var d;return(0,m.Z)().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return console.log("value",p),p.GoodsId=a.location.query.values.id,d=!1,i.next=5,Ee(p);case 5:d=i.sent,d&&te(!1),Y.current.reload();case 8:case"end":return i.stop()}},u)}));return function(u){return o.apply(this,arguments)}}(),onCancel:function(){te(!1)},createModalVisible:Me})]})};return(0,Z.useEffect)(function(){function o(){(0,ee.fA)({current:1,status:0,pageSize:1e3}).then(function(d){var g=d.data.data;g.forEach(function(i){i.text=i.goodsType_Name}),E(g)})}function u(){(0,ee.se)({current:1,status:0,pageSize:1e3}).then(function(d){var g=d.data.data;g.forEach(function(i){i.text=i.name}),Ke(g)})}function p(){Pe('{"current":1,"pageSize":200}').then(function(d){var g=d.data.data;$e(g)})}p(),o(),u()},[]),(0,e.jsx)(t.ZP,{title:a.location.query.isAdd?"\u5546\u54C1\u65B0\u589E":"\u8BE6\u60C5",tabActiveKey:Ne,onTabChange:at,tabList:ut,children:ot[ne.operationKey]})},Ue=Re},4795:function(je,R,n){"use strict";n.d(R,{lO:function(){return N},GT:function(){return ae},Rq:function(){return ue},e3:function(){return m},yR:function(){return C},fA:function(){return se},se:function(){return y}});var v=n(39428),S=n(3182),F=n(48971);function N(s){return I.apply(this,arguments)}function I(){return I=(0,S.Z)((0,v.Z)().mark(function s(h){return(0,v.Z)().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",(0,F.WY)("/kitchen/api/goods/goodss",{method:"Post",data:h}));case 1:case"end":return t.stop()}},s)})),I.apply(this,arguments)}function ae(s){return w.apply(this,arguments)}function w(){return w=(0,S.Z)((0,v.Z)().mark(function s(h){return(0,v.Z)().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",(0,F.WY)("/kitchen/api/bom/getpage",{method:"Post",data:h}));case 1:case"end":return t.stop()}},s)})),w.apply(this,arguments)}function Ce(s){return B.apply(this,arguments)}function B(){return B=_asyncToGenerator(_regeneratorRuntime().mark(function s(h){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:h}));case 1:case"end":return t.stop()}},s)})),B.apply(this,arguments)}function xe(s){return P.apply(this,arguments)}function P(){return P=_asyncToGenerator(_regeneratorRuntime().mark(function s(h){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:h}));case 1:case"end":return t.stop()}},s)})),P.apply(this,arguments)}function ue(s){return T.apply(this,arguments)}function T(){return T=(0,S.Z)((0,v.Z)().mark(function s(h){return(0,v.Z)().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",(0,F.WY)("/kitchen/api/goods",{method:"POST",data:h}));case 1:case"end":return t.stop()}},s)})),T.apply(this,arguments)}function m(s){return U.apply(this,arguments)}function U(){return U=(0,S.Z)((0,v.Z)().mark(function s(h){return(0,v.Z)().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return console.log("\u5546\u54C1\u6570\u636E\u4FEE\u6539",h),t.abrupt("return",(0,F.WY)("/kitchen/api/goods",{method:"PUT",data:h}));case 2:case"end":return t.stop()}},s)})),U.apply(this,arguments)}function C(s){return b.apply(this,arguments)}function b(){return b=(0,S.Z)((0,v.Z)().mark(function s(h){return(0,v.Z)().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",(0,F.WY)("/kitchen/api/goods",{method:"DELETE",data:h}));case 1:case"end":return t.stop()}},s)})),b.apply(this,arguments)}function se(s){return l.apply(this,arguments)}function l(){return l=(0,S.Z)((0,v.Z)().mark(function s(h){return(0,v.Z)().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",(0,F.WY)("/kitchen/api/goods-type/goods-types",{method:"POST",data:h}));case 1:case"end":return t.stop()}},s)})),l.apply(this,arguments)}function y(s){return $.apply(this,arguments)}function $(){return $=(0,S.Z)((0,v.Z)().mark(function s(h){return(0,v.Z)().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",(0,F.WY)("/kitchen/api/goods-type/big-goods-types",{method:"POST",data:h}));case 1:case"end":return t.stop()}},s)})),$.apply(this,arguments)}function c(s){return W.apply(this,arguments)}function W(){return W=_asyncToGenerator(_regeneratorRuntime().mark(function s(h){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()}},s)})),W.apply(this,arguments)}}}]);