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

2 lines
11 KiB
JavaScript

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