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

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