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

  1. (self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[3800],{20173:function(ue,k,n){"use strict";n.d(k,{lM:function(){return Z},IH:function(){return G},mm:function(){return H},eP:function(){return ne},FM:function(){return re}});var g=n(39428),w=n(11849),u=n(3182),D=n(48971),f=n(96690);function Z(d,o){return z.apply(this,arguments)}function z(){return z=(0,u.Z)((0,g.Z)().mark(function d(o,E){return(0,g.Z)().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",(0,D.WY)((0,f.w)()+"/api/organize/page",{method:"POST",data:(0,w.Z)({},o)}));case 1:case"end":return r.stop()}},d)})),z.apply(this,arguments)}function G(d){return y.apply(this,arguments)}function y(){return y=(0,u.Z)((0,g.Z)().mark(function d(o){return(0,g.Z)().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",(0,D.WY)((0,f.w)()+"/api/organize/addorg",{method:"POST",data:(0,w.Z)({},o)}));case 1:case"end":return t.stop()}},d)})),y.apply(this,arguments)}function te(d){return v.apply(this,arguments)}function v(){return v=_asyncToGenerator(_regeneratorRuntime().mark(function d(o){return _regeneratorRuntime().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",request(getDataBaseUrl()+"\u200B/api\u200B/organize/getorglist",{method:"POST",data:_objectSpread({},o)}));case 1:case"end":return t.stop()}},d)})),v.apply(this,arguments)}function H(d){return B.apply(this,arguments)}function B(){return B=(0,u.Z)((0,g.Z)().mark(function d(o){return(0,g.Z)().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",(0,D.WY)((0,f.w)()+"\u200B/api\u200B/organize/deleteorg?id="+o,{method:"GET"}));case 1:case"end":return t.stop()}},d)})),B.apply(this,arguments)}function ne(d){return M.apply(this,arguments)}function M(){return M=(0,u.Z)((0,g.Z)().mark(function d(o){return(0,g.Z)().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",(0,D.WY)((0,f.w)()+"\u200B/api\u200B/organize/updateorg",{method:"POST",data:(0,w.Z)({},o)}));case 1:case"end":return t.stop()}},d)})),M.apply(this,arguments)}function ie(d){return W.apply(this,arguments)}function W(){return W=_asyncToGenerator(_regeneratorRuntime().mark(function d(o){return _regeneratorRuntime().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",request(getDataBaseUrl()+"/api\u200B/sysOrg\u200B/detail",{method:"POST",data:_objectSpread({},o)}));case 1:case"end":return t.stop()}},d)})),W.apply(this,arguments)}function re(d){return U.apply(this,arguments)}function U(){return U=(0,u.Z)((0,g.Z)().mark(function d(o){return(0,g.Z)().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",(0,D.WY)((0,f.w)()+"\u200B/api\u200B/organize/tree",{method:"GET",data:(0,w.Z)({},o)}));case 1:case"end":return t.stop()}},d)})),U.apply(this,arguments)}},72721:function(ue,k,n){"use strict";n.r(k),n.d(k,{default:function(){return ve}});var g=n(57663),w=n(71577),u=n(39428),D=n(34792),f=n(48086),Z=n(3182),z=n(62350),G=n(24565),y=n(2824),te=n(49101),v=n(67294),H=n(28790),B=n(16894),ne=n(71194),M=n(50146),ie=n(77883),W=n(85986),re=n(62999),U=n(54680),d=n(47673),o=n(4107),E=n(9715),t=n(55843),r=n(85893),le=function(e){var x=(0,v.useState)(),a=(0,y.Z)(x,2),q=a[0],V=a[1],K=t.Z.useForm(),_=(0,y.Z)(K,1),S=_[0];(0,v.useEffect)(function(){var O;if(console.log(e.values),e!=null&&(O=e.values)!==null&&O!==void 0&&O.id){var P,I,C,L,R,T,b,Y;S.setFieldsValue({id:e==null||(P=e.values)===null||P===void 0?void 0:P.id,name:e==null||(I=e.values)===null||I===void 0?void 0:I.name,orgId:e==null||(C=e.values)===null||C===void 0?void 0:C.orgId,phone:e==null||(L=e.values)===null||L===void 0?void 0:L.phone,sort:e==null||(R=e.values)===null||R===void 0?void 0:R.sort,description:e==null||(T=e.values)===null||T===void 0?void 0:T.description,orgName:e==null||(b=e.values)===null||b===void 0?void 0:b.orgName}),V(e==null||(Y=e.values)===null||Y===void 0?void 0:Y.orgId)}else S.resetFields()},[e.values]);var F=function(P,I,C){console.log(I),S.setFieldsValue({orgName:I[0]}),V(P)};return(0,r.jsx)(M.Z,{title:e.values.id?"\u7F16\u8F91":"\u65B0\u5EFA",width:640,visible:e.createModalVisible,bodyStyle:{padding:"32px 40px 48px"},footer:null,onCancel:function(){e.onCancel()},destroyOnClose:!0,children:(0,r.jsxs)(t.Z,{layout:"Horizontal",labelCol:{span:4},preserve:!1,form:S,initialValues:e.values,onFinish:e.onFinish,children:[(0,r.jsx)(t.Z.Item,{name:"id",hidden:!0,children:(0,r.jsx)(o.Z,{})}),(0,r.jsx)(t.Z.Item,{name:"orgName",hidden:!0,children:(0,r.jsx)(o.Z,{})}),(0,r.jsx)(t.Z.Item,{label:"\u6240\u5C5E\u7EC4\u7EC7",name:"orgId",rules:[{required:!0}],children:(0,r.jsx)(U.Z,{allowClear:!0,treeDefaultExpandAll:!0,treeData:e.OrgList,onChange:F,value:q})}),(0,r.jsx)(t.Z.Item,{label:"\u573A\u666F\u540D\u79F0",name:"name",rules:[{required:!0,max:50}],children:(0,r.jsx)(o.Z,{})}),(0,r.jsx)(t.Z.Item,{label:"\u7535\u8BDD",name:"phone",rules:[{required:!0}],children:(0,r.jsx)(o.Z,{})}),(0,r.jsx)(t.Z.Item,{name:"sort",label:"\u6392\u5E8F",children:(0,r.jsx)(W.Z,{min:1,decimalSeparator:"0"})}),(0,r.jsx)(t.Z.Item,{label:"\u63CF\u8FF0",name:"description",children:(0,r.jsx)(o.Z,{})}),(0,r.jsx)(t.Z.Item,{children:(0,r.jsx)(w.Z,{type:"primary",htmlType:"submit",children:"\u4FDD\u5B58"})})]})})},se=le,N=n(48971);function de(m){return J.apply(this,arguments)}function J(){return J=(0,Z.Z)((0,u.Z)().mark(function m(e){return(0,u.Z)().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.abrupt("return",(0,N.WY)("/kitchbase/api/store/page",{method:"POST",data:e}));case 1:case"end":return a.stop()}},m)})),J.apply(this,arguments)}function oe(m){return Q.apply(this,arguments)}function Q(){return Q=(0,Z.Z)((0,u.Z)().mark(function m(e){return(0,u.Z)().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.abrupt("return",(0,N.WY)("/kitchbase/api/store/add",{method:"POST",data:e}));case 1:case"end":return a.stop()}},m)})),Q.apply(this,arguments)}function ce(m){return X.apply(this,arguments)}function X(){return X=(0,Z.Z)((0,u.Z)().mark(function m(e){return(0,u.Z)().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.abrupt("return",(0,N.WY)("/kitchbase/api/store/update",{method:"POST",data:e}));case 1:case"end":return a.stop()}},m)})),X.apply(this,arguments)}function me(m){return $.apply(this,arguments)}function $(){return $=(0,Z.Z)((0,u.Z)().mark(function m(e){return(0,u.Z)().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.abrupt("return",(0,N.WY)("/kitchbase/api/store/delete",{method:"POST",data:e}));case 1:case"end":return a.stop()}},m)})),$.apply(this,arguments)}var he=n(20173),Se="message",fe=function(){var e=(0,v.useState)([]),x=(0,y.Z)(e,2),a=x[0],q=x[1];(0,v.useEffect)(function(){(0,he.FM)().then(function(c){q(c.data)})},[]);var V=(0,v.useState)(!1),K=(0,y.Z)(V,2),_=K[0],S=K[1],F=(0,v.useRef)(),O=(0,v.useState)(),P=(0,y.Z)(O,2),I=P[0],C=P[1],L=(0,v.useState)([]),R=(0,y.Z)(L,2),T=R[0],b=R[1],Y=[{title:"\u4E3B\u952E",dataIndex:"id",hideInSearch:!0,hideInTable:!0,tip:"\u89C4\u5219\u540D\u79F0\u662F\u552F\u4E00\u7684 key"},{title:"\u573A\u666F\u540D\u79F0",dataIndex:"name",ellipsis:!0},{title:"\u6240\u5C5E\u7EC4\u7EC7",dataIndex:"orgName",valueType:"treeSelect",fieldProps:{options:a,allowClear:!0},hideInSearch:!1},{title:"\u7535\u8BDD",dataIndex:"phone",search:!0},{title:"\u6392\u5E8F",dataIndex:"sort",search:!1},{title:"\u63CF\u8FF0",dataIndex:"description",search:!1},{title:"\u64CD\u4F5C",dataIndex:"option",valueType:"option",fixed:"right",width:200,render:function(s,l){return[(0,r.jsx)("a",{onClick:function(){S(!0),C(l)},children:"\u66F4\u65B0"},"update"),(0,r.jsx)(G.Z,{type:"primary",title:"\u786E\u8BA4\u5220\u9664\u5417\uFF1F",okText:"\u662F",cancelText:"\u5426",onConfirm:function(){var i=[{id:l.id}];ae(i)},onCancel:function(){},children:(0,r.jsx)("a",{href:"#",children:"\u5220\u9664"})},"primary")]}}],ge=function(){var c=(0,Z.Z)((0,u.Z)().mark(function s(l){return(0,u.Z)().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return i.next=2,oe(JSON.stringify(l)).then(function(p){p.succeeded?(f.default.success("\u6DFB\u52A0\u6210\u529F"),S(!1),C(void 0),F.current.reload()):f.default.error(p.errors)});case 2:case"end":return i.stop()}},s)}));return function(l){return c.apply(this,arguments)}}(),Ze=function(){var c=(0,Z.Z)((0,u.Z)().mark(function s(l){return(0,u.Z)().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return i.next=2,ce(JSON.stringify(l)).then(function(p){p.succeeded?(f.default.success("\u4FEE\u6539\u6210\u529F"),S(!1),C(void 0),F.current.reload()):f.default.error(p.errors)});case 2:case"end":return i.stop()}},s)}));return function(l){return c.apply(this,arguments)}}(),pe=function(){return(T==null?void 0:T.length)>0&&(0,r.jsx)(G.Z,{title:"\u786E\u8BA4\u5220\u9664\u5417?",onConfirm:ye,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",children:(0,r.jsx)(w.Z,{type:"primary",children:"\u6279\u91CF\u5220\u9664"})})},ye=function(){var s,l;ae(T),b([]),(s=F.current)===null||s===void 0||(l=s.reloadAndRest)===null||l===void 0||l.call(s)},ae=function(){var c=(0,Z.Z)((0,u.Z)().mark(function s(l){var h;return(0,u.Z)().wrap(function(p){for(;;)switch(p.prev=p.next){case 0:return h=[],l.forEach(function(j){h.push(j.id)}),p.next=4,me(h).then(function(j){if(j.succeeded){var A,ee;f.default.success("\u5220\u9664\u6210\u529F"),b([]),(A=F.current)===null||A===void 0||(ee=A.reloadAndRest)===null||ee===void 0||ee.call(A)}else f.default.error(j.errors)});case 4:case"end":return p.stop()}},s)}));return function(l){return c.apply(this,arguments)}}();return(0,r.jsxs)(H.ZP,{host:!0,header:{title:"",breadcrumb:{}},children:[(0,r.jsx)(B.ZP,{headerTitle:"\u573A\u666F\u4FE1\u606F",actionRef:F,rowKey:"id",pagination:{defaultPageSize:10},search:{labelWidth:120},toolBarRender:function(){return[(0,r.jsxs)(w.Z,{type:"primary",onClick:function(){S(!0)},children:[(0,r.jsx)(te.Z,{})," \u65B0\u5EFA"]},"primary"),(0,r.jsx)(pe,{})]},request:function(){var c=(0,Z.Z)((0,u.Z)().mark(function s(l){var h,i;return(0,u.Z)().wrap(function(j){for(;;)switch(j.prev=j.next){case 0:return h=[],i=0,j.next=4,de(l).then(function(A){h=A.data.data,i=A.data.total});case 4:return j.abrupt("return",{data:h,success:!0,total:i});case 5:case"end":return j.stop()}},s)}));return function(s){return c.apply(this,arguments)}}(),columns:Y,rowSelection:{onChange:function(s,l){b(l)}}}),(0,r.jsx)(se,{OrgList:a,onFinish:function(){var c=(0,Z.Z)((0,u.Z)().mark(function s(l){return(0,u.Z)().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:if(!l.id){i.next=5;break}return i.next=3,Ze(l);case 3:i.next=7;break;case 5:return i.next=7,ge(l);case 7:case"end":return i.stop()}},s)}));return function(s){return c.apply(this,arguments)}}(),onCancel:function(){S(!1),C(void 0)},createModalVisible:_,values:I||{}})]})},ve=fe}}]);