包含后厨 团餐 门店分支
Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.
 
 
 

2 righe
14 KiB

  1. (self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[3101],{85651:function($e,T,s){"use strict";s.r(T),s.d(T,{default:function(){return Se}});var Me=s(57663),I=s(71577),b=s(2824),U=s(11849),x=s(39428),ze=s(34792),c=s(48086),R=s(3182),H=s(49101),m=s(67294),K=s(28790),J=s(16894),Le=s(71194),w=s(50146),He=s(9715),i=s(55843),Ke=s(47673),S=s(4107),Je=s(43358),P=s(34041),h=s(48971);function N(a){return(0,h.WY)("/saasbase/api/organize/getorglist")}function Q(a){return(0,h.WY)("\u200B/saasbase/api\u200B/organize/tree",{data:(0,U.Z)({},a)})}var V={GetOrg:N,gettree:Q},e=s(85893),X=function(t){var o=(0,m.useState)(),f=(0,b.Z)(o,2),r=f[0],l=f[1];return(0,m.useEffect)(function(){V.GetOrg().then(function(F){var g=[];for(var C in F.data)g.push((0,e.jsx)(P.Z.Option,{value:C,children:F.data[C]}));l(g)})},[t.values]),(0,e.jsx)(w.Z,{title:t.values.id?"\u7F16\u8F91\u7528\u6237":"\u65B0\u5EFA\u7528\u6237",width:640,visible:t.modalVisible,bodyStyle:{padding:"32px 40px 1px 48px"},footer:null,onCancel:function(){t.onCancel()},destroyOnClose:!0,children:(0,e.jsxs)(i.Z,{preserve:!1,layout:"horizontal",labelCol:{span:4},initialValues:t.values,onFinish:t.onFinish,children:[(0,e.jsx)(i.Z.Item,{name:"id",hidden:!0,children:(0,e.jsx)(S.Z,{})}),(0,e.jsx)(i.Z.Item,{name:"account",label:"\u767B\u5F55\u8D26\u6237",rules:[{required:!0,max:255}],children:(0,e.jsx)(S.Z,{placeholder:"\u8BF7\u8F93\u5165\u767B\u5F55\u8D26\u6237",disabled:!!t.values.id})}),(0,e.jsx)(i.Z.Item,{name:"name",label:"\u7528\u6237\u59D3\u540D",rules:[{required:!0,max:255}],children:(0,e.jsx)(S.Z,{placeholder:"\u8BF7\u8F93\u5165\u7528\u6237\u59D3\u540D"})}),(0,e.jsx)(i.Z.Item,{name:"phone",label:"\u7528\u6237\u624B\u673A",rules:[{required:!0,max:20,pattern:/0?(13|14|15|18|17)[0-9]{9}$/,message:"\u624B\u673A\u53F7\u683C\u5F0F\u4E0D\u6B63\u786E"}],children:(0,e.jsx)(S.Z,{placeholder:"\u8BF7\u8F93\u5165\u7528\u6237\u624B\u673A"})}),(0,e.jsx)(i.Z.Item,{name:"sysOrgId",label:"\u6240\u5C5E\u7EC4\u7EC7",rules:[{required:!0}],children:(0,e.jsx)(P.Z,{placeholder:"\u8BF7\u9009\u62E9\u6240\u5C5E\u7EC4\u7EC7",children:r})}),(0,e.jsxs)(i.Z.Item,{children:[(0,e.jsx)(I.Z,{htmlType:"button",style:{float:"right",left:10},onClick:t.onCancel,children:"\u53D6\u6D88"}),(0,e.jsx)(I.Z,{type:"primary",htmlType:"submit",style:{float:"right"},children:"\u4FDD\u5B58"})]})]})})},q=X,_=function(t){return(0,m.useEffect)(function(){console.log(t)}),(0,e.jsx)(w.Z,{title:"\u53D8\u66F4\u5BC6\u7801",width:640,visible:t.pwdVisible,bodyStyle:{padding:"32px 40px 1px 48px"},footer:null,onCancel:function(){t.onCancel()},destroyOnClose:!0,children:(0,e.jsxs)(i.Z,{layout:"vertical",preserve:!1,labelCol:{span:4},initialValues:t.values,onFinish:t.onFinish,children:[(0,e.jsx)(i.Z.Item,{name:"id",hidden:!0,children:(0,e.jsx)(S.Z,{})}),(0,e.jsx)(i.Z.Item,{name:"account",label:"\u7528\u6237\u8D26\u6237",rules:[{required:!0}],children:(0,e.jsx)(S.Z,{placeholder:"\u8BF7\u8F93\u5165\u7528\u6237\u8D26\u6237",disabled:!0})}),(0,e.jsx)(i.Z.Item,{name:"oPwd",label:"\u65E7\u5BC6\u7801",rules:[{required:!0}],children:(0,e.jsx)(S.Z.Password,{placeholder:"\u8BF7\u8F93\u5165\u65E7\u5BC6\u7801"})}),(0,e.jsx)(i.Z.Item,{name:"nPwd",label:"\u65B0\u5BC6\u7801",rules:[{required:!0}],children:(0,e.jsx)(S.Z.Password,{placeholder:"\u8BF7\u8F93\u5165\u65B0\u5BC6\u7801"})}),(0,e.jsxs)(i.Z.Item,{children:[(0,e.jsx)(I.Z,{htmlType:"button",style:{float:"right",left:10},onClick:t.onCancel,children:"\u53D6\u6D88"}),(0,e.jsx)(I.Z,{type:"primary",htmlType:"submit",style:{float:"right"},children:"\u4FDD\u5B58"})]})]})})},ee=_,te=function(t){return(0,e.jsx)(w.Z,{title:"\u89D2\u8272\u6388\u6743",width:640,visible:t.roleVisible,bodyStyle:{padding:"32px 40px 1px 48px"},footer:null,onCancel:function(){t.onCancel()},destroyOnClose:!0,children:(0,e.jsxs)(i.Z,{layout:"vertical",preserve:!1,labelCol:{span:4},initialValues:t.values,onFinish:t.onFinish,children:[(0,e.jsx)(i.Z.Item,{name:"id",hidden:!0,children:(0,e.jsx)(S.Z,{})}),(0,e.jsx)(i.Z.Item,{name:"sysUserId",hidden:!0,children:(0,e.jsx)(S.Z,{})}),(0,e.jsx)(i.Z.Item,{name:"sysRoleId",rules:[{required:!0}],label:"\u89D2\u8272\u6388\u6743",children:(0,e.jsx)(P.Z,{mode:"multiple",style:{width:"100%"},placeholder:"\u8BF7\u9009\u62E9\u89D2\u8272",children:t.selectData})}),(0,e.jsxs)(i.Z.Item,{children:[(0,e.jsx)(I.Z,{htmlType:"button",style:{float:"right",left:10},onClick:t.onCancel,children:"\u53D6\u6D88"}),(0,e.jsx)(I.Z,{type:"primary",htmlType:"submit",style:{float:"right"},children:"\u4FDD\u5B58"})]})]})})},ae=te,Ne=s(62999),ne=s(85733),re=function(t){var o=(0,m.useState)([]),f=(0,b.Z)(o,2),r=f[0],l=f[1];return(0,m.useEffect)(function(){function F(){V.gettree().then(function(g){l(g.data)})}F()},[t.values]),(0,e.jsx)(w.Z,{width:640,bodyStyle:{padding:"32px 40px 48px"},destroyOnClose:!0,title:"\u7ED9 ".concat(t.values.name," \u6388\u6743\u6570\u636E"),visible:t.updateModalVisible,footer:null,onCancel:function(){return t.onCancel()},children:(0,e.jsxs)(i.Z,{preserve:!1,labelCol:{span:4},onFinish:t.onFinish,initialValues:t.values,children:[(0,e.jsx)(i.Z.Item,{name:"orgId",label:"\u9009\u62E9\u673A\u6784",rules:[{required:!0,message:"\u9009\u62E9\u673A\u6784"}],children:(0,e.jsx)(ne.Z,{style:{width:"100%"},dropdownStyle:{maxHeight:400,overflow:"auto"},treeData:r,multiple:!0,placeholder:"\u9009\u62E9\u673A\u6784",treeDefaultExpandAll:!0})}),(0,e.jsx)(i.Z.Item,{children:(0,e.jsx)(I.Z,{type:"primary",htmlType:"submit",style:{float:"right"},children:"\u4FDD\u5B58"})})]})})},se=re;function ue(a){return(0,h.WY)("/saasbase/api/user/userpage",{method:"post",data:a})}function le(a){return(0,h.WY)("/saasbase/api/user/enable/?Id=".concat(a))}function ie(a){return(0,h.WY)("/saasbase/api/user/disable/?Id=".concat(a))}function de(a){return(0,h.WY)("/saasbase/api\u200B/user/delete",{method:"POST",data:a})}function oe(a){return(0,h.WY)("/saasbase/api\u200B/user/add",{method:"POST",data:a})}function ce(a){return(0,h.WY)("/saasbase/api\u200B/user/update",{method:"POST",data:a})}function fe(a){return(0,h.WY)("/saasbase/api/user/resetuserpwd/?Id=".concat(a))}function he(a){return(0,h.WY)("/saasbase/api/user/updatepwd",{method:"POST",data:a})}function pe(){return(0,h.WY)("/saasbase/api/roles/getrole")}function me(a){return(0,h.WY)("/saasbase/api/user/getuserrole?UserId=".concat(a))}function ve(a){return(0,h.WY)("/saasbase/api/user/adduserrole",{method:"POST",data:a})}function xe(a){return(0,h.WY)("/saasbase/api/user/updateuserrole",{method:"POST",data:a})}function ye(a){return B.apply(this,arguments)}function B(){return B=(0,R.Z)((0,x.Z)().mark(function a(t){return(0,x.Z)().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:return f.abrupt("return",(0,h.WY)("/saasbase/api/user/setandalteruserscope",{method:"post",data:t}));case 1:case"end":return f.stop()}},a)})),B.apply(this,arguments)}function Ze(a){return(0,h.WY)("\u200B/kitchen/api\u200B/sysOrg\u200B/tree",{data:(0,U.Z)({},a)})}var y={Page:ue,Enable:le,Disable:ie,RemoveUser:de,Update:ce,Add:oe,ResetPwd:fe,UpdatePwd:he,GetRoleDic:pe,GetUserRole:me,AddUserRole:ve,UpdateUserRole:xe,SetDataRole:ye,gettree:Ze},Qe=s(62255),ge=function(){var a=(0,R.Z)((0,x.Z)().mark(function t(o){return(0,x.Z)().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,r.next=3,y.Add(o).then(function(l){l.data?c.default.success("\u6DFB\u52A0\u6210\u529F"):c.default.error("\u6DFB\u52A0\u5931\u8D25,"+l.errors)});case 3:return r.abrupt("return",!0);case 6:return r.prev=6,r.t0=r.catch(0),c.default.error("\u6DFB\u52A0\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01"),r.abrupt("return",!1);case 10:case"end":return r.stop()}},t,null,[[0,6]])}));return function(o){return a.apply(this,arguments)}}(),be=function(){var a=(0,R.Z)((0,x.Z)().mark(function t(o){var f;return(0,x.Z)().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return f=c.default.loading("\u6B63\u5728\u5206\u914D\u6570\u636E\u6743\u9650"),l.prev=1,l.next=4,y.SetDataRole((0,U.Z)({},o));case 4:return f(),c.default.success("\u5206\u914D\u6570\u636E\u6743\u9650\u6210\u529F"),l.abrupt("return",!0);case 9:return l.prev=9,l.t0=l.catch(1),f(),c.default.error("\u5206\u914D\u6570\u636E\u6743\u9650\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01"),l.abrupt("return",!1);case 14:case"end":return l.stop()}},t,null,[[1,9]])}));return function(o){return a.apply(this,arguments)}}(),Ce=function(){var a=(0,R.Z)((0,x.Z)().mark(function t(o){return(0,x.Z)().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,r.next=3,y.Update(o).then(function(l){l.data?c.default.success("\u4FEE\u6539\u6210\u529F"):c.default.error("\u4FEE\u6539\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01")});case 3:return r.abrupt("return",!0);case 6:return r.prev=6,r.t0=r.catch(0),c.default.error("\u4FEE\u6539\u5931\u8D25\u8BF7\u91CD\u8BD5!"),r.abrupt("return",!1);case 10:case"end":return r.stop()}},t,null,[[0,6]])}));return function(o){return a.apply(this,arguments)}}(),Xe=null,qe="User",je=function(){var t=(0,m.useState)(),o=(0,b.Z)(t,2),f=o[0],r=o[1],l=(0,m.useState)({}),F=(0,b.Z)(l,2),g=F[0],C=F[1],Fe=(0,m.useState)(),A=(0,b.Z)(Fe,2),De=A[0],W=A[1],D=(0,m.useRef)(),Ie=(0,m.useState)(),Y=(0,b.Z)(Ie,2),_e=Y[0],et=Y[1],Re=(0,m.useState)(!1),G=(0,b.Z)(Re,2),we=G[0],O=G[1],Ee=(0,m.useState)(!1),k=(0,b.Z)(Ee,2),Ue=k[0],E=k[1],Pe=(0,m.useState)(),$=(0,b.Z)(Pe,2),Be=$[0],Oe=$[1],Te=(0,m.useState)(),M=(0,b.Z)(Te,2),Ve=M[0],Ae=M[1],We=(0,m.useState)(),z=(0,b.Z)(We,2),tt=z[0],at=z[1],Ye=function(n){Ae(n),y.GetRoleDic().then(function(u){var d=[];for(var p in u.data)d.push((0,e.jsx)(Option,{value:p,children:u.data[p]}));Oe(d),y.GetUserRole(n).then(function(Z){C(Z.data),E(!0)})})},Ge=function(n){var u=[];return u.push((0,e.jsx)("a",{disabled:n.adminType==2,style:{pointerEvents:n.adminType==2?"none":"auto"},onClick:function(){r(!0),C(n)},children:"\u4FEE\u6539"})),n.status==1&&u.push((0,e.jsx)("a",{disabled:n.adminType==2,style:{pointerEvents:n.adminType==2?"none":"auto"},onClick:function(){y.Enable(n.id).then(function(p){D.current.reload()})},children:"\u542F\u7528"})),n.status==0&&u.push((0,e.jsx)("a",{disabled:n.adminType==2,style:{pointerEvents:n.adminType==2?"none":"auto"},onClick:function(){y.Disable(n.id).then(function(p){D.current.reload()})},children:"\u7981\u7528"})),u.push((0,e.jsx)("a",{disabled:n.adminType==2,style:{pointerEvents:n.adminType==2?"none":"auto"},onClick:function(){y.RemoveUser([n.id]).then(function(p){p.data?c.default.success("\u5220\u9664\u6210\u529F"):c.default.error("\u5220\u9664\u5931\u8D25"),D.current.reload()})},children:"\u5220\u9664"})),u.push((0,e.jsx)("a",{onClick:function(){y.ResetPwd(n.id).then(function(p){p.data?c.default.success("\u91CD\u7F6E\u6210\u529F"):c.default.error("\u91CD\u7F6E\u5931\u8D25")})},children:"\u91CD\u7F6E\u5BC6\u7801"})),u.push((0,e.jsx)("a",{onClick:function(){O(!0),C(n)},children:"\u4FEE\u6539\u5BC6\u7801"})),u.push((0,e.jsx)("a",{disabled:n.adminType==2,style:{pointerEvents:n.adminType==2?"none":"auto"},onClick:function(){Ye(n.id)},children:"\u89D2\u8272\u6388\u6743"})),u},ke=[{title:"\u4E3B\u952E",dataIndex:"id",tip:"key",hideInSearch:!0,hideInTable:!0},{title:"\u7528\u6237\u59D3\u540D",dataIndex:"name"},{title:"\u767B\u5F55\u8D26\u6237",dataIndex:"account"},{title:"\u72B6\u6001",dataIndex:"status",hideInSearch:!0,valueEnum:{0:{text:"\u542F\u7528",status:"Processing"},1:{text:"\u7981\u7528",status:"Success"}}},{title:"\u662F\u5426\u5220\u9664",dataIndex:"isDeleted",hideInSearch:!0,valueEnum:{0:{text:"\u6B63\u5E38",status:"Processing"},1:{text:"\u5220\u9664",status:"Success"}}},{title:"\u521B\u5EFA\u65F6\u95F4",dataIndex:"createAt",hideInSearch:!0,sorter:!0},{title:"\u64CD\u4F5C",dataIndex:"option",valueType:"option",fixed:"right",width:350,render:function(n,u){return Ge(u)}}];return(0,e.jsxs)(K.ZP,{host:!0,header:{title:"",breadcrumb:{}},children:[(0,e.jsx)(J.ZP,{actionRef:D,rowKey:"id",pagination:{defaultPageSize:10},search:{labelWidth:120},toolBarRender:function(){return(0,e.jsxs)(I.Z,{type:"primary",onClick:function(){r(!0)},children:[(0,e.jsx)(H.Z,{})," \u65B0\u5EFA"]},"create")},request:function(){var v=(0,R.Z)((0,x.Z)().mark(function n(u){var d,p;return(0,x.Z)().wrap(function(j){for(;;)switch(j.prev=j.next){case 0:return d=[],p=0,j.next=4,y.Page(u).then(function(L){d=L.data.data,p=L.data.total});case 4:return j.abrupt("return",{data:d,success:!0,total:p});case 5:case"end":return j.stop()}},n)}));return function(n){return v.apply(this,arguments)}}(),columns:ke}),(0,e.jsx)(q,{onFinish:function(){var v=(0,R.Z)((0,x.Z)().mark(function n(u){var d;return(0,x.Z)().wrap(function(Z){for(;;)switch(Z.prev=Z.next){case 0:if(d=!1,!u.id){Z.next=7;break}return Z.next=4,Ce(u);case 4:d=Z.sent,Z.next=10;break;case 7:return Z.next=9,ge(u);case 9:d=Z.sent;case 10:d&&(r(!1),C({}),D.current&&D.current.reload()),D.current.reload();case 12:case"end":return Z.stop()}},n)}));return function(n){return v.apply(this,arguments)}}(),onCancel:function(){r(!1),C({})},modalVisible:f,values:g||{}}),(0,e.jsx)(ee,{onFinish:function(n){y.UpdatePwd(n).then(function(u){u.data?c.default.success("\u4FEE\u6539\u6210\u529F"):c.default.error("\u4FEE\u6539\u5931\u8D25"),O(!1)})},onCancel:function(){O(!1)},values:g||{},pwdVisible:we}),(0,e.jsx)(ae,{onFinish:function(n){n.id?y.UpdateUserRole(n).then(function(u){u.data?c.default.success("\u4FEE\u6539\u6210\u529F"):c.default.error("\u4FEE\u6539\u5931\u8D25"),E(!1)}):(n.sysUserId=Ve,y.AddUserRole(n).then(function(u){u.data?c.default.success("\u6DFB\u52A0\u6210\u529F"):c.default.error("\u6DFB\u52A0\u5931\u8D25"),E(!1)}))},selectData:Be,values:g,onCancel:function(){C({}),E(!1)},roleVisible:Ue}),g&&Object.keys(g).length?(0,e.jsx)(se,{onFinish:function(){var v=(0,R.Z)((0,x.Z)().mark(function n(u){var d,p;return(0,x.Z)().wrap(function(j){for(;;)switch(j.prev=j.next){case 0:return d={sysUserId:g.id,sysOrgId:u.orgId},j.next=3,be(d);case 3:p=j.sent,p&&(W(!1),C({}),D.current&&D.current.reload());case 5:case"end":return j.stop()}},n)}));return function(n){return v.apply(this,arguments)}}(),onCancel:function(){W(!1),C({})},updateModalVisible:De,values:g}):null]})},Se=je}}]);