|
- (self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[1564],{73529:function(){},26341:function(Se,B,a){"use strict";a.r(B),a.d(B,{default:function(){return ee}});var Ce=a(71194),H=a(50146),xe=a(77883),K=a(21888),je=a(47673),F=a(4107),Fe=a(57663),L=a(71577),Pe=a(43358),y=a(34041),Ie=a(62350),J=a(24565),d=a(39428),Ge=a(34792),m=a(48086),Z=a(3182),Te=a(9715),o=a(55843),f=a(2824),c=a(67294),Q=a(73529),P=a.n(Q),X=a(28790),k=a(49101),q=a(16894),h=a(48971),p={GetAllStore:function(){return(0,h.WY)("/groupmeal/api/shop/alllist",{method:"GET"})},GetGateListByStoreList:function(u){return(0,h.WY)("/groupmeal/api/GateInfo/gatealllist?StoreId=".concat(u),{method:"GET"})},PayCardAdd:function(u){return(0,h.WY)("/groupmeal/api/PayCard/add",{method:"POST",data:u})},PayCardEnable:function(u){return(0,h.WY)("/groupmeal/PayCard/enable",{method:"POST",data:u})},PayCardByGateId:function(u,I,G){return(0,h.WY)("/groupmeal/api/PayCard/gateList?GateId=".concat(u,"&Current=").concat(I,"&PageSize=").concat(G),{method:"GET"})},UpdatePayCardInfo:function(u){return(0,h.WY)("/groupmeal/api/PayCard/update",{method:"POST",data:u})},DelPayCard:function(u){return(0,h.WY)("/groupmeal/api/PayCard/del?id="+u,{method:"POST"})}},e=a(85893),_=function(){var u=(0,c.useRef)(),I=o.Z.useForm(),G=(0,f.Z)(I,1),g=G[0],te=(0,c.useState)(!1),O=(0,f.Z)(te,2),ae=O[0],S=O[1],re=(0,c.useState)({id:""}),R=(0,f.Z)(re,2),b=R[0],T=R[1],ne=(0,c.useState)([]),D=(0,f.Z)(ne,2),se=D[0],ue=D[1],le=(0,c.useState)(""),$=(0,f.Z)(le,2),ie=$[0],W=$[1],de=(0,c.useState)([]),Y=(0,f.Z)(de,2),E=Y[0],V=Y[1],oe=(0,c.useState)(""),U=(0,f.Z)(oe,2),x=U[0],A=U[1],ce=(0,c.useState)(1),z=(0,f.Z)(ce,2),fe=z[0],me=z[1],he=(0,c.useState)(10),M=(0,f.Z)(he,2),N=M[0],Ee=M[1],ve=function(t){T(t),S(!0),g.setFieldsValue(t)},pe=function(){S(!0),g.resetFields(),g.setFieldValue("sleepTime",10),g.setFieldValue("status",1)},Ae=function(t){console.log("\u5220\u9664",t)},ye=function(){var s=(0,Z.Z)((0,d.Z)().mark(function t(r){var n,i;return(0,d.Z)().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:if(!r.id){l.next=7;break}return l.next=3,p.UpdatePayCardInfo(r);case 3:n=l.sent,n.statusCode===200?(S(!1),m.default.success("\u66F4\u65B0\u6210\u529F\uFF01"),u.current.reload(),T({})):m.default.error(n.errors||"\u66F4\u65B0\u5931\u8D25"),l.next=12;break;case 7:return r.status=0,l.next=10,p.PayCardAdd(r);case 10:i=l.sent,i.statusCode===200?(S(!1),m.default.success("\u65B0\u589E\u6210\u529F\uFF01"),u.current.reload()):m.default.error(i.errors||"\u65B0\u589E\u5931\u8D25");case 12:case"end":return l.stop()}},t)}));return function(r){return s.apply(this,arguments)}}(),Ze=[{title:"\u5237\u5361\u673A\u540D\u79F0",dataIndex:"name",ellipsis:!0},{title:"\u5F53\u524D\u6863\u53E3",dataIndex:"gateId",render:function(t,r){var n=E.find(function(i){return i.id===r.gateId});return(0,e.jsx)("div",{children:n?n.name:"\u9ED8\u8BA4\u6863\u53E3"})}},{title:"\u5237\u5361\u673A\u7F16\u53F7",dataIndex:"address",ellipsis:!0},{title:"\u95F4\u9694\u65F6\u95F4",dataIndex:"sleepTime"},{title:"\u72B6\u6001",dataIndex:"status",valueType:"select",valueEnum:{0:{text:"\u6B63\u5E38",status:"Success"},1:{text:"\u505C\u7528",status:"Error"},2:{text:"\u5220\u9664",status:"Error"}}},{title:"\u64CD\u4F5C",valueType:"option",key:"option",fixed:"right",width:150,render:function(t,r,n,i){return[(0,e.jsx)("a",{onClick:function(){return ve(r)},children:"\u66F4\u65B0"}),(0,e.jsx)(J.Z,{title:"\u786E\u5B9A\u8981\u5220\u9664\u5417\uFF1F",onConfirm:(0,Z.Z)((0,d.Z)().mark(function j(){var l;return(0,d.Z)().wrap(function(C){for(;;)switch(C.prev=C.next){case 0:return C.next=2,p.DelPayCard(r.id);case 2:l=C.sent,l.data?(m.default.success("\u5220\u9664\u6210\u529F"),u.current.reload()):m.default.error("\u5220\u9664\u5931\u8D25");case 4:case"end":return C.stop()}},j)})),okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",children:(0,e.jsx)("a",{href:"#",children:"\u5220\u9664"})},"delete")]}}],ge=function(){var s=(0,Z.Z)((0,d.Z)().mark(function t(){var r;return(0,d.Z)().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return i.next=2,p.GetAllStore();case 2:r=i.sent,r.statusCode=="200"?(ue(r.data),W(r.data[0].id),w(r.data[0].id)):m.default.error(r.msg||"\u83B7\u53D6\u5E97\u94FA\u5217\u8868\u5931\u8D25");case 4:case"end":return i.stop()}},t)}));return function(){return s.apply(this,arguments)}}(),w=function(){var s=(0,Z.Z)((0,d.Z)().mark(function t(r){var n,i;return(0,d.Z)().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.next=2,p.GetGateListByStoreList(r);case 2:n=l.sent,n.statusCode===200?(n.data.length>0?(V(n.data),A(n.data[0].id)):V([]),u==null||(i=u.current)===null||i===void 0||i.reload()):m.default.error(n.error||"\u83B7\u53D6\u6863\u53E3\u5217\u8868\u5931\u8D25");case 4:case"end":return l.stop()}},t)}));return function(r){return s.apply(this,arguments)}}();return(0,c.useEffect)(function(){ge()},[]),(0,e.jsx)(X.ZP,{header:{title:"",breadcrumb:{}},children:(0,e.jsxs)("div",{className:P().member_card_container,children:[(0,e.jsx)(q.ZP,{columns:Ze,actionRef:u,pagination:{pageSize:N,onChange:function(t){return me(t)}},scroll:{x:1300},request:(0,Z.Z)((0,d.Z)().mark(function s(){var t;return(0,d.Z)().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(console.log("selectedGate",x),!x){n.next=7;break}return n.next=4,p.PayCardByGateId(x,fe,N);case 4:if(t=n.sent,t.statusCode!==200){n.next=7;break}return n.abrupt("return",{data:t.data.data,success:!0,total:t.data.total});case 7:case"end":return n.stop()}},s)})),cardBordered:!0,editable:{type:"multiple"},rowKey:"id",search:!1,options:{setting:{listsHeight:400}},dateFormatter:"string",headerTitle:"\u5237\u5361\u673A\u7BA1\u7406",toolBarRender:function(){return[(0,e.jsxs)("div",{className:P().table_search_item,children:[(0,e.jsx)("div",{children:"\u5F52\u5C5E\u573A\u666F:"}),(0,e.jsx)(y.Z,{style:{width:300},value:ie,onChange:function(r){W(r),w(r),A({})},children:se.map(function(t){return(0,e.jsx)(Option,{value:t.id,children:t.name},t.id)})})]}),(0,e.jsxs)("div",{className:P().table_search_item,children:[(0,e.jsx)("div",{children:"\u5F53\u524D\u6863\u53E3\uFF1A"}),(0,e.jsx)(y.Z,{style:{width:300},value:x,onChange:function(r){A(r),u.current.reload()},children:E.map(function(t){return(0,e.jsx)(Option,{value:t.id,children:t.name},t.id)})})]}),(0,e.jsx)(L.Z,{icon:(0,e.jsx)(k.Z,{}),type:"primary",onClick:pe,children:"\u65B0\u5EFA"},"button")]}}),(0,e.jsx)(H.Z,{width:600,title:b.id?"\u66F4\u65B0":"\u65B0\u589E",visible:ae,footer:!1,onCancel:function(){T({}),S(!1)},children:(0,e.jsxs)(o.Z,{name:"basic",onFinish:ye,form:g,labelCol:{span:4},children:[(0,e.jsx)(o.Z.Item,{label:"id",name:"id",hidden:!0,children:(0,e.jsx)(F.Z,{})}),(0,e.jsx)(o.Z.Item,{label:"\u5237\u5361\u673A\u540D\u79F0",name:"name",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5237\u5361\u673A\u540D\u79F0\uFF01"}],children:(0,e.jsx)(F.Z,{})}),(0,e.jsx)(o.Z.Item,{label:"\u5F52\u5C5E\u6863\u53E3",name:"gateId",rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u5F52\u5C5E\u6863\u53E3\uFF01"}],children:(0,e.jsx)(y.Z,{children:E.map(function(s){return(0,e.jsx)(y.Z.Option,{value:s.id,children:s.name},s.id)})})}),(0,e.jsx)(o.Z.Item,{label:"\u5237\u5361\u673A\u7F16\u53F7",name:"address",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5237\u5361\u673A\u7F16\u53F7\uFF01"},{pattern:new RegExp(/[0-9A-Fa-f]{2}/,"g"),message:"\u8BF7\u8F93\u516516\u8FDB\u5236\uFF01"}],children:(0,e.jsx)(F.Z,{})}),(0,e.jsx)(o.Z.Item,{label:"\u95F4\u9694\u65F6\u95F4",name:"sleepTime",children:(0,e.jsx)(K.Z,{min:0})}),(0,e.jsx)(o.Z.Item,{noStyle:!0,shouldUpdate:function(t,r){return t.mode!==r.mode},children:function(t){var r=t.getFieldValue;return b.id?(0,e.jsx)(o.Z.Item,{label:"\u72B6\u6001",name:"status",children:(0,e.jsxs)(y.Z,{defaultValue:0,children:[(0,e.jsx)(Option,{value:0,children:"\u6B63\u5E38"}),(0,e.jsx)(Option,{value:1,children:"\u7981\u7528"})]})}):null}}),(0,e.jsx)(o.Z.Item,{children:(0,e.jsx)(L.Z,{type:"primary",htmlType:"submit",children:"\u786E\u5B9A"})})]})})]})})},ee=_}}]);
|