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