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

2 lines
9.3 KiB
JavaScript

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