cashier-mer/build/assets/index-DQK-DgZf.js

2 lines
9.3 KiB
JavaScript
Raw Normal View History

2024-06-11 18:02:28 +08:00
import{_ as G,u as H,r as i,o as J,m as V,a as Q,b as p,l as R,c as s,h as a,e,f as _,w as y,g as $,p as te,v as F,F as A,i as E,s as K,t as n,d as j,x as w,y as W,z as X,D as se}from"./index-DHeiRjQX.js";import{s as oe,d as ae,e as le}from"./store-BKcq1Vfo.js";import{h as q}from"./moment-Cl4UOzQZ.js";import{p as ie}from"./pay-CoYkrSJY.js";import{p as ne}from"./padding-CGeVIEC_.js";/* empty css */const de=v=>(W("data-v-4002e8c0"),v=v(),X(),v),_e={class:"my-order"},ce={class:"header-nav"},re=de(()=>e("div",{class:"nav-item"},n("收银订单"),-1)),ue={class:"nav-item-btn"},pe={class:"header-input"},ve={class:"order-lists","infinite-scroll-distance":300,"infinite-scroll-delay":500,style:{overflow:"auto"}},fe=["onClick"],me={class:"top"},he={class:"create-time"},ye={class:"shop"},ge={key:0,class:"left"},ke={key:0,class:"shop-name"},$e={class:"right"},be={class:"money"},we={class:"count"},De={class:"bottom"},Se={class:"pay"},Ve={key:0},ze={key:1},Ye={key:2},Ce={key:3},xe={key:4},Pe={key:5},Re={key:1,style:{color:"#ff4a00"}},Le={key:0,class:"load-end"},Me={key:1,class:"load-end"},Ie={__name:"order",props:{isSystem:{type:Boolean,default:!1},source:{type:Number,default:1}},setup(v,{expose:D}){H(),i([]);const t=i(1),f=r=>{c.value.page_no=1,b.value=!1,h.value=!1,d.value=[],k(!0)};i(null);const m=i(""),L=()=>{c.value.start_time=q(m.value[0]).format("YYYY-MM-DD 00:00:00"),c.value.end_time=q(m.value[1]).format("YYYY-MM-DD 23:59:59"),k(!0)},u=r=>r.getTime()>Date.now(),c=i({page_no:1,page_size:20,order_id:"",start_time:"",end_time:"",is_sashier:1}),h=i(!1),M=i(0),S=i(0),b=i(!1),d=i([]),k=(r=!1)=>{if(r)c.value.page_no=1;else if(b.value||h.value)return;h.value=!0,t.value==1&&(c.value.paid=null),t.value==2&&(c.value.paid=0),oe(c.value).then(l=>{r?d.value=l.data.lists:d.value=[...d.value,...l.data.lists],c.value.page_no==1&&d.value.length>0&&V.emit("set-sale-order-detail",d.value[0]),l.data.lists.length<c.value.page_size?b.value=!0:c.value.page_no++,S.value=0,console.log(c.value.page_no),M.value=l.data.count,h.value=!1}).catch(l=>{b.value=!0,h.value=!1})},I=(r,l)=>{S.value=l,V.emit("set-sale-order-detail",r)};return D({getOrderList:k}),J(()=>{V.on("update-sale-order-detail",r=>{console.log("==="),d.value[S.value].paid=1})}),Q(()=>{V.off("update-sale-order-detail")}),(r,l)=>{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=p("spna"),P=R("loading"),Z=R("infinite-scroll");return s(),a("div",_e,[e("div",ce,[re,e("div",ue,[_(B,{modelValue:t.value,"onUpdate:modelValue":l[0]||(l[0]=o=>t.value=o),onChange:f,size:"small"},{default:y(()=>[_(z,{value:1},{default:y(()=>[$("全部")]),_:1}),_(z,{value:2},{default:y(()=>[$("未支付")]),_:1})]),_:1},8,["modelValue"]),_(N,{modelValue:m.value,"onUpdate:modelValue":l[1]||(l[1]=o=>m.value=o),type:"daterange","start-placeholder":"开始时间","end-placeholder":"结束时间",size:"small","value-format":"YYYY/MM/DD","disabled-date":u,onChange:L,clearable:!1,style:{width:"14rem","margin-left":"1rem"}},null,8,["modelValue"])])]),e("div",pe,[_(Y,{modelValue:c.value.order_id,"onUpdate:modelValue":l[3]||(l[3]=o=>c.value.order_id=o),placeholder:"请输入订单编号",onKeydown:l[4]||(l[4]=te(o=>k(!0),["enter"])),onClear:l[5]||(l[5]=o=>k(!0)),clearable:""},{append:y(()=>[_(T,{type:"primary",style:{"background-color":"#1890ff",color:"#fff","border-radius":"0 0.315rem 0.315rem 0"},onClick:l[2]||(l[2]=o=>k(!0))},{default:y(()=>[$("搜索")]),_:1})]),_:1},8,["modelValue"])]),F((s(),a("div",ve,[(s(!0),a(A,null,E(d.value,(o,U)=>(s(),a("div",{class:K(["item",{"item-active":S.value==U}]),key:U,onClick:O=>I(o,U)},[e("div",me,[e("div",{class:K(["sn","cahier"])},"单号: "+n(o.order_id),1),e("div",he,n(o.pay_time),1)]),e("div",ye,[o.product_info?(s(),a("div",ge,[(s(!0),a(A,null,E(o.product_info.slice(0,5),(O,ee)=>(s(),j(C,{key:ee,src:O.image,class:"shop-img"},null,8,["src"]))),128)),o.product_info.length==1?(s(),a("div",ke,n(o.product_info[0].store_name),1)):w("",!0)])):w("",!0),e("div",$e,