包含后厨 团餐 门店分支
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
12 KiB

  1. (self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[985],{26072:function(re,w,a){"use strict";a.r(w);var Y=a(20228),h=a(11382),b=a(57338),D=a(273),W=a(11849),j=a(57663),M=a(71577),x=a(43185),L=a(93009),K=a(62350),z=a(24565),f=a(2824),c=a(39428),U=a(34792),p=a(48086),g=a(3182),G=a(49101),T=a(84391),E=a(67294),O=a(28790),F=a(85224),I=a(16894),V=a(12826),A=a(48971),B=a(82539),s=a(85893),ne=null,C=function(){var i=(0,g.Z)((0,c.Z)().mark(function e(l){var v;return(0,c.Z)().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return v=p.default.loading("\u6B63\u5728\u914D\u7F6E"),u.prev=1,u.next=4,(0,B.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(P){P.data?p.default.success("\u914D\u7F6E\u6210\u529F"):p.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),v(),u.abrupt("return",!1);case 11:case"end":return u.stop()}},e,null,[[1,7]])}));return function(l){return i.apply(this,arguments)}}(),t=function(){var i=(0,g.Z)((0,c.Z)().mark(function e(l){var v;return(0,c.Z)().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:if(v=p.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,B.yR)(l.map(function(P){return P.id})).then(function(P){v(),P.data?p.default.success("\u5220\u9664\u6210\u529F\uFF0C\u5373\u5C06\u5237\u65B0"):p.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),v(),p.default.error("\u5220\u9664\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5"),u.abrupt("return",!1);case 14:case"end":return u.stop()}},e,null,[[3,9]])}));return function(l){return i.apply(this,arguments)}}(),o=function(){var e=(0,E.useState)([]),l=(0,f.Z)(e,2),v=l[0],$=l[1],u=(0,E.useState)(!1),P=(0,f.Z)(u,2),Ee=P[0],ve=P[1],se=(0,E.useState)(!1),J=(0,f.Z)(se,2),ue=J[0],oe=J[1],R=(0,E.useRef)(),ie=(0,E.useState)(),H=(0,f.Z)(ie,2),y=H[0],le=H[1],de=(0,E.useState)([]),Q=(0,f.Z)(de,2),Z=Q[0],X=Q[1],_e=(0,E.useState)(),q=(0,f.Z)(_e,2),ce=q[0],pe=q[1],me=(0,E.useState)(!1),ee=(0,f.Z)(me,2),he=ee[0],k=ee[1];(0,E.useEffect)(function(){fe()},[]);function fe(){(0,B.FM)().then(function(m){pe(m.data)})}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(n){return"".concat(n,"\xA5")},hideInSearch:!0},{title:"\u5546\u54C1\u7C7B\u578B",dataIndex:"goodsTypeName",valueType:"treeSelect",fieldProps:{showSearch:!0,allowClear:!0,options:ce}},{title:"\u5546\u54C1\u7C7B\u578B",dataIndex:"goodsTypeId",hideInForm:!0,hideInTable:!0,valueEnum:v},{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",fixed:"right",width:350,render:function(n,r){return[(0,s.jsx)("a",{type:"primary",onClick:function(){A.m8.push({pathname:"/database/goods/goodsInfo",query:{isAdd:!1,values:r,tabStatus:"basis"}})},children:"\u66F4\u65B0"},"primary"),(0,s.jsx)("a",{type:"primary",onClick:function(){A.m8.push({pathname:"/database/goods/goodsInfo",query:{isAdd:!1,values:r,tabStatus:"goodsbom"}})},children:"\u5546\u54C1\u914D\u65B9\u8BBE\u7F6E"},"primary"),(0,s.jsx)("a",{type:"primary",onClick:function(){A.m8.push({pathname:"/database/goods/goodsInfo",query:{isAdd:!1,values:r,tabStatus:"goodstechnologymaken"}})},children:"\u5546\u54C1\u5DE5\u827A\u8BBE\u7F6E"},"primary"),r.status===0&&(0,s.jsx)("a",{onClick:function(){r.status="1",C(r),R.current.reload()},children:"\u505C\u7528"},"link"),(r.status===1||r.status===2)&&(0,s.jsx)("a",{onClick:function(){r.status="0",C(r),R.current.reload()},children:"\u542F\u7528"},"warn"),(0,s.jsx)(z.Z,{type:"primary",title:"\u786E\u8BA4\u5220\u9664\u5417\uFF1F",okText:"\u662F",cancelText:"\u5426",onConfirm:function(){(0,B.yR)(r.id).then(function(_){_.succeeded?(p.default.success("\u5220\u9664\u6210\u529F"),R.current.reload()):p.default.error(_.errors)})},onCancel:function(){},children:(0,s.jsx)("a",{href:"#",children:"\u5220\u9664"})},"primary")]}}],ge={beforeUpload:function(n){return k(!0),n.type!=="application/vnd.ms-excel"&&n.type!=="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"&&p.default.error("".concat(n.name," \u4E0D\u662F exelce \u6587\u4EF6")),n.type=="application/vnd.ms-excel"||n.type=="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"?!0:L.Z.LIST_IGNORE},name:"file",action:"/saasbase/api/goodes/ExportGood",headers:{Authorization:"Bearer "+localStorage.getItem("token")},onChange:function(n){n.file.status!=="uploading"&&console.log(n.file,n.fileList),n.file.status==="done"?(k(!1),p.default.success("".concat(n.file.name," file uploaded successfully"))):n.file.status==="error"&&(k(!1),p.default.error("".concat(n.file.name,":").concat(n.file.response," ")))}};return(0,s.jsx)(O.ZP,{host:!0,header:{title:"",breadcrumb:{}},children:(0,s.jsxs)(h.Z,{spinning:he,tip:"\u4E0A\u4F20\u4E2D...",children:[(0,s.jsx)(I.ZP,{headerTitle:"",actionRef:R,rowKey:"id",pagination:{defaultPageSize:10},search:{labelWidth:120},toolBarRender:function(){return[(0,s.jsxs)(M.Z,{type:"primary",onClick:function(){A.m8.push({pathname:"/database/goods/goodsInfo",query:{isAdd:!0,values:null,tabStatus:"basis"}})},children:[(0,s.jsx)(G.Z,{})," \u65B0\u5EFA"]},"primary"),(0,s.jsxs)(M.Z,{onClick:(0,g.Z)((0,c.Z)().mark(function n(){var r;return(0,c.Z)().wrap(function(_){for(;;)switch(_.prev=_.next){case 0:r=document.createElement("a"),r.href="https://hbl-test-1305371387.cos.ap-chengdu.myqcloud.com//Franchisee/goods/133463060115739076.xlsx",r.click();case 3:case"end":return _.stop()}},n)})),children:[(0,s.jsx)(T.Z,{})," \u4E0B\u8F7D\u5546\u54C1\u5BFC\u5165\u6A21\u677F"]},"primary"),(0,s.jsx)(L.Z,(0,W.Z)((0,W.Z)({},ge),{},{showUploadList:!1,children:(0,s.jsx)(M.Z,{icon:(0,s.jsx)(T.Z,{}),children:"\u5BFC\u5165\u5546\u54C1"})}))]},request:function(){var m=(0,g.Z)((0,c.Z)().mark(function n(r){var d,_;return(0,c.Z)().wrap(function(S){for(;;)switch(S.prev=S.next){case 0:return d=[],r.goodsTypeId!=null&&(r.goodsTypeId=v[r.goodsTypeId].goodsTypeId),_=0,S.next=5,(0,B.lO)(r).then(function(ae){d=ae.data.data,console.log(d),d.forEach(function(N){N.defaultMate!=null&&(N.defaultMate=N.defaultMate.split(","))}),console.log(d),_=ae.data.total});case 5:return S.abrupt("return",{data:d,success:!0,total:_});case 6:case"end":return S.stop()}},n)}));return function(n){return m.apply(this,arguments)}}(),columns:te,rowSelection:{onChange:function(n,r){X(r)}}}),(Z==null?void 0:Z.length)>0&&(0,s.jsx)(F.Z,{extra:(0,s.jsxs)("div",{children:["\u5DF2\u9009\u62E9"," ",(0,s.jsx)("a",{style:{fontWeight:600},children:Z.length})," ","\u9879 \xA0\xA0"]}),children:(0,s.jsx)(M.Z,{onClick:(0,g.Z)((0,c.Z)().mark(function m(){var n,r;return(0,c.Z)().wrap(function(_){for(;;)switch(_.prev=_.next){case 0:return _.next=2,t(Z);case 2:X([]),(n=R.current)===null||n===void 0||(r=n.reloadAndRest)===null||r===void 0||r.call(n);case 4:case"end":return _.stop()}},m)})),children:"\u5220\u9664"})}),(0,s.jsx)(D.Z,{width:600,visible:ue,onClose:function(){le(void 0),oe(!1)},closable:!1,children:(y==null?void 0:y.name)&&(0,s.jsx)(V.ZP,{column:2,title:y==null?void 0:y.name,request:(0,g.Z)((0,c.Z)().mark(function m(){return(0,c.Z)().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",{data:y||{}});case 1:case"end":return r.stop()}},m)})),params:{id:y==null?void 0:y.name},columns:te})})]})})};w.default=o},82539:function(re,w,a){"use strict";a.d(w,{lO:function(){return W},Rq:function(){return c},e3:function(){return p},yR:function(){return G},FM:function(){return F}});var Y=a(11849),h=a(39428),b=a(3182),D=a(48971);function W(t){return j.apply(this,arguments)}function j(){return j=(0,b.Z)((0,h.Z)().mark(function t(o){return(0,h.Z)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,D.WY)("/saasbase/api/goods/page",{method:"Post",data:o}));case 1:case"end":return e.stop()}},t)})),j.apply(this,arguments)}function M(t){return x.apply(this,arguments)}function x(){return x=_asyncToGenerator(_regeneratorRuntime().mark(function t(o){return _regeneratorRuntime().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",request("/saasbase/api/bom/getpage",{method:"Post",data:o}));case 1:case"end":return e.stop()}},t)})),x.apply(this,arguments)}function L(t){return K.apply(this,arguments)}function K(){return K=_asyncToGenerator(_regeneratorRuntime().mark(function t(o){return _regeneratorRuntime().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",request("/saasbase/api/GoodsBom/AddBom",{method:"Post",data:o}));case 1:case"end":return e.stop()}},t)})),K.apply(this,arguments)}function z(t){return f.apply(this,arguments)}function f(){return f=_asyncToGenerator(_regeneratorRuntime().mark(function t(o){return _regeneratorRuntime().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",request("/saasbase/api/GoodsBom/getBomInfo",{method:"Post",data:o}));case 1:case"end":return e.stop()}},t)})),f.apply(this,arguments)}function c(t){return U.apply(this,arguments)}function U(){return U=(0,b.Z)((0,h.Z)().mark(function t(o){return(0,h.Z)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,D.WY)("/saasbase/api/goods/add",{method:"POST",data:o}));case 1:case"end":return e.stop()}},t)})),U.apply(this,arguments)}function p(t){return g.apply(this,arguments)}function g(){return g=(0,b.Z)((0,h.Z)().mark(function t(o){return(0,h.Z)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return console.log("\u5546\u54C1\u6570\u636E\u4FEE\u6539",o),e.abrupt("return",(0,D.WY)("/saasbase/api/goods/update",{method:"Post",data:o}));case 2:case"end":return e.stop()}},t)})),g.apply(this,arguments)}function G(t){return T.apply(this,arguments)}function T(){return T=(0,b.Z)((0,h.Z)().mark(function t(o){return(0,h.Z)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,D.WY)("/saasbase/api/goods/delete?id="+o,{method:"Get"}));case 1:case"end":return e.stop()}},t)})),T.apply(this,arguments)}function E(t){return O.apply(this,arguments)}function O(){return O=_asyncToGenerator(_regeneratorRuntime().mark(function t(o){return _regeneratorRuntime().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",request("/saasbase/api/goods-type/goods-types",{method:"POST",data:o}));case 1:case"end":return e.stop()}},t)})),O.apply(this,arguments)}function F(t){return I.apply(this,arguments)}function I(){return I=(0,b.Z)((0,h.Z)().mark(function t(o){return(0,h.Z)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,D.WY)("\u200B/saasbase/api\u200B/goodstype/tree",{method:"GET",data:(0,Y.Z)({},o)}));case 1:case"end":return e.stop()}},t)})),I.apply(this,arguments)}function V(t){return A.apply(this,arguments)}function A(){return A=_asyncToGenerator(_regeneratorRuntime().mark(function t(o){return _regeneratorRuntime().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",request("/saasbase/api/goodstaste/getlist"));case 1:case"end":return e.stop()}},t)})),A.apply(this,arguments)}function B(t){return s.apply(this,arguments)}function s(){return s=_asyncToGenerator(_regeneratorRuntime().mark(function t(o){return _regeneratorRuntime().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",request("/saasbase//api/goods/exportgood",{method:"POST",data:o}));case 1:case"end":return e.stop()}},t)})),s.apply(this,arguments)}function ne(){return C.apply(this,arguments)}function C(){return C=_asyncToGenerator(_regeneratorRuntime().mark(function t(){return _regeneratorRuntime().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return i.abrupt("return",request("/saasbase/api/goods/goodstemplateexport",{method:"post",responseType:"blob"}));case 1:case"end":return i.stop()}},t)})),C.apply(this,arguments)}}}]);