1. backend: 禁用主账号 dual-write + 子账号登录校验主账号状态
- BizOrgServiceImpl.toggleStatus: 同步 biz_org.status 与 sys_user.status
- BizOrgController.toggleStatus: 严格校验 '0'/'1'
- BizAuthController.smsLogin 4.5: 子账号校验主账号状态拦截
2. fix: BizMeeting 补 9 个字段 getters/setters
- projectId / projectName / orgName / supervisionOpinion / supervisionBy
- supervisionTime / invitationUrl / scheduleUrl / laborSigned
- 解决 Meetings.vue 修改/复制 projectId 为空的 bug
3. frontend: 0/1 status 标准化显示
- 10 个 Orgs/People 表格 el-tag 由 raw 0/1 改为 正常/禁用
- 4 个 People 页面修复 row.status || '正常' 在 '0' 时不
回退的 bug (字符串 '0' 是 truthy)
- 筛选下拉 / 编辑表单 / onToggleStatus label 全部对齐 0/1 语义
- DB 迁移: 10 行脏数据 (7 正常/合作中 → 0, 3 禁用 → 1)
- 备份表 biz_org_backup_20260819
Co-Authored-By: Claude <noreply@anthropic.com>
147 lines
6.5 KiB
Vue
147 lines
6.5 KiB
Vue
<template>
|
|
<!--
|
|
角色: 🟨 合规 服务机构查看 (manager/executor-orgs)
|
|
说明: 原 manager/Orgs.vue 拆出 executor 一支, 仅查看
|
|
接口: bizList('org', q)
|
|
-->
|
|
<div class="page-card manager-executor-orgs">
|
|
<div class="breadcrumb">首页 / 服务机构管理</div>
|
|
|
|
<el-form inline :model="q" class="filter-form">
|
|
<el-form-item label="公司名称">
|
|
<el-input v-model="q.orgName" placeholder="输入公司名称" clearable />
|
|
</el-form-item>
|
|
<el-form-item label="税号/统一社会信用代码">
|
|
<el-input v-model="q.taxNo" placeholder="输入税号" clearable />
|
|
</el-form-item>
|
|
<el-form-item label="合作状态">
|
|
<el-select v-model="q.status" placeholder="请选择" clearable style="width:140px">
|
|
<el-option label="正常" value="0" />
|
|
<el-option label="禁用" value="1" />
|
|
</el-select>
|
|
</el-form-item>
|
|
<el-form-item>
|
|
<el-button type="primary" @click="load">查找</el-button>
|
|
<el-button @click="reset">重置</el-button>
|
|
</el-form-item>
|
|
</el-form>
|
|
|
|
<el-table :data="rows" v-loading="loading" stripe border>
|
|
<el-table-column type="index" label="#" width="50" />
|
|
<el-table-column prop="orgName" label="公司名称" min-width="200" show-overflow-tooltip />
|
|
<el-table-column prop="address" label="公司地址" min-width="220" show-overflow-tooltip />
|
|
<el-table-column prop="taxNo" label="税号/统一社会信用代码" min-width="180" />
|
|
<el-table-column label="合作状态" width="100" align="center">
|
|
<template #default="{ row }">
|
|
<el-tag :type="statusTagType(row.status)" disable-transitions>{{ row.status === '1' ? '禁用' : '正常' }}</el-tag>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column prop="createTime" label="创建日期" width="120" align="center">
|
|
<template #default="{ row }">{{ row.createTime ? String(row.createTime).slice(0,10) : '' }}</template>
|
|
</el-table-column>
|
|
<el-table-column prop="contactName" label="联系人" width="100" align="center" />
|
|
<el-table-column prop="contactPhone" label="联系电话" width="130" align="center" />
|
|
<el-table-column label="操作" width="240" fixed="right">
|
|
<template #default="{ row }">
|
|
<el-button link type="primary" @click="view(row)">查看</el-button>
|
|
<el-button link type="primary" @click="goPeople(row)">人员管理</el-button>
|
|
<el-button link :type="isDisabled(row) ? 'success' : 'danger'" @click="onToggleStatus(row)">
|
|
{{ isDisabled(row) ? '恢复' : '禁用' }}
|
|
</el-button>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table>
|
|
<div class="pager">
|
|
<el-pagination v-model:current-page="page.pageNum" v-model:page-size="page.pageSize" :total="page.total" :page-sizes="[10,20,50]" layout="total, sizes, prev, pager, next, jumper" @current-change="load" @size-change="load" />
|
|
</div>
|
|
|
|
<el-dialog v-model="detailOpen" title="服务机构详情" width="640px" v-if="currentRow">
|
|
<el-descriptions :column="1" border>
|
|
<el-descriptions-item label="公司类型">
|
|
<el-tag type="primary">执行方</el-tag>
|
|
</el-descriptions-item>
|
|
<el-descriptions-item label="公司名称">{{ currentRow.orgName }}</el-descriptions-item>
|
|
<el-descriptions-item label="公司地址">{{ currentRow.address }}</el-descriptions-item>
|
|
<el-descriptions-item label="税号/统一社会信用代码">{{ currentRow.taxNo }}</el-descriptions-item>
|
|
<el-descriptions-item label="合作状态">
|
|
<el-tag :type="statusTagType(currentRow.status)">{{ currentRow.status === '1' ? '禁用' : '正常' }}</el-tag>
|
|
</el-descriptions-item>
|
|
<el-descriptions-item label="创建日期">{{ currentRow.createTime ? String(currentRow.createTime).slice(0,10) : '' }}</el-descriptions-item>
|
|
<el-descriptions-item label="联系人">{{ currentRow.contactName || '-' }}</el-descriptions-item>
|
|
<el-descriptions-item label="联系电话">{{ currentRow.contactPhone || '-' }}</el-descriptions-item>
|
|
</el-descriptions>
|
|
<template #footer>
|
|
<el-button @click="detailOpen=false">关闭</el-button>
|
|
</template>
|
|
</el-dialog>
|
|
</div>
|
|
</template>
|
|
|
|
<script setup>
|
|
import { ref, reactive, onMounted } from 'vue'
|
|
import { useRouter } from 'vue-router'
|
|
import { bizList, toggleOrgStatus } from '@/api/public'
|
|
import { ElMessage, ElMessageBox } from 'element-plus'
|
|
|
|
const router = useRouter()
|
|
|
|
const q = ref({ orgType: 'executor', orgName: '', taxNo: '', status: '' })
|
|
const rows = ref([])
|
|
const loading = ref(false)
|
|
const page = reactive({ pageNum: 1, pageSize: 10, total: 0 })
|
|
const currentRow = ref(null)
|
|
const detailOpen = ref(false)
|
|
|
|
function statusTagType(s) {
|
|
// 统一: 0=正常(success), 1=禁用(danger)
|
|
return s === '1' ? 'danger' : 'success'
|
|
}
|
|
function isDisabled(row) {
|
|
return row.status === '1'
|
|
}
|
|
|
|
async function load() {
|
|
loading.value = true
|
|
try {
|
|
const { data } = await bizList('org', { ...q.value, pageNum: page.pageNum, pageSize: page.pageSize })
|
|
rows.value = data?.rows || []; page.total = data?.total || 0
|
|
} catch { rows.value = []; page.total = 0 }
|
|
finally { loading.value = false }
|
|
}
|
|
function reset() { q.value = { orgType: 'executor', orgName: '', taxNo: '', status: '' }; page.pageNum = 1; load() }
|
|
function view(row) { currentRow.value = row; detailOpen.value = true }
|
|
function goPeople(row) {
|
|
router.push({ path: '/manager/executor-people', query: { orgId: row.orgId, orgName: row.orgName } })
|
|
}
|
|
|
|
// 仅禁用主账号 (走 BizOrgServiceImpl.toggleStatus: 同步 biz_org.status + sys_user.status)
|
|
// 子账号由 BizAuthController.smsLogin 4.5 节校验主账号状态拦截
|
|
async function onToggleStatus(row) {
|
|
const disabled = isDisabled(row)
|
|
const newStatus = disabled ? '0' : '1' // 0=正常, 1=禁用
|
|
const label = disabled ? '恢复' : '禁用'
|
|
if (!disabled) {
|
|
try {
|
|
await ElMessageBox.confirm(
|
|
`确定要${label}「${row.orgName}」吗? ${label}后该企业主账号无法登录, 企业下子账号也将被拦截`,
|
|
'确认',
|
|
{ type: 'warning' }
|
|
)
|
|
} catch { return }
|
|
}
|
|
try {
|
|
await toggleOrgStatus(row.orgId, newStatus)
|
|
ElMessage.success('已' + label)
|
|
load()
|
|
} catch (e) { ElMessage.error(e?.msg || '操作失败') }
|
|
}
|
|
|
|
onMounted(load)
|
|
</script>
|
|
|
|
<style scoped>
|
|
.manager-executor-orgs { padding: 16px; }
|
|
.breadcrumb { font-size: 13px; color: #8c8c8c; margin-bottom: 12px; }
|
|
.filter-form { margin-bottom: 12px; }
|
|
.pager { display: flex; justify-content: flex-end; margin-top: 12px; }
|
|
</style> |