2 lines
7.7 KiB
JavaScript
2 lines
7.7 KiB
JavaScript
|
import{_ as A,u as F,r as a,o as M,m as C,a as P,b as h,s as S,c as s,h as o,e,f as d,w,g as D,v as X,z as I,F as U,i as O,y as Y,t as n,d as Z,A as u,O as ee,B as R,C as T,P as te,Q as se}from"./index-BhwfcSvx.js";/* empty css */import{p as oe}from"./padding-dm0HkGpn.js";const ae=_=>(R("data-v-9d0ec279"),_=_(),T(),_),le={class:"my-order"},ie={class:"header-nav"},ne=ae(()=>e("div",{class:"nav-item"},n("收银订单"),-1)),de={class:"nav-item-btn"},ce={class:"header-input"},_e={class:"order-lists","infinite-scroll-distance":300,"infinite-scroll-delay":500,style:{overflow:"auto"}},re=["onClick"],ue={class:"top"},ve={class:"create-time"},pe={class:"shop"},fe={key:0,class:"left"},me={key:0,class:"shop-name"},he={class:"right"},ge={class:"money"},ye={class:"count"},$e={class:"bottom"},be={class:"pay"},ke={key:0},we={key:0},Ve={key:1},ze={key:2},Ce={key:1,style:{color:"#ff4a00"}},De={key:0,class:"load-end"},xe={key:1,class:"load-end"},Se={__name:"order",props:{isSystem:{type:Boolean,default:!1},source:{type:Number,default:1}},setup(_){F();const i=_;a([]);const y=a(1),c=m=>{r.value.page_no=1,b.value=!1,v.value=!1,p.value=[],f(!0)};a(null);const $=a(""),x=()=>{r.value.date=$.value.join("-"),f(!0)},k=m=>m.getTime()>Date.now(),r=a({page_no:1,page_size:20,number:"",date:"",source:i.source}),v=a(!1),V=a(0),z=a(0),b=a(!1),p=a([]),f=(m=!1)=>{if(m)r.value.page_no=1;else if(b.value||v.value)return;v.value=!0,y.value==1&&(r.value.paid=null),y.value==2&&(r.value.paid=0),ee(r.value).then(l=>{m?p.value=l.data.lists:p.value=[...p.value,...l.data.lists],l.data.lists.length<r.value.page_size?b.value=!0:r.value.page_no++,z.value=0,C.emit("set-sale-order-detail",p.value[0]),V.value=l.data.count,v.value=!1}).catch(l=>{b.value=!0,v.value=!1})},E=(m,l)=>{z.value=l,C.emit("set-sale-order-detail",m)};return M(()=>{C.on("update-sale-order-detail",m=>{console.log("==="),p.value[z.value].paid=1})}),P(()=>{C.off("update-sale-order-detail")}),(m,l)=>{const L=h("el-radio-button"),K=h("el-radio-group"),j=h("el-date-picker"),Q=h("el-button"),q=h("el-input"),G=h("el-image"),H=S("loading"),J=S("infinite-scroll");return s(),o("div",le,[e("div",ie,[ne,e("div",de,[d(K,{modelValue:y.value,"onUpdate:modelValue":l[0]||(l[0]=t=>y.value=t),onChange:c,size:"small"},{default:w(()=>[d(L,{value:1},{default:w(()=>[D("全部")]),_:1}),d(L,{value:2},{default:w(()=>[D("未支付")]),_:1})]),_:1},8,["modelValue"]),d(j,{modelValue:$.value,"onUpdate:modelValue":l[1]||(l[1]=t=>$.value=t),type:"daterange","start-placeholder":"开始时间","end-placeholder":"结束时间",size:"small","value-format":"YYYY/MM/DD","disabled-date":k,onChange:x,style:{width:"14rem","margin-left":"1rem"}},null,8,["modelValue"])])]),e("div",ce,[d(q,{modelValue:r.value.number,"onUpdate:modelValue":l[3]||(l[3]=t=>r.value.number=t),placeholder:"请输入订单编号",onKeydown:l[4]||(l[4]=X(t=>f(!0),["enter"])),onClear:l[5]||(l[5]=t=>f(!0)),clearable:""},{append:w(()=>[d(Q,{type:"primary",style:{"background-color":"#1890ff",color:"#fff","border-radius":"0 0.315rem 0.315rem 0"},onClick:l[2]||(l[2]=t=>f(!0))},{default:w(()=>[D("搜索")]),_:1})]),_:1},8,["modelValue"])]),I((s(),o("div",_e,[(s(!0),o(U,null,O(p.value,(t,B)=>(s(),o("div",{class:Y(["item",{"item-active":z.value==B}]),key:B,onClick:N=>E(t,B)},[e("div",ue,[e("div",{class:Y(["sn","cahier"])},"单号: "+n(t.number),1),e("div",ve,n(t.create_time),1)]),e("div",pe,[t.goods_list?(s(),o("div",fe,[(s(!0),o(U,null,O(t.goods_list.slice(0,5),(N,W)=>(s(),Z(G,{key:W,src:N.imgs,class:"shop-img"},null,8,["src"]))),128)),t.goods_list.length==1?(s(),o("div",me,n(t.goods_list[0].class_name),1)):u("",!0)])):u("",!0),e("div",he,[e("div",ge,"¥"+n(t.total),1),e("div",ye,"共"+n(t.goods_count)+"款商品",1)])]),e("div",$e,[e("div",be,[t.paid?(s(),o("div",ke,[D(" 已支付 "),t.pay_type==9?(s(),o("span",we,"(微信收款)")):u("",!0),t.pay_type==3?(s(),o("span",Ve,"(余额支付)")):u("",!0),t.pay_type==1?(s(),o("span",ze,"(微信支付)")):u("",!0)])):(s(),o("div",Ce,"未支付"))])])],10,re))),128)),b.value?
|