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 line
3.8KB

  1. import{p as A}from"./evaluationPlan-d9bddf0a.js";import{E as I,x as R,a as E,r as v,B as $,b as d,c as q,L as z,h as o,e as C,f as l,i as g,k as J,$ as O}from"./index-dd5fae99.js";const U={class:"search mb-16"},Y={class:"dialog-footer"},F=J({name:"planProjectDialog"}),H=Object.assign(F,{props:{visible:{type:Boolean,default:!1,required:!0},data:{type:Array,default:void 0},params:{type:Object,default:()=>({})},templateTypeListData:{type:Array,default:void 0}},emits:["close","getProjectData"],setup(j,{emit:k}){const{projectTypeOptions:T}=I.dictStore.globalDicts||{},w=R(),f=j,_=k,n=E({projectName:void 0,buildOrgName:void 0}),i=v(),h=[{type:"selection",reserveSelection:!0,width:"55"},{label:"项目名称",key:"projectName",prop:"projectName",minWidth:"200",showOverflowTooltip:!0},{label:"预算年度",key:"projectYear",prop:"projectYear",width:80},{label:"项目金额",key:"declareAmount",prop:"declareAmount"},{label:"申报单位",key:"buildOrgName",prop:"buildOrgName"},{label:"项目类型",key:"projectType",prop:"projectType",render:r=>O("span",T[r.projectType]||"-"),width:80},{label:"模板类型",key:"templateType",prop:"templateType",render:r=>{var e,a;return O("span",((a=(e=f.templateTypeListData)==null?void 0:e.find(t=>t.id===r.templateType))==null?void 0:a.name)||"-")}}],p=v([]),N=v(0),b=async(r=(e=>(e=i.value)==null?void 0:e.pageParams)())=>{const a=await A({...r,...n,appraisalId:w.query.appraisalId});p.value=a.data.records,N.value=a.data.total,n.projectName&&(p.value=p.value.filter(s=>s.projectName.indexOf(n.projectName)!==-1)),n.buildOrgName&&(p.value=p.value.filter(s=>s.buildOrgName.indexOf(n.buildOrgName)!==-1));const t=JSON.parse(JSON.stringify(u.value))||[];t!=null&&t.length&&p.value&&p.value.forEach(s=>{t.map(y=>y.projectCode).includes(s.projectCode)&&i.value.toggleRowSelect(s,!0)})},D=()=>{i.value.pageParams.pageNumber=1,b()},V=()=>{n.projectName=void 0,n.buildOrgName=void 0,i.value.pageParams.pageNumber=1,i.value.pageParams.pageSize=10,b()},u=v([]),P=r=>{const e=r.map(a=>a.projectCode);p.value.forEach(a=>{e.includes(a.projectCode)?u.value.push(a):u.value=u.value.filter(t=>t.projectCode!==a.projectCode)})},S=()=>{const r={},e=u.value.reduce((a,t)=>(r[t.projectCode]||(r[t.projectCode]=a.push(t)),a),[]);_("getProjectData",e)};return $(()=>f.visible,async r=>{var e;r&&((e=f.data)!=null&&e.length&&(u.value=f.data.map(a=>a),console.log(u.value)),b())}),(r,e)=>{const a=d("el-input"),t=d("el-form-item"),s=d("el-col"),m=d("el-button"),y=d("el-row"),x=d("el-form"),L=d("table-list"),B=d("el-dialog");return q(),z(B,{"model-value":j.visible,title:"添加项目",width:"70%","destroy-on-close":"",onClose:e[3]||(e[3]=c=>_("close"))},{footer:o(()=>[C("span",Y,[l(m,{onClick:e[2]||(e[2]=c=>_("close"))},{default:o(()=>e[6]||(e[6]=[g("关闭")])),_:1}),l(m,{type:"primary",onClick:S},{default:o(()=>e[7]||(e[7]=[g(" 确定 ")])),_:1})])]),default:o(()=>[C("div",U,[l(x,{"label-suffix":":",model:n,size:"small"},{default:o(()=>[l(y,{gutter:16},{default:o(()=>[l(s,{span:8},{default:o(()=>[l(t,{label:"项目名称"},{default:o(()=>[l(a,{modelValue:n.projectName,"onUpdate:modelValue":e[0]||(e[0]=c=>n.projectName=c),placeholder:"请输入"},null,8,["modelValue"])]),_:1})]),_:1}),l(s,{span:8},{default:o(()=>[l(t,{label:"申报单位"},{default:o(()=>[l(a,{modelValue:n.buildOrgName,"onUpdate:modelValue":e[1]||(e[1]=c=>n.buildOrgName=c),placeholder:"请输入"},null,8,["modelValue"])]),_:1})]),_:1}),l(s,{span:8},{default:o(()=>[l(t,{class:"btn"},{default:o(()=>[l(m,{type:"primary",onClick:D},{default:o(()=>e[4]||(e[4]=[g("查询")])),_:1}),l(m,{onClick:V},{default:o(()=>e[5]||(e[5]=[g("重置")])),_:1})]),_:1})]),_:1})]),_:1})]),_:1},8,["model"])]),l(L,{ref_key:"tableListRef",ref:i,column:h,data:p.value,"row-key":"projectCode",total:N.value,onSelectionChange:P,onGetTableData:b},null,8,["data","total"])]),_:1},8,["model-value"])}}});export{H as default};