import{_ as O,u as R,r as l,o as E,m as w,a as K,b as m,l as x,c as t,h as a,e,f as c,w as $,g as D,p as X,v as L,F as U,i as T,s as A,t as n,d as Z,x as r,y as P,z as G,G as ee}from"./index-C2mUYWeU.js";import{s as te,g as se,h as oe}from"./store-DGmfknqP.js";import{h as F}from"./moment-Cl4UOzQZ.js";/* empty css */import{p as ae}from"./padding-REVqc2LB.js";const ie=p=>(P("data-v-274591ed"),p=p(),G(),p),le={class:"my-order"},ne={class:"header-nav"},de=ie(()=>e("div",{class:"nav-item"},n("线上订单"),-1)),_e={class:"nav-item-btn"},ce={class:"header-input"},re={class:"order-lists","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"},$e={class:"count"},be={class:"bottom"},ke={class:"pay"},we={key:0},De={key:0},Ve={key:1},Ye={key:2},ze={key:3},Ce={key:4},xe={key:1,style:{color:"#ff4a00"}},Se={key:0,class:"load-end"},Me={key:1,class:"load-end"},Ie={__name:"order",props:{isSystem:{type:Boolean,default:!1},source:{type:Number,default:1}},setup(p){R(),l([]);const s=l(1),b=v=>{u.value.page_no=1,f.value=!1,_.value=!1,h.value=[],g(!0)};l(null);const d=l(""),V=()=>{u.value.start_time=F(d.value[0]).format("YYYY-MM-DD 00:00:00"),u.value.end_time=F(d.value[1]).format("YYYY-MM-DD 23:59:59"),g(!0)},S=v=>v.getTime()>Date.now(),u=l({page_no:1,page_size:20,order_id:"",start_time:"",end_time:"",is_sashier:2}),_=l(!1),B=l(0),k=l(0),f=l(!1),h=l([]),g=(v=!1)=>{if(v)u.value.page_no=1;else if(f.value||_.value)return;_.value=!0,s.value==1&&(u.value.paid=null),s.value==2&&(u.value.paid=0),te(u.value).then(i=>{v?h.value=i.data.lists:h.value=[...h.value,...i.data.lists],i.data.lists.length{f.value=!0,_.value=!1})},M=(v,i)=>{k.value=i,w.emit("set-sale-order-detail",v)};return E(()=>{w.on("update-sale-order-detail",v=>{console.log("==="),h.value[k.value].paid=1})}),K(()=>{w.off("update-sale-order-detail")}),(v,i)=>{const Y=m("el-radio-button"),z=m("el-radio-group"),C=m("el-date-picker"),j=m("el-button"),q=m("el-input"),H=m("el-image"),J=x("loading"),Q=x("infinite-scroll");return t(),a("div",le,[e("div",ne,[de,e("div",_e,[c(z,{modelValue:s.value,"onUpdate:modelValue":i[0]||(i[0]=o=>s.value=o),onChange:b,size:"small"},{default:$(()=>[c(Y,{value:1},{default:$(()=>[D("全部")]),_:1}),c(Y,{value:2},{default:$(()=>[D("未支付")]),_:1})]),_:1},8,["modelValue"]),c(C,{modelValue:d.value,"onUpdate:modelValue":i[1]||(i[1]=o=>d.value=o),type:"daterange","start-placeholder":"开始时间","end-placeholder":"结束时间",size:"small","value-format":"YYYY/MM/DD","disabled-date":S,onChange:V,clearable:!1,style:{width:"14rem","margin-left":"1rem"}},null,8,["modelValue"])])]),e("div",ce,[c(q,{modelValue:u.value.order_id,"onUpdate:modelValue":i[3]||(i[3]=o=>u.value.order_id=o),placeholder:"请输入订单编号",onKeydown:i[4]||(i[4]=X(o=>g(!0),["enter"])),onClear:i[5]||(i[5]=o=>g(!0)),clearable:""},{append:$(()=>[c(j,{type:"primary",style:{"background-color":"#1890ff",color:"#fff","border-radius":"0 0.315rem 0.315rem 0"},onClick:i[2]||(i[2]=o=>g(!0))},{default:$(()=>[D("搜索")]),_:1})]),_:1},8,["modelValue"])]),L((t(),a("div",re,[(t(!0),a(U,null,T(h.value,(o,I)=>(t(),a("div",{class:A(["item",{"item-active":k.value==I}]),key:I,onClick:N=>M(o,I)},[e("div",ve,[e("div",{class:A(["sn","cahier"])},"单号: "+n(o.order_id),1),e("div",pe,n(o.pay_time),1)]),e("div",fe,[o.product_info?(t(),a("div",me,[(t(!0),a(U,null,T(o.product_info.slice(0,5),(N,W)=>(t(),Z(H,{key:W,src:N.image,class:"shop-img"},null,8,["src"]))),128)),o.product_info.length==1?(t(),a("div",he,n(o.product_info[0].store_name),1)):r("",!0)])):r("",!0),e("div",ye,[e("div",ge,"¥"+n(o.pay_price),1),e("div",$e,"共"+n(o.product_info.length)+"款商品",1)])]),e("div",be,[e("div",ke,[o.paid?(t(),a("div",we,[D(n(o.paid_name)+" ",1),o.pay_type==9?(t(),a("span",De,"(微信收款)")):r("",!0),o.pay_type==17?(t(),a("span",Ve,"(现金支付)")):r("",!0),o.pay_type==13?(t(),a("span",Ye,"(支付宝收款)")):r("",!0),o.pay_type==3?(t(),a("span",ze,"(余额支付)")):r("",!0),o.pay_type==1?(t(),a("span",Ce,"(微信支付)")):r("",!0)])):(t(),a("div",xe,n(o.paid_name),1))])])],10,ue))),128)),f.value?(t(),a("div",Se,"没有更多了")):r("",!0),_.value?(t(),a("div",Me,"加载中...")):r("",!0)])),[[J,_.value],[Q,g]])])}}},Le=O(Ie,[["__scopeId","data-v-274591ed"]]),y=p=>(P("data-v-fbbcbf15"),p=p(),G(),p),Be={class:"my-order"},Ne={key:0,class:"detail"},Ue={class:"table","infinite-scroll-distance":300,"infinite-scroll-delay":300,style:{overflow:"auto"},"infinite-scroll-immediate":!1},Te=y(()=>e("div",{class:"table-title"},"订单信息",-1)),Ae={class:"table-info"},Fe={class:"info-item"},Oe=y(()=>e("div",{class:"info-item-title"},"订单编号:",-1)),Re={class:"info-item-info"},Ee={class:"info-item"},Ke=y(()=>e("div",{class:"info-item-title"},"商品款数:",-1)),Pe={class:"info-item-info"},Ge={class:"info-item"},je=y(()=>e("div",{class:"info-item-title"},"商品总价:",-1)),qe={class:"info-item-info"},He={class:"info-item"},Je=y(()=>e("div",{class:"info-item-title"},"创建时间:",-1)),Qe={class:"info-item-info"},We={class:"info-item"},Xe=y(()=>e("div",{class:"info-item-title"},"优惠抵扣:",-1)),Ze={class:"info-item-info"},et={class:"info-item"},tt=y(()=>e("div",{class:"info-item-title"},"实际支付:",-1)),st={class:"info-item-info"},ot={class:"info-item"},at=y(()=>e("div",{class:"info-item-title"},"支付时间:",-1)),it={class:"info-item-info"},lt={class:"info-item"},nt=y(()=>e("div",{class:"info-item-title"},"支付方式:",-1)),dt={class:"info-item-info"},_t={key:0},ct={key:1},rt={key:2},ut={key:3},vt={key:4},pt={style:{"font-size":"0.9rem"}},ft={style:{color:"#ff4a00"}},mt={style:{display:"flex","align-items":"center"}},ht={style:{"margin-left":"0.5rem"}},yt={key:1},gt={__name:"detail",setup(p){R(),ee();const s=l({id:""});l([]),l(null);const b=l(!1);l(0),l(0),l(["商品信息","订单详情"]),l(""),l(!1);const d=l({page_no:1,page_size:15,loadend:!1,loading:!1}),V=l([]),S=()=>{console.log("触底"),s.value.id&&!d.value.loadend&&(console.log("加载"),d.value.loading=!0,se({pid:s.value.id,page_no:d.value.page_no,page_size:d.value.page_size}).then(_=>{V.value=[...V.value,..._.data.lists],_.data.lists.length{b.value=!0,oe({id:s.value.id}).then(_=>{s.value=_.data,setTimeout(()=>{b.value=!1},200)})};return E(()=>{w.on("set-sale-order-detail",_=>{console.log("===",_),s.value=_,d.value.page_no=1,d.value.loadend=!1,d.value.loading=!1,V.value=[],u()})}),K(()=>{w.off("set-sale-order-detail")}),(_,B)=>{var i;const k=m("el-image"),f=m("el-table-column"),h=m("el-table"),g=m("el-empty"),M=x("infinite-scroll"),v=x("loading");return t(),a("div",Be,[s.value.id?L((t(),a("div",Ne,[L((t(),a("div",Ue,[Te,e("div",Ae,[e("div",Fe,[Oe,e("div",Re,n(s.value.order_id),1)]),e("div",Ee,[Ke,e("div",Pe,n(s.value.total_num||0),1)]),e("div",Ge,[je,e("div",qe,"¥"+n(s.value.total_price),1)]),e("div",He,[Je,e("div",Qe,n(s.value.pay_time),1)]),e("div",We,[Xe,e("div",Ze,"¥"+n(s.value.deduction_price),1)]),e("div",et,[tt,e("div",st,"¥"+n(s.value.pay_price),1)]),e("div",ot,[at,e("div",it,n(s.value.pay_time),1)]),e("div",lt,[nt,e("div",dt,[s.value.pay_type==9?(t(),a("span",_t,"微信收款")):r("",!0),s.value.pay_type==17?(t(),a("span",ct,"现金支付")):r("",!0),s.value.pay_type==13?(t(),a("span",rt,"支付宝收款")):r("",!0),s.value.pay_type==3?(t(),a("span",ut,"余额支付")):r("",!0),s.value.pay_type==1?(t(),a("span",vt,"微信支付")):r("",!0)])])]),e("div",pt,[D(" 共计 "),e("span",ft,n(((i=s.value.product)==null?void 0:i.length)||" "),1),D(" 款商品 ")]),c(h,{data:s.value.product},{default:$(()=>[c(f,{label:"商品信息"},{default:$(({row:Y})=>{var z,C;return[e("div",mt,[c(k,{style:{height:"3rem",width:"3rem"},src:(z=Y.cart_info)==null?void 0:z.image},null,8,["src"]),e("span",ht,n((C=Y.cart_info)==null?void 0:C.name),1)])]}),_:1}),c(f,{prop:"cart_info.price",label:"单价",width:"150"}),c(f,{prop:"cart_info.cart_num",label:"数量",width:"150"}),c(f,{prop:"cart_info.total",label:"总价",width:"150"})]),_:1},8,["data"])])),[[M,S]])])),[[v,b.value]]):(t(),a("div",yt,[c(g)]))])}}},$t=O(gt,[["__scopeId","data-v-fbbcbf15"]]),bt={class:"my-card"},zt={__name:"index",setup(p){return(s,b)=>(t(),a("div",bt,[c(Le,{style:{"flex-shrink":"0"},ref:"orderRef"},null,512),c(ae),c($t,{ref:"detailRef"},null,512)]))}};export{zt as default};