import{e as a,a9 as t,r as s,aa as i,f as n,g as r,h as o,w as d,x as l,z as m,o as p,i as u,N as c,_}from"./index-Cg3FU-dV.js";import{_ as h}from"./uni-search-bar.CR6HHo5B.js";import{i as x}from"./invoiceList.CT5ltxV8.js";import{c as b}from"./customerTab.DpH_ZKvN.js";import{g as w}from"./index.vG6WzeDr.js";/* empty css                                                                  */import{_ as g}from"./_plugin-vue_export-helper.BCo6x5W8.js";import"./uni-datetime-picker.vue_vue_type_style_index_0_scoped_6f474695_lang.CEqmT57_.js";import{N as y}from"./customer.DHyt6w_W.js";import"./uni-icons.D_sy4NxH.js";import"./uni-row.DfI4R5V8.js";import"./uni-dateformat.D7mTxFoD.js";import"./uni-list.B5vvSfhy.js";import"./uni-badge.AEsViQRE.js";import"./index.Dozy1JgX.js";/* empty css                                                              */const f=g({__name:"search",setup(g){const f=a({typeIndex:0,tabIndex:0,tabId:1,eid:"",emptyTitle:"暂无搜索结果～",customStyle:{border:"none",lineHeight:"20px",background:"#ED4014"},examineTabData:[{name:"我负责的",id:2},{name:"我查看的",id:1}],listData:[],where:{eid:"",page:1,limit:10,name:"",time:"",status:"",types:"",way:1,salesman_id:""}});t((a=>{a.index&&(f.tabIndex=Number(a.index)),e.way&&(f.where.way=e.way),a.eid&&(f.eid=a.eid,f.where.eid=a.eid)}));const j=()=>{f.where.name="",f.listData=[]},v=()=>{_()},D=()=>{f.where.page=1,f.where.name?T(!0):j()},I=e=>{f.where.page>1&&backToTop(),f.tabId=e.id,f.tabIndex=e.index,f.where.page=1,T(!0)},T=(e=!1)=>{f.where.page=1,0===f.tabIndex?f.where.way=1:f.where.way=0,k(e)},C=s(!1),k=(e=!1)=>{y(f.where).then((a=>{e&&(f.listData=[]),f.listData.push(...a.data.list);const t=Math.ceil(a.data.count/f.where.limit);f.listData.length<=0||f.where.page>=t?C.value=!1:C.value=!0})).catch((e=>{l.error(e.message)}))};return i((()=>{C.value&&(f.where.page++,k())})),(e,a)=>{const t=m,s=n(r("uni-search-bar"),h);return p(),o(t,{class:"content"},{default:d((()=>[u(t,{class:"cr-position-header"},{default:d((()=>[u(t,{class:"status_bar"}),u(t,{class:"default-search"},{default:d((()=>[u(s,{onConfirm:D,onFocus:D,focus:!0,bgColor:"#F0F1F5",modelValue:f.where.name,"onUpdate:modelValue":a[0]||(a[0]=e=>f.where.name=e),onClear:j,onCancel:v},null,8,["modelValue"])])),_:1}),f.eid?c("",!0):(p(),o(b,{key:0,"examine-tab-data":f.examineTabData,onChange:I,index:f.tabIndex},null,8,["examine-tab-data","index"]))])),_:1}),u(t,{class:"examine-content m10"},{default:d((()=>[u(x,{"list-data":f.listData,"empty-title":f.emptyTitle},null,8,["list-data","empty-title"])])),_:1}),u(w)])),_:1})}}},[["__scopeId","data-v-c600080b"]]);export{f as default};
