|
- (self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[816],{53571:function(ne,A,a){"use strict";a.r(A),a.d(A,{default:function(){return le}});var h=a(57338),Z=a(273),x=a(11849),V=a(57663),b=a(71577),Y=a(43185),F=a(93009),I=a(2824),m=a(39428),ae=a(34792),v=a(48086),j=a(3182),E=a(49101),P=a(84391),f=a(67294),W=a(78009),_=a(85224),U=a(16894),G=a(12826),L=a(71194),O=a(9715),ue=a(47673),D=a(43358),o=a(85893),$=function(d){var l=_Select.Option,y=_Select.OptGroup;return _jsx(_Modal,{title:d.values.id?"\u7F16\u8F91":"\u65B0\u5EFA",width:640,visible:d.createModalVisible,bodyStyle:{padding:"32px 40px 48px"},footer:null,closable:!0,onCancel:function(){d.onCancel()},destroyOnClose:!0,children:_jsxs(_Form,{labelCol:{span:4},layout:"horizontal",preserve:!1,initialValues:d.values,onFinish:d.onFinish,children:[_jsx(_Form.Item,{name:"id",hidden:!0,children:_jsx(_Input,{})}),_jsx(_Form.Item,{name:"code",label:"\u5546\u54C1\u7F16\u7801",hidden:!0,rules:[{required:!0}],children:_jsx(_Input,{})}),_jsx(_Form.Item,{name:"name",label:"\u5546\u54C1\u540D\u79F0",rules:[{required:!0}],children:_jsx(_Input,{})}),_jsx(_Form.Item,{name:"price",label:"\u5546\u54C1\u4EF7\u683C",rules:[{required:!0}],children:_jsx(_Input,{})}),_jsx(_Form.Item,{name:"imgUrl",label:"\u5546\u54C1\u56FE\u7247\u5730\u5740",rules:[{required:!0}],children:_jsx(_Input,{})}),_jsx(_Form.Item,{name:"remark",label:"\u5907\u6CE8",rules:[{required:!0}],children:_jsx(_Input,{})}),_jsx(_Form.Item,{name:"foreignKeyRe",label:"\u5173\u8054\u5916\u952E",rules:[{required:!0}],children:_jsx(_Input,{})}),_jsx(_Form.Item,{name:"goodsTypeId",label:"\u5546\u54C1\u7C7B\u578B",rules:[{required:!0}],children:_jsx(_Select,{children:d.goodsTypaData==null?"":d.goodsTypaData.map(function(S,u){return _jsx(_Select.Option,{index:u,value:S.id,children:S.goodsType_Name},S.id)})})}),_jsx(_Form.Item,{name:"status",label:"\u72B6\u6001",defaultValue:d.values.status,rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u72B6\u6001"}],children:_jsx(_Select,{placeholder:"\u8BF7\u9009\u62E9\u72B6\u6001",children:_jsxs(y,{children:[_jsx(_Select.Option,{value:0,children:"\u6B63\u5E38"}),_jsx(_Select.Option,{value:1,children:"\u505C\u7528"})]})})}),_jsx(_Form.Item,{children:_jsx(_Button,{type:"primary",htmlType:"submit",children:"\u4FDD\u5B58"})})]})})},se=null,B=a(48971),t=a(4795),s=null,i=function(){var w=(0,j.Z)((0,m.Z)().mark(function d(l){var y;return(0,m.Z)().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return y=v.default.loading("\u6B63\u5728\u914D\u7F6E"),u.prev=1,u.next=4,(0,t.e3)({id:l.id,code:l.code,name:l.name,price:l.price,imgUrl:l.imgUrl,remark:l.remark,status:l.status,goodsTypeId:l.goodsTypeId}).then(function(C){C.data?v.default.success("\u914D\u7F6E\u6210\u529F"):v.default.error("\u914D\u7F6E\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01")});case 4:return u.abrupt("return",!0);case 7:return u.prev=7,u.t0=u.catch(1),y(),u.abrupt("return",!1);case 11:case"end":return u.stop()}},d,null,[[1,7]])}));return function(l){return w.apply(this,arguments)}}(),e=function(){var w=(0,j.Z)((0,m.Z)().mark(function d(l){var y;return(0,m.Z)().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:if(y=v.default.loading("\u6B63\u5728\u5220\u9664"),l){u.next=3;break}return u.abrupt("return",!0);case 3:return u.prev=3,u.next=6,(0,t.yR)(l.map(function(C){return C.id})).then(function(C){y(),C.data?v.default.success("\u5220\u9664\u6210\u529F\uFF0C\u5373\u5C06\u5237\u65B0"):v.default.error("\u5220\u9664\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5")});case 6:return u.abrupt("return",!0);case 9:return u.prev=9,u.t0=u.catch(3),y(),v.default.error("\u5220\u9664\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5"),u.abrupt("return",!1);case 14:case"end":return u.stop()}},d,null,[[3,9]])}));return function(l){return w.apply(this,arguments)}}(),oe=function(){var d=(0,f.useState)([]),l=(0,I.Z)(d,2),y=l[0],S=l[1],u=(0,f.useState)(!1),C=(0,I.Z)(u,2),Te=C[0],Ze=C[1],ie=(0,f.useState)(!1),N=(0,I.Z)(ie,2),de=N[0],ce=N[1],M=(0,f.useRef)(),pe=(0,f.useState)(),z=(0,I.Z)(pe,2),T=z[0],me=z[1],he=(0,f.useState)([]),J=(0,I.Z)(he,2),R=J[0],H=J[1],fe=(0,f.useState)(),Q=(0,I.Z)(fe,2),Se=Q[0],Ce=Q[1],ge=(0,f.useState)(),X=(0,I.Z)(ge,2),be=X[0],je=X[1],ve=(0,f.useState)(),q=(0,I.Z)(ve,2),Be=q[0],ye=q[1],xe=(0,f.useState)(),ee=(0,I.Z)(xe,2),Fe=ee[0],we=ee[1];(0,f.useEffect)(function(){function g(){(0,t.GT)({current:1,pageSize:1e7}).then(function(n){var c=n.data.data;ye(c)})}g();function r(){(0,t.fA)({current:1,pageSize:1e3}).then(function(n){var c=n.data.data;c.forEach(function(p){p.text=p.goodsType_Name,p.goodsTypeId=p.id}),S(c)})}r()},[]);var te=[{title:"\u4E3B\u952E",dataIndex:"id",hideInTable:!0,hideInSearch:!0},{title:"\u56FE\u7247\u5730\u5740",dataIndex:"imgUrl",hideInTable:!0,hideInSearch:!0},{title:"\u7F16\u7801",dataIndex:"code",valueType:"textarea"},{title:"\u540D\u79F0",dataIndex:"name",valueType:"textarea"},{title:"\u57FA\u7840\u4EF7\u683C",dataIndex:"price",hideInForm:!0,renderText:function(r){return"".concat(r,"\xA5")},hideInSearch:!0},{title:"\u4F1A\u5458\u4EF7",dataIndex:"vipPrice",hideInForm:!0,renderText:function(r){return"".concat(r,"\xA5")},hideInSearch:!0},{title:"\u5546\u54C1\u5C0F\u7C7B",dataIndex:"goodsTypeName",hideInForm:!0,hideInSearch:!0},{title:"\u5546\u54C1\u7C7B\u578B",dataIndex:"goodsTypeId",hideInForm:!0,hideInTable:!0,valueEnum:y},{title:"\u5546\u54C1\u5C5E\u6027",dataIndex:"goodsAttribute",hideInForm:!0,valueEnum:{0:{text:"\u5355\u54C1"},1:{text:"\u5957\u9910"}}},{title:"\u5173\u8054\u5916\u952E",dataIndex:"foreignKeyRe",valueType:"textarea"},{title:"\u72B6\u6001",dataIndex:"status",hideInForm:!0,valueEnum:{0:{text:"\u6B63\u5E38",status:"Processing"},1:{text:"\u505C\u7528",status:"Error"},2:{text:"\u5220\u9664",status:"Error"}}},{title:"\u5907\u6CE8",dataIndex:"remark",ellipsis:!0,tip:"\u6807\u9898\u8FC7\u957F\u4F1A\u81EA\u52A8\u6536\u7F29"},{title:"\u64CD\u4F5C",dataIndex:"option",valueType:"option",render:function(r,n){return[(0,o.jsx)("a",{type:"primary",onClick:function(){B.m8.push({pathname:"/goods/goodsInfo",query:{isAdd:!1,values:n,tabStatus:"basis"}})},children:"\u66F4\u65B0"},"primary"),(0,o.jsx)("a",{type:"primary",onClick:function(){B.m8.push({pathname:"/goods/goodsInfo",query:{isAdd:!1,values:n,tabStatus:"goodsbom"}})},children:"\u5546\u54C1\u914D\u65B9\u8BBE\u7F6E"},"primary"),n.status===0&&(0,o.jsx)("a",{onClick:function(){n.status="1",i(n),M.current.reload()},children:"\u505C\u7528"},"link"),(n.status===1||n.status===2)&&(0,o.jsx)("a",{onClick:function(){n.status="0",i(n),M.current.reload()},children:"\u542F\u7528"},"warn"),(0,o.jsx)("a",{onClick:function(){B.m8.push({pathname:"/bom/cookingentry",query:{isAdd:!1,values:n}})},children:"\u5C0F\u7092\u914D\u7F6E"},"config")]}}],Ie={beforeUpload:function(r){return r.type!=="application/vnd.ms-excel"&&r.type!=="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"&&v.default.error("".concat(r.name," \u4E0D\u662F exelce \u6587\u4EF6")),r.type=="application/vnd.ms-excel"||r.type=="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"?!0:F.Z.LIST_IGNORE},name:"file",action:"/kitchen/api/goodes/ExportGood",headers:{Authorization:"Bearer "+localStorage.getItem("token")},onChange:function(r){r.file.status!=="uploading"&&console.log(r.file,r.fileList),r.file.status==="done"?v.default.success("".concat(r.file.name," file uploaded successfully")):r.file.status==="error"&&v.default.error("".concat(r.file.name,":").concat(r.file.response," "))}};return(0,o.jsxs)(W.ZP,{children:[(0,o.jsx)(U.ZP,{headerTitle:"",actionRef:M,rowKey:"id",search:{labelWidth:120},toolBarRender:function(){return[(0,o.jsxs)(b.Z,{type:"primary",onClick:function(){B.m8.push({pathname:"/goods/goodsInfo",query:{isAdd:!0,values:null,tabStatus:"basis"}})},children:[(0,o.jsx)(E.Z,{})," \u65B0\u5EFA"]},"primary"),(0,o.jsxs)(b.Z,{onClick:(0,j.Z)((0,m.Z)().mark(function r(){var n;return(0,m.Z)().wrap(function(p){for(;;)switch(p.prev=p.next){case 0:n=document.createElement("a"),n.href="https://hbl-test-1305371387.cos.ap-chengdu.myqcloud.com//Franchisee/goods/133461572557666278.xlsx",n.click();case 3:case"end":return p.stop()}},r)})),children:[(0,o.jsx)(P.Z,{})," \u4E0B\u8F7D\u5546\u54C1\u5BFC\u5165\u6A21\u677F"]},"primary"),(0,o.jsx)(F.Z,(0,x.Z)((0,x.Z)({},Ie),{},{children:(0,o.jsx)(b.Z,{icon:(0,o.jsx)(P.Z,{}),children:"\u5BFC\u5165\u5546\u54C1"})}))]},request:function(){var g=(0,j.Z)((0,m.Z)().mark(function r(n){var c,p;return(0,m.Z)().wrap(function(k){for(;;)switch(k.prev=k.next){case 0:return c=[],n.goodsTypeId!=null&&(n.goodsTypeId=y[n.goodsTypeId].goodsTypeId),p=0,k.next=5,(0,t.lO)(n).then(function(re){c=re.data.data,console.log(c),c.forEach(function(K){K.defaultMate!=null&&(K.defaultMate=K.defaultMate.split(","))}),console.log(c),p=re.data.total});case 5:return k.abrupt("return",{data:c,success:!0,total:p});case 6:case"end":return k.stop()}},r)}));return function(r){return g.apply(this,arguments)}}(),columns:te,rowSelection:{onChange:function(r,n){H(n)}}}),(R==null?void 0:R.length)>0&&(0,o.jsx)(_.Z,{extra:(0,o.jsxs)("div",{children:["\u5DF2\u9009\u62E9"," ",(0,o.jsx)("a",{style:{fontWeight:600},children:R.length})," ","\u9879 \xA0\xA0"]}),children:(0,o.jsx)(b.Z,{onClick:(0,j.Z)((0,m.Z)().mark(function g(){var r,n;return(0,m.Z)().wrap(function(p){for(;;)switch(p.prev=p.next){case 0:return p.next=2,e(R);case 2:H([]),(r=M.current)===null||r===void 0||(n=r.reloadAndRest)===null||n===void 0||n.call(r);case 4:case"end":return p.stop()}},g)})),children:"\u5220\u9664"})}),(0,o.jsx)(Z.Z,{width:600,visible:de,onClose:function(){me(void 0),ce(!1)},closable:!1,children:(T==null?void 0:T.name)&&(0,o.jsx)(G.ZP,{column:2,title:T==null?void 0:T.name,request:(0,j.Z)((0,m.Z)().mark(function g(){return(0,m.Z)().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",{data:T||{}});case 1:case"end":return n.stop()}},g)})),params:{id:T==null?void 0:T.name},columns:te})})]})},le=oe},4795:function(ne,A,a){"use strict";a.d(A,{lO:function(){return V},GT:function(){return Y},Rq:function(){return j},e3:function(){return P},yR:function(){return W},fA:function(){return U},se:function(){return L}});var h=a(39428),Z=a(3182),x=a(48971);function V(t){return b.apply(this,arguments)}function b(){return b=(0,Z.Z)((0,h.Z)().mark(function t(s){return(0,h.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:s}));case 1:case"end":return e.stop()}},t)})),b.apply(this,arguments)}function Y(t){return F.apply(this,arguments)}function F(){return F=(0,Z.Z)((0,h.Z)().mark(function t(s){return(0,h.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:s}));case 1:case"end":return e.stop()}},t)})),F.apply(this,arguments)}function I(t){return m.apply(this,arguments)}function m(){return m=_asyncToGenerator(_regeneratorRuntime().mark(function t(s){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:s}));case 1:case"end":return e.stop()}},t)})),m.apply(this,arguments)}function ae(t){return v.apply(this,arguments)}function v(){return v=_asyncToGenerator(_regeneratorRuntime().mark(function t(s){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:s}));case 1:case"end":return e.stop()}},t)})),v.apply(this,arguments)}function j(t){return E.apply(this,arguments)}function E(){return E=(0,Z.Z)((0,h.Z)().mark(function t(s){return(0,h.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:s}));case 1:case"end":return e.stop()}},t)})),E.apply(this,arguments)}function P(t){return f.apply(this,arguments)}function f(){return f=(0,Z.Z)((0,h.Z)().mark(function t(s){return(0,h.Z)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return console.log("\u5546\u54C1\u6570\u636E\u4FEE\u6539",s),e.abrupt("return",(0,x.WY)("/kitchen/api/goods",{method:"PUT",data:s}));case 2:case"end":return e.stop()}},t)})),f.apply(this,arguments)}function W(t){return _.apply(this,arguments)}function _(){return _=(0,Z.Z)((0,h.Z)().mark(function t(s){return(0,h.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:s}));case 1:case"end":return e.stop()}},t)})),_.apply(this,arguments)}function U(t){return G.apply(this,arguments)}function G(){return G=(0,Z.Z)((0,h.Z)().mark(function t(s){return(0,h.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:s}));case 1:case"end":return e.stop()}},t)})),G.apply(this,arguments)}function L(t){return O.apply(this,arguments)}function O(){return O=(0,Z.Z)((0,h.Z)().mark(function t(s){return(0,h.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:s}));case 1:case"end":return e.stop()}},t)})),O.apply(this,arguments)}function ue(t){return D.apply(this,arguments)}function D(){return D=_asyncToGenerator(_regeneratorRuntime().mark(function t(s){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()}},t)})),D.apply(this,arguments)}function o(t){return $.apply(this,arguments)}function $(){return $=_asyncToGenerator(_regeneratorRuntime().mark(function t(s){return _regeneratorRuntime().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",request("/kitchen//api/goodes/ExportGood",{method:"POST",data:s}));case 1:case"end":return e.stop()}},t)})),$.apply(this,arguments)}function se(){return B.apply(this,arguments)}function B(){return B=_asyncToGenerator(_regeneratorRuntime().mark(function t(){return _regeneratorRuntime().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return i.abrupt("return",request("/kitchen/api/goodes/GoodsTemplateExport",{method:"post",responseType:"blob"}));case 1:case"end":return i.stop()}},t)})),B.apply(this,arguments)}}}]);
|