|
|
@@ -330,7 +330,7 @@
|
|
|
size="mini"
|
|
|
type="text"
|
|
|
icon="el-icon-delete"
|
|
|
- @click="onDel(r.row.id, r.row.planName)"
|
|
|
+ @click="onDel(r.row)"
|
|
|
v-hasPermi="['system:user:remove']"
|
|
|
>删除</el-button
|
|
|
>
|
|
|
@@ -355,6 +355,7 @@
|
|
|
:ruleTypeOptions="dict.type.rule_type"
|
|
|
></dialog-edit>
|
|
|
<DialogDistribute ref="dialogDistribute" @select="sel"></DialogDistribute>
|
|
|
+ <DialogThreeState ref="DialogThreeState"> </DialogThreeState>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
@@ -366,6 +367,7 @@ import DialogEdit from "./dialog.edit";
|
|
|
import * as api from "@/api/resumption/plan";
|
|
|
import { statusOptions, getLabel } from "./../../commonOption";
|
|
|
import { allRole } from "@/api/system/role";
|
|
|
+import DialogThreeState from "@/components/message/threeStateMessageBox.vue";
|
|
|
export default {
|
|
|
name: "resumptionplan",
|
|
|
dicts: [
|
|
|
@@ -380,6 +382,7 @@ export default {
|
|
|
DialogEdit,
|
|
|
OrgTree,
|
|
|
DialogDistribute,
|
|
|
+ DialogThreeState,
|
|
|
},
|
|
|
data() {
|
|
|
const { params, query } = this.$route;
|
|
|
@@ -462,24 +465,22 @@ export default {
|
|
|
// return false;
|
|
|
// },
|
|
|
showPublish(row) {
|
|
|
- //可以下发:本机构创建+所属机构是自己+状态为草稿、停用的计划
|
|
|
- //可以下发:所属机构是自己,创建机构不是自己,状态为草稿、停用且上级计划下发时,本计划设置为禁用
|
|
|
+ //可以下发:本机构创建+状态为草稿、停用的计划
|
|
|
if (
|
|
|
row.planCreateOrgId == this.orgId &&
|
|
|
- row.planOfOrgId == this.orgId &&
|
|
|
(row.planStatus == 0 || row.planStatus == 2)
|
|
|
) {
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
- if (
|
|
|
- row.planOfOrgId == this.orgId &&
|
|
|
- row.planCreateOrgId != this.orgId &&
|
|
|
- (row.planStatus == 0 || row.planStatus == 2) &&
|
|
|
- row.distributePlanStatus == 0
|
|
|
- ) {
|
|
|
- return true;
|
|
|
- }
|
|
|
+ // if (
|
|
|
+ // row.planOfOrgId == this.orgId &&
|
|
|
+ // row.planCreateOrgId != this.orgId &&
|
|
|
+ // (row.planStatus == 0 || row.planStatus == 2) &&
|
|
|
+ // row.distributePlanStatus == 0
|
|
|
+ // ) {
|
|
|
+ // return true;
|
|
|
+ // }
|
|
|
|
|
|
return false;
|
|
|
},
|
|
|
@@ -488,25 +489,21 @@ export default {
|
|
|
return row.planCreateOrgId == this.orgId;
|
|
|
},
|
|
|
showWithDraw(row) {
|
|
|
- //本机构创建+所属机构是自己+状态为使用中
|
|
|
- //不是本机构创建+所属机构是自己+状态为使用中+上级下发时状态默认为禁用
|
|
|
- if (
|
|
|
- row.planCreateOrgId == this.orgId &&
|
|
|
- row.planOfOrgId == this.orgId &&
|
|
|
- row.planStatus == 1
|
|
|
- ) {
|
|
|
- return true;
|
|
|
- }
|
|
|
+ //本机构创建是自己+状态为使用中
|
|
|
|
|
|
- if (
|
|
|
- row.planOfOrgId == this.orgId &&
|
|
|
- row.planCreateOrgId != this.orgId &&
|
|
|
- row.planStatus == 1 &&
|
|
|
- row.distributePlanStatus == 0
|
|
|
- ) {
|
|
|
+ if (row.planCreateOrgId == this.orgId && row.planStatus == 1) {
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
+ // if (
|
|
|
+ // row.planOfOrgId == this.orgId &&
|
|
|
+ // row.planCreateOrgId != this.orgId &&
|
|
|
+ // row.planStatus == 1 &&
|
|
|
+ // row.distributePlanStatus == 0
|
|
|
+ // ) {
|
|
|
+ // return true;
|
|
|
+ // }
|
|
|
+
|
|
|
return false;
|
|
|
},
|
|
|
// //已完成下发的计划不显示下发按钮
|
|
|
@@ -532,8 +529,16 @@ export default {
|
|
|
// },
|
|
|
//开始撤回
|
|
|
chhuile(row) {
|
|
|
+ let msg = "";
|
|
|
+ if (row.taskHasCompleted == 1) {
|
|
|
+ msg =
|
|
|
+ "本次操作将对下周期及以后任务生效,对当前及历史任务不造成影响,是否确认提交?";
|
|
|
+ } else {
|
|
|
+ msg =
|
|
|
+ "本次操作将对当前轮次及以后任务生效,并删除所有历史未完成任务,是否确认提交?";
|
|
|
+ }
|
|
|
this.$modal
|
|
|
- .confirm("确认撤回?", "提示")
|
|
|
+ .confirm(msg, "提示")
|
|
|
.then(() => {
|
|
|
// 用户点击了确认按钮
|
|
|
// console.log("执行操作...");
|
|
|
@@ -555,10 +560,21 @@ export default {
|
|
|
// }
|
|
|
// return false;
|
|
|
// },
|
|
|
- sel(selectList) {
|
|
|
+ sel(selectList, row) {
|
|
|
this.loading = true;
|
|
|
- api.distribute(selectList).then((response) => {
|
|
|
- this.getList();
|
|
|
+ let msg = "";
|
|
|
+ if (row.planStatus == 0) {
|
|
|
+ msg = "是否立即生成任务?";
|
|
|
+ } else {
|
|
|
+ msg = "任务内容是否从当前周期生效";
|
|
|
+ }
|
|
|
+ this.$refs["DialogThreeState"].show(msg, async (state) => {
|
|
|
+ if (state == 0 || state == 1) {
|
|
|
+ await api.distribute(selectList, state == 1).then((response) => {
|
|
|
+ this.getList();
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
this.loading = false;
|
|
|
});
|
|
|
},
|
|
|
@@ -600,38 +616,48 @@ export default {
|
|
|
onEdit(id, other = {}) {
|
|
|
this.$refs.editDialog.show(id, other);
|
|
|
},
|
|
|
- onChildPlanDistribute(row) {
|
|
|
+ onHSPlanDistribute(row) {
|
|
|
+ let msg = "";
|
|
|
+ if (row.planStatus == 0) {
|
|
|
+ msg = "是否立即生成任务?";
|
|
|
+ } else {
|
|
|
+ msg = "是否立即生效";
|
|
|
+ }
|
|
|
this.$modal
|
|
|
- .confirm("是否下发!", "提示")
|
|
|
+ .confirm(msg, "提示")
|
|
|
.then(() => {
|
|
|
// 用户点击了确认按钮
|
|
|
console.log("执行操作...");
|
|
|
- this.loading = true;
|
|
|
- api
|
|
|
- .distributeCheHui(row.id)
|
|
|
- .then((response) => {
|
|
|
- // console.log(response, "then");
|
|
|
- if (response.data == 0) {
|
|
|
- this.loading = false;
|
|
|
- } else {
|
|
|
- this.getList();
|
|
|
- this.loading = false;
|
|
|
- }
|
|
|
- })
|
|
|
- .catch((response) => {
|
|
|
- // console.log(response, "catch");
|
|
|
- this.getList();
|
|
|
- this.loading = false;
|
|
|
- });
|
|
|
+ distributeHS(row.id, true);
|
|
|
})
|
|
|
.catch(() => {
|
|
|
// 用户点击了取消按钮
|
|
|
- console.log("取消操作...");
|
|
|
+ // console.log("取消操作...");
|
|
|
+ distributeHS(row.id, false);
|
|
|
+ });
|
|
|
+ },
|
|
|
+ distributeHS(id, immediateEffect) {
|
|
|
+ this.loading = true;
|
|
|
+ api
|
|
|
+ .distributeHS(row.id, true)
|
|
|
+ .then((response) => {
|
|
|
+ // console.log(response, "then");
|
|
|
+ if (response.data == 0) {
|
|
|
+ this.loading = false;
|
|
|
+ } else {
|
|
|
+ this.getList();
|
|
|
+ this.loading = false;
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch((response) => {
|
|
|
+ // console.log(response, "catch");
|
|
|
+ this.getList();
|
|
|
+ this.loading = false;
|
|
|
});
|
|
|
},
|
|
|
showDialogDistribute(row) {
|
|
|
if (row.planOfOrgType == 3) {
|
|
|
- this.onChildPlanDistribute(row);
|
|
|
+ this.onHSPlanDistribute(row);
|
|
|
} else {
|
|
|
this.$refs.dialogDistribute.show(row);
|
|
|
}
|
|
|
@@ -655,15 +681,27 @@ export default {
|
|
|
// this.$refs.dialogDistribute.show(row);
|
|
|
// });
|
|
|
},
|
|
|
- async onDel(id, name) {
|
|
|
+ async onDel(row) {
|
|
|
+ let msg = "";
|
|
|
+ if (row.planStatus == 0) {
|
|
|
+ msg = '是否确认删除名称为"' + row.planName + '"的任务?';
|
|
|
+ } else {
|
|
|
+ if (row.taskHasCompleted == 1) {
|
|
|
+ msg =
|
|
|
+ "本次操作将对下周期及以后任务生效,对当前及历史任务不造成影响,是否确认提交?";
|
|
|
+ } else {
|
|
|
+ msg =
|
|
|
+ "本次操作将对当前轮次及以后任务生效,并删除所有历史未完成任务,是否确认提交?";
|
|
|
+ }
|
|
|
+ }
|
|
|
this.$modal
|
|
|
- .confirm('是否确认删除名称为"' + name + '"的数据项?')
|
|
|
+ .confirm(msg)
|
|
|
.then(() => {
|
|
|
// 用户点击了确认按钮
|
|
|
console.log("执行操作...");
|
|
|
this.loading = true;
|
|
|
api
|
|
|
- .delelte(id)
|
|
|
+ .del(row.id)
|
|
|
.then(() => {
|
|
|
this.getList();
|
|
|
this.loading = false;
|
|
|
@@ -676,6 +714,7 @@ export default {
|
|
|
.catch(() => {
|
|
|
// 用户点击了取消按钮
|
|
|
console.log("取消操作...");
|
|
|
+ this.loading = false;
|
|
|
});
|
|
|
},
|
|
|
// 多选框选中数据
|
|
|
@@ -689,7 +728,7 @@ export default {
|
|
|
this.resetForm("search");
|
|
|
this.queryParams.orgId = this.orgId;
|
|
|
this.queryParams.checkSub = false;
|
|
|
- this.$refs["orgTree"].setCheckSub(this.queryParams.checkSub)
|
|
|
+ this.$refs["orgTree"].setCheckSub(this.queryParams.checkSub);
|
|
|
// this.$refs.tree.setCurrentKey(null);
|
|
|
this.getList();
|
|
|
},
|