|
- import{_ as xe}from"./index-4950cfb0.js";import _e from"./addExpertDialog-0b06a511.js";import be from"./addProjectDialog-16e4484b.js";import Re from"./ruleFormCom-3884fe85.js";import{r as ye,a as Be}from"./reviewMeeting-39e99ddc.js";import{E as Ve,y as ke,r as V,a as k,o as Te,b as d,c as g,d as L,f as t,h as l,e as c,i as p,F as j,H as N,u as q,L as _,t as w,j as P,k as Le,a0 as je,W as we,s as Ce}from"./index-dd5fae99.js";import{g as Ue}from"./getTimeDiffer-b6027bbf.js";import"./unitManage-104cfe86.js";import"./expertStore-7d1ebc1f.js";const De=["onClick"],Ne={class:"flex flex-col items-start"},Pe={class:"flex flex-col items-start"},Oe={class:"flex flex-col items-start"};const he={class:"footer"},qe=Le({name:"addMeeting"}),Ke=Object.assign(qe,{setup(Ye){const{meetingTypeOptions:A,projectTypeOptions:E}=Ve.dictStore.globalDicts||{},{proxy:H}=Ce(),Y=ke(),$=V(),F=V(),i=k({expertInviteRule:{inviteType:1,randomRules:[{expertDicts:[],expertTags:[]}],appointRule:{},avoidRule:{avoidUnitIdList:[],avoidOrgIdList:[],expertIds:[],avoidType:3}},meetingBasicInfo:{isInnerProject:!0}}),S=V([{}]),z=k([{label:"序号",type:"index",width:"60"},{label:"项目名称",key:"projectName",prop:"projectName",minWidth:"150",showOverflowTooltip:!0},{label:"申报单位",key:"buildOrg",prop:"buildOrg",minWidth:"150",showOverflowTooltip:!0},{label:"项目类型",slot:"projectTypeName",prop:"projectTypeName",width:"100"},{label:"申报金额",key:"declaredAmount",prop:"declaredAmount",width:"130"},{label:"预算年度",key:"projectYear",prop:"projectYear",width:"100"},{label:"操作",slot:"action",width:"60",fixed:"right"}]),J=(n,e,f)=>Ue(new Date(e[0].replace(/-/g,"/")),new Date,"h")>1?f():f(new Error("评审时间必须是当前时间的一小时之后")),G=k({"meetingBasicInfo.name":[{required:!0,message:"请输入会议名称",trigger:"blur"}],"meetingBasicInfo.isInnerProject":[{required:!0,message:"请选择",trigger:"blur"}],"meetingBasicInfo.type":[{required:!0,message:"请选择评审类型",trigger:"blur"}],"meetingBasicInfo.projectIdList":[{required:!0,message:"请选择评审项目",trigger:"blur"}],"meetingBasicInfo.projects":[{required:!0,message:"请填写评审项目",trigger:"blur"}],"meetingBasicInfo.times":[{required:!0,message:"请选择评审时间",trigger:"change"},{validator:J,trigger:"change"}],"meetingBasicInfo.meetingUsageTime":[{required:!0,message:"请选择评审耗时",trigger:"blur"}],"meetingBasicInfo.meetingAddress":[{required:!0,message:"请输入评审地点",trigger:"blur"}],"meetingBasicInfo.judgesAttendanceTime":[{required:!0,message:"请选择评委到场时间",trigger:"blur"}],"meetingBasicInfo.connecter":[{required:!0,message:"请输入联系人",trigger:"blur"}],"meetingBasicInfo.contact":[{required:!0,message:"请输入联系方式",trigger:"blur"}],"expertInviteRule.inviteType":[{required:!0,message:"请选择抽取方式",trigger:"blur"}],"expertInviteRule.appointRule.inviteDesc":[{required:!0,message:"请输入抽取理由",trigger:"blur"}],"expertInviteRule.appointRule.expertIdList":[{required:!0,message:"请指定专家",trigger:"blur"}],"expertInviteRule.avoidRule.avoidUnitIdList":[{required:!0,message:"请添加回避单位",trigger:"blur"}],"expertInviteRule.avoidRule.expertIds":[{required:!0,message:"请添加回避专家",trigger:"blur"}],"expertInviteRule.avoidRule.avoidOrgIdList":[{required:!0,message:"请添加回避条线",trigger:"blur"}],"expertInviteRule.avoidRule.avoidType":[{required:!0,message:"请选择"}]}),b=V(!1),W=async n=>{n&&await n.validate(async(e,f)=>{var s,r,u,x;if(e){const o=JSON.parse(JSON.stringify(i));if(i.expertInviteRule.inviteType===1?(delete o.expertInviteRule.appointRule,o.expertInviteRule.randomRules=F.value.handleParmas()):(delete o.expertInviteRule.randomRules,o.expertInviteRule.appointRule.inviteType=o.expertInviteRule.inviteType,o.expertInviteRule.appointRule.expertIdList=o.expertInviteRule.appointRule.expertIdList.map(I=>I.id),o.expertInviteRule.appointRule.count=(r=(s=o.expertInviteRule.appointRule)==null?void 0:s.expertIdList)==null?void 0:r.length),o.expertInviteRule.avoidRule.avoidUnitIdList=o.expertInviteRule.avoidRule.avoidUnitIdList.map(I=>I.organizationCode),o.expertInviteRule.avoidRule.expertIds=o.expertInviteRule.avoidRule.expertIds.map(I=>I.userId),i.meetingBasicInfo.isInnerProject?o.meetingBasicInfo.innerProjects=o.meetingBasicInfo.projectIdList.map(I=>({projectId:I.id,projectCode:I.projectCode})):(o.meetingBasicInfo.projects=[],o.meetingBasicInfo.projects.push({projectName:i.meetingBasicInfo.projects})),o.meetingBasicInfo.startTime=((u=o.meetingBasicInfo.times)==null?void 0:u[0])||void 0,o.meetingBasicInfo.endTime=((x=o.meetingBasicInfo.times)==null?void 0:x[1])||void 0,o.meetingBasicInfo.times=void 0,b.value=!0,o.expertInviteRule.inviteType===2)await O(o),b.value=!1;else{const I=await ye(o);b.value=!1;const B=o.expertInviteRule.randomRules.reduce((D,T)=>D+T.count,0);I.data.canInvite<B?je.confirm("当前可邀请专家数量不足,是否继续邀请?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(()=>{O(o),b.value=!1}).catch(()=>{b.value=!1}):(await O(o),b.value=!1)}}else console.log("error submit!",f)})},O=async n=>{try{await Be(n),H.$message.success("提交成功!"),b.value=!1,Y.go(-1)}catch{b.value=!1}},y=k({visible:!1,meetingType:i.meetingBasicInfo.type,data:[]}),K=()=>{y.visible=!0,y.meetingType=i.meetingBasicInfo.type,y.data=i.meetingBasicInfo.projectIdList},Q=n=>{i.meetingBasicInfo.projectIdList=JSON.parse(JSON.stringify(n)),y.visible=!1},X=n=>{const e=i.meetingBasicInfo.projectIdList.findIndex(f=>f.id===n.id);i.meetingBasicInfo.projectIdList.splice(e,1)},C=V(),$e=()=>{C.value="回避条线",m.defaultProps={children:"records",label:"businessStripName",value:"businessStripCode",isLeaf:"isLeaf"},m.type="LINE",m.unitVisible=!0,m.showCheckbox=!0,m.data=i.expertInviteRule.avoidRule.avoidOrgIdList&&i.expertInviteRule.avoidRule.avoidOrgIdList.map(n=>n)||[]},Fe=n=>{i.expertInviteRule.avoidRule.avoidOrgIdList.splice(n,1)},m=k({unitVisible:!1,showCheckbox:!1,data:void 0}),Z=()=>{m.unitVisible=!0,m.showCheckbox=!0,m.defaultProps={children:"children",label:"title",value:"key",isLeaf:"isLeaf"},m.type="UNIT",m.data=i.expertInviteRule.avoidRule.avoidUnitIdList&&i.expertInviteRule.avoidRule.avoidUnitIdList.map(n=>({key:n.organizationCode,title:n.name}))||[]},ee=()=>{C.value=void 0,m.unitVisible=!1},te=n=>{C.value==="回避条线"?i.expertInviteRule.avoidRule.avoidOrgIdList=n.map(e=>e):i.expertInviteRule.avoidRule.avoidUnitIdList=n.map(e=>({organizationCode:e.key,name:e.title}))},le=n=>{i.expertInviteRule.avoidRule.avoidUnitIdList.splice(n,1)},U=V(),R=k({visible:!1,data:[]}),ie=()=>{var n,e;U.value=1,R.visible=!0,R.data=((e=(n=i.expertInviteRule.appointRule)==null?void 0:n.expertIdList)==null?void 0:e.map(f=>({userId:f.id,expertName:f.name})))||[]},ae=n=>{U.value===1?i.expertInviteRule.appointRule.expertIdList=n.map(e=>({id:e.userId,name:e.expertName})):i.expertInviteRule.avoidRule.expertIds=n,R.visible=!1},ne=n=>{i.expertInviteRule.appointRule.expertIdList.splice(i.expertInviteRule.appointRule.expertIdList.indexOf(n),1)},oe=n=>{i.expertInviteRule.avoidRule.expertIds.splice(i.expertInviteRule.avoidRule.expertIds.indexOf(n),1)},re=()=>{var n;U.value=2,R.visible=!0,R.data=((n=i.expertInviteRule.avoidRule)==null?void 0:n.expertIds)||[]},se=n=>{n?i.meetingBasicInfo.projects=void 0:i.meetingBasicInfo.projectIdList=void 0},ue=()=>{i.meetingBasicInfo.projectIdList=[]},de=V([]),pe=async()=>{const n=await we();de.value=n.data};return Te(async()=>{pe()}),(n,e)=>{const f=d("el-input"),s=d("el-form-item"),r=d("el-col"),u=d("el-row"),x=d("el-radio"),o=d("el-radio-group"),I=d("table-list"),B=d("el-button"),D=d("el-date-picker"),T=d("el-card"),me=d("Plus"),fe=d("el-icon"),h=d("el-tag"),M=d("el-option"),ge=d("el-select"),ce=d("el-input-number"),ve=d("el-form");return g(),L(j,null,[t(ve,{ref_key:"ruleFormRef",ref:$,model:i,rules:G,"label-width":"auto",class:"demo-ruleForm footerPage","label-suffix":":","scroll-to-error":""},{default:l(()=>[t(T,{class:"mb-16",shadow:"never"},{header:l(()=>e[21]||(e[21]=[c("div",{class:"card-header"},[c("span",null,"基本信息")],-1)])),default:l(()=>[t(u,{gutter:20},{default:l(()=>[t(r,{span:24},{default:l(()=>[t(s,{label:"会议名称",prop:"meetingBasicInfo.name"},{default:l(()=>[t(f,{modelValue:i.meetingBasicInfo.name,"onUpdate:modelValue":e[0]||(e[0]=a=>i.meetingBasicInfo.name=a),placeholder:"请输入",maxlength:50},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),t(u,{gutter:20},{default:l(()=>[t(r,{span:24},{default:l(()=>[t(s,{label:"是否系统内项目",prop:"meetingBasicInfo.isInnerProject"},{default:l(()=>[t(o,{modelValue:i.meetingBasicInfo.isInnerProject,"onUpdate:modelValue":e[1]||(e[1]=a=>i.meetingBasicInfo.isInnerProject=a),class:"ml-4",onChange:se},{default:l(()=>[t(x,{label:!0},{default:l(()=>e[22]||(e[22]=[p("是")])),_:1}),t(x,{label:!1},{default:l(()=>e[23]||(e[23]=[p("否")])),_:1})]),_:1},8,["modelValue"])]),_:1})]),_:1})]),_:1}),t(u,{gutter:20},{default:l(()=>[t(r,{span:24},{default:l(()=>[t(s,{label:"评审类型",prop:"meetingBasicInfo.type"},{default:l(()=>[t(o,{modelValue:i.meetingBasicInfo.type,"onUpdate:modelValue":e[2]||(e[2]=a=>i.meetingBasicInfo.type=a),onChange:ue},{default:l(()=>[(g(!0),L(j,null,N(q(A),(a,v)=>(g(),_(x,{key:v,label:v},{default:l(()=>[p(w(a),1)]),_:2},1032,["label"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1})]),_:1}),t(u,{gutter:20},{default:l(()=>[t(r,{span:i.meetingBasicInfo.isInnerProject?24:12},{default:l(()=>[i.meetingBasicInfo.isInnerProject?(g(),_(s,{key:0,label:"评审项目",prop:"meetingBasicInfo.projectIdList"},{default:l(()=>[t(I,{class:"w-full",column:z,pagination:!1,height:200,data:i.meetingBasicInfo.projectIdList},{projectTypeName:l(({scope:a})=>{var v;return[p(w(q(E)[(v=a.row)==null?void 0:v.projectType]),1)]}),action:l(({scope:a})=>[c("a",{onClick:v=>X(a.row)},"删除",8,De)]),_:1},8,["column","data"])]),_:1})):(g(),_(s,{key:1,label:"评审项目",prop:"meetingBasicInfo.projects"},{default:l(()=>[t(f,{modelValue:i.meetingBasicInfo.projects,"onUpdate:modelValue":e[3]||(e[3]=a=>i.meetingBasicInfo.projects=a),placeholder:"请输入",maxlength:50},null,8,["modelValue"])]),_:1}))]),_:1},8,["span"]),t(r,{span:12},{default:l(()=>[i.meetingBasicInfo.isInnerProject?(g(),_(B,{key:0,class:"ml-40",type:"primary",disabled:!i.meetingBasicInfo.type,onClick:e[4]||(e[4]=a=>K())},{default:l(()=>e[24]||(e[24]=[p("添加项目")])),_:1},8,["disabled"])):P("",!0)]),_:1})]),_:1}),t(u,{gutter:20,class:"mt-30"},{default:l(()=>[t(r,{span:15},{default:l(()=>[t(s,{label:"评审时间",prop:"meetingBasicInfo.times"},{default:l(()=>[t(D,{modelValue:i.meetingBasicInfo.times,"onUpdate:modelValue":e[5]||(e[5]=a=>i.meetingBasicInfo.times=a),type:"datetimerange",placeholder:"请选择",format:"YYYY-MM-DD HH:mm","value-format":"YYYY-MM-DD HH:mm"},null,8,["modelValue"])]),_:1})]),_:1}),t(r,{span:12},{default:l(()=>[t(s,{label:"评审耗时",prop:"meetingBasicInfo.meetingUsageTime"},{default:l(()=>[t(o,{modelValue:i.meetingBasicInfo.meetingUsageTime,"onUpdate:modelValue":e[6]||(e[6]=a=>i.meetingBasicInfo.meetingUsageTime=a),class:"ml-4"},{default:l(()=>[t(x,{label:1},{default:l(()=>e[25]||(e[25]=[p("半天")])),_:1}),t(x,{label:2},{default:l(()=>e[26]||(e[26]=[p("一天")])),_:1})]),_:1},8,["modelValue"])]),_:1})]),_:1}),t(r,{span:12},{default:l(()=>[t(s,{label:"评委到场时间",prop:"meetingBasicInfo.judgesAttendanceTime"},{default:l(()=>[t(D,{modelValue:i.meetingBasicInfo.judgesAttendanceTime,"onUpdate:modelValue":e[7]||(e[7]=a=>i.meetingBasicInfo.judgesAttendanceTime=a),type:"datetime",placeholder:"请选择",format:"YYYY-MM-DD HH:mm","value-format":"YYYY-MM-DD HH:mm"},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),t(u,{gutter:20},{default:l(()=>[t(r,{span:24},{default:l(()=>[t(s,{label:"评审地点",prop:"meetingBasicInfo.meetingAddress"},{default:l(()=>[t(f,{modelValue:i.meetingBasicInfo.meetingAddress,"onUpdate:modelValue":e[8]||(e[8]=a=>i.meetingBasicInfo.meetingAddress=a),placeholder:"请输入",maxlength:50},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),t(u,{gutter:20},{default:l(()=>[t(r,{span:12},{default:l(()=>[t(s,{label:"联系人",prop:"meetingBasicInfo.connecter"},{default:l(()=>[t(f,{modelValue:i.meetingBasicInfo.connecter,"onUpdate:modelValue":e[9]||(e[9]=a=>i.meetingBasicInfo.connecter=a),placeholder:"请输入",maxlength:20},null,8,["modelValue"])]),_:1})]),_:1}),t(r,{span:12},{default:l(()=>[t(s,{label:"联系方式",prop:"meetingBasicInfo.contact"},{default:l(()=>[t(f,{modelValue:i.meetingBasicInfo.contact,"onUpdate:modelValue":e[10]||(e[10]=a=>i.meetingBasicInfo.contact=a),placeholder:"请输入",maxlength:11},null,8,["modelValue"])]),_:1})]),_:1})]),_:1})]),_:1}),t(T,{class:"mb-16",shadow:"never"},{header:l(()=>e[27]||(e[27]=[c("div",{class:"card-header"},[c("span",null,"抽取信息")],-1)])),default:l(()=>[t(u,{gutter:20},{default:l(()=>[t(r,{span:12},{default:l(()=>[t(s,{label:"抽取方式",prop:"expertInviteRule.inviteType"},{default:l(()=>[t(o,{modelValue:i.expertInviteRule.inviteType,"onUpdate:modelValue":e[11]||(e[11]=a=>i.expertInviteRule.inviteType=a),class:"ml-4"},{default:l(()=>[t(x,{label:1},{default:l(()=>e[28]||(e[28]=[p("随机抽取")])),_:1}),t(x,{label:2},{default:l(()=>e[29]||(e[29]=[p("指定抽取")])),_:1})]),_:1},8,["modelValue"])]),_:1})]),_:1})]),_:1}),i.expertInviteRule.inviteType==1?(g(),_(u,{key:0,gutter:20},{default:l(()=>[t(Re,{ref_key:"ruleFormComRef",ref:F,modelValue:S.value,"onUpdate:modelValue":e[12]||(e[12]=a=>S.value=a)},null,8,["modelValue"])]),_:1})):(g(),_(u,{key:1,gutter:20},{default:l(()=>[t(r,{span:24},{default:l(()=>[t(s,{label:"指定抽取理由",prop:"expertInviteRule.appointRule.inviteDesc"},{default:l(()=>[t(f,{modelValue:i.expertInviteRule.appointRule.inviteDesc,"onUpdate:modelValue":e[13]||(e[13]=a=>i.expertInviteRule.appointRule.inviteDesc=a),placeholder:"请输入",type:"textarea",maxlength:"1000","show-word-limit":!0},null,8,["modelValue"])]),_:1})]),_:1}),t(r,{span:12},{default:l(()=>[t(s,{label:"指定专家",prop:"expertInviteRule.appointRule.expertIdList"},{default:l(()=>[c("div",Ne,[t(B,{type:"primary",class:"button-new-tag ml-1",size:"small",onClick:ie},{default:l(()=>[t(fe,null,{default:l(()=>[t(me)]),_:1}),e[30]||(e[30]=p("添加专家 "))]),_:1}),c("p",null,[(g(!0),L(j,null,N(i.expertInviteRule.appointRule.expertIdList,a=>(g(),_(h,{key:a,class:"mx-1",closable:"","disable-transitions":!1,onClose:v=>ne(a)},{default:l(()=>[p(w(a.name),1)]),_:2},1032,["onClose"]))),128))])])]),_:1})]),_:1})]),_:1}))]),_:1}),i.expertInviteRule.inviteType==1?(g(),_(T,{key:0,shadow:"never"},{header:l(()=>e[31]||(e[31]=[c("div",{class:"card-header"},[c("span",null,"回避信息")],-1)])),default:l(()=>[t(u,null,{default:l(()=>[t(r,null,{default:l(()=>[t(s,{label:"部门、条线回避规则",prop:"expertInviteRule.avoidRule.avoidType"},{default:l(()=>[t(ge,{modelValue:i.expertInviteRule.avoidRule.avoidType,"onUpdate:modelValue":e[14]||(e[14]=a=>i.expertInviteRule.avoidRule.avoidType=a)},{default:l(()=>[t(M,{value:2,label:"回避条线"}),t(M,{value:3,label:"不回避"})]),_:1},8,["modelValue"])]),_:1})]),_:1})]),_:1}),t(u,{gutter:20},{default:l(()=>[t(r,{span:12},{default:l(()=>[t(s,{label:"回避单位"},{default:l(()=>[c("div",Pe,[t(B,{type:"primary",size:"small",icon:"Plus",onClick:Z},{default:l(()=>e[32]||(e[32]=[p(" 添加回避单位 ")])),_:1}),c("p",null,[(g(!0),L(j,null,N(i.expertInviteRule.avoidRule.avoidUnitIdList,(a,v)=>(g(),_(h,{key:v,class:"mr-8",closable:"",onClose:Ie=>le(v)},{default:l(()=>[p(w(a.name),1)]),_:2},1032,["onClose"]))),128))])])]),_:1})]),_:1})]),_:1}),t(u,{gutter:20},{default:l(()=>[t(r,{span:12},{default:l(()=>[t(s,{label:"回避专家"},{default:l(()=>[c("div",Oe,[t(B,{type:"primary",class:"button-new-tag ml-1",size:"small",icon:"Plus",onClick:re},{default:l(()=>e[33]||(e[33]=[p(" 添加回避专家 ")])),_:1}),c("p",null,[(g(!0),L(j,null,N(i.expertInviteRule.avoidRule.expertIds,a=>(g(),_(h,{key:a,class:"mx-1",closable:"","disable-transitions":!1,onClose:v=>oe(a)},{default:l(()=>[p(w(a.expertName),1)]),_:2},1032,["onClose"]))),128))])])]),_:1})]),_:1})]),_:1}),t(u,{gutter:20},{default:l(()=>[t(r,{span:12},{default:l(()=>[P("",!0),P("",!0)]),_:1})]),_:1}),t(u,{gutter:20},{default:l(()=>[t(r,{span:24},{default:l(()=>[t(s,{label:"一周内参与"},{default:l(()=>[t(ce,{modelValue:i.expertInviteRule.avoidRule.weekInviteCount,"onUpdate:modelValue":e[16]||(e[16]=a=>i.expertInviteRule.avoidRule.weekInviteCount=a),placeholder:"请输入",min:0,controls:!1,style:{width:"100px !important"}},null,8,["modelValue"]),e[35]||(e[35]=c("div",{style:{fontSize:"14px",color:"#666666",lineHeight:"2em"}},"次的专家不再抽取",-1))]),_:1})]),_:1})]),_:1})]),_:1})):P("",!0),c("div",he,[t(B,{type:"primary",loading:b.value,onClick:e[17]||(e[17]=a=>W($.value))},{default:l(()=>e[36]||(e[36]=[p(" 提交 ")])),_:1},8,["loading"]),t(B,{onClick:e[18]||(e[18]=a=>q(Y).go(-1))},{default:l(()=>e[37]||(e[37]=[p("返回")])),_:1})])]),_:1},8,["model","rules"]),t(xe,{visible:m.unitVisible,"show-checkbox":m.showCheckbox,"default-data":m.data,title:C.value,type:m.type,"default-props":m.defaultProps,onClose:ee,onGetSelectUnit:te},null,8,["visible","show-checkbox","default-data","title","type","default-props"]),t(_e,{visible:R.visible,"org-code":R.orgCode,data:R.data,"select-expert-type":U.value,onGetUserData:ae,onClose:e[19]||(e[19]=a=>R.visible=!1)},null,8,["visible","org-code","data","select-expert-type"]),t(be,{visible:y.visible,data:y.data,"meeting-type":y.meetingType,"dictionary-list":n.dictionaryList,onGetProjectData:Q,onClose:e[20]||(e[20]=a=>y.visible=!1)},null,8,["visible","data","meeting-type","dictionary-list"])],64)}}});export{Ke as default};
|