import{_ as b,d as M,m as f,cT as x,d0 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.d0c68291.js";import{s as P,c as w,a as F}from"./content.config.7e3496d7.js";import{f as R}from"./export.8d59e752.js";import{i as S}from"./isBeyondTime.2be61112.js";import{u as A}from"./use-page-search.f8fe5a6b.js";import{u as T,a as z}from"./useBusinessQuery.0cfc7001.js";import"./createRequset.2a519b90.js";import"./calc.3602fe08.js";import"./lodash.ae569796.js";const V="companyNo",j="receivable",H=M({__name:"business",setup(K){const c=f(null),{hasPermissionWithCode:C}=x(j),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:"1",...o},deleteProps:["date"]}},e=>{const{date:t,companyNo:o,depart_id:n}=e,s=a(t).format("YYYY-MM-DD"),m=a(t).daysInMonth(),v=a(s).subtract(-(m-1),"days").format("YYYY-MM-DD");return{result:{start:s+" 00:00:00",end:v+" 23:59:59",companyNo:o,plat_type:"1",dz_type:"1",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[V]){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 X=b(H,[["__file","C:/Users/63107/Desktop/projects/report-v3/src/views/time/receivable/components/business.vue"]]);export{X as default};
