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