2 lines
10 KiB
JavaScript
2 lines
10 KiB
JavaScript
import{_ as O,x as j,r as a,b as C,j as K,c as t,h as s,e,f as d,w as f,g as y,k as q,p as x,F as N,i as U,l as A,t as l,d as F,q as n,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-u0hj8LVS.js";import{v as Y,p as Z,f as ee}from"./pay-D-50vyYW.js";import{p as te}from"./padding-BLY6EjEZ.js";const se=h=>(H("data-v-aaca35b5"),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"},me={class:"count"},ye={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:1,style:{color:"#ff4a00"}},Pe={key:0,class:"cashier"},Re={key:1,class:"cashier"},Le={key:0,class:"load-end"},Ie={key:1,class:"load-end"},Ae={__name:"order",setup(h,{expose:k}){const i=j();a([]);const g=a(1);a(null);const r=a({page:1,limit:20,search_info:""}),c=a(!1);a(0);const S=a(0),b=a(!1),p=a([]),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(()=>[y("返回上一页")]),_: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(()=>[y("搜索")]),_: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?"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)):n("",!0)])):n("",!0),e("div",fe,[e("div",he,"¥"+l(o.pay_price),1),e("div",me,"共"+l(o.total_num)+"件商品",1)])]),e("div",ye,[e("div",ke,[o.paid?(t(),s("div",ge,[y(" 已支付 "),o.pay_type==12?(t(),s("span",$e,"(现金支付)")):n("",!0),o.pay_type==11?(t(),s("span",be,"(微信支付)")):n("",!0),o.pay_type==0?(t(),s("span",Ce,"(余额支付)")):n("",!0),o.pay_type==1?(t(),s("span",we,"(微信支付)")):n("",!0),o.pay_type==9?(t(),s("span",xe,"(商户余额支付)")):n("",!0),o.pay_type==10?(t(),s("span",Se,"(对公转账)")):n("",!0)])):(t(),s("div",Ve,"未支付"))]),o.service_info?(t(),s("div",Pe,"收银员: "+l(o.service_info.nickname),1)):(t(),s("div",Re,"平台订单"))])],10,de))),128)),b.value?(t(),s("div",Le,"没有更多了")):n("",!0),c.value?(t(),s("div",Ie,"加载中...")):n("",!0)])),[[z,c.value],[D,V]])])}}},Be=O(Ae,[["__scopeId","data-v-aaca35b5"]]),v=h=>(H("data-v-e39dfe99"),h=h(),G(),h),Ee={class:"my-order"},ze={class:"header-nav"},De=["onClick"],Ke={class:"detail"},Ne={key:0,class:"table"},Ue={style:{"font-size":"0.9rem"}},Fe={style:{color:"#ff4a00"}},Me={style:{display:"flex","align-items":"center"}},Te={style:{"margin-left":"0.5rem"}},Oe={key:1,class:"table"},je=v(()=>e("div",{class:"table-title"},"订单信息",-1)),qe={class:"table-info"},He={class:"info-item"},Ge=v(()=>e("div",{class:"info-item-title"},"创建时间:",-1)),Je={class:"info-item-info"},Qe={class:"info-item"},We=v(()=>e("div",{class:"info-item-title"},"商品总数:",-1)),Xe={class:"info-item-info"},Ye={class:"info-item"},Ze=v(()=>e("div",{class:"info-item-title"},"商品总价:",-1)),et={class:"info-item-info"},tt={class:"info-item"},st=v(()=>e("div",{class:"info-item-title"},"支付时间:",-1)),ot={class:"info-item-info"},it={class:"info-item"},at=v(()=>e("div",{class:"info-item-title"},"优惠抵扣:",-1)),nt={class:"info-item-info"},lt={class:"info-item"},ct=v(()=>e("div",{class:"info-item-title"},"实际支付:",-1)),dt={class:"info-item-info"},_t={class:"info-item"},rt=v(()=>e("div",{class:"info-item-title"},"支付方式:",-1)),ut={class:"info-item-info"},vt={key:0},pt={key:1},ft={key:2},ht={key:3},mt={key:4},yt={key:5},kt={key:0,class:"table-title"},gt={key:1,class:"table-info",style:{"flex-direction":"column"}},$t={class:"info-item"},bt=v(()=>e("div",{class:"info-item-title"},"头像:",-1)),Ct={class:"info-item-info"},wt={class:"info-item"},xt=v(()=>e("div",{class:"info-item-title"},"昵称:",-1)),St={class:"info-item-info"},Vt={class:"info-item"},Pt=v(()=>e("div",{class:"info-item-title"},"账号:",-1)),Rt={class:"info-item-info"},Lt={class:"footer"},It={class:"info"},At={class:"price"},Bt={key:0,class:"handle"},Et={key:1,class:"handle"},zt=v(()=>e("span",null,"提单前请清空购物车, 避免提单的商品与购物车商品混合, 请确保购物车内无数据后再进行提单",-1)),Dt={class:"dialog-footer"},Kt={__name:"detail",setup(h){j();const k=Q(),i=a({});I.on("set-order-detail",m=>{i.value=m}),a([]);const g=a(null),r=a(!1);a(0);const c=a(0),S=a(["商品信息","订单详情"]),b=a(""),p=a(!1),V=()=>{p.value=!1,ee({order_sn:b.value}).then(m=>{M({message:m.message,type:"success"}),k.push({name:"home"})})},B=m=>{g.value.setRePay({price:m.pay_price,order_id:m.group_order_id}),g.value.drawer=!0};return(m,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",Ee,[e("div",ze,[(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,De))),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",Ke,[i.value.orderProduct&&c.value==0?(t(),s("div",Ne,[e("div",Ue,[y(" 共计 "),e("span",Fe,l(i.value.total_num),1),y(" 件商品 ")]),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",Me,[d(_,{style:{height:"3rem",width:"3rem"},src:o.cart_info.productAttr.image||o.cart_info.product.image},null,8,["src"]),e("span",Te,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"])])):n("",!0),i.value.orderProduct&&c.value==1?(t(),s("div",Oe,[je,e("div",qe,[e("div",He,[Ge,e("div",Je,l(i.value.create_time),1)]),e("div",Qe,[We,e("div",Xe,l(i.value.total_num),1)]),e("div",Ye,[Ze,e("div",et,"¥"+l(i.value.total_price),1)]),e("div",tt,[st,e("div",ot,l(i.value.pay_time),1)]),e("div",it,[at,e("div",nt,"¥"+l(i.value.deduction_price),1)]),e("div",lt,[ct,e("div",dt,"¥"+l(i.value.pay_price),1)]),e("div",_t,[rt,e("div",ut,[i.value.pay_type==11?(t(),s("span",vt,"微信收款")):n("",!0),i.value.pay_type==12?(t(),s("span",pt,"现金支付")):n("",!0),i.value.pay_type==0?(t(),s("span",ft,"余额支付")):n("",!0),i.value.pay_type==1?(t(),s("span",ht,"微信支付")):n("",!0),i.value.pay_type==9?(t(),s("span",mt,"商户余额支付")):n("",!0),i.value.pay_type==10?(t(),s("span",yt,"对公转账")):n("",!0)])])]),i.value.service_info?(t(),s("div",kt,"收银员信息")):n("",!0),i.value.service_info?(t(),s("div",gt,[e("div",$t,[bt,e("div",Ct,[d(_,{style:{height:"4rem",width:"4rem","border-radius":"50%"},src:i.value.service_info.avatar},null,8,["src"])])]),e("div",wt,[xt,e("div",St,l(i.value.service_info.nickname),1)]),e("div",Vt,[Pt,e("div",Rt,l(i.value.service_info.account),1)])])):n("",!0)])):n("",!0),e("div",Lt,[e("div",It,[e("div",At,[y(" 实付: "),e("span",null,"¥"+l(i.value.pay_price),1)])]),i.value.verify_status==0?(t(),s("div",Bt,[d(P,{class:"btn",type:"warning",onClick:u[0]||(u[0]=o=>B(i.value))},{default:f(()=>[y("核销")]),_:1})])):(t(),s("div",Et,"已支付"))])])),[[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",Dt,[d(P,{onClick:u[1]||(u[1]=o=>p.value=!1)},{default:f(()=>[y("取消")]),_:1}),m.cartCount>0?(t(),F(P,{key:0,onClick:m.goHome},{default:f(()=>[y(" 前去清空购物车 ")]),_:1},8,["onClick"])):(t(),F(P,{key:1,type:"primary",onClick:V},{default:f(()=>[y(" 确认提单 ")]),_:1}))])]),default:f(()=>[zt]),_:1},8,["modelValue"])])}}},Nt=O(Kt,[["__scopeId","data-v-e39dfe99"]]),Ut={class:"my-card"},Ft={class:"my-code"},Mt=e("h2",null,"订单核销",-1),Tt={class:"box"},Ht={__name:"index",setup(h){const k=a(1),i=a("1372640275688400"),g=a(null),r=a(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",Ut,[x(e("div",Ft,[Mt,e("div",Tt,[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(Be,{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(Nt,{ref:"detailRef"},null,512),[[L,k.value==2]])]))}};export{Ht as default};
|