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

2 lines
10 KiB
JavaScript

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