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