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

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