2 lines
11 KiB
JavaScript
2 lines
11 KiB
JavaScript
|
import{_ as q,u as H,r,o as Q,m as x,b as h,j as F,c as t,h as s,e,t as c,f as d,w as u,g as f,k as W,q as G,F as O,i as j,p as B,d as K,s as n,A as X,E as Y,v as Z,x as ee}from"./index-BK45VPeO.js";import{s as te,f as se,g as oe}from"./pay.vue_vue_type_style_index_0_scoped_43f405bf_lang-UtIhw1Q5.js";import{p as ae}from"./pay-jKmmbq3P.js";import{p as ie}from"./padding-C_XosNLD.js";const le={class:"my-order"},ne={class:"header-nav"},de={class:"nav-item"},ce={class:"nav-item-btn"},re={class:"header-input"},_e={class:"order-list","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"},ke={class:"count"},$e={class:"bottom"},be={class:"pay"},Ce={key:0},Ve={key:0},Se={key:1},we={key:2},Pe={key:3},Le={key:4},Ie={key:5},Ae={key:6},De={key:1,style:{color:"#ff4a00"}},xe={key:0,class:"cashier"},Re={key:1,class:"cashier"},Be={key:0,class:"load-end"},Ue={key:1,class:"load-end"},ze={__name:"order",props:{isSystem:{type:Boolean,default:!1}},setup($){const I=H(),R=$;r([]);const o=r(1),A=i=>{v.value.page=1,S.value=!1,y.value=!1,k.value=[],b(!0)};r(null);const D=r(""),g=()=>{v.value.date=D.value.join("-"),b(!0)},v=r({page:1,limit:20,store_name:"",date:"",staff_id:0,sale_type:2}),y=r(!1),V=r(0),L=r(0),S=r(!1),k=r([]),b=(i=!1)=>{if(i)v.value.page=1;else if(S.value||y.value)return;R.isSystem||(v.value.staff_id=I.userInfo.service.service_id),y.value=!0,o.value==1&&(v.value.paid=null),o.value==2&&(v.value.paid=0),te(I.userInfo.service.mer_id,v.value).then(l=>{i?k.value=l.data.list:k.value=[...k.value,...l.data.list],l.data.list.length<v.value.limit?S.value=!0:v.value.page++,L.value=0,x.emit("set-order-detail",k.value[0]),V.value=l.data.count,y.value=!1}).catch(l=>{S.value=!0,y.value=!1})},_=(i,l)=>{L.value=l,x.emit("set-order-detail",i)};return Q(()=>{x.on("update-order-detail",i=>{console.log("==="),k.value[L.value].paid=1})}),(i,l)=>{const w=h("el-radio-button"),U=h("el-radio-group"),C=h("el-date-picker"),z=h("el-button"),E=h("el-input"),p=h("el-image"),P=F("loading"),T=F("infinite-scroll");return t(),s("div",le,[e("div",ne,[e("div",de,c($.isSystem?"平台订单":"收银订单"),1),e("div",ce,[d(U,{modelValue:o.value,"onUpdate:modelValue":l[0]||(l[0]=a=>o.value=a),onChange:A,size:"small"},{default:u(()=>[d(w,{value:1},{default:u(()=>[f("已支付")]),_:1}),d(w,{value:2},{default:u(()=>[f("未支付")]),_:1})]),_:1},8,["modelValue"]),d(C,{modelValue:D.value,"onUpdate:modelValue":l[1]||(l[1]=a=>D.value=a),type:"daterange","start-placeholder":"开始时间","end-placeholder":"结束时间",size:"small","value-format":"YYYY/MM/DD",onChange:g,style:{width:"14rem","margin-left":"1rem"}},null,8,["modelValue"])])]),e("div",re,[d(E,{modelValue:v.value.store_name,"onUpdate:modelValue":l[3]||(l[3]=a=>v.value.store_name=a),placeholder:"请输入订单编号",onKeydown:l[4]||(l[4]=W(a=>b(!0),["enter"])),onClear:l[5]||(l[5]=a=>b(!0)),clearable:""},{append:u(()=>[d(z,{type:"primary",style:{"background-color":"#1890ff",color:"#fff","border-radius":"0 0.315rem 0.315rem 0"},onClick:l[2]||(l[2]=a=>b(!0))},{default:u(()=>[f("搜索")]),_:1})]),_:1},8,["modelValue"])]),G((t(),s("div",_e,[(t(!0),s(O,null,j(k.value,(a,M)=>(t(),s("div",{class:B(["item",{"item-active":L.value==M}]),key:M,onClick:N=>_(a,M)},[e("div",ve,[e("div",{class:B(["sn",a.pay_type===11||a.pay_type===12||a.pay_type===13?"cahier":"cahier2"])}," 单号: "+c(a.order_sn),3),e("div",pe,c(a.create_time),1)]),e("div",fe,[a.orderProduct?(t(),s("div",me,[(t(!0),s(O,null,j(a.orderProduct.slice(0,5),(N,J)=>(t(),K(p,{key:J,src:N.cart_info.productAttr.image||N.cart_info.product.image,class:"shop-img"},null,8,["src"]))),128)),a.orderProduct.length==1?(t(),s("div",he,c(a.orderProduct[0].cart_info.product.store_name),1)):n("",!0)])):n("",!0),e("div",ye,[e("div",ge,"¥"+c(a.pay_price),1),e("div",ke,"共"+c(a.total_num)+"件商品",1)])]),e("div",$e,[e("div",be,[a.paid?(t(),s("div",Ce,[f(" 已支付 "),a.pay_type==13?
|