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

2 lines
10 KiB
JavaScript

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