import{d as K,y as Q,B as X,b as C,r as g,Z as j,o as ee,c as s,e as u,G as v,i as a,u as p,h as e,k,f as b,F as G,H as M,g as f,j as E,q as ae}from"./index.a2494fc2.js";import{E as te}from"./index.108a55d4.js";import{r as le,a as oe,c as ne}from"./renewalProjectTreasury.6213a230.js";import{u as re}from"./useExportExc.03cd7129.js";import{g as N,a as se}from"./getIsShowRegionTree.7b64ce60.js";const de={class:"flex"},ue={class:"flex justify-between"},pe=["onClick"],ie=["onClick"],me=["onClick"],ce=K({name:"projectStore"}),Ne=Object.assign(ce,{setup(fe){const{proxy:P}=ae(),T=Q(),{reAuditStatusOptions:O,projectTypeOptions:A}=X.dictStore.globalDicts||{},t=C({projectName:void 0,projectType:void 0,approvalStatus:void 0,year:void 0,times:void 0}),c=g(),R=g(0),Y=C([{label:"\u5E8F\u53F7",type:"index",width:"60"},{label:"\u9879\u76EE\u540D\u79F0",key:"projectName",prop:"projectName",minWidth:"200",showOverflowTooltip:!0},{label:"\u7533\u62A5\u5355\u4F4D",key:"buildOrgName",prop:"buildOrgName",minWidth:"150",showOverflowTooltip:!0},{label:"\u9879\u76EE\u7C7B\u578B",key:"projectType",prop:"projectType",minWidth:"80",render:o=>j("span",A[o.projectType]||"-")},{label:"\u9884\u7B97\u5E74\u5EA6",key:"projectYear",prop:"projectYear",width:"80"},{label:"\u4E0B\u4E00\u5E74\u5EA6\u652F\u4ED8\u91D1\u989D\uFF08\u4E07\u5143\uFF09",key:"annualPaymentAmount",prop:"annualPaymentAmount",width:"200"},{label:"\u9879\u76EE\u72B6\u6001",key:"approvalStatus",prop:"approvalStatus",width:"180",render:o=>[j("span",{class:["dot mr-4",`bg-${o.approvalStatus==="PENDING"?"warning":o.approvalStatus==="PASS"?"success":"danger"}`]}),j("span",{class:`text-${o.approvalStatus==="PENDING"?"warning":o.approvalStatus==="PASS"?"success":"danger"}`},o.approvalStatus==="PENDING"?"\u5F85\u5BA1\u6838":o.approvalStatus==="PASS"?"\u5BA1\u6838\u901A\u8FC7":"\u5BA1\u6838\u4E0D\u901A\u8FC7")]},{label:"\u521B\u5EFA\u65F6\u95F4",key:"createOn",prop:"createOn",width:"180"},{label:"\u64CD\u4F5C",slot:"action",width:"160",fixed:"right"}]),x=g([]),S=g(),U=o=>{S.value=o.regionLevel===3?o.regionCode:void 0,c.value.pageParams.pageNumber=1,i()},i=async(o=c.value.pageParams)=>{var r,_;const l=await le({...o,...t,year:t.year*1||void 0,startTime:((r=t.times)==null?void 0:r[0])||void 0,endTime:((_=t.times)==null?void 0:_[1])||void 0,regionCode:S.value||void 0,times:void 0});x.value=l.data.records,R.value=l.data.total},$=()=>{i()},B=()=>{t.projectName=void 0,t.projectType=void 0,t.approvalStatus=void 0,t.year=void 0,t.times=void 0,c.value.pageParams.pageNumber=1,c.value.pageParams.pageSize=10,i()},L=o=>{T.push({name:"renewalProjectAsscess",query:{projectRenewalId:o.id}})},H=o=>{P.$messageBox.confirm("\u786E\u5B9A\u8981\u5220\u9664\u8BE5\u9879\u5417?","\u63D0\u793A\uFF01",{type:"warning"}).then(async()=>{await oe({projectRenewalId:o.id}),P.$message.success("\u5220\u9664\u6210\u529F\uFF01"),i()})},q=o=>{T.push({name:"projectTreasuryDetail",query:{projectRenewalId:o.id}})},{exportLoading:z,exportData:F}=re(),W=()=>{F(()=>{var o,l;return ne({...t,startTime:((o=t.times)==null?void 0:o[0])||void 0,endTime:((l=t.times)==null?void 0:l[1])||void 0,year:t.year*1||void 0,regionCode:S.value||void 0,times:void 0})})};return ee(async()=>{N(["SUPER_ADMIN","REGION_MANAGER"])||i()}),(o,l)=>{const r=s("el-col"),_=s("el-input"),m=s("el-form-item"),D=s("el-option"),I=s("el-select"),y=s("el-row"),h=s("el-date-picker"),w=s("el-button"),Z=s("el-form"),V=s("el-card"),J=s("table-list");return u(),v(y,null,{default:a(()=>[p(N)(["SUPER_ADMIN","REGION_MANAGER"])?(u(),v(r,{key:0,span:4,class:"pr-16"},{default:a(()=>[e(te,{params:p(se)({SUPER_ADMIN:!1,REGION_MANAGER:!1}),onGetTree:U},null,8,["params"])]),_:1})):k("",!0),e(r,{span:p(N)(["SUPER_ADMIN","REGION_MANAGER"])?20:24},{default:a(()=>[e(V,{class:"w-full search"},{default:a(()=>[e(Z,{model:t,size:"small","label-suffix":":"},{default:a(()=>[e(y,{gutter:16,class:"mb-16"},{default:a(()=>[e(r,{span:8},{default:a(()=>[e(m,{label:"\u9879\u76EE\u540D\u79F0"},{default:a(()=>[e(_,{modelValue:t.projectName,"onUpdate:modelValue":l[0]||(l[0]=n=>t.projectName=n),placeholder:"\u8BF7\u8F93\u5165"},null,8,["modelValue"])]),_:1})]),_:1}),e(r,{span:8},{default:a(()=>[e(m,{label:"\u9879\u76EE\u7C7B\u578B"},{default:a(()=>[e(I,{modelValue:t.projectType,"onUpdate:modelValue":l[1]||(l[1]=n=>t.projectType=n),placeholder:"\u5168\u90E8",class:"w-full"},{default:a(()=>[(u(!0),b(G,null,M(p(A),(n,d)=>(u(),v(D,{key:d,label:n,value:d},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1}),e(r,{span:8},{default:a(()=>[e(m,{label:"\u9879\u76EE\u72B6\u6001"},{default:a(()=>[e(I,{modelValue:t.approvalStatus,"onUpdate:modelValue":l[2]||(l[2]=n=>t.approvalStatus=n),placeholder:"\u5168\u90E8",class:"w-full"},{default:a(()=>[(u(!0),b(G,null,M(p(O),(n,d)=>(u(),v(D,{key:d,label:n,value:d},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1})]),_:1}),e(y,{gutter:16,class:"mb-16"},{default:a(()=>[e(r,{span:8},{default:a(()=>[e(m,{label:"\u9884\u7B97\u5E74\u5EA6"},{default:a(()=>[e(h,{modelValue:t.year,"onUpdate:modelValue":l[3]||(l[3]=n=>t.year=n),type:"year","value-format":"YYYY",placeholder:"\u8BF7\u9009\u62E9"},null,8,["modelValue"])]),_:1})]),_:1}),e(r,{span:16},{default:a(()=>[e(m,{label:"\u521B\u5EFA\u65F6\u95F4"},{default:a(()=>[e(h,{modelValue:t.times,"onUpdate:modelValue":l[4]||(l[4]=n=>t.times=n),type:"datetimerange",editable:!1,format:"YYYY-MM-DD HH:mm","value-format":"YYYY-MM-DD HH:mm","range-separator":"-","start-placeholder":"\u5F00\u59CB\u65F6\u95F4","end-placeholder":"\u7ED3\u675F\u65F6\u95F4"},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),e(y,null,{default:a(()=>[e(r,{span:24},{default:a(()=>[e(m,{class:"btn"},{default:a(()=>[f("div",de,[e(w,{type:"primary",onClick:$},{default:a(()=>l[5]||(l[5]=[E("\u67E5\u8BE2")])),_:1}),e(w,{onClick:B},{default:a(()=>l[6]||(l[6]=[E("\u91CD\u7F6E")])),_:1})])]),_:1})]),_:1})]),_:1})]),_:1},8,["model"])]),_:1}),e(V,{class:"w-full mt-8"},{header:a(()=>[f("div",ue,[l[8]||(l[8]=f("span",null,"\u5217\u8868",-1)),f("div",null,[e(w,{type:"primary",plain:"",size:"small","export-loading":p(z),onClick:W},{default:a(()=>l[7]||(l[7]=[E("\u5BFC\u51FA")])),_:1},8,["export-loading"])])])]),default:a(()=>[e(J,{ref_key:"tableListRef",ref:c,column:Y,data:x.value,total:R.value,onGetTableData:i},{action:a(({scope:n})=>[n.row.approvalStatus==="PENDING"?(u(),b("a",{key:0,onClick:d=>L(n.row)},"\u5BA1\u6838",8,pe)):k("",!0),f("a",{onClick:d=>q(n.row)},"\u8BE6\u60C5",8,ie),p(N)(["SUPER_ADMIN","REGION_MANAGER"])&&n.row.approvalStatus==="NOT_PASS"?(u(),b("a",{key:1,class:"text-danger",onClick:d=>H(n.row)},"\u5220\u9664",8,me)):k("",!0)]),_:1},8,["column","data","total"])]),_:1})]),_:1},8,["span"])]),_:1})}}});export{Ne as default};