import{_ as k,d as R,m as f,cl as S,cU as b,d1 as w,w as B,r as m,o as p,A as d,x as C,u as a,D as F,H as I,a as P,S as N}from"./index.e80c366d.js";import{s as A,c as E,a as D}from"./content.config.9622550e.js";import{h as U}from"./export.6f50dc45.js";import{u as V}from"./use-page-search.e3e95470.js";import{u as j,a as q}from"./useBusinessQuery.00e2ea8d.js";import"./createRequset.60472412.js";import"./xlsx.ed122d16.js";import"./lodash.92db800d.js";const H="goodCostInfo",T=R({__name:"business",setup(z){const i=f(null),r=S(!1),{hasPermissionWithCode:g}=b(H),u=w(),{searchConfig:c}=j({sourceConfig:A,queryField:"companyNo"}),l=f(c),{contentConfig:h}=q({sourceConfig:E,apis:{httpList:D.list}}),_={pageSearchHook:()=>V(function(o){const{year_month:t,...n}=o;let e="",s="";if(t){e=t+"-01";const y=N(e).subtract(1,"month").endOf("month").date();s=t+"-"+y}return{result:{...n,start:e,end:s},deleteProp:[]}},void 0,c)};B(()=>u.level,o=>{const{formItems:t}=l.value,n=t.findIndex(({field:s})=>s==="depart_id"),{itemid:e=""}=u.info||{};Number(o)===2&&(l.value.formItems[n].defaultValue=e)},{immediate:!0});const v={onSuccess:()=>r.value=!1,onStart:()=>r.value=!0,onFail:()=>r.value=!1};async function x(){const o=i.value.getBasicParams()||{};await U({params:o,...v,isAdmin:!1,name:"\u5546\u54C1\u6210\u672C\u4FE1\u606F\u62A5\u8868.xlsx",fileType:"aplication/x-msexecl",url:"/purchease/purchase/goodCostInfoExport"})}return(o,t)=>{const n=m("el-button"),e=m("PageContainer");return p(),d(e,{hooks:_,getContentRef:s=>i.value=s,"content-config":a(h),"search-config":a(c),lockKey:"companyNo"},{content_header:C(()=>[a(g)("18")?(p(),d(n,{key:0,icon:a(F)("arrow-up-line"),onClick:x,size:"small",type:"primary"},{default:C(()=>[I("\u5BFC\u51FA")]),_:1},8,["icon"])):P("v-if",!0)]),_:1},8,["getContentRef","content-config","search-config"])}}});var Q=k(T,[["__file","C:/Users/63107/Desktop/projects/report-v3/src/views/time/goodCostInfo/components/business.vue"]]);export{Q as default};
