|
1 |
- import{i as ue,j as de,h as me,k as fe}from"./evaluationPlan-d9bddf0a.js";import{E as ve,r as v,a as x,x as ce,$ as D,o as ye,b as d,c as u,d as k,f as t,h as a,i as m,e as _,L as b,t as f,j as U,F as T,H as q,k as _e,s as ge}from"./index-dd5fae99.js";import be from"./userListDialog-d499cf9a.js";import ke from"./planProjectDialog-d4d7b885.js";import{t as Ue}from"./indicatorTemplate-ca1642c9.js";const je={class:"flex justify-between"},Ce=["onClick"],we=["onClick"],Ne=["onClick"],Le={key:1},$e=["onClick"],xe={class:"dialog-footer"},De=_e({name:"projectGroup"}),Oe=Object.assign(De,{setup(Te){const{proxy:V}=ge(),{projectTypeOptions:X}=ve.dictStore.globalDicts||{},s=v({name:"",reAppraisalUsers:[],verificationUsers:[],projects:[],verifyLeader:void 0}),j=x({name:void 0}),E=v(),z=ce(),C=v(),J=x([{label:"序号",type:"index",width:"80"},{label:"分组名称",key:"name",prop:"name",minWidth:"120",showOverflowTooltip:!0},{label:"复评人员",key:"reAppraisalUsers",prop:"reAppraisalUsers",render:l=>{var e;return D("span",(e=l.reAppraisalUsers)==null?void 0:e.map(n=>n==null?void 0:n.username).join("、"))}},{label:"核查人员",key:"verificationUsers",prop:"verificationUsers",render:l=>{var e;return D("span",(e=l.verificationUsers)==null?void 0:e.map(n=>n==null?void 0:n.username).join("、"))}},{label:"创建时间",key:"createOn",prop:"createOn",width:"150"},{label:"操作",slot:"action",width:"200",fixed:"right"}]),K={name:[{required:!0,message:"请填写",trigger:"blur"}],projects:[{required:!0,message:"请选择",trigger:"blur"}],reAppraisalUsers:[{required:!0,message:"请选择",trigger:"blur"}],verificationUsers:[{required:!0,message:"请选择",trigger:"blur"}],verifyLeader:[{required:!0,message:"请选择",trigger:"blur"}]},Q=x([{label:"序号",type:"index",width:"80"},{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:l=>D("span",X[l.projectType]||"-"),width:80},{label:"模板类型",key:"templateType",prop:"templateType",render:l=>{var e,n;return D("span",((n=(e=R.value)==null?void 0:e.find(o=>o.id===l.templateType))==null?void 0:n.name)||"-")}},{label:"操作",slot:"action",width:"80",fixed:"right"}]),A=v([]),w=async(l=C.value.pageParams)=>{const e=await ue(z.query.appraisalId,{...j});A.value=e.data,console.log(A)},Z=l=>{V.$messageBox.confirm(`确定要删除该${l.name}吗?`,"提示!",{type:"warning"}).then(async()=>{await de(l.id),w(),V.$message.success("删除成功")})},ee=()=>{w()},G=()=>{j.name=void 0,C.value.pageParams.pageNumber=1,C.value.pageParams.pageSize=10,w()},N=v(!1),P=v(""),c=v(!0),h=async(l,e)=>{var n;if(P.value="新增分组",c.value=!0,l!=null&&l.id){c.value=e,P.value=e?"编辑分组":"分组详情";const o=await me(l.id);s.value={...o.data,reAppraisalUsers:o.data.reAppraisalUsers.map(i=>({...i,name:i.username,phoneNo:i.mobile,orgName:i.empPosUnitName})),verificationUsers:o.data.verificationUsers.map(i=>({...i,name:i.username,phoneNo:i.mobile,orgName:i.empPosUnitName})),verifyLeader:((n=o.data.verifyLeader)==null?void 0:n.employeeCode)||""}}else s.value={};N.value=!0},B=v(""),g=x({visible:!1,data:void 0,params:{userRoleList:[]}}),I=l=>{var e;g.data=((e=s.value)==null?void 0:e[l])||[],g.params.roleCode=l==="reAppraisalUsers"?"REVIEWER":"EXPERT",B.value=l,g.visible=!0},F=()=>{g.visible=!1},ae=l=>{s.value[B.value]=l.map(e=>({...e})),F()},L=x({visible:!1,data:void 0}),le=()=>{var l;L.visible=!0,L.data=((l=s.value)==null?void 0:l.projects)||[]},S=()=>{L.visible=!1},te=l=>{s.value.projects=l.map(e=>({...e})),S()},re=(l,e)=>{s.value[l].splice(e,1)},se=async l=>{l&&await l.validate(async e=>{if(e){const n={...s.value,appraisalId:z.query.appraisalId,projectCodes:s.value.projects.map(o=>o.projectCode),reAppraisalUsers:s.value.reAppraisalUsers.map(o=>o.employeeCode),verificationUsers:s.value.verificationUsers.map(o=>o.employeeCode),projects:void 0};await fe(n),V.$message.success("提交成功"),N.value=!1,s.value={},G()}})},R=v(),oe=async()=>{const l=await Ue();R.value=l.data};return ye(()=>{oe(),w()}),(l,e)=>{const n=d("el-input"),o=d("el-form-item"),i=d("el-col"),y=d("el-button"),$=d("el-row"),W=d("el-form"),Y=d("el-card"),H=d("table-list"),M=d("el-tag"),ne=d("el-option"),ie=d("el-select"),pe=d("el-dialog");return u(),k(T,null,[t(Y,{class:"search mb-16"},{default:a(()=>[t(W,{"label-suffix":":",model:j,size:"small"},{default:a(()=>[t($,{gutter:16},{default:a(()=>[t(i,{span:8},{default:a(()=>[t(o,{label:"分组名称"},{default:a(()=>[t(n,{modelValue:j.name,"onUpdate:modelValue":e[0]||(e[0]=r=>j.name=r),placeholder:"请输入"},null,8,["modelValue"])]),_:1})]),_:1}),t(i,{span:16},{default:a(()=>[t(o,{class:"btn"},{default:a(()=>[t(y,{type:"primary",onClick:ee},{default:a(()=>e[8]||(e[8]=[m("查询")])),_:1}),t(y,{onClick:G},{default:a(()=>e[9]||(e[9]=[m("重置")])),_:1})]),_:1})]),_:1})]),_:1})]),_:1},8,["model"])]),_:1}),t(Y,null,{header:a(()=>[_("div",je,[e[11]||(e[11]=_("span",null,"列表",-1)),_("div",null,[t(y,{type:"primary",size:"small",icon:"plus",onClick:h},{default:a(()=>e[10]||(e[10]=[m("新建分组")])),_:1})])])]),default:a(()=>[t(H,{ref_key:"tableListRef",ref:C,column:J,data:A.value,pagination:!1,onGetTableData:w},{action:a(({scope:r})=>[_("a",{onClick:p=>h(r.row,!0)},"编辑",8,Ce),_("a",{onClick:p=>h(r.row)},"详情",8,we),_("a",{class:"text-danger",onClick:p=>Z(r.row)},"删除",8,Ne)]),_:1},8,["column","data"])]),_:1}),t(pe,{modelValue:N.value,"onUpdate:modelValue":e[7]||(e[7]=r=>N.value=r),title:P.value,width:"59%"},{footer:a(()=>[_("span",xe,[t(y,{onClick:e[5]||(e[5]=r=>N.value=!1)},{default:a(()=>e[15]||(e[15]=[m("关闭")])),_:1}),t(y,{type:"primary",onClick:e[6]||(e[6]=r=>se(E.value))},{default:a(()=>e[16]||(e[16]=[m(" 提交 ")])),_:1})])]),default:a(()=>[t(W,{ref_key:"formRef",ref:E,model:s.value,rules:K,"label-position":"right","label-width":"","label-suffix":":"},{default:a(()=>[t($,{gutter:4},{default:a(()=>[t(i,{span:12},{default:a(()=>[t(o,{label:"分组名称",prop:"name"},{default:a(()=>[c.value?(u(),b(n,{key:0,modelValue:s.value.name,"onUpdate:modelValue":e[1]||(e[1]=r=>s.value.name=r),maxlength:"50",placeholder:"请输入"},null,8,["modelValue"])):(u(),k("span",Le,f(s.value.name),1))]),_:1})]),_:1})]),_:1}),t($,{gutter:4},{default:a(()=>[t(i,{span:24},{default:a(()=>[t(o,{label:"评价项目",prop:"projects"},{default:a(()=>[t(H,{ref_key:"tableListRef",ref:C,column:Q,pagination:!1,data:s.value.projects,class:"w-full","empty-temp":!1},{action:a(({scope:r})=>[c.value?(u(),k("a",{key:0,class:"text-danger",onClick:p=>re("projects",r.$index)},"删除",8,$e)):U("",!0)]),_:1},8,["column","data"]),_("div",null,[c.value?(u(),b(y,{key:0,icon:"plus",plain:"",type:"primary",class:"mt-16",size:"small",onClick:le},{default:a(()=>e[12]||(e[12]=[m("添加项目")])),_:1})):U("",!0)])]),_:1})]),_:1})]),_:1}),t($,{gutter:4},{default:a(()=>[t(i,{span:12},{default:a(()=>[t(o,{label:"复评人员",prop:"reAppraisalUsers"},{default:a(()=>{var r;return[(r=s.value.reAppraisalUsers)!=null&&r.length?(u(!0),k(T,{key:0},q(s.value.reAppraisalUsers,(p,O)=>(u(),b(M,{key:O,class:"mr-4 mb-8"},{default:a(()=>[m(f(p.name)+" | "+f(p.orgName)+" | "+f(p.phoneNo),1)]),_:2},1024))),128)):U("",!0),c.value?(u(),b(y,{key:1,icon:"plus",plain:"",type:"primary",size:"small",onClick:e[2]||(e[2]=p=>I("reAppraisalUsers"))},{default:a(()=>e[13]||(e[13]=[m("添加复评人员")])),_:1})):U("",!0)]}),_:1})]),_:1})]),_:1}),t($,{gutter:4},{default:a(()=>[t(i,{span:12},{default:a(()=>[t(o,{label:"核查人员",prop:"verificationUsers"},{default:a(()=>{var r;return[(r=s.value.verificationUsers)!=null&&r.length?(u(!0),k(T,{key:0},q(s.value.verificationUsers,(p,O)=>(u(),b(M,{key:O,class:"mr-4 mb-8"},{default:a(()=>[m(f(p.name)+" | "+f(p.orgName)+" | "+f(p.phoneNo),1)]),_:2},1024))),128)):U("",!0),c.value?(u(),b(y,{key:1,icon:"plus",plain:"",type:"primary",size:"small",onClick:e[3]||(e[3]=p=>I("verificationUsers"))},{default:a(()=>e[14]||(e[14]=[m("添加核查人员")])),_:1})):U("",!0)]}),_:1})]),_:1}),t(i,{span:12},{default:a(()=>[t(o,{label:"核查组长",prop:"verifyLeader"},{default:a(()=>[t(ie,{modelValue:s.value.verifyLeader,"onUpdate:modelValue":e[4]||(e[4]=r=>s.value.verifyLeader=r),class:"w-full",disabled:!c.value},{default:a(()=>[(u(!0),k(T,null,q(s.value.verificationUsers,(r,p)=>(u(),b(ne,{key:p,value:r.employeeCode,label:`${r.name} | ${r.orgName} | ${r.phoneNo}`},{default:a(()=>[m(f(r.name)+" | "+f(r.orgName)+" | "+f(r.phoneNo),1)]),_:2},1032,["value","label"]))),128))]),_:1},8,["modelValue","disabled"])]),_:1})]),_:1})]),_:1})]),_:1},8,["model"])]),_:1},8,["modelValue","title"]),t(be,{visible:g.visible,data:g.data,params:g.params,onClose:F,onGetProjectData:ae},null,8,["visible","data","params"]),t(ke,{visible:L.visible,data:L.data,"template-type-list-data":R.value,onClose:S,onGetProjectData:te},null,8,["visible","data","template-type-list-data"])],64)}}});export{Oe as default};
|