import{a2 as e,e as a,r as t,Q as s,cB as n,x as i,f as r,g as l,o,h as d,w as c,a as u,i as m,j as p,t as _,N as x,a7 as h,y as g,z as f,a8 as y,b,a9 as v,K as w,aa as j,J as T,m as I,aq as k}from"./index-Cg3FU-dV.js";import{t as D}from"./index.B9huFudH.js";import{d as C}from"./index.D_hliqYM.js";import{i as z}from"./invoiceList.CT5ltxV8.js";import{c as N}from"./customerTab.DpH_ZKvN.js";import{g as K}from"./index.vG6WzeDr.js";import{_ as $}from"./uni-datetime-picker.h8Ix41Za.js";import{N as B}from"./customer.DHyt6w_W.js";import{_ as H}from"./_plugin-vue_export-helper.BCo6x5W8.js";import"./uni-nav-bar.BXgu2eq7.js";import"./uni-icons.D_sy4NxH.js";/* empty css *//* empty css *//* empty css */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 */import"./uni-datetime-picker.vue_vue_type_style_index_0_scoped_6f474695_lang.CEqmT57_.js";const J={__name:"formBox",props:{type:{type:String,default:"center"},status:{type:Number,default:-2}},emits:["change"],setup(b,{emit:v}){const w=b,{type:j,status:T}=e(w),I=a({typeText:"发票类型",timeText:"创建日期",usersText:"业务员",labelText:"审核状态",typeIndex:0,usersIndex:0,usersData:[]}),k=a({time:"",salesmaId:"",status:"",type:""}),D=t(null);let C=v;const z=a([{name:"所有类型",id:""},{name:"个人普通发票",id:1},{name:"企业普通发票",id:2},{name:"企业专用发票",id:3}]),N=a([{name:"所有状态",id:""},{name:"发票作废",id:-1},{name:"待审核",id:0},{name:"待开票",id:1},{name:"已拒绝",id:2},{name:"撤回开票",id:3},{name:"申请作废",id:4},{name:"已开票",id:5}]);s((()=>{K()}));const K=()=>{n().then((e=>{const a=e.data?e.data:[];a.unshift({name:"所有人员",id:""}),I.usersData=a})).catch((e=>{i.error(e.message)}))},B=e=>{const a=e.detail.value;I.typeText=z[a].name,"所有类型"===I.typeText&&(I.typeText="发票类型"),k.type=z[a].id,C("change",k)},H=e=>{const a=e.detail.value;I.usersText=I.usersData[a].name,"所有人员"===I.usersText&&(I.usersText="业务员"),k.salesmaId=I.usersData[a].id,C("change",k)},J=e=>{const a=e.detail.value;I.labelText=N[a].name,"所有状态"===I.labelText&&(I.labelText="审核状态"),k.status=N[a].id,C("change",k)},L=()=>{D.value.clear()},Q=e=>{if(e.length>0){const a=e[0].replace(/-/g,"/")+"-"+e[1].replace(/-/g,"/");I.timeText=e[0].substring(5).replace("-","/")+"-"+e[1].substring(5).replace("-","/"),k.time=a}else I.timeText="所有日期",k.time="";C("change",k)};return(e,a)=>{const t=g,s=f,n=y,i=r(l("uni-datetime-picker"),$);return o(),d(s,{class:"cr-search-content plr10"},{default:c((()=>[1==u(T)?(o(),d(n,{key:0,class:"picker-selector",mode:"selector",onChange:H,value:I.usersIndex,range:I.usersData,"range-key":"name"},{default:c((()=>[m(s,{class:"search-default-label"},{default:c((()=>[p(_(I.usersText)+" ",1),m(t,{class:"iconfont icon-zhankai1"})])),_:1})])),_:1},8,["value","range"])):x("",!0),m(n,{class:"picker-selector",mode:"selector",onChange:J,value:I.typeIndex,range:N,"range-key":"name"},{default:c((()=>[m(s,{class:"search-default-label"},{default:c((()=>[p(_(I.labelText)+" ",1),m(t,{class:"iconfont icon-zhankai1"})])),_:1})])),_:1},8,["value","range"]),m(n,{class:"picker-selector",mode:"selector",onChange:B,value:I.typeIndex,range:z,"range-key":"name"},{default:c((()=>[m(s,{class:"search-default-label"},{default:c((()=>[p(_(I.typeText)+" ",1),m(t,{class:"iconfont icon-zhankai1"})])),_:1})])),_:1},8,["value","range"]),m(i,{ref_key:"timeRef",ref:D,type:"daterange","clear-icon":!1,border:!1,onChange:Q},{default:c((()=>[m(s,{class:"search-default-date"},{default:c((()=>[p(_(I.timeText)+" ",1),k.time?x("",!0):(o(),d(t,{key:0,class:"date-open-icon iconfont icon-zhankai1"}))])),_:1}),k.time?(o(),d(t,{key:0,class:"iconfont date-clear icon-shenpizhongxin-jujue",onClick:h(L,["stop"])})):x("",!0)])),_:1},512)])),_:1})}}},L=H({__name:"index",setup(e){const s=b();t(s.state.app.currentIndex);const n=a({typeIndex:0,tabIndex:0,tabId:2,emptyTitle:"当前暂无发票~",customStyle:{border:"none",lineHeight:"20px",background:"#ED4014"},examineTabData:[{name:"我负责的",id:2},{name:"我查看的",id:1}],listData:[],where:{page:1,limit:10,scope_frame:"self",name:"",time:"",status:"",types:"",way:1,salesman_id:""}});v((e=>{_()}));const r=a([{type:1,icon:"icon-sousuo"}]),l=e=>{I(`/pages/customer/invoice/search?index=${n.tabIndex}&way=${n.where.way}`)},u=e=>{n.where.page>1&&k(),n.tabId=e.id,n.tabIndex=e.index,n.where.page=1,_(!0)},p=e=>{n.where.page=1,n.where.status=e.status,n.where.types=e.type,n.where.time=e.time,n.where.salesman_id=e.salesmaId,_(!0)},_=(e=!1)=>{n.where.page=1,n.where.way=0===n.tabIndex?1:"",h(e)},x=t(!1),h=(e=!1)=>{n.where.scope_frame=1==n.where.way?"self":"all",B(n.where).then((a=>{e&&(n.listData=[]),n.listData.push(...a.data.list);const t=Math.ceil(a.data.count/n.where.limit);n.listData.length<=0||n.where.page>=t?x.value=!1:x.value=!0,w()})).catch((e=>{i.error(e.message)}))};return j((()=>{x.value&&(n.where.page++,h())})),T((()=>{n.where.page=1,n.value=!1,n.listData=[],h()})),(e,a)=>{const t=f;return o(),d(t,{class:"content"},{default:c((()=>[m(t,{class:"cr-position-header"},{default:c((()=>[m(t,{class:"status_bar"}),m(C,{"jump-url":"/pages/workbench/index","is-right":!0,"right-data":r,onHandleNarItem:l},null,8,["right-data"]),m(N,{"examine-tab-data":n.examineTabData,index:n.tabIndex,onChange:u},null,8,["examine-tab-data","index"]),m(J,{onChange:p,status:n.tabId,type:"approve"},null,8,["status"])])),_:1}),m(t,{class:"examine-content m10"},{default:c((()=>[m(z,{"list-data":n.listData,"empty-title":n.emptyTitle},null,8,["list-data","empty-title"])])),_:1}),m(K),m(D,{currentIndex:2})])),_:1})}}},[["__scopeId","data-v-cdac77b4"]]);export{L as default};