|
|
@@ -4,7 +4,7 @@
|
|
|
<!--机构数据-->
|
|
|
<el-col :span="4" :xs="24">
|
|
|
<org-tree v-model="queryParams.belongOrgId" @defaultKey="getDefaultKey" @checkChange="checkChange"
|
|
|
- @click="clickTreeNode" hangsheTree></org-tree>
|
|
|
+ @click="clickTreeNode" hangsheTree :defuaultCheckSub="false"></org-tree>
|
|
|
</el-col>
|
|
|
<!--搜索栏-->
|
|
|
<el-col :span="20" :xs="24">
|
|
|
@@ -23,16 +23,16 @@
|
|
|
</el-form-item>
|
|
|
<el-form-item label="计划状态" prop="planStatus">
|
|
|
<el-select v-model="queryParams.planStatus" placeholder="请选择计划状态" clearable>
|
|
|
- <el-option v-for="dict in dict.type.plan_status" :key="dict.value" :label="dict.label"
|
|
|
+ <el-option v-for="dict in dict.type.edu_plan_status" :key="dict.value" :label="dict.label"
|
|
|
:value="dict.value"/>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
-<!-- <el-form-item label="培训角色" prop="planRoleId">
|
|
|
- <el-select v-model="queryParams.planRoleId" placeholder="请选择培训角色" clearable>
|
|
|
- <el-option v-for="item in planRoleList" :key="item.roleId" :label="item.roleName"
|
|
|
- :value="item.roleId"></el-option>
|
|
|
- </el-select>
|
|
|
- </el-form-item>-->
|
|
|
+ <!-- <el-form-item label="培训角色" prop="planRoleId">
|
|
|
+ <el-select v-model="queryParams.planRoleId" placeholder="请选择培训角色" clearable>
|
|
|
+ <el-option v-for="item in planRoleList" :key="item.roleId" :label="item.roleName"
|
|
|
+ :value="item.roleId"></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>-->
|
|
|
<el-form-item label="计划周期" prop="planCycle">
|
|
|
<el-select v-model="queryParams.planCycle" placeholder="请选择计划周期" clearable>
|
|
|
<el-option v-for="dict in dict.type.edu_plan_cycle" :key="dict.value" :label="dict.label"
|
|
|
@@ -80,7 +80,7 @@
|
|
|
border
|
|
|
height="550"
|
|
|
size="small" :data="planList" @selection-change="handleSelectionChange" row-key="id">
|
|
|
- <!-- :tree-props="{ children: 'children' }" -->
|
|
|
+ <!-- :tree-props="{ children: 'children' }" -->
|
|
|
<el-table-column label="序号" align="center" prop="no" width="60"/>
|
|
|
<el-table-column label="培训主题" align="left" width="200" prop="planName"/>
|
|
|
<el-table-column label="创建机构" align="left" width="180" prop="createOrgName"/>
|
|
|
@@ -90,20 +90,20 @@
|
|
|
<dict-tag :options="dict.type.sys_org_type" :value="scope.row.execOrgType"/>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
-<!-- <el-table-column prop="planRoleNameList" width="180" label="培训角色">
|
|
|
- <template slot-scope="scope">
|
|
|
- <template v-if="scope.row.planRoleNameList">
|
|
|
- <el-tag size="mini" type="success"
|
|
|
- v-for="(item, index) in (scope.row.planRoleNameList || '').split(',')"
|
|
|
- :key="index">
|
|
|
- {{ item }}
|
|
|
- </el-tag>
|
|
|
- </template>
|
|
|
- <template v-else>
|
|
|
- <el-tag size="mini">{{ scope.row.checkOrgTypeText }}</el-tag>
|
|
|
- </template>
|
|
|
- </template>
|
|
|
- </el-table-column>-->
|
|
|
+ <!-- <el-table-column prop="planRoleNameList" width="180" label="培训角色">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <template v-if="scope.row.planRoleNameList">
|
|
|
+ <el-tag size="mini" type="success"
|
|
|
+ v-for="(item, index) in (scope.row.planRoleNameList || '').split(',')"
|
|
|
+ :key="index">
|
|
|
+ {{ item }}
|
|
|
+ </el-tag>
|
|
|
+ </template>
|
|
|
+ <template v-else>
|
|
|
+ <el-tag size="mini">{{ scope.row.checkOrgTypeText }}</el-tag>
|
|
|
+ </template>
|
|
|
+ </template>
|
|
|
+ </el-table-column>-->
|
|
|
<el-table-column label="计划周期" align="center" prop="planCycle">
|
|
|
<template slot-scope="scope">
|
|
|
<dict-tag :options="dict.type.edu_plan_cycle" :value="scope.row.planCycle"/>
|
|
|
@@ -112,7 +112,7 @@
|
|
|
<el-table-column label="培训次数" align="center" prop="execTimes"/>
|
|
|
<el-table-column label="计划状态" align="center" prop="planStatus">
|
|
|
<template slot-scope="scope">
|
|
|
- <dict-tag :options="dict.type.plan_status" :value="scope.row.planStatus"/>
|
|
|
+ <dict-tag :options="dict.type.edu_plan_status" :value="parseInt(scope.row.planStatus)"/>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column label="修改人" align="center" prop="updateBy"/>
|
|
|
@@ -122,6 +122,9 @@
|
|
|
<el-button v-if="checkCanPublish(scope.row)" size="mini" type="text" icon="el-icon-down"
|
|
|
@click="handlePublish(scope.row)" v-hasPermi="['core:plan:edit']">下发
|
|
|
</el-button>
|
|
|
+ <el-button v-if="checkCanRevocation(scope.row)" size="mini" type="text" icon="el-icon-down"
|
|
|
+ @click="handleRevocation(scope.row)" v-hasPermi="['core:plan:edit']">撤回
|
|
|
+ </el-button>
|
|
|
<el-button v-if="checkCanEdit(scope.row)" size="mini" type="text" icon="el-icon-edit-outline"
|
|
|
@click="handleUpdate(scope.row)" v-hasPermi="['core:plan:edit']">编辑
|
|
|
</el-button>
|
|
|
@@ -138,7 +141,7 @@
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
<!-- 添加或修改教育培训计划对话框 -->
|
|
|
- <DialogCom :title="title" :visible.sync="open" @close="cancel" width="850px" height="800px" append-to-body >
|
|
|
+ <DialogCom :title="title" :visible.sync="open" @close="cancel" width="850px" height="800px" append-to-body>
|
|
|
<el-form ref="form" :model="form" :rules="rules" label-width="110px">
|
|
|
<el-row>
|
|
|
<el-col :span="24">
|
|
|
@@ -156,16 +159,27 @@
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
- <el-col :span="12">
|
|
|
- <el-form-item label="机构类型" prop="execOrgType">
|
|
|
- <el-select style="width: 100%" v-model="form.execOrgType" placeholder="请选择执行机构类型" @change="execOrgTypeChanged()">
|
|
|
|
|
|
- <el-option v-for="dict in getUserOrgType" :key="dict.value" :label="dict.label"
|
|
|
- :value="parseInt(dict.value)"></el-option>
|
|
|
|
|
|
- </el-select>
|
|
|
+ <el-col :span="12" v-show="form.planCycle != 0">
|
|
|
+ <el-form-item label="立即生效" prop="buildTaskNow">
|
|
|
+ <el-checkbox v-model="form.buildTaskNow">
|
|
|
+ 默认从下个周期...
|
|
|
+ <el-popover placement="top-start" title="" width="200" trigger="hover"
|
|
|
+ content="默认从下个周期生成任务,勾选后从当前周期立即生成任务">
|
|
|
+ <i class="el-icon-warning-outline change-icon" slot="reference"></i>
|
|
|
+ </el-popover>
|
|
|
+ </el-checkbox>
|
|
|
</el-form-item>
|
|
|
+
|
|
|
</el-col>
|
|
|
+ <!-- <el-col :span="12">
|
|
|
+ <el-form-item label="培训角色" prop="planRoleId">
|
|
|
+ <el-select style="width: 100%" v-model="form.planRoleId" placeholder="请选择" multiple>
|
|
|
+ <el-option v-for="item in roleList" :key="item.id" :label="item.name" :value="item.id"></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>-->
|
|
|
</el-row>
|
|
|
<el-row>
|
|
|
<el-col :span="12" v-show="form.planCycle == 0">
|
|
|
@@ -178,7 +192,8 @@
|
|
|
</el-col>
|
|
|
<el-col :span="12" v-show="form.planCycle == 0">
|
|
|
<el-form-item prop="endDate" label="结束日期">
|
|
|
- <el-date-picker style="width: 100%" v-model="form.endDate" :picker-options="endDatepickerOptions" align="right" type="date"
|
|
|
+ <el-date-picker style="width: 100%" v-model="form.endDate" :picker-options="endDatepickerOptions"
|
|
|
+ align="right" type="date"
|
|
|
placeholder="选择结束日期">
|
|
|
</el-date-picker>
|
|
|
</el-form-item>
|
|
|
@@ -187,9 +202,10 @@
|
|
|
|
|
|
<el-row>
|
|
|
<el-col :span="12">
|
|
|
- <el-form-item label="计划状态" prop="planStatus">
|
|
|
- <el-select style="width: 100%" v-model="form.planStatus" placeholder="请选择计划状态">
|
|
|
- <el-option v-for="dict in dict.type.plan_status" :key="dict.value" :label="dict.label"
|
|
|
+ <el-form-item label="机构类型" prop="execOrgType">
|
|
|
+ <el-select style="width: 100%" v-model="form.execOrgType" placeholder="请选择执行机构类型"
|
|
|
+ @change="execOrgTypeChanged()">
|
|
|
+ <el-option v-for="dict in getUserOrgType" :key="dict.value" :label="dict.label"
|
|
|
:value="parseInt(dict.value)"></el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
@@ -203,36 +219,18 @@
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
<el-row>
|
|
|
- <el-col :span="12" v-show="form.planCycle != 0">
|
|
|
- <el-form-item label="立即生效" prop="buildTaskNow">
|
|
|
- <el-checkbox v-model="form.buildTaskNow">
|
|
|
- 勾选后在当前周期开始生效
|
|
|
- </el-checkbox>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
<el-col :span="12">
|
|
|
-<!-- <el-form-item label="培训角色" prop="planRoleId">
|
|
|
- <el-select style="width: 100%" v-model="form.planRoleId" placeholder="请选择" multiple>
|
|
|
- <el-option v-for="item in roleList" :key="item.id" :label="item.name" :value="item.id"></el-option>
|
|
|
+ <el-form-item v-if="this.form.id" label="计划状态" prop="planStatus">
|
|
|
+ <el-select style="width: 100%" v-model="form.planStatus" placeholder="请选择计划状态">
|
|
|
+ <el-option v-for="dict in dict.type.edu_plan_status" :key="dict.value" :label="dict.label"
|
|
|
+ :value="parseInt(dict.value)"></el-option>
|
|
|
</el-select>
|
|
|
- </el-form-item>-->
|
|
|
+ </el-form-item>
|
|
|
</el-col>
|
|
|
- </el-row>
|
|
|
- <el-row>
|
|
|
- <el-col :span="24">
|
|
|
- <!-- <el-form-item label="培训机构" prop="planExecOrgIdList">
|
|
|
- <tree-select v-model="form.planExecOrgIdList" :options="deptOptions" :show-count="true"
|
|
|
- :normalizer="tenantIdnormalizer" :props="{ checkStrictly: true, label: 'name' }"
|
|
|
- placeholder="请选择培训机构"/>
|
|
|
- </el-form-item>-->
|
|
|
-
|
|
|
+ <el-col :span="12">
|
|
|
<el-form-item v-show="form.execOrgType" label="培训机构" prop="planExecOrgIdList">
|
|
|
- <org-tree-select
|
|
|
- v-model="form.planExecOrgIdList"
|
|
|
- :queryData="form.execOrgType"
|
|
|
- ref="orgTreeSelect"
|
|
|
- :enabledCheckOrgTypes="form.execOrgType"
|
|
|
- :disable="true">
|
|
|
+ <org-tree-select v-model="form.planExecOrgIdList" :queryData="form.execOrgType"
|
|
|
+ ref="orgTreeSelect" :enabledCheckOrgTypes="form.execOrgType" :disable="true">
|
|
|
</org-tree-select>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
@@ -282,7 +280,8 @@ import {
|
|
|
listPlanRole,
|
|
|
publishPlan,
|
|
|
roleList,
|
|
|
- updatePlan
|
|
|
+ updatePlan,
|
|
|
+ revocationPlan
|
|
|
} from "@/api/core/edu/plan";
|
|
|
import OrgTreeSelect from '@/components/orgTreeSelect'
|
|
|
import tableList from "@/mixins/tableList";
|
|
|
@@ -293,7 +292,7 @@ import DialogSelectFile from "./dialog.select.file.vue";
|
|
|
|
|
|
export default {
|
|
|
name: "Plan",
|
|
|
- dicts: ['plan_cycle', 'sys_org_type', 'plan_status', 'edu_plan_cycle'],
|
|
|
+ dicts: ['sys_org_type', 'edu_plan_cycle', 'edu_plan_status'],
|
|
|
components: {OrgTreeSelect, OrgTree, KFileUpload, DialogSelectFile},
|
|
|
mixins: [tableList],
|
|
|
data() {
|
|
|
@@ -331,7 +330,7 @@ export default {
|
|
|
pageNum: 1,
|
|
|
pageSize: 10,
|
|
|
belongOrgId: null,
|
|
|
- checkSub: true
|
|
|
+ checkSub: false
|
|
|
|
|
|
},
|
|
|
formFileListDefualtValue: [],
|
|
|
@@ -374,23 +373,21 @@ export default {
|
|
|
},
|
|
|
};
|
|
|
},
|
|
|
- computed:{
|
|
|
- getUserOrgType(){
|
|
|
- console.log("computed allSysOrgTypes",this.dict.type.sys_org_type,this.$store.getters.orgType);
|
|
|
- let tempArry =[];
|
|
|
- this.dict.type.sys_org_type.forEach(x=>{
|
|
|
- if(Number(x.value)>=this.$store.getters.orgType)
|
|
|
- {
|
|
|
- tempArry.push(x);
|
|
|
- }
|
|
|
- });
|
|
|
- // console.log("computed getUserOrgType",tempArry);
|
|
|
- return tempArry;
|
|
|
- }
|
|
|
+ computed: {
|
|
|
+ getUserOrgType() {
|
|
|
+ let tempArry = [];
|
|
|
+ this.dict.type.sys_org_type.forEach(x => {
|
|
|
+ if (Number(x.value) >= this.$store.getters.orgType) {
|
|
|
+ tempArry.push(x);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ // console.log("computed getUserOrgType",tempArry);
|
|
|
+ return tempArry;
|
|
|
+ }
|
|
|
},
|
|
|
created() {
|
|
|
this.getList();
|
|
|
- // this.initPlanRoleList();
|
|
|
+ // this.initPlanRoleList();
|
|
|
this.orgId = this.$store.getters.orgId;
|
|
|
},
|
|
|
methods: {
|
|
|
@@ -439,21 +436,26 @@ export default {
|
|
|
}
|
|
|
return time.getTime() < new Date(startDate).getTime()
|
|
|
},
|
|
|
+ //草稿状态显示按钮“下发、编辑、删除”,使用中显示按钮“撤回、编辑、删除”,停用状态显示按钮“下发、编辑、删除”;
|
|
|
//已完成下发的计划不显示下发按钮
|
|
|
checkCanPublish(row) {
|
|
|
- if (row.issue == 0 && row.standard == 1 && row.planStatus == 0) {
|
|
|
+ if (row.issue == 0 && row.standard == 1 && (row.planStatus == 0 || row.planStatus == 2)) {
|
|
|
return true
|
|
|
}
|
|
|
return false;
|
|
|
},
|
|
|
- //所属机构为当前用户登录机构时才显示 “编辑、删除”按钮
|
|
|
+ //撤回按钮
|
|
|
+ checkCanRevocation(row) {
|
|
|
+ return row.planStatus == 1 && row.standard == 1 && this.checkCanEdit(row);
|
|
|
+ },
|
|
|
+ //所属机构为当前用户登录机构或等于创建机构时才显示 “编辑、删除”按钮
|
|
|
checkCanEdit(row) {
|
|
|
- return row.belongOrgId == this.$store.getters.orgId
|
|
|
+ return (row.belongOrgId == this.$store.getters.orgId || row.createOrgId == this.$store.getters.orgId)
|
|
|
},
|
|
|
checkCanDel(row) {
|
|
|
- // 计划所属机构=当前登陆人机构 && 创建机构为省联社 && 不是被下发的 && 计划下不存在已有执行任务的情况
|
|
|
- console.log("checkCanDel",row,row.belongOrgId == this.$store.getters.orgId,row.issue != 1,row.done != 1)
|
|
|
- return row.belongOrgId == this.$store.getters.orgId && (row.issue != 1 || (row.issue == 1 && row.done != 1))
|
|
|
+ // 计划所属机构or创建机构 =当前登陆人机构 && 创建机构为省联社 && 不是被下发的 && 计划下不存在已有执行任务的情况
|
|
|
+ return (row.belongOrgId == this.$store.getters.orgId || row.createOrgId == this.$store.getters.orgId)
|
|
|
+ && (row.issue != 1 || (row.issue == 1 && row.done != 1))
|
|
|
},
|
|
|
//省联社下发的计划不显示“删除”按钮
|
|
|
checkCreateByTopOrg(row) {
|
|
|
@@ -511,7 +513,7 @@ export default {
|
|
|
},
|
|
|
// 节点单击事件
|
|
|
clickTreeNode(data) {
|
|
|
- // this.initPlanRoleList();
|
|
|
+ // this.initPlanRoleList();
|
|
|
this.queryParams.belongOrgId = data.id;
|
|
|
this.handleQuery();
|
|
|
},
|
|
|
@@ -558,8 +560,8 @@ export default {
|
|
|
getPlan(id).then(response => {
|
|
|
this.form = response.data;
|
|
|
|
|
|
- //将 this.form.planExecOrgIdList中的元素转为字符串
|
|
|
- if(this.form.planExecOrgIdList == null){
|
|
|
+ //将 this.form.planExecOrgIdList中的元素转为字符串
|
|
|
+ if (this.form.planExecOrgIdList == null) {
|
|
|
this.form.planExecOrgIdList = [];
|
|
|
}
|
|
|
this.form.planExecOrgIdList = this.form.planExecOrgIdList.map(element => element.toString());
|
|
|
@@ -580,11 +582,16 @@ export default {
|
|
|
request.planExecOrgIdList = [];
|
|
|
}
|
|
|
if (request.id != null) {
|
|
|
- updatePlan(request).then(response => {
|
|
|
+ console.log("updatePlan", request)
|
|
|
+ this.$modal.confirm(this.getMsgStr(request,'修改')).then(function () {
|
|
|
+ return updatePlan(request);
|
|
|
+ }).then(() => {
|
|
|
this.$modal.msgSuccess("修改成功");
|
|
|
this.open = false;
|
|
|
this.getList();
|
|
|
+ }).catch(() => {
|
|
|
});
|
|
|
+
|
|
|
} else {
|
|
|
addPlan(request).then(response => {
|
|
|
this.$modal.msgSuccess("新增成功");
|
|
|
@@ -598,7 +605,7 @@ export default {
|
|
|
/** 删除按钮操作 */
|
|
|
handleDelete(row) {
|
|
|
const ids = row.id || this.ids;
|
|
|
- this.$modal.confirm('是否确认删除教育培训计划:' + row.planName).then(function () {
|
|
|
+ this.$modal.confirm(this.getMsgStr(row,'删除')).then(function () {
|
|
|
return delPlan(ids);
|
|
|
}).then(() => {
|
|
|
this.getList();
|
|
|
@@ -609,7 +616,7 @@ export default {
|
|
|
/** 下发计划 */
|
|
|
handlePublish(row) {
|
|
|
if (row.id != null) {
|
|
|
- this.$modal.confirm('是否确认下发该计划?').then(function () {
|
|
|
+ this.$modal.confirm(this.getMsgStr(row,'下发')).then(function () {
|
|
|
return publishPlan(row.id);
|
|
|
}).then(() => {
|
|
|
this.$modal.msgSuccess("计划下发成功");
|
|
|
@@ -618,6 +625,25 @@ export default {
|
|
|
});
|
|
|
}
|
|
|
},
|
|
|
+ getMsgStr(row,type){
|
|
|
+ let str='是否确认'+type+'该计划?';
|
|
|
+ if (row.standard==1){
|
|
|
+ str='此操作将会影响所有行社计划,'+str;
|
|
|
+ }
|
|
|
+ return str;
|
|
|
+ },
|
|
|
+ //撤回计划
|
|
|
+ handleRevocation(row) {
|
|
|
+ if (row.id != null) {
|
|
|
+ this.$modal.confirm(this.getMsgStr(row,'撤回')).then(function () {
|
|
|
+ return revocationPlan(row.id);
|
|
|
+ }).then(() => {
|
|
|
+ this.$modal.msgSuccess("计划撤回成功");
|
|
|
+ this.getList();
|
|
|
+ }).catch(() => {
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
/** 导出按钮操作 */
|
|
|
handleExport() {
|
|
|
this.download('system/plan/export', {
|
|
|
@@ -629,16 +655,15 @@ export default {
|
|
|
},
|
|
|
fileSelected(list) {
|
|
|
if (!list) return;
|
|
|
- let tempArry=[];
|
|
|
+ let tempArry = [];
|
|
|
list.forEach(x => {
|
|
|
- tempArry=tempArry.concat(x.fileList);
|
|
|
+ tempArry = tempArry.concat(x.fileList);
|
|
|
})
|
|
|
- console.log("tempArry",tempArry,this.form.fileList);
|
|
|
- if(this.form.fileList){
|
|
|
- this.formFileListDefualtValue =this.form.fileList.concat(tempArry);
|
|
|
- }
|
|
|
- else{
|
|
|
- this.formFileListDefualtValue =tempArry;
|
|
|
+ console.log("tempArry", tempArry, this.form.fileList);
|
|
|
+ if (this.form.fileList) {
|
|
|
+ this.formFileListDefualtValue = this.form.fileList.concat(tempArry);
|
|
|
+ } else {
|
|
|
+ this.formFileListDefualtValue = tempArry;
|
|
|
}
|
|
|
|
|
|
},
|