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,["
|