cashier-mer/build/assets/index-DhcBvfn5.js

2 lines
9.9 KiB
JavaScript

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