2 lines
11 KiB
JavaScript
2 lines
11 KiB
JavaScript
import{_ as G,u as J,r as a,b as w,j as M,c as t,h as s,e,f as c,w as p,g as $,k as Q,q as I,F as T,i as j,s as l,E as L,m as U,p as B,t as d,d as q,v as W,x as X,A as Y,n as H,o as Z,H as O,I as ee}from"./index-3-t8Fk7s.js";import{v as te,f as se,j as oe}from"./pay.vue_vue_type_style_index_0_scoped_7f298acd_lang-BaAcCNPN.js";import{p as ie}from"./pay-Bt7FIL7i.js";import{p as ae}from"./padding-DTyMU7Be.js";const ne=y=>(W("data-v-0f73b4d2"),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"},me={class:"shop"},he={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},Se={key:1},Ie={key:2},xe={key:3},Re={key:4},Le={key:5},Ae={key:6},Pe={key:1,style:{color:"#ff4a00"}},Ee={key:0,class:"cashier"},Oe={key:1,class:"cashier"},Ue={key:0,class:"load-end"},Be={key:1,class:"load-end"},ze={__name:"order",emits:["backOne"],setup(y,{expose:k,emit:S}){const x=J();a([]);const o=a(1);a(null);const v=a({page:1,limit:20,search_info:""}),g=a(!1);a(0);const m=a(0),h=a(!1),b=a([]),C=(r=!1)=>{if(!v.value.search_info)return L.error("请输入订单编号");if(r)v.value.page=1;else if(h.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(x.userInfo.service.mer_id,v.value.search_info).then(n=>{b.value=[n.data],U.emit("set-order-detail",b.value[0]),g.value=!1}).catch(n=>{h.value=!0,g.value=!1})},z=(r,n)=>{m.value=n,U.emit("set-order-detail",r)},D=r=>{v.value.search_info=r,C(!0)},A=S,K=()=>{A("backOne")};return k({setCode:D}),(r,n)=>{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,[c(u,{type:"primary",size:"small",onClick:K},{default:p(()=>[$("返回上一页")]),_:1})])]),e("div",_e,[c(E,{modelValue:v.value.search_info,"onUpdate:modelValue":n[1]||(n[1]=i=>v.value.search_info=i),placeholder:"请输入订单编号",onKeydown:n[2]||(n[2]=Q(i=>C(!0),["enter"])),clearable:""},{append:p(()=>[c(u,{type:"primary",style:{"background-color":"#1890ff",color:"#fff","border-radius":"0 0.315rem 0.315rem 0"},onClick:n[0]||(n[0]=i=>C(!0))},{default:p(()=>[$("搜索")]),_:1})]),_:1},8,["modelValue"])]),I((t(),s("div",ue,[(t(!0),s(T,null,j(b.value,(i,P)=>(t(),s("div",{class:B(["item",{"item-active":m.value==P}]),key:P,onClick:_=>z(i,P)},[e("div",pe,[e("div",{class:B(["sn",i.pay_type===11||i.pay_type===12||i.pay_type===13?"cahier":"cahier2"])},"单号: "+d(i.order_sn),3),e("div",fe,d(i.create_time),1)]),e("div",me,[i.orderProduct?(t(),s("div",he,[(t(!0),s(T,null,j(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,d(i.orderProduct[0].cart_info.product.store_name),1)):l("",!0)])):l("",!0),e("div",ke,[e("div",ge,"¥"+d(i.pay_price),1),e("div",$e,"共"+d(i.total_num)+"件商品",1)])]),e("div",be,[e("div",Ce,[i.paid?(t(),s("div",Ve,[$(" 已支付 "),i.pay_type==13?(t(),s("span",we,"(支付宝收款)")):l("",!0),i.pay_type==12?(t(),s("span",Se,"(现金支付)")):l("",!0),i.pay_type==11?(t(),s("span",Ie,"(微信收款)")):l("",!0),i.pay_type==0?(t(),s("span",xe,"(余额支付)")):l("",!0),i.pay_type==1?(t(),s("span",Re,"(微信支付)")):l("",!0),i.pay_type==9?(t(),s("span",Le,"(商户余额支付)")):l("",!0),i.pay_type==10?(t(),s("span",Ae,"(对公转账)")):l("",!0)])):(t(),s("div",Pe,"未支付"))]),i.service_info?(t(),s("div",Ee,"收银员: "+d(i.service_info.nickname),1)):(t(),s("div",Oe,"平台订单"))])],10,ve))),128)),h.value?(t(),s("div",Ue,"没有更多了")):l("",!0),g.value?(t(),s("div",Be,"加载中...")):l("",!0)])),[[F,g.value],[R,C]])])}}},De=G(ze,[["__scopeId","data-v-0f73b4d2"]]),f=y=>(W("data-v-5c9b212f"),y=y(),X(),y),Ke={class:"my-order"},Ne={class:"header-nav"},Fe=["onClick"],Me={class:"detail"},Te={key:0,class:"table"},je={style:{"font-size":"0.9rem"}},qe={style:{color:"#ff4a00"}},He={style:{display:"flex","align-items":"center"}},Ge={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"},mt=f(()=>e("div",{class:"info-item-title"},"支付方式:",-1)),ht={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"},St={key:1,class:"table-info",style:{"flex-direction":"column"}},It={class:"info-item"},xt=f(()=>e("div",{class:"info-item-title"},"头像:",-1)),Rt={class:"info-item-info"},Lt={class:"info-item"},At=f(()=>e("div",{class:"info-item-title"},"昵称:",-1)),Pt={class:"info-item-info"},Et={class:"info-item"},Ot=f(()=>e("div",{class:"info-item-title"},"账号:",-1)),Ut={class:"info-item-info"},Bt={class:"footer"},zt={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 S=J(),x=Y(),o=a({});U.on("set-order-detail",r=>{o.value=r,H(()=>{var n;(n=A.value)==null||n.toggleAllSelection()})}),a([]);const v=a(null),g=a(!1);a(0);const m=a(0),h=a(["商品信息","订单详情"]),b=a(""),C=a(!1),z=()=>{C.value=!1,se({order_sn:b.value}).then(r=>{L({message:r.message,type:"success"}),x.push({name:"home"})})},D=k,A=a(null),K=()=>{let r=A.value.getSelectionRows();if(r.length==0)return L.error("请选择核销商品");let n={data:[],verify_code:o.value.verify_code};r.forEach(u=>{n.data.push({id:u.order_product_id,num:u.product_num})}),oe(S.userInfo.service.mer_id,o.value.order_id,n).then(u=>{L.success(u.message),D("reInit")}).catch(u=>{L.error(u.message)})};return(r,n)=>{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"),P=M("loading");return t(),s("div",Ke,[e("div",Ne,[(t(!0),s(T,null,j(h.value,(_,V)=>(t(),s("div",{key:V,class:B(["nav-item",{"nav-item-active":m.value==V,"nav-item-radius1":m.value==V+1,"nav-item-radius2":m.value==V-1}]),onClick:Qt=>m.value=V},d(_),11,Fe))),128)),e("div",{class:B(["nav-item",{"nav-item-radius2":m.value==h.value.length-1}]),style:{flex:"1"}},null,2)]),I((t(),s("div",Me,[o.value.orderProduct&&m.value==0?(t(),s("div",Te,[e("div",je,[$(" 共计 "),e("span",qe,d(o.value.total_num),1),$(" 件商品 ")]),c(F,{style:{height:"calc(100vh - 100px - 14rem)"},data:o.value.orderProduct,ref_key:"tableRef",ref:A},{default:p(()=>[c(u,{type:"selection",width:"55"}),c(u,{prop:"cart_info.product.store_name",label:"商品信息"},{default:p(({row:_})=>[e("div",He,[c(E,{style:{height:"3rem",width:"3rem"},src:_.cart_info.productAttr.image||_.cart_info.product.image},null,8,["src"]),e("span",Ge,d(_.cart_info.product.store_name),1)])]),_:1}),c(u,{prop:"cart_info.productAttr.price",label:"单价",width:"150"}),c(u,{prop:"product_num",label:"数量",width:"180"},{default:p(({row:_})=>[c(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}),c(u,{prop:"total_price",label:"总价",width:"150"})]),_:1},8,["data"])])):l("",!0),o.value.orderProduct&&m.value==1?(t(),s("div",Je,[Qe,e("div",We,[e("div",Xe,[Ye,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,[it,e("div",at,"¥"+d(o.value.total_price),1)]),e("div",nt,[lt,e("div",ct,d(o.value.pay_time),1)]),e("div",dt,[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",kt,"现金支付")):l("",!0),o.value.pay_type==13?(t(),s("span",gt,"支付宝收款")):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",wt,"收银员信息")):l("",!0),o.value.service_info?(t(),s("div",St,[e("div",It,[xt,e("div",Rt,[c(E,{style:{height:"4rem",width:"4rem","border-radius":"50%"},src:o.value.service_info.avatar},null,8,["src"])])]),e("div",Lt,[At,e("div",Pt,d(o.value.service_info.nickname),1)]),e("div",Et,[Ot,e("div",Ut,d(o.value.service_info.account),1)])])):l("",!0)])):l("",!0),e("div",Bt,[e("div",zt,[e("div",Dt,[$(" 实付: "),e("span",null,"¥"+d(o.value.pay_price),1)])]),o.value.verify_status==0?(t(),s("div",Kt,[c(R,{class:"btn",type:"warning",onClick:K},{default:p(()=>[$("核销")]),_:1})])):(t(),s("div",Nt,"已支付"))])])),[[P,g.value]]),c(ie,{ref_key:"payRef",ref:v},null,512),c(i,{modelValue:C.value,"onUpdate:modelValue":n[1]||(n[1]=_=>C.value=_),title:"提示",width:"500"},{footer:p(()=>[e("div",Mt,[c(R,{onClick:n[0]||(n[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:z},{default:p(()=>[$(" 确认提单 ")]),_:1}))])]),default:p(()=>[Ft]),_:1},8,["modelValue"])])}}},jt=G(Tt,[["__scopeId","data-v-5c9b212f"]]),qt={class:"my-card"},Ht={class:"my-code"},Gt=e("h2",null,"订单核销",-1),Jt={class:"box"},es={__name:"index",setup(y){const k=a(1),S=a(""),x=a(null),o=a(null),v=()=>{if(S.value=="")return L.error("请输入订单编号");k.value=2,H(()=>{o.value.setCode(S.value)})},g=()=>{v()};return Z(()=>{H(()=>{x.value.focus()})}),(m,h)=>(t(),s("div",qt,[I(e("div",Ht,[Gt,e("div",Jt,[I(e("input",{ref_key:"inputRef",ref:x,"onUpdate:modelValue":h[0]||(h[0]=b=>S.value=b),placeholder:"",class:"input",onKeyup:Q(v,["enter"])},null,544),[[ee,S.value]]),e("div",{class:"btn",onClick:v},"查询")])],512),[[O,k.value==1]]),I(c(De,{style:{"flex-shrink":"0"},ref_key:"orderRef",ref:o,onBackOne:h[1]||(h[1]=b=>k.value=1)},null,512),[[O,k.value==2]]),I(c(ae,null,null,512),[[O,k.value==2]]),I(c(jt,{ref:"detailRef",onReInit:g},null,512),[[O,k.value==2]])]))}};export{es as default};
|