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

2 lines
8.5 KiB
JavaScript

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