import{e,a9 as t,r as a,K as i,x as s,aa as n,J as r,h as o,w as d,z as p,o as l,i as m,m as u}from"./index-B3cqKsI_.js";import{d as c}from"./index.CL60Q41z.js";import{i as _}from"./invoiceList.D2VbKoK3.js";import{g as h}from"./index.CVKsP8q3.js";import{c as g,N as y,O as j}from"./customer.Crnb53sL.js";import{_ as v}from"./_plugin-vue_export-helper.BCo6x5W8.js";import"./uni-nav-bar.xE5Um1Eb.js";import"./uni-icons.EqO7jntL.js";/* empty css                                                                  *//* empty css                                                                    *//* empty css                                                              */import"./uni-row.DyJ89Jxj.js";import"./uni-dateformat.DQ4pg8Wo.js";import"./uni-list.zT2ADjW3.js";import"./uni-badge.D3PXVPFA.js";import"./index.GhHyI8tz.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)),$(),b()}));const f=e([{type:1,icon:"icon-sousuo"},{type:2,icon:"icon-a-gengduo2"}]),b=()=>{g().then((e=>{x.buildData=e.data}))},w=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(),o(a,{class:"content"},{default:d((()=>[m(a,{class:"cr-position-header"},{default:d((()=>[m(a,{class:"status_bar"}),m(c,{"is-right":!0,"jump-url":x.jumpUrl,"is-jump-bar":!1,"right-data":f,onHandleNarItem:w},null,8,["jump-url","right-data"])])),_:1}),m(a,{class:"examine-content m10"},{default:d((()=>[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};
