2024-06-11 16:05:20 +08:00
|
|
|
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"
|