cashier-mer/dist/assets/index-BcsrYmbf.js

2 lines
11 KiB
JavaScript
Raw Normal View History

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