You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2 lines
14KB

  1. import{E as re,r as A,y as se,x as ie,a as Y,$ as S,o as ne,b as d,c as k,d as q,f as t,h as o,e as u,N as _,i as c,F as pe,j as R,L as ue,u as de,k as me,s as fe}from"./index-dd5fae99.js";import{e as ce,c as ve,d as be,f as ge}from"./evaluationPlan-d9bddf0a.js";import ye from"./projectListDialog-48aa167f.js";import _e from"./applicationListDialog-0d577406.js";import{a as je}from"./performanceApprove-75a10e75.js";import{t as Ae}from"./indicatorTemplate-ca1642c9.js";const we={class:"mainBox"},Ve={class:"flex items-center"},xe={class:"flex"},Ye={class:"flex items-center text-14"},Se={class:"flex w-full"},ke={class:"flex items-center text-14 w-full"},Re={class:"mb-8 flex"},Ce=["onClick"];const De=["onClick"],qe={class:"footer"},Ne=me({name:"addPlan"}),Le=Object.assign(Ne,{setup(he){const{projectTypeOptions:B}=re.dictStore.globalDicts||{},a=A({target:["1"],projects:[],applications:[]}),v=A(),N=se(),b=ie(),{proxy:F}=fe(),h=(s,e,r)=>{e||r(),/^\d+(\.\d{1,6})?$/.test(e)?e*1>=1e8?r("请输入正确格式,小于100000000"):a.value.startAmount&&a.value.endAmount&&a.value.startAmount>a.value.endAmount?r("项目金额范围的起始金额不能大于最终金额"):r():r("请输入正确格式,最多保留六位小数")},T=(s,e,r)=>{e||r(),a.value.selfAppraisalScoreRate&&a.value.reAppraisalScoreRate&&a.value.selfAppraisalScoreRate+a.value.reAppraisalScoreRate!==100?r("自评分和复评分比例相加必须等于100"):r()},P=(s,e,r)=>{e||r(),a.value.projectYearStart>a.value.projectYearEnd?r("开始年份必须小于等于结束年份"):r()},O={name:[{required:!0,message:"请输入"}],startSelfDays:[{required:!0,message:"请输入"}],completeSelfDays:[{required:!0,message:"请输入"}],target:[{required:!0,message:"请选择"}],projectYear:[{required:!0,message:"请选择"}],projectYearStart:[{required:!0,message:"请选择"},{validator:P,trigger:"blur"}],projectYearEnd:[{required:!0,message:"请选择"},{validator:P,trigger:"blur"}],startAmount:[{required:!0,message:"请输入"},{validator:h,trigger:"blur"}],endAmount:[{required:!0,message:"请输入"},{validator:h,trigger:"blur"}],reAppraisalRate:[{required:!0,message:"请选择"}],selfAppraisalScoreRate:[{required:!0,message:"请输入"},{validator:T,trigger:"blur"}],reAppraisalScoreRate:[{required:!0,message:"请输入"},{validator:T,trigger:"blur"}],projects:[{required:!0,message:"至少需要一个项目"}],applications:[{required:!0,message:"请添加"}]},z=Y([{label:"序号",type:"index",width:"60"},{label:"项目名称",key:"projectName",prop:"projectName",minWidth:"200",showOverflowTooltip:!0},{label:"预算年度",key:"projectYear",prop:"projectYear"},{label:"项目金额",key:"declareAmount",prop:"declareAmount"},{label:"申报单位",key:"buildOrgName",prop:"buildOrgName"},{label:"项目类型",key:"projectType",prop:"projectType",render:s=>S("span",B[s.projectType]||"-")},{label:"模板类型",key:"templateType",prop:"templateType",render:s=>{var e,r;return S("span",((r=(e=D.value)==null?void 0:e.find(l=>l.id===s.templateType))==null?void 0:r.name)||"-")}},{label:"是否复评",key:"isReAppraisal",slot:"isReAppraisal"},{label:"操作",slot:"action",width:"70",fixed:"right"}]),G=Y([{label:"序号",type:"index",width:"60"},{label:"应用名称",key:"relatedExistsApplication",prop:"relatedExistsApplication",minWidth:150,render:s=>S("span",s.relatedExistsApplication||s.applicationName),showOverflowTooltip:!0},{label:"申报单位",key:"buildOrgName",prop:"buildOrgName"},{label:"应用类型",key:"applicationType",prop:"applicationType"},{label:"应用领域",key:"bizDomain",prop:"bizDomain",render:s=>S("span",s.bizDomain)},{label:"发布端",key:"publishSide",prop:"publishSide"},{label:"操作",slot:"action",width:"70",fixed:"right"}]),W=A(),H=A(),g=Y({visible:!1,data:void 0,params:void 0}),J=()=>{const s=[];s.push(new Promise((e,r)=>{v.value.validateField("projectYear",l=>{l?e():r(!1)})})),s.push(new Promise((e,r)=>{v.value.validateField("startAmount",l=>{l?e():r(!1)})})),s.push(new Promise((e,r)=>{v.value.validateField("endAmount",l=>{l?e():r(!1)})})),Promise.all([...s]).then(()=>{var r;g.visible=!0,g.data=((r=a.value)==null?void 0:r.projects)||[];const e=[];for(let l=a.value.projectYearStart*1;l<=a.value.projectYearEnd*1;l++)e.push(l);g.params={projectYear:e.join(","),startAmount:a.value.startAmount,endAmount:a.value.endAmount}})},U=()=>{g.visible=!1},K=s=>{a.value.projects=s.map(e=>({...e})),U()},I=(s,e)=>{a.value[e].splice(s,1)},j=Y({visible:!1,data:void 0,params:{regionCode:b.query.regionId,status:30001,appraisalId:b.query.id}}),Q=()=>{var s;j.visible=!0,j.data=((s=a.value)==null?void 0:s.applications)||[]},$=()=>{j.visible=!1},X=s=>{a.value.applications=s.map(e=>({...e,appId:e.id})),$()},C=A(),Z=async s=>{s&&await s.validate(async e=>{var r,l,p,n;if(e){const f=[];for(let m=a.value.projectYearStart*1;m<=a.value.projectYearEnd*1;m++)f.push(m);const V={...a.value,auditId:C.value||void 0,projectYear:f.join(","),target:a.value.target.join(","),projects:a.value.target.includes("1")&&((l=(r=a.value)==null?void 0:r.projects)==null?void 0:l.map(m=>({...m,id:m.projectId||m.id})))||void 0,applicationIds:a.value.target.includes("2")&&((n=(p=a.value)==null?void 0:p.applications)==null?void 0:n.map(m=>m.appId))||void 0,applications:void 0,auditInfo:void 0,auditStatus:void 0,auditStatusName:void 0,auditMessage:void 0,projectYearStart:void 0,projectYearEnd:void 0};b.query.id?await ce(V):await ve(V),F.$message.success("提交成功"),N.go(-1)}})},ee=async()=>{var s,e,r,l;if(b.query.auditId){const p=await je(b.query.auditId),n=(s=p.data.appraisalDetail)==null?void 0:s.projectYear.toString().split(",");a.value={...(e=p.data)==null?void 0:e.appraisalDetail,projectYearStart:(n==null?void 0:n[0])||"",projectYearEnd:(n==null?void 0:n[n.length-1])||"",target:(r=p.data)==null?void 0:r.appraisalDetail.target.split(",")},p.data.auditStatus===3&&(C.value=p.data.id)}else{const p=await be(b.query.id),n=(l=p.data)==null?void 0:l.projectYear.toString().split(",");a.value={...p.data,projectYearStart:(n==null?void 0:n[0])||"",projectYearEnd:(n==null?void 0:n[n.length-1])||"",target:p.data.target.split(",")},p.data.auditInfo.auditStatus===3&&(C.value=p.data.auditInfo.id)}},w=()=>{var s;(s=a.value.projects)!=null&&s.length&&(a.value.projects=[])},ae=async()=>{const s=[];s.push(new Promise((e,r)=>{v.value.validateField("projectYear",l=>{l?e():r(!1)})})),s.push(new Promise((e,r)=>{v.value.validateField("startAmount",l=>{l?e():r(!1)})})),s.push(new Promise((e,r)=>{v.value.validateField("endAmount",l=>{l?e():r(!1)})})),s.push(new Promise((e,r)=>{v.value.validateField("reAppraisalRate",l=>{l?e():r(!1)})})),Promise.all([...s]).then(async()=>{const e=[];for(let l=a.value.projectYearStart*1;l<=a.value.projectYearEnd*1;l++)e.push(l);const r=await ge({projectYear:e.join(","),startAmount:a.value.startAmount,endAmount:a.value.endAmount,reAppraisalRate:a.value.reAppraisalRate,appraisalId:b.query.id||void 0});a.value.projects=r.data.map(l=>({...l,isAppraisal:!0}))})},D=A(),te=async()=>{const s=await Ae();D.value=s.data};return ne(()=>{te(),(b.query.id||b.query.auditId)&&ee()}),(s,e)=>{const r=d("el-input"),l=d("el-form-item"),p=d("el-col"),n=d("el-row"),f=d("el-input-number"),V=d("el-checkbox"),m=d("el-checkbox-group"),E=d("el-date-picker"),x=d("el-button"),L=d("el-switch"),M=d("table-list"),le=d("el-form"),oe=d("el-card");return k(),q("div",we,[t(oe,null,{default:o(()=>[t(le,{ref_key:"fromRef",ref:v,model:a.value,rules:O,"label-position":"right","label-width":"","label-suffix":":","scroll-to-error":""},{default:o(()=>[t(n,{gutter:24},{default:o(()=>[t(p,{span:12},{default:o(()=>[t(l,{label:"计划名称",prop:"name"},{default:o(()=>[t(r,{modelValue:a.value.name,"onUpdate:modelValue":e[0]||(e[0]=i=>a.value.name=i),maxlength:"50",placeholder:"请输入"},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),t(n,{gutter:24},{default:o(()=>[t(p,{span:24},{default:o(()=>[t(l,{label:"自评时间",required:""},{default:o(()=>[u("div",Ve,[e[21]||(e[21]=u("span",null,"项目终验后",-1)),t(l,{"label-width":"0",style:{"margin-bottom":"0",width:"60px"},class:"mx-4",prop:"startSelfDays"},{default:o(()=>[t(f,{modelValue:a.value.startSelfDays,"onUpdate:modelValue":e[1]||(e[1]=i=>a.value.startSelfDays=i),min:0,controls:!1,onMousewheel:e[2]||(e[2]=_(()=>{},["prevent"]))},null,8,["modelValue"])]),_:1}),e[22]||(e[22]=u("span",null,"天后开始自评,",-1)),t(l,{"label-width":"0",style:{"margin-bottom":"0",width:"60px"},class:"mx-4",prop:"completeSelfDays"},{default:o(()=>[t(f,{modelValue:a.value.completeSelfDays,"onUpdate:modelValue":e[3]||(e[3]=i=>a.value.completeSelfDays=i),min:0,controls:!1,onMousewheel:e[4]||(e[4]=_(()=>{},["prevent"]))},null,8,["modelValue"])]),_:1}),e[23]||(e[23]=u("span",null,"天内需完成自评",-1))])]),_:1})]),_:1}),t(p,{span:24},{default:o(()=>[t(l,{label:"评价对象",prop:"target"},{default:o(()=>[t(m,{modelValue:a.value.target,"onUpdate:modelValue":e[5]||(e[5]=i=>a.value.target=i)},{default:o(()=>[t(V,{label:"1"},{default:o(()=>e[24]||(e[24]=[c("项目")])),_:1}),t(V,{label:"2"},{default:o(()=>e[25]||(e[25]=[c("应用")])),_:1})]),_:1},8,["modelValue"])]),_:1})]),_:1})]),_:1}),a.value.target.includes("1")?(k(),q(pe,{key:0},[e[34]||(e[34]=u("p",{class:"font-bold mb-8"},"项目选择",-1)),t(n,null,{default:o(()=>[t(p,{span:12},{default:o(()=>[u("div",xe,[t(l,{label:"预算年度",prop:"projectYearStart"},{default:o(()=>[t(E,{modelValue:a.value.projectYearStart,"onUpdate:modelValue":e[6]||(e[6]=i=>a.value.projectYearStart=i),type:"year",placeholder:"开始年份",format:"YYYY","value-format":"YYYY",onChange:w},null,8,["modelValue"])]),_:1}),e[26]||(e[26]=u("span",null," ~ ",-1)),t(l,{"label-width":"0",prop:"projectYearStart"},{default:o(()=>[t(E,{modelValue:a.value.projectYearEnd,"onUpdate:modelValue":e[7]||(e[7]=i=>a.value.projectYearEnd=i),type:"year",placeholder:"结束年份",format:"YYYY","value-format":"YYYY",onChange:w},null,8,["modelValue"])]),_:1})])]),_:1}),t(p,{span:24,class:"mb-18"},{default:o(()=>[u("div",Ye,[t(l,{label:"项目金额(范围)",style:{"margin-bottom":"0"},prop:"startAmount"},{default:o(()=>[t(f,{modelValue:a.value.startAmount,"onUpdate:modelValue":e[8]||(e[8]=i=>a.value.startAmount=i),clearable:"",controls:!1,placeholder:"请输入起始金额",onMousewheel:e[9]||(e[9]=_(()=>{},["prevent"])),onChange:w},null,8,["modelValue"])]),_:1}),e[27]||(e[27]=u("span",null," 万元 ≤ 项目金额 < ",-1)),t(l,{"label-width":"0",style:{"margin-bottom":"0"},prop:"endAmount"},{default:o(()=>[t(f,{modelValue:a.value.endAmount,"onUpdate:modelValue":e[10]||(e[10]=i=>a.value.endAmount=i),clearable:"",controls:!1,placeholder:"请输入结束金额",onMousewheel:e[11]||(e[11]=_(()=>{},["prevent"])),onChange:w},null,8,["modelValue"])]),_:1}),e[28]||(e[28]=u("span",null," 万元",-1))])]),_:1})]),_:1}),t(n,null,{default:o(()=>[t(p,{span:8},{default:o(()=>[t(l,{label:"项目复评占比",prop:"reAppraisalRate"},{default:o(()=>[u("div",Se,[t(f,{modelValue:a.value.reAppraisalRate,"onUpdate:modelValue":e[12]||(e[12]=i=>a.value.reAppraisalRate=i),clearable:"",controls:!1,placeholder:"请输入",max:100,min:0,precision:0,onMousewheel:e[13]||(e[13]=_(()=>{},["prevent"])),onChange:w},null,8,["modelValue"]),e[29]||(e[29]=c(" % "))])]),_:1})]),_:1})]),_:1}),t(n,null,{default:o(()=>[t(p,{span:24,class:"mb-18"},{default:o(()=>[u("div",ke,[t(l,{label:"最终评分公式",style:{"margin-bottom":"0"},prop:"selfAppraisalScoreRate"},{default:o(()=>[t(f,{modelValue:a.value.selfAppraisalScoreRate,"onUpdate:modelValue":e[14]||(e[14]=i=>a.value.selfAppraisalScoreRate=i),class:"width-150",clearable:"",controls:!1,placeholder:"请输入",precision:0,max:100,min:0,onMousewheel:e[15]||(e[15]=_(()=>{},["prevent"]))},null,8,["modelValue"])]),_:1}),e[30]||(e[30]=c(" %自评分 +  ")),t(l,{"label-width":"0",style:{"margin-bottom":"0"},prop:"reAppraisalScoreRate"},{default:o(()=>[t(f,{modelValue:a.value.reAppraisalScoreRate,"onUpdate:modelValue":e[16]||(e[16]=i=>a.value.reAppraisalScoreRate=i),class:"width-150",clearable:"",controls:!1,precision:0,max:100,min:0,placeholder:"请输入",onMousewheel:e[17]||(e[17]=_(()=>{},["prevent"]))},null,8,["modelValue"])]),_:1}),e[31]||(e[31]=c(" %复评分 "))])]),_:1})]),_:1}),u("div",Re,[t(x,{icon:"plus",plain:"",type:"primary",onClick:ae},{default:o(()=>e[32]||(e[32]=[c("筛选项目")])),_:1}),t(x,{icon:"plus",plain:"",type:"primary",onClick:J},{default:o(()=>e[33]||(e[33]=[c("添加项目")])),_:1})]),t(l,{"label-width":"0",prop:"projects"},{default:o(()=>[t(M,{ref_key:"tableListRef",ref:W,column:z,pagination:!1,data:a.value.projects,"empty-temp":!1,class:"flex-1 mb-16"},{isAppraisal:o(({scope:i})=>[t(L,{modelValue:i.row.isAppraisal,"onUpdate:modelValue":y=>i.row.isAppraisal=y},null,8,["modelValue","onUpdate:modelValue"])]),isReAppraisal:o(({scope:i})=>[t(L,{modelValue:i.row.isReAppraisal,"onUpdate:modelValue":y=>i.row.isReAppraisal=y},null,8,["modelValue","onUpdate:modelValue"])]),action:o(({scope:i})=>[i.row.selfAppraisalScoreTime&&i.row.selfAppraisalTotalScore?R("",!0):(k(),q("a",{key:0,class:"text-danger",onClick:y=>I(i.$index,"projects")},"删除",8,Ce))]),_:1},8,["column","data"])]),_:1})],64)):R("",!0),R("",!0),a.value.target.includes("2")?(k(),ue(n,{key:2,gutter:24},{default:o(()=>[t(p,{span:24},{default:o(()=>[t(l,{label:"评价应用",prop:"applications"},{default:o(()=>[t(M,{ref_key:"tableListRef1",ref:H,column:G,pagination:!1,data:a.value.applications,"empty-temp":!1,class:"flex-1"},{action:o(({scope:i})=>[u("a",{class:"text-danger",onClick:y=>I(i.$index,"applications")},"删除",8,De)]),_:1},8,["column","data"]),u("div",null,[t(x,{icon:"plus",plain:"",type:"primary",class:"mt-16",onClick:Q},{default:o(()=>e[36]||(e[36]=[c("添加应用")])),_:1})])]),_:1})]),_:1})]),_:1})):R("",!0),t(n,{gutter:16},{default:o(()=>[t(p,{span:12},{default:o(()=>[t(l,{label:"备注"},{default:o(()=>[t(r,{modelValue:a.value.remark,"onUpdate:modelValue":e[18]||(e[18]=i=>a.value.remark=i),type:"textarea",maxlength:200,"show-word-limit":""},null,8,["modelValue"])]),_:1})]),_:1})]),_:1})]),_:1},8,["model"])]),_:1}),u("div",qe,[t(x,{type:"primary",onClick:e[19]||(e[19]=i=>Z(v.value))},{default:o(()=>e[37]||(e[37]=[c(" 提交 ")])),_:1}),t(x,{onClick:e[20]||(e[20]=i=>de(N).go(-1))},{default:o(()=>e[38]||(e[38]=[c("取消")])),_:1})]),t(ye,{visible:g.visible,data:g.data,params:g.params,"template-type-list-data":D.value,onClose:U,onGetProjectData:K},null,8,["visible","data","params","template-type-list-data"]),t(_e,{visible:j.visible,data:j.data,params:j.params,onClose:$,onGetAppData:X},null,8,["visible","data","params"])])}}});export{Le as default};