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:
@@ -34,7 +34,13 @@
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="所属公司" prop="orgName">
|
||||
<el-input v-model="form.orgName" placeholder="请输入所属公司" maxlength="200" />
|
||||
<el-input v-model="form.orgName" :readonly="!!myOrg" placeholder="请输入所属公司" maxlength="200">
|
||||
<template #append v-if="myOrg">
|
||||
<el-tooltip content="主账号公司, 注册时已自动关联" placement="top">
|
||||
<el-icon><Lock /></el-icon>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="部门" prop="department">
|
||||
@@ -72,15 +78,21 @@ import { ref, reactive, computed, onMounted } from 'vue'
|
||||
import { useRoute, useRouter } from 'vue-router'
|
||||
import { bizGet, bizAdd, bizUpdate } from '@/api/public'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import request from '@/utils/request'
|
||||
import { useUserStore } from '@/store/user'
|
||||
import { Lock } from '@element-plus/icons-vue'
|
||||
|
||||
const route = useRoute()
|
||||
const router = useRouter()
|
||||
const userStore = useUserStore()
|
||||
|
||||
const isEdit = computed(() => !!route.params.id)
|
||||
const personId = computed(() => route.params.id || null)
|
||||
|
||||
const formRef = ref()
|
||||
const saving = ref(false)
|
||||
// 主账号关联的公司 (注册时建, 按 user_id 反查)
|
||||
const myOrg = ref(null)
|
||||
const form = reactive({
|
||||
userName: '',
|
||||
name: '',
|
||||
@@ -146,7 +158,31 @@ function goHome() {
|
||||
router.push('/executor/overview')
|
||||
}
|
||||
|
||||
onMounted(loadDetail)
|
||||
// 加载主账号关联的公司 (注册时建, 按 user_id + orgType 反查, 一用户一类型一公司)
|
||||
async function loadMyOrg() {
|
||||
const uid = userStore.user?.userId
|
||||
if (!uid) return
|
||||
try {
|
||||
const res = await request({
|
||||
url: '/business/org/list',
|
||||
method: 'get',
|
||||
params: { userId: uid, orgType: 'executor', pageNum: 1, pageSize: 1 }
|
||||
})
|
||||
const rows = (res?.data?.rows) || res?.rows || []
|
||||
if (rows.length) {
|
||||
myOrg.value = rows[0]
|
||||
// 默认带出, 提交时也直接发这个 orgId (不再依赖 orgName 字符串匹配)
|
||||
form.orgName = rows[0].orgName || ''
|
||||
}
|
||||
} catch (e) {
|
||||
console.warn('loadMyOrg:', e?.msg)
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
if (isEdit.value) loadDetail()
|
||||
else loadMyOrg() // 新建时默认带出主账号公司
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
@@ -131,8 +131,11 @@ function onView(row) { view.value = row; viewOpen.value = true }
|
||||
async function onToggleStatus(row, action) {
|
||||
try {
|
||||
await ElMessageBox.confirm(`确定${action}「${row.name}」吗?`, action, { type: 'warning' })
|
||||
const newStatus = action === '禁用' ? '禁用' : '正常'
|
||||
await bizUpdate('person', { personId: row.personId, status: newStatus })
|
||||
// sys_user.status 是 CHAR(1), 只能写 '0'/'1' (禁用='1', 启用='0')
|
||||
// 必须带 userId: BizPersonServiceImpl.updateByPrimaryKey 仅在 userId != null 时
|
||||
// 才同步 status 到 sys_user, 否则只更新 biz_person (而 biz_person.status 已删除)
|
||||
const newStatus = action === '禁用' ? '1' : '0'
|
||||
await bizUpdate('person', { personId: row.personId, userId: row.userId, status: newStatus })
|
||||
ElMessage.success(`${action}成功`)
|
||||
loadList()
|
||||
} catch (e) { if (e !== 'cancel') ElMessage.error(e?.msg || `${action}失败`) }
|
||||
|
||||
@@ -124,7 +124,7 @@
|
||||
<el-descriptions-item label="项目编号">{{ detail.projectNo }}</el-descriptions-item>
|
||||
<el-descriptions-item label="项目形式">{{ detail.projectForm }}</el-descriptions-item>
|
||||
<el-descriptions-item label="项目名称" :span="2">{{ detail.projectName }}</el-descriptions-item>
|
||||
<el-descriptions-item label="赞助方负责人" :span="2">{{ detail.sponsorAdminUserName || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="支持方负责人" :span="2">{{ detail.sponsorAdminUserName || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="总场次/总期数">{{ detail.totalSessions }}/{{ detail.totalPeriods }}</el-descriptions-item>
|
||||
<el-descriptions-item label="已执行">{{ detail.doneSessions || 0 }}</el-descriptions-item>
|
||||
<el-descriptions-item label="未执行">{{ detail.todoSessions || 0 }}</el-descriptions-item>
|
||||
|
||||
Reference in New Issue
Block a user