cashier-mer/build/assets/index-DkxSzkWt.js

2 lines
8.7 KiB
JavaScript

import{_ as H,u as j,r as l,b as m,l as L,c as s,h as o,e,f as _,w as x,g as C,p as q,v as g,F as U,i as A,x as u,m as O,E as K,s as M,t as n,d as G,y as J,z as P,D as X,o as Q,a as Y,n as T,H as D,I as Z}from"./index-DHeiRjQX.js";import{e as ee,d as te,w as se}from"./store-BKcq1Vfo.js";/* empty css */import{p as oe}from"./padding-CGeVIEC_.js";const ie=r=>(J("data-v-c1565278"),r=r(),P(),r),ae={class:"my-order"},le={class:"header-nav"},ne=ie(()=>e("div",{class:"nav-item"},"核销订单",-1)),ce={class:"nav-item-clear"},de={class:"header-input"},_e={class:"order-lists","infinite-scroll-distance":300,"infinite-scroll-delay":500,style:{overflow:"auto"}},re=["onClick"],ve={class:"top"},ue={class:"create-time"},pe={class:"shop"},fe={key:0,class:"left"},he={key:0,class:"shop-name"},ye={class:"right"},me={class:"money"},ge={class:"count"},ke={class:"bottom"},$e={class:"pay"},be={key:0},we={key:0},xe={key:1},Ce={key:2},ze={key:3},Ie={key:4},Se={key:1,style:{color:"#ff4a00"}},Ve={key:0,class:"cashier"},De={key:1,class:"cashier",style:{color:"#ff4a00"}},Oe={key:0,class:"load-end"},Re={key:1,class:"load-end"},Be={__name:"order",emits:["backOne"],setup(r,{expose:t,emit:h}){j(),l([]),l(null);const i=l({verify_code:""}),p=l(!1),k=l(0),$=l(0),c=l(!1),v=l([]),y=(b=!1)=>{i.value.verify_code=i.value.verify_code.replace("—","-"),i.value.verify_code=i.value.verify_code.replace(/\uFF0D/,"-"),i.value.verify_code=i.value.verify_code.replace(" ",""),ee(i.value).then(d=>{v.value=[d.data],$.value=0,O.emit("set-sale-order-detail",v.value[0]),k.value=d.data.count,v.value[0].is_writeoff&&K.warning("订单已核销过")}).catch(d=>{})},w=(b,d)=>{$.value=d,O.emit("set-order-detail",b)},R=b=>{i.value.verify_code=b,y(!0)},B=h,E=()=>{B("backOne")};return t({setCode:R}),(b,d)=>{const z=m("el-button"),I=m("el-input"),S=m("el-image"),V=L("loading");return s(),o("div",ae,[e("div",le,[ne,e("div",ce,[_(z,{type:"primary",size:"small",onClick:E},{default:x(()=>[C("返回上一页")]),_:1})])]),e("div",de,[_(I,{modelValue:i.value.verify_code,"onUpdate:modelValue":d[1]||(d[1]=a=>i.value.verify_code=a),placeholder:"请输入核销码",onKeydown:d[2]||(d[2]=q(a=>y(!0),["enter"])),clearable:""},{append:x(()=>[_(z,{type:"primary",style:{"background-color":"#1890ff",color:"#fff","border-radius":"0 0.315rem 0.315rem 0"},onClick:d[0]||(d[0]=a=>y(!0))},{default:x(()=>[C("搜索")]),_:1})]),_:1},8,["modelValue"])]),g((s(),o("div",_e,[(s(!0),o(U,null,A(v.value,(a,F)=>(s(),o("div",{class:M(["item",{"item-active":$.value==F}]),key:F,onClick:N=>w(a,F)},[e("div",ve,[e("div",{class:M(["sn","cahier"])},"单号: "+n(a.order_id),1),e("div",ue,n(a.pay_time),1)]),e("div",pe,[a.product?(s(),o("div",fe,[(s(!0),o(U,null,A(a.product.slice(0,5),(N,W)=>(s(),G(S,{key:W,src:N.cart_info.image,class:"shop-img"},null,8,["src"]))),128)),a.product.length==1?(s(),o("div",he,n(a.product[0].store_name),1)):u("",!0)])):u("",!0),e("div",ye,[e("div",me,"¥"+n(a.pay_price),1),e("div",ge,"共"+n(a.total_num)+"款商品",1)])]),e("div",ke,[e("div",$e,[a.paid?(s(),o("div",be,[C(n(a.paid_name)+" ",1),a.pay_type==9?(s(),o("span",we,"(微信收款)")):u("",!0),a.pay_type==17?(s(),o("span",xe,"(现金支付)")):u("",!0),a.pay_type==13?(s(),o("span",Ce,"(支付宝收款)")):u("",!0),a.pay_type==3?(s(),o("span",ze,"(余额支付)")):u("",!0),a.pay_type==1?(s(),o("span",Ie,"(微信支付)")):u("",!0)])):(s(),o("div",Se,n(a.paid_name),1))]),a.is_writeoff==0?(s(),o("div",Ve,"核销码:"+n(a.verify_code),1)):(s(),o("div",De,"已核销:"+n(a.verify_code),1))])],10,re))),128)),c.value?(s(),o("div",Oe,"没有更多了")):u("",!0),p.value?(s(),o("div",Re,"加载中...")):u("",!0)])),[[V,p.value]])])}}},Ee=H(Be,[["__scopeId","data-v-c1565278"]]),f=r=>(J("data-v-76c1152d"),r=r(),P(),r),Fe={class:"my-order"},Le={key:0,class:"detail"},Ke={class:"table","infinite-scroll-distance":300,"infinite-scroll-delay":300,style:{overflow:"auto"},"infinite-scroll-immediate":!1},Ne=f(()=>e("div",{class:"table-title"},"订单信息",-1)),Ue={class:"table-info"},Ae={class:"info-item"},Me=f(()=>e("div",{class:"info-item-title"},"订单编号:",-1)),Te={class:"info-item-info"},He={class:"info-item"},je=f(()=>e("div",{class:"info-item-title"},"商品款数:",-1)),qe={class:"info-item-info"},Ge={class:"info-item"},Je=f(()=>e("div",{class:"info-item-title"},"商品总价:",-1)),Pe={class:"info-item-info"},Qe={class:"info-item"},We=f(()=>e("div",{class:"info-item-title"},"创建时间:",-1)),Xe={class:"info-item-info"},Ye={class:"info-item"},Ze=f(()=>e("div",{class:"info-item-title"},"优惠抵扣:",-1)),et={class:"info-item-info"},tt={class:"info-item"},st=f(()=>e("div",{class:"info-item-title"},"实际支付:",-1)),ot={class:"info-item-info"},it={class:"info-item"},at=f(()=>e("div",{class:"info-item-title"},"支付时间:",-1)),lt={class:"info-item-info"},nt={class:"info-item"},ct=f(()=>e("div",{class:"info-item-title"},"支付方式:",-1)),dt={class:"info-item-info"},_t={key:0},rt={key:1},vt={key:2},ut={key:3},pt={key:4},ft={key:5},ht={style:{"font-size":"0.9rem"}},yt={style:{color:"#ff4a00"}},mt={style:{display:"flex","align-items":"center"}},gt={style:{"margin-left":"0.5rem"}},kt={class:"footer"},$t={key:1},bt={key:1},wt={__name:"detail",setup(r){j(),X();const t=l({id:""});l([]),l(null);const h=l(!1);l(0),l(0),l(["商品信息","订单详情"]),l(""),l(!1);const i=l({page_no:1,page_size:15,loadend:!1,loading:!1}),p=l([]),k=()=>{console.log("触底"),t.value.id&&!i.value.loadend&&(console.log("加载"),i.value.loading=!0,te({pid:t.value.id,page_no:i.value.page_no,page_size:i.value.page_size}).then(c=>{p.value=[...p.value,...c.data.lists],c.data.lists.length<i.value.page_size&&(i.value.loadend=!0),i.value.loading=!1,i.value.page_no++}))},$=()=>{se({verify_code:t.value.verify_code}).then(c=>{console.log("===",c),c.show==0&&c.msg=="核销成功"&&K.success(c.msg),t.value.is_writeoff=1})};return Q(()=>{O.on("set-sale-order-detail",c=>{console.log("===",c),t.value=c,i.value.page_no=1,i.value.loadend=!1,i.value.loading=!1,p.value=[]})}),Y(()=>{O.off("set-sale-order-detail")}),(c,v)=>{var z;const y=m("el-image"),w=m("el-table-column"),R=m("el-table"),B=m("el-button"),E=m("el-empty"),b=L("infinite-scroll"),d=L("loading");return s(),o("div",Fe,[t.value.id?g((s(),o("div",Le,[g((s(),o("div",Ke,[Ne,e("div",Ue,[e("div",Ae,[Me,e("div",Te,n(t.value.order_id),1)]),e("div",He,[je,e("div",qe,n(t.value.total_num||0),1)]),e("div",Ge,[Je,e("div",Pe,"¥"+n(t.value.total_price),1)]),e("div",Qe,[We,e("div",Xe,n(t.value.pay_time),1)]),e("div",Ye,[Ze,e("div",et,"¥"+n(t.value.deduction_price),1)]),e("div",tt,[st,e("div",ot,"¥"+n(t.value.pay_price),1)]),e("div",it,[at,e("div",lt,n(t.value.pay_time),1)]),e("div",nt,[ct,e("div",dt,[t.value.pay_type_name?(s(),o("span",_t,n(t.value.pay_type_name),1)):t.value.pay_type==9?(s(),o("span",rt,"微信收款")):t.value.pay_type==17?(s(),o("span",vt,"现金支付")):t.value.pay_type==13?(s(),o("span",ut,"支付宝收款")):t.value.pay_type==3?(s(),o("span",pt,"余额支付")):t.value.pay_type==1?(s(),o("span",ft,"微信支付")):u("",!0)])])]),e("div",ht,[C(" 共计 "),e("span",yt,n(((z=t.value.product)==null?void 0:z.length)||" "),1),C(" 款商品 ")]),_(R,{data:t.value.product},{default:x(()=>[_(w,{label:"商品信息"},{default:x(({row:I})=>{var S,V;return[e("div",mt,[_(y,{style:{height:"3rem",width:"3rem"},src:(S=I.cart_info)==null?void 0:S.image},null,8,["src"]),e("span",gt,n((V=I.cart_info)==null?void 0:V.name),1)])]}),_:1}),_(w,{prop:"cart_info.price",label:"单价",width:"150"}),_(w,{prop:"cart_info.cart_num",label:"数量",width:"150"}),_(w,{prop:"cart_info.total_price",label:"总价",width:"150"})]),_:1},8,["data"])])),[[b,k]]),e("div",kt,[t.value.is_writeoff==0?(s(),G(B,{key:0,type:"primary",size:"large",disabled:t.value.is_writeoff,onClick:$},{default:x(()=>[C("立即核销")]),_:1},8,["disabled"])):(s(),o("div",$t,"该订单已核销"))])])),[[d,h.value]]):(s(),o("div",bt,[_(E,{description:"没找到核销订单信息"})]))])}}},xt=H(wt,[["__scopeId","data-v-76c1152d"]]),Ct={class:"my-card"},zt={class:"my-code"},It=e("h2",null,"订单核销",-1),St={class:"box"},Bt={__name:"index",setup(r){const t=l(1),h=l(""),i=l(null),p=l(null),k=()=>{if(h.value=="")return K.error("请输入订单编号");t.value=2,T(()=>{p.value.setCode(h.value)})},$=()=>{k()};return Q(()=>{T(()=>{i.value.focus()})}),(c,v)=>(s(),o("div",Ct,[g(e("div",zt,[It,e("div",St,[g(e("input",{ref_key:"inputRef",ref:i,"onUpdate:modelValue":v[0]||(v[0]=y=>h.value=y),placeholder:"",class:"input",onKeyup:q(k,["enter"])},null,544),[[Z,h.value]]),e("div",{class:"btn",onClick:k},"查询")])],512),[[D,t.value==1]]),g(_(Ee,{style:{"flex-shrink":"0"},ref_key:"orderRef",ref:p,onBackOne:v[1]||(v[1]=y=>t.value=1)},null,512),[[D,t.value==2]]),g(_(oe,null,null,512),[[D,t.value==2]]),g(_(xt,{ref:"detailRef",onReInit:$},null,512),[[D,t.value==2]])]))}};export{Bt as default};