import{d as Q,A as X,D as Z,b as C,r as g,a0 as j,o as ee,c as s,e as u,I as v,i as a,u as p,h as e,k as h,f as b,F as G,J as M,g as f,j as k,x as ae}from"./index.d340e473.js";import{E as te}from"./index.af6ebbed.js";import{r as le,a as oe,c as ne}from"./renewalProjectTreasury.4131e151.js";import{u as re}from"./useExportExc.c3c2ae13.js";import{g as N,a as se}from"./getIsShowRegionTree.26f6f682.js";const de={class:"flex"},ue={class:"flex justify-between"},pe=f("span",null,"\u5217\u8868",-1),ie=["onClick"],ce=["onClick"],me=["onClick"],fe=Q({name:"projectStore"}),Se=Object.assign(fe,{setup(_e){const{proxy:E}=ae(),P=X(),{reAuditStatusOptions:O,projectTypeOptions:A}=Z.dictStore.globalDicts||{},t=C({projectName:void 0,projectType:void 0,approvalStatus:void 0,year:void 0,times:void 0}),m=g(),T=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:l=>j("span",A[l.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:l=>[j("span",{class:["dot mr-4",`bg-${l.approvalStatus==="PENDING"?"warning":l.approvalStatus==="PASS"?"success":"danger"}`]}),j("span",{class:`text-${l.approvalStatus==="PENDING"?"warning":l.approvalStatus==="PASS"?"success":"danger"}`},l.approvalStatus==="PENDING"?"\u5F85\u5BA1\u6838":l.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=l=>{S.value=l.regionLevel===3?l.regionCode:void 0,m.value.pageParams.pageNumber=1,i()},i=async(l=m.value.pageParams)=>{var r,_;const n=await le({...l,...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=n.data.records,T.value=n.data.total},$=()=>{i()},L=()=>{t.projectName=void 0,t.projectType=void 0,t.approvalStatus=void 0,t.year=void 0,t.times=void 0,m.value.pageParams.pageNumber=1,m.value.pageParams.pageSize=10,i()},B=l=>{P.push({name:"renewalProjectAsscess",query:{projectRenewalId:l.id}})},H=l=>{E.$messageBox.confirm("\u786E\u5B9A\u8981\u5220\u9664\u8BE5\u9879\u5417?","\u63D0\u793A\uFF01",{type:"warning"}).then(async()=>{await oe({projectRenewalId:l.id}),E.$message.success("\u5220\u9664\u6210\u529F\uFF01"),i()})},z=l=>{P.push({name:"projectTreasuryDetail",query:{projectRenewalId:l.id}})},{exportLoading:F,exportData:W}=re(),q=()=>{W(()=>{var l,n;return ne({...t,startTime:((l=t.times)==null?void 0:l[0])||void 0,endTime:((n=t.times)==null?void 0:n[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()}),(l,n)=>{const r=s("el-col"),_=s("el-input"),c=s("el-form-item"),R=s("el-option"),D=s("el-select"),y=s("el-row"),I=s("el-date-picker"),w=s("el-button"),J=s("el-form"),V=s("el-card"),K=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})):h("",!0),e(r,{span:p(N)(["SUPER_ADMIN","REGION_MANAGER"])?20:24},{default:a(()=>[e(V,{class:"w-full search"},{default:a(()=>[e(J,{model:t,size:"small","label-suffix":":"},{default:a(()=>[e(y,{gutter:16,class:"mb-16"},{default:a(()=>[e(r,{span:8},{default:a(()=>[e(c,{label:"\u9879\u76EE\u540D\u79F0"},{default:a(()=>[e(_,{modelValue:t.projectName,"onUpdate:modelValue":n[0]||(n[0]=o=>t.projectName=o),placeholder:"\u8BF7\u8F93\u5165"},null,8,["modelValue"])]),_:1})]),_:1}),e(r,{span:8},{default:a(()=>[e(c,{label:"\u9879\u76EE\u7C7B\u578B"},{default:a(()=>[e(D,{modelValue:t.projectType,"onUpdate:modelValue":n[1]||(n[1]=o=>t.projectType=o),placeholder:"\u5168\u90E8",class:"w-full"},{default:a(()=>[(u(!0),b(G,null,M(p(A),(o,d)=>(u(),v(R,{key:d,label:o,value:d},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1}),e(r,{span:8},{default:a(()=>[e(c,{label:"\u9879\u76EE\u72B6\u6001"},{default:a(()=>[e(D,{modelValue:t.approvalStatus,"onUpdate:modelValue":n[2]||(n[2]=o=>t.approvalStatus=o),placeholder:"\u5168\u90E8",class:"w-full"},{default:a(()=>[(u(!0),b(G,null,M(p(O),(o,d)=>(u(),v(R,{key:d,label:o,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(c,{label:"\u9884\u7B97\u5E74\u5EA6"},{default:a(()=>[e(I,{modelValue:t.year,"onUpdate:modelValue":n[3]||(n[3]=o=>t.year=o),type:"year","value-format":"YYYY",placeholder:"\u8BF7\u9009\u62E9"},null,8,["modelValue"])]),_:1})]),_:1}),e(r,{span:16},{default:a(()=>[e(c,{label:"\u521B\u5EFA\u65F6\u95F4"},{default:a(()=>[e(I,{modelValue:t.times,"onUpdate:modelValue":n[4]||(n[4]=o=>t.times=o),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(c,{class:"btn"},{default:a(()=>[f("div",de,[e(w,{type:"primary",onClick:$},{default:a(()=>[k("\u67E5\u8BE2")]),_:1}),e(w,{onClick:L},{default:a(()=>[k("\u91CD\u7F6E")]),_:1})])]),_:1})]),_:1})]),_:1})]),_:1},8,["model"])]),_:1}),e(V,{class:"w-full mt-8"},{header:a(()=>[f("div",ue,[pe,f("div",null,[e(w,{type:"primary",plain:"",size:"small","export-loading":p(F),onClick:q},{default:a(()=>[k("\u5BFC\u51FA")]),_:1},8,["export-loading"])])])]),default:a(()=>[e(K,{ref_key:"tableListRef",ref:m,column:Y,data:x.value,total:T.value,onGetTableData:i},{action:a(({scope:o})=>[o.row.approvalStatus==="PENDING"?(u(),b("a",{key:0,onClick:d=>B(o.row)},"\u5BA1\u6838",8,ie)):h("",!0),f("a",{onClick:d=>z(o.row)},"\u8BE6\u60C5",8,ce),p(N)(["SUPER_ADMIN","REGION_MANAGER"])&&o.row.approvalStatus==="NOT_PASS"?(u(),b("a",{key:1,class:"text-danger",onClick:d=>H(o.row)},"\u5220\u9664",8,me)):h("",!0)]),_:1},8,["column","data","total"])]),_:1})]),_:1},8,["span"])]),_:1})}}});export{Se as default};