|
|
@@ -108,7 +108,8 @@
|
|
|
icon="el-icon-search"
|
|
|
size="mini"
|
|
|
@click="handleQuery"
|
|
|
- >搜索</el-button
|
|
|
+ >搜索
|
|
|
+ </el-button
|
|
|
>
|
|
|
</el-col>
|
|
|
<el-col :span="1.5">
|
|
|
@@ -117,7 +118,8 @@
|
|
|
icon="el-icon-refresh"
|
|
|
size="mini"
|
|
|
@click="resetQuery"
|
|
|
- >重置</el-button
|
|
|
+ >重置
|
|
|
+ </el-button
|
|
|
>
|
|
|
</el-col>
|
|
|
<el-col :span="1.5">
|
|
|
@@ -127,7 +129,7 @@
|
|
|
size="mini"
|
|
|
@click="handleAdd"
|
|
|
v-hasPermi="['core:plan:add']"
|
|
|
- >新增任务
|
|
|
+ >新增任务
|
|
|
</el-button>
|
|
|
</el-col>
|
|
|
<!-- <el-col :span="1.5">
|
|
|
@@ -166,7 +168,7 @@
|
|
|
row-key="id"
|
|
|
>
|
|
|
<!-- :tree-props="{ children: 'children' }" -->
|
|
|
- <el-table-column label="序号" align="center" prop="no" width="60" />
|
|
|
+ <el-table-column label="序号" align="center" prop="no" width="60"/>
|
|
|
<el-table-column
|
|
|
label="任务名称"
|
|
|
align="left"
|
|
|
@@ -263,7 +265,7 @@
|
|
|
icon="el-icon-arrow-down"
|
|
|
@click="handlePublish(scope.row)"
|
|
|
v-hasPermi="['core:plan:edit']"
|
|
|
- >下发
|
|
|
+ >下发
|
|
|
</el-button>
|
|
|
<el-button
|
|
|
v-if="checkCanRevocation(scope.row)"
|
|
|
@@ -272,7 +274,7 @@
|
|
|
icon="el-icon-top-left"
|
|
|
@click="handleRevocation(scope.row)"
|
|
|
v-hasPermi="['core:plan:edit']"
|
|
|
- >撤回
|
|
|
+ >撤回
|
|
|
</el-button>
|
|
|
<el-button
|
|
|
v-if="checkCanEdit(scope.row)"
|
|
|
@@ -281,7 +283,7 @@
|
|
|
icon="el-icon-edit-outline"
|
|
|
@click="handleUpdate(scope.row)"
|
|
|
v-hasPermi="['core:plan:edit']"
|
|
|
- >编辑
|
|
|
+ >编辑
|
|
|
</el-button>
|
|
|
<el-button
|
|
|
v-if="checkCanDel(scope.row)"
|
|
|
@@ -290,7 +292,7 @@
|
|
|
icon="el-icon-delete"
|
|
|
@click="handleDelete(scope.row)"
|
|
|
v-hasPermi="['core:plan:remove']"
|
|
|
- >删除
|
|
|
+ >删除
|
|
|
</el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
@@ -327,23 +329,23 @@
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
-<!-- <el-col :span="12">
|
|
|
- <el-form-item label="培训类型" prop="type">
|
|
|
- <el-select
|
|
|
- style="width: 100%"
|
|
|
- v-model="form.type"
|
|
|
- placeholder="请选择培训类型"
|
|
|
- @change="eduTypeSelected()"
|
|
|
- >
|
|
|
- <el-option
|
|
|
- v-for="dict in dict.type.edu_training_type"
|
|
|
- :key="dict.value"
|
|
|
- :label="dict.label"
|
|
|
- :value="parseInt(dict.value)"
|
|
|
- ></el-option>
|
|
|
- </el-select>
|
|
|
- </el-form-item>
|
|
|
- </el-col>-->
|
|
|
+ <!-- <el-col :span="12">
|
|
|
+ <el-form-item label="培训类型" prop="type">
|
|
|
+ <el-select
|
|
|
+ style="width: 100%"
|
|
|
+ v-model="form.type"
|
|
|
+ placeholder="请选择培训类型"
|
|
|
+ @change="eduTypeSelected()"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="dict in dict.type.edu_training_type"
|
|
|
+ :key="dict.value"
|
|
|
+ :label="dict.label"
|
|
|
+ :value="parseInt(dict.value)"
|
|
|
+ ></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>-->
|
|
|
</el-row>
|
|
|
<el-row>
|
|
|
<el-col :span="12">
|
|
|
@@ -413,19 +415,19 @@
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
<el-row>
|
|
|
- <el-col :span="12" v-show="showBuildTaskNow()">
|
|
|
+<!-- <el-col :span="12" v-show="showBuildTaskNow()">
|
|
|
<el-form-item label="立即生效" prop="buildTaskNow">
|
|
|
<el-checkbox v-model="form.buildTaskNow">
|
|
|
默认从下个周期生成任务,
|
|
|
- <br />
|
|
|
+ <br/>
|
|
|
勾选后从当前周期立即生成任务
|
|
|
- <!-- <el-popover placement="top-start" title="" width="200" trigger="hover"
|
|
|
+ <!– <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-popover>–>
|
|
|
</el-checkbox>
|
|
|
</el-form-item>
|
|
|
- </el-col>
|
|
|
+ </el-col>-->
|
|
|
<el-col :span="12">
|
|
|
<el-form-item label="受训机构类型" prop="execOrgType">
|
|
|
<el-select
|
|
|
@@ -443,8 +445,7 @@
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
- </el-row>
|
|
|
- <el-row>
|
|
|
+
|
|
|
<!-- <el-col :span="12">
|
|
|
<el-form-item v-if="this.form.id" label="计划状态" prop="planStatus">
|
|
|
<el-select style="width: 100%" v-model="form.planStatus" placeholder="请选择计划状态">
|
|
|
@@ -453,7 +454,7 @@
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
</el-col>-->
|
|
|
- <el-col :span="24">
|
|
|
+ <el-col :span="12">
|
|
|
<el-form-item
|
|
|
v-show="form.execOrgType"
|
|
|
label="受训机构"
|
|
|
@@ -497,7 +498,8 @@
|
|
|
<el-col :span="12">
|
|
|
<el-form-item label="">
|
|
|
<el-button type="primary" @click="showSelectFile"
|
|
|
- >选取知识库文件</el-button
|
|
|
+ >选取知识库文件
|
|
|
+ </el-button
|
|
|
>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
@@ -509,12 +511,9 @@
|
|
|
<el-button @click="cancel">取 消</el-button>
|
|
|
</div>
|
|
|
</DialogCom>
|
|
|
- <DialogSelectFile
|
|
|
- ref="DialogSelectFile"
|
|
|
- :defaultSelect="defaultSelect"
|
|
|
- @select="fileSelected"
|
|
|
- :orgId="orgId"
|
|
|
- ></DialogSelectFile>
|
|
|
+ <DialogSelectFile ref="DialogSelectFile" :defaultSelect="defaultSelect" @select="fileSelected"
|
|
|
+ :orgId="orgId"></DialogSelectFile>
|
|
|
+ <DialogThreeState ref="DialogThreeState"></DialogThreeState>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
@@ -533,12 +532,15 @@ import {
|
|
|
import OrgTreeSelect from "@/components/orgTreeSelect";
|
|
|
import tableList from "@/mixins/tableList";
|
|
|
import OrgTree from "@/components/orgTree/orgQuerySelector.vue";
|
|
|
-import { deptTreeSelect } from "@/api/system/public";
|
|
|
+import {deptTreeSelect} from "@/api/system/public";
|
|
|
import KFileUpload from "@/components/K-FileUpload/index.vue";
|
|
|
import DialogSelectFile from "./dialog.select.file.vue";
|
|
|
import dayjs from "dayjs";
|
|
|
import KTextarea from "@/components/common/textarea.vue";
|
|
|
-import { mapGetters } from "vuex";
|
|
|
+import {mapGetters} from "vuex";
|
|
|
+import DialogThreeState from "@/components/message/threeStateMessageBox.vue";
|
|
|
+import * as api from "@/api/resumption/plan";
|
|
|
+
|
|
|
export default {
|
|
|
name: "Plan",
|
|
|
dicts: [
|
|
|
@@ -553,6 +555,7 @@ export default {
|
|
|
KFileUpload,
|
|
|
DialogSelectFile,
|
|
|
KTextarea,
|
|
|
+ DialogThreeState,
|
|
|
},
|
|
|
mixins: [tableList],
|
|
|
data() {
|
|
|
@@ -597,25 +600,25 @@ export default {
|
|
|
// 表单校验
|
|
|
rules: {
|
|
|
planName: [
|
|
|
- { required: true, message: "任务名称不能为空", trigger: "blur" },
|
|
|
+ {required: true, message: "任务名称不能为空", trigger: "blur"},
|
|
|
],
|
|
|
type: [
|
|
|
- { required: true, message: "培训类型不能为空", trigger: "blur" },
|
|
|
+ {required: true, message: "培训类型不能为空", trigger: "blur"},
|
|
|
],
|
|
|
planCycle: [
|
|
|
- { required: true, message: "任务周期不能为空", trigger: "blur" },
|
|
|
+ {required: true, message: "任务周期不能为空", trigger: "blur"},
|
|
|
],
|
|
|
execTimes: [
|
|
|
- { required: true, message: "培训次数不能为空", trigger: "blur" },
|
|
|
+ {required: true, message: "培训次数不能为空", trigger: "blur"},
|
|
|
],
|
|
|
planStatus: [
|
|
|
- { required: true, message: "计划状态不能为空", trigger: "blur" },
|
|
|
+ {required: true, message: "计划状态不能为空", trigger: "blur"},
|
|
|
],
|
|
|
execOrgType: [
|
|
|
- { required: true, message: "受训机构类型不能为空", trigger: "blur" },
|
|
|
+ {required: true, message: "受训机构类型不能为空", trigger: "blur"},
|
|
|
],
|
|
|
planRoleId: [
|
|
|
- { required: true, message: "培训角色不能为空", trigger: "blur" },
|
|
|
+ {required: true, message: "培训角色不能为空", trigger: "blur"},
|
|
|
],
|
|
|
},
|
|
|
planRoleList: [],
|
|
|
@@ -742,8 +745,7 @@ export default {
|
|
|
/!* && (row.issue != 1 || (row.issue == 1 && row.done != 1))*!/
|
|
|
&& !row.parentId && row.createByTopOrg!=1*/
|
|
|
return (
|
|
|
- (row.standard == 1 || row.standard == 2) &&
|
|
|
- row.done != 1 &&
|
|
|
+ (row.standard == 1 || row.standard == 2) && /*row.done != 1 &&*/
|
|
|
this.checkCanEdit(row)
|
|
|
);
|
|
|
},
|
|
|
@@ -813,6 +815,7 @@ export default {
|
|
|
planRoleId: null,
|
|
|
fileList: null,
|
|
|
standard: null,
|
|
|
+ done: null,
|
|
|
};
|
|
|
this.resetForm("form");
|
|
|
},
|
|
|
@@ -851,8 +854,8 @@ export default {
|
|
|
/** 重置按钮操作 */
|
|
|
resetQuery() {
|
|
|
this.resetForm("queryForm");
|
|
|
- this.queryParams.belongOrgId=this.orgId
|
|
|
- this.queryParams.checkSub=false;
|
|
|
+ this.queryParams.belongOrgId = this.orgId
|
|
|
+ this.queryParams.checkSub = false;
|
|
|
this.$refs["orgTree"].setCheckSub(this.queryParams.checkSub)
|
|
|
this.handleQuery();
|
|
|
},
|
|
|
@@ -898,7 +901,7 @@ export default {
|
|
|
}
|
|
|
this.$refs["form"].validate((valid) => {
|
|
|
if (valid) {
|
|
|
- let request = { ...this.form };
|
|
|
+ let request = {...this.form};
|
|
|
if (this.form.planExecOrgIdList) {
|
|
|
const list = Array.isArray(this.form.planExecOrgIdList)
|
|
|
? this.form.planExecOrgIdList
|
|
|
@@ -908,9 +911,18 @@ export default {
|
|
|
request.planExecOrgIdList = [];
|
|
|
}
|
|
|
if (request.id != null) {
|
|
|
- console.log("updatePlan", request);
|
|
|
+ let msg = "";
|
|
|
+ if (this.form.planStatus == 1) {
|
|
|
+ if (this.form.done == 1) {
|
|
|
+ msg = "因存在已完成任务,本次修改内容将下周期生效,是否确认提交?";
|
|
|
+ } else {
|
|
|
+ msg = "因不存在已完成任务,本次修改内容将立即生效,是否确认提交?";
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ msg = "是否确认修改?";
|
|
|
+ }
|
|
|
this.$modal
|
|
|
- .confirm(this.getMsgStr(request, "修改"))
|
|
|
+ .confirm(msg)
|
|
|
.then(function () {
|
|
|
return updatePlan(request);
|
|
|
})
|
|
|
@@ -920,7 +932,8 @@ export default {
|
|
|
this.getList();
|
|
|
this.$refs["upload"].clearFiles();
|
|
|
})
|
|
|
- .catch(() => {});
|
|
|
+ .catch(() => {
|
|
|
+ });
|
|
|
} else {
|
|
|
addPlan(request).then((response) => {
|
|
|
this.$modal.msgSuccess("新增成功");
|
|
|
@@ -934,9 +947,21 @@ export default {
|
|
|
},
|
|
|
/** 删除按钮操作 */
|
|
|
handleDelete(row) {
|
|
|
+ let msg = "";
|
|
|
+ if (row.planStatus == 0) {
|
|
|
+ msg = '是否确认删除名称为"' + row.planName + '"的任务?';
|
|
|
+ } else {
|
|
|
+ if (row.done == 1) {
|
|
|
+ msg =
|
|
|
+ "本次操作将对下周期及以后任务生效,对当前及历史任务不造成影响,是否确认提交?";
|
|
|
+ } else {
|
|
|
+ msg =
|
|
|
+ "本次操作将对当前轮次及以后任务生效,并删除所有历史未完成任务,是否确认提交?";
|
|
|
+ }
|
|
|
+ }
|
|
|
const ids = row.id || this.ids;
|
|
|
this.$modal
|
|
|
- .confirm(this.getMsgStr(row, "删除"))
|
|
|
+ .confirm(msg)
|
|
|
.then(function () {
|
|
|
return delPlan(ids);
|
|
|
})
|
|
|
@@ -944,21 +969,38 @@ export default {
|
|
|
this.getList();
|
|
|
this.$modal.msgSuccess("删除成功");
|
|
|
})
|
|
|
- .catch(() => {});
|
|
|
+ .catch(() => {
|
|
|
+ });
|
|
|
},
|
|
|
/** 下发计划 */
|
|
|
handlePublish(row) {
|
|
|
- if (row.id != null) {
|
|
|
+ let msg = "";
|
|
|
+ if (row.planStatus == 0) {
|
|
|
+ msg = "请选择从当前轮次或周期开始生成任务?";
|
|
|
+ this.$refs["DialogThreeState"].show(
|
|
|
+ msg,
|
|
|
+ (state) => {
|
|
|
+ if (state == 0 || state == 1) {
|
|
|
+ publishPlan(row.id, state);
|
|
|
+ this.getList();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ yesText: "当前轮次",//1
|
|
|
+ noText: "下周期",//0
|
|
|
+ cancelText: "取消下发",
|
|
|
+ }
|
|
|
+ );
|
|
|
+ } else if (row.planStatus == 2) {
|
|
|
this.$modal
|
|
|
- .confirm(this.getMsgStr(row, "下发"))
|
|
|
- .then(function () {
|
|
|
- return publishPlan(row.id);
|
|
|
+ .confirm("因存在已完成任务,本次任务下发仅支持下周期生成任务", {
|
|
|
+ confirmButtonText: "下周期",
|
|
|
+ canelButtonText: "取消下发",
|
|
|
})
|
|
|
.then(() => {
|
|
|
- this.$modal.msgSuccess("计划下发成功");
|
|
|
+ publishPlan(row.id, 0);
|
|
|
this.getList();
|
|
|
- })
|
|
|
- .catch(() => {});
|
|
|
+ });
|
|
|
}
|
|
|
},
|
|
|
getMsgStr(row, type) {
|
|
|
@@ -970,18 +1012,27 @@ export default {
|
|
|
},
|
|
|
//撤回计划
|
|
|
handleRevocation(row) {
|
|
|
- if (row.id != null) {
|
|
|
- this.$modal
|
|
|
- .confirm("撤回计划会清除本周期所有任务,是否继续?")
|
|
|
- .then(function () {
|
|
|
- return revocationPlan(row.id);
|
|
|
- })
|
|
|
- .then(() => {
|
|
|
- this.$modal.msgSuccess("计划撤回成功");
|
|
|
- this.getList();
|
|
|
- })
|
|
|
- .catch(() => {});
|
|
|
+ let msg = "";
|
|
|
+ if (row.done == 1) {
|
|
|
+ msg =
|
|
|
+ "本次操作将对下周期及以后任务生效,对当前及历史任务不造成影响,是否确认提交?";
|
|
|
+ } else {
|
|
|
+ msg =
|
|
|
+ "本次操作将对当前轮次及以后任务生效,并删除所有历史未完成任务,是否确认提交?";
|
|
|
}
|
|
|
+ this.$modal
|
|
|
+ .confirm(msg, "提示")
|
|
|
+ .then(() => {
|
|
|
+ // 用户点击了确认按钮
|
|
|
+ this.loading = true;
|
|
|
+ revocationPlan(row.id).then((response) => {
|
|
|
+ this.getList();
|
|
|
+ this.loading = false;
|
|
|
+ });
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ // 用户点击了取消按钮
|
|
|
+ });
|
|
|
},
|
|
|
/** 导出按钮操作 */
|
|
|
handleExport() {
|
|
|
@@ -1001,8 +1052,8 @@ export default {
|
|
|
let tempArry = [];
|
|
|
let fileNameList = [];
|
|
|
let addFileNameList = [];
|
|
|
- if(this.form.fileList==null) {
|
|
|
- this.form.fileList=[];
|
|
|
+ if (this.form.fileList == null) {
|
|
|
+ this.form.fileList = [];
|
|
|
}
|
|
|
this.form.fileList.forEach((x) => {
|
|
|
let fileObj = JSON.parse(x);
|