Commit f59bf4ce authored by 纪泽龙's avatar 纪泽龙

培训计划管理复现

parent 7549f9b9
......@@ -2,7 +2,7 @@
* @Author: 纪泽龙 jizelong@qq.com
* @Date: 2022-09-22 10:38:49
* @LastEditors: 纪泽龙 jizelong@qq.com
* @LastEditTime: 2022-12-19 14:01:37
* @LastEditTime: 2022-12-28 15:01:59
* @FilePath: /danger-manage-web/src/views/lessonsProgram/components/addLesson.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
......@@ -24,6 +24,7 @@
:is="currentComponent"
:bankId.sync="bankId"
:subjectId.sync="subjectId"
:jsonData="jsonData"
ref="current"
></component>
</transition>
......@@ -73,6 +74,9 @@ export default {
bankId: {
type: Number,
},
jsonData:{
type:Array,
}
},
// components: {
// Lesson,
......
......@@ -42,7 +42,7 @@
<div class="right flex">
<template v-if="!isActive">
<div>
<el-button type="text" @click="edit">编辑</el-button>
<el-button type="text" @click="edit(personnelOptions)">编辑</el-button>
<el-button type="text" @click="deletePlan">删除</el-button>
</div>
</template>
......@@ -95,10 +95,10 @@ export default {
};
},
methods: {
edit() {
edit(personnelOptions) {
// 编辑
//console.log(this.infoData);
this.$parent.addClick(this.infoData);
console.log(personnelOptions);
this.$parent.addClick(this.infoData,personnelOptions);
//this.$emit("edit", this.oldInfoData);
},
save() {
......
......@@ -2,7 +2,7 @@
* @Author: 纪泽龙 jizelong@qq.com
* @Date: 2022-09-22 10:59:44
* @LastEditors: 纪泽龙 jizelong@qq.com
* @LastEditTime: 2022-12-21 17:30:33
* @LastEditTime: 2022-12-28 15:06:07
* @FilePath: /danger-manage-web/src/views/lessonsProgram/components/Lession.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
......@@ -25,30 +25,31 @@
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value">
:value="item.value"
>
</el-option>
</el-select>
</el-form-item>
<!--<el-form-item label="开始时间" prop="releaseTime">-->
<!--<el-date-picker-->
<!--v-model="form.startTime"-->
<!--value-format="yyyy-MM-dd HH:mm:ss"-->
<!--type="datetime"-->
<!--placeholder="开始时间"-->
<!--default-time="12:00:00"-->
<!--&gt;-->
<!--</el-date-picker>-->
<!--</el-form-item>-->
</div>
<!--<el-form-item label="结束时间" prop="releaseTime">-->
<!--<el-date-picker-->
<!--v-model="form.endTime"-->
<!--value-format="yyyy-MM-dd HH:mm:ss"-->
<!--type="datetime"-->
<!--placeholder="结束时间"-->
<!--default-time="12:00:00"-->
<!--v-model="form.startTime"-->
<!--value-format="yyyy-MM-dd HH:mm:ss"-->
<!--type="datetime"-->
<!--placeholder="开始时间"-->
<!--default-time="12:00:00"-->
<!--&gt;-->
<!--</el-date-picker>-->
<!--</el-form-item>-->
</div>
<!--<el-form-item label="结束时间" prop="releaseTime">-->
<!--<el-date-picker-->
<!--v-model="form.endTime"-->
<!--value-format="yyyy-MM-dd HH:mm:ss"-->
<!--type="datetime"-->
<!--placeholder="结束时间"-->
<!--default-time="12:00:00"-->
<!--&gt;-->
<!--</el-date-picker>-->
<!--</el-form-item>-->
<el-form-item label="选择人员" prop="releaseTime">
......@@ -90,7 +91,7 @@ import {
addPlan,
editPlan,
getPlanList,
getPlan
getPlan,
} from "@/api/educationPlanExam/trainingProgram";
export default {
name: "",
......@@ -98,6 +99,9 @@ export default {
bankId: {
type: Number,
},
jsonData: {
tyoe: Array,
},
// jsonSelectNameList: {
// type: String,
// default:
......@@ -109,13 +113,16 @@ export default {
},
data() {
return {
options: [{
value: 1,
label: '内部员工'
}, {
value: 2,
label: '承包商培训'
}],
options: [
{
value: 1,
label: "内部员工",
},
{
value: 2,
label: "承包商培训",
},
],
form: {
bankName: "",
// courseType: "",
......@@ -123,13 +130,13 @@ export default {
// video: "",
// enclosure: "",
deptId: null,
personnelType:1,
personnelType: 1,
abc: 0,
},
// 参考人员
jsonSelectNameList: null,
peopleList:[],
peopleList: [],
// 归属部门列表
deptOptions: [],
......@@ -162,7 +169,7 @@ export default {
mounted() {
// this.jsonSelectNameList
// '[{"staffId":880,"staffName":"孙卓亚"},{"staffId":871,"staffName":"张玉宾"},{"staffId":869,"staffName":"李二朝"},{"staffId":870,"staffName":"盖永峰"},{"staffId":868,"staffName":"刘丽艳"},{"staffId":867,"staffName":"霍文俊"},{"staffId":866,"staffName":"刘志坚"},{"staffId":865,"staffName":"郝文权"},{"staffId":864,"staffName":"齐雪军"},{"staffId":852,"staffName":"刘江平"},{"staffId":853,"staffName":"谷建海"},{"staffId":851,"staffName":"丁振国"},{"staffId":850,"staffName":"齐江波"},{"staffId":849,"staffName":"周立新"},{"staffId":848,"staffName":"史志波"},{"staffId":847,"staffName":"王增波"},{"staffId":846,"staffName":"杨彦龙"},{"staffId":845,"staffName":"杨华国"},{"staffId":844,"staffName":"王青华"}]';
// '[{"staffId":880,"staffName":"孙卓亚"},{"staffId":871,"staffName":"张玉宾"},{"staffId":869,"staffName":"李二朝"},{"staffId":870,"staffName":"盖永峰"},{"staffId":868,"staffName":"刘丽艳"},{"staffId":867,"staffName":"霍文俊"},{"staffId":866,"staffName":"刘志坚"},{"staffId":865,"staffName":"郝文权"},{"staffId":864,"staffName":"齐雪军"},{"staffId":852,"staffName":"刘江平"},{"staffId":853,"staffName":"谷建海"},{"staffId":851,"staffName":"丁振国"},{"staffId":850,"staffName":"齐江波"},{"staffId":849,"staffName":"周立新"},{"staffId":848,"staffName":"史志波"},{"staffId":847,"staffName":"王增波"},{"staffId":846,"staffName":"杨彦龙"},{"staffId":845,"staffName":"杨华国"},{"staffId":844,"staffName":"王青华"}]';
this.$refs.changePaple.changeNameList(this.jsonSelectNameList);
},
methods: {
......@@ -184,8 +191,12 @@ export default {
this.form = {
bankName: res.data.planName,
deptId: res.data.planId,
personnelType: res.data.personnelType
personnelType: res.data.personnelType,
};
// 人名复现
this.jsonSelectNameList = JSON.stringify(this.jsonData);
this.$refs.changePaple.changeNameList(this.jsonSelectNameList);
// const data = res.data;
// const { bankName, courseType, courseConent, video, enclosure } =
// data;
......@@ -216,36 +227,34 @@ export default {
console.log("参考人员", list);
this.peopleList = list;
},
savePlan(){
savePlan() {
this.$refs.form.validate((valid) => {
if (valid) {
if(this.peopleList.length<3){
this.$message.error('请至少选择一个考试人员');
return
if (this.peopleList.length < 3) {
this.$message.error("请至少选择一个考试人员");
return;
}
//console.log(this.peopleList);
//console.log(this.peopleList);
this.form.peopleList = this.peopleList.toString();
this.form.planName = this.form.bankName;
console.log(this.form)
if(this.bankId!=null){
this.form.planId = this.bankId;
console.log(this.form);
if (this.bankId != null) {
this.form.planId = this.bankId;
return editPlan(this.form).then((res) => {
if (res.code == 200) {
this.$parent.$parent.$parent.getPlanList();
}
});
}else {
this.$parent.$parent.$parent.getPlanList();
}
});
} else {
return addPlan(this.form).then((res) => {
if (res.code == 200) {
if (res.code == 200) {
this.$parent.$parent.$parent.getPlanList();
}
});
}
}
});
});
},
save(num = 2) {
// 因为富文本编辑器会残留<p><br></p>,所以要清
......
......@@ -2,7 +2,7 @@
* @Author: 纪泽龙 jizelong@qq.com
* @Date: 2022-09-16 17:07:30
* @LastEditors: 纪泽龙 jizelong@qq.com
* @LastEditTime: 2022-09-28 17:46:09
* @LastEditTime: 2022-12-28 15:04:15
* @FilePath: /danger-manage-web/src/views/trainingProgram/index.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
......@@ -70,6 +70,7 @@
:componentsNum.sync="componentsNum"
:bankId.sync="bankId"
:visible.sync="dilogFlag"
:jsonData='jsonData'
/>
</div>
</template>
......@@ -102,6 +103,8 @@ export default {
data() {
return {
personnelOptions,
// 选人复显示
jsonData:null,
isActiveId: 999,
list: [],
// 当点击编辑的时候,会记录最初始的
......@@ -228,7 +231,7 @@ export default {
this.isActiveId = 999;
},
changeList() {},
addClick(form) {
addClick(form,json) {
this.$refs.Dia.title = "新增培训计划";
this.componentsNum = 2;
......@@ -238,6 +241,13 @@ export default {
//console.log("=======")
this.$refs.Dia.title = "修改培训计划";
this.bankId = form.planId;
this.jsonData = json.map(item=>{
return {
peoPleId:item.postId,
peoPleName:item.postName,
}
})
}
//this.addOpen = true;
},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment