2024-07-11 14:41:33 +08:00
|
|
|
import{_ as G,u as H,r as n,o as J,m as D,a as Q,b as u,h as I,c as s,k as o,e,f as d,w as p,g as b,d as F,p as m,i as oe,j as O,F as E,l as K,z as j,t as l,q as W,s as X,I as ae}from"./index-CCL_aieW.js";import{d as ie,e as le}from"./store-BNm3g_zr.js";import{h as q}from"./moment-Cl4UOzQZ.js";import{p as ne}from"./pay-H92PK2lK.js";import{p as de}from"./padding-CGiyqEPU.js";import"./authCode-C8sYYjUN.js";/* empty css */const _e=f=>(W("data-v-bf6504fc"),f=f(),X(),f),ce={class:"my-order"},re={class:"header-nav"},ue=_e(()=>e("div",{class:"nav-item"},l("收银订单"),-1)),ve={class:"nav-item-btn"},pe={class:"header-input"},fe={class:"order-lists","infinite-scroll-distance":300,"infinite-scroll-delay":500,style:{overflow:"auto"}},me=["onClick"],he={class:"top"},ye={class:"create-time"},ge={class:"shop"},ke={key:0,class:"left"},be={key:0,class:"shop-name"},$e={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}){H(),n([]);const t=n(1),h=r=>{_.value.page_no=1,$.value=!1,g.value=!1,c.value=[],k(!0)};n(null);const y=n(""),R=()=>{_.value.start_time=q(y.value[0]).format("YYYY-MM-DD 00:00:00"),_.value.end_time=q(y.value[1]).format("YYYY-MM-DD 23:59:59"),k(!0)},S=r=>r.getTime()>Date.now(),_=n({page_no:1,page_size:20,order_id:"",start_time:"",end_time:"",is_sashier:1}),g=n(!1),M=n(0),C=n(0),$=n(!1),c=n([]),k=(r=!1)=>{if(r)_.value.page_no=1;else if($.value||g.value)return;g.value=!0,t.value==1&&(_.value.paid=null),t.value==2&&(_.value.paid=0),ie(_.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?$.value=!0:_.value.page_no++,C.value=0,console.log(_.value.page_no),M.value=i.data.count,g.value=!1}).catch(i=>{$.value=!0,g.value=!1})},L=(r,i)=>{C.value=i,D.emit("set-sale-order-detail",r)};return w({getOrderList:k}),J(()=>{D.on("update-sale-order-detail",r=>{console.log("==="),c.value[C.value].paid=1})}),Q(()=>{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"),Z=u("spna"),ee=I("loading"),te=I("infinite-scroll");return s(),o("div",ce,[e("div",re,[ue,e("div",ve,[d(B,{modelValue:t.value,"onUpdate:modelValue":i[0]||(i[0]=a=>t.value=a),onChange:h,size:"small"},{default:p(()=>[d(V,{value:1},{default:p(()=>[b("全部")]),_:1}),d(V,{value:2},{default:p(()=>[b("未支付")]),_:1})]),_:1},8,["modelValue"]),d(N,{modelValue:y.value,"onUpdate:modelValue":i[1]||(i[1]=a=>y.value=a),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",pe,[d(z,{modelValue:_.value.order_id,"onUpdate:modelValue":i[4]||(i[4]=a=>_.value.order_id=a),placeholder:"请输入订单编号",onKeydown:i[5]||(i[5]=oe(a=>k(!0),["enter"])),onClear:i[6]||(i[6]=a=>k(!0))},{suffix:p(()=>[_.value.order_id!=""?(s(),F(Y,{key:0,size:"18",onClick:i[2]||(i[2]=a=>{_.value.order_id="",k(!0)}),style:{cursor:"pointer","margin-right":"0.5rem"}},{default:p(()=>[d(T)]),_:1})):m("",!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]=a=>k(!0))},{default:p(()=>[b("搜索")]),_:1})]),_:1},8,["modelValue"])]),O((s(),o("div",fe,[(s(!0),o(E,null,K(c.value,(a,U)=>(s(),o("div",{class:j(["item",{"item-active":C.value==U}]),key:U,onClick:A=>L(a,U)},[e("div",he,[e("div",{class:j(["sn","cahier"])},"单号: "+l(a.order_id),1),e("div",ye,l(a.pay_time),1)]),e("div",ge,[a.product_info
|