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