jiawuxian 1 жил өмнө
parent
commit
c2ca6de125

+ 15 - 6
src/views/resumption/plan/dialog.edit.vue

@@ -502,7 +502,7 @@ export default {
       );
 
       //行社不能编辑省联社计划的名称;省联社也不能单独编辑子计划的名称
-      r &= (this.formData.planOfOrgId==this.orgId)
+      r &= this.formData.planOfOrgId == this.orgId;
       return r;
     },
     //省联社履职内容不能删除
@@ -801,7 +801,7 @@ export default {
       this.$refs.DialogSelect.show(this.getIteamF());
     },
     onSubmit() {
-      this.$refs.form.validate(async (isValidate) => {        
+      this.$refs.form.validate(async (isValidate) => {
         if (!isValidate) return;
         this.loading = true;
         // this.formData.planStatus = 0;
@@ -824,16 +824,25 @@ export default {
         // this.formData.roleList =
         //   this.selectedValues.length == 0 ? null : this.selectedValues;
         //停用、使用中编辑
-        if (this.formData.planStatus =="1" ) {
+
+        if (this.formData.planStatus == "1") {
+          let msg;
+          let imme;
           if (this.formData.taskHasCompleted == 1) {
-            this.update(this.formData, false);
+            imme = false;
+            msg = "因存在已完成任务,本次修改内容将从下周期生效。";
           } else {
-            this.update(this.formData, true);
+            imme = true;
+            msg = "因不存在已完成任务,本次修改内容将立即生成。";
           }
+
+          this.$modal.confirm(msg).then(() => {
+            this.update(this.formData, imme);
+          });
         } else if (this.formData.planStatus == "2") {
           this.update(this.formData, false);
         } else {
-          this.update(this.formData,false);
+          this.update(this.formData, false);
         }
       });
     },

+ 26 - 23
src/views/resumption/plan/index.vue

@@ -455,6 +455,10 @@ export default {
     //   return false;
     // },
     showPublish(row) {
+      //有父计划且父计划不是使用中状态,不能下发
+      if (row.parentStatus != 1 && row.parentId) {
+        return false;
+      }
       //可以下发:本机构创建+状态为草稿、停用的计划
       if (
         row.planCreateOrgId == this.orgId &&
@@ -521,11 +525,9 @@ export default {
     chhuile(row) {
       let msg = "";
       if (row.taskHasCompleted == 1) {
-        msg =
-          "本次操作将对下周期及以后任务生效,对当前及历史任务不造成影响,是否确认提交?";
+        msg = "因不存在已完成任务,撤回后将删除所有生成任务?";
       } else {
-        msg =
-          "本次操作将对当前轮次及以后任务生效,并删除所有历史未完成任务,是否确认提交?";
+        msg = "因存在已完成任务,撤回后下周期起将不再生成任务?";
       }
       this.$modal
         .confirm(msg, "提示")
@@ -553,7 +555,7 @@ export default {
     sel(selectList, row) {
       let msg = "";
       if (row.planStatus == 0) {
-        msg = "请选择立即生成或下个周期开始生成任务?";
+        msg = "请选择下发后立即生成或下周期生成任务。";
         this.$refs["DialogThreeState"].show(
           msg,
           (state) => {
@@ -564,15 +566,12 @@ export default {
           {
             yesText: "立即生成",
             noText: "下周期",
-            cancelText: "取消下发",
+            cancelText: "取消",
           }
         );
       } else if (row.planStatus == 2) {
         this.$modal
-          .confirm("因存在已完成任务,本次任务下发仅支持下周期生成任务", {
-            confirmButtonText: "下周期",
-            canelButtonText: "取消下发",
-          })
+          .confirm("因存在已完成任务,是否确定从下周期生成任务?")
           .then(() => {
             this.distributeInner(selectList, false);
           });
@@ -592,11 +591,10 @@ export default {
           this.loading = false;
         });
     },
-    
-    onHSPlanDistribute(row) {    
 
+    onHSPlanDistribute(row) {
       if (row.planStatus == 0) {
-        let   msg = "请选择下发后立即生成或下周期生成任务?";
+        let msg = "请选择下发后立即生成或下周期生成任务";
         this.$refs["DialogThreeState"].show(
           msg,
           (state) => {
@@ -612,10 +610,7 @@ export default {
         );
       } else if (row.planStatus == 2) {
         this.$modal
-          .confirm("因存在已完成任务,是否确定从下周期生成任务", {
-            confirmButtonText: "确定",
-            canelButtonText: "取消",
-          })
+          .confirm("因存在已完成任务,是否确定从下周期生成任务?")
           .then(() => {
             this.distributeHS(row.id, false);
           });
@@ -710,13 +705,21 @@ export default {
       let msg = "";
       if (row.planStatus == 0) {
         msg = '是否确认删除名称为"' + row.planName + '"的任务?';
-      } else {
-        if (row.taskHasCompleted == 1) {
-          msg =
-            "本次操作将对下周期及以后任务生效,对当前及历史任务不造成影响,是否确认提交?";
+      } else if (row.planStatus == 1) {
+        if (row.planCycle == 1) {
+          msg = "本次删除将强制删除今日所有任务?";
+        } else {
+          msg = "本次删除将强制删除当前任务时间及以后所有任务";
+        }
+      } else if (row.planStatus == 2) {
+        if (row.hasTaskCurrentCycle) {
+          if (row.planCycle == 1) {
+            msg = "本次删除将强制删除今日所有任务?";
+          } else {
+            msg = "本次删除将强制删除当前任务时间及以后所有任务";
+          }
         } else {
-          msg =
-            "本次操作将对当前轮次及以后任务生效,并删除所有历史未完成任务,是否确认提交?";
+          msg = '是否确认删除名称为"' + row.planName + '"的任务?';
         }
       }
       this.$modal

+ 20 - 10
src/views/safetycheck/plan/dialog.edit.vue

@@ -260,7 +260,9 @@
             />
           </el-form-item>
         </el-form>
-        <el-button @click="openSelect"><span class="requiredlabel">选择检查内容</span> </el-button>
+        <el-button @click="openSelect"
+          ><span class="requiredlabel">选择检查内容</span>
+        </el-button>
         <el-button @click="deleteSelected">批量删除</el-button>
         <el-table
           :data="tableData"
@@ -570,7 +572,7 @@ export default {
         this.formData.planStatus == null || this.formData.planStatus == "0"
       );
       //行社不能编辑省联社计划的名称;省联社也不能单独编辑子计划的名称
-      r &= (this.formData.planOfOrgId==this.orgId)
+      r &= this.formData.planOfOrgId == this.orgId;
       return r;
     },
     NowBuild() {
@@ -656,15 +658,15 @@ export default {
       };
     },
     getRolesByOrg() {
-      console.log(this.formData.execOrgType,"this.formData.execOrgType")
+      console.log(this.formData.execOrgType, "this.formData.execOrgType");
       // let params = {
       //   orgType: null,
       // };
       if (
         this.formData.execOrgType != null &&
-        this.formData.execOrgType != undefined&&
-        this.formData.execOrgType != ''
-      ){
+        this.formData.execOrgType != undefined &&
+        this.formData.execOrgType != ""
+      ) {
         findRoleByType(this.formData.execOrgType).then((res) => {
           console.log(res, "res");
           this.planRoles = res;
@@ -828,16 +830,24 @@ export default {
         //   this.formData.buildTaskNow = true;
         // }
 
-        if (this.formData.planStatus =="1" ) {
+        if (this.formData.planStatus == "1") {
+          let msg;
+          let imme;
           if (this.formData.taskHasCompleted == 1) {
-            this.update(this.formData, false);
+            imme = false;
+            msg = "因存在已完成任务,本次修改内容将从下周期生效。";
           } else {
-            this.update(this.formData, true);
+            imme = true;
+            msg = "因不存在已完成任务,本次修改内容将立即生成。";
           }
+
+          this.$modal.confirm(msg).then(() => {
+            this.update(this.formData, imme);
+          });
         } else if (this.formData.planStatus == "2") {
           this.update(this.formData, false);
         } else {
-          this.update(this.formData,false);
+          this.update(this.formData, false);
         }
       });
     },

+ 40 - 19
src/views/safetycheck/plan/index.vue

@@ -376,7 +376,7 @@
                   size="mini"
                   type="text"
                   icon="el-icon-delete"
-                  @click="onDel(r.row.id, r.row.planName)"
+                  @click="onDel(r.row)"
                   v-hasPermi="['core:checkplan:remove']"
                   >删除</el-button
                 >
@@ -509,15 +509,8 @@ export default {
     },
 
     onHSPlanDistribute(row) {
-      let msg = "";
-      if (row.planStatus == 0) {
-        msg = "是否立即生成任务?";
-      } else {
-        msg = "本周期未完成任务应用最新任务内容";
-      }
-
       if (row.planStatus == 0) {
-        msg = "请选择下发后立即生成或下周期生成任务?";
+        let msg = "请选择下发后立即生成或下周期生成任务";
         this.$refs["DialogThreeState"].show(
           msg,
           (state) => {
@@ -533,7 +526,7 @@ export default {
         );
       } else if (row.planStatus == 2) {
         this.$modal
-          .confirm("因存在已完成任务,是否确定从下周期生成任务", {
+          .confirm("因存在已完成任务,是否确定从下周期生成任务", {
             confirmButtonText: "确定",
             canelButtonText: "取消",
           })
@@ -564,6 +557,10 @@ export default {
         });
     },
     showPublish(row) {
+      //有父计划且父计划不是使用中状态,不能下发
+      if (row.parentStatus != 1 && row.parentId) {
+        return false;
+      }
       //可以下发:本机构创建+状态为草稿、停用的计划
       if (
         row.planCreateOrgId == this.orgId &&
@@ -615,7 +612,7 @@ export default {
     sel(selectList, row) {
       let msg = "";
       if (row.planStatus == 0) {
-        msg = "请选择立即生成或下个周期开始生成任务?";
+        msg = "请选择下发后立即生成或下周期生成任务。";
         this.$refs["DialogThreeState"].show(
           msg,
           (state) => {
@@ -626,15 +623,12 @@ export default {
           {
             yesText: "立即生成",
             noText: "下周期",
-            cancelText: "取消下发",
+            cancelText: "取消",
           }
         );
       } else if (row.planStatus == 2) {
         this.$modal
-          .confirm("因存在已完成任务,本次任务下发仅支持下周期生成任务", {
-            confirmButtonText: "下周期",
-            canelButtonText: "取消下发",
-          })
+          .confirm("因存在已完成任务,是否确定从下周期生成任务?")
           .then(() => {
             this.distributeInner(selectList, false);
           });
@@ -657,8 +651,14 @@ export default {
     
     //开始撤回
     chhuile(row) {
+      let msg;
+      if (row.taskHasCompleted == 1) {
+        msg = "因不存在已完成任务,撤回后将删除所有生成任务?";
+      } else {
+        msg = "因存在已完成任务,撤回后下周期起将不再生成任务?";
+      }
       this.$modal
-        .confirm("确认撤回?", "提示")
+        .confirm(msg, "提示")
         .then(() => {
           // 用户点击了确认按钮
           // console.log("执行操作...");
@@ -718,9 +718,30 @@ export default {
     onEdit(id, other = {}) {
       this.$refs.editDialog.show(id, other);
     },
-    async onDel(id, name) {
+    async onDel(row) {
+      let msg = "";
+      if (row.planStatus == 0) {
+        msg = '是否确认删除名称为"' + row.planName + '"的任务?';
+      } else if (row.planStatus == 1) {
+        if (row.planCycle == 1) {
+          msg = "本次删除将强制删除今日所有任务?";
+        } else {
+          msg = "本次删除将强制删除当前任务时间及以后所有任务";
+        }
+      } else if (row.planStatus == 2) {
+        if (row.hasTaskCurrentCycle) {
+          if (row.planCycle == 1) {
+            msg = "本次删除将强制删除今日所有任务?";
+          } else {
+            msg = "本次删除将强制删除当前任务时间及以后所有任务";
+          }
+        } else {
+          msg = '是否确认删除名称为"' + row.planName + '"的任务?';
+        }
+      }
+
       this.$modal
-        .confirm('是否确认删除名称为"' + name + '"的数据项?')
+        .confirm(msg)
         .then(() => {
           // 用户点击了确认按钮
           // console.log("执行操作...");