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

2 lines
10 KiB
JavaScript

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