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