cashier-mer/dist/assets/index-B7hMcs07.js

2 lines
8.5 KiB
JavaScript
Raw Normal View History

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