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