|
|
|
(self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[581,7975,1322],{58709:function(ue,g,e){"use strict";e.r(g),e.d(g,{default:function(){return Q}});var o=e(2824),c=e(39428),se=e(34792),y=e(48086),F=e(3182),u=e(67294),W=e(78009),$=e(85224),G=e(16894),le=e(71194),U=e(50146),oe=e(57663),H=e(71577),ie=e(77883),Y=e(85986),de=e(9715),i=e(71257),ce=e(47673),Z=e(4107),me=e(43358),B=e(34041),t=e(85893),z=function(n){var m=B.Z.Option,j=B.Z.OptGroup;return(0,t.jsx)(U.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,t.jsxs)(i.Z,{layout:"horizontal",labelCol:{span:4},preserve:!1,initialValues:n.values,onFinish:n.onFinish,children:[(0,t.jsx)(i.Z.Item,{name:"id",hidden:!0,children:(0,t.jsx)(Z.Z,{})}),(0,t.jsx)(i.Z.Item,{name:"companyName",label:"\u4F01\u4E1A\u540D\u79F0",rules:[{required:!0,max:30}],children:(0,t.jsx)(Z.Z,{placeholder:"\u8BF7\u8F93\u5165\u4F01\u4E1A\u540D\u79F0",disabled:!0})}),(0,t.jsx)(i.Z.Item,{name:"userName",label:"\u8054\u7CFB\u4EBA",rules:[{required:!0,max:20}],children:(0,t.jsx)(Z.Z,{placeholder:"\u8BF7\u8F93\u5165\u8054\u7CFB\u4EBA",disabled:!0})}),(0,t.jsx)(i.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,t.jsx)(Z.Z,{placeholder:"\u8BF7\u8F93\u5165\u7535\u8BDD",disabled:!0})}),(0,t.jsx)(i.Z.Item,{name:"TMCDeviceNum",label:"\u8BBE\u5907\u6570\u91CF",rules:[{required:!0}],children:(0,t.jsx)(Y.Z,{step:1,min:1,max:1e3,precision:10})}),(0,t.jsx)(i.Z.Item,{children:(0,t.jsx)(H.Z,{type:"primary",htmlType:"submit",children:"\u5BA1\u6838\u901A\u8FC7"})})]})})},K=z,I=e(48971),D={companyPage:function(n){return(0,I.WY)("/kitchen/api/CompanyHelper/companypage",{method:"POST",data:n})},updateCompany:function(n){return(0,I.WY)("/kitchen/api/CompanyHelper/ApproveCompany",{method:"POST",data:n})}},J=function(){var v=(0,F.Z)((0,c.Z)().mark(function n(m){return(0,c.Z)().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.prev=0,a.next=3,D.updateCompany(m).then(function(p){if(!p.succeeded)return y.default.error(p.errors),!1;p.data?y.default.success("\u5BA1\u6838\u5B8C\u6210"):y.default.error("\u5BA1\u6838\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01")});case 3:return a.abrupt("return",!0);case 6:return a.prev=6,a.t0=a.catch(0),y.default.error("\u5BA1\u6838\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01"),a.abrupt("return",!1);case 10:case"end":return a.stop()}},n,null,[[0,6]])}));return function(m){return v.apply(this,arguments)}}(),L=function(){var n=(0,u.useState)(),m=(0,o.Z)(n,2),j=m[0],a=m[1],p=(0,u.useState)(),A=(0,o.Z)(p,2),he=A[0],ve=A[1],X=(0,u.useState)({}),T=(0,o.Z)(X,2),w=T[0],M=T[1],k=(0,u.useState)(),P=(0,o.Z)(k,2),pe=P[0],q=P[1],S=(0,u.useRef)(),_=(0,u.useState)(),R=(0,o.Z)(_,2),fe=R[0],V=R[1],ee=(0,u.useState)(),E=(0,o.Z)(ee,2),x=E[0],te=E[1],ae=(0,u.useState)(),O=(0,o.Z)(ae,2),ye=O[0],Ze=O[1],ne=(0,u.useState)(),b=(0,o.Z)(ne,2),Se=b[0],xe=b[1],re=[{title:"\u4E3B\u952E",dataIndex:"id",tip:"key",hideInSearch:!0,hideInTable:!0,render:function(s,r){return(0,t.jsx)("a",{onClick:function(){V(r),q(!0)},children:s})}},{title:"\u4F01\u4E1A\u540D\u79F0",dataIndex:"companyName"},{title:"\u8054\u7CFB\u4EBA\u59D3\u540D",dataIndex:"userName"},{title:"\u7535\u8BDD",dataIndex:"phone"},{title:"\u72B6\u6001",dataIndex:"status",hideInForm:!0,valueEnum:{0:{text:"\u5F85\u5BA1\u6838",status:"Processing"},1:{text:"\u5DF2\u5BA1\u6838",status:"Success"}}},{title:"\u64CD\u4F5C",dataIndex:"option",valueType:"option",render:function(s,r){return[r.status===0&&(0,t.jsxs)("a",{onClick:function(){a(!0),M(r)},children:[" ","\u5BA1\u6838"]})]}}];return(0,t.jsxs)(W.ZP,{children:[(0,t.jsx)(G.ZP,{headerTitle:"\u7533\u8BF7\u8BD5\u7528\u5217\u8868",actionRef:S,rowKey:"id",search:{labelWidth:120},request:function(){var d=(0,F.Z)((0,c.Z)().mark(function s(r){var l,C;return(0,c.Z)().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:return l=[],C=0,f.next=4,D.companyPage(r).then(function(N){l=N.data.data,C=N.data.total});case 4:return f.abrupt("return",{data:l,success:!0,total:C});case 5:case"end":return f.stop()}},s)}));return function(s){return d.apply(this,arguments)}}(),columns:re,rowSelection:{onChange:function(s,r){te(r)}}}),(x==null?void 0:x.length)>0&&(0,t.jsx)($.Z,{extra:(0,t.jsxs)("div",{children:["\u5DF2\u9009\u62E9"," ",(0,t.jsx)("a",{style:{fontWeight:600},children:x.length})," ","\u9879 \xA0\xA0"]})}),(0,t.jsx)(K,{onFinish:function(){var d=(0,F.Z)((0,c.Z)().mark(function s(r){var l;return(0,c.Z)().wrap(function(h){for(;;)switch(h.prev=h.next){case 0:return l=!1,h.next=3,J(r);case 3:l=h.sent,l&&(a(!1),V(void 0),S.current&&S.current.reload()),S.current.reload();case 6:case"end":return h.stop()}},s)}));return function(s){return d.apply(this,arguments)}}(),onCancel:function(){a(!1),M({})},modalVisible:j,values:w||{}})]})},Q=L}}]); |