import{_ as v,d as b,m as f,cU as x,d1 as D,w as B,r as l,o as _,A as y,x as g,u as r,D as k,H as I,a as N,cc as E,S as a}from"./index.e80c366d.js";import{s as P,c as w,a as F}from"./content.config.b6995743.js";import{f as R}from"./export.6f50dc45.js";import{i as S}from"./isBeyondTime.85391023.js";import{u as A}from"./use-page-search.e3e95470.js";import{u as T,a as z}from"./useBusinessQuery.00e2ea8d.js";import"./createRequset.60472412.js";import"./calc.3602fe08.js";import"./xlsx.ed122d16.js";import"./lodash.92db800d.js";const U="companyNo",V="receivableMain",j=b({__name:"business",setup(H){const c=f(null),{hasPermissionWithCode:C}=x(V),p=D(),{searchConfig:i}=T({sourceConfig:P,queryField:"companyNo"}),u=f(i),{contentConfig:d}=z({sourceConfig:w,apis:{httpList:F.list}}),h={pageSearchHook:()=>A(e=>{const{date:t,...o}=e,n=a(t).format("YYYY-MM-DD"),s=a(t).daysInMonth(),m=a(n).subtract(-(s-1),"days").format("YYYY-MM-DD");return{result:{start:n+" 00:00:00",end:m+" 23:59:59",plat_type:"1",dz_type:"2",...o},deleteProps:["date"]}},e=>{const{date:t,companyNo:o,depart_id:n}=e,s=a(t).format("YYYY-MM-DD"),m=a(t).daysInMonth(),M=a(s).subtract(-(m-1),"days").format("YYYY-MM-DD");return{result:{start:s+" 00:00:00",end:M+" 23:59:59",companyNo:o,plat_type:"1",dz_type:"2",depart_id:n},deleteProps:["date"]}},i)};B(()=>p.level,e=>{const{formItems:t}=u.value,o=t.findIndex(({field:s})=>s==="depart_id"),{itemid:n=""}=p.info||{};Number(e)===2&&(u.value.formItems[o].disabled=Number(e)===2,u.value.formItems[o].defaultValue=n)},{immediate:!0});async function Y(){const e=c.value.getBasicParams()||{},{start:t,end:o}=e;if(!e[U]){E.warning("\u8BF7\u9009\u62E9\u4E1A\u52A1\u516C\u53F8");return}if(S({end:o,start:t,len:30}))return;const s=c.value.getData();R({columns:d.columns,name:"\u5E94\u6536\u8D26\u6B3E\u6C47\u603B.xlsx",data:s})}return(e,t)=>{const o=l("el-button"),n=l("PageContainer");return _(),y(n,{hooks:h,getContentRef:s=>c.value=s,"content-config":r(d),"search-config":r(i),lockKey:"companyNo"},{content_header:g(()=>[r(C)("18")?(_(),y(o,{key:0,icon:r(k)("arrow-up-line"),onClick:Y,size:"small",type:"primary"},{default:g(()=>[I("\u5BFC\u51FA")]),_:1},8,["icon"])):N("v-if",!0)]),_:1},8,["getContentRef","content-config","search-config"])}}});var Z=v(j,[["__file","C:/Users/63107/Desktop/projects/report-v3/src/views/time/receivableMain/components/business.vue"]]);export{Z as default};
