import{Q as k,_ as Y,d as R,m,cp as S,w as W,p as j,r as s,o as d,A as f,x as u,u as p,b as P,h as _,H as U,a as g,D as z}from"./index.b5c844d0.js";import{b as D}from"./calc.0cdee66c.js";import{a as C,D as H}from"./demand-modify-modal.2d89d249.js";import{u as I}from"./use-page-search.c59d5041.js";import"./index.ef737d72.js";import"./createRequset.6b7f85e0.js";const b={formItems:[{field:"date",type:"date_composition",trigger:"change",defaultValue:"2025"},{field:"companyNo",type:"business-query",trigger:"change"}]},$=k(new Date).format("YYYY-MM");function q(r,e){const[n,o,i]=$.split("-");return!(r({columns:[{prop:"year",label:"\u5E74",minWidth:"70px"},{prop:"month",label:"\u6708",minWidth:"70px"},{prop:"companyName",label:"\u516C\u53F8\u540D\u79F0",minWidth:"135px"},{prop:"total_tips",label:"\u5F00\u7968\u6307\u6807",width:"100px",cellRenderer({row:e}){return r?D(e.inv_tips):e.inv_tips}},{prop:"cost_tips",label:"\u5229\u6DA6\u6307\u6807",width:"100px",cellRenderer({row:e}){return r?D(e.cost_tips):e.cost_tips}},{prop:"createtime",label:"\u521B\u5EFA\u65F6\u95F4",minWidth:"115px"},{prop:"creater",label:"\u521B\u5EFA\u4EBA",minWidth:"80px"},{label:"\u64CD\u4F5C",fixed:"right",width:90,slot:"operation"}],showTitle:!1,superUserNoAction:!1,showDelete(e){return q(e.year,e.month)},apis:{httpDelete:C.delete,httpList:(e={})=>{const{date:n,...o}=e;if(n&&n.length===7){const[i,c]=n.split("-");o.year=i,o.month=c}return n&&n.length===4&&(o.year=n),C.list(o)}}}),v="invCompanyTotalTips",O=R({__name:"index",setup(r){const e=m(!0),n=m(!0),o=m(null),i=m(null),{hasPermissionWithCode:c}=S(v),E=k(new Date).format("YYYY-MM");function F(l,t){const[h,y,x]=E.split("-");return!(lI(void 0,void 0,b)};function T(l){var t;(t=o.value)==null||t.onDisplay(l)}function w(){var t;const{companyNo:l}=i.value.getBasicParams();(t=o.value)==null||t.onDisplay({companyNo:l})}return W(()=>e.value,()=>{n.value=!1,j(()=>n.value=!0)}),(l,t)=>{const h=s("ElSwitch"),y=s("el-button"),x=s("ElButton"),B=s("ElTooltip"),N=s("page-container"),A=s("ExecModal"),V=s("page-auth");return d(),f(V,{"page-name":v},{default:u(()=>[n.value?(d(),f(N,{key:0,hooks:M,"page-name":v,"search-config":p(b),"get-content-ref":a=>i.value=a,"content-config":p(L)(e.value)},{content_header:u(()=>[t[3]||(t[3]=P("span",{class:"mr-[5px]",style:{"font-weight":"700"}},"\u663E\u793A\u5355\u4F4D:",-1)),_(h,{class:"mr-[15px]",modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=a=>e.value=a),"active-text":"\u4E07\u5143","inactive-text":"\u5143"},null,8,["modelValue"]),p(c)("2")?(d(),f(y,{key:0,size:"small",type:"primary",onClick:w},{default:u(()=>t[2]||(t[2]=[U(" \u6DFB\u52A0 ")])),_:1})):g("v-if",!0)]),content_action:u(a=>[p(c)("4")&&Object.keys(a).length!==0&&F(a.year,a.month)?(d(),f(B,{key:0,content:"\u7F16\u8F91",placement:"top"},{default:u(()=>[_(x,{link:"",size:"small",type:"primary",icon:p(z)("edits"),onClick:Q=>T(a)},null,8,["icon","onClick"])]),_:2},1024)):g("v-if",!0)]),_:1},8,["search-config","get-content-ref","content-config"])):g("v-if",!0),_(H,{ref_key:"demandModifyModal",ref:o,onRefresh:t[1]||(t[1]=a=>i.value.onSearch())},null,512),_(A,{ref:"execModalRef"},null,512)]),_:1})}}});var te=Y(O,[["__file","D:/work/sjtj/report-v3/src/views/tipsSetting/invCompanyTotalTips/index.vue"]]);export{te as default};