import{_ as W,u as X,r as d,o as Z,m as V,a as ee,b as r,h as R,c as s,k as o,e,f as n,w as u,g,d as M,p,i as ie,j as q,F as j,l as Q,z as G,t as l,q as te,s as se,I as ae,E as H}from"./index-Coi1SeOG.js";import{d as le,e as ne,f as de,g as _e}from"./store-aHlc-Kl5.js";import{h as J}from"./moment-Cl4UOzQZ.js";import{p as ce}from"./pay-BxmlWt0q.js";import{p as re}from"./padding-ClNnfcUq.js";import"./authCode-DhLBWOj4.js";/* empty css */const ue=f=>(te("data-v-bf6504fc"),f=f(),se(),f),ve={class:"my-order"},pe={class:"header-nav"},fe=ue(()=>e("div",{class:"nav-item"},l("收银订单"),-1)),me={class:"nav-item-btn"},he={class:"header-input"},ye={class:"order-lists","infinite-scroll-distance":300,"infinite-scroll-delay":500,style:{overflow:"auto"}},ge=["onClick"],ke={class:"top"},be={class:"create-time"},$e={class:"shop"},we={key:0,class:"left"},Ce={key:0,class:"shop-name"},De={class:"right"},Se={class:"money"},Ve={class:"count"},ze={class:"bottom"},Ye={class:"pay"},xe={key:0},Pe={key:1},Ie={key:2},Me={key:3},Re={key:4},Le={key:5},Ne={key:1,style:{color:"#ff4a00"}},Te={key:0,class:"load-end"},Be={key:1,class:"load-end"},Oe={__name:"order",props:{isSystem:{type:Boolean,default:!1},source:{type:Number,default:1}},setup(f,{expose:D}){X(),d([]);const t=d(1),k=y=>{_.value.page_no=1,w.value=!1,$.value=!1,m.value=[],h(!0)};d(null);const b=d(""),L=()=>{_.value.start_time=J(b.value[0]).format("YYYY-MM-DD 00:00:00"),_.value.end_time=J(b.value[1]).format("YYYY-MM-DD 23:59:59"),h(!0)},N=y=>y.getTime()>Date.now(),_=d({page_no:1,page_size:20,order_id:"",start_time:"",end_time:"",is_sashier:1}),$=d(!1),T=d(0),S=d(0),w=d(!1),m=d([]),h=(y=!1)=>{if(y)_.value.page_no=1;else if(w.value||$.value)return;$.value=!0,t.value==1&&(_.value.paid=null),t.value==2&&(_.value.paid=0),le(_.value).then(a=>{y?m.value=a.data.lists:m.value=[...m.value,...a.data.lists],_.value.page_no==1&&m.value.length>0&&V.emit("set-sale-order-detail",m.value[0]),a.data.lists.length<_.value.page_size?w.value=!0:_.value.page_no++,S.value=0,console.log(_.value.page_no),T.value=a.data.count,$.value=!1}).catch(a=>{w.value=!0,$.value=!1})},v=(y,a)=>{S.value=a,V.emit("set-sale-order-detail",y)};return D({getOrderList:h}),Z(()=>{V.on("update-sale-order-detail",y=>{console.log("==="),m.value[S.value].paid=1})}),ee(()=>{V.off("update-sale-order-detail")}),(y,a)=>{const C=r("el-radio-button"),B=r("el-radio-group"),z=r("el-date-picker"),O=r("CircleClose"),U=r("el-icon"),A=r("el-button"),E=r("el-input"),Y=r("el-image"),x=r("spna"),P=R("loading"),I=R("infinite-scroll");return s(),o("div",ve,[e("div",pe,[fe,e("div",me,[n(B,{modelValue:t.value,"onUpdate:modelValue":a[0]||(a[0]=i=>t.value=i),onChange:k,size:"small"},{default:u(()=>[n(C,{value:1},{default:u(()=>[g("全部")]),_:1}),n(C,{value:2},{default:u(()=>[g("未支付")]),_:1})]),_:1},8,["modelValue"]),n(z,{modelValue:b.value,"onUpdate:modelValue":a[1]||(a[1]=i=>b.value=i),type:"daterange","start-placeholder":"开始时间","end-placeholder":"结束时间",size:"small","value-format":"YYYY/MM/DD","disabled-date":N,onChange:L,clearable:!1,style:{width:"14rem","margin-left":"1rem"}},null,8,["modelValue"])])]),e("div",he,[n(E,{modelValue:_.value.order_id,"onUpdate:modelValue":a[4]||(a[4]=i=>_.value.order_id=i),placeholder:"请输入订单编号",onKeydown:a[5]||(a[5]=ie(i=>h(!0),["enter"])),onClear:a[6]||(a[6]=i=>h(!0))},{suffix:u(()=>[_.value.order_id!=""?(s(),M(U,{key:0,size:"18",onClick:a[2]||(a[2]=i=>{_.value.order_id="",h(!0)}),style:{cursor:"pointer","margin-right":"0.5rem"}},{default:u(()=>[n(O)]),_:1})):p("",!0)]),append:u(()=>[n(A,{type:"primary",style:{"background-color":"#1890ff",color:"#fff","border-radius":"0 0.315rem 0.315rem 0"},onClick:a[3]||(a[3]=i=>h(!0))},{default:u(()=>[g("搜索")]),_:1})]),_:1},8,["modelValue"])]),q((s(),o("div",ye,[(s(!0),o(j,null,Q(m.value,(i,F)=>(s(),o("div",{class:G(["item",{"item-active":S.value==F}]),key:F,onClick:K=>v(i,F)},[e("div",ke,[e("div",{class:G(["sn","cahier"])},"单号: "+l(i.order_id),1),e("div",be,l(i.pay_time),1)]),e("div",$e,[i.product_info?(s(),o("div",we,[(s(!0),o(j,null,Q(i.product_info.slice(0,5),(K,oe)=>(s(),M(Y,{key:oe,src:K.image,class:"shop-img"},null,8,["src"]))),128)),i.product_info.length==1?(s(),o("div",Ce,l(i.product_info[0].store_name),1)):p("",!0)])):p("",!0),e("div",De,[e("div",Se,"¥"+l(i.pay_price),1),e("div",Ve,"共"+l(i.total_num)+"款商品",1)])]),e("div",ze,[e("div",Ye,[i.paid?(s(),o("div",xe,[g(l(i.paid_name)+" ",1),i.pay_type_name?(s(),M(x,{key:0},{default:u(()=>[g("("+l(i.pay_type_name)+")",1)]),_:2},1024)):i.pay_type==9?(s(),o("span",Pe,"(微信收款)")):i.pay_type==17?(s(),o("span",Ie,"(现金支付)")):i.pay_type==13?(s(),o("span",Me,"(支付宝收款)")):i.pay_type==3?(s(),o("span",Re,"(余额支付)")):i.pay_type==1?(s(),o("span",Le,"(微信支付)")):p("",!0)])):(s(),o("div",Ne,l(i.paid_name),1))])])],10,ge))),128)),w.value?(s(),o("div",Te,"没有更多了")):p("",!0),$.value?(s(),o("div",Be,"加载中...")):p("",!0)])),[[P,$.value],[I,h]])])}}},Ue=W(Oe,[["__scopeId","data-v-bf6504fc"]]),c=f=>(te("data-v-81084524"),f=f(),se(),f),Ae={class:"my-order"},Ee={key:0,class:"detail"},Fe={class:"table","infinite-scroll-distance":300,"infinite-scroll-delay":300,style:{overflow:"auto"},"infinite-scroll-immediate":!1},qe=c(()=>e("div",{class:"table-title"},"订单信息",-1)),Ke={class:"table-info"},je={class:"info-item"},Qe=c(()=>e("div",{class:"info-item-title"},"订单编号:",-1)),Ge={class:"info-item-info"},He={class:"info-item"},Je=c(()=>e("div",{class:"info-item-title"},"商品款数:",-1)),We={class:"info-item-info"},Xe={class:"info-item"},Ze=c(()=>e("div",{class:"info-item-title"},"商品总价:",-1)),et={class:"info-item-info"},tt={class:"info-item"},st=c(()=>e("div",{class:"info-item-title"},"创建时间:",-1)),ot={class:"info-item-info"},it={class:"info-item"},at=c(()=>e("div",{class:"info-item-title"},"优惠抵扣:",-1)),lt={class:"info-item-info"},nt={class:"info-item"},dt=c(()=>e("div",{class:"info-item-title"},"实际支付:",-1)),_t={class:"info-item-info"},ct={class:"info-item"},rt=c(()=>e("div",{class:"info-item-title"},"支付时间:",-1)),ut={class:"info-item-info"},vt={class:"info-item"},pt=c(()=>e("div",{class:"info-item-title"},"支付方式:",-1)),ft={class:"info-item-info"},mt={key:0},ht={key:1},yt={key:2},gt={key:3},kt={key:4},bt={key:5},$t=c(()=>e("div",{class:"info-item"},null,-1)),wt={class:"info-item"},Ct=c(()=>e("div",{class:"info-item-title"},"是否退款:",-1)),Dt={class:"info-item-info"},St={class:"info-item"},Vt=c(()=>e("div",{class:"info-item-title"},"退款金额:",-1)),zt={class:"info-item-info"},Yt={key:0,class:"table-title"},xt={key:1,class:"table-info"},Pt={class:"info-item"},It=c(()=>e("div",{class:"info-item-title"},"用户ID:",-1)),Mt={class:"info-item-info"},Rt={class:"info-item"},Lt=c(()=>e("div",{class:"info-item-title"},"用户昵称:",-1)),Nt={class:"info-item-info"},Tt={class:"info-item"},Bt=c(()=>e("div",{class:"info-item-title"},"用户电话:",-1)),Ot={class:"info-item-info"},Ut={style:{"font-size":"0.9rem"}},At={style:{color:"#ff4a00"}},Et={style:{display:"flex","align-items":"center"}},Ft={style:{"margin-left":"0.5rem"}},qt=c(()=>e("div",{style:{height:"8rem"}},null,-1)),Kt={key:0,class:"footer"},jt={key:1,class:"footer"},Qt={key:1},Gt={__name:"detail",emits:["rePaySuccess"],setup(f,{emit:D}){X(),ae();const t=d({id:""});d([]);const k=d(null),b=d(!1);d(0),d(0),d(["商品信息","订单详情"]),d(""),d(!1);const L=()=>{k.value.setForm({isRePay:!0,data:t.value}),k.value.drawer=!0},N=()=>{t.value.order_id?ne({order_no:t.value.order_id}).then(v=>{console.log(v)}):H({message:"订单号不能为空",type:"error"})},_=d({page_no:1,page_size:15,loadend:!1,loading:!1}),$=d([]),T=()=>console.log("触底"),S=()=>{b.value=!0,de({id:t.value.id}).then(v=>{t.value=v.data,setTimeout(()=>{b.value=!1},200)})},w=D,m=(v=null)=>{setTimeout(()=>{w("rePaySuccess")})},h=()=>{_e({id:t.value.id}).then(v=>{H({message:v.msg,type:"success"}),setTimeout(()=>{w("rePaySuccess")})})};return Z(()=>{V.on("set-sale-order-detail",v=>{console.log("===",v),t.value=v,_.value.page_no=1,_.value.loadend=!1,_.value.loading=!1,$.value=[],S()})}),ee(()=>{V.off("set-sale-order-detail")}),(v,y)=>{var Y;const a=r("el-image"),C=r("el-table-column"),B=r("el-table"),z=r("el-button"),O=r("el-alert"),U=r("el-empty"),A=R("infinite-scroll"),E=R("loading");return s(),o("div",Ae,[t.value.id?q((s(),o("div",Ee,[q((s(),o("div",Fe,[qe,e("div",Ke,[e("div",je,[Qe,e("div",Ge,l(t.value.order_id),1)]),e("div",He,[Je,e("div",We,l(t.value.total_num||0),1)]),e("div",Xe,[Ze,e("div",et,"¥"+l(t.value.total_price),1)]),e("div",tt,[st,e("div",ot,l(t.value.pay_time),1)]),e("div",it,[at,e("div",lt,"¥"+l(t.value.deduction_price),1)]),e("div",nt,[dt,e("div",_t,"¥"+l(t.value.pay_price),1)]),e("div",ct,[rt,e("div",ut,l(t.value.pay_time),1)]),e("div",vt,[pt,e("div",ft,[t.value.pay_type_name?(s(),o("span",mt,l(t.value.pay_type_name),1)):t.value.pay_type==9?(s(),o("span",ht,"微信收款")):t.value.pay_type==17?(s(),o("span",yt,"现金支付")):t.value.pay_type==13?(s(),o("span",gt,"支付宝收款")):t.value.pay_type==3?(s(),o("span",kt,"余额支付")):t.value.pay_type==1?(s(),o("span",bt,"微信支付")):p("",!0)])]),$t,e("div",wt,[Ct,e("div",Dt,[e("span",null,l(t.value.refund_status_name),1)])]),e("div",St,[Vt,e("div",zt,[e("span",null,"¥"+l(t.value.refund_price),1)])])]),t.value.uid?(s(),o("div",Yt,"用户信息")):p("",!0),t.value.uid?(s(),o("div",xt,[e("div",Pt,[It,e("div",Mt,l(t.value.uid),1)]),e("div",Rt,[Lt,e("div",Nt,l(t.value.nickname),1)]),e("div",Tt,[Bt,e("div",Ot,l(t.value.mobile),1)])])):p("",!0),e("div",Ut,[g(" 共计 "),e("span",At,l(((Y=t.value.product)==null?void 0:Y.length)||" "),1),g(" 款商品 ")]),n(B,{data:t.value.product},{default:u(()=>[n(C,{label:"商品信息"},{default:u(({row:x})=>{var P,I;return[e("div",Et,[n(a,{style:{height:"3rem",width:"3rem","flex-shrink":"0"},src:(P=x.cart_info)==null?void 0:P.image},null,8,["src"]),e("span",Ft,l((I=x.cart_info)==null?void 0:I.name),1)])]}),_:1}),n(C,{prop:"cart_info.store_info",label:"商品规格",width:"150"}),n(C,{prop:"cart_info.price",label:"单价",width:"150"}),n(C,{prop:"cart_info.cart_num",label:"数量",width:"150"}),n(C,{prop:"cart_info.pay_price",label:"总价",width:"150"})]),_:1},8,["data"]),qt])),[[A,T]]),t.value.paid?p("",!0):(s(),o("div",Kt,[n(z,{type:"primary",size:"large",onClick:L},{default:u(()=>[g("重新支付")]),_:1}),t.value.pay_type==9?(s(),M(z,{key:0,type:"primary",size:"large",onClick:N},{default:u(()=>[g("查询支付")]),_:1})):p("",!0)])),t.value.paid==1&&t.value.status==1?(s(),o("div",jt,[e("div",null,[n(O,{title:"当前订单将在16点时进行收单打包,如果不需配送,可点击右侧按钮",type:"error",closable:!1})]),n(z,{type:"primary",size:"large",onClick:h},{default:u(()=>[g("不配送")]),_:1})])):p("",!0)])),[[E,b.value]]):(s(),o("div",Qt,[n(U)])),n(ce,{ref_key:"payRef",ref:k,onPaySuccess:m},null,512)])}}},Ht=W(Gt,[["__scopeId","data-v-81084524"]]),Jt={class:"my-card"},is={__name:"index",setup(f){const D=d(null),t=()=>{var k;(k=D.value)==null||k.getOrderList(!0)};return(k,b)=>(s(),o("div",Jt,[n(Ue,{style:{"flex-shrink":"0"},ref_key:"orderRef",ref:D},null,512),n(re),n(Ht,{ref:"detailRef",onRePaySuccess:t},null,512)]))}};export{is as default};