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