|
@@ -38,15 +38,15 @@
|
|
|
<el-table-column type="selection" width="55" align="center" fixed="left"/>
|
|
|
<el-table-column label="详细计划" align="center" prop="detailPlan" :show-overflow-tooltip="true" width="180"
|
|
|
fixed="left"/>
|
|
|
- <el-table-column label="计划培训开始时间" prop="planData" width="180" align="center" fixed="left">
|
|
|
+ <el-table-column label="计划培训时间" prop="planDate" width="180" align="center" fixed="left">
|
|
|
<template slot-scope="scope">
|
|
|
- <span>{{ parseTime(scope.row.planData, '{y}-{m}-{d}') }}</span>
|
|
|
+ <span>{{ parseTime(scope.row.planDate, '{y}-{m}-{d}') }}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column label="培训主题" align="center" prop="topic" :show-overflow-tooltip="true" fixed="left"
|
|
|
width="180"/>
|
|
|
<el-table-column label="培训计划" align="center" prop="courseDay" :show-overflow-tooltip="true" width="180"/>
|
|
|
- <el-table-column label="培训内容" align="center" prop="content" :show-overflow-tooltip="true" width="180"/>
|
|
|
+ <el-table-column label="培训内容" align="center" prop="content" width="280"/>
|
|
|
<el-table-column label="培训状态" align="center" prop="planStatus" :show-overflow-tooltip="true" width="180">
|
|
|
<template slot-scope="scope">
|
|
|
<el-tag v-if="scope.row.planStatus == 2" size="small" type="warning">待考试</el-tag>
|
|
@@ -171,6 +171,56 @@
|
|
|
<el-input v-model="form.remarks" placeholder="请输入备注"/>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
+ <el-card v-for="(recordForm, index) in recordForm" :key="index" shadow="always" class="mb8 mt8">
|
|
|
+ <el-form ref="recordForm" :model="recordForm" :rules="rules" label-width="100px">
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="23">
|
|
|
+ <el-form-item label="计划培训时间" prop="planDate">
|
|
|
+ <el-date-picker
|
|
|
+ v-model="recordForm.planDate"
|
|
|
+ type="date"
|
|
|
+ value-format="yyyy-MM-dd"
|
|
|
+ placeholder="请选择计划培训时间">
|
|
|
+ </el-date-picker>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="1">
|
|
|
+ <el-tooltip class="item" effect="dark" content="移除本行" placement="top">
|
|
|
+ <el-button
|
|
|
+ type="text"
|
|
|
+ @click.prevent="removeDomain(recordForm)"
|
|
|
+ style="float: right;"
|
|
|
+ >❌
|
|
|
+ </el-button>
|
|
|
+ </el-tooltip>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="23">
|
|
|
+ <el-form-item label="培训计划" prop="courseDay">
|
|
|
+ <el-input v-model="recordForm.courseDay" placeholder="请输入培训计划"/>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="23">
|
|
|
+ <el-form-item label="培训内容" prop="content">
|
|
|
+ <el-input type="textarea" v-model="recordForm.content" placeholder="请输入培训内容"/>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </el-form>
|
|
|
+ </el-card>
|
|
|
+
|
|
|
+ <div class="mb8 mt8">
|
|
|
+ <el-tooltip class="item" effect="dark" content="该按钮会删除所有卡片内容!请谨慎操作!" placement="top">
|
|
|
+ <el-button type="danger" plain @click="resetForm1()" :disabled="finalFlag"><i
|
|
|
+ class="el-icon-refresh-left"></i></el-button>
|
|
|
+ </el-tooltip>
|
|
|
+ <el-button type="success" plain @click="add"><i class="el-icon-plus"></i></el-button>
|
|
|
+ <el-button type="warning" plain @click="reduce" :disabled="flag||finalFlag"><i class="el-icon-minus"></i>
|
|
|
+ </el-button>
|
|
|
+ </div>
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
<el-button type="primary" @click="submitForm">确 定</el-button>
|
|
|
<el-button @click="cancel">取 消</el-button>
|
|
@@ -214,7 +264,7 @@
|
|
|
type="primary"
|
|
|
icon="el-icon-video-play"
|
|
|
@click="handleStudy(file.data)"
|
|
|
- >开始学习
|
|
|
+ >查看附件
|
|
|
</el-button>
|
|
|
</el-dialog>
|
|
|
|
|
@@ -266,18 +316,6 @@
|
|
|
<span>{{ parseTime(scope.row.createdate, '{y}-{m}-{d}') }}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <!-- <el-table-column :label="$t('培训日期')" align="center" prop="pDate" width="150">-->
|
|
|
- <!-- <template slot-scope="scope">-->
|
|
|
- <!-- <el-date-picker-->
|
|
|
- <!-- v-if="scope.row.isEdit"-->
|
|
|
- <!-- v-model="scope.row.pDate"-->
|
|
|
- <!-- type="date"-->
|
|
|
- <!-- value-format="yyyy-MM-dd"-->
|
|
|
- <!-- placeholder="日期">-->
|
|
|
- <!-- </el-date-picker>-->
|
|
|
- <!-- <span v-else>{{ parseTime(scope.row.pDate, '{y}-{m}-{d}') }}</span>-->
|
|
|
- <!-- </template>-->
|
|
|
- <!-- </el-table-column>-->
|
|
|
<el-table-column :label="$t('操作')" align="center" width="220" class-name="small-padding fixed-width">
|
|
|
<template slot-scope="scope">
|
|
|
<el-button
|
|
@@ -368,6 +406,10 @@ import {treeselect} from "@/api/system/dept";
|
|
|
import Treeselect from "@riophae/vue-treeselect";
|
|
|
import {getToken} from "@/utils/auth";
|
|
|
import {allFileList, delCommonfile} from "@/api/common/commonfile";
|
|
|
+import {delLjContent, listLjContent} from "@/api/training/bccnew/ljContent";
|
|
|
+import {delFtContent, listFtContent} from "@/api/training/bccnew/ftContent";
|
|
|
+import {delFlContent, listFlContent} from "@/api/training/bccnew/flContent";
|
|
|
+import {delYsContent, listYsContent} from "@/api/training/bccnew/ysContent";
|
|
|
|
|
|
var timer = null;
|
|
|
export default {
|
|
@@ -379,6 +421,9 @@ export default {
|
|
|
components: {Treeselect},
|
|
|
data() {
|
|
|
return {
|
|
|
+ recordForm: [{}],
|
|
|
+ flag: true,
|
|
|
+ finalFlag: false,
|
|
|
file: {
|
|
|
open: false,
|
|
|
data: {}
|
|
@@ -470,6 +515,80 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
methods: {
|
|
|
+ resetForm1() {
|
|
|
+ this.recordForm = [{}]
|
|
|
+ this.flags();
|
|
|
+ },
|
|
|
+ // 表单添加一行
|
|
|
+ add() {
|
|
|
+ let arr = {};
|
|
|
+ this.recordForm.push(arr)
|
|
|
+ this.flags();
|
|
|
+ },
|
|
|
+ // 表单减少一行
|
|
|
+ reduce() {
|
|
|
+ this.recordForm.length = this.recordForm.length - 1
|
|
|
+ this.flags()
|
|
|
+ },
|
|
|
+ //删除自身
|
|
|
+ removeDomain(item) {
|
|
|
+ console.log(item)
|
|
|
+ if (!item.id) {
|
|
|
+ //如果子类大于1 可点击删除按钮
|
|
|
+ if (this.recordForm.length > 1) {
|
|
|
+ var index = this.recordForm.indexOf(item)
|
|
|
+ if (index !== -1) {
|
|
|
+ this.recordForm.splice(index, 1)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.flags()
|
|
|
+ } else {
|
|
|
+ var index = this.recordForm.indexOf(item)
|
|
|
+ if (this.planType === 1) {
|
|
|
+ this.$confirm('是否确认删除该行?').then(function () {
|
|
|
+ return delLjContent(item.id);
|
|
|
+ }).then(() => {
|
|
|
+ this.msgSuccess("删除成功");
|
|
|
+ this.recordForm.splice(index, 1)
|
|
|
+ })
|
|
|
+ }else if (this.planType === 2) {
|
|
|
+ this.$confirm('是否确认删除该行?').then(function () {
|
|
|
+ return delYsContent(item.id);
|
|
|
+ }).then(() => {
|
|
|
+ this.msgSuccess("删除成功");
|
|
|
+ this.recordForm.splice(index, 1)
|
|
|
+ })
|
|
|
+ }else if (this.planType === 3) {
|
|
|
+ this.$confirm('是否确认删除该行?').then(function () {
|
|
|
+ return delFlContent(item.id);
|
|
|
+ }).then(() => {
|
|
|
+ this.msgSuccess("删除成功");
|
|
|
+ this.recordForm.splice(index, 1)
|
|
|
+ })
|
|
|
+ }else if (this.planType === 4) {
|
|
|
+ this.$confirm('是否确认删除该行?').then(function () {
|
|
|
+ return delFtContent(item.id);
|
|
|
+ }).then(() => {
|
|
|
+ this.msgSuccess("删除成功");
|
|
|
+ this.recordForm.splice(index, 1)
|
|
|
+ })
|
|
|
+ }
|
|
|
+ this.flags()
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 判断数组长度
|
|
|
+ flags() {
|
|
|
+ //如果小于1则自动添加一行
|
|
|
+ if (this.recordForm.length < 2) {
|
|
|
+ this.flag = true
|
|
|
+ } else if (this.recordForm.length < 1) {
|
|
|
+ this.recordForm.push({});
|
|
|
+ } else {
|
|
|
+ //先赋值为true再赋为false, 不然会没反应
|
|
|
+ this.flag = true
|
|
|
+ this.flag = false
|
|
|
+ }
|
|
|
+ },
|
|
|
saveScore(row) {
|
|
|
if (this.planType === 1) {
|
|
|
this.$confirm('成绩保存后不可修改!请确认成绩为' + ((row.score1Tmp ? row.score1Tmp : row.score2Tmp ? row.score2Tmp : row.score3Tmp) === undefined ? "" : (row.score1Tmp ? row.score1Tmp : row.score2Tmp ? row.score2Tmp : row.score3Tmp)), "警告", {
|
|
@@ -762,7 +881,9 @@ export default {
|
|
|
score3: null
|
|
|
};
|
|
|
this.resetForm("form");
|
|
|
- }, /** 搜索按钮操作 */
|
|
|
+ this.recordForm = [{}]
|
|
|
+ },
|
|
|
+ /** 搜索按钮操作 */
|
|
|
handleQuery() {
|
|
|
this.queryParams.pageNum = 1;
|
|
|
this.getList();
|
|
@@ -828,24 +949,36 @@ export default {
|
|
|
this.form = response.data;
|
|
|
this.open = true;
|
|
|
this.title = "修改课程";
|
|
|
+ listLjContent({pid: id}).then(res => {
|
|
|
+ this.recordForm = res.data;
|
|
|
+ })
|
|
|
});
|
|
|
} else if (this.planType == 2) {
|
|
|
getYsplandsdt(id).then(response => {
|
|
|
this.form = response.data;
|
|
|
this.open = true;
|
|
|
this.title = "修改课程";
|
|
|
+ listYsContent({pid: id}).then(res => {
|
|
|
+ this.recordForm = res.data;
|
|
|
+ })
|
|
|
});
|
|
|
} else if (this.planType == 3) {
|
|
|
getFlplandsdt(id).then(response => {
|
|
|
this.form = response.data;
|
|
|
this.open = true;
|
|
|
this.title = "修改课程";
|
|
|
+ listFlContent({pid: id}).then(res => {
|
|
|
+ this.recordForm = res.data;
|
|
|
+ })
|
|
|
});
|
|
|
} else if (this.planType == 4) {
|
|
|
getFtplandsdt(id).then(response => {
|
|
|
this.form = response.data;
|
|
|
this.open = true;
|
|
|
this.title = "修改课程";
|
|
|
+ listFtContent({pid: id}).then(res => {
|
|
|
+ this.recordForm = res.data;
|
|
|
+ })
|
|
|
});
|
|
|
}
|
|
|
},
|
|
@@ -857,6 +990,7 @@ export default {
|
|
|
submitForm() {
|
|
|
this.$refs["form"].validate(valid => {
|
|
|
if (valid) {
|
|
|
+ this.form.contents = this.recordForm;
|
|
|
if (this.form.id != null) {
|
|
|
if (this.planType == 1) {
|
|
|
updateLjplandsdt(this.form).then(response => {
|
|
@@ -917,7 +1051,7 @@ export default {
|
|
|
//合并单元格
|
|
|
mergeMethod({row, column, rowIndex, columnIndex}) {
|
|
|
// console.log(row)
|
|
|
- if ([1,3, 6, 7, 8, 9, 10, 11, 12, 13, 14].includes(columnIndex)) {
|
|
|
+ if ([1, 3, 6, 7, 8, 9, 10, 11, 12, 13, 14].includes(columnIndex)) {
|
|
|
const _row = this.setTable(this.dsdtList).merge[rowIndex];
|
|
|
const _col = _row > 0 ? 1 : 0;
|
|
|
return {
|