Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.
 
 
 

2 řádky
17 KiB

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