import{d as e,e as a,a9 as t,r as n,aa as i,f as s,g as o,o as r,h as p,w as l,i as d,a as m,_,aq as u,x as c,z as f}from"./index-DXvjTqMr.js";import{_ as x}from"./uni-search-bar.CxwyNur9.js";import{i as b}from"./invoiceList.0NB70VVT.js";import{c as h}from"./customerTab.g3HmAsdX.js";import{g}from"./index.C_bCAwVj.js";import{i as j}from"./invoiceExamine.nwRAVLHm.js";import{p as v}from"./assessment.C7cFhOQt.js";import{a as y}from"./finance.Bxo1BZoO.js";import{_ as w}from"./_plugin-vue_export-helper.BCo6x5W8.js";import"./uni-icons.Dxt3pfrw.js";/* 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                                                              */import"./uni-forms.GA6sNr68.js";import"./uni-forms.vue_vue_type_style_index_0_scoped_a2a9907e_lang.DijPs27m.js";import"./uni-easyinput.D7PPGXPC.js";/* empty css                                                                      */import"./uni-popup.BpvJsdxE.js";import"./uni-popup.vue_vue_type_style_index_0_scoped_90b62717_lang.BoqUbMLw.js";import"./index.D3kEQn5y.js";import"./uni-nav-bar.BZJJc0Hh.js";/* empty css                                                                    *//* empty css                                                              */import"./file.u5oGG8Vo.js";const I=w(e({__name:"search",setup(e){const w=a({typeIndex:0,tabIndex:0,tabId:1,placeholder:"请输入关键字搜索",emptyTitle:"暂无搜索结果～",customStyle:{border:"none",lineHeight:"20px",background:"#ED4014"},examineTabData:v,listData:[],config:{},where:{way:"",page:1,limit:10,status:[0,3],time:"",name:"",invoiced:"",from:1,date:"",salesman_name:"",types:""}});t((e=>{const a=w.examineTabData.length-1;e.index&&(e.index>a?w.tabIndex=a:w.tabIndex=Number(e.index),w.tabId=w.examineTabData[w.tabIndex].id)}));const I=()=>{w.where.name="",w.listData=[]},D=()=>{_()},C=()=>{w.where.page=1,w.where.name?V(!0):I()},T=n(null),F=e=>{w.config=e,T.value.popupOpen()},k=()=>{V(!0)},E=e=>{if(w.tabId===e.id||""===w.where.name)return!1;w.where.page>1&&u(),w.tabId=e.id,w.tabIndex=e.index,V(!0)},V=(e=!1)=>{w.where.page=1,w.where.status=1===w.tabId?[0,3]:"",N(e)},L=n(!1),N=(e=!1)=>{y(w.where).then((a=>{e&&(w.listData=[]),w.listData.push(...a.data.list);const t=Math.ceil(a.data.count/w.where.limit);L.value=!(w.listData.length<=0||w.where.page>=t)})).catch((e=>{c.error(e.message)}))};return i((()=>{L.value&&(w.where.page++,N())})),(e,a)=>{const t=f,n=s(o("uni-search-bar"),x);return r(),p(t,{class:"content"},{default:l((()=>[d(t,{class:"cr-position-header"},{default:l((()=>[d(t,{class:"status_bar"}),d(t,{class:"default-search"},{default:l((()=>[d(n,{onConfirm:C,onFocus:C,placeholder:m(w).placeholder,focus:!0,bgColor:"#F0F1F5",modelValue:m(w).where.name,"onUpdate:modelValue":a[0]||(a[0]=e=>m(w).where.name=e),onClear:I,onCancel:D},null,8,["placeholder","modelValue"])])),_:1}),d(h,{"examine-tab-data":m(w).examineTabData,index:m(w).tabIndex,onChange:E},null,8,["examine-tab-data","index"])])),_:1}),d(t,{class:"examine-content m10"},{default:l((()=>[d(b,{"list-data":m(w).listData,"empty-title":m(w).emptyTitle,"is-finance":!0,onChange:F},null,8,["list-data","empty-title"])])),_:1}),d(g),d(j,{ref_key:"invoiceExamineRef",ref:T,"config-data":m(w).config,onChange:k},null,8,["config-data"])])),_:1})}}}),[["__scopeId","data-v-1d073fbc"]]);export{I as default};
