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