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

  1. (self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[8024],{81629:function(ve){ve.exports={table_search_item:"table_search_item___23emW"}},46507:function(ve,me,n){"use strict";n.r(me),n.d(me,{default:function(){return $e}});var lt=n(57338),Ue=n(83107),ot=n(13062),Ee=n(71230),it=n(89032),ae=n(15746),dt=n(47673),de=n(4107),ct=n(57663),pe=n(71577),ft=n(43358),L=n(34041),ht=n(62350),Ae=n(24565),l=n(39428),vt=n(34792),S=n(48086),Z=n(3182),mt=n(9715),U=n(55843),m=n(2824),f=n(67294),ce=n(28790),we=n(49101),Te=n(16894),Oe=n(81629),Se=n.n(Oe),ge=n(3996),Be=n(9669),be=n.n(Be),De=n(11849),E=n(48971),x={GetAllStore:function(){return(0,E.WY)("/groupmeal/api/shop/alllist",{method:"GET"})},GetGateListByStorePage:function(a,W,$){var A=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"";return(0,E.WY)("/groupmeal/api/GateInfo/gatelist?StoreId=".concat(a,"&Current=").concat(W,"&PageSize=").concat($),{method:"GET",headers:{TenantId:A}})},AddGate:function(a){return(0,E.WY)("/groupmeal/api/GateInfo/add",{method:"POST",data:a})},UpdateGateInfo:function(a){var W=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";return(0,E.WY)("/groupmeal/api/GateInfo/Update",{method:"POST",data:a,headers:{TenantId:W}})},GetDicList:function(a){return(0,E.WY)("/saasbase/api/dictdata/getdiclist?typeCode="+a,{method:"Get"})},AddGateSetUp:function(a){return(0,E.WY)("/groupmeal/api/GateInfo/AddGateSetUp",{method:"POST",data:a})},GetGateSetUp:function(a){return(0,E.WY)("/groupmeal/api/GateInfo/GetGateSetUp",{method:"POST",data:a})},Del:function(a){return(0,E.WY)("/groupmeal/api/GateInfo/del?id="+a,{method:"POST"})},GetGoodsByMenuIdPage:function(a){return(0,E.WY)("/saasbase/api/FoodMenu/GetGoodsByMenuIdPage",{method:"POST",data:(0,De.Z)({},a)})},AddGateFood:function(a){return(0,E.WY)("/groupmeal/api/GateInfo/AddGateFood",{method:"POST",data:a})},GetGateFoodList:function(a){return(0,E.WY)("/groupmeal/api/GateInfo/GetGateFoodList?gateId="+a,{method:"get",data:a})}},pt=n(71194),Ze=n(50146),St=n(58996),Ge=n(77933),ue=n(86582),e=n(85893),Pe=function(a){var W=(0,f.useRef)(),$=(0,f.useState)(!0),A=(0,m.Z)($,2),ne=A[0],le=A[1],O="sendCoupon",B=(0,f.useState)(a.gateSetUp),K=(0,m.Z)(B,2),j=K[0],w=K[1],R=(0,f.useState)([]),z=(0,m.Z)(R,2),N=z[0],k=z[1],H=(0,f.useState)([]),M=(0,m.Z)(H,2),J=M[0],Q=M[1],X=(0,f.useState)([]),Y=(0,m.Z)(X,2),q=Y[0],b=Y[1];(0,f.useEffect)(function(){var i=function(){var s=(0,Z.Z)((0,l.Z)().mark(function h(g){return(0,l.Z)().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:x.GetDicList("GateSetUp").then(function(y){var D=y.data,T=[];y.succeeded&&D.forEach(function(se){T.push({key:se.value,title:se.value,description:g,disabled:!1,tag:se.value})}),b(T),Q(T)});case 1:case"end":return u.stop()}},h)}));return function(g){return s.apply(this,arguments)}}();i()},[]);var oe=function(){var i=(0,Z.Z)((0,l.Z)().mark(function s(h){var g,o;return(0,l.Z)().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:return y.next=2,x.GetGateSetUp({gateId:h});case 2:g=y.sent,o=[],g.data.forEach(function(D){o.push(D.key)}),setGateSetUp(o);case 6:case"end":return y.stop()}},s)}));return function(h){return i.apply(this,arguments)}}(),re=function(s,h,g){w(s)},_=function(s,h){k([].concat((0,ue.Z)(s),(0,ue.Z)(h)))},V=function(s,h){},ee=function(){var i=(0,Z.Z)((0,l.Z)().mark(function s(h,g){return(0,l.Z)().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:if(h!="right"){u.next=2;break}return u.abrupt("return");case 2:case"end":return u.stop()}},s)}));return function(h,g){return i.apply(this,arguments)}}(),G=function(){var i=(0,Z.Z)((0,l.Z)().mark(function s(h){var g;return(0,l.Z)().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:if(!(j==null||j.length<=0)){u.next=3;break}return S.default.error("\u8BF7\u9009\u62E9\u663E\u793A\u533A\u57DF"),u.abrupt("return");case 3:return S.default.loading("\u6B63\u5728\u6DFB\u52A0...",O),u.prev=4,g=[],j.forEach(function(y){g.push({Key:y,GateId:h.values.id,IsShow:!0})}),x.AddGateSetUp(g).then(function(y){S.default.destroy(O),y.data?(S.default.success("\u6DFB\u52A0\u6210\u529F"),w([]),k([]),h.onCancel()):S.default.error("\u6DFB\u52A0\u5931\u8D25")}),u.abrupt("return",!0);case 11:return u.prev=11,u.t0=u.catch(4),console.log(u.t0),S.default.destroy(O),S.default.error("\u6DFB\u52A0\u8BF7\u91CD\u8BD5\uFF01"),u.abrupt("return",!1);case 17:case"end":return u.stop()}},s,null,[[4,11]])}));return function(h){return i.apply(this,arguments)}}();return(0,e.jsx)(Ze.Z,{destroyOnClose:!0,visible:a.shows,width:700,onCancel:function(){b(J),w([]),a.onCancel()},onOk:function(){G(a),a.actionRef.current.reload()},children:(0,e.jsx)(ce.ZP,{header:{title:"\u8BBE\u7F6E\u5C4F\u5E55\u663E\u793A",breadcrumb:{}},children:(0,e.jsx)(Ge.Z,{oneWay:ne,showSearch:!0,showSelectAll:!0,onSearch:ee,dataSource:q,titles:["\u672A\u9009\u62E9","\u5DF2\u9009\u4E2D"],targetKeys:j,selectedKeys:N,onChange:re,onSelectChange:_,onScroll:V,render:function(s){return s.title},pagination:{pageSize:8},listStyle:{width:500,height:400}})})})},Re=Pe,ke=function(a){var W=(0,f.useRef)(),$=(0,f.useState)(!0),A=(0,m.Z)($,2),ne=A[0],le=A[1],O="setGateFood",B=(0,f.useState)(a.gateFoodSet),K=(0,m.Z)(B,2),j=K[0],w=K[1],R=(0,f.useState)([]),z=(0,m.Z)(R,2),N=z[0],k=z[1],H=(0,f.useState)([]),M=(0,m.Z)(H,2),J=M[0],Q=M[1],X=(0,f.useState)([]),Y=(0,m.Z)(X,2),q=Y[0],b=Y[1];(0,f.useEffect)(function(){var G=function(){var i=(0,Z.Z)((0,l.Z)().mark(function s(h){return(0,l.Z)().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:x.GetAllStore().then(function(u){var y=u.data,D=[];u.succeeded&&y.forEach(function(T){D.push({key:T.id,title:T.name,description:h,disabled:!1,tag:T.name})}),b(D),Q(D)});case 1:case"end":return o.stop()}},s)}));return function(h){return i.apply(this,arguments)}}();G()},[]);var oe=function(i,s,h){w(i)},re=function(i,s){k([].concat((0,ue.Z)(i),(0,ue.Z)(s)))},_=function(i,s){},V=function(){var G=(0,Z.Z)((0,l.Z)().mark(function i(s,h){return(0,l.Z)().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:if(s!="right"){o.next=2;break}return o.abrupt("return");case 2:case"end":return o.stop()}},i)}));return function(s,h){return G.apply(this,arguments)}}(),ee=function(){var G=(0,Z.Z)((0,l.Z)().mark(function i(s){var h;return(0,l.Z)().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:if(!(j==null||j.length<=0)){o.next=3;break}return S.default.error("\u8BF7\u9009\u62E9\u83DC\u54C1"),o.abrupt("return");case 3:return S.default.loading("\u6B63\u5728\u6DFB\u52A0...",O),o.prev=4,h=[],j.forEach(function(u){h.push({FoodId:u,GateId:s.values.id,FoodName:""})}),x.AddGateFood(h).then(function(u){S.default.destroy(O),u.data?(S.default.success("\u6DFB\u52A0\u6210\u529F"),w([]),k([]),s.onCancel()):S.default.error("\u6DFB\u52A0\u5931\u8D25")}),o.abrupt("return",!0);case 11:return o.prev=11,o.t0=o.catch(4),console.log(o.t0),S.default.destroy(O),S.default.error("\u6DFB\u52A0\u8BF7\u91CD\u8BD5\uFF01"),o.abrupt("return",!1);case 17:case"end":return o.stop()}},i,null,[[4,11]])}));return function(s){return G.apply(this,arguments)}}();return(0,e.jsx)(Ze.Z,{destroyOnClose:!0,visible:a.shows,width:700,onCancel:function(){b(J),a.onCancel()},onOk:function(){ee(a),a.actionRef.current.reload()},children:(0,e.jsx)(ce.ZP,{header:{title:"\u8BBE\u7F6E\u5C4F\u5E55\u663E\u793A\u83DC\u54C1",breadcrumb:{}},children:(0,e.jsx)(Ge.Z,{oneWay:ne,showSearch:!0,showSelectAll:!0,onSearch:V,dataSource:q,titles:["\u672A\u9009\u62E9","\u5DF2\u9009\u4E2D"],targetKeys:j,selectedKeys:N,onChange:oe,onSelectChange:re,onScroll:_,render:function(i){return i.title},pagination:{pageSize:8},listStyle:{width:500,height:400}})})})},Le=ke,We=function(){var a=(0,f.useRef)(),W=U.Z.useForm(),$=(0,m.Z)(W,1),A=$[0],ne=(0,f.useState)(!1),le=(0,m.Z)(ne,2),O=le[0],B=le[1],K=(0,f.useState)({}),j=(0,m.Z)(K,2),w=j[0],R=j[1],z=(0,f.useState)(!1),N=(0,m.Z)(z,2),k=N[0],H=N[1],M=(0,f.useState)(!1),J=(0,m.Z)(M,2),Q=J[0],X=J[1],Y=(0,f.useState)([]),q=(0,m.Z)(Y,2),b=q[0],oe=q[1],re=(0,f.useState)(""),_=(0,m.Z)(re,2),V=_[0],ee=_[1],G=(0,f.useState)(1),i=(0,m.Z)(G,2),s=i[0],h=i[1],g=(0,f.useState)(10),o=(0,m.Z)(g,2),u=o[0],y=o[1],D=(0,f.useState)([]),T=(0,m.Z)(D,2),se=T[0],Ke=T[1],ze=(0,f.useState)([]),ye=(0,m.Z)(ze,2),Me=ye[0],Ye=ye[1],Ve=(0,f.useState)(null),Ce=(0,m.Z)(Ve,2),te=Ce[0],xe=Ce[1],Ne=(0,f.useState)(""),Fe=(0,m.Z)(Ne,2),fe=Fe[0],he=Fe[1],He={},Je={placeholder:"\u8BF7\u8F93\u5165\u5927\u5C4F\u6A2A\u5E45...",MENU_CONF:{fontSize:{fontSizeList:["10px","20px","40px","60px","80px","100px","150px","180px","200px"]},uploadImage:{customUpload:function(t,r){return(0,Z.Z)((0,l.Z)().mark(function v(){var p,I,c;return(0,l.Z)().wrap(function(P){for(;;)switch(P.prev=P.next){case 0:p=t.name.lastIndexOf("."),I=t.name.substr(p+1),c=null,x.GetCosRequestURL({directory:"kitchen",fileExtension:I,method:"PUT"}).then(function(ie){var st=ie.allUrl,je=new FileReader;je.readAsArrayBuffer(t),je.onload=function(ut){c=ut.target.result,be().put(st,c).then(function(Ie){(Ie.status==200||Ie.statusText=="OK")&&(r(ie.seeUrl,ie.seeUrl,ie.seeUrl),S.default.success("\u4E0A\u4F20\u6210\u529F\uFF01"))})}});case 4:case"end":return P.stop()}},v)}))()}}}};(0,f.useEffect)(function(){return function(){te!=null&&(te.destroy(),xe(null))}},[te]);var Qe=function(){var d=(0,Z.Z)((0,l.Z)().mark(function t(r){var v,p;return(0,l.Z)().wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return c.next=2,x.GetGateSetUp({gateId:r});case 2:v=c.sent,p=[],v.data.forEach(function(C){p.push(C.key)}),Ke(p);case 6:case"end":return c.stop()}},t)}));return function(r){return d.apply(this,arguments)}}(),Xe=function(){var d=(0,Z.Z)((0,l.Z)().mark(function t(r){var v,p;return(0,l.Z)().wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return c.next=2,x.GetGateFoodList(r);case 2:v=c.sent,p=[],v.data.forEach(function(C){p.push(C.foodId)}),Ye(p);case 6:case"end":return c.stop()}},t)}));return function(r){return d.apply(this,arguments)}}(),qe=function(t){R(t),B(!0),he(t.remaek),A.setFieldsValue(t)},_e=function(t){R(t),H(!0)},et=function(t){R(t),X(!0)},tt=function(){B(!0),te&&te.setHtml(""),he(""),A.resetFields()},at=function(){var d=(0,Z.Z)((0,l.Z)().mark(function t(r){var v,p;return(0,l.Z)().wrap(function(c){for(;;)switch(c.prev=c.next){case 0:if(!r.id){c.next=8;break}return r.remaek=fe,c.next=4,x.UpdateGateInfo(r);case 4:v=c.sent,v.statusCode===200?(S.default.success("\u66F4\u65B0\u6863\u53E3\u6210\u529F\uFF01"),B(!1),a.current.reload()):S.default.error(v.errors||"\u66F4\u65B0\u5931\u8D25"),c.next=14;break;case 8:return r.remaek=fe,r.status=0,c.next=12,x.AddGate(r);case 12:p=c.sent,p.statusCode===200?(S.default.success("\u65B0\u589E\u6863\u53E3\u6210\u529F\uFF01"),B(!1),a.current.reload()):S.default.error(p.errors||"\u65B0\u589E\u5931\u8D25");case 14:case"end":return c.stop()}},t)}));return function(r){return d.apply(this,arguments)}}(),nt=[{title:"\u6863\u53E3\u540D\u79F0",dataIndex:"name",ellipsis:!0},{title:"\u5F52\u5C5E\u573A\u666F",dataIndex:"storeId",render:function(t,r){var v=b.find(function(p){return p.id===r.storeId});if(v)return(0,e.jsx)("div",{children:v.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:"\u505C\u7528",status:"Error"},2:{text:"\u5220\u9664",status:"Error"}}},{title:"\u64CD\u4F5C",valueType:"option",key:"option",fixed:"right",width:300,render:function(t,r,v,p){return[(0,e.jsx)("a",{onClick:function(){return qe(r)},children:"\u66F4\u65B0"}),(0,e.jsx)("a",{onClick:(0,Z.Z)((0,l.Z)().mark(function I(){return(0,l.Z)().wrap(function(C){for(;;)switch(C.prev=C.next){case 0:return C.next=2,Xe(r.id);case 2:et(r);case 3:case"end":return C.stop()}},I)})),children:"\u8BBE\u7F6E\u83DC\u54C1"}),(0,e.jsx)("a",{onClick:(0,Z.Z)((0,l.Z)().mark(function I(){return(0,l.Z)().wrap(function(C){for(;;)switch(C.prev=C.next){case 0:return C.next=2,Qe(r.id);case 2:_e(r);case 3:case"end":return C.stop()}},I)})),children:"\u8BBE\u7F6E\u5C4F\u5E55\u663E\u793A"}),(0,e.jsx)(Ae.Z,{title:"\u786E\u5B9A\u8981\u5220\u9664\u5417\uFF1F",onConfirm:(0,Z.Z)((0,l.Z)().mark(function I(){var c;return(0,l.Z)().wrap(function(P){for(;;)switch(P.prev=P.next){case 0:return P.next=2,x.Del(r.id);case 2:c=P.sent,c.data?(S.default.success("\u5220\u9664\u6210\u529F"),a.current.reload()):S.default.error("\u5220\u9664\u5931\u8D25");case 4:case"end":return P.stop()}},I)})),okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",children:(0,e.jsx)("a",{href:"#",children:"\u5220\u9664"})},"delete")]}}],rt=function(){var d=(0,Z.Z)((0,l.Z)().mark(function t(){var r;return(0,l.Z)().wrap(function(p){for(;;)switch(p.prev=p.next){case 0:return p.next=2,x.GetAllStore();case 2:r=p.sent,r.statusCode=="200"?(oe(r.data),ee(r.data[0].id),a.current.reload()):S.default.error(r.msg||"\u83B7\u53D6\u573A\u666F\u5217\u8868\u5931\u8D25");case 4:case"end":return p.stop()}},t)}));return function(){return d.apply(this,arguments)}}();return(0,f.useEffect)(function(){rt()},[]),(0,e.jsx)(ce.ZP,{header:{title:"",breadcrumb:{}},children:(0,e.jsxs)("div",{className:Se().member_card_container,children:[(0,e.jsx)(Te.ZP,{columns:nt,actionRef:a,pagination:{pageSize:u,onChange:function(t){return h(t)}},scroll:{x:1300},request:(0,Z.Z)((0,l.Z)().mark(function d(){var t;return(0,l.Z)().wrap(function(v){for(;;)switch(v.prev=v.next){case 0:if(!V){v.next=6;break}return v.next=3,x.GetGateListByStorePage(V,s,u);case 3:if(t=v.sent,t.statusCode!==200){v.next=6;break}return v.abrupt("return",{data:t.data.data,success:!0,total:t.data.total});case 6:case"end":return v.stop()}},d)})),cardBordered:!0,editable:{type:"multiple"},rowKey:"id",search:!1,options:{setting:{listsHeight:400}},dateFormatter:"string",headerTitle:"\u6863\u53E3\u7BA1\u7406",toolBarRender:function(){return[(0,e.jsxs)("div",{className:Se().table_search_item,children:[(0,e.jsx)("div",{children:"\u5F53\u524D\u573A\u666F\uFF1A"}),(0,e.jsx)(L.Z,{style:{width:300},value:V,onChange:function(r){ee(r),a.current.reload()},children:b.map(function(t){return(0,e.jsx)(Option,{value:t.id,children:t.name},t.id)})})]}),(0,e.jsx)(pe.Z,{icon:(0,e.jsx)(we.Z,{}),type:"primary",onClick:function(){R({}),tt()},children:"\u65B0\u5EFA"},"button")]}}),(0,e.jsx)(Ue.Z,{destroyOnClose:!0,width:"85%",title:w.id?"\u66F4\u65B0":"\u65B0\u589E",visible:O,onClose:function(){return B(!1)},children:(0,e.jsxs)(U.Z,{name:"basic",onFinish:at,form:A,labelCol:{span:4},children:[(0,e.jsx)(U.Z.Item,{label:"id",name:"id",hidden:!0,children:(0,e.jsx)(de.Z,{size:"large"})}),(0,e.jsxs)(Ee.Z,{children:[(0,e.jsx)(ae.Z,{xs:12,sm:12,md:12,lg:12,xl:12,children:(0,e.jsx)(U.Z.Item,{label:"\u6863\u53E3\u540D\u79F0",name:"name",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u6863\u53E3\u540D\u79F0\uFF01"}],children:(0,e.jsx)(de.Z,{size:"large"})})}),(0,e.jsx)(ae.Z,{xs:12,sm:12,md:12,lg:12,xl:12,children:(0,e.jsx)(U.Z.Item,{label:"\u5F52\u5C5E\u573A\u666F",name:"storeId",rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u5F52\u5C5E\u573A\u666F\uFF01"}],children:(0,e.jsx)(L.Z,{size:"large",children:b.map(function(d){return(0,e.jsx)(L.Z.Option,{value:d.id,children:d.name},d.id)})})})}),(0,e.jsx)(ae.Z,{xs:12,sm:12,md:12,lg:12,xl:12,children:(0,e.jsx)(U.Z.Item,{label:"\u5C5E\u6027",name:"mode",rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u5C5E\u6027\uFF01"}],children:(0,e.jsxs)(L.Z,{size:"large",children:[(0,e.jsx)(L.Z.Option,{value:1,children:"\u56FA\u5B9A\u91D1\u989D"}),(0,e.jsx)(L.Z.Option,{value:2,children:"\u81EA\u7531\u8BBE\u5B9A"})]})})}),(0,e.jsx)(ae.Z,{xs:12,sm:12,md:12,lg:12,xl:12,children:(0,e.jsx)(U.Z.Item,{noStyle:!0,shouldUpdate:function(t,r){return t.mode!==r.mode},children:function(t){var r=t.getFieldValue;return r("mode")=="1"?(0,e.jsx)(U.Z.Item,{label:"\u91D1\u989D",name:"price",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u91D1\u989D\uFF01"}],children:(0,e.jsx)(de.Z,{size:"large"})}):null}})}),(0,e.jsx)(ae.Z,{xs:12,sm:12,md:12,lg:12,xl:12,children:(0,e.jsx)(U.Z.Item,{noStyle:!0,shouldUpdate:function(t,r){return t.mode!==r.mode},children:function(t){var r=t.getFieldValue;return w.id?(0,e.jsx)(U.Z.Item,{label:"\u72B6\u6001",name:"status",children:(0,e.jsxs)(L.Z,{size:"large",defaultValue:0,children:[(0,e.jsx)(Option,{value:0,children:"\u6B63\u5E38"}),(0,e.jsx)(Option,{value:1,children:"\u505C\u7528"})]})}):null}})})]}),(0,e.jsxs)("div",{style:{border:"1px solid #ccc",zIndex:100},children:[(0,e.jsx)(ge.o,{editor:te,defaultConfig:He,mode:"default",style:{borderBottom:"1px solid #ccc"}}),(0,e.jsx)(ge.M,{defaultConfig:Je,value:fe,onCreated:xe,onChange:function(t){return he(t.getHtml())},mode:"default",style:{height:"500px",overflowY:"hidden"}})]}),(0,e.jsx)(U.Z.Item,{children:(0,e.jsx)(pe.Z,{type:"primary",htmlType:"submit",style:{marginTop:"10px"},children:"\u786E\u5B9A"})})]})}),k&&(0,e.jsx)(Re,{shows:k,values:w,actionRef:a,gateSetUp:se,onCancel:function(){H(!1)}}),Q&&(0,e.jsx)(Le,{shows:Q,values:w,actionRef:a,gateFoodSet:Me,onCancel:function(){X(!1)}})]})})},$e=We}}]);