2024-09-02 20:52:04 +08:00
|
|
|
import{_ as q,u as W,r as l,b as f,h as E,c as s,k as o,e,t as a,f as _,w as m,g as w,i as G,j as $,F as P,l as T,p as u,m as b,E as F,z as j,d as N,I as X,o as H,a as Y,q as Z,s as ee,n as M,L as A,M as te}from"./index-CEprPOh1.js";import{f as se,l as oe,w as ie,k as ae}from"./store-BoFe3Agt.js";/* empty css */import{p as le}from"./padding-Bq_IbaOz.js";const ne={class:"my-order"},ce={class:"header-nav"},de={class:"nav-item"},_e={class:"nav-item-clear"},re={class:"header-input"},ve={class:"order-lists","infinite-scroll-distance":300,"infinite-scroll-delay":500,"infinite-scroll-immediate":!1,style:{overflow:"auto"}},ue=["onClick"],fe={class:"top"},pe={class:"create-time"},he={class:"shop"},ye={key:0,class:"left"},me={key:0,class:"shop-name"},ke={class:"right"},ge={class:"money"},$e={class:"count"},be={class:"bottom"},we={class:"pay"},Ce={key:0},xe={key:1},Re={key:2},Ie={key:3},ze={key:4},Oe={key:5},Ve={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"},Ae={__name:"order",props:{type:{type:Number,default:2}},emits:["backOne"],setup(C,{expose:t,emit:h}){W(),l([]),l(null);const n=l({verify_code:"",page_no:1,page_size:15}),r=l(!1),k=l(0),g=l(0),I=l(!1),c=l([]),p=(x=!1)=>{r.value||(r.value=!0,n.value.verify_code?(n.value.verify_code=n.value.verify_code.replace("—","-"),n.value.verify_code=n.value.verify_code.replace(/\uFF0D/,"-"),n.value.verify_code=n.value.verify_code.replace(" ",""),se({verify_code:n.value.verify_code}).then(d=>{c.value=[d.data],g.value=0,b.emit("set-sale-order-detail",c.value[0]),k.value=d.data.count,r.value=!1,c.value[0].is_writeoff&&F.warning("订单已核销过")}).catch(d=>{r.value=!1,F.error(d.msg||"没有找到该订单"),c.value=[],b.emit("set-sale-order-detail",{})})):oe(n.value).then(d=>{c.value=[...c.value,...d.data.lists],n.value.page_no==1&&b.emit("set-sale-order-detail",c.value[0]),k.value=d.data.count,n.value.page_no++,r.value=!1}).catch(d=>{r.value=!1}))},z=(x,d)=>{g.value=d,b.emit("set-sale-order-detail",x)},y=x=>{n.value.verify_code=x,g.value=0,n.value.page_no=1,p(!0)},R=h,O=()=>{b.emit("set-sale-order-detail",{}),c.value=[],R("backOne")};return t({setCode:y}),(x,d)=>{const V=f("el-button"),B=f("el-input"),D=f("el-image"),L=f("spna"),S=E("loading"),J=E("infinite-scroll");return s(),o("div",ne,[e("div",ce,[e("div",de,a(C.type==2?"核销订单":"核销记录"),1),e("div",_e,[_(V,{type:"primary",size:"small",onClick:O},{default:m(()=>[w("返回上一页")]),_:1})])]),e("div",re,[_(B,{modelValue:n.value.verify_code,"onUpdate:modelValue":d[1]||(d[1]=i=>n.value.verify_code=i),placeholder:"请输入核销码",onKeydown:d[2]||(d[2]=G(i=>p(!0),["enter"])),clearable:""},{append:m(()=>[_(V,{type:"primary",style:{"background-color":"#1890ff",color:"#fff","border-radius":"0 0.315rem 0.315rem 0"},onClick:d[0]||(d[0]=i=>p(!0))},{default:m(()=>[w("搜索")]),_:1})]),_:1},8,["modelValue"])]),$((s(),o("div",ve,[(s(!0),o(P,null,T(c.value,(i,K)=>(s(),o("div",{class:j(["item",{"item-active":g.value==K}]),key:K,onClick:U=>z(i,K)},[e("div",fe,[e("div",{class:j(["sn","cahier"])},"单号: "+a(i.order_id),1),e("div",pe,a(i.pay_time),1)]),e("div",he,[i.product?(s(),o("div",ye,[(s(!0),o(P,null,T(i.product.slice(0,5),(U,Q)=>(s(),N(D,{key:Q,src:U.cart_info.image,class:"shop-img"},null,8,["src"]))),128)),i.product.length==1?(s(),o("div",me,a(i.product[0].store_name),1)):u("",!0)])):u("",!0),e("div",ke,[e("div",ge,"¥"+a(i.pay_price),1),e("div",$e,"共"+a(i.total_num)+"款商品",1)])]),e("div",be,[e("div",we,[i.paid?(s(),o("div",Ce,[w(a(i.paid_name)+" ",1),i.pay_type_name?(s(),N(L,{key:0},{default:m(()=>[w("("+a(i.pay_type_name)+")",1)]),_:2},1024)):i.pay_type==9?(s(),o("span",xe,"(微信收款)")):i.pay_type==17?(s(),o("span",Re,"(现金支付)")):i.pay_type==13?(s(),o("span",Ie,"(支付宝收款)")):i.pay_type==3?(s(),o("span",ze,"(余额支付)")):i.pay_type==1?(s(),o("span",Oe,"(微信支付)")):u("",!0)])):(s(),o("div",Ve,a(i.paid_name),1))]),
|