import{_ as j,u as H,r,b as g,l as Y,c as t,h as s,e,t as d,f as c,w as u,g as m,p as Q,v as q,F,i as M,s as A,d as K,x as l,m as O,C as W,E as R,y as X,z as Z}from"./index-C_cqdhu3.js";import{e as ee,f as te,g as se}from"./pay.vue_vue_type_style_index_0_scoped_d2507c03_lang-Cip5UPp4.js";import{p as oe}from"./pay-FgwAi2HS.js";const ae={class:"my-order"},ie={class:"header-nav"},le={class:"nav-item"},ne={class:"nav-item-btn"},de={class:"header-input"},ce={class:"order-list","infinite-scroll-distance":"300","infinite-scroll-delay":"500",style:{overflow:"auto"}},re=["onClick"],_e={class:"top"},ue={class:"create-time"},ve={class:"shop"},pe={key:0,class:"left"},fe={key:0,class:"shop-name"},me={class:"right"},he={class:"money"},ye={class:"count"},ge={class:"bottom"},ke={class:"pay"},$e={key:0},be={key:0},Ce={key:1},Ve={key:2},Se={key:3},we={key:4},Pe={key:5},Le={key:6},De={key:1,style:{color:"#ff4a00"}},Ie={key:0,class:"cashier"},Ae={key:1,class:"cashier"},xe={key:0,class:"load-end"},ze={key:1,class:"load-end"},Be={__name:"order",props:{isSystem:{type:Boolean,default:!1}},setup(V){const L=H(),o=V;r([]);const $=r(1),x=k=>{v.value.page=1,S.value=!1,p.value=!1,b.value=[],n(!0)};r(null);const y=r(""),D=()=>{v.value.date=y.value.join("-"),n(!0)},v=r({page:1,limit:20,search_info:"",date:""}),p=r(!1),z=r(0),P=r(0),S=r(!1),b=r([]),n=(k=!1)=>{if(k)v.value.page=1;else if(S.value||p.value)return;o.isSystem||(v.value.staff_id=L.userInfo.service.service_id),p.value=!0,$.value==1&&(v.value.paid=null),$.value==2&&(v.value.paid=0),ee(L.userInfo.service.mer_id,v.value).then(i=>{k?b.value=i.data.list:b.value=[...b.value,...i.data.list],i.data.list.length{S.value=!0,p.value=!1})},_=(k,i)=>{P.value=i,O.emit("set-order-detail",k)};return(k,i)=>{const I=g("el-radio-button"),C=g("el-radio-group"),B=g("el-date-picker"),U=g("el-button"),f=g("el-input"),w=g("el-image"),T=Y("loading"),G=Y("infinite-scroll");return t(),s("div",ae,[e("div",ie,[e("div",le,d(V.isSystem?"平台订单":"收银订单"),1),e("div",ne,[c(C,{modelValue:$.value,"onUpdate:modelValue":i[0]||(i[0]=a=>$.value=a),onChange:x,size:"small"},{default:u(()=>[c(I,{value:1},{default:u(()=>[m("全部")]),_:1}),c(I,{value:2},{default:u(()=>[m("未支付")]),_:1})]),_:1},8,["modelValue"]),c(B,{modelValue:y.value,"onUpdate:modelValue":i[1]||(i[1]=a=>y.value=a),type:"daterange","start-placeholder":"开始时间","end-placeholder":"结束时间",size:"small","value-format":"YYYY/MM/DD",onChange:D,style:{width:"14rem","margin-left":"1rem"}},null,8,["modelValue"])])]),e("div",de,[c(f,{modelValue:v.value.search_info,"onUpdate:modelValue":i[3]||(i[3]=a=>v.value.search_info=a),placeholder:"请输入订单编号",onKeydown:i[4]||(i[4]=Q(a=>n(!0),["enter"])),onClear:i[5]||(i[5]=a=>n(!0)),clearable:""},{append:u(()=>[c(U,{type:"primary",style:{"background-color":"#1890ff",color:"#fff","border-radius":"0 5px 5px 0"},onClick:i[2]||(i[2]=a=>n(!0))},{default:u(()=>[m("搜索")]),_:1})]),_:1},8,["modelValue"])]),q((t(),s("div",ce,[(t(!0),s(F,null,M(b.value,(a,E)=>(t(),s("div",{class:A(["item",{"item-active":P.value==E}]),key:E,onClick:N=>_(a,E)},[e("div",_e,[e("div",{class:A(["sn",a.pay_type===11||a.pay_type===12||a.pay_type===13?"cahier":"cahier2"])}," 单号: "+d(a.order_sn),3),e("div",ue,d(a.create_time),1)]),e("div",ve,[a.orderProduct?(t(),s("div",pe,[(t(!0),s(F,null,M(a.orderProduct.slice(0,5),(N,J)=>(t(),K(w,{key:J,src:N.cart_info.productAttr.image||N.cart_info.product.image,class:"shop-img"},null,8,["src"]))),128)),a.orderProduct.length==1?(t(),s("div",fe,d(a.orderProduct[0].cart_info.product.store_name),1)):l("",!0)])):l("",!0),e("div",me,[e("div",he,"¥"+d(a.pay_price),1),e("div",ye,"共"+d(a.total_num)+"件商品",1)])]),e("div",ge,[e("div",ke,[a.paid?(t(),s("div",$e,[m(" 已支付 "),a.pay_type==13?(t(),s("span",be,"(支付宝收款)")):l("",!0),a.pay_type==12?(t(),s("span",Ce,"(现金支付)")):l("",!0),a.pay_type==11?(t(),s("span",Ve,"(微信收款)")):l("",!0),a.pay_type==0?(t(),s("span",Se,"(余额支付)")):l("",!0),a.pay_type==1?(t(),s("span",we,"(微信支付)")):l("",!0),a.pay_type==9?(t(),s("span",Pe,"(商户余额支付)")):l("",!0),a.pay_type==10?(t(),s("span",Le,"(对公转账)")):l("",!0)])):(t(),s("div",De,"未支付"))]),a.service_info?(t(),s("div",Ie," 收银员: "+d(a.service_info.nickname),1)):(t(),s("div",Ae,"平台订单"))])],10,re))),128)),S.value?(t(),s("div",xe,"没有更多了")):l("",!0),p.value?(t(),s("div",ze,"加载中...")):l("",!0)])),[[T,p.value],[G,n]])])}}},Tt=j(Be,[["__scopeId","data-v-1fde361d"]]),h=V=>(X("data-v-f0903720"),V=V(),Z(),V),Ue={class:"my-order"},Ee={class:"header-nav"},Ne=["onClick"],Re={class:"detail"},Ye={key:0,class:"table"},Fe={style:{"font-size":"0.9rem"}},Me={style:{color:"#ff4a00"}},Ke={style:{display:"flex","align-items":"center"}},Oe={style:{"margin-left":"0.5rem"}},Te={key:1,class:"table"},je=h(()=>e("div",{class:"table-title"},"订单信息",-1)),He={class:"table-info"},qe={class:"info-item"},Ge=h(()=>e("div",{class:"info-item-title"},"创建时间:",-1)),Je={class:"info-item-info"},Qe={class:"info-item"},We=h(()=>e("div",{class:"info-item-title"},"商品总数:",-1)),Xe={class:"info-item-info"},Ze={class:"info-item"},et=h(()=>e("div",{class:"info-item-title"},"商品总价:",-1)),tt={class:"info-item-info"},st={class:"info-item"},ot=h(()=>e("div",{class:"info-item-title"},"支付时间:",-1)),at={class:"info-item-info"},it={class:"info-item"},lt=h(()=>e("div",{class:"info-item-title"},"优惠抵扣:",-1)),nt={class:"info-item-info"},dt={class:"info-item"},ct=h(()=>e("div",{class:"info-item-title"},"实际支付:",-1)),rt={class:"info-item-info"},_t={class:"info-item"},ut=h(()=>e("div",{class:"info-item-title"},"支付方式:",-1)),vt={class:"info-item-info"},pt={key:0},ft={key:1},mt={key:2},ht={key:3},yt={key:4},gt={key:5},kt={key:6},$t={key:0,class:"table-title"},bt={key:1,class:"table-info",style:{"flex-direction":"column"}},Ct={class:"info-item"},Vt=h(()=>e("div",{class:"info-item-title"},"头像:",-1)),St={class:"info-item-info"},wt={class:"info-item"},Pt=h(()=>e("div",{class:"info-item-title"},"昵称:",-1)),Lt={class:"info-item-info"},Dt={class:"info-item"},It=h(()=>e("div",{class:"info-item-title"},"账号:",-1)),At={class:"info-item-info"},xt={key:2,class:"footer"},zt={class:"info"},Bt={class:"ser"},Ut={class:"price"},Et={key:0,class:"handle"},Nt={key:1,class:"handle"},Rt=h(()=>e("span",null,"提单前请清空购物车, 避免提单的商品与购物车商品混合, 请确保购物车内无数据后再进行提单",-1)),Yt={class:"dialog-footer"},Ft={__name:"detail",setup(V){H();const L=W(),o=r({});O.on("set-order-detail",n=>{o.value=n}),r([]);const $=r(null),x=r(!1);r(0);const y=r(0),D=r(["商品信息","订单详情"]),v=r(""),p=r(!1),z=n=>{v.value=n,p.value=!0},P=()=>{p.value=!1,te({order_sn:v.value}).then(n=>{R({message:n.message,type:"success"}),L.push({name:"home"})})},S=n=>{$.value.setRePay({price:n.pay_price,order_id:n.group_order_id}),$.value.drawer=!0},b=n=>{se({order_sn:n}).then(_=>{_.data.paid==1||_.message=="支付成功"?R({message:_.message,type:"success"}):R({message:_.message,type:"error"})}).catch(_=>{})};return(n,_)=>{const k=g("el-image"),i=g("el-table-column"),I=g("el-table"),C=g("el-button"),B=g("el-dialog"),U=Y("loading");return t(),s("div",Ue,[e("div",Ee,[(t(!0),s(F,null,M(D.value,(f,w)=>(t(),s("div",{key:w,class:A(["nav-item",{"nav-item-active":y.value==w,"nav-item-radius1":y.value==w+1,"nav-item-radius2":y.value==w-1}]),onClick:T=>y.value=w},d(f),11,Ne))),128)),e("div",{class:A(["nav-item",{"nav-item-radius2":y.value==D.value.length-1}]),style:{flex:"1"}},null,2)]),q((t(),s("div",Re,[o.value.orderProduct&&y.value==0?(t(),s("div",Ye,[e("div",Fe,[m(" 共计 "),e("span",Me,d(o.value.total_num),1),m(" 件商品 ")]),c(I,{style:{height:"calc(100vh - 100px - 14rem)"},data:o.value.orderProduct},{default:u(()=>[c(i,{prop:"cart_info.product.store_name",label:"商品信息"},{default:u(({row:f})=>[e("div",Ke,[c(k,{style:{height:"3rem",width:"3rem"},src:f.cart_info.productAttr.image||f.cart_info.product.image},null,8,["src"]),e("span",Oe,d(f.cart_info.product.store_name),1)])]),_:1}),c(i,{prop:"cart_info.productAttr.price",label:"单价",width:"150"}),c(i,{prop:"product_num",label:"数量",width:"150"}),c(i,{prop:"total_price",label:"总价",width:"150"})]),_:1},8,["data"])])):l("",!0),o.value.orderProduct&&y.value==1?(t(),s("div",Te,[je,e("div",He,[e("div",qe,[Ge,e("div",Je,d(o.value.create_time),1)]),e("div",Qe,[We,e("div",Xe,d(o.value.total_num),1)]),e("div",Ze,[et,e("div",tt,"¥"+d(o.value.total_price),1)]),e("div",st,[ot,e("div",at,d(o.value.pay_time),1)]),e("div",it,[lt,e("div",nt,"¥"+d(o.value.deduction_price),1)]),e("div",dt,[ct,e("div",rt,"¥"+d(o.value.pay_price),1)]),e("div",_t,[ut,e("div",vt,[o.value.pay_type==11?(t(),s("span",pt,"微信收款")):l("",!0),o.value.pay_type==12?(t(),s("span",ft,"现金支付")):l("",!0),o.value.pay_type==13?(t(),s("span",mt,"支付宝收款")):l("",!0),o.value.pay_type==0?(t(),s("span",ht,"余额支付")):l("",!0),o.value.pay_type==1?(t(),s("span",yt,"微信支付")):l("",!0),o.value.pay_type==9?(t(),s("span",gt,"商户余额支付")):l("",!0),o.value.pay_type==10?(t(),s("span",kt,"对公转账")):l("",!0)])])]),o.value.service_info?(t(),s("div",$t,"收银员信息")):l("",!0),o.value.service_info?(t(),s("div",bt,[e("div",Ct,[Vt,e("div",St,[c(k,{style:{height:"4rem",width:"4rem","border-radius":"50%"},src:o.value.service_info.avatar},null,8,["src"])])]),e("div",wt,[Pt,e("div",Lt,d(o.value.service_info.nickname),1)]),e("div",Dt,[It,e("div",At,d(o.value.service_info.account),1)])])):l("",!0)])):l("",!0),o.value.service_info?(t(),s("div",xt,[e("div",zt,[e("div",Bt,"收银员: "+d(o.value.service_info.nickname),1),e("div",Ut,[m(" 实付: "),e("span",null,"¥"+d(o.value.pay_price),1)])]),o.value.pay_time?(t(),s("div",Nt,"已支付")):(t(),s("div",Et,[c(C,{class:"btn",type:"primary",onClick:_[0]||(_[0]=f=>S(o.value))},{default:u(()=>[m("重新支付")]),_:1}),c(C,{class:"btn",type:"primary",onClick:_[1]||(_[1]=f=>b(o.value.order_sn))},{default:u(()=>[m("检测状态")]),_:1}),c(C,{class:"btn",type:"success",onClick:_[2]||(_[2]=f=>z(o.value.order_sn))},{default:u(()=>[m("提单")]),_:1})]))])):l("",!0)])),[[U,x.value]]),c(oe,{ref_key:"payRef",ref:$},null,512),c(B,{modelValue:p.value,"onUpdate:modelValue":_[4]||(_[4]=f=>p.value=f),title:"提示",width:"500"},{footer:u(()=>[e("div",Yt,[c(C,{onClick:_[3]||(_[3]=f=>p.value=!1)},{default:u(()=>[m("取消")]),_:1}),n.cartCount>0?(t(),K(C,{key:0,onClick:n.goHome},{default:u(()=>[m(" 前去清空购物车 ")]),_:1},8,["onClick"])):(t(),K(C,{key:1,type:"primary",onClick:P},{default:u(()=>[m(" 确认提单 ")]),_:1}))])]),default:u(()=>[Rt]),_:1},8,["modelValue"])])}}},jt=j(Ft,[["__scopeId","data-v-f0903720"]]);export{jt as d,Tt as o};