feat: 合并 admin/manager 重复页 + 公示意向 + 劳务签署
页合并 (admin/manager 共用, route.path 角色感知): - expert: Experts.vue + ExpertNew.vue (list/new/edit/view 一套) - sponsor-orgs: SponsorOrgs.vue - sponsor-people: SponsorPeople.vue + SponsorPersonNew.vue + SponsorPersonDetail.vue - executor-orgs: ExecutorOrgs.vue - executor-people: ExecutorPeople.vue + ExecutorPersonNew.vue + ExecutorPersonDetail.vue - 给 SponsorPeople / ExecutorPeople op 列补上 查看/编辑 按钮 (潜在 bug 修复) - 详情弹窗统一用 el-descriptions 风格 (替代 admin 旧版 ElMessageBox.alert) 后端: - BizSignController + BizSignServiceImpl + PdfService (劳务签署 PDF 流程) - BizPublicityIntentController (公示意向: 支持/执行) - BizPublicitySupportIntent / BizPublicityExecutionIntent ExportVo - BizMeetingAttendee 字段合并 (bank_region 替代 bankProvince/bankCity) - BizExpert 字段合并 (id_card_attachments CSV, bank_region) - Excel 导入模板精简 (开户行 1 列) 前端: - doctor/SignFill + SignContract + SignSuccess (劳务签署 3 页流程) - ImportResultDialog 通用组件 - IdCardUploader 重构 (单 v-model:idCardAttachments, CSV 格式) - AreaCascader 调整 - Login.vue + AdminLayout.vue + PortalShell.vue + Home.vue 适配 DB: 字段合并 (id_card_front/back → id_card_attachments, bank_province/city → bank_region)
This commit is contained in:
@@ -42,6 +42,7 @@ const props = defineProps({
|
||||
separator: { type: String, default: '/' },
|
||||
format: { type: String, default: 'array' }, // 'array' | 'string'
|
||||
joinSep: { type: String, default: '/' },
|
||||
maxLevel: { type: Number, default: 3 }, // 级数限制: 2=省/市, 3=省/市/区
|
||||
props: { type: Object, default: () => ({}) }
|
||||
})
|
||||
|
||||
@@ -76,8 +77,19 @@ function stringToValues(str) {
|
||||
return toValues(labels)
|
||||
}
|
||||
|
||||
// 静态引用, 组件树只在加载时构建一次
|
||||
const options = areaData
|
||||
// 按 maxLevel 截断级数 (2=省/市, 3=省/市/区)
|
||||
const options = computed(() => {
|
||||
if (props.maxLevel >= 3) return areaData
|
||||
return areaData.map(prov => ({
|
||||
...prov,
|
||||
children: props.maxLevel >= 2
|
||||
? (prov.children || []).map(city => {
|
||||
const { children, ...rest } = city
|
||||
return rest
|
||||
})
|
||||
: undefined
|
||||
}))
|
||||
})
|
||||
|
||||
const cascaderProps = computed(() => ({
|
||||
value: 'value',
|
||||
|
||||
@@ -1,11 +1,7 @@
|
||||
<!--
|
||||
身份证正反面上传控件 (仿 hwt-code gr-id-card, 适配 PC 后台)
|
||||
用法 (双 v-model):
|
||||
<id-card-uploader
|
||||
v-model:front-url="form.idCardFrontUrl"
|
||||
v-model:back-url="form.idCardBackUrl"
|
||||
:dir="'ry8080/idcard/'"
|
||||
/>
|
||||
单 v-model, 内部以 CSV "frontUrl,backUrl" 存到一个字段:
|
||||
<id-card-uploader v-model="form.idCardAttachments" />
|
||||
|
||||
readonly=true 时不显示上传按钮, 点击 thumb 弹 el-image 预览
|
||||
上传走 OSS 直传 (utils/oss.js 的 uploadToOss)
|
||||
@@ -47,25 +43,41 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref } from 'vue'
|
||||
import { ref, computed } from 'vue'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { uploadToOss } from '@/utils/oss'
|
||||
|
||||
/** CSV 拆分: 允许任意空段, 返回 [front, back], 空段视为 '' */
|
||||
function parseCsv(str) {
|
||||
if (!str || typeof str !== 'string') return ['', '']
|
||||
const parts = str.split(',')
|
||||
return [parts[0] || '', parts[1] || '']
|
||||
}
|
||||
|
||||
/** 拼回 CSV: 始终 2 段 (空字符串保留位), 避免 "a" 被读成 ["a",""] 没问题但 "a," 被读成 ["a",""] */
|
||||
function joinCsv(front, back) {
|
||||
return [front || '', back || ''].join(',')
|
||||
}
|
||||
|
||||
const props = defineProps({
|
||||
frontUrl: { type: String, default: '' },
|
||||
backUrl: { type: String, default: '' },
|
||||
/** CSV 字符串, "frontUrl,backUrl", 任意段为空保留位 */
|
||||
modelValue: { type: String, default: '' },
|
||||
dir: { type: String, default: 'ry8080/idcard/' },
|
||||
readonly: { type: Boolean, default: false },
|
||||
frontPlaceholder: { type: String, default: '/images/id-front.png' },
|
||||
backPlaceholder: { type: String, default: '/images/id-back.png' }
|
||||
})
|
||||
|
||||
const emit = defineEmits(['update:frontUrl', 'update:backUrl'])
|
||||
const emit = defineEmits(['update:modelValue'])
|
||||
|
||||
const fileInputFront = ref(null)
|
||||
const fileInputBack = ref(null)
|
||||
const uploading = ref({ front: false, back: false })
|
||||
|
||||
// 内部 front/back URL 由 modelValue 派生
|
||||
const frontUrl = computed(() => parseCsv(props.modelValue)[0])
|
||||
const backUrl = computed(() => parseCsv(props.modelValue)[1])
|
||||
|
||||
function handleClick(side) {
|
||||
if (props.readonly) return
|
||||
if (uploading.value[side]) return
|
||||
@@ -88,11 +100,9 @@ async function onFileChange(e, side) {
|
||||
uploading.value[side] = true
|
||||
try {
|
||||
const url = await uploadToOss(file, props.dir)
|
||||
if (side === 'front') {
|
||||
emit('update:frontUrl', url)
|
||||
} else {
|
||||
emit('update:backUrl', url)
|
||||
}
|
||||
const [f, b] = parseCsv(props.modelValue)
|
||||
const next = side === 'front' ? joinCsv(url, b) : joinCsv(f, url)
|
||||
emit('update:modelValue', next)
|
||||
ElMessage.success(side === 'front' ? '身份证正面已上传' : '身份证反面已上传')
|
||||
} catch (err) {
|
||||
ElMessage.error(err.message || '上传失败')
|
||||
@@ -137,4 +147,4 @@ async function onFileChange(e, side) {
|
||||
object-fit: cover;
|
||||
display: block;
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
v-model="visible"
|
||||
title="导入结果"
|
||||
width="600px"
|
||||
append-to-body
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<div style="width:100%;margin-bottom: 8px">
|
||||
<span v-if="result">成功:{{ result.okNum ?? 0 }} 条,失败 {{ result.ngNum ?? 0 }} 条</span>
|
||||
<span v-else style="color:#909399">无导入结果</span>
|
||||
</div>
|
||||
<el-table
|
||||
:data="(result && result.ngList) || []"
|
||||
border
|
||||
style="width: 100%"
|
||||
:height="400"
|
||||
size="small"
|
||||
>
|
||||
<el-table-column width="80" align="center" prop="rowNum" label="行号" />
|
||||
<el-table-column label="失败原因" prop="message" />
|
||||
</el-table>
|
||||
<template #footer>
|
||||
<el-button @click="close">关 闭</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { computed } from 'vue'
|
||||
|
||||
// v-model 默认绑 modelValue / update:modelValue (Vue 3 规范)
|
||||
const props = defineProps({
|
||||
modelValue: { type: Boolean, default: false },
|
||||
result: { type: Object, default: null }
|
||||
})
|
||||
const emit = defineEmits(['update:modelValue'])
|
||||
|
||||
const visible = computed({
|
||||
get: () => props.modelValue,
|
||||
set: v => emit('update:modelValue', v)
|
||||
})
|
||||
|
||||
function close() {
|
||||
visible.value = false
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss"></style>
|
||||
@@ -126,8 +126,8 @@ async function onUserCmd(cmd) {
|
||||
if (cmd === 'logout') return goLogout()
|
||||
if (cmd === 'account') {
|
||||
const r = (userStore.user?.role || '')
|
||||
const map = { admin: '/leader/home', leader: '/leader/home', manager: '/manager/workbench', doctor: '/doctor/home', executor: '/executor/meetings', sponsor: '/sponsor/home' }
|
||||
router.push(map[r] || '/leader/home')
|
||||
const map = { admin: '/admin/workbench', leader: '/leader/home', manager: '/manager/workbench', doctor: '/doctor/home', executor: '/executor/meetings', sponsor: '/sponsor/home' }
|
||||
router.push(map[r] || '/')
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user