|
@@ -1,34 +1,71 @@
|
|
|
<template>
|
|
|
<el-dialog
|
|
|
+ width="1500px"
|
|
|
:title="!this.taskForm.taskId == '' ? $t('处理') : $t('详情')"
|
|
|
- :close-on-click-modal="false"
|
|
|
:visible.sync="visible">
|
|
|
<el-form :model="taskForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="" label-width="80px">
|
|
|
- <el-form-item label="申请列表">
|
|
|
+ <el-form-item label="年度计划">
|
|
|
+ <el-table :data="yearplanList" border>
|
|
|
+ <el-table-column label="培训员工编号" align="center" prop="staffId" :show-overflow-tooltip="true"/>
|
|
|
+ <el-table-column label="培训员工" align="center" prop="staffName" :show-overflow-tooltip="true"/>
|
|
|
+ <el-table-column label="年度培训标题" align="center" prop="name" :show-overflow-tooltip="true"/>
|
|
|
+ <el-table-column label="年份" align="center" prop="planYear" width="100">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="部门" align="center" prop="deptName" :show-overflow-tooltip="true"/>
|
|
|
+ </el-table>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="计划列表">
|
|
|
<el-table
|
|
|
:data="planList"
|
|
|
border
|
|
|
style="width: 100%">
|
|
|
- <el-table-column label="培训员工编号" align="center" prop="staffId" :show-overflow-tooltip="true"/>
|
|
|
- <el-table-column label="培训内容" align="center" prop="plantName" :show-overflow-tooltip="true"/>
|
|
|
- <el-table-column label="开始日期" align="center" prop="startDate" width="100">
|
|
|
+ <el-table-column label="培训员工编号" align="center" prop="staffId" :show-overflow-tooltip="true"/>
|
|
|
+ <el-table-column label="培训员工" align="center" prop="staffName" :show-overflow-tooltip="true"/>
|
|
|
+ <el-table-column label="培训内容" align="center" prop="plantName" :show-overflow-tooltip="true"/>
|
|
|
+ <el-table-column label="开始日期" align="center" prop="startDate" width="100">
|
|
|
<template slot-scope="scope">
|
|
|
<span>{{ parseTime(scope.row.startDate, '{y}-{m}-{d}') }}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="结束日期" align="center" prop="endDate" width="100">
|
|
|
+ <el-table-column label="结束日期" align="center" prop="endDate" width="100">
|
|
|
<template slot-scope="scope">
|
|
|
<span>{{ parseTime(scope.row.endDate, '{y}-{m}-{d}') }}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="学时" align="center" prop="classHour" :show-overflow-tooltip="true"/>
|
|
|
- <el-table-column label="具体内容" align="center" prop="classContent" :show-overflow-tooltip="true"/>
|
|
|
+ <el-table-column label="学时" align="center" prop="classHour" :show-overflow-tooltip="true"/>
|
|
|
+ <el-table-column label="具体内容" align="center" prop="classContent" :show-overflow-tooltip="true"/>
|
|
|
+ <el-table-column :label="$t('申请状态')" align="center" prop="approveStatus"
|
|
|
+ :formatter="approveStatusFormat" :show-overflow-tooltip="true"/>
|
|
|
+ <el-table-column label="创建人" align="center" prop="createBy" :show-overflow-tooltip="true"/>
|
|
|
+ <el-table-column label="创建时间" align="center" prop="createdate" width="130">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span>{{ parseTime(scope.row.createdate, '{y}-{m}-{d} {h}:{i}') }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="修改人" align="center" prop="updateBy" :show-overflow-tooltip="true"/>
|
|
|
+ <el-table-column label="修改时间" align="center" prop="updatedate" width="130">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span>{{ parseTime(scope.row.updatedate, '{y}-{m}-{d} {h}:{i}') }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="操作" align="center" fixed="right" class-name="small-padding fixed-width" width="80">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-button
|
|
|
+ size="mini"
|
|
|
+ type="text"
|
|
|
+ icon="el-icon-edit"
|
|
|
+ @click="handleUpdate(scope.row)"
|
|
|
+ v-hasPermi="['spec:plan:edit']"
|
|
|
+ v-if="scope.row.editFlag != 0"
|
|
|
+ >修改</el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
</el-table>
|
|
|
</el-form-item>
|
|
|
<el-row>
|
|
|
|
|
|
</el-row>
|
|
|
- <el-form-item :label="$t('申请时间')" prop="creattime">
|
|
|
+ <el-form-item :label="$t('申请时间')" prop="creattime">
|
|
|
<el-input v-model="dataForm.creattime" disabled></el-input>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
@@ -41,7 +78,58 @@
|
|
|
<el-button v-if="!this.taskForm.taskId == ''" type="primary" @click="dataFormSubmit(1)" :disabled="submitDisabled">{{$t('批准')}}</el-button>
|
|
|
<el-button v-if="!this.taskForm.taskId == ''" type="danger" @click="dataFormSubmit(0)" :disabled="submitDisabled">{{$t('拒绝')}}</el-button>
|
|
|
</span>
|
|
|
+ <!-- 添加或修改培训计划对话框 -->
|
|
|
+ <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
|
|
+
|
|
|
+ <el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
|
|
+ <el-form-item label="培训员工" prop="staffId" >
|
|
|
+ <el-select v-model="form.staffId" placeholder="请选择学员" disabled>
|
|
|
+ <el-option
|
|
|
+ v-for="successor in successorOptions"
|
|
|
+ :key="successor.key"
|
|
|
+ :label="successor.value"
|
|
|
+ :value="successor.key"
|
|
|
+ ></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
|
|
|
+ <el-form-item label="培训内容" prop="plantName">
|
|
|
+ <el-input v-model="form.plantName" placeholder="请输入培训内容" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="开始日期" prop="startDate">
|
|
|
+ <el-date-picker clearable size="small" style="width: 200px"
|
|
|
+ v-model="form.startDate"
|
|
|
+ type="date"
|
|
|
+ value-format="yyyy-MM-dd"
|
|
|
+ placeholder="选择开始日期">
|
|
|
+ </el-date-picker>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="结束日期" prop="endDate">
|
|
|
+ <el-date-picker clearable size="small" style="width: 200px"
|
|
|
+ v-model="form.endDate"
|
|
|
+ type="date"
|
|
|
+ value-format="yyyy-MM-dd"
|
|
|
+ placeholder="选择结束日期">
|
|
|
+ </el-date-picker>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="学时" prop="classHour">
|
|
|
+ <el-input v-model="form.classHour" placeholder="请输入学时" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="具体内容">
|
|
|
+ <el-input
|
|
|
+ type="textarea"
|
|
|
+ :rows="6"
|
|
|
+ placeholder="请输入内容"
|
|
|
+ v-model="form.classContent">
|
|
|
+ </el-input>
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
+ </el-form>
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
+ <el-button type="primary" @click="submitForm">确 定</el-button>
|
|
|
+ <el-button @click="cancel2">取 消</el-button>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
</el-dialog>
|
|
|
</template>
|
|
|
|
|
@@ -50,6 +138,7 @@
|
|
|
|
|
|
import {getStapproveInfo, handleApprove} from "@/api/training/spec/stapprove";
|
|
|
import {getHistorylist} from "@/api/ehs/approvedanger";
|
|
|
+ import {addPlan, getPlan, updatePlan} from "@/api/training/spec/plan";
|
|
|
|
|
|
export default {
|
|
|
name: "spec-training-plan",
|
|
@@ -59,7 +148,13 @@
|
|
|
loading: true,
|
|
|
// 总条数
|
|
|
total: 0,
|
|
|
+ // 是否显示弹出层
|
|
|
+ open: false,
|
|
|
+ title: "",
|
|
|
approvedangerList: [],
|
|
|
+ // 学员列表
|
|
|
+ successorOptions: [],
|
|
|
+ approveStatusOptions: [],
|
|
|
recordVisible: false,
|
|
|
// 遮罩层
|
|
|
historyLoading: false,
|
|
@@ -67,6 +162,7 @@
|
|
|
historyList: [],
|
|
|
visible: false,
|
|
|
planList: [],
|
|
|
+ yearplanList: [],
|
|
|
dataList: [],
|
|
|
fileTips: '',
|
|
|
showDelay: false,
|
|
@@ -125,6 +221,11 @@
|
|
|
pType: 'traning',
|
|
|
pId: null
|
|
|
},
|
|
|
+ // 表单参数
|
|
|
+ form: {},
|
|
|
+ // 表单校验
|
|
|
+ rules: {
|
|
|
+ },
|
|
|
dataRule: {
|
|
|
approveType: [
|
|
|
{ required: true, message: this.$t('approveType') + this.$t('notEmpty'), trigger: 'blur' }
|
|
@@ -147,7 +248,9 @@
|
|
|
}
|
|
|
},
|
|
|
created() {
|
|
|
-
|
|
|
+ this.getDicts("spec_training_approve_status").then(response => {
|
|
|
+ this.approveStatusOptions = response.data;
|
|
|
+ });
|
|
|
},
|
|
|
methods: {
|
|
|
init (id, taskId, processId,taskName) {
|
|
@@ -165,10 +268,14 @@
|
|
|
this.taskForm.businessKey = response.data.id
|
|
|
this.dataForm.creattime = response.data.creattime
|
|
|
this.planList = response.data.planList
|
|
|
+ this.yearplanList = [response.data.yearplan]
|
|
|
});
|
|
|
|
|
|
},
|
|
|
-
|
|
|
+ // 申请状态字典翻译
|
|
|
+ approveStatusFormat(row, column) {
|
|
|
+ return this.selectDictLabel(this.approveStatusOptions, row.approveStatus);
|
|
|
+ },
|
|
|
// 取消按钮
|
|
|
cancel() {
|
|
|
this.visible = false;
|
|
@@ -203,7 +310,15 @@
|
|
|
};
|
|
|
this.resetForm("form");
|
|
|
},
|
|
|
-
|
|
|
+ /** 修改按钮操作 */
|
|
|
+ handleUpdate(row) {
|
|
|
+ const id = row.id || this.ids
|
|
|
+ getPlan(id).then(response => {
|
|
|
+ this.form = response.data;
|
|
|
+ this.open = true;
|
|
|
+ this.title = "修改培训计划";
|
|
|
+ });
|
|
|
+ },
|
|
|
/** 提交按钮 */
|
|
|
// 表单提交
|
|
|
dataFormSubmit (val) {
|
|
@@ -230,11 +345,25 @@
|
|
|
this.comment = ''
|
|
|
})
|
|
|
},
|
|
|
- recordHandle(devList,dataForm){
|
|
|
- this.recordVisible = true
|
|
|
- this.$nextTick(() => {
|
|
|
- this.$refs.recordDeal.init(devList,dataForm);
|
|
|
- })
|
|
|
+ /** 提交按钮 */
|
|
|
+ submitForm() {
|
|
|
+ this.$refs["form"].validate(valid => {
|
|
|
+ if (valid) {
|
|
|
+ if (this.form.id != null) {
|
|
|
+ updatePlan(this.form).then(response => {
|
|
|
+ this.msgSuccess("修改成功");
|
|
|
+ this.open = false;
|
|
|
+ // this.getList();
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+ /** 取消按钮 */
|
|
|
+ cancel2() {
|
|
|
+ this.open = false;
|
|
|
+ this.reset();
|
|
|
},
|
|
|
}
|
|
|
}
|