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

2 lines
11 KiB
JavaScript

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,"¥"+d(a.pay_price),1),e("div",be,"共"+d(a.total_num)+"件商品",1)])]),e("div",Ce,[e("div",Ve,[a.paid?(t(),s("div",Se,[h(" 已支付 "),a.pay_type==13?(t(),s("span",we,"(支付宝收款)")):l("",!0),a.pay_type==12?(t(),s("span",Ye,"(现金支付)")):l("",!0),a.pay_type==11?(t(),s("span",De,"(微信收款)")):l("",!0),a.pay_type==0?(t(),s("span",Pe,"(余额支付)")):l("",!0),a.pay_type==1?(t(),s("span",Le,"(微信支付)")):l("",!0),a.pay_type==9?(t(),s("span",Ie,"(商户余额支付)")):l("",!0),a.pay_type==10?(t(),s("span",Me,"(对公转账)")):l("",!0)])):(t(),s("div",Ae,"未支付"))]),a.service_info?(t(),s("div",ze," 收银员: "+d(a.service_info.nickname),1)):(t(),s("div",Be,"平台订单"))])],10,pe))),128)),S.value?(t(),s("div",Re,"没有更多了")):l("",!0),f.value?(t(),s("div",Ue,"加载中...")):l("",!0)])),[[O,f.value],[Q,n]])])}}},Jt=H(qe,[["__scopeId","data-v-6dea798c"]]),y=V=>(se("data-v-e6e9d4a9"),V=V(),oe(),V),Ee={class:"my-order"},Ne={class:"header-nav"},je=["onClick"],xe={class:"detail"},Fe={key:0,class:"table"},Ke={style:{"font-size":"0.9rem"}},Oe={style:{color:"#ff4a00"}},Te={style:{display:"flex","align-items":"center"}},He={style:{"margin-left":"0.5rem"}},Ge={key:1,class:"table"},Je=y(()=>e("div",{class:"table-title"},"订单信息",-1)),Qe={class:"table-info"},We={class:"info-item"},Xe=y(()=>e("div",{class:"info-item-title"},"创建时间:",-1)),Ze={class:"info-item-info"},et={class:"info-item"},tt=y(()=>e("div",{class:"info-item-title"},"商品总数:",-1)),st={class:"info-item-info"},ot={class:"info-item"},at=y(()=>e("div",{class:"info-item-title"},"商品总价:",-1)),it={class:"info-item-info"},lt={class:"info-item"},nt=y(()=>e("div",{class:"info-item-title"},"支付时间:",-1)),dt={class:"info-item-info"},ct={class:"info-item"},rt=y(()=>e("div",{class:"info-item-title"},"优惠抵扣:",-1)),_t={class:"info-item-info"},ut={class:"info-item"},vt=y(()=>e("div",{class:"info-item-title"},"实际支付:",-1)),pt={class:"info-item-info"},ft={class:"info-item"},mt=y(()=>e("div",{class:"info-item-title"},"支付方式:",-1)),ht={class:"info-item-info"},yt={key:0},gt={key:1},kt={key:2},$t={key:3},bt={key:4},Ct={key:5},Vt={key:6},St={key:0,class:"table-title"},wt={key:1,class:"table-info",style:{"flex-direction":"column"}},Yt={class:"info-item"},Dt=y(()=>e("div",{class:"info-item-title"},"头像:",-1)),Pt={class:"info-item-info"},Lt={class:"info-item"},It=y(()=>e("div",{class:"info-item-title"},"昵称:",-1)),Mt={class:"info-item-info"},At={class:"info-item"},zt=y(()=>e("div",{class:"info-item-title"},"账号:",-1)),Bt={class:"info-item-info"},Rt={key:2,class:"footer"},Ut={class:"info"},qt={class:"ser"},Et={class:"price"},Nt={key:0,class:"handle"},jt={key:1,class:"handle"},xt=y(()=>e("span",null,"提单前请清空购物车, 避免提单的商品与购物车商品混合, 请确保购物车内无数据后再进行提单",-1)),Ft={class:"dialog-footer"},Kt={__name:"detail",setup(V){const D=G(),L=te(),o=r({});P.on("set-order-detail",n=>{o.value=n}),r([]);const b=r(null),z=r(!1);r(0);const p=r(0),I=r(["商品信息","订单详情"]),u=r(""),f=r(!1),B=n=>{u.value=n,f.value=!0},Y=()=>{f.value=!1,ie({order_sn:u.value,staff_id:D.userInfo.service.service_id}).then(n=>{N({message:n.message,type:"success"}),L.push({name:"home"})})},S=n=>{b.value.setRePay({price:n.pay_price,order_id:n.group_order_id}),b.value.drawer=!0},k=n=>{le({order_sn:n}).then(_=>{_.data.paid==1||_.message=="支付成功"?(N({message:_.message,type:"success"}),P.emit("update-order-detail",{}),o.value.paid=1):N({message:_.message,type:"error"})}).catch(_=>{})};return(n,_)=>{const $=g("el-image"),i=g("el-table-column"),M=g("el-table"),C=g("el-button"),R=g("el-dialog"),U=j("loading");return t(),s("div",Ee,[e("div",Ne,[(t(!0),s(x,null,F(I.value,(m,w)=>(t(),s("div",{key:w,class:A(["nav-item",{"nav-item-active":p.value==w,"nav-item-radius1":p.value==w+1,"nav-item-radius2":p.value==w-1}]),onClick:O=>p.value=w},d(m),11,je))),128)),e("div",{class:A(["nav-item",{"nav-item-radius2":p.value==I.value.length-1}]),style:{flex:"1"}},null,2)]),J((t(),s("div",xe,[o.value.orderProduct&&p.value==0?(t(),s("div",Fe,[e("div",Ke,[h(" 共计 "),e("span",Oe,d(o.value.total_num),1),h(" 件商品 ")]),c(M,{style:{height:"calc(100vh - 100px - 14rem)"},data:o.value.orderProduct},{default:v(()=>[c(i,{prop:"cart_info.product.store_name",label:"商品信息"},{default:v(({row:m})=>[e("div",Te,[c($,{style:{height:"3rem",width:"3rem"},src:m.cart_info.productAttr.image||m.cart_info.product.image},null,8,["src"]),e("span",He,d(m.cart_info.product.store_name),1)])]),_:1}),c(i,{prop:"cart_info.productAttr.price",label:"单价",width:"150"}),c(i,{prop:"product_num",label:"数量",width:"150"}),c(i,{prop:"total_price",label:"总价",width:"150"})]),_:1},8,["data"])])):l("",!0),o.value.orderProduct&&p.value==1?(t(),s("div",Ge,[Je,e("div",Qe,[e("div",We,[Xe,e("div",Ze,d(o.value.create_time),1)]),e("div",et,[tt,e("div",st,d(o.value.total_num),1)]),e("div",ot,[at,e("div",it,"¥"+d(o.value.total_price),1)]),e("div",lt,[nt,e("div",dt,d(o.value.pay_time),1)]),e("div",ct,[rt,e("div",_t,"¥"+d(o.value.deduction_price),1)]),e("div",ut,[vt,e("div",pt,"¥"+d(o.value.pay_price),1)]),e("div",ft,[mt,e("div",ht,[o.value.pay_type==11?(t(),s("span",yt,"微信收款")):l("",!0),o.value.pay_type==12?(t(),s("span",gt,"现金支付")):l("",!0),o.value.pay_type==13?(t(),s("span",kt,"支付宝收款")):l("",!0),o.value.pay_type==0?(t(),s("span",$t,"余额支付")):l("",!0),o.value.pay_type==1?(t(),s("span",bt,"微信支付")):l("",!0),o.value.pay_type==9?(t(),s("span",Ct,"商户余额支付")):l("",!0),o.value.pay_type==10?(t(),s("span",Vt,"对公转账")):l("",!0)])])]),o.value.service_info?(t(),s("div",St,"收银员信息")):l("",!0),o.value.service_info?(t(),s("div",wt,[e("div",Yt,[Dt,e("div",Pt,[c($,{style:{height:"4rem",width:"4rem","border-radius":"50%"},src:o.value.service_info.avatar},null,8,["src"])])]),e("div",Lt,[It,e("div",Mt,d(o.value.service_info.nickname),1)]),e("div",At,[zt,e("div",Bt,d(o.value.service_info.account),1)])])):l("",!0)])):l("",!0),o.value.service_info?(t(),s("div",Rt,[e("div",Ut,[e("div",qt,"收银员: "+d(o.value.service_info.nickname),1),e("div",Et,[h(" 实付: "),e("span",null,"¥"+d(o.value.pay_price),1)])]),o.value.paid?(t(),s("div",jt,"已支付")):(t(),s("div",Nt,[c(C,{class:"btn",type:"primary",onClick:_[0]||(_[0]=m=>S(o.value))},{default:v(()=>[h("重新支付")]),_:1}),c(C,{class:"btn",type:"primary",onClick:_[1]||(_[1]=m=>k(o.value.order_sn))},{default:v(()=>[h("检测状态")]),_:1}),c(C,{class:"btn",type:"success",onClick:_[2]||(_[2]=m=>B(o.value.order_sn))},{default:v(()=>[h("提单")]),_:1})]))])):l("",!0)])),[[U,z.value]]),c(ne,{ref_key:"payRef",ref:b},null,512),c(R,{modelValue:f.value,"onUpdate:modelValue":_[4]||(_[4]=m=>f.value=m),title:"提示",width:"500"},{footer:v(()=>[e("div",Ft,[c(C,{onClick:_[3]||(_[3]=m=>f.value=!1)},{default:v(()=>[h("取消")]),_:1}),n.cartCount>0?(t(),K(C,{key:0,onClick:n.goHome},{default:v(()=>[h(" 前去清空购物车 ")]),_:1},8,["onClick"])):(t(),K(C,{key:1,type:"primary",onClick:Y},{default:v(()=>[h(" 确认提单 ")]),_:1}))])]),default:v(()=>[xt]),_:1},8,["modelValue"])])}}},Qt=H(Kt,[["__scopeId","data-v-e6e9d4a9"]]);export{Qt as d,Jt as o};