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