cashier-mer/dist/assets/detail-CNaDiLm4.js

2 lines
11 KiB
JavaScript
Raw Normal View History

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