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