包含后厨 团餐 门店分支
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([[2047],{91952:function(se,S,t){"use strict";t.r(S),t.d(S,{default:function(){return z}});var ne=t(71194),D=t(50146),ue=t(62999),A=t(85733),le=t(47673),j=t(4107),ie=t(57663),B=t(71577),oe=t(62350),$=t(24565),n=t(39428),h=t(3182),de=t(9715),m=t(55843),g=t(2824),c=t(67294),R=t(28790),W=t(16894),Y=t(49101),Z=t(48971),f={Page:function(i){return(0,Z.WY)("/groupmeal/api/shop/page",{method:"Post",data:i})},Add:function(i){return(0,Z.WY)("/groupmeal/api/shop",{method:"Post",data:i})},Update:function(i){return(0,Z.WY)("/groupmeal/api/shop",{method:"PUT",data:i})},Del:function(i){return(0,Z.WY)("/groupmeal//api/shop/del/"+i,{method:"Post"})},GetOrgList:function(i){return(0,Z.WY)("/saasbase/api/organize/getorglist",{method:"Post",data:i})},GetOrgtree:function(){return(0,Z.WY)("/saasbase/api/organize/tree",{method:"get"})}},y=t(69215),a=t(85893),U=function(){var i=(0,c.useState)(!1),T=(0,g.Z)(i,2),V=T[0],x=T[1],M=(0,c.useState)({}),I=(0,g.Z)(M,2),E=I[0],L=I[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)([]),w=(0,g.Z)(X,2),b=w[0],k=w[1],q=m.Z.useForm(),_=(0,g.Z)(q,1),d=_[0],F=(0,c.useRef)();(0,c.useEffect)(function(){var u=function(){var s=(0,h.Z)((0,n.Z)().mark(function r(o){var e,p;return(0,n.Z)().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.next=2,f.GetOrgList({pid:""});case 2:e=l.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 l.stop()}},r)}));return function(o){return s.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",ellipsis:{showTitle:!1},fieldProps:{options:b}},{title:"\u573A\u666F\u540D\u79F0",dataIndex:"name",ellipsis:{showTitle:!1},valueType:"textarea"},{title:"\u7535\u8BDD",dataIndex:"phone",valueType:"textarea"},{title:"\u64CD\u4F5C",dataIndex:"option",valueType:"option",key:"operation",fixed:"right",width:150,render:function(s,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,h.Z)((0,n.Z)().mark(function o(){var e;return(0,n.Z)().wrap(function(v){for(;;)switch(v.prev=v.next){case 0:return v.next=2,f.Del(r.id);case 2:e=v.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 v.stop()}},o)})),okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",children:(0,a.jsx)("a",{href:"#",children:"\u5220\u9664"})},"delete")]}}],te=function(){var u=(0,h.Z)((0,n.Z)().mark(function s(){var r;return(0,n.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()}},s)}));return function(){return u.apply(this,arguments)}}(),re=function(){var u=(0,h.Z)((0,n.Z)().mark(function s(){var r;return(0,n.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()}},s)}));return function(){return u.apply(this,arguments)}}(),ae=function(){var u=(0,h.Z)((0,n.Z)().mark(function s(){var r;return(0,n.Z)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!E.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()}},s)}));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,h.Z)((0,n.Z)().mark(function s(r){var o,e,p;return(0,n.Z)().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.next=2,f.Page(r);case 2:return o=l.sent,e=o.data.data,p=o.data.total,l.abrupt("return",{data:e,success:!0,total:p});case 6:case"end":return l.stop()}},s)}));return function(s){return u.apply(this,arguments)}}()})}),(0,a.jsx)(D.Z,{width:600,title:E.id?"\u66F4\u65B0":"\u65B0\u589E",open:V,onOk:d.submit,onCancel:function(){d.resetFields(),x(!1)},children:(0,a.jsxs)(m.Z,{name:"basic",form:d,onFinish:ae,labelCol:{span:4},children:[(0,a.jsx)(m.Z.Item,{name:"id",label:"id",hidden:!0,children:(0,a.jsx)(j.Z,{})}),(0,a.jsx)(m.Z.Item,{name:"orgId",label:"\u6240\u5C5E\u7EC4\u7EC7",rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u6240\u5C5E\u7EC4\u7EC7"}],children:(0,a.jsx)(A.Z,{style:{width:"100%"},treeData:H,placeholder:"\u8BF7\u9009\u62E9\u6240\u5C5E\u7EC4\u7EC7",treeDefaultExpandAll:!0})}),(0,a.jsx)(m.Z.Item,{name:"name",label:"\u573A\u666F\u540D\u79F0",rules:[{required:!0,max:20}],children:(0,a.jsx)(j.Z,{})}),(0,a.jsx)(m.Z.Item,{name:"phone",label:"\u7535\u8BDD",rules:[{required:!0,max:20}],children:(0,a.jsx)(j.Z,{})})]})})]})},z=U}}]);