|
- (self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[3113],{3044:function(){},27800:function(Be,F,r){"use strict";r.r(F),r.d(F,{default:function(){return k}});var Ie=r(57338),Y=r(83107),w=r(11849),Me=r(71194),H=r(50146),Fe=r(43358),l=r(34041),Oe=r(47673),O=r(4107),Pe=r(57663),b=r(71577),Ee=r(94233),P=r(51890),f=r(39428),Te=r(34792),v=r(48086),Z=r(3182),Ae=r(9715),m=r(55843),o=r(2824),c=r(67294),K=r(3044),Q=r.n(K),J=r(28790),E=r(89366),T=r(49101),A=r(16894),p=r(48971),S={GetMemberCardPageList:function(u){return(0,p.WY)("/groupmeal/api/StoredValueCard/GetMmenberCardPage",{method:"POST",data:u})},AddMemberCard:function(u){return(0,p.WY)("/groupmeal/api/StoredValueCard/AddMmenberCard",{method:"POST",data:u})},UpdateMemberCardState:function(u){return(0,p.WY)("/groupmeal/api/StoredValueCard/UpdateMmenberCardState",{method:"PUT",data:u})},GetMemberListByPage:function(u){return(0,p.WY)("/groupmeal/api/MemberInfoService/GetMemberPageQuery",{method:"POST",data:u})},OnBindMember:function(u){return(0,p.WY)("/groupmeal/api/StoredValueCard/MemberBindingCards",{method:"POST",data:u})}},e=r(85893),X=function(){var u=(0,c.useRef)(),q=m.Z.useForm(),_=(0,o.Z)(q,1),j=_[0],ee=(0,c.useState)(!1),R=(0,o.Z)(ee,2),te=R[0],C=R[1],re=(0,c.useState)({id:""}),U=(0,o.Z)(re,2),x=U[0],y=U[1],ae=(0,c.useState)(1),V=(0,o.Z)(ae,2),Re=V[0],ne=V[1],se=(0,c.useState)(10),G=(0,o.Z)(se,2),ue=G[0],Ue=G[1],de=(0,c.useState)(0),z=(0,o.Z)(de,2),Ve=z[0],Ge=z[1],le=(0,c.useState)(!1),D=(0,o.Z)(le,2),ie=D[0],B=D[1],oe=(0,c.useState)(1),L=(0,o.Z)(oe,2),ze=L[0],ce=L[1],me=(0,c.useState)(10),W=(0,o.Z)(me,2),he=W[0],De=W[1],fe=(0,c.useState)(0),$=(0,o.Z)(fe,2),Le=$[0],ve=$[1],pe=(0,c.useState)([]),N=(0,o.Z)(pe,2),I=N[0],M=N[1],Se=function(t){j.setFieldsValue(t),y(t),C(!0)},ge=function(){j.resetFields(),y({id:""}),C(!0)},Ce=function(t){B(!0),y(t),M([]),t.memberInfoId&&M([t.memberInfoId])},Ze=function(){var n=(0,Z.Z)((0,f.Z)().mark(function t(){var a;return(0,f.Z)().wrap(function(d){for(;;)switch(d.prev=d.next){case 0:if(I.length!==0){d.next=3;break}return v.default.info("\u8BF7\u9009\u62E9\u8981\u7ED1\u5B9A\u7684\u4F1A\u5458"),d.abrupt("return");case 3:return d.next=5,S.OnBindMember({memberInfoId:I[0],memberCardId:x.id});case 5:a=d.sent,a.data===!0?(v.default.success("\u7ED1\u5B9A\u6210\u529F"),u.current.reload(),B(!1)):v.default.error(a.errors||"\u7ED1\u5B9A\u5931\u8D25");case 7:case"end":return d.stop()}},t)}));return function(){return n.apply(this,arguments)}}(),We=function(t){console.log("\u5220\u9664",t)},xe=function(){var n=(0,Z.Z)((0,f.Z)().mark(function t(a){var i,d;return(0,f.Z)().wrap(function(h){for(;;)switch(h.prev=h.next){case 0:if(!a.id){h.next=7;break}return h.next=3,S.UpdateMemberCardState({id:a.id,type:a.type,state:a.state});case 3:i=h.sent,i.statusCode===200?(v.default.success("\u66F4\u65B0\u6210\u529F"),C(!1),u.current.reload()):v.default.error(i.errors||"\u66F4\u65B0\u50A8\u503C\u5361\u5931\u8D25"),h.next=11;break;case 7:return h.next=9,S.AddMemberCard({type:a.type,state:1});case 9:d=h.sent,d.statusCode===200?(v.default.success("\u6DFB\u52A0\u6210\u529F"),C(!1),u.current.reload()):v.default.error(d.errors||"\u6DFB\u52A0\u50A8\u503C\u5361\u5931\u8D25");case 11:case"end":return h.stop()}},t)}));return function(a){return n.apply(this,arguments)}}(),be=[{title:"\u5361\u53F7",dataIndex:"cardNum",ellipsis:!0},{title:"\u4F1A\u5458\u540D\u79F0",dataIndex:"memberName",ellipsis:!0,hideInSearch:!0},{title:"\u4F1A\u5458\u5934\u50CF",dataIndex:"headImgUrl",ellipsis:!0,width:100,align:"center",hideInSearch:!0,render:function(t,a){return(0,e.jsx)(P.C,{size:64,shape:"square",icon:(0,e.jsx)(E.Z,{}),src:a.headImgUrl})}},{title:"\u4F1A\u5458\u7535\u8BDD",dataIndex:"phone",ellipsis:!0,hideInSearch:!0},{title:"\u72B6\u6001",dataIndex:"state",valueType:"select",hideInSearch:!0,valueEnum:{0:{text:"\u505C\u7528",status:"Error"},1:{text:"\u6B63\u5E38",status:"Success"},2:{text:"\u6302\u5931",status:"Error"},3:{text:"\u4F5C\u5E9F",status:"Error"}}},{title:"\u7C7B\u578B",dataIndex:"type",valueType:"select",hideInSearch:!0,valueEnum:{1:{text:"\u4EBA\u8138",status:"Success"},2:{text:"\u5B9E\u4F53\u5361",status:"Success"},3:{text:"\u6307\u7EB9",status:"Success"}}},{title:"\u64CD\u4F5C",valueType:"option",key:"option",fixed:"right",width:150,render:function(t,a,i,d){return[(0,e.jsx)("a",{onClick:function(){return Se(a)},children:"\u7F16\u8F91"}),(0,e.jsx)("a",{onClick:function(){return Ce(a)},children:"\u7ED1\u5B9A\u4F1A\u5458"})]}}],je={onChange:function(t){M(t)},selectedRowKeys:I},ye=[{title:"\u4F1A\u5458\u5934\u50CF",dataIndex:"headImgUrl",ellipsis:!0,width:100,align:"center",hideInSearch:!0,render:function(t,a){return(0,e.jsx)(P.C,{size:64,shape:"square",icon:(0,e.jsx)(E.Z,{}),src:a.headImgUrl})}},{title:"\u771F\u5B9E\u59D3\u540D",dataIndex:"realName",ellipsis:!0},{title:"\u8054\u7CFB\u65B9\u5F0F",dataIndex:"phone",ellipsis:!0}];return(0,e.jsx)(J.ZP,{header:{title:"",breadcrumb:{}},children:(0,e.jsxs)("div",{className:Q().member_card_container,children:[(0,e.jsx)(A.ZP,{pagination:{pageSize:ue,onChange:function(t){return ne(t)}},scroll:{x:1300},columns:be,actionRef:u,request:function(){var n=(0,Z.Z)((0,f.Z)().mark(function t(a){var i;return(0,f.Z)().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return s.next=2,S.GetMemberCardPageList(a);case 2:return i=s.sent,s.abrupt("return",{data:i.data.data,success:!0,total:i.data.total});case 4:case"end":return s.stop()}},t)}));return function(t){return n.apply(this,arguments)}}(),cardBordered:!0,editable:{type:"multiple"},rowKey:"id",options:{setting:{listsHeight:400}},dateFormatter:"string",headerTitle:"\u50A8\u503C\u5361\u7BA1\u7406",toolBarRender:function(){return[(0,e.jsx)(b.Z,{icon:(0,e.jsx)(T.Z,{}),type:"primary",onClick:ge,children:"\u65B0\u5EFA"},"button")]}}),(0,e.jsx)(H.Z,{width:600,title:x.id?"\u7F16\u8F91\u50A8\u503C\u5361":"\u6DFB\u52A0\u50A8\u503C\u5361",visible:te,footer:!1,onCancel:function(){return C(!1)},children:(0,e.jsxs)(m.Z,{name:"basic",onFinish:xe,form:j,labelCol:{span:4},children:[(0,e.jsx)(m.Z.Item,{label:"id",name:"id",hidden:!0,children:(0,e.jsx)(O.Z,{})}),(0,e.jsx)(m.Z.Item,{label:"\u5361\u53F7",name:"cardNum",children:(0,e.jsx)(O.Z,{disabled:!0})}),(0,e.jsx)(m.Z.Item,{noStyle:!0,shouldUpdate:function(t,a){return t.mode!==a.mode},children:function(t){var a=t.getFieldValue;return x.id?(0,e.jsx)(m.Z.Item,{label:"\u72B6\u6001",name:"state",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u9009\u62E9\u72B6\u6001\uFF01"}],children:(0,e.jsxs)(l.Z,{children:[(0,e.jsx)(l.Z.Option,{value:0,children:"\u505C\u7528"}),(0,e.jsx)(l.Z.Option,{value:1,children:"\u6B63\u5E38"}),(0,e.jsx)(l.Z.Option,{disabled:!0,value:2,children:"\u6302\u5931"}),(0,e.jsx)(l.Z.Option,{value:3,children:"\u4F5C\u5E9F"})]})}):null}}),(0,e.jsx)(m.Z.Item,{noStyle:!0,shouldUpdate:function(t,a){return t.mode!==a.mode},children:function(t){var a=t.getFieldValue;return x.id?(0,e.jsx)(m.Z.Item,{label:"\u7C7B\u578B",name:"type",rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u7C7B\u578B\uFF01"}],children:(0,e.jsxs)(l.Z,{disabled:!0,children:[(0,e.jsx)(l.Z.Option,{value:1,children:"\u4EBA\u8138"}),(0,e.jsx)(l.Z.Option,{value:2,children:"\u5B9E\u4F53\u5361"}),(0,e.jsx)(l.Z.Option,{value:3,children:"\u6307\u7EB9"})]})}):(0,e.jsx)(m.Z.Item,{label:"\u7C7B\u578B",name:"type",rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u7C7B\u578B\uFF01"}],children:(0,e.jsxs)(l.Z,{children:[(0,e.jsx)(l.Z.Option,{value:1,children:"\u4EBA\u8138"}),(0,e.jsx)(l.Z.Option,{value:2,children:"\u5B9E\u4F53\u5361"}),(0,e.jsx)(l.Z.Option,{value:3,children:"\u6307\u7EB9"})]})})}}),(0,e.jsx)(m.Z.Item,{children:(0,e.jsx)(b.Z,{type:"primary",htmlType:"submit",children:"\u786E\u5B9A"})})]})}),(0,e.jsx)(Y.Z,{width:600,title:"\u7ED1\u5B9A\u4F1A\u5458",placement:"right",onClose:function(){return B(!1)},visible:ie,children:(0,e.jsx)(A.ZP,{toolBarRender:function(){return[(0,e.jsx)(b.Z,{icon:(0,e.jsx)(T.Z,{}),type:"primary",onClick:Ze,children:"\u786E\u5B9A\u7ED1\u5B9A"},"button")]},rowSelection:(0,w.Z)({type:"radio"},je),columns:ye,cardBordered:!0,request:(0,Z.Z)((0,f.Z)().mark(function n(){var t,a,i=arguments;return(0,f.Z)().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return t=i.length>0&&i[0]!==void 0?i[0]:{},s.next=3,S.GetMemberListByPage(t);case 3:if(a=s.sent,a.statusCode!==200){s.next=7;break}return ve(a.data.total),s.abrupt("return",{data:a.data.data,success:!0,total:a.data.total});case 7:case"end":return s.stop()}},n)})),rowKey:"id",search:{labelWidth:"auto"},pagination:{pageSize:he,onChange:function(t){return ce(t)}},dateFormatter:"string",headerTitle:"\u4F1A\u5458\u5217\u8868"})})]})})},k=X}}]);
|