cashier-mer/dist/assets/index-DudCf6-k.js

2 lines
9.9 KiB
JavaScript

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