Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

p__sys__company.c2b523a5.async.js 13 KiB

pirms 1 gada
1
  1. (self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[9035],{76432:function(Ee,Y,t){"use strict";t.r(Y),t.d(Y,{default:function(){return Fe}});var Ae=t(57338),ae=t(273),be=t(57663),z=t(71577),Re=t(62350),K=t(24565),y=t(2824),i=t(39428),Me=t(34792),c=t(48086),S=t(3182),ne=t(49101),v=t(67294),te=t(78009),re=t(85224),ue=t(16894),le=t(12826),Be=t(71194),L=t(50146),Te=t(77883),se=t(85986),Pe=t(9715),p=t(71257),$e=t(47673),g=t(4107),ke=t(43358),U=t(34041),a=t(85893),ie=function(n){var d=U.Z.Option,I=U.Z.OptGroup;return(0,a.jsx)(L.Z,{title:n.values.id?"\u7F16\u8F91":"\u65B0\u5EFA",width:640,visible:n.modalVisible,bodyStyle:{padding:"32px 40px 48px"},footer:null,onCancel:function(){n.onCancel()},destroyOnClose:!0,maskClosable:!1,children:(0,a.jsxs)(p.Z,{layout:"horizontal",labelCol:{span:4},preserve:!1,initialValues:n.values,onFinish:n.onFinish,children:[(0,a.jsx)(p.Z.Item,{name:"id",hidden:!0,children:(0,a.jsx)(g.Z,{})}),(0,a.jsx)(p.Z.Item,{name:"name",label:"\u4F01\u4E1A\u540D\u79F0",rules:[{required:!0,max:30}],children:(0,a.jsx)(g.Z,{placeholder:"\u8BF7\u8F93\u5165\u4F01\u4E1A\u540D\u79F0"})}),(0,a.jsx)(p.Z.Item,{name:"code",label:"\u4F01\u4E1A\u7F16\u7801",rules:[{required:!0,max:30}],children:(0,a.jsx)(g.Z,{placeholder:"\u8BF7\u8F93\u5165\u4F01\u4E1A\u7F16\u7801"})}),(0,a.jsx)(p.Z.Item,{name:"adminName",label:"\u7BA1\u7406\u5458\u59D3\u540D",rules:[{required:!0,max:20}],children:(0,a.jsx)(g.Z,{placeholder:"\u8BF7\u8F93\u5165\u7BA1\u7406\u5458\u59D3\u540D"})}),(0,a.jsx)(p.Z.Item,{name:"settlementCycles",label:"\u7ED3\u7B97\u5468\u671F",rules:[{required:!0}],children:(0,a.jsx)(se.Z,{step:1,min:1,max:100,precision:0})}),(0,a.jsx)(p.Z.Item,{name:"email",label:"\u7535\u5B50\u90AE\u4EF6",rules:[{required:!0,max:50,message:"\u8BF7\u8F93\u5165\u7535\u5B50\u90AE\u4EF6"},{pattern:/^[a-zA-Z0-9_.-]+@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)*\.[a-zA-Z0-9]{2,6}$/,message:"\u90AE\u7BB1\u683C\u5F0F\u4E0D\u6B63\u786E"}],children:(0,a.jsx)(g.Z,{placeholder:"\u7535\u5B50\u90AE\u4EF6\u662F\u767B\u5F55\u8D26\u6237",disabled:!!n.values.id})}),(0,a.jsx)(p.Z.Item,{name:"phone",label:"\u7535\u8BDD",rules:[{max:20,pattern:/0?(13|14|15|18|17)[0-9]{9}$/,message:"\u624B\u673A\u53F7\u683C\u5F0F\u4E0D\u6B63\u786E"}],children:(0,a.jsx)(g.Z,{placeholder:"\u8BF7\u8F93\u5165\u7535\u8BDD"})}),(0,a.jsx)(p.Z.Item,{name:"host",label:"\u57DF\u540D",rules:[{max:100}],children:(0,a.jsx)(g.Z,{placeholder:"\u8BF7\u8F93\u5165\u57DF\u540D"})}),(0,a.jsx)(p.Z.Item,{name:"wechatAppId",label:"\u5C0F\u7A0B\u5E8Fid",rules:[{max:100}],children:(0,a.jsx)(g.Z,{placeholder:"\u5C0F\u7A0B\u5E8Fid"})}),(0,a.jsx)(p.Z.Item,{name:"remark",label:"\u5907\u6CE8",rules:[{max:100}],children:(0,a.jsx)(g.Z,{placeholder:"\u8BF7\u8F93\u5165\u5907\u6CE8"})}),(0,a.jsx)(p.Z.Item,{children:(0,a.jsx)(z.Z,{type:"primary",htmlType:"submit",children:"\u4FDD\u5B58"})})]})})},de=ie,Ge=t(13062),oe=t(71230),Oe=t(89032),N=t(15746),Ve=t(32157),ce=t(7573),We=t(71153),me=t(60331),j=t(48971),C={companyPage:function(n){return(0,j.WY)("/kitchen/api/company/companypage",{method:"POST",data:n})},addCompany:function(n){return(0,j.WY)("/kitchen/api/company/add",{method:"POST",data:n})},updateCompany:function(n){return(0,j.WY)("/kitchen/api/company/update",{method:"PUT",data:n})},removeCompany:function(n){return(0,j.WY)("/kitchen/api/company/delete",{method:"DELETE",data:n})},Enable:function(n){return(0,j.WY)("/kitchen/api/company/enable/?Id=".concat(n),{method:"Get"})},Disable:function(n){return(0,j.WY)("/kitchen/api/company/disable/?Id=".concat(n),{method:"Get"})},addRoleMenu:function(n){return(0,j.WY)("/kitchen/api/role/addorupdatemenurole",{method:"POST",data:n})},GetMenu:function(n){return(0,j.WY)("\u200B/kitchen/api/select/menutree/?GetType=".concat(n))},GetRoleMenu:function(n){return(0,j.WY)("/kitchen/api/role/getmenurole/?RoleId=".concat(n))},menutreepage:function(n){return(0,j.WY)("/kitchen/api\u200B/menu/getmenutreepage",{method:"post",data:n})}},W=t(62255),fe=function(n){var d=(0,v.useState)(),I=(0,y.Z)(d,2),e=I[0],m=I[1],T=(0,v.useState)(),P=(0,y.Z)(T,2),$=P[0],H=P[1],k=(0,v.useState)(),b=(0,y.Z)(k,2),E=b[0],G=b[1];(0,v.useEffect)((0,S.Z)((0,i.Z)().mark(function A(){var l,R,M;return(0,i.Z)().wrap(function(D){for(;;)switch(D.prev=D.next){case 0:return l=[],W.Z.from(n.values).forEach(function(V){V.isParentMenu||l.push(V.id)}),G(l),D.next=5,C.GetMenu("ALL");case 5:R=D.sent,M=W.Z.from(R.data).toArray(),m(M);case 8:case"end":return D.stop()}},A)})),[n.modalVisible]);var O=function(){var l=[];return W.Z.from(n.values).forEach(function(R){l.push((0,a.jsx)(me.Z,{style:{width:100,margin:"Center"},color:"processing",children:R.name}))}),l},w=(0,a.jsx)(L.Z,{width:700,bodyStyle:{padding:"32px 40px 48px"},destroyOnClose:!0,title:"\u83DC\u5355\u5206\u914D",visible:n.modalVisible,onOk:function(){return n.onSubmit(E)},onCancel:function(){return n.onCancel()},maskClosable:!1,children:(0,a.jsxs)(oe.Z,{children:[(0,a.jsx)(N.Z,{span:8,children:(0,a.jsx)(ce.Z,{treeData:e,onCheck:function(l,R){G(l)},defaultExpandAll:!0,checkedKeys:E,checkable:!0})}),(0,a.jsxs)(N.Z,{span:16,children:[(0,a.jsx)("div",{children:"\u5DF2\u9009\u83DC\u5355"}),n.values==null?"":O()]})]})});return w},he=fe,ve=function(){var u=(0,S.Z)((0,i.Z)().mark(function n(d){return(0,i.Z)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,C.addCompany(d).then(function(m){if(!m.succeeded)return c.default.error(m.errors),!1;m.data?c.default.success("\u6DFB\u52A0\u6210\u529F"):c.default.error("\u6DFB\u52A0\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01")});case 3:return e.abrupt("return",!0);case 6:return e.prev=6,e.t0=e.catch(0),c.default.error("\u6DFB\u52A0\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01"),e.abrupt("return",!1);case 10:case"end":return e.stop()}},n,null,[[0,6]])}));return function(d){return u.apply(this,arguments)}}(),pe=function(){var u=(0,S.Z)((0,i.Z)().mark(function n(d){return(0,i.Z)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,C.updateCompany(d).then(function(m){if(!m.succeeded)return c.default.error(m.errors),!1;m.data?c.default.success("\u914D\u7F6E\u6210\u529F"):c.default.error("\u914D\u7F6E\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01")});case 3:return e.abrupt("return",!0);case 6:return e.prev=6,e.t0=e.catch(0),c.default.error("\u914D\u7F6E\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01"),e.abrupt("return",!1);case 10:case"end":return e.stop()}},n,null,[[0,6]])}));return function(d){return u.apply(this,arguments)}}(),Ze=function(){var u=(0,S.Z)((0,i.Z)().mark(function n(d){return(0,i.Z)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(d){e.next=2;break}return e.abrupt("return",!0);case 2:return e.prev=2,e.next=5,C.removeCompany(d.map(function(m){return m.id})).then(function(m){if(m)return c.default.success("\u5220\u9664\u6210\u529F\uFF0C\u5373\u5C06\u5237\u65B0"),!0;c.default.error("\u5220\u9664\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5")});case 5:return e.abrupt("return",!0);case 8:return e.prev=8,e.t0=e.catch(2),c.default.error("\u5220\u9664\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5"),e.abrupt("return",!1);case 12:case"end":return e.stop()}},n,null,[[2,8]])}));return function(d){return u.apply(this,arguments)}}(),ye=function(){var u=(0,S.Z)((0,i.Z)().mark(function n(d){return(0,i.Z)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,C.addRoleMenu(d).then(function(m){m.data?c.default.success("\u6388\u6743\u6210\u529F"):c.default.error("\u6388\u6743\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01")});case 3:return e.abrupt("return",!0);case 6:return e.prev=6,e.t0=e.catch(0),c.default.error("\u6388\u6743\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01"),e.abrupt("return",!1);case 10:case"end":return e.stop()}},n,null,[[0,6]])}));return function(d){return u.apply(this,arguments)}}(),Ce=function(){var n=(0,v.useState)(),d=(0,y.Z)(n,2),I=d[0],e=d[1],m=(0,v.useState)(),T=(0,y.Z)(m,2),P=T[0],$=T[1],H=(0,v.useState)({}),k=(0,y.Z)(H,2),b=k[0],E=k[1],G=(0,v.useState)(),O=(0,y.Z)(G,2),w=O[0],A=O[1],l=(0,v.useRef)(),R=(0,v.useState)(),M=(0,y.Z)(R,2),F=M[0],D=M[1],V=(0,v.useState)(),J=(0,y.Z)(V,2),B=J[0],Q=J[1],xe=(0,v.useState)(),X=(0,y.Z)(xe,2),je=X[0],Se=X[1],ge=(0,v.useState)(),q=(0,y.Z)(ge,2),Ie=q[0],De=q[1];(0,v.useEffect)(function(){C.GetMenu().then(function(o){Se(o.data.data)})},[]);var _=[{title:"\u4E3B\u952E",dataIndex:"id",tip:"key",hideInSearch:!0,hideInTable:!0,render:function(s,r){return(0,a.jsx)("a",{onClick:function(){D(r),A(!0)},children:s})}},{title:"\u4F01\u4E1A\u540D\u79F0",dataIndex:"name"},{title:"\u7BA1\u7406\u5458\u59D3\u540D",dataIndex:"adminName"},{title:"\u7535\u5B50\u90AE\u4EF6",dataIndex:"email"},{title:"\u7ED3\u7B97\u5468\u671F",dataIndex:"settlementCycles",hideInSearch:!0},{title:"\u7535\u8BDD",dataIndex:"phone"},{title:"\u5C0F\u7A0B\u5E8Fid",dataIndex:"wechatAppId",hideInSearch:!0},{title:"\u5907\u6CE8",dataIndex:"remark",hideInSearch:!0},{title:"\u72B6\u6001",dataIndex:"status",hideInForm:!0,valueEnum:{0:{text:"\u542F\u7528",status:"Processing"},1:{text:"\u7981\u7528",status:"Success"}}},{title:"\u521B\u5EFA\u65F6\u95F4",dataIndex:"createAt",valueType:"date",hideInForm:!0},{title:"\u64CD\u4F5C",dataIndex:"option",valueType:"option",render:function(s,r){var h=[(0,a.jsxs)("a",{onClick:function(){e(!0),E(r)},children:[" ","\u66F4\u65B0"]}),(0,a.jsxs)("a",{onClick:function(){C.GetRoleMenu(r.sysRoleId).then(function(f){De(f.data),$(!0)}),E(r)},children:[" ","\u4F01\u4E1A\u83DC\u5355\u6388\u6743"]}),(0,a.jsx)(K.Z,{type:"primary",title:"\u786E\u8BA4\u5220\u9664\u5417\uFF1F",okText:"\u662F",cancelText:"\u5426",onConfirm:function(){C.removeCompany([r.id]).then(function(f){c.default.success("\u5220\u9664\u6210\u529F\uFF0C\u5373\u5C06\u5237\u65B0"),l.current.reload()})},onCancel:function(){},children:(0,a.jsx)("a",{href:"#",children:"\u5220\u9664"})},"primary")];return h.push((0,a.jsxs)("a",{onClick:function(){r.status==1?C.Enable(r.id).then(function(f){c.default.success("\u542F\u7528\u6210\u529F\uFF0C\u5373\u5C06\u5237\u65B0"),l.current.reload()}):C.Disable(r.id).then(function(f){c.default.success("\u7981\u7528\u6210\u529F\uFF0C\u5373\u5C06\u5237\u65B0"),l.current.reload()})},children:[" ",r.status==0?"\u7981\u7528":"\u542F\u7528"]},"primary")),h}}];return(0,a.jsxs)(te.ZP,{children:[(0,a.jsx)(ue.ZP,{headerTitle:"\u4F01\u4E1A\u4FE1\u606F\u5217\u8868",actionRef:l,rowKey:"id",search:{labelWidth:120},toolBarRender:function(){return[(0,a.jsxs)(z.Z,{type:"primary",onClick:function(){e(!0)},children:[(0,a.jsx)(ne.Z,{})," \u65B0\u5EFA"]},"primary")]},request:function(){var o=(0,S.Z)((0,i.Z)().mark(function s(r){var h,Z;return(0,i.Z)().wrap(function(x){for(;;)switch(x.prev=x.next){case 0:return h=[],Z=0,x.next=4,C.companyPage(r).then(function(ee){h=ee.data.data,Z=ee.data.total});case 4:return x.abrupt("return",{data:h,success:!0,total:Z});case 5:case"end":return x.stop()}},s)}));return function(s){return o.apply(this,arguments)}}(),columns:_,rowSelection:{onChange:function(s,r){Q(r)}}}),(B==null?void 0:B.length)>0&&(0,a.jsx)(re.Z,{extra:(0,a.jsxs)("div",{children:["\u5DF2\u9009\u62E9"," ",(0,a.jsx)("a",{style:{fontWeight:600},children:B.length})," ","\u9879 \xA0\xA0"]}),children:(0,a.jsx)(K.Z,{type:"primary",title:"\u786E\u8BA4\u5220\u9664\u5417\uFF1F",okText:"\u662F",cancelText:"\u5426",onConfirm:function(){var s,r;Ze(B),Q([]),(s=l.current)===null||s===void 0||(r=s.reloadAndRest)===null||r===void 0||r.call(s)},onCancel:function(){},children:(0,a.jsx)("a",{href:"#",children:"\u6279\u91CF\u5220\u9664"})},"primary")}),(0,a.jsx)(de,{onFinish:function(){var o=(0,S.Z)((0,i.Z)().mark(function s(r){var h;return(0,i.Z)().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:if(h=!1,!r.id){f.next=7;break}return f.next=4,pe(r);case 4:h=f.sent,f.next=10;break;case 7:return f.next=9,ve(r);case 9:h=f.sent;case 10:h&&(e(!1),D(void 0),l.current&&l.current.reload()),l.current.reload();case 12:case"end":return f.stop()}},s)}));return function(s){return o.apply(this,arguments)}}(),onCancel:function(){e(!1),E({})},modalVisible:I,values:b||{}}),b&&Object.keys(b).length?(0,a.jsx)(he,{treeData:je,onSubmit:function(){var o=(0,S.Z)((0,i.Z)().mark(function s(r){var h,Z;return(0,i.Z)().wrap(function(x){for(;;)switch(x.prev=x.next){case 0:return h={sysRoleId:b.sysRoleId,sysMenuId:r},x.next=3,ye(h);case 3:Z=x.sent,Z&&($(!1),E({}),l.current&&l.current.reload());case 5:case"end":return x.stop()}},s)}));return function(s){return o.apply(this,arguments)}}(),onCancel:function(){$(!1),E({})},modalVisible:P,values:Ie||{}}):null,(0,a.jsx)(ae.Z,{width:600,visible:w,onClose:function(){D(void 0),A(!1)},closable:!1,children:(F==null?void 0:F.name)&&(0,a.jsx)(le.ZP,{column:2,title:F==null?void 0:F.name,request:(0,S.Z)((0,i.Z)().mark(function o(){return(0,i.Z)().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",{data:F||{}});case 1:case"end":return r.stop()}},o)})),params:{id:F==null?void 0:F.name},columns:_})})]})},Fe=Ce}}]);