2 lines
12 KiB
JavaScript
2 lines
12 KiB
JavaScript
import{_ as ie,V as re,o as m,c as x,e as t,f as n,E as U,j as d,k as b,a5 as ue,h as i,t as c,n as pe,g as z,d as I,a as h,F as E,r as X,q as de}from"./index-C1KISTGN.js";import{a as T}from"./index-42ANG6Sg.js";const ce={class:"evaluation-manage"},me={key:1},fe={class:"supplier-title"},ye={style:{"font-weight":"bold",color:"#409EFF"}},ge={class:"score-summary"},be={style:{color:"#67c23a"}},ve={style:{"margin-bottom":"12px",color:"#606266","font-size":"13px",padding:"0 4px"}},_e={style:{color:"#0052D9"}},xe={__name:"Evaluation",setup(he){const q=b([]),D=b(!1),j=b(null),g=de({count:3,specialties:[]}),V=b([]),S=b("form"),B=b(!1),Y=["医疗设备","药品采购","信息化系统","工程建设","财务审计","法律合规","后勤管理"],R=[{name:"王建国",title:"主任医师",specialty:"医疗设备",unit:"山东省立医院",phone:"13800138001"},{name:"李秀梅",title:"副主任医师",specialty:"药品采购",unit:"齐鲁医院",phone:"13900139002"},{name:"张志远",title:"高级工程师",specialty:"信息化系统",unit:"山东大学",phone:"13700137003"},{name:"刘晓燕",title:"注册会计师",specialty:"财务审计",unit:"山东省审计厅",phone:"13600136004"},{name:"陈伟华",title:"高级工程师",specialty:"工程建设",unit:"山东建筑大学",phone:"13500135005"},{name:"赵明亮",title:"主任药师",specialty:"药品采购",unit:"山东省药品监督管理局",phone:"18600186006"},{name:"孙丽娜",title:"律师",specialty:"法律合规",unit:"山东众成清泰律师事务所",phone:"18800188007"},{name:"周国强",title:"高级工程师",specialty:"医疗设备",unit:"山东医疗器械研究所",phone:"15900159008"},{name:"吴雪峰",title:"副教授",specialty:"信息化系统",unit:"山东师范大学",phone:"15800158009"},{name:"郑海燕",title:"主任护师",specialty:"医疗设备",unit:"山东省肿瘤医院",phone:"15700157010"},{name:"马文博",title:"高级经济师",specialty:"财务审计",unit:"山东省财政厅",phone:"15600156011"},{name:"徐晓东",title:"高级工程师",specialty:"工程建设",unit:"山东省建设厅",phone:"15000150012"},{name:"林静怡",title:"主任药师",specialty:"药品采购",unit:"山东省立医院药剂科",phone:"15100151013"},{name:"黄志强",title:"副教授",specialty:"法律合规",unit:"山东大学法学院",phone:"15200152014"},{name:"谢美玲",title:"高级工程师",specialty:"后勤管理",unit:"山东省后勤管理协会",phone:"15300153015"}],Z=l=>{if(l.openingDate){const e=new Date(l.openingDate).getTime(),r=Date.now(),s=e-r,u=4*24*60*60*1e3;if(s>u){U.warning("离开标大于4天,暂不允许抽取专家");return}}j.value=l,g.count=3,g.specialties=[],V.value=[],S.value="form",D.value=!0},A=()=>{let l=R;if(g.specialties.length){const r=R.filter(s=>g.specialties.includes(s.specialty));l=r.length>=g.count?r:R}const e=[...l].sort(()=>Math.random()-.5);V.value=e.slice(0,g.count),S.value="result"},ee=async()=>{B.value=!0;try{await T.post("/api/bidding/extract-experts",{projectId:j.value.id,experts:V.value})}catch{}j.value.expertCount=g.count,U.success("专家抽取成功"),D.value=!1,B.value=!1},N=b(""),F=async()=>{var l,e;try{const[r,s]=await Promise.all([T.get("/api/bidding/enrollment-summary"),T.get("/api/bidding/list")]),u=((l=s.data)==null?void 0:l.data)||[],k=((e=r.data)==null?void 0:e.data)||[],C=Object.fromEntries(k.map(o=>[o.id,o]));q.value=u.filter(o=>N.value?o.name.includes(N.value):!0).map((o,_)=>{const y={...o,...C[o.id]},p=[1,10,3,7,2,15,5,20,4,8],w=new Date;return w.setDate(w.getDate()+p[_%p.length]),y.openingDate=w.toISOString().replace("T"," ").substring(0,19),(_===0||_===1)&&(y.status=2,y.expertCount=0),y})}catch{U.error("加载数据失败")}};re(F);const M=b(!1),v=b(null),$=b([]),te=async l=>{var e,r,s;v.value=l,$.value=[];try{const k=((e=(await T.get(`/api/bidding/${l.id}`)).data)==null?void 0:e.data)||{},C=k.enrollments||[],_=(((r=(await T.get("/api/bidding/evaluations")).data)==null?void 0:r.data)||[]).filter(p=>p.projectCode===l.code),y={};for(const p of C)y[p.supplierId]={supplierId:p.supplierId,supplierName:p.supplierName,scores:[]};for(const p of _){const w=Object.values(y).find(P=>P.supplierName===p.supplierName);w&&w.scores.push(p)}$.value=Object.values(y),v.value={...l,winnerSupplierId:(s=k.project)==null?void 0:s.winnerSupplierId}}catch{U.error("加载评标数据失败")}M.value=!0},W=l=>{const e=Number(l.priceScore||0),r=Number(l.businessScore||0),s=Number(l.techScore||0);return((e+r+s)/3).toFixed(2)},L=(l,e)=>l.length?(l.reduce((s,u)=>s+Number(u[e]||0),0)/l.length).toFixed(2):"—",le=l=>l.length?(l.reduce((r,s)=>r+Number(W(s)),0)/l.length).toFixed(2):"—",G=l=>({0:"草稿",1:"报名中",2:"已开标",3:"评标中",4:"已定标",5:"已完成"})[l]??"—",H=l=>({0:"info",1:"success",2:"warning",3:"warning",4:"primary",5:"success"})[l]??"",K=l=>l.status===2&&(!l.expertCount||l.expertCount===0)?{key:"pending",label:"待评标",type:"danger"}:{key:String(l.status),label:G(l.status),type:H(l.status)},ne=l=>l?String(l).replace("T"," ").substring(0,16):"—",O=l=>{if(!l)return"—";const e=new Date(l).getTime()-Date.now();return e<=0?"已过":Math.ceil(e/(1e3*60*60*24))};return(l,e)=>{var Q;const r=d("el-input"),s=d("el-form-item"),u=d("el-button"),k=d("el-form"),C=d("el-tag"),o=d("el-table-column"),_=d("el-table"),y=d("el-card"),p=d("el-descriptions-item"),w=d("el-descriptions"),P=d("el-empty"),J=d("el-dialog"),ae=d("el-input-number"),oe=d("el-option"),se=d("el-select");return m(),x("div",ce,[t(y,null,{header:n(()=>[...e[8]||(e[8]=[h("span",{style:{"font-size":"16px","font-weight":"bold"}},"评标管理",-1)])]),default:n(()=>[t(k,{inline:"",style:{"margin-bottom":"16px"}},{default:n(()=>[t(s,{label:"项目名称"},{default:n(()=>[t(r,{modelValue:N.value,"onUpdate:modelValue":e[0]||(e[0]=a=>N.value=a),placeholder:"搜索项目名称",clearable:"",style:{width:"200px"},onKeyup:ue(F,["enter"])},null,8,["modelValue"])]),_:1}),t(s,null,{default:n(()=>[t(u,{type:"primary",onClick:F},{default:n(()=>[...e[9]||(e[9]=[i("查询",-1)])]),_:1}),t(u,{onClick:e[1]||(e[1]=a=>{N.value="",F()})},{default:n(()=>[...e[10]||(e[10]=[i("重置",-1)])]),_:1})]),_:1})]),_:1}),t(_,{data:q.value,border:"",stripe:""},{default:n(()=>[t(o,{label:"状态",width:"100",align:"center"},{default:n(({row:a})=>[t(C,{type:K(a).type,size:"small"},{default:n(()=>[i(c(K(a).label),1)]),_:2},1032,["type"])]),_:1}),t(o,{prop:"code",label:"项目编号",width:"160"}),t(o,{prop:"name",label:"项目名称","min-width":"180"}),t(o,{prop:"publishDate",label:"发布日期",width:"110"}),t(o,{prop:"openingDate",label:"开标日期",width:"160"}),t(o,{label:"离开标天数",width:"110",align:"center"},{default:n(({row:a})=>[a.openingDate?(m(),x("span",{key:0,style:pe({color:O(a.openingDate)<=4?"#E6A23C":"#606266",fontWeight:O(a.openingDate)<=4?"bold":"normal"})},c(O(a.openingDate))+" "+c(typeof O(a.openingDate)=="number"?"天":""),5)):(m(),x("span",me,"—"))]),_:1}),t(o,{label:"评标专家数",width:"100",align:"center",prop:"expertCount"}),t(o,{label:"已评供应商",width:"100",align:"center",prop:"evaluatedCount"}),t(o,{label:"操作",width:"200",align:"center",fixed:"right"},{default:n(({row:a})=>[K(a).key==="pending"?(m(),z(u,{key:0,size:"small",type:"warning",onClick:f=>Z(a)},{default:n(()=>[...e[11]||(e[11]=[i("专家抽取",-1)])]),_:1},8,["onClick"])):I("",!0),t(u,{size:"small",type:"primary",onClick:f=>te(a)},{default:n(()=>[...e[12]||(e[12]=[i("查看",-1)])]),_:1},8,["onClick"])]),_:1})]),_:1},8,["data"])]),_:1}),t(J,{modelValue:M.value,"onUpdate:modelValue":e[3]||(e[3]=a=>M.value=a),title:`${(Q=v.value)==null?void 0:Q.name} — 评标详情`,width:"1000px"},{footer:n(()=>[t(u,{onClick:e[2]||(e[2]=a=>M.value=!1)},{default:n(()=>[...e[14]||(e[14]=[i("关闭",-1)])]),_:1})]),default:n(()=>[v.value?(m(),x(E,{key:0},[t(w,{column:3,border:"",size:"small",style:{"margin-bottom":"20px"}},{default:n(()=>[t(p,{label:"项目编号"},{default:n(()=>[i(c(v.value.code),1)]),_:1}),t(p,{label:"项目状态"},{default:n(()=>[t(C,{type:H(v.value.status),size:"small"},{default:n(()=>[i(c(G(v.value.status)),1)]),_:1},8,["type"])]),_:1}),t(p,{label:"发布日期"},{default:n(()=>[i(c(v.value.publishDate),1)]),_:1})]),_:1}),(m(!0),x(E,null,X($.value,a=>(m(),x("div",{key:a.supplierId,style:{"margin-bottom":"20px"}},[h("div",fe,[i(c(a.supplierName)+" ",1),a.supplierId===v.value.winnerSupplierId?(m(),z(C,{key:0,type:"success",size:"small",style:{"margin-left":"8px"}},{default:n(()=>[...e[13]||(e[13]=[i("中标",-1)])]),_:1})):I("",!0)]),t(_,{data:a.scores,border:"",size:"small"},{default:n(()=>[t(o,{prop:"expertName",label:"评标专家",width:"120"}),t(o,{prop:"priceScore",label:"报价得分",width:"100",align:"center"}),t(o,{prop:"businessScore",label:"商务得分",width:"100",align:"center"}),t(o,{prop:"techScore",label:"技术得分",width:"100",align:"center"}),t(o,{label:"总分",width:"100",align:"center"},{default:n(({row:f})=>[h("span",ye,c(W(f)),1)]),_:1}),t(o,{prop:"comment",label:"评语","min-width":"160","show-overflow-tooltip":""}),t(o,{label:"评标时间",width:"150"},{default:n(({row:f})=>[i(c(ne(f.evaluatedTime)),1)]),_:1})]),_:1},8,["data"]),h("div",ge,[i(" 平均报价:"+c(L(a.scores,"priceScore"))+" | 平均商务:"+c(L(a.scores,"businessScore"))+" | 平均技术:"+c(L(a.scores,"techScore"))+" | 综合均分:",1),h("strong",be,c(le(a.scores)),1)])]))),128)),$.value.length===0?(m(),z(P,{key:0,description:"暂无评标记录"})):I("",!0)],64)):I("",!0)]),_:1},8,["modelValue","title"]),t(J,{modelValue:D.value,"onUpdate:modelValue":e[7]||(e[7]=a=>D.value=a),title:"专家抽取",width:"600px","close-on-click-modal":!1},{footer:n(()=>[S.value==="form"?(m(),z(u,{key:0,onClick:e[6]||(e[6]=a=>D.value=!1)},{default:n(()=>[...e[20]||(e[20]=[i("取消",-1)])]),_:1})):(m(),x(E,{key:1},[t(u,{onClick:A},{default:n(()=>[...e[21]||(e[21]=[i("重新抽取",-1)])]),_:1}),t(u,{type:"primary",loading:B.value,onClick:ee},{default:n(()=>[...e[22]||(e[22]=[i("确认并保存",-1)])]),_:1},8,["loading"])],64))]),default:n(()=>{var a;return[S.value==="form"?(m(),z(k,{key:0,"label-width":"90px",style:{padding:"10px 20px"}},{default:n(()=>[t(s,{label:"专家人数"},{default:n(()=>[t(ae,{modelValue:g.count,"onUpdate:modelValue":e[4]||(e[4]=f=>g.count=f),min:1,max:9,style:{width:"160px"}},null,8,["modelValue"]),e[15]||(e[15]=h("span",{style:{"margin-left":"10px",color:"#909399","font-size":"13px"}},"人",-1))]),_:1}),t(s,{label:"专业方向"},{default:n(()=>[t(se,{modelValue:g.specialties,"onUpdate:modelValue":e[5]||(e[5]=f=>g.specialties=f),multiple:"",placeholder:"不限专业(可多选)",style:{width:"100%"}},{default:n(()=>[(m(),x(E,null,X(Y,f=>t(oe,{key:f,label:f,value:f},null,8,["label","value"])),64))]),_:1},8,["modelValue"])]),_:1}),t(s,null,{default:n(()=>[t(u,{type:"primary",onClick:A},{default:n(()=>[...e[16]||(e[16]=[i("开始抽取",-1)])]),_:1})]),_:1})]),_:1})):S.value==="result"?(m(),x(E,{key:1},[h("div",ve,[e[17]||(e[17]=i(" 已为项目 ",-1)),h("strong",null,c((a=j.value)==null?void 0:a.name),1),e[18]||(e[18]=i(" 随机抽取 ",-1)),h("strong",_e,c(V.value.length),1),e[19]||(e[19]=i(" 名专家: ",-1))]),t(_,{data:V.value,border:"",size:"small"},{default:n(()=>[t(o,{prop:"name",label:"姓名",width:"90",align:"center"}),t(o,{prop:"title",label:"职称",width:"120",align:"center"}),t(o,{prop:"specialty",label:"专业",width:"110",align:"center"}),t(o,{prop:"phone",label:"联系电话",width:"120",align:"center"}),t(o,{prop:"unit",label:"单位","min-width":"160","show-overflow-tooltip":""})]),_:1},8,["data"])],64)):I("",!0)]}),_:1},8,["modelValue"])])}}},Ce=ie(xe,[["__scopeId","data-v-85d9a87c"]]);export{Ce as default};
|