import{e,a9 as t,r as a,K as i,x as s,aa as n,J as r,h as d,w as o,z as p,o as l,i as m,m as u}from"./index-DXvjTqMr.js";import{d as c}from"./index.D3kEQn5y.js";import{i as _}from"./invoiceList.0NB70VVT.js";import{g as h}from"./index.C_bCAwVj.js";import{c as g,N as y,O as j}from"./customer.BB8HSfBC.js";import{_ as v}from"./_plugin-vue_export-helper.BCo6x5W8.js";import"./uni-nav-bar.BZJJc0Hh.js";import"./uni-icons.Dxt3pfrw.js";/* empty css *//* empty css *//* empty css */import"./uni-row.DufxBgTC.js";import"./uni-dateformat.R_eYMhRe.js";import"./uni-list.DC8Q_4GY.js";import"./uni-badge.BiEW0hVl.js";import"./index.Bd3eRv6X.js";/* empty css */const x=v({__name:"invoice",setup(v){const x=e({typeIndex:0,tabIndex:0,tabId:1,emptyTitle:"暂无发票,快去申请吧~",listData:[],buildData:{},name:"",where:{limit:10,page:1,types:"",eid:""},jumpUrl:""});t((e=>{x.where.eid=e.eid,x.jumpUrl=`/pages/customer/list/details?id=${e.eid}`,x.name=e.name,3==e.types&&(f=f.splice(1,1)),$(),w()}));const f=e([{type:1,icon:"icon-sousuo"},{type:2,icon:"icon-a-gengduo2"}]),w=()=>{g().then((e=>{x.buildData=e.data}))},b=e=>{if(1===e.type&&u(`/pages/customer/invoice/search?eid=${x.where.eid}`),2===e.type){let e={eid:x.where.eid};j(e).then((e=>{e.data.length>0?u(`/pages/customer/invoice/checkPayment?id=${x.buildData.invoicing_switch}&eid=${x.where.eid}&name=${x.name}`):u(`/pages/users/examine/default?id=${x.buildData.invoicing_switch}&eid=${x.where.eid}&types=invoice`)}))}},D=a(!1),$=(e=!1)=>{y(x.where).then((t=>{e&&(x.listData=[]),x.listData.push(...t.data.list);const a=Math.ceil(t.data.count/x.where.limit);x.listData.length<=0||x.where.page>=a?D.value=!1:D.value=!0,i()})).catch((e=>{s.error(e.message)}))};return n((()=>{D.value&&(x.where.page++,$())})),r((()=>{x.where.page=1,x.value=!1,x.listData=[],$()})),(e,t)=>{const a=p;return l(),d(a,{class:"content"},{default:o((()=>[m(a,{class:"cr-position-header"},{default:o((()=>[m(a,{class:"status_bar"}),m(c,{"is-right":!0,"jump-url":x.jumpUrl,"is-jump-bar":!1,"right-data":f,onHandleNarItem:b},null,8,["jump-url","right-data"])])),_:1}),m(a,{class:"examine-content m10"},{default:o((()=>[m(_,{"list-data":x.listData,type:x.typeIndex,name:x.name,eid:x.where.eid,"empty-title":x.emptyTitle},null,8,["list-data","type","name","eid","empty-title"])])),_:1}),m(h)])),_:1})}}},[["__scopeId","data-v-a54b4766"]]);export{x as default};