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