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