feat(项目管理): 招标字段/负责人/导出/下拉/登录短信 完整链路
后端 (ruoyi-business) - BizProject: +is_bid_project, +execOrgNames(GROUP_CONCAT派生), +leadUserName - BizProjectMapper.xml: 上述字段全部贯通 selectFields/insert/update, 列表加 exec_org_names 子查询 + lead_user_name JOIN - BizSysUserQueryMapper (新): 干净查 sys_user by role_type, 避开 @DataScope 切面污染, 用于项目负责人下拉 - BizOrgMapper.selectExecutorOrgOptions (新): JOIN sys_user (parent_user_id IS NULL) 限定 MAIN 账号, 排除同公司普通员工子账号 - BizOrgController: +/business/org/executorOptions 端点 - BizExecutionIntentController: +exportSignupExperts 端点 (POST /business/executionIntent/export) - BizSignupExpertExportVo (新): 中文列头 Excel 导出 VO (专家姓名/科室/医院/职称/报名时间/手机号) - BizProjectAssign / SponsorAssign 重命名 + Service 实现调整 - 删除 sql/ 下所有迁移脚本 (按用户要求不再保存 SQL 文件) 前端 (ry-vue3) - api/system.js: +listExecutorOrgs 走新接口, listExecutor/listSupporters/listManagers 保持 listByRole 兼容 - views/manager/Projects.vue: 执行方下拉改 label=u.orgName / value=u.userId, 数据源走 listExecutorOrgs +execOrgNames 列展示 +导出报名专家 dropdown 项 +is_bid_project 表单字段 - views/manager/ProjectsNew.vue + ManagerProjectDetail.vue: +is_bid_project 表单/展示 - views/auth/Login.vue: +手机号验证码登录 tab (复用 SysSmsService, dev 模式 10 开头手机号固定码 1234) - 路由/布局/角色视角多页面整理 (SponsorOrgs/People/SponsorPersonNew 等) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -137,7 +137,10 @@ function reset() {
|
||||
|
||||
async function onToggleStatus(row) {
|
||||
const disabled = isDisabled(row)
|
||||
const newStatus = disabled ? '正常' : '禁用'
|
||||
// sys_user.status 是 CHAR(1), 只能写 '0'/'1' (禁用='1', 启用='0')
|
||||
// 必须带 userId: BizPersonServiceImpl.updateByPrimaryKey 仅在 userId != null 时
|
||||
// 才同步 status 到 sys_user, 否则只更新 biz_person (而 biz_person.status 已删除)
|
||||
const newStatus = disabled ? '0' : '1'
|
||||
const label = disabled ? '启用' : '禁用'
|
||||
try {
|
||||
await ElMessageBox.confirm(
|
||||
@@ -147,7 +150,7 @@ async function onToggleStatus(row) {
|
||||
)
|
||||
} catch { return }
|
||||
try {
|
||||
await bizUpdate('person', { personId: row.personId, status: newStatus })
|
||||
await bizUpdate('person', { personId: row.personId, userId: row.userId, status: newStatus })
|
||||
ElMessage.success('已' + label)
|
||||
load()
|
||||
} catch (e) { ElMessage.error(e?.msg || '操作失败') }
|
||||
|
||||
@@ -5,54 +5,61 @@
|
||||
首页 / 项目管理 / <span class="current">项目详情</span>
|
||||
</div>
|
||||
|
||||
<!-- ================= 1. 项目信息 (11 字段, 一列竖排) ================= -->
|
||||
<el-form v-if="row && row.projectId" label-position="left" class="info-form">
|
||||
<el-form-item label="项目编号">
|
||||
<span class="info-value">{{ row.projectNo || '-' }}</span>
|
||||
</el-form-item>
|
||||
<el-form-item label="项目名称">
|
||||
<span class="info-value">{{ row.projectName || '-' }}</span>
|
||||
</el-form-item>
|
||||
<el-form-item label="总场次/总期数">
|
||||
<span class="info-value">{{ row.totalSessions || 0 }}</span>
|
||||
</el-form-item>
|
||||
<el-form-item label="总金额">
|
||||
<span class="info-value money">¥ {{ fmtMoney(row.totalAmount) }}</span>
|
||||
</el-form-item>
|
||||
<el-form-item label="管理费及税金">
|
||||
<span class="info-value money">¥ {{ fmtMoney(row.manageFee) }}</span>
|
||||
</el-form-item>
|
||||
<el-form-item label="项目开始时间">
|
||||
<span class="info-value">{{ fmtDate(row.startTime) }}</span>
|
||||
</el-form-item>
|
||||
<el-form-item label="项目结束时间">
|
||||
<span class="info-value">{{ fmtDate(row.endTime) }}</span>
|
||||
</el-form-item>
|
||||
<el-form-item label="赞助公司">
|
||||
<span class="info-value">{{ row.sponsorAdminUserName || '-' }}</span>
|
||||
</el-form-item>
|
||||
<el-form-item label="项目形式">
|
||||
<span class="info-value">{{ row.projectForm || '-' }}</span>
|
||||
</el-form-item>
|
||||
<el-form-item label="项目评价">
|
||||
<a class="op-link" href="javascript:void(0)" @click="openScoreDialog">{{ fmtScore(row.ratingScore) }}</a>
|
||||
</el-form-item>
|
||||
<!-- ================= 1. 项目信息 (11 字段, 两列) ================= -->
|
||||
<div class="new-card-title">项目信息</div>
|
||||
<el-form v-if="row && row.projectId" label-width="120px" class="info-form">
|
||||
<el-row :gutter="12">
|
||||
<el-col :span="12"><el-form-item label="项目编号"><span class="info-value">{{ row.projectNo || '-' }}</span></el-form-item></el-col>
|
||||
<el-col :span="12"><el-form-item label="项目名称"><span class="info-value">{{ row.projectName || '-' }}</span></el-form-item></el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="12">
|
||||
<el-col :span="12"><el-form-item label="总场次/总期数"><span class="info-value">{{ row.totalSessions || 0 }}</span></el-form-item></el-col>
|
||||
<el-col :span="12"><el-form-item label="总金额"><span class="info-value money">¥ {{ fmtMoney(row.totalAmount) }}</span></el-form-item></el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="12">
|
||||
<el-col :span="12"><el-form-item label="管理费及税金"><span class="info-value money">¥ {{ fmtMoney(row.manageFee) }}</span></el-form-item></el-col>
|
||||
<el-col :span="12"><el-form-item label="项目形式"><span class="info-value">{{ row.projectForm || '-' }}</span></el-form-item></el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="12">
|
||||
<el-col :span="12"><el-form-item label="项目开始时间"><span class="info-value">{{ fmtDate(row.startTime) }}</span></el-form-item></el-col>
|
||||
<el-col :span="12"><el-form-item label="项目结束时间"><span class="info-value">{{ fmtDate(row.endTime) }}</span></el-form-item></el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="12">
|
||||
<el-col :span="12"><el-form-item label="是否招标项目"><span class="info-value">{{ row.isBidProject === 'Y' ? '是' : '否' }}</span></el-form-item></el-col>
|
||||
<el-col :span="12"><el-form-item label="项目负责人"><span class="info-value">{{ row.leadUserName || row.sponsorAdminUserName || '-' }}</span></el-form-item></el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="12">
|
||||
<el-col :span="12"><el-form-item label="支持公司"><span class="info-value">{{ row.sponsorAdminUserName || '-' }}</span></el-form-item></el-col>
|
||||
<el-col :span="12"><el-form-item label="项目评价"><a class="op-link" href="javascript:void(0)" @click="openScoreDialog">{{ fmtScore(row.ratingScore) }}</a></el-form-item></el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
|
||||
<!-- ================= 2. 角色劳务设置 ================= -->
|
||||
<div class="section-title">角色劳务设置</div>
|
||||
<p class="hint-red">*角色劳务设置针对该项目所有会议生效</p>
|
||||
<el-table :data="form.roleRows" border>
|
||||
<el-table-column prop="role" label="角色" width="120" />
|
||||
<el-table-column label="劳务金额" align="right">
|
||||
<template #default="{ row }">¥ {{ fmtMoney(row.amount) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="80" align="center">
|
||||
<template #default="{ $index }">
|
||||
<el-button link type="danger" :disabled="form.roleRows.length<=1" @click="removeRoleRowAt($index)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<table class="info-table role-labor-table">
|
||||
<colgroup>
|
||||
<col style="width:120px">
|
||||
<col style="width:180px">
|
||||
<col style="width:80px">
|
||||
</colgroup>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>角色</th>
|
||||
<th style="text-align:right">劳务金额</th>
|
||||
<th style="text-align:center">操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="(r, idx) in form.roleRows" :key="idx">
|
||||
<td>{{ r.role || '-' }}</td>
|
||||
<td style="text-align:right">¥ {{ fmtMoney(r.amount) }}</td>
|
||||
<td style="text-align:center">
|
||||
<el-button link type="danger" :disabled="form.roleRows.length<=1" @click="removeRoleRowAt(idx)">删除</el-button>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<div style="margin-top:8px">
|
||||
<el-button link type="primary" @click="addRoleRow">+ 增加角色</el-button>
|
||||
</div>
|
||||
@@ -402,6 +409,13 @@ onMounted(async () => {
|
||||
.info-form :deep(.el-form-item__label) {
|
||||
font-size: 14px; color: #595959; width: 130px; padding-right: 16px;
|
||||
}
|
||||
/* 章节标题 (与编辑页 ProjectsNew.vue 保持一致) */
|
||||
.new-card-title {
|
||||
font-size: 14px; font-weight: 600; color: #262626;
|
||||
margin: 16px 0 12px; padding-left: 8px;
|
||||
border-left: 3px solid var(--brand-primary); line-height: 1;
|
||||
}
|
||||
.new-card-title:first-child { margin-top: 0; }
|
||||
.info-value { font-size: 15px; color: #1a1a1a; font-weight: 500; }
|
||||
.info-value.money {
|
||||
font-family: ui-monospace, "Courier New", monospace;
|
||||
@@ -425,6 +439,11 @@ onMounted(async () => {
|
||||
|
||||
/* 角色劳务表格 */
|
||||
.info-table { width: 100%; border-collapse: collapse; font-size: 13px; }
|
||||
.role-labor-table { width: auto; border: 1px solid #ebeef5; } /* 角色劳务表格按内容紧凑显示, 不撑满卡片 */
|
||||
.role-labor-table th,
|
||||
.role-labor-table td { border-right: 1px solid #ebeef5; }
|
||||
.role-labor-table th:last-child,
|
||||
.role-labor-table td:last-child { border-right: none; }
|
||||
.info-table th { background: #fafafa; padding: 10px 12px; text-align: left; color: #1a1a1a; font-weight: 600; border-bottom: 1px solid #f0f0f0; white-space: nowrap; }
|
||||
.info-table td { padding: 10px 12px; border-bottom: 1px solid #f5f5f5; color: #595959; vertical-align: middle; }
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
<el-form inline :model="q" class="filter-form">
|
||||
<el-form-item label="公司类型">
|
||||
<el-select v-model="q.orgType" placeholder="全部" clearable style="width:140px">
|
||||
<el-option label="赞助方" value="sponsor" />
|
||||
<el-option label="支持方" value="sponsor" />
|
||||
<el-option label="执行方" value="executor" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
@@ -40,7 +40,7 @@
|
||||
<el-table-column label="类型" width="100" align="center">
|
||||
<template #default="{ row }">
|
||||
<el-tag :type="row.orgType === 'sponsor' ? 'success' : 'primary'" disable-transitions>
|
||||
{{ row.orgType === 'sponsor' ? '赞助方' : '执行方' }}
|
||||
{{ row.orgType === 'sponsor' ? '支持方' : '执行方' }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
@@ -71,7 +71,7 @@
|
||||
<el-descriptions :column="1" border>
|
||||
<el-descriptions-item label="公司类型">
|
||||
<el-tag :type="currentRow.orgType === 'sponsor' ? 'success' : 'primary'">
|
||||
{{ currentRow.orgType === 'sponsor' ? '赞助方' : '执行方' }}
|
||||
{{ currentRow.orgType === 'sponsor' ? '支持方' : '执行方' }}
|
||||
</el-tag>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="公司名称">{{ currentRow.orgName }}</el-descriptions-item>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<div class="breadcrumb">首页 / 项目管理</div>
|
||||
|
||||
<el-form inline :model="q" class="filter-form">
|
||||
<el-form-item label="赞助方负责人:"><el-input v-model="q.sponsorAdminUserName" placeholder="输入账号/昵称" clearable /></el-form-item>
|
||||
<el-form-item label="支持单位:"><el-input v-model="q.sponsorOrgName" placeholder="输入支持单位名称" clearable /></el-form-item>
|
||||
<el-form-item label="服务机构:"><el-input v-model="q.execOrgName" placeholder="输入服务机构" clearable /></el-form-item>
|
||||
<el-form-item label="项目编号:"><el-input v-model="q.projectNo" placeholder="输入项目编号" clearable /></el-form-item>
|
||||
<el-form-item label="项目名称:"><el-input v-model="q.projectName" placeholder="输入项目名称" clearable /></el-form-item>
|
||||
@@ -64,7 +64,8 @@
|
||||
<span v-else style="color:#c0c4cc">-</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="sponsorAdminUserName" label="赞助方负责人" width="160" show-overflow-tooltip />
|
||||
<el-table-column prop="sponsorOrgName" label="支持单位" width="160" show-overflow-tooltip />
|
||||
<el-table-column prop="execOrgNames" label="服务机构" min-width="180" show-overflow-tooltip />
|
||||
<el-table-column prop="projectForm" label="项目形式" width="100" align="center" />
|
||||
<el-table-column prop="isFinished" label="是否结题" width="100" align="center">
|
||||
<template #default="{ row }">
|
||||
@@ -89,6 +90,7 @@
|
||||
<el-dropdown-item v-if="row.isFinished !== '1' && row.isFinished !== 1" command="close">结题</el-dropdown-item>
|
||||
<el-dropdown-item command="assign">项目分配</el-dropdown-item>
|
||||
<el-dropdown-item command="rate">执行单位评分</el-dropdown-item>
|
||||
<el-dropdown-item command="exportExperts" divided>导出报名专家</el-dropdown-item>
|
||||
<el-dropdown-item v-if="row.isPublished === '1' || row.publishUrl" command="activate" divided>开通</el-dropdown-item>
|
||||
<el-dropdown-item v-if="row.isPublished === '1' || row.publishUrl" command="delAnn" divided>删除公告</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
@@ -121,8 +123,8 @@
|
||||
<div style="color:#606266;font-size:13px">共 <b>{{ assignBatchProjects.length }}</b> 个项目</div>
|
||||
</el-form-item>
|
||||
<el-form-item label="支持方">
|
||||
<el-select v-model="assignForm.sponsorAdminUserId" placeholder="请选择赞助方负责人" filterable :filter-method="searchSupporters" clearable style="width:100%" @change="onSupporterPick">
|
||||
<el-option v-for="u in supporterOptions" :key="u.userId" :label="`${u.userName} (${u.nickName || ''})`" :value="u.userId" />
|
||||
<el-select v-model="assignForm.sponsorAdminUserId" placeholder="请选择支持单位" filterable :filter-method="searchSponsorOrgs" clearable style="width:100%" @change="onSponsorOrgPick">
|
||||
<el-option v-for="u in sponsorOrgOptions" :key="u.userId" :label="u.orgName" :value="u.userId" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-divider>执行方分配</el-divider>
|
||||
@@ -152,7 +154,7 @@
|
||||
style="width:100%"
|
||||
@change="v => onExecUserPick(row, v)">
|
||||
<el-option v-for="u in (row._options || [])" :key="u.userId"
|
||||
:label="`${u.userName}${u.nickName ? ' (' + u.nickName + ')' : ''}`" :value="u.userId" />
|
||||
:label="u.orgName" :value="u.userId" />
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
@@ -270,7 +272,7 @@
|
||||
import { ref, reactive, computed, onMounted, watch } from 'vue'
|
||||
import { useRouter, useRoute } from 'vue-router'
|
||||
import { bizList, bizAdd, bizUpdate, bizDelete } from '@/api/public'
|
||||
import { listExecutor, listSupporters } from '@/api/system'
|
||||
import { listExecutorOrgs, listSponsorOrgs } from '@/api/system'
|
||||
import request from '@/utils/request'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import { ArrowDown } from '@element-plus/icons-vue'
|
||||
@@ -278,7 +280,7 @@ import Preview from '@/components/Preview.vue'
|
||||
const router = useRouter()
|
||||
const route = useRoute()
|
||||
|
||||
const q = ref({ sponsorAdminUserName: '', execOrgName: '', projectNo: '', projectName: '', projectForm: '', startTime: '', endTime: '', isFinished: '', isSettled: '', ratingScore: '' })
|
||||
const q = ref({ sponsorOrgName: '', execOrgName: '', projectNo: '', projectName: '', projectForm: '', startTime: '', endTime: '', isFinished: '', isSettled: '', ratingScore: '' })
|
||||
const rows = ref([])
|
||||
const loading = ref(false)
|
||||
const page = reactive({ pageNum: 1, pageSize: 10, total: 0 })
|
||||
@@ -303,6 +305,7 @@ function onAction(cmd, row) {
|
||||
else if (cmd === 'close') openClose(row)
|
||||
else if (cmd === 'assign') doAssign(row)
|
||||
else if (cmd === 'rate') openSingleScore(row)
|
||||
else if (cmd === 'exportExperts') exportExperts(row)
|
||||
else if (cmd === 'activate') openActivate(row)
|
||||
else if (cmd === 'delAnn') openDeleteAnnouncement(row)
|
||||
}
|
||||
@@ -314,7 +317,7 @@ function doAssign(row) {
|
||||
assignOpen.value = true
|
||||
onAssignProjectChange(row.projectId)
|
||||
// 预加载 sponsor 候选
|
||||
setTimeout(() => loadSupporters(''), 100)
|
||||
setTimeout(() => loadSponsorOrgs(''), 100)
|
||||
}
|
||||
function doEdit(row) { router.push(`/manager/projects/edit/${row.projectId}`) }
|
||||
|
||||
@@ -330,12 +333,38 @@ async function doDelete(row) {
|
||||
}
|
||||
}
|
||||
|
||||
function reset() { q.value = { sponsorAdminUserName:'', execOrgName:'', projectNo:'', projectName:'', projectForm:'', startTime:'', endTime:'', isFinished:'', isSettled:'', ratingScore:'' }; page.pageNum = 1; load() }
|
||||
function reset() { q.value = { sponsorOrgName:'', execOrgName:'', projectNo:'', projectName:'', projectForm:'', startTime:'', endTime:'', isFinished:'', isSettled:'', ratingScore:'' }; page.pageNum = 1; load() }
|
||||
|
||||
// 导出
|
||||
function exportProjects() { ElMessage.info('导出项目功能开发中') }
|
||||
function exportEval() { ElMessage.info('项目评价导出功能开发中') }
|
||||
function exportExperts() { ElMessage.info('已报名专家信息导出功能开发中') }
|
||||
// 导出某项目的报名专家 (biz_execution_intent)
|
||||
// 字段: 专家姓名 科室 医院 职称 报名时间 手机号
|
||||
async function exportExperts(row) {
|
||||
if (!row || !row.projectNo) { ElMessage.warning('缺少项目编号'); return }
|
||||
try {
|
||||
// 后端 BizExecutionIntent 参数没 @RequestBody, 必须走 URL query string
|
||||
const res = await request({
|
||||
url: '/business/executionIntent/export',
|
||||
method: 'post',
|
||||
params: { projectNo: row.projectNo },
|
||||
responseType: 'blob'
|
||||
})
|
||||
const blob = new Blob([res.data], { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' })
|
||||
const url = window.URL.createObjectURL(blob)
|
||||
const a = document.createElement('a')
|
||||
a.href = url
|
||||
a.download = `报名专家_${row.projectNo}.xlsx`
|
||||
document.body.appendChild(a)
|
||||
a.click()
|
||||
document.body.removeChild(a)
|
||||
window.URL.revokeObjectURL(url)
|
||||
ElMessage.success('导出成功')
|
||||
} catch (e) {
|
||||
const msg = e?.msg || e?.message || '导出失败'
|
||||
ElMessage.error(msg)
|
||||
}
|
||||
}
|
||||
|
||||
// ========== 单行操作按钮 handlers(弹 5 个独立 dialog) ==========
|
||||
function openClose(row) {
|
||||
@@ -481,7 +510,7 @@ function openAssign() {
|
||||
assignOpen.value = true
|
||||
setTimeout(() => {
|
||||
assignForm.execRows.forEach(r => searchExecutors('', r))
|
||||
loadSupporters('')
|
||||
loadSponsorOrgs('')
|
||||
}, 100)
|
||||
}
|
||||
function openBatch(kind) {
|
||||
@@ -573,7 +602,7 @@ const assignForm = reactive({
|
||||
execRows: [], // 动态加
|
||||
deadlineDays: 30
|
||||
})
|
||||
const supporterOptions = ref([])
|
||||
const sponsorOrgOptions = ref([])
|
||||
let _supporterTimer = null
|
||||
|
||||
// 已分配场次合计 (实时)
|
||||
@@ -593,12 +622,12 @@ const singleAmountOver = computed(() =>
|
||||
)
|
||||
|
||||
function makeEmptyExecRow() {
|
||||
return { _loading: false, _timer: null, _options: [], execUserId: null, execUserName: '', execNickName: '', execOrg: '', sessions: 0, amount: 0, remark: '' }
|
||||
return { _loading: false, _timer: null, _options: [], execUserId: null, sessions: 0, amount: 0, remark: '' }
|
||||
}
|
||||
|
||||
function resetAssignForm() {
|
||||
Object.assign(assignForm, { projectId:'', sponsorAdminUserId:null, sponsorAdminUserName:'', totalSessions:0, totalAmount:0, execRows:[makeEmptyExecRow()], deadlineDays:30 })
|
||||
supporterOptions.value = []
|
||||
sponsorOrgOptions.value = []
|
||||
assignBatchMode.value = false
|
||||
assignBatchProjects.value = []
|
||||
}
|
||||
@@ -621,36 +650,37 @@ function onAssignProjectChange(v) {
|
||||
// 切换项目时重新拉已分配记录 (回显)
|
||||
loadAssigns(v)
|
||||
// 重新拉支持方候选
|
||||
loadSupporters('')
|
||||
loadSponsorOrgs('')
|
||||
}
|
||||
|
||||
// 加载支持方 (sponsor 角色)
|
||||
async function loadSupporters(query) {
|
||||
// 加载支持方 (sponsor 角色) - 按公司名查, JOIN biz_org + sys_user
|
||||
async function loadSponsorOrgs(query) {
|
||||
if (_supporterTimer) clearTimeout(_supporterTimer)
|
||||
_supporterTimer = setTimeout(async () => {
|
||||
try {
|
||||
const params = { pageNum: 1, pageSize: 50 }
|
||||
if (query) params.userName = query
|
||||
const r = await listSupporters(params)
|
||||
supporterOptions.value = r.data || []
|
||||
// 已选项不在结果里时单独拉取并加首位
|
||||
if (assignForm.sponsorAdminUserId && !supporterOptions.value.find(u => u.userId === assignForm.sponsorAdminUserId)) {
|
||||
const r2 = await listSupporters({ userId: assignForm.sponsorAdminUserId })
|
||||
// 主搜索: 按 org_name 模糊匹配
|
||||
const params = {}
|
||||
if (query) params.orgName = query
|
||||
const r = await listSponsorOrgs(params)
|
||||
sponsorOrgOptions.value = r.data || []
|
||||
// 已选项不在结果里时按 userId 单独拉取并加首位
|
||||
if (assignForm.sponsorAdminUserId && !sponsorOrgOptions.value.find(u => u.userId === assignForm.sponsorAdminUserId)) {
|
||||
const r2 = await listSponsorOrgs({ userId: assignForm.sponsorAdminUserId })
|
||||
const sel = (r2.data || []).find(u => u.userId === assignForm.sponsorAdminUserId)
|
||||
if (sel) supporterOptions.value = [sel, ...supporterOptions.value]
|
||||
if (sel) sponsorOrgOptions.value = [sel, ...sponsorOrgOptions.value]
|
||||
}
|
||||
} catch (e) {
|
||||
supporterOptions.value = []
|
||||
sponsorOrgOptions.value = []
|
||||
}
|
||||
}, 200)
|
||||
}
|
||||
|
||||
function searchSupporters(q) { loadSupporters(q) }
|
||||
function searchSponsorOrgs(q) { loadSponsorOrgs(q) }
|
||||
|
||||
// 选中支持方后回填名称
|
||||
function onSupporterPick(userId) {
|
||||
const u = supporterOptions.value.find(x => x.userId === userId)
|
||||
if (u) assignForm.sponsorAdminUserName = u.nickName || u.userName
|
||||
// 选中支持方后回填 user_name (缓存到 biz_project.sponsor_admin_user_name)
|
||||
function onSponsorOrgPick(userId) {
|
||||
const u = sponsorOrgOptions.value.find(x => x.userId === userId)
|
||||
if (u) assignForm.sponsorAdminUserName = u.userName
|
||||
}
|
||||
|
||||
// 拉取项目已分配的执行方
|
||||
@@ -663,9 +693,6 @@ async function loadAssigns(projectId) {
|
||||
assignForm.execRows = list.map(a => ({
|
||||
...makeEmptyExecRow(),
|
||||
execUserId: a.execUserId,
|
||||
execUserName: a.execUserName,
|
||||
execNickName: a.execNickName,
|
||||
execOrg: a.execOrg,
|
||||
sessions: a.sessions || 0,
|
||||
amount: Number(a.amount || 0),
|
||||
remark: a.remark || ''
|
||||
@@ -682,19 +709,22 @@ async function loadAssigns(projectId) {
|
||||
}
|
||||
}
|
||||
|
||||
// 加载执行方 (row 级 debounce, 每个 row 独立 timer)
|
||||
// 加载执行方 (按执行单位名 org_name 模糊匹配)
|
||||
// 关键: 数据源是 biz_org (org_type='executor') JOIN sys_user (MAIN 账号 only)
|
||||
// label=orgName (执行单位名称), value=MAIN user_id (直接写 biz_project_assign.exec_user_id)
|
||||
// 走 /business/org/executorOptions (不在走 sys_user.role_type='executor' 查询, 避免子账号混入)
|
||||
async function searchExecutors(query, row) {
|
||||
if (row._timer) clearTimeout(row._timer)
|
||||
row._loading = true
|
||||
row._timer = setTimeout(async () => {
|
||||
try {
|
||||
const params = { pageNum: 1, pageSize: 20 }
|
||||
if (query) params.userName = query
|
||||
const r = await listExecutor(params)
|
||||
const params = {}
|
||||
if (query) params.orgName = query
|
||||
const r = await listExecutorOrgs(params)
|
||||
row._options = r.data || []
|
||||
// 选中的项如果不在结果里, 加到首位
|
||||
// 选中的项如果不在结果里, 按 userId 单独拉取并加到首位 (保证已选项在 el-option 中能找到 label)
|
||||
if (row.execUserId && !row._options.find(u => u.userId === row.execUserId)) {
|
||||
const r2 = await listExecutor({ userId: row.execUserId })
|
||||
const r2 = await listExecutorOrgs({ userId: row.execUserId })
|
||||
const sel = (r2.data || []).find(u => u.userId === row.execUserId)
|
||||
if (sel) row._options = [sel, ...row._options]
|
||||
}
|
||||
@@ -706,13 +736,12 @@ async function searchExecutors(query, row) {
|
||||
}, 300)
|
||||
}
|
||||
|
||||
// 选中执行方后回填
|
||||
// 选中执行方后只保留 userId (后端 service 层会反查 biz_org 写 execution_unit_id;
|
||||
// 名称/nickName/deptName 不再缓存, 由前端从 _options 里实时取)
|
||||
function onExecUserPick(row, userId) {
|
||||
const u = (row._options || []).find(x => x.userId === userId)
|
||||
if (u) {
|
||||
row.execUserName = u.userName
|
||||
row.execNickName = u.nickName || ''
|
||||
row.execOrg = u.dept?.deptName || ''
|
||||
// 仅清掉旧的非持久化字段 (兼容旧 _options 残留), 业务字段不写
|
||||
}
|
||||
}
|
||||
|
||||
@@ -751,9 +780,6 @@ async function submitAssign() {
|
||||
|
||||
const assignBody = valid.map(r => ({
|
||||
execUserId: r.execUserId,
|
||||
execUserName: r.execUserName,
|
||||
execNickName: r.execNickName,
|
||||
execOrg: r.execOrg,
|
||||
sessions: r.sessions,
|
||||
amount: r.amount,
|
||||
remark: r.remark
|
||||
|
||||
@@ -20,6 +20,24 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="12">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="项目负责人">
|
||||
<el-select v-model="form.leadUserId" placeholder="请选择合规管理员" filterable clearable :filter-method="searchManagers" style="width:100%">
|
||||
<el-option v-for="u in managerOptions" :key="u.userId"
|
||||
:label="`${u.userName}${u.nickName ? ' (' + u.nickName + ')' : ''}`" :value="u.userId" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="是否招标项目">
|
||||
<el-select v-model="form.isBidProject" placeholder="请选择" style="width:100%" clearable>
|
||||
<el-option label="是" value="Y" />
|
||||
<el-option label="否" value="N" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="12">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="项目形式" prop="projectForm">
|
||||
@@ -61,22 +79,6 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="12">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="提交截止(天)">
|
||||
<el-input-number v-model="form.submitDeadlineDays" :min="0" controls-position="right" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="支持单位">
|
||||
<el-select v-model="form.sponsorAdminUserId" placeholder="请选择赞助方负责人" filterable clearable style="width:100%" @change="onSupporterPick">
|
||||
<el-option v-for="u in supporterOptions" :key="u.userId"
|
||||
:label="`${u.userName}${u.nickName ? ' (' + u.nickName + ')' : ''}`"
|
||||
:value="u.userId" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<!-- ========== 第二区块:角色劳务设置 ========== -->
|
||||
<div class="new-card-title">角色劳务设置</div>
|
||||
@@ -134,7 +136,7 @@
|
||||
import { ref, reactive, onMounted } from 'vue'
|
||||
import { useRoute, useRouter } from 'vue-router'
|
||||
import { bizAdd, bizUpdate, bizGet } from '@/api/public'
|
||||
import { listExecutor, listSupporters } from '@/api/system'
|
||||
import { listExecutor, listManagers } from '@/api/system'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import request from '@/utils/request'
|
||||
import OssFileUploader from '@/components/OssFileUploader.vue'
|
||||
@@ -150,18 +152,18 @@ const fileInputRef = ref(null)
|
||||
function defaultRoleRow() { return { role: '', customName: '', amount: 0 } }
|
||||
function defaultNotice(key, label) { return { key, label, url: '', name: '' } }
|
||||
|
||||
// 支持方候选 (sponsor 角色)
|
||||
const supporterOptions = ref([])
|
||||
// 项目负责人候选 (合规管理员, sys_user.role_type='manager')
|
||||
const managerOptions = ref([])
|
||||
let _managerTimer = null
|
||||
|
||||
const form = reactive({
|
||||
projectName: '', projectNo: '', projectForm: '',
|
||||
// 项目负责人 (sys_user.role_type='manager' 合规管理员, 名称由后端 JOIN 查, 不缓存)
|
||||
leadUserId: null,
|
||||
// 是否招标项目 Y/N (默认 N)
|
||||
isBidProject: 'N',
|
||||
totalSessions: 0, totalAmount: 0, manageFee: 0,
|
||||
startTime: '', endTime: '',
|
||||
// 赞助方负责人 (sys_user.role_type='sponsor', 原 org_id/org_name 字段已重命名)
|
||||
sponsorAdminUserId: null,
|
||||
sponsorAdminUserName: '',
|
||||
// 提交截止(天)
|
||||
submitDeadlineDays: 30,
|
||||
roleRows: [
|
||||
{ role: '主席', customName: '', amount: 0 },
|
||||
{ role: '主持', customName: '', amount: 0 },
|
||||
@@ -222,9 +224,8 @@ async function loadProject() {
|
||||
form.manageFee = p.manageFee || 0
|
||||
form.startTime = p.startTime || ''
|
||||
form.endTime = p.endTime || ''
|
||||
form.sponsorAdminUserId = p.sponsorAdminUserId || null
|
||||
form.sponsorAdminUserName = p.sponsorAdminUserName || ''
|
||||
form.submitDeadlineDays = p.submitDeadlineDays || 30
|
||||
form.leadUserId = p.leadUserId || null
|
||||
form.isBidProject = p.isBidProject || 'N'
|
||||
// 公告文件反显: 优先 publicityFiles JSON 数组, 否则兼容旧字段
|
||||
const files = []
|
||||
if (Array.isArray(p.publicityFiles)) files.push(...p.publicityFiles)
|
||||
@@ -258,27 +259,29 @@ async function loadProject() {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
async function loadSupporters(query = '') {
|
||||
try {
|
||||
const params = { roleType: 'sponsor', pageNum: 1, pageSize: 50 }
|
||||
if (query) params.userName = query
|
||||
const r = await listSupporters(params)
|
||||
supporterOptions.value = (r.data && r.data.rows) || r.rows || []
|
||||
} catch (e) { supporterOptions.value = [] }
|
||||
// 加载项目负责人 (合规管理员, sys_user.role_type='manager')
|
||||
async function loadManagers(query) {
|
||||
if (_managerTimer) clearTimeout(_managerTimer)
|
||||
_managerTimer = setTimeout(async () => {
|
||||
try {
|
||||
const params = { pageNum: 1, pageSize: 50 }
|
||||
if (query) params.userName = query
|
||||
const r = await listManagers(params)
|
||||
managerOptions.value = (r.data && r.data.rows) || r.rows || []
|
||||
// 已选项不在结果里时按 userId 单独拉取并加首位, 避免 el-select 选中后 label 空白
|
||||
if (form.leadUserId && !managerOptions.value.find(u => u.userId === form.leadUserId)) {
|
||||
const r2 = await listManagers({ userId: form.leadUserId })
|
||||
const sel = (r2.data && r2.data.rows) || r2.rows || []
|
||||
if (sel[0]) managerOptions.value = [sel[0], ...managerOptions.value]
|
||||
}
|
||||
} catch (e) { managerOptions.value = [] }
|
||||
}, 200)
|
||||
}
|
||||
|
||||
function onSupporterPick(userId) {
|
||||
const u = supporterOptions.value.find(x => x.userId === userId)
|
||||
if (u) form.sponsorAdminUserName = u.userName || ''
|
||||
}
|
||||
|
||||
|
||||
|
||||
function searchManagers(q) { loadManagers(q) }
|
||||
|
||||
onMounted(() => {
|
||||
loadProject()
|
||||
loadSupporters('')
|
||||
loadManagers('')
|
||||
})
|
||||
function goBack() {
|
||||
// 带 _t 强制 Projects.vue watch 触发 reload, 即便路由一样也重载
|
||||
@@ -301,9 +304,8 @@ async function submit(mode = 'save') {
|
||||
manageFee: form.manageFee,
|
||||
startTime: form.startTime,
|
||||
endTime: form.endTime,
|
||||
sponsorAdminUserId: form.sponsorAdminUserId,
|
||||
sponsorAdminUserName: form.sponsorAdminUserName,
|
||||
submitDeadlineDays: form.submitDeadlineDays
|
||||
leadUserId: form.leadUserId,
|
||||
isBidProject: form.isBidProject
|
||||
}
|
||||
// 公告文件以 publicityFiles JSON 数组存储 (替代旧 invitationUrl/supportLetterUrl/noticeUrl/scheduleUrl)
|
||||
payload.publicityFiles = JSON.stringify(uploaded.map(n => ({
|
||||
|
||||
@@ -56,7 +56,7 @@
|
||||
<el-dialog v-model="detailOpen" title="支持单位详情" width="640px" v-if="currentRow">
|
||||
<el-descriptions :column="1" border>
|
||||
<el-descriptions-item label="公司类型">
|
||||
<el-tag type="success">赞助方</el-tag>
|
||||
<el-tag type="success">支持方</el-tag>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="公司名称">{{ currentRow.orgName }}</el-descriptions-item>
|
||||
<el-descriptions-item label="公司地址">{{ currentRow.address }}</el-descriptions-item>
|
||||
|
||||
@@ -137,7 +137,10 @@ function reset() {
|
||||
|
||||
async function onToggleStatus(row) {
|
||||
const disabled = isDisabled(row)
|
||||
const newStatus = disabled ? '正常' : '禁用'
|
||||
// sys_user.status 是 CHAR(1), 只能写 '0'/'1' (禁用='1', 启用='0')
|
||||
// 必须带 userId: BizPersonServiceImpl.updateByPrimaryKey 仅在 userId != null 时
|
||||
// 才同步 status 到 sys_user, 否则只更新 biz_person (而 biz_person.status 已删除)
|
||||
const newStatus = disabled ? '0' : '1'
|
||||
const label = disabled ? '启用' : '禁用'
|
||||
try {
|
||||
await ElMessageBox.confirm(
|
||||
@@ -147,7 +150,7 @@ async function onToggleStatus(row) {
|
||||
)
|
||||
} catch { return }
|
||||
try {
|
||||
await bizUpdate('person', { personId: row.personId, status: newStatus })
|
||||
await bizUpdate('person', { personId: row.personId, userId: row.userId, status: newStatus })
|
||||
ElMessage.success('已' + label)
|
||||
load()
|
||||
} catch (e) { ElMessage.error(e?.msg || '操作失败') }
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
<el-input v-model="form.position" placeholder="职务" maxlength="50" />
|
||||
</el-form-item>
|
||||
<el-form-item label="角色">
|
||||
<span style="color:#303133">监察员 <span style="color:#909399;font-size:12px">(赞助方人员固定)</span></span>
|
||||
<span style="color:#303133">监察员 <span style="color:#909399;font-size:12px">(支持方人员固定)</span></span>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
|
||||
@@ -26,8 +26,6 @@
|
||||
</router-link>
|
||||
</div>
|
||||
|
||||
<p class="hint-text">*点击数字,跳转到相应的列表页</p>
|
||||
|
||||
<!-- 消息通知 -->
|
||||
<section class="section">
|
||||
<h2 class="section-title">消息通知<a class="more" href="javascript:void(0)">更多 →</a></h2>
|
||||
@@ -102,37 +100,32 @@ onMounted(() => { loadStats(); loadNotices() })
|
||||
.manager-workbench { padding: 16px; }
|
||||
.breadcrumb { font-size: 13px; color: #8c8c8c; margin-bottom: 12px; }
|
||||
|
||||
/* 5 个 KPI 卡 (跟 executor/Overview 一致) */
|
||||
/* 5 个 KPI 卡 (深色底白字) */
|
||||
.stats-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; margin-bottom: 12px; }
|
||||
.stat-card {
|
||||
background: #fff;
|
||||
border: 1px solid #f0f0f0;
|
||||
background: #1e3a8a;
|
||||
border: 1px solid #1e3a8a;
|
||||
border-radius: 8px;
|
||||
padding: 24px;
|
||||
cursor: pointer;
|
||||
text-decoration: none;
|
||||
color: inherit;
|
||||
color: #fff;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
transition: opacity .15s, border-color .15s;
|
||||
transition: opacity .15s, border-color .15s, transform .15s;
|
||||
min-height: 120px;
|
||||
}
|
||||
.stat-card:hover { border-color: var(--brand-primary); opacity: .9; }
|
||||
.stat-label { font-size: 14px; color: #8c8c8c; margin-bottom: 16px; }
|
||||
.stat-card:hover { opacity: .9; transform: translateY(-2px); }
|
||||
.stat-label { font-size: 14px; color: rgba(255, 255, 255, 0.85); margin-bottom: 16px; }
|
||||
.stat-value {
|
||||
font-size: 32px;
|
||||
font-weight: 600;
|
||||
line-height: 1.2;
|
||||
background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-primary-deep) 100%);
|
||||
-webkit-background-clip: text;
|
||||
-webkit-text-fill-color: transparent;
|
||||
background-clip: text;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.hint-text { font-size: 12px; color: #ff4d4f; margin: 12px 0 20px; text-align: center; }
|
||||
|
||||
/* 消息通知 */
|
||||
.section {
|
||||
background: #fff;
|
||||
|
||||
Reference in New Issue
Block a user