business.4d75f44a.js 2.3 KB

1
  1. import{_ as b,d as M,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.62ae038d.js";import{s as P,c as w,a as F}from"./content.config.5bfce904.js";import{f as R}from"./export.100da817.js";import{i as S}from"./isBeyondTime.739eee0f.js";import{u as A}from"./use-page-search.490f9727.js";import{u as T,a as z}from"./useBusinessQuery.7142a93c.js";import"./createRequset.2509add7.js";import"./calc.3602fe08.js";import"./xlsx.ed122d16.js";import"./lodash.586958d1.js";const U="companyNo",V="receivable",j=M({__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:"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[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=b(j,[["__file","C:/Users/63107/Desktop/projects/report-v3/src/views/time/receivable/components/business.vue"]]);export{Z as default};