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

  1. (self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[7093],{13102:function(ie,A,r){"use strict";r.r(A),r.d(A,{default:function(){return ee}});var de=r(57663),P=r(71577),ce=r(62350),U=r(24565),s=r(39428),oe=r(34792),d=r(48086),p=r(3182),T=r(2824),fe=r(402),b=r(56256),C=r(67294),D=r(28790),V=r(85224),Y=r(49101),J=r(16894),pe=r(71194),N=r(50146),he=r(9715),y=r(55843),ve=r(47673),S=r(4107),me=r(43358),B=r(34041),t=r(85893),z=function(c){var v=B.Z.Option,n=B.Z.OptGroup;return(0,t.jsx)(N.Z,{title:c.values.id?"\u7F16\u8F91":"\u65B0\u5EFA",width:640,visible:c.createModalVisible,bodyStyle:{padding:"32px 40px 48px"},footer:null,onCancel:function(){c.onCancel()},destroyOnClose:!0,children:(0,t.jsxs)(y.Z,{layout:"vertical",preserve:!1,initialValues:c.values,onFinish:c.onFinish,children:[(0,t.jsx)(y.Z.Item,{name:"id",hidden:!0,children:(0,t.jsx)(S.Z,{})}),(0,t.jsx)(y.Z.Item,{label:"\u4EA7\u54C1\u540D\u79F0",name:"name",rules:[{required:!0,max:50}],children:(0,t.jsx)(S.Z,{})}),(0,t.jsx)(y.Z.Item,{label:"\u4EA7\u54C1\u6807\u7B7E",name:"code",rules:[{required:!0,max:50}],children:(0,t.jsx)(S.Z,{})}),(0,t.jsx)(y.Z.Item,{label:"\u5907\u6CE8",name:"remark",rules:[{required:!1,max:50}],children:(0,t.jsx)(S.Z,{})}),(0,t.jsx)(y.Z.Item,{children:(0,t.jsx)(P.Z,{type:"primary",htmlType:"submit",children:"\u4FDD\u5B58"})})]})})},K=z,Z=r(48971);function H(o){return w.apply(this,arguments)}function w(){return w=(0,p.Z)((0,s.Z)().mark(function o(c){return(0,s.Z)().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",(0,Z.WY)("/saasbase/api/product/page",{method:"POST",data:c}));case 1:case"end":return n.stop()}},o)})),w.apply(this,arguments)}function L(o){return F.apply(this,arguments)}function F(){return F=(0,p.Z)((0,s.Z)().mark(function o(c){return(0,s.Z)().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",(0,Z.WY)("/saasbase/api/product/add",{method:"POST",data:c}));case 1:case"end":return n.stop()}},o)})),F.apply(this,arguments)}function k(o){return I.apply(this,arguments)}function I(){return I=(0,p.Z)((0,s.Z)().mark(function o(c){return(0,s.Z)().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",(0,Z.WY)("\u200B/saasbase/api/product/delete",{method:"POST",data:c}));case 1:case"end":return n.stop()}},o)})),I.apply(this,arguments)}function Q(o){return R.apply(this,arguments)}function R(){return R=(0,p.Z)((0,s.Z)().mark(function o(c){return(0,s.Z)().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",(0,Z.WY)("\u200B/saasbase/api/product/update",{method:"POST",data:c}));case 1:case"end":return n.stop()}},o)})),R.apply(this,arguments)}function X(o){return $.apply(this,arguments)}function $(){return $=(0,p.Z)((0,s.Z)().mark(function o(c){return(0,s.Z)().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",(0,Z.WY)("\u200B/saasbase/api/product/updatestatus",{method:"POST",data:c}));case 1:case"end":return n.stop()}},o)})),$.apply(this,arguments)}var g="message",q=b.Z.Paragraph,ye=b.Z.Text,_=function(){var c=(0,C.useState)(!1),v=(0,T.Z)(c,2),n=v[0],x=v[1],m=(0,C.useRef)(),re=(0,C.useState)(),G=(0,T.Z)(re,2),ae=G[0],O=G[1],te=(0,C.useState)([]),W=(0,T.Z)(te,2),j=W[0],E=W[1],ne=[{title:"\u4E3B\u952E",dataIndex:"id",hideInSearch:!0,hideInTable:!0,tip:"\u89C4\u5219\u540D\u79F0\u662F\u552F\u4E00\u7684 key"},{title:"\u4EA7\u54C1\u540D\u79F0",dataIndex:"name",valueType:"textarea"},{title:"\u4EA7\u54C1\u6807\u7B7E",dataIndex:"code",valueType:"textarea"},{title:"\u4EA7\u54C1key",dataIndex:"key",valueType:"textarea",render:function(l){return(0,t.jsx)(q,{style:{display:"inline"},copyable:!0,children:l})}},{title:"\u5907\u6CE8",dataIndex:"remark",valueType:"textarea",width:450},{title:"\u72B6\u6001",dataIndex:"status",hideInForm:!0,search:!0,valueEnum:{0:{text:"\u542F\u7528",status:"Processing"},1:{text:"\u7981\u7528",status:"Success"}}},{title:"\u64CD\u4F5C",dataIndex:"option",valueType:"option",fixed:"right",width:450,render:function(l,a){return[(0,t.jsx)("a",{onClick:function(){x(!0),O(a)},children:" \u66F4\u65B0"},"config"),(0,t.jsx)("a",{onClick:(0,p.Z)((0,s.Z)().mark(function i(){return(0,s.Z)().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return m.current.reload(),a.status=a.status?0:1,u.next=4,X(a).then(function(h){h.succeeded?d.default.success("\u914D\u7F6E\u6210\u529F"):d.default.error("\u914D\u7F6E\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01")});case 4:case"end":return u.stop()}},i)})),children:a.status==0?"\u7981\u7528":"\u542F\u7528"},"status"),(0,t.jsx)(U.Z,{type:"primary",title:"\u786E\u8BA4\u5220\u9664\u5417\uFF1F",okText:"\u662F",cancelText:"\u5426",onConfirm:function(){k([a.id]).then(function(e){d.default.success("\u5220\u9664\u6210\u529F\uFF0C\u5373\u5C06\u5237\u65B0"),m.current.reload()})},onCancel:function(){},children:(0,t.jsx)("a",{href:"#",children:"\u5220\u9664"})},"primary"),(0,t.jsx)("a",{onClick:function(){Z.m8.push({pathname:"/device/productmanage",query:{isAdd:!1,values:a,tabStatus:"basis"}})},children:" \u7BA1\u7406"},"config")]}}],ue=function(){var f=(0,p.Z)((0,s.Z)().mark(function l(a){return(0,s.Z)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,d.default.loading("\u6B63\u5728\u6DFB\u52A0",g),e.next=4,L(JSON.stringify(a)).then(function(u){return d.default.destroy(g),u.succeeded?(d.default.success("\u6DFB\u52A0\u6210\u529F"),m.current.reload(),!0):(d.default.error(u.errors),!1)});case 4:e.next=10;break;case 6:return e.prev=6,e.t0=e.catch(0),d.default.error("\u6DFB\u52A0\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01"),e.abrupt("return",!1);case 10:case"end":return e.stop()}},l,null,[[0,6]])}));return function(a){return f.apply(this,arguments)}}(),se=function(){var f=(0,p.Z)((0,s.Z)().mark(function l(a){return(0,s.Z)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,d.default.loading("\u6B63\u5728\u4FEE\u6539",g),d.default.destroy(g),e.next=5,Q(JSON.stringify(a)).then(function(u){return d.default.destroy(g),u.succeeded?(d.default.success("\u4FEE\u6539\u6210\u529F"),m.current.reload(),!0):(d.default.error(u.errors),!1)});case 5:e.next=11;break;case 7:return e.prev=7,e.t0=e.catch(0),d.default.error("\u4FEE\u6539\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01"),e.abrupt("return",!1);case 11:case"end":return e.stop()}},l,null,[[0,7]])}));return function(a){return f.apply(this,arguments)}}(),le=function(){var f=(0,p.Z)((0,s.Z)().mark(function l(a){var i;return(0,s.Z)().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return u.prev=0,d.default.loading("\u6B63\u5728\u5220\u9664"),i=[],a.forEach(function(h){i.push(h.id)}),u.next=6,k(i).then(function(h){return h.data?(d.default.success("\u5220\u9664\u6210\u529F"),m.current.reload(),!0):(d.default.error(h.errors),!1)});case 6:u.next=12;break;case 8:return u.prev=8,u.t0=u.catch(0),d.default.error("\u5220\u9664\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01"),u.abrupt("return",!1);case 12:case"end":return u.stop()}},l,null,[[0,8]])}));return function(a){return f.apply(this,arguments)}}();return(0,t.jsxs)(D.ZP,{host:!0,header:{title:"",breadcrumb:{}},children:[(0,t.jsx)(J.ZP,{actionRef:m,rowKey:"id",pagination:{defaultPageSize:10},search:{labelWidth:120},toolBarRender:function(){return[(0,t.jsxs)(P.Z,{type:"primary",onClick:function(){x(!0)},children:[(0,t.jsx)(Y.Z,{})," \u65B0\u5EFA"]},"primary")]},request:function(){var f=(0,p.Z)((0,s.Z)().mark(function l(a){var i,e;return(0,s.Z)().wrap(function(h){for(;;)switch(h.prev=h.next){case 0:return i=[],e=0,h.next=4,H(a).then(function(M){i=M.data.data,e=M.data.total});case 4:return h.abrupt("return",{data:i,success:!0,total:e});case 5:case"end":return h.stop()}},l)}));return function(l){return f.apply(this,arguments)}}(),columns:ne,rowSelection:{onChange:function(l,a){E(a)}}}),(j==null?void 0:j.length)>0&&(0,t.jsx)(V.Z,{extra:(0,t.jsxs)("div",{children:["\u5DF2\u9009\u62E9"," ",(0,t.jsx)("a",{style:{fontWeight:600},children:j.length})," ","\u9879 \xA0\xA0"]}),children:(0,t.jsx)(P.Z,{onClick:(0,p.Z)((0,s.Z)().mark(function f(){var l,a;return(0,s.Z)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,le(j);case 2:E([]),(l=m.current)===null||l===void 0||(a=l.reloadAndRest)===null||a===void 0||a.call(l);case 4:case"end":return e.stop()}},f)})),children:"\u5220\u9664"})}),(0,t.jsx)(K,{onFinish:function(){var f=(0,p.Z)((0,s.Z)().mark(function l(a){var i;return(0,s.Z)().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:i=!1,a.id?i=se(a):i=ue(a),i&&(x(!1),O(void 0)),m.current.reload();case 4:case"end":return u.stop()}},l)}));return function(l){return f.apply(this,arguments)}}(),onCancel:function(){x(!1),O(void 0)},createModalVisible:n,values:ae||{}})]})},ee=_}}]);