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

2 lines
7.7 KiB
JavaScript

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