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