|
@@ -151,7 +151,10 @@
|
|
|
</el-col> -->
|
|
</el-col> -->
|
|
|
<el-col :span="8">
|
|
<el-col :span="8">
|
|
|
<el-form-item label="是否扫码签到:" prop="needSignIn">
|
|
<el-form-item label="是否扫码签到:" prop="needSignIn">
|
|
|
- <el-radio-group v-model="form.needSignIn" :disabled="dialogType != 'add'">
|
|
|
|
|
|
|
+ <el-radio-group
|
|
|
|
|
+ v-model="form.needSignIn"
|
|
|
|
|
+ :disabled="dialogType != 'add'"
|
|
|
|
|
+ >
|
|
|
<el-radio :label="1">是</el-radio>
|
|
<el-radio :label="1">是</el-radio>
|
|
|
<el-radio :label="0">否</el-radio>
|
|
<el-radio :label="0">否</el-radio>
|
|
|
</el-radio-group>
|
|
</el-radio-group>
|
|
@@ -219,7 +222,10 @@
|
|
|
</el-col>
|
|
</el-col>
|
|
|
<el-col :span="8">
|
|
<el-col :span="8">
|
|
|
<el-form-item label="实到人数:" prop="actualCount">
|
|
<el-form-item label="实到人数:" prop="actualCount">
|
|
|
- <el-input v-model="form.actualCount" placeholder="请输入实到人数" />
|
|
|
|
|
|
|
+ <el-input
|
|
|
|
|
+ v-model="form.actualCount"
|
|
|
|
|
+ placeholder="请输入实到人数"
|
|
|
|
|
+ />
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
</el-row>
|
|
</el-row>
|
|
@@ -260,7 +266,10 @@
|
|
|
<!-- 结果附件 -->
|
|
<!-- 结果附件 -->
|
|
|
<el-row :gutter="20">
|
|
<el-row :gutter="20">
|
|
|
<el-col :span="12">
|
|
<el-col :span="12">
|
|
|
- <el-form-item label="培训结果附件:" prop="trainingResultAttachment">
|
|
|
|
|
|
|
+ <el-form-item
|
|
|
|
|
+ label="培训结果附件:"
|
|
|
|
|
+ prop="trainingResultAttachment"
|
|
|
|
|
+ >
|
|
|
<fileMain
|
|
<fileMain
|
|
|
v-model="form.trainingResultAttachment"
|
|
v-model="form.trainingResultAttachment"
|
|
|
:type="isView ? 'view' : 'add'"
|
|
:type="isView ? 'view' : 'add'"
|
|
@@ -328,17 +337,29 @@
|
|
|
<!-- 参加培训人员 -->
|
|
<!-- 参加培训人员 -->
|
|
|
<div class="section-title">参加培训人员</div>
|
|
<div class="section-title">参加培训人员</div>
|
|
|
<div class="section-toolbar">
|
|
<div class="section-toolbar">
|
|
|
- <el-button
|
|
|
|
|
- type="primary"
|
|
|
|
|
- size="small"
|
|
|
|
|
- icon="el-icon-plus"
|
|
|
|
|
- v-if="!isView"
|
|
|
|
|
- @click="handleAddPerson"
|
|
|
|
|
- >添加培训人员</el-button
|
|
|
|
|
- >
|
|
|
|
|
|
|
+ <template v-if="!isView">
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ type="primary"
|
|
|
|
|
+ size="small"
|
|
|
|
|
+ icon="el-icon-plus"
|
|
|
|
|
+ @click="handleAddPerson"
|
|
|
|
|
+ >添加培训人员</el-button
|
|
|
|
|
+ >
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ size="small"
|
|
|
|
|
+ icon="el-icon-upload2"
|
|
|
|
|
+ @click="handleImportPerson"
|
|
|
|
|
+ >导入</el-button
|
|
|
|
|
+ >
|
|
|
|
|
+ </template>
|
|
|
</div>
|
|
</div>
|
|
|
<el-table :data="form.persons" border style="width: 100%">
|
|
<el-table :data="form.persons" border style="width: 100%">
|
|
|
- <el-table-column type="index" label="序号" width="60" align="center" />
|
|
|
|
|
|
|
+ <el-table-column
|
|
|
|
|
+ type="index"
|
|
|
|
|
+ label="序号"
|
|
|
|
|
+ width="60"
|
|
|
|
|
+ align="center"
|
|
|
|
|
+ />
|
|
|
<el-table-column label="参训人员" align="center" min-width="110">
|
|
<el-table-column label="参训人员" align="center" min-width="110">
|
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
|
<el-input v-model="scope.row.personName" readonly />
|
|
<el-input v-model="scope.row.personName" readonly />
|
|
@@ -380,10 +401,7 @@
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
<el-table-column label="追踪成绩" align="center" min-width="110">
|
|
<el-table-column label="追踪成绩" align="center" min-width="110">
|
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
|
- <el-input
|
|
|
|
|
- v-model="scope.row.trackingScore"
|
|
|
|
|
- placeholder="0-100"
|
|
|
|
|
- />
|
|
|
|
|
|
|
+ <el-input v-model="scope.row.trackingScore" placeholder="0-100" />
|
|
|
</template>
|
|
</template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
<el-table-column label="追踪效果" align="center" min-width="230">
|
|
<el-table-column label="追踪效果" align="center" min-width="230">
|
|
@@ -443,6 +461,11 @@
|
|
|
})
|
|
})
|
|
|
"
|
|
"
|
|
|
/>
|
|
/>
|
|
|
|
|
+ <person-import
|
|
|
|
|
+ ref="personImportRef"
|
|
|
|
|
+ title="导入参训人员"
|
|
|
|
|
+ @confirm="handlePersonImported"
|
|
|
|
|
+ />
|
|
|
</ele-modal>
|
|
</ele-modal>
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
@@ -451,6 +474,7 @@
|
|
|
import DeptSelect from '@/components/CommomSelect/dept-select.vue';
|
|
import DeptSelect from '@/components/CommomSelect/dept-select.vue';
|
|
|
import personSelect from '@/components/CommomSelect/person-select.vue';
|
|
import personSelect from '@/components/CommomSelect/person-select.vue';
|
|
|
import userSelect from '@/components/user-select/user-select.vue';
|
|
import userSelect from '@/components/user-select/user-select.vue';
|
|
|
|
|
+ import personImport from '@/components/upload/person-import-dialog.vue';
|
|
|
import {
|
|
import {
|
|
|
getById,
|
|
getById,
|
|
|
save as saveTraining,
|
|
save as saveTraining,
|
|
@@ -508,7 +532,8 @@
|
|
|
components: {
|
|
components: {
|
|
|
DeptSelect,
|
|
DeptSelect,
|
|
|
personSelect,
|
|
personSelect,
|
|
|
- userSelect
|
|
|
|
|
|
|
+ userSelect,
|
|
|
|
|
+ personImport
|
|
|
},
|
|
},
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
@@ -542,7 +567,11 @@
|
|
|
{ required: true, message: '请选择结束时间', trigger: 'change' }
|
|
{ required: true, message: '请选择结束时间', trigger: 'change' }
|
|
|
],
|
|
],
|
|
|
archiveFlag: [
|
|
archiveFlag: [
|
|
|
- { required: true, message: '请选择是否一人一档归档', trigger: 'change' }
|
|
|
|
|
|
|
+ {
|
|
|
|
|
+ required: true,
|
|
|
|
|
+ message: '请选择是否一人一档归档',
|
|
|
|
|
+ trigger: 'change'
|
|
|
|
|
+ }
|
|
|
],
|
|
],
|
|
|
trainingContent: [
|
|
trainingContent: [
|
|
|
{ max: 500, message: '培训内容不能超过500字', trigger: 'blur' }
|
|
{ max: 500, message: '培训内容不能超过500字', trigger: 'blur' }
|
|
@@ -556,7 +585,7 @@
|
|
|
computed: {
|
|
computed: {
|
|
|
...mapGetters(['user']),
|
|
...mapGetters(['user']),
|
|
|
deptId() {
|
|
deptId() {
|
|
|
- return this.user.info.deptIds?.[0] || "";
|
|
|
|
|
|
|
+ return this.user.info.deptIds?.[0] || '';
|
|
|
},
|
|
},
|
|
|
dialogTitle() {
|
|
dialogTitle() {
|
|
|
const titleMap = {
|
|
const titleMap = {
|
|
@@ -608,8 +637,7 @@
|
|
|
? ''
|
|
? ''
|
|
|
: item.trainingHours,
|
|
: item.trainingHours,
|
|
|
assessmentScore:
|
|
assessmentScore:
|
|
|
- item.assessmentScore === undefined ||
|
|
|
|
|
- item.assessmentScore === null
|
|
|
|
|
|
|
+ item.assessmentScore === undefined || item.assessmentScore === null
|
|
|
? ''
|
|
? ''
|
|
|
: item.assessmentScore,
|
|
: item.assessmentScore,
|
|
|
trainingEffect:
|
|
trainingEffect:
|
|
@@ -631,7 +659,8 @@
|
|
|
id: detail.id || '',
|
|
id: detail.id || '',
|
|
|
trainingProject: detail.trainingProject || '',
|
|
trainingProject: detail.trainingProject || '',
|
|
|
organizationId:
|
|
organizationId:
|
|
|
- detail.organizationId === undefined || detail.organizationId === null
|
|
|
|
|
|
|
+ detail.organizationId === undefined ||
|
|
|
|
|
+ detail.organizationId === null
|
|
|
? ''
|
|
? ''
|
|
|
: detail.organizationId,
|
|
: detail.organizationId,
|
|
|
organizationName: detail.organizationName || '',
|
|
organizationName: detail.organizationName || '',
|
|
@@ -642,7 +671,8 @@
|
|
|
: detail.responsibleUserId,
|
|
: detail.responsibleUserId,
|
|
|
responsibleUserName: detail.responsibleUserName || '',
|
|
responsibleUserName: detail.responsibleUserName || '',
|
|
|
trainingUnitId:
|
|
trainingUnitId:
|
|
|
- detail.trainingUnitId === undefined || detail.trainingUnitId === null
|
|
|
|
|
|
|
+ detail.trainingUnitId === undefined ||
|
|
|
|
|
+ detail.trainingUnitId === null
|
|
|
? ''
|
|
? ''
|
|
|
: detail.trainingUnitId,
|
|
: detail.trainingUnitId,
|
|
|
trainingUnitName: detail.trainingUnitName || '',
|
|
trainingUnitName: detail.trainingUnitName || '',
|
|
@@ -716,13 +746,34 @@
|
|
|
handleAddPerson() {
|
|
handleAddPerson() {
|
|
|
this.$refs.userSelectRef.open(null, 0, true);
|
|
this.$refs.userSelectRef.open(null, 0, true);
|
|
|
},
|
|
},
|
|
|
|
|
+ handleImportPerson() {
|
|
|
|
|
+ this.$refs.personImportRef.open(
|
|
|
|
|
+ this.form.persons.map((item) => item.personId)
|
|
|
|
|
+ );
|
|
|
|
|
+ },
|
|
|
handlePersonSelected(rows) {
|
|
handlePersonSelected(rows) {
|
|
|
- const list = Array.isArray(rows) ? rows : [rows];
|
|
|
|
|
|
|
+ this.appendPersons(Array.isArray(rows) ? rows : [rows]);
|
|
|
|
|
+ },
|
|
|
|
|
+ handlePersonImported(persons, ignoredCount) {
|
|
|
|
|
+ const added = this.appendPersons(persons);
|
|
|
|
|
+ if (added) {
|
|
|
|
|
+ this.$message.success(`成功导入 ${added} 名参训人员`);
|
|
|
|
|
+ }
|
|
|
|
|
+ if (ignoredCount) {
|
|
|
|
|
+ this.$message.warning(`已忽略 ${ignoredCount} 行未导入的数据`);
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ // 追加参训人员并按 personId 去重,返回实际新增条数
|
|
|
|
|
+ appendPersons(list) {
|
|
|
const exists = new Set(
|
|
const exists = new Set(
|
|
|
this.form.persons.map((item) => String(item.personId))
|
|
this.form.persons.map((item) => String(item.personId))
|
|
|
);
|
|
);
|
|
|
|
|
+ let added = 0;
|
|
|
list.forEach((item) => {
|
|
list.forEach((item) => {
|
|
|
- if (exists.has(String(item.id))) return;
|
|
|
|
|
|
|
+ const personId = String(item.id);
|
|
|
|
|
+ if (exists.has(personId)) return;
|
|
|
|
|
+ exists.add(personId);
|
|
|
|
|
+ added++;
|
|
|
this.form.persons.push({
|
|
this.form.persons.push({
|
|
|
personId: item.id,
|
|
personId: item.id,
|
|
|
personName: item.name || '',
|
|
personName: item.name || '',
|
|
@@ -736,6 +787,7 @@
|
|
|
});
|
|
});
|
|
|
});
|
|
});
|
|
|
this.form.plannedCount = this.form.persons.length;
|
|
this.form.plannedCount = this.form.persons.length;
|
|
|
|
|
+ return added;
|
|
|
},
|
|
},
|
|
|
handleDeletePerson(index) {
|
|
handleDeletePerson(index) {
|
|
|
this.form.persons.splice(index, 1);
|
|
this.form.persons.splice(index, 1);
|