cashier-mer/dist/assets/index-CEBHM46W.js

2 lines
9.9 KiB
JavaScript

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