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-WeUkftbp.js";import{_ as x}from"./uni-search-bar.BHGf4P5g.js";import{i as b}from"./invoiceList.5yV_Kco1.js";import{c as h}from"./customerTab.Dl-WFCzx.js";import{g}from"./index.NTbA_2SX.js";import{i as j}from"./invoiceExamine.Cz7tsYJS.js";import{p as v}from"./assessment.C7cFhOQt.js";import{a as y}from"./finance.DTaS5L8b.js";import{_ as w}from"./_plugin-vue_export-helper.BCo6x5W8.js";import"./uni-icons.B3nCnuXe.js";/* empty css                                                                  */import"./uni-row.DLutFlIQ.js";import"./uni-dateformat.CAFQ6hZt.js";import"./uni-list.D2b1m_I0.js";import"./uni-badge.CLrZv6EZ.js";import"./index.D8Jasx-l.js";/* empty css                                                              */import"./uni-forms.CCONsUgM.js";import"./uni-forms.vue_vue_type_style_index_0_scoped_a2a9907e_lang.DijPs27m.js";import"./uni-easyinput.D5FSIQIk.js";/* empty css                                                                      */import"./uni-popup.CI1Fmu1z.js";import"./uni-popup.vue_vue_type_style_index_0_scoped_90b62717_lang.BVw2wyB9.js";import"./index.BcUDVLb2.js";import"./uni-nav-bar.cBITQXNK.js";/* empty css                                                                    *//* empty css                                                              */import"./file.BMc01nZQ.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};
