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