index.e7e20117.js 9.3 KB

1
  1. import{d as ae,V as oe,r as c,p as le,j2 as N,o as ne,c as C,e as l,f as n,g as a,h as v,i as y,F as L,j as S,H as Q,t as d,n as B,A as V,u as q,j3 as ue,k as U,m as Z,j4 as ce,j5 as re,j6 as ie,en as de,E as P,j7 as _e,R as ve,S as ge,_ as pe}from"./index.0308b213.js";const E=F=>(ve("data-v-d9ddab4d"),F=F(),ge(),F),fe={class:"body"},he={class:"left"},be=E(()=>a("div",{style:{"font-size":"20px","font-weight":"bold"}},"\u684C\u53F0\u7BA1\u7406",-1)),Ce={class:"table-area"},ye=["onClick"],ke={class:"right"},me={class:"right-top"},Fe=["onClick"],Ae={class:"status_content"},xe={class:"status_title"},Le={key:0,class:"status_count"},Se={key:1,class:"loading-dot"},Be={class:"right-bottom"},Ee={key:0,style:{height:"100%",width:"100%",display:"flex","justify-content":"center","align-items":"center","text-align":"center"}},we=E(()=>a("div",null,[a("div",null,[a("img",{src:"https://qny.wdsp666.com/\u798F\u888B\u80CC\u666F\u56FE/agent/20c11314d8c0dbd8e933d8d71acb77e.png",alt:""})]),a("div",null,"\u6CA1\u6709\u66F4\u591A\u6570\u636E\u5185\u5BB9...")],-1)),Me=[we],ze=["onClick"],De={style:{display:"flex","align-items":"center","justify-content":"space-between"}},je={class:"status-container"},Te={class:"time"},Ve={class:"content"},qe={class:"title"},Ie={key:1,class:"price"},$e={class:"footer"},Ne={class:"footer-right"},Qe=["onClick"],Ue=E(()=>a("svg",{class:"qrcode-icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},[a("path",{d:"M737.673809 863.903745 737.673809 800.13335 672.503531 800.13335 672.503531 863.949794ZM834.943157 863.949794c15.954367 0 29.006637-13.053294 29.006637-29.006637l0-34.808784-62.461587 0 0 63.769372M415.311891 223.865627l0 191.447287L223.864604 415.312914 223.864604 223.865627 415.311891 223.865627M450.120674 160.050206 189.05582 160.050206c-15.953344 0-29.006637 13.053294-29.006637 29.006637l0 261.063831c0 15.954367 13.053294 29.006637 29.006637 29.006637l261.063831 0c15.953344 0 29.006637-13.053294 29.006637-29.006637L479.126288 189.056843C479.127312 173.1035 466.074018 160.050206 450.120674 160.050206L450.120674 160.050206zM319.588759 319.589782m-31.907711 0a31.181 31.181 0 1 0 63.815421 0 31.181 31.181 0 1 0-63.815421 0ZM800.134373 223.865627l0 191.447287L608.688109 415.312914 608.688109 223.865627 800.134373 223.865627M834.943157 160.050206 573.879326 160.050206c-15.954367 0-29.006637 13.053294-29.006637 29.006637l0 261.063831c0 15.954367 13.053294 29.006637 29.006637 29.006637l261.063831 0c15.954367 0 29.006637-13.053294 29.006637-29.006637L863.949794 189.056843C863.950817 173.1035 850.897523 160.050206 834.943157 160.050206L834.943157 160.050206zM704.411241 319.589782m-31.907711 0a31.181 31.181 0 1 0 63.815421 0 31.181 31.181 0 1 0-63.815421 0ZM415.311891 608.687086l0 191.447287L223.864604 800.134373 223.864604 608.687086 415.311891 608.687086M450.120674 544.871665 189.05582 544.871665c-15.953344 0-29.006637 13.053294-29.006637 29.006637l0 261.063831c0 15.954367 13.053294 29.006637 29.006637 29.006637l261.063831 0c15.954367 0 29.006637-13.053294 29.006637-29.006637L479.126288 573.878303C479.127312 557.924959 466.074018 544.871665 450.120674 544.871665L450.120674 544.871665zM319.588759 704.410218m-31.907711 0a31.181 31.181 0 1 0 63.815421 0 31.181 31.181 0 1 0-63.815421 0ZM834.943157 544.871665l-35.579333 0 0 127.630842-63.815421 0L735.548402 544.871665 573.879326 544.871665c-15.954367 0-29.006637 13.053294-29.006637 29.006637l0 261.063831c0 15.954367 13.053294 29.006637 29.006637 29.006637l34.808784 0 0-63.815421 0-63.815421 0-63.815421 63.815421 0 0 63.815421L863.950817 736.317928l0-162.439626C863.950817 557.924959 850.897523 544.871665 834.943157 544.871665z",fill:"currentColor"})],-1)),Ze=[Ue],Pe={class:"num"},He={key:0,class:"bottom"},Re={class:"pagination"},Ge={key:1},Je={class:"imageQrcode"},Ke={key:0,class:"loading-container"},Oe=E(()=>a("div",{class:"loading-text"},"\u6B63\u5728\u52A0\u8F7D\u4E8C\u7EF4\u7801...",-1)),We=ae({setup(F){const{router:H}=oe(),p=c(!1),h=c({page:1,limit:20}),g=c([]),A=c([{id:1,title:"\u7A7A\u95F2\u4E2D",color:"#00a851",backgroundColor:"#def0ec"},{id:2,title:"\u5DF2\u5F00\u53F0",color:"#ffa500",backgroundColor:"#fff4d9"},{id:3,title:"\u5DF2\u4E0B\u5355",color:"#1e90ff",backgroundColor:"#d3e9ff"},{id:4,title:"\u5DF2\u652F\u4ED8",color:"#32cd32",backgroundColor:"#dbf4dd"},{id:-1,title:"\u6E05\u9664\u62FC\u5355",color:"#ff6347",backgroundColor:"#ffebe1"}]),w=e=>{const t=A.value.find(o=>o.id===e);return t?{title:t.title,color:t.color,backgroundColor:t.backgroundColor}:{title:"\u672A\u77E5\u72B6\u6001",color:"#deebf6",backgroundColor:"#808080"}},u=c(0),b=c([]),_=c(0);c(0);const f=c([]),M=c(0);le([_,u],()=>{p.value=!1,k()});const I=async()=>{if(!b.value||b.value.length===0||!g.value||g.value.length===0)return;p.value=!1;const e=u.value,t=_.value;try{for(const o of g.value){const r=await N({status:o.id,table_area_id:_.value,page:1,limit:1});o.num=r.count}p.value=!0,u.value=e,_.value=t,k()}catch(o){console.error("\u521D\u59CB\u5316\u72B6\u6001\u6570\u91CF\u5931\u8D25:",o),p.value=!0}},$=e=>{_.value=e.id,g.value=e.table_status,I()},z=()=>{ie({}).then(e=>{b.value=e.areas,$(b.value[0])})},R=e=>{const t=e.table_status.find(o=>o.id===1);return t?t.num:0},G=e=>{if(!f.value||f.value.length===0)return 0;const t=f.value.filter(r=>r.status===e).length;if(e===u.value)return M.value;const o=b.value.find(r=>r.id===_.value);if(o&&o.table_status){const r=o.table_status.find(T=>T.id===e);if(r)return r.num}return t},k=()=>{p.value=!1,N({status:u.value==-2?"":u.value,table_area_id:_.value==-2?"":_.value,page:h.value.page,limit:h.value.limit}).then(e=>{if(f.value=e.lists,M.value=e.count,u.value!==-2){const t=g.value.find(o=>o.id===u.value);t&&(t.num=e.count)}p.value=!0})},J=(e,t)=>{de({id:t,status:e}).then(o=>{P.success("\u5207\u6362\u6210\u529F"),z(),k()}).catch(o=>{z(),k()})},D=c(!1),j=c(""),x=c(!1),K=e=>{D.value=!0,x.value=!0,j.value="",_e(e).then(t=>{j.value=t.data,x.value=!1}).catch(t=>{P.error("\u4E8C\u7EF4\u7801\u52A0\u8F7D\u5931\u8D25"),x.value=!1})};ne(()=>{const e=setInterval(()=>{g.value&&g.value.length>0&&(clearInterval(e),I())},300)});const O=e=>{if(e===-2)return{borderColor:u.value===e?"#1e90ff":"transparent",backgroundColor:u.value===e?"rgba(30, 144, 255, 0.1)":"transparent"};const t=A.value.find(o=>o.id===e);return t?{borderColor:u.value===e?t.color:"transparent",backgroundColor:u.value===e?`${t.backgroundColor}80`:"transparent"}:{}},W=e=>{if(e===-2)return{backgroundColor:"#1e90ff"};const t=A.value.find(o=>o.id===e);return t?{backgroundColor:t.color}:{}},X=e=>{H.push({path:"/store/checkstand",query:{table_id:e.id,table_title:e.title}})};return z(),k(),(e,t)=>{const o=C("el-scrollbar"),r=C("el-icon"),T=C("el-option"),Y=C("el-select"),ee=C("el-pagination"),te=C("el-image");return l(),n("div",fe,[a("div",he,[be,a("div",Ce,[v(o,null,{default:y(()=>[(l(!0),n(L,null,S(b.value,(s,m)=>(l(),n("div",{class:Q(["table-area-btn",{"select-table-area":_.value==s.id}]),key:m,onClick:i=>$(s)},d(s.title)+"\uFF08\u7A7A\u4F4D"+d(R(s))+"\u4E2A\uFF09 ",11,ye))),128))]),_:1})])]),a("div",ke,[a("div",me,[(l(!0),n(L,null,S(g.value,(s,m)=>(l(),n("div",{class:Q(["status_btn",{select_status_btn:u.value==s.id}]),key:m,style:B(O(s.id)),onClick:i=>u.value=s.id},[a("div",{class:"status_indicator",style:B(W(s.id))},null,4),a("div",Ae,[a("span",xe,d(s.title),1),p.value?(l(),n("span",Le,"\uFF08"+d(G(s.id))+"\uFF09",1)):(l(),n("span",Se,"..."))])],14,Fe))),128))]),a("div",Be,[f.value.length<=0?(l(),n("div",Ee,Me)):V("",!0),(l(!0),n(L,null,S(f.value,(s,m)=>(l(),n("div",{class:"tableBox",key:m,onClick:i=>X(s)},[a("div",De,[a("div",je,[a("div",{class:"status",style:B({backgroundColor:w(s.status).backgroundColor,color:w(s.status).color})},d(w(s.status).title),5)]),a("div",Te,[v(r,{style:{"margin-left":"5px",width:"13px",height:"13px"}},{default:y(()=>[v(q(ue))]),_:1})])]),a("div",Ve,[a("div",qe,d(s.title),1),s.order_info?(l(),n("div",{key:0,class:"price",style:B({color:s.order_info.pay_type!=null?"":"#ff0000"})},d(s.order_id==0?"\u5F85\u4E0B\u5355":s.order_info.price),5)):(l(),n("div",Ie,d(s.order_id==0?"\u5F85\u4E0B\u5355":""),1))]),a("div",$e,[v(Y,{class:"changeStatus",type:"primary",onChange:i=>J(i,s.id),placeholder:"\u684C\u53F0\u72B6\u6001",modelValue:s.status,"onUpdate:modelValue":i=>s.status=i},{default:y(()=>[(l(!0),n(L,null,S(A.value,(i,se)=>(l(),U(T,{key:se,label:i.title,value:i.id},{default:y(()=>[Z(d(i.title),1)]),_:2},1032,["label","value"]))),128))]),_:2},1032,["onChange","modelValue","onUpdate:modelValue"]),a("div",Ne,[a("div",{class:"qrcode-btn",onClick:i=>K(s.id)},Ze,8,Qe)]),a("div",Pe,[v(r,{style:{"margin-right":"5px",width:"13px",height:"13px"}},{default:y(()=>[v(q(ce))]),_:1}),Z(d(s.guest_num),1)])])],8,ze))),128))]),f.value.length>0?(l(),n("div",He,[a("div",Re,[v(ee,{currentPage:h.value.page,"onUpdate:currentPage":t[0]||(t[0]=s=>h.value.page=s),"page-size":h.value.limit,"onUpdate:page-size":t[1]||(t[1]=s=>h.value.limit=s),"page-sizes":[10,20,30,40,50],layout:"total, sizes, prev, pager, next, jumper",total:M.value},null,8,["currentPage","page-size","total"])])])):V("",!0),D.value?(l(),n("div",Ge,[a("div",{class:"back",onClick:t[2]||(t[2]=s=>D.value=!1)}),a("div",Je,[x.value?(l(),n("div",Ke,[v(r,{class:"loading-icon",size:30},{default:y(()=>[v(q(re))]),_:1}),Oe])):(l(),U(te,{key:1,src:j.value,fit:"contain",style:{width:"100%",height:"100%"}},null,8,["src"]))])])):V("",!0)])])}}});const Ye=pe(We,[["__scopeId","data-v-d9ddab4d"]]);export{Ye as default};