No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.

p__card__gate.e558c3c3.async.js 17 KiB

hace 1 año
1
  1. (self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[4769,1322],{41287:function(le){le.exports={table_search_item:"table_search_item___2mgJV"}},5697:function(le,re,n){"use strict";n.r(re),n.d(re,{default:function(){return Re}});var pe=n(57338),u=n(273),i=n(13062),e=n(71230),G=n(89032),b=n(15746),se=n(47673),ce=n(4107),Xe=n(57663),ge=n(71577),qe=n(43358),U=n(34041),S=n(39428),_e=n(34792),v=n(48086),I=n(3182),et=n(9715),P=n(55843),m=n(2824),d=n(67294),fe=n(78009),Te=n(49101),Ee=n(16894),Ae=n(41287),Ce=n.n(Ae),ye=n(3996),Oe=n(9669),Fe=n.n(Oe),T=n(66050),tt=n(71194),Ze=n(50146),at=n(58996),Ge=n(77933),ue=n(86582),t=n(85893),ke=function(g){var me=(0,d.useRef)(),_=(0,d.useState)(!0),E=(0,m.Z)(_,2),ee=E[0],oe=E[1],A="sendCoupon",O=(0,d.useState)(),W=(0,m.Z)(O,2),x=W[0],F=W[1],M=(0,d.useState)([]),R=(0,m.Z)(M,2),z=R[0],L=R[1],N=(0,d.useState)([]),Y=(0,m.Z)(N,2),$=Y[0],te=Y[1],V=(0,d.useState)([]),w=(0,m.Z)(V,2),H=w[0],k=w[1];(0,d.useEffect)(function(){var c=function(){var s=(0,I.Z)((0,S.Z)().mark(function o(h){return(0,S.Z)().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:T.Z.GetDicList("GateSetUp").then(function(C){var ie=C.data,B=[];C.succeeded&&ie.forEach(function(j){B.push({key:j.value,title:j.value,description:h,disabled:!1,tag:j.value})}),k(B),te(B)});case 1:case"end":return a.stop()}},o)}));return function(h){return s.apply(this,arguments)}}();c()},[]);var ae=function(s,o,h){F(s)},ne=function(s,o){L([].concat((0,ue.Z)(s),(0,ue.Z)(o)))},J=function(s,o){},D=function(){var c=(0,I.Z)((0,S.Z)().mark(function s(o,h){return(0,S.Z)().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:if(o!="right"){a.next=2;break}return a.abrupt("return");case 2:case"end":return a.stop()}},s)}));return function(o,h){return c.apply(this,arguments)}}(),Q=function(){var c=(0,I.Z)((0,S.Z)().mark(function s(o){var h;return(0,S.Z)().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:if(!(x==null||x.length<=0)){a.next=3;break}return v.default.error("\u8BF7\u9009\u62E9\u663E\u793A\u533A\u57DF"),a.abrupt("return");case 3:return v.default.loading("\u6B63\u5728\u6DFB\u52A0...",A),a.prev=4,h=[],x.forEach(function(C){h.push({Key:C,GateId:o.values.id,IsShow:!0})}),T.Z.AddGateSetUp(h).then(function(C){v.default.destroy(A),C.data?(v.default.success("\u6DFB\u52A0\u6210\u529F"),F([]),L([]),o.onCancel()):v.default.error("\u6DFB\u52A0\u5931\u8D25")}),a.abrupt("return",!0);case 11:return a.prev=11,a.t0=a.catch(4),console.log(a.t0),v.default.destroy(A),v.default.error("\u6DFB\u52A0\u8BF7\u91CD\u8BD5\uFF01"),a.abrupt("return",!1);case 17:case"end":return a.stop()}},s,null,[[4,11]])}));return function(o){return c.apply(this,arguments)}}();return(0,t.jsx)(Ze.Z,{destroyOnClose:!0,visible:g.shows,width:700,onCancel:function(){k($),g.onCancel()},onOk:function(){Q(g),g.actionRef.current.reload()},children:(0,t.jsx)(fe.ZP,{header:{title:"\u8BBE\u7F6E\u5C4F\u5E55\u663E\u793A",breadcrumb:{}},children:(0,t.jsx)(Ge.Z,{oneWay:ee,showSearch:!0,showSelectAll:!0,onSearch:D,dataSource:H,titles:["\u672A\u9009\u62E9","\u5DF2\u9009\u4E2D"],targetKeys:x,selectedKeys:z,onChange:ae,onSelectChange:ne,onScroll:J,render:function(s){return s.title},pagination:{pageSize:8},listStyle:{width:500,height:400}})})})},Be=ke,Ue=function(g){var me=(0,d.useRef)(),_=(0,d.useState)(!0),E=(0,m.Z)(_,2),ee=E[0],oe=E[1],A="setGateFood",O=(0,d.useState)(),W=(0,m.Z)(O,2),x=W[0],F=W[1],M=(0,d.useState)([]),R=(0,m.Z)(M,2),z=R[0],L=R[1],N=(0,d.useState)([]),Y=(0,m.Z)(N,2),$=Y[0],te=Y[1],V=(0,d.useState)([]),w=(0,m.Z)(V,2),H=w[0],k=w[1];(0,d.useEffect)(function(){var c=function(){var s=(0,I.Z)((0,S.Z)().mark(function o(h){return(0,S.Z)().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:T.Z.GetGoodsByMenuIdPage({current:1,pageSize:5e3}).then(function(C){var ie=C.data.data,B=[];C.succeeded&&ie.forEach(function(j){B.push({key:j.id,title:j.name,description:h,disabled:!1,tag:j.name})}),k(B),te(B)});case 1:case"end":return a.stop()}},o)}));return function(h){return s.apply(this,arguments)}}();c()},[]);var ae=function(s,o,h){F(s)},ne=function(s,o){L([].concat((0,ue.Z)(s),(0,ue.Z)(o)))},J=function(s,o){},D=function(){var c=(0,I.Z)((0,S.Z)().mark(function s(o,h){return(0,S.Z)().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:if(o!="right"){a.next=2;break}return a.abrupt("return");case 2:case"end":return a.stop()}},s)}));return function(o,h){return c.apply(this,arguments)}}(),Q=function(){var c=(0,I.Z)((0,S.Z)().mark(function s(o){var h;return(0,S.Z)().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:if(!(x==null||x.length<=0)){a.next=3;break}return v.default.error("\u8BF7\u9009\u62E9\u83DC\u54C1"),a.abrupt("return");case 3:return v.default.loading("\u6B63\u5728\u6DFB\u52A0...",A),a.prev=4,h=[],x.forEach(function(C){h.push({FoodId:C,GateId:o.values.id,FoodName:""})}),T.Z.AddGateFood(h).then(function(C){v.default.destroy(A),C.data?(v.default.success("\u6DFB\u52A0\u6210\u529F"),F([]),L([]),o.onCancel()):v.default.error("\u6DFB\u52A0\u5931\u8D25")}),a.abrupt("return",!0);case 11:return a.prev=11,a.t0=a.catch(4),console.log(a.t0),v.default.destroy(A),v.default.error("\u6DFB\u52A0\u8BF7\u91CD\u8BD5\uFF01"),a.abrupt("return",!1);case 17:case"end":return a.stop()}},s,null,[[4,11]])}));return function(o){return c.apply(this,arguments)}}();return(0,t.jsx)(Ze.Z,{destroyOnClose:!0,visible:g.shows,width:700,onCancel:function(){k($),g.onCancel()},onOk:function(){Q(g),g.actionRef.current.reload()},children:(0,t.jsx)(fe.ZP,{header:{title:"\u8BBE\u7F6E\u5C4F\u5E55\u663E\u793A\u83DC\u54C1",breadcrumb:{}},children:(0,t.jsx)(Ge.Z,{oneWay:ee,showSearch:!0,showSelectAll:!0,onSearch:D,dataSource:H,titles:["\u672A\u9009\u62E9","\u5DF2\u9009\u4E2D"],targetKeys:x,selectedKeys:z,onChange:ae,onSelectChange:ne,onScroll:J,render:function(s){return s.title},pagination:{pageSize:8},listStyle:{width:500,height:400}})})})},We=Ue,Me=function(){var g=(0,d.useRef)(),me=P.Z.useForm(),_=(0,m.Z)(me,1),E=_[0],ee=(0,d.useState)(!1),oe=(0,m.Z)(ee,2),A=oe[0],O=oe[1],W=(0,d.useState)({id:""}),x=(0,m.Z)(W,2),F=x[0],M=x[1],R=(0,d.useState)(!1),z=(0,m.Z)(R,2),L=z[0],N=z[1],Y=(0,d.useState)(!1),$=(0,m.Z)(Y,2),te=$[0],V=$[1],w=(0,d.useState)([]),H=(0,m.Z)(w,2),k=H[0],ae=H[1],ne=(0,d.useState)(""),J=(0,m.Z)(ne,2),D=J[0],Q=J[1],c=(0,d.useState)(1),s=(0,m.Z)(c,2),o=s[0],h=s[1],K=(0,d.useState)(10),a=(0,m.Z)(K,2),C=a[0],ie=a[1],B=(0,d.useState)(null),j=(0,m.Z)(B,2),X=j[0],be=j[1],Le=(0,d.useState)(""),Ie=(0,m.Z)(Le,2),he=Ie[0],Se=Ie[1],Ye={},we={placeholder:"\u8BF7\u8F93\u5165\u5927\u5C4F\u6A2A\u5E45...",MENU_CONF:{fontSize:{fontSizeList:["10px","20px","40px","60px","80px","100px","150px","180px","200px"]},uploadImage:{customUpload:function(r,l){return(0,I.Z)((0,S.Z)().mark(function p(){var y,q,Z;return(0,S.Z)().wrap(function(ve){for(;;)switch(ve.prev=ve.next){case 0:y=r.name.lastIndexOf("."),q=r.name.substr(y+1),Z=null,T.Z.GetCosRequestURL({directory:"kitchen",fileExtension:q,method:"PUT"}).then(function(de){var Je=de.allUrl,Pe=new FileReader;Pe.readAsArrayBuffer(r),Pe.onload=function(Qe){Z=Qe.target.result,Fe().put(Je,Z).then(function(je){(je.status==200||je.statusText=="OK")&&(l(de.seeUrl,de.seeUrl,de.seeUrl),v.default.success("\u4E0A\u4F20\u6210\u529F\uFF01"))})}});case 4:case"end":return ve.stop()}},p)}))()}}}};(0,d.useEffect)(function(){return function(){X!=null&&(X.destroy(),be(null))}},[X]);var De=function(r){M(r),O(!0),Se(r.remaek),E.setFieldsValue(r)},Ke=function(r){M(r),N(!0)},ze=function(r){M(r),V(!0)},Ne=function(){O(!0),X&&X.setHtml(""),Se(""),E.resetFields()},$e=function(){var f=(0,I.Z)((0,S.Z)().mark(function r(l){var p,y;return(0,S.Z)().wrap(function(Z){for(;;)switch(Z.prev=Z.next){case 0:if(!l.id){Z.next=8;break}return l.remaek=he,Z.next=4,T.Z.UpdateGateInfo(l);case 4:p=Z.sent,p.statusCode===200?(v.default.success("\u66F4\u65B0\u6863\u53E3\u6210\u529F\uFF01"),O(!1),g.current.reload()):v.default.error(p.errors||"\u66F4\u65B0\u6863\u53E3\u5931\u8D25"),Z.next=13;break;case 8:return l.remaek=he,Z.next=11,T.Z.AddGate(l);case 11:y=Z.sent,y.statusCode===200?(v.default.success("\u65B0\u589E\u6863\u53E3\u6210\u529F\uFF01"),O(!1),g.current.reload()):v.default.error(y.errors||"\u65B0\u589E\u6863\u53E3\u5931\u8D25");case 13:case"end":return Z.stop()}},r)}));return function(l){return f.apply(this,arguments)}}(),Ve=[{title:"\u6863\u53E3\u540D\u79F0",dataIndex:"name",ellipsis:!0},{title:"\u5F52\u5C5E\u95E8\u5E97",dataIndex:"storeId",render:function(r,l){var p=k.find(function(y){return y.id===l.storeId});if(p)return(0,t.jsx)("div",{children:p.store_Name})}},{title:"\u5C5E\u6027",dataIndex:"mode",valueType:"select",valueEnum:{1:{text:"\u56FA\u5B9A",status:"Success"},2:{text:"\u81EA\u7531\u8BBE\u5B9A",status:"Success"}}},{title:"\u91D1\u989D",dataIndex:"price"},{title:"\u72B6\u6001",dataIndex:"status",valueType:"select",valueEnum:{0:{text:"\u6B63\u5E38",status:"Success"},1:{text:"\u7981\u7528",status:"Error"},2:{text:"\u5220\u9664",status:"Error"}}},{title:"\u64CD\u4F5C",valueType:"option",key:"option",render:function(r,l,p,y){return[(0,t.jsx)("a",{onClick:function(){return De(l)},children:"\u66F4\u65B0"}),(0,t.jsx)("a",{onClick:function(){return ze(l)},children:"\u8BBE\u7F6E\u83DC\u54C1"}),(0,t.jsx)("a",{onClick:function(){return Ke(l)},children:"\u8BBE\u7F6E\u5C4F\u5E55\u663E\u793A"})]}}],He=function(){var f=(0,I.Z)((0,S.Z)().mark(function r(){var l;return(0,S.Z)().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:return y.next=2,T.Z.GetAllStore();case 2:l=y.sent,l.isSuccess?(ae(l.data),Q(l.data[0].id),g.current.reload()):v.default.error(l.msg||"\u83B7\u53D6\u5E97\u94FA\u5217\u8868\u5931\u8D25");case 4:case"end":return y.stop()}},r)}));return function(){return f.apply(this,arguments)}}();return(0,d.useEffect)(function(){He()},[]),(0,t.jsx)(fe.ZP,{children:(0,t.jsxs)("div",{className:Ce().member_card_container,children:[(0,t.jsx)(Ee.ZP,{columns:Ve,actionRef:g,request:(0,I.Z)((0,S.Z)().mark(function f(){var r;return(0,S.Z)().wrap(function(p){for(;;)switch(p.prev=p.next){case 0:if(!D){p.next=6;break}return p.next=3,T.Z.GetGateListByStorePage(D,o,C);case 3:if(r=p.sent,r.statusCode!==200){p.next=6;break}return p.abrupt("return",{data:r.data.data,success:!0,total:r.data.total});case 6:case"end":return p.stop()}},f)})),cardBordered:!0,editable:{type:"multiple"},rowKey:"id",search:!1,options:{setting:{listsHeight:400}},pagination:{pageSize:C,onChange:function(r){return h(r)}},dateFormatter:"string",headerTitle:"\u6863\u53E3\u7BA1\u7406",toolBarRender:function(){return[(0,t.jsxs)("div",{className:Ce().table_search_item,children:[(0,t.jsx)("div",{children:"\u5F53\u524D\u95E8\u5E97\uFF1A"}),(0,t.jsx)(U.Z,{style:{width:300},value:D,onChange:function(l){Q(l),g.current.reload()},children:k.map(function(r){return(0,t.jsx)(Option,{value:r.id,children:r.store_Name},r.id)})})]}),(0,t.jsx)(ge.Z,{icon:(0,t.jsx)(Te.Z,{}),type:"primary",onClick:Ne,children:"\u65B0\u5EFA"},"button")]}}),(0,t.jsx)(u.Z,{destroyOnClose:!0,width:"100%",title:F.id?"\u7F16\u8F91\u6863\u53E3":"\u6DFB\u52A0\u6863\u53E3",visible:A,onClose:function(){return O(!1)},children:(0,t.jsxs)(P.Z,{name:"basic",onFinish:$e,form:E,labelCol:{span:4},children:[(0,t.jsx)(P.Z.Item,{label:"id",name:"id",hidden:!0,children:(0,t.jsx)(ce.Z,{size:"large"})}),(0,t.jsxs)(e.Z,{children:[(0,t.jsx)(b.Z,{xs:12,sm:12,md:12,lg:12,xl:12,children:(0,t.jsx)(P.Z.Item,{label:"\u6863\u53E3\u540D\u79F0",name:"name",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u6863\u53E3\u540D\u79F0\uFF01"}],children:(0,t.jsx)(ce.Z,{size:"large"})})}),(0,t.jsx)(b.Z,{xs:12,sm:12,md:12,lg:12,xl:12,children:(0,t.jsx)(P.Z.Item,{label:"\u5F52\u5C5E\u95E8\u5E97",name:"storeId",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5F52\u5C5E\u95E8\u5E97\uFF01"}],children:(0,t.jsx)(U.Z,{size:"large",children:k.map(function(f){return(0,t.jsx)(U.Z.Option,{value:f.id,children:f.store_Name},f.id)})})})}),(0,t.jsx)(b.Z,{xs:12,sm:12,md:12,lg:12,xl:12,children:(0,t.jsx)(P.Z.Item,{label:"\u5C5E\u6027",name:"mode",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u9009\u62E9\u5C5E\u6027\uFF01"}],children:(0,t.jsxs)(U.Z,{size:"large",children:[(0,t.jsx)(U.Z.Option,{value:1,children:"\u56FA\u5B9A\u91D1\u989D"}),(0,t.jsx)(U.Z.Option,{value:2,children:"\u81EA\u7531\u8BBE\u5B9A"})]})})}),(0,t.jsx)(b.Z,{xs:12,sm:12,md:12,lg:12,xl:12,children:(0,t.jsx)(P.Z.Item,{noStyle:!0,shouldUpdate:function(r,l){return r.mode!==l.mode},children:function(r){var l=r.getFieldValue;return l("mode")=="1"?(0,t.jsx)(P.Z.Item,{label:"\u91D1\u989D",name:"price",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u91D1\u989D\uFF01"}],children:(0,t.jsx)(ce.Z,{size:"large"})}):null}})}),(0,t.jsx)(b.Z,{xs:12,sm:12,md:12,lg:12,xl:12,children:(0,t.jsx)(P.Z.Item,{label:"\u72B6\u6001",name:"status",children:(0,t.jsxs)(U.Z,{size:"large",defaultValue:1,children:[(0,t.jsx)(Option,{value:0,children:"\u6B63\u5E38"}),(0,t.jsx)(Option,{value:1,children:"\u7981\u7528"})]})})})]}),(0,t.jsxs)("div",{style:{border:"1px solid #ccc",zIndex:100},children:[(0,t.jsx)(ye.o,{editor:X,defaultConfig:Ye,mode:"default",style:{borderBottom:"1px solid #ccc"}}),(0,t.jsx)(ye.M,{defaultConfig:we,value:he,onCreated:be,onChange:function(r){return Se(r.getHtml())},mode:"default",style:{height:"500px",overflowY:"hidden"}})]}),(0,t.jsx)(P.Z.Item,{children:(0,t.jsx)(ge.Z,{type:"primary",htmlType:"submit",style:{marginTop:"10px"},children:"\u786E\u5B9A"})})]})}),(0,t.jsx)(Be,{shows:L,values:F,actionRef:g,onCancel:function(){N(!1)}}),(0,t.jsx)(We,{shows:te,values:F,actionRef:g,onCancel:function(){V(!1)}})]})})},Re=Me},66050:function(le,re,n){"use strict";var pe=n(11849),u=n(48971);re.Z={GetAllStore:function(){return(0,u.WY)("/kitchen/api/StoreHelper/GetAllStore",{method:"GET",headers:{TenantId:""}})},GetMemberListByPage:function(e){return(0,u.WY)("/kitchen/api/member/member-page-query",{method:"POST",data:e})},OnBindMember:function(e){return(0,u.WY)("/kitchen/api/member/member-binding-cards",{method:"POST",data:e})},GetMemberAccountCardConsRecord:function(e){return(0,u.WY)("/kitchen/api/member/member-account-amount-page",{method:"POST",data:e})},GetMemberAccountRecordTotal:function(e){return(0,u.WY)("/kitchen/api/member/member-account-record-total",{method:"POST",data:e})},AddGate:function(e){return(0,u.WY)("/kitchen/api/GateInfo/add",{method:"POST",data:e})},EnableGate:function(e){var G=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";return(0,u.WY)("/kitchen/api/GateInfo/Enable",{method:"POST",data:e,headers:{TenantId:G}})},GetGateListByStorePage:function(e,G,b){var se=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"";return(0,u.WY)("/kitchen/api/GateInfo/gatelist?StoreId=".concat(e,"&Current=").concat(G,"&PageSize=").concat(b),{method:"GET",headers:{TenantId:se}})},GetGateListByStorePageNew:function(e,G,b){var se=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"";return(0,u.WY)("/kitchen/api/one-card/gate-list?StoreId=".concat(e,"&Current=").concat(G,"&PageSize=").concat(b),{method:"GET",headers:{TenantId:se}})},GetGateListByStoreList:function(e){return(0,u.WY)("/kitchen/api/GateInfo/gatealllist?StoreId=".concat(e),{method:"GET"})},UpdateGateInfo:function(e){var G=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";return(0,u.WY)("/kitchen/api/GateInfo/Update",{method:"POST",data:e,headers:{TenantId:G}})},UpdateGateInfoNew:function(e){var G=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";return(0,u.WY)("/kitchen/api/one-card",{method:"PUT",data:e,headers:{TenantId:G}})},PayCardAdd:function(e){return(0,u.WY)("/kitchen/api/PayCard/add",{method:"POST",data:e})},PayCardEnable:function(e){return(0,u.WY)("/kitchenapi/PayCard/enable",{method:"POST",data:e})},PayCardByGateId:function(e,G,b){return(0,u.WY)("/kitchen/api/PayCard/gateList?GateId=".concat(e,"&Current=").concat(G,"&PageSize=").concat(b),{method:"GET"})},UpdatePayCardInfo:function(e){return(0,u.WY)("/kitchen/api/PayCard/update",{method:"POST",data:e})},GetCosRequestURL:function(e){return(0,u.WY)("/kitchen/api/systemconfig/GetCosRequestSignURL",{method:"POST",data:e})},GetMemberAccountPageList:function(e){return(0,u.WY)("/kitchen/api/member/member-account-page-list",{method:"POST",data:e})},UpdateMemberAccountStatus:function(e){return(0,u.WY)("/kitchen/api/member/member-account-status",{method:"POST",data:e})},GetMemberCardPageList:function(e){return(0,u.WY)("/kitchen/api/member/mmenber-card-page",{method:"POST",data:e})},AddMemberCard:function(e){return(0,u.WY)("/kitchen/api/member/mmenber-card",{method:"POST",data:e})},UpdateMemberCardState:function(e){return(0,u.WY)("/kitchen/api/member/mmenber-card-state",{method:"PUT",data:e})},GetDicList:function(e){return(0,u.WY)("/kitchen/api/dict-data/dic-list/".concat(e),{method:"Get"})},AddGateSetUp:function(e){return(0,u.WY)("/kitchen/api/GateInfo/AddGateSetUp",{method:"POST",data:e})},GetFoodList:function(e){return(0,u.WY)("/kitchen/api/dict-data/dic-list/".concat(e),{method:"Get"})},AddGateFood:function(e){return(0,u.WY)("/kitchen/api/GateInfo/AddGateFood",{method:"POST",data:e})},GetGoodsByMenuIdPage:function(e){return(0,u.WY)("/kitchen/api/FoodMenu/GetGoodsByMenuIdPage",{method:"POST",data:(0,pe.Z)({},e)})}}}}]);