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

  1. (self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[2508],{70209:function(ne,S,t){"use strict";t.r(S),t.d(S,{default:function(){return z}});var se=t(71194),A=t(50146),ue=t(62999),w=t(85733),ie=t(47673),j=t(4107),le=t(57663),B=t(71577),oe=t(62350),$=t(24565),s=t(39428),v=t(3182),de=t(9715),h=t(55843),g=t(2824),c=t(67294),R=t(28790),W=t(16894),Y=t(49101),Z=t(48971),f={Page:function(l){return(0,Z.WY)("/storemanagement/api/shop/page",{method:"Post",data:l})},Add:function(l){return(0,Z.WY)("/storemanagement/api/shop",{method:"Post",data:l})},Update:function(l){return(0,Z.WY)("/storemanagement/api/shop",{method:"PUT",data:l})},Del:function(l){return(0,Z.WY)("/storemanagement/api/shop/del/"+l,{method:"Post"})},GetOrgList:function(l){return(0,Z.WY)("/saasbase/api/organize/getorglist",{method:"Post",data:l})},GetOrgtree:function(){return(0,Z.WY)("/saasbase/api/organize/tree",{method:"get"})}},y=t(69215),a=t(85893),U=function(){var l=(0,c.useState)(!1),I=(0,g.Z)(l,2),V=I[0],x=I[1],M=(0,c.useState)({}),E=(0,g.Z)(M,2),T=E[0],L=E[1],K=(0,c.useState)([]),P=(0,g.Z)(K,2),H=P[0],J=P[1],N=(0,c.useState)([]),G=(0,g.Z)(N,2),ce=G[0],Q=G[1],X=(0,c.useState)([]),D=(0,g.Z)(X,2),b=D[0],k=D[1],q=h.Z.useForm(),_=(0,g.Z)(q,1),d=_[0],F=(0,c.useRef)();(0,c.useEffect)(function(){var u=function(){var n=(0,v.Z)((0,s.Z)().mark(function r(o){var e,p;return(0,s.Z)().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return i.next=2,f.GetOrgList({pid:""});case 2:e=i.sent,p=[],e.statusCode==200&&e.data.forEach(function(O){p.push({id:O.id,text:O.name,value:O.id,label:O.name})}),k(p);case 6:case"end":return i.stop()}},r)}));return function(o){return n.apply(this,arguments)}}();u(),te(),re()},[]);var ee=[{title:"\u4E3B\u952E",dataIndex:"id",tip:"\u89C4\u5219\u540D\u79F0\u662F\u552F\u4E00\u7684 key",hideInSearch:!0,hideInTable:!0},{title:"\u6240\u5C5E\u7EC4\u7EC7",dataIndex:"orgId",valueType:"select",fieldProps:{options:b}},{title:"\u573A\u666F\u540D\u79F0",dataIndex:"name",valueType:"textarea"},{title:"\u7535\u8BDD",dataIndex:"phone",valueType:"textarea"},{title:"\u64CD\u4F5C",dataIndex:"option",valueType:"option",key:"operation",fixed:"right",width:150,render:function(n,r){return[(0,a.jsx)("a",{onClick:function(){x(!0),L(r),d.setFieldsValue(r)},children:"\u66F4\u65B0"},"config"),(0,a.jsx)($.Z,{title:"\u786E\u5B9A\u8981\u5220\u9664\u5417\uFF1F",onConfirm:(0,v.Z)((0,s.Z)().mark(function o(){var e;return(0,s.Z)().wrap(function(m){for(;;)switch(m.prev=m.next){case 0:return m.next=2,f.Del(r.id);case 2:e=m.sent,e.data?(y.yw.success("\u5220\u9664\u6210\u529F"),F.current.reload()):y.yw.error(response.errors||"\u5220\u9664\u5931\u8D25");case 4:case"end":return m.stop()}},o)})),okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",children:(0,a.jsx)("a",{href:"#",children:"\u5220\u9664"})},"delete")]}}],te=function(){var u=(0,v.Z)((0,s.Z)().mark(function n(){var r;return(0,s.Z)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,f.GetOrgtree();case 2:r=e.sent,r.statusCode==200&&J(r.data);case 4:case"end":return e.stop()}},n)}));return function(){return u.apply(this,arguments)}}(),re=function(){var u=(0,v.Z)((0,s.Z)().mark(function n(){var r;return(0,s.Z)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,f.GetOrgList({pid:""});case 2:r=e.sent,r.statusCode==200&&Q(r.data);case 4:case"end":return e.stop()}},n)}));return function(){return u.apply(this,arguments)}}(),ae=function(){var u=(0,v.Z)((0,s.Z)().mark(function n(){var r;return(0,s.Z)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!T.id){e.next=7;break}return e.next=3,f.Update(d.getFieldsValue());case 3:r=e.sent,r.data?(y.yw.success("\u4FEE\u6539\u6210\u529F"),F.current.reload(),x(!1),d.resetFields()):y.yw.error(r.errors||"\u4FEE\u6539\u5931\u8D25"),e.next=11;break;case 7:return e.next=9,f.Add(d.getFieldsValue());case 9:r=e.sent,r.data?(y.yw.success("\u65B0\u589E\u6210\u529F"),F.current.reload(),x(!1),d.resetFields()):y.yw.error(r.errors||"\u65B0\u589E\u5931\u8D25");case 11:case"end":return e.stop()}},n)}));return function(){return u.apply(this,arguments)}}(),fe={labelCol:{span:6},wrapperCol:{span:14}};return(0,a.jsxs)("div",{children:[(0,a.jsx)(R.ZP,{header:{title:"",breadcrumb:{}},children:(0,a.jsx)(W.ZP,{columns:ee,actionRef:F,rowKey:"id",pagination:{pageSize:10},scroll:{x:1300},toolBarRender:function(){return[(0,a.jsxs)(B.Z,{type:"primary",onClick:function(){x(!0),L({})},children:[(0,a.jsx)(Y.Z,{})," \u65B0\u5EFA"]},"primary")]},request:function(){var u=(0,v.Z)((0,s.Z)().mark(function n(r){var o,e,p;return(0,s.Z)().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return i.next=2,f.Page(r);case 2:return o=i.sent,e=o.data.data,p=o.data.total,i.abrupt("return",{data:e,success:!0,total:p});case 6:case"end":return i.stop()}},n)}));return function(n){return u.apply(this,arguments)}}()})}),(0,a.jsx)(A.Z,{width:600,title:T.id?"\u66F4\u65B0":"\u65B0\u589E",open:V,onOk:d.submit,onCancel:function(){d.resetFields(),x(!1)},children:(0,a.jsxs)(h.Z,{name:"basic",form:d,onFinish:ae,labelCol:{span:4},children:[(0,a.jsx)(h.Z.Item,{name:"id",label:"id",hidden:!0,children:(0,a.jsx)(j.Z,{})}),(0,a.jsx)(h.Z.Item,{name:"orgId",label:"\u6240\u5C5E\u7EC4\u7EC7",rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u6240\u5C5E\u7EC4\u7EC7"}],children:(0,a.jsx)(w.Z,{style:{width:"100%"},treeData:H,placeholder:"\u8BF7\u9009\u62E9\u6240\u5C5E\u7EC4\u7EC7",treeDefaultExpandAll:!0})}),(0,a.jsx)(h.Z.Item,{name:"name",label:"\u573A\u666F\u540D\u79F0",rules:[{required:!0,max:20}],children:(0,a.jsx)(j.Z,{})}),(0,a.jsx)(h.Z.Item,{name:"phone",label:"\u7535\u8BDD",rules:[{required:!0,max:20}],children:(0,a.jsx)(j.Z,{})})]})})]})},z=U}}]);