business.b15216fc.js 2.3 KB

1
  1. import{aD as b,W as B,_ as F,d as k,w as h,b9 as w,bp as E,z as I,r as _,o as y,G as v,C as x,u as p,J as R,M as A,a as S,au as D}from"./index.1d5f2f42.js";import{i as P,s as T,c as J,a as V}from"./isBeyondTime.ec4f3d38.js";import{f as q}from"./export.669edd93.js";import{u as z}from"./use-page-search.5b2e253c.js";import{l as H}from"./lodash.f6259d7e.js";import"./createRequset.f858bea3.js";import"./isBeyondTime.8b05db81.js";import"./calc.3602fe08.js";const d={index:2,name:"relaComName",code:"relaComNo"};function K(u){const{sourceConfig:o,apis:a,insertBusinessField:n=d}=u,e=H.exports.cloneDeep(o),{columns:s}=e,{index:t=d.index,name:m=d.name,code:C=d.code}=n,g=s.splice(t);return e.apis=a,e.columns=s.concat(g),{contentConfig:e}}function M(u){const{sourceConfig:o,queryField:a="relaComNo"}=u,n=JSON.parse(JSON.stringify(o)),e=b(""),s=B(()=>e.value==="");return n.formItems=[...n.formItems,{trigger:"change",field:a,placeholder:"\u4E1A\u52A1\u516C\u53F8",noRest:!0,type:"business-permission",onChange:t=>e.value=t}],{searchConfig:n,isHasCompany:s,companyNo:e}}const O=k({__name:"business",setup(u){const o=h(null),a="companyNo",n="reportDaily",{hasPermissionWithCode:e}=w(n),s=E(),{searchConfig:t}=M({sourceConfig:T,queryField:"companyNo"}),m=h(t),{contentConfig:C}=K({sourceConfig:J,apis:{httpList:V.list}}),g={pageSearchHook:()=>z(void 0,void 0,t,!1,a)};I(()=>s.level,r=>{const{formItems:l}=m.value,i=l.findIndex(({field:c})=>c==="depart_id"),{itemid:f=""}=s.info||{};Number(r)===2&&(m.value.formItems[i].disabled=Number(r)===2,m.value.formItems[i].defaultValue=f)},{immediate:!0});async function N(){const r=o.value.getBasicParams()||{},{start:l,end:i}=r;if(!r[a]){D.warning("\u8BF7\u9009\u62E9\u4E1A\u52A1\u516C\u53F8");return}if(P({end:i,start:l,len:30}))return;const c=o.value.getData();q({columns:C.columns,name:"\u65E5\u62A5.xlsx",data:c})}return(r,l)=>{const i=_("el-button"),f=_("PageContainer");return y(),v(f,{hooks:g,getContentRef:c=>o.value=c,"content-config":p(C),"search-config":p(t),lockKey:"relaComNo"},{content_header:x(()=>[p(e)("18")?(y(),v(i,{key:0,icon:p(R)("arrow-up-line"),onClick:N,size:"small",type:"primary"},{default:x(()=>[A("\u5BFC\u51FA")]),_:1},8,["icon"])):S("v-if",!0)]),_:1},8,["getContentRef","content-config","search-config"])}}});var Y=F(O,[["__file","D:/work/rep-v3/report-v3/src/views/time/reportDaily/components/business.vue"]]);export{Y as default};