cashier-ERP/dist/assets/detail-SSwoB7VG.js

2 lines
12 KiB
JavaScript

import{_ as H,z as Z,u as G,r as u,o as ee,m as L,b as g,j as N,c as t,h as s,e,t as _,f as d,w as v,g as p,s as l,k as te,q as J,F as j,i as x,p as I,d as F,A as se,E,v as oe,x as ae}from"./index-3-t8Fk7s.js";import{e as ie,f as le,g as ne}from"./pay.vue_vue_type_style_index_0_scoped_7f298acd_lang-BaAcCNPN.js";import{h as O}from"./moment-Cl4UOzQZ.js";import{p as de}from"./pay-Bt7FIL7i.js";const ce={class:"header-nav"},re={class:"nav-item"},_e={class:"nav-item-btn"},ue={key:0,class:"nav-item-btn"},ve={class:"header-input"},pe={class:"order-list","infinite-scroll-distance":"300","infinite-scroll-delay":"500",style:{overflow:"auto"}},fe=["onClick"],me={class:"top"},ye={class:"create-time"},he={class:"shop"},ge={key:0,class:"left"},ke={key:0,class:"shop-name"},$e={class:"right"},be={class:"money"},Ce={class:"count"},Ve={class:"bottom"},Se={class:"pay"},we={key:0},Ye={key:0},De={key:1},Pe={key:2},Le={key:3},Ie={key:4},Me={key:5},Ae={key:6},qe={key:1,style:{color:"#ff4a00"}},ze={key:0,class:"cashier"},Ue={key:1,class:"cashier"},Be={key:0,class:"load-end"},Re={key:1,class:"load-end"},Te={__name:"order",props:{isSystem:{type:Boolean,default:!1}},setup($){const S=Z(),M=G(),o=$;u([]);const C=u(1),w=u(0),k=m=>{r.value.page=1,Y.value=!1,b.value=!1,c.value=[],n(!0)};u(null);const V=u(""),A=()=>{r.value.date=V.value.join("-"),n(!0)},r=u({page:1,limit:20,search_info:"",date:"",staff_id:0});S.query.date&&(V.value=[O(S.query.date).format("YYYY/MM/DD"),O(S.query.date).format("YYYY/MM/DD")],r.value.date=V.value.join("-")),S.query.payType&&(w.value=S.query.payType);const b=u(!1),U=u(0),P=u(0),Y=u(!1),c=u([]),n=(m=!1)=>{if(m)r.value.page=1;else if(Y.value||b.value)return;o.isSystem||(r.value.staff_id=M.userInfo.service.service_id,w.value==1?r.value.pay_type="12":w.value==2?r.value.pay_type="11,13":r.value.pay_type=""),b.value=!0,C.value==1&&(r.value.paid=null),C.value==2&&(r.value.paid=0),ie(M.userInfo.service.mer_id,r.value).then(i=>{m?c.value=i.data.list:c.value=[...c.value,...i.data.list],i.data.list.length<r.value.limit?Y.value=!0:r.value.page++,P.value=0,c.value.length>0&&L.emit("set-order-detail",c.value[0]),U.value=i.data.count,b.value=!1}).catch(i=>{Y.value=!0,b.value=!1})},q=(m,i)=>{P.value=i,L.emit("set-order-detail",m)};return ee(()=>{L.on("update-order-detail",m=>{console.log("==="),c.value[P.value].paid=1})}),(m,i)=>{const y=g("el-radio-button"),z=g("el-radio-group"),B=g("el-date-picker"),f=g("el-button"),D=g("el-input"),K=g("el-image"),Q=N("loading"),W=N("infinite-scroll");return t(),s("div",{class:I(["my-order",{"my-order-no-system":!$.isSystem}])},[e("div",ce,[e("div",re,_($.isSystem?"平台订单":"收银订单"),1),e("div",_e,[d(z,{modelValue:C.value,"onUpdate:modelValue":i[0]||(i[0]=a=>C.value=a),onChange:k,size:"small"},{default:v(()=>[d(y,{value:1},{default:v(()=>[p("全部")]),_:1}),d(y,{value:2},{default:v(()=>[p("未支付")]),_:1})]),_:1},8,["modelValue"]),d(B,{modelValue:V.value,"onUpdate:modelValue":i[1]||(i[1]=a=>V.value=a),type:"daterange","start-placeholder":"开始时间","end-placeholder":"结束时间",size:"small","value-format":"YYYY/MM/DD",onChange:A,style:{width:"14rem","margin-left":"1rem"}},null,8,["modelValue"])]),$.isSystem?l("",!0):(t(),s("div",ue,[d(z,{modelValue:w.value,"onUpdate:modelValue":i[2]||(i[2]=a=>w.value=a),onChange:k,size:"small"},{default:v(()=>[d(y,{value:0},{default:v(()=>[p("全部")]),_:1}),d(y,{value:1},{default:v(()=>[p("现金收款")]),_:1}),d(y,{value:2},{default:v(()=>[p("线上收款")]),_:1})]),_:1},8,["modelValue"])]))]),e("div",ve,[d(D,{modelValue:r.value.search_info,"onUpdate:modelValue":i[4]||(i[4]=a=>r.value.search_info=a),placeholder:"请输入订单编号",onKeydown:i[5]||(i[5]=te(a=>n(!0),["enter"])),onClear:i[6]||(i[6]=a=>n(!0)),clearable:""},{append:v(()=>[d(f,{type:"primary",style:{"background-color":"#1890ff",color:"#fff","border-radius":"0 0.315rem 0.315rem 0"},onClick:i[3]||(i[3]=a=>n(!0))},{default:v(()=>[p("搜索")]),_:1})]),_:1},8,["modelValue"])]),J((t(),s("div",pe,[(t(!0),s(j,null,x(c.value,(a,R)=>(t(),s("div",{class:I(["item",{"item-active":P.value==R}]),key:R,onClick:T=>q(a,R)},[e("div",me,[e("div",{class:I(["sn",a.pay_type===11||a.pay_type===12||a.pay_type===13?"cahier":"cahier2"])}," 单号: "+_(a.order_sn),3),e("div",ye,_(a.create_time),1)]),e("div",he,[a.orderProduct?(t(),s("div",ge,[(t(!0),s(j,null,x(a.orderProduct.slice(0,5),(T,X)=>(t(),F(K,{key:X,src:T.cart_info.productAttr.image||T.cart_info.product.image,class:"shop-img"},null,8,["src"]))),128)),a.orderProduct.length==1?(t(),s("div",ke,_(a.orderProduct[0].cart_info.product.store_name),1)):l("",!0)])):l("",!0),e("div",$e,[e("div",be,"¥"+_(a.pay_price),1),e("div",Ce,"共"+_(a.total_num)+"件商品",1)])]),e("div",Ve,[e("div",Se,[a.paid?(t(),s("div",we,[p(" 已支付 "),a.pay_type==13?(t(),s("span",Ye,"(支付宝收款)")):l("",!0),a.pay_type==12?(t(),s("span",De,"(现金支付)")):l("",!0),a.pay_type==11?(t(),s("span",Pe,"(微信收款)")):l("",!0),a.pay_type==0?(t(),s("span",Le,"(余额支付)")):l("",!0),a.pay_type==1?(t(),s("span",Ie,"(微信支付)")):l("",!0),a.pay_type==9?(t(),s("span",Me,"(商户余额支付)")):l("",!0),a.pay_type==10?(t(),s("span",Ae,"(对公转账)")):l("",!0)])):(t(),s("div",qe,"未支付"))]),a.service_info?(t(),s("div",ze," 收银员: "+_(a.service_info.nickname),1)):(t(),s("div",Ue,"平台订单"))])],10,fe))),128)),Y.value?(t(),s("div",Be,"没有更多了")):l("",!0),b.value?(t(),s("div",Re,"加载中...")):l("",!0)])),[[Q,b.value],[W,n]])],2)}}},Qt=H(Te,[["__scopeId","data-v-afd5b49f"]]),h=$=>(oe("data-v-e6e9d4a9"),$=$(),ae(),$),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"}},He={style:{display:"flex","align-items":"center"}},Ge={style:{"margin-left":"0.5rem"}},Je={key:1,class:"table"},Qe=h(()=>e("div",{class:"table-title"},"订单信息",-1)),We={class:"table-info"},Xe={class:"info-item"},Ze=h(()=>e("div",{class:"info-item-title"},"创建时间:",-1)),et={class:"info-item-info"},tt={class:"info-item"},st=h(()=>e("div",{class:"info-item-title"},"商品总数:",-1)),ot={class:"info-item-info"},at={class:"info-item"},it=h(()=>e("div",{class:"info-item-title"},"商品总价:",-1)),lt={class:"info-item-info"},nt={class:"info-item"},dt=h(()=>e("div",{class:"info-item-title"},"支付时间:",-1)),ct={class:"info-item-info"},rt={class:"info-item"},_t=h(()=>e("div",{class:"info-item-title"},"优惠抵扣:",-1)),ut={class:"info-item-info"},vt={class:"info-item"},pt=h(()=>e("div",{class:"info-item-title"},"实际支付:",-1)),ft={class:"info-item-info"},mt={class:"info-item"},yt=h(()=>e("div",{class:"info-item-title"},"支付方式:",-1)),ht={class:"info-item-info"},gt={key:0},kt={key:1},$t={key:2},bt={key:3},Ct={key:4},Vt={key:5},St={key:6},wt={key:0,class:"table-title"},Yt={key:1,class:"table-info",style:{"flex-direction":"column"}},Dt={class:"info-item"},Pt=h(()=>e("div",{class:"info-item-title"},"头像:",-1)),Lt={class:"info-item-info"},It={class:"info-item"},Mt=h(()=>e("div",{class:"info-item-title"},"昵称:",-1)),At={class:"info-item-info"},qt={class:"info-item"},zt=h(()=>e("div",{class:"info-item-title"},"账号:",-1)),Ut={class:"info-item-info"},Bt={key:2,class:"footer"},Rt={class:"info"},Tt={class:"ser"},Et={class:"price"},Nt={key:0,class:"handle"},jt={key:1,class:"handle"},xt=h(()=>e("span",null,"提单前请清空购物车, 避免提单的商品与购物车商品混合, 请确保购物车内无数据后再进行提单",-1)),Ft={class:"dialog-footer"},Kt={__name:"detail",setup($){const S=G(),M=se(),o=u({});L.on("set-order-detail",c=>{o.value=c}),u([]);const C=u(null),w=u(!1);u(0);const k=u(0),V=u(["商品信息","订单详情"]),A=u(""),r=u(!1),b=c=>{A.value=c,r.value=!0},U=()=>{r.value=!1,le({order_sn:A.value,staff_id:S.userInfo.service.service_id}).then(c=>{E({message:c.message,type:"success"}),M.push({name:"home"})})},P=c=>{C.value.setRePay({price:c.pay_price,order_id:c.group_order_id}),C.value.drawer=!0},Y=c=>{ne({order_sn:c}).then(n=>{n.data.paid==1||n.message=="支付成功"?(E({message:n.message,type:"success"}),L.emit("update-order-detail",{}),o.value.paid=1):E({message:n.message,type:"error"})}).catch(n=>{})};return(c,n)=>{const q=g("el-image"),m=g("el-table-column"),i=g("el-table"),y=g("el-button"),z=g("el-dialog"),B=N("loading");return t(),s("div",Ee,[e("div",Ne,[(t(!0),s(j,null,x(V.value,(f,D)=>(t(),s("div",{key:D,class:I(["nav-item",{"nav-item-active":k.value==D,"nav-item-radius1":k.value==D+1,"nav-item-radius2":k.value==D-1}]),onClick:K=>k.value=D},_(f),11,je))),128)),e("div",{class:I(["nav-item",{"nav-item-radius2":k.value==V.value.length-1}]),style:{flex:"1"}},null,2)]),J((t(),s("div",xe,[o.value.orderProduct&&k.value==0?(t(),s("div",Fe,[e("div",Ke,[p(" 共计 "),e("span",Oe,_(o.value.total_num),1),p(" 件商品 ")]),d(i,{style:{height:"calc(100vh - 100px - 14rem)"},data:o.value.orderProduct},{default:v(()=>[d(m,{prop:"cart_info.product.store_name",label:"商品信息"},{default:v(({row:f})=>[e("div",He,[d(q,{style:{height:"3rem",width:"3rem"},src:f.cart_info.productAttr.image||f.cart_info.product.image},null,8,["src"]),e("span",Ge,_(f.cart_info.product.store_name),1)])]),_:1}),d(m,{prop:"cart_info.productAttr.price",label:"单价",width:"150"}),d(m,{prop:"product_num",label:"数量",width:"150"}),d(m,{prop:"total_price",label:"总价",width:"150"})]),_:1},8,["data"])])):l("",!0),o.value.orderProduct&&k.value==1?(t(),s("div",Je,[Qe,e("div",We,[e("div",Xe,[Ze,e("div",et,_(o.value.create_time),1)]),e("div",tt,[st,e("div",ot,_(o.value.total_num),1)]),e("div",at,[it,e("div",lt,"¥"+_(o.value.total_price),1)]),e("div",nt,[dt,e("div",ct,_(o.value.pay_time),1)]),e("div",rt,[_t,e("div",ut,"¥"+_(o.value.deduction_price),1)]),e("div",vt,[pt,e("div",ft,"¥"+_(o.value.pay_price),1)]),e("div",mt,[yt,e("div",ht,[o.value.pay_type==11?(t(),s("span",gt,"微信收款")):l("",!0),o.value.pay_type==12?(t(),s("span",kt,"现金支付")):l("",!0),o.value.pay_type==13?(t(),s("span",$t,"支付宝收款")):l("",!0),o.value.pay_type==0?(t(),s("span",bt,"余额支付")):l("",!0),o.value.pay_type==1?(t(),s("span",Ct,"微信支付")):l("",!0),o.value.pay_type==9?(t(),s("span",Vt,"商户余额支付")):l("",!0),o.value.pay_type==10?(t(),s("span",St,"对公转账")):l("",!0)])])]),o.value.service_info?(t(),s("div",wt,"收银员信息")):l("",!0),o.value.service_info?(t(),s("div",Yt,[e("div",Dt,[Pt,e("div",Lt,[d(q,{style:{height:"4rem",width:"4rem","border-radius":"50%"},src:o.value.service_info.avatar},null,8,["src"])])]),e("div",It,[Mt,e("div",At,_(o.value.service_info.nickname),1)]),e("div",qt,[zt,e("div",Ut,_(o.value.service_info.account),1)])])):l("",!0)])):l("",!0),o.value.service_info?(t(),s("div",Bt,[e("div",Rt,[e("div",Tt,"收银员: "+_(o.value.service_info.nickname),1),e("div",Et,[p(" 实付: "),e("span",null,"¥"+_(o.value.pay_price),1)])]),o.value.paid?(t(),s("div",jt,"已支付")):(t(),s("div",Nt,[d(y,{class:"btn",type:"primary",onClick:n[0]||(n[0]=f=>P(o.value))},{default:v(()=>[p("重新支付")]),_:1}),d(y,{class:"btn",type:"primary",onClick:n[1]||(n[1]=f=>Y(o.value.order_sn))},{default:v(()=>[p("检测状态")]),_:1}),d(y,{class:"btn",type:"success",onClick:n[2]||(n[2]=f=>b(o.value.order_sn))},{default:v(()=>[p("提单")]),_:1})]))])):l("",!0)])),[[B,w.value]]),d(de,{ref_key:"payRef",ref:C},null,512),d(z,{modelValue:r.value,"onUpdate:modelValue":n[4]||(n[4]=f=>r.value=f),title:"提示",width:"500"},{footer:v(()=>[e("div",Ft,[d(y,{onClick:n[3]||(n[3]=f=>r.value=!1)},{default:v(()=>[p("取消")]),_:1}),c.cartCount>0?(t(),F(y,{key:0,onClick:c.goHome},{default:v(()=>[p(" 前去清空购物车 ")]),_:1},8,["onClick"])):(t(),F(y,{key:1,type:"primary",onClick:U},{default:v(()=>[p(" 确认提单 ")]),_:1}))])]),default:v(()=>[xt]),_:1},8,["modelValue"])])}}},Wt=H(Kt,[["__scopeId","data-v-e6e9d4a9"]]);export{Wt as d,Qt as o};