联教编辑报错

This commit is contained in:
2026-09-20 15:24:07 +08:00
parent 5e3bee9c5f
commit f5a5c89ee3
6 changed files with 165 additions and 21 deletions
+3 -1
View File
@@ -55,7 +55,9 @@ export function importJointTraining(file) {
return request({
url: '/ks/yjlx/import',
method: 'post',
data: formData
data: formData,
headers: { 'Content-Type': 'multipart/form-data' },
timeout: 60000
})
}
@@ -362,8 +362,8 @@ export default {
if (f.mc && f.mc.trim()) payload.mc = f.mc.trim()
if (f.xz && f.xz.trim()) payload.xz = f.xz.trim()
if (f.yj && f.yj.trim()) payload.yj = f.yj.trim()
if (f.ksrq) payload.ksrq = f.ksrq
if (f.jsrq) payload.jsrq = f.jsrq
if (f.ksrq) payload.ksrq = String(f.ksrq).replace(' ', 'T')
if (f.jsrq) payload.jsrq = String(f.jsrq).replace(' ', 'T')
if (f.ts !== null && f.ts !== undefined) payload.ts = f.ts
if (f.jbksl !== null && f.jbksl !== undefined) payload.jbksl = f.jbksl
if (f.kslx && f.kslx.trim()) payload.kslx = f.kslx.trim()
@@ -435,7 +435,7 @@ export default {
handleDownloadTemplate() {
downloadJointTrainingTemplate().then(blob => {
saveAs(blob, '联教连训管理.xls')
saveAs(blob, '联教联训数据文件模板.xlsx')
this.$message.success('模板下载成功')
}).catch(() => {})
}
@@ -61,13 +61,15 @@
</div>
<el-table v-loading="loading" :data="tableData" stripe border highlight-current-row>
<el-table-column type="index" label="序号" width="60" align="center" />
<el-table-column prop="bh" label="编号" width="100" show-overflow-tooltip />
<el-table-column prop="mc" label="名称" min-width="140" show-overflow-tooltip />
<el-table-column prop="pxlx" label="培训类型" width="120" show-overflow-tooltip />
<el-table-column prop="pxcc" label="培训层次" width="120" show-overflow-tooltip />
<el-table-column prop="bb" label="版本" width="100" show-overflow-tooltip />
<el-table-column prop="xgsj" label="修改时间" width="170" show-overflow-tooltip />
<el-table-column label="停用" width="80" align="center">
<el-table-column prop="bh" label="编号" width="150" align="center" show-overflow-tooltip />
<el-table-column prop="mc" label="名称" width="200" align="center" show-overflow-tooltip />
<el-table-column prop="pxlx" label="培训类型" width="200" align="center" show-overflow-tooltip />
<el-table-column prop="pxcc" label="培训层次" width="200" align="center" show-overflow-tooltip />
<el-table-column prop="bb" label="版本" width="200" align="center" show-overflow-tooltip />
<el-table-column label="修改时间" width="200" align="center" show-overflow-tooltip>
<template slot-scope="{ row }">{{ fmtDateTime(row.xgsj) || '-' }}</template>
</el-table-column>
<el-table-column label="停用" width="120" align="center">
<template slot-scope="scope">
<el-tag
:type="scope.row.ty === 1 || scope.row.ty === true ? 'danger' : 'success'"
@@ -78,7 +80,7 @@
</el-tag>
</template>
</el-table-column>
<el-table-column label="操作" width="150" align="center" fixed="right">
<el-table-column label="操作" align="center" fixed="right">
<template slot-scope="scope">
<el-button type="text" size="small" icon="el-icon-view" @click="handleView(scope.row)">详情</el-button>
<el-button type="text" size="small" icon="el-icon-edit" @click="handleEdit(scope.row)">编辑</el-button>
@@ -240,7 +242,7 @@
<el-descriptions-item label="培训类型">{{ viewForm.pxlx || '-' }}</el-descriptions-item>
<el-descriptions-item label="培训层次">{{ viewForm.pxcc || '-' }}</el-descriptions-item>
<el-descriptions-item label="版本">{{ viewForm.bb || '-' }}</el-descriptions-item>
<el-descriptions-item label="修改时间">{{ viewForm.xgsj || '-' }}</el-descriptions-item>
<el-descriptions-item label="修改时间">{{ fmtDateTime(viewForm.xgsj) || '-' }}</el-descriptions-item>
<el-descriptions-item label="当前学期考试不及格门数下限">{{ formatValue(viewForm.dqxqksbjgmsxx) }}</el-descriptions-item>
<el-descriptions-item label="当前学期考试不及格门数上限">{{ formatValue(viewForm.dqxqksbjgmssx) }}</el-descriptions-item>
<el-descriptions-item label="当前学期考查不及格门数下限">{{ formatValue(viewForm.dqxqkcbjgmsxx) }}</el-descriptions-item>
@@ -514,6 +516,14 @@ export default {
/** 空值显示占位符 */
formatValue(val) {
return val !== null && val !== undefined ? val : '-'
},
/** 统一格式化后端 LocalDateTime(去除 T、截断到秒) */
fmtDateTime(val) {
if (val === null || val === undefined || val === '') {
return ''
}
return String(val).replace('T', ' ').slice(0, 19)
}
}
}