Преглед на файлове

培训/演练:增加无周期计划下发提示

jingyuanchao преди 1 година
родител
ревизия
a42f5afd95
променени са 2 файла, в които са добавени 77 реда и са изтрити 58 реда
  1. 33 23
      src/views/core/drill/plan/index.vue
  2. 44 35
      src/views/core/edu/plan/index.vue

+ 33 - 23
src/views/core/drill/plan/index.vue

@@ -498,6 +498,7 @@ import OrgTreeSelect from "@/components/orgTreeSelect";
 import dayjs from "dayjs";
 import {mapGetters} from "vuex";
 import DialogThreeState from "@/components/message/threeStateMessageBox.vue";
+
 export default {
   name: "Plan",
   dicts: [
@@ -506,7 +507,7 @@ export default {
     "drill_plan_cycle",
     "core_drill_category",
   ],
-  components: {OrgTree, KFileUpload, OrgTreeSelect,DialogThreeState},
+  components: {OrgTree, KFileUpload, OrgTreeSelect, DialogThreeState},
   mixins: [tableList],
   data() {
     return {
@@ -839,7 +840,7 @@ export default {
               if (this.form.done == 1) {
                 msg = "因存在已完成任务,本次修改内容将下周期生效,是否确认提交?";
               } else {
-                msg =  "因不存在已完成任务,本次修改内容将立即生效,是否确认提交?";
+                msg = "因不存在已完成任务,本次修改内容将立即生效,是否确认提交?";
               }
             } else {
               msg = "是否确认修改?";
@@ -898,32 +899,41 @@ export default {
     /** 下发计划 */
     handlePublish(row) {
       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) {
+      if (row.planCycle == 0) {
         this.$modal
-          .confirm("因存在已完成任务,本次任务下发仅支持下周期生成任务", {
-            confirmButtonText: "下周期",
+          .confirm("无周期任务下发将会立即生成任务,是否确认下发?", {
+            confirmButtonText: "确认下发",
             canelButtonText: "取消下发",
           })
           .then(() => {
-            publishPlan(row.id, 0);
-            this.getList();
+            publishPlan(row.id, 1);
           });
+      } else {
+        if (row.planStatus == 0) {
+          msg = "请选择从当前轮次或周期开始生成任务?";
+          this.$refs["DialogThreeState"].show(
+            msg,
+            (state) => {
+              if (state == 0 || state == 1) {
+                publishPlan(row.id, state);
+              }
+            },
+            {
+              yesText: "当前轮次",//1
+              noText: "下周期",//0
+              cancelText: "取消下发",
+            }
+          );
+        } else if (row.planStatus == 2) {
+          this.$modal
+            .confirm("因存在已完成任务,本次任务下发仅支持下周期生成任务", {
+              confirmButtonText: "下周期",
+              canelButtonText: "取消下发",
+            })
+            .then(() => {
+              publishPlan(row.id, 0);
+            });
+        }
       }
       this.getList();
     },

+ 44 - 35
src/views/core/edu/plan/index.vue

@@ -415,19 +415,19 @@
           </el-col>
         </el-row>
         <el-row>
-<!--          <el-col :span="12" v-show="showBuildTaskNow()">
-            <el-form-item label="立即生效" prop="buildTaskNow">
-              <el-checkbox v-model="form.buildTaskNow">
-                默认从下个周期生成任务,
-                <br/>
-                勾选后从当前周期立即生成任务
-                &lt;!&ndash;                <el-popover placement="top-start" title="" width="200" trigger="hover"
-                                            content="默认从下个周期生成任务,勾选后从当前周期立即生成任务">
-                                  <i class="el-icon-warning-outline change-icon" slot="reference"></i>
-                                </el-popover>&ndash;&gt;
-              </el-checkbox>
-            </el-form-item>
-          </el-col>-->
+          <!--          <el-col :span="12" v-show="showBuildTaskNow()">
+                      <el-form-item label="立即生效" prop="buildTaskNow">
+                        <el-checkbox v-model="form.buildTaskNow">
+                          默认从下个周期生成任务,
+                          <br/>
+                          勾选后从当前周期立即生成任务
+                          &lt;!&ndash;                <el-popover placement="top-start" title="" width="200" trigger="hover"
+                                                      content="默认从下个周期生成任务,勾选后从当前周期立即生成任务">
+                                            <i class="el-icon-warning-outline change-icon" slot="reference"></i>
+                                          </el-popover>&ndash;&gt;
+                        </el-checkbox>
+                      </el-form-item>
+                    </el-col>-->
           <el-col :span="12">
             <el-form-item label="受训机构类型" prop="execOrgType">
               <el-select
@@ -916,7 +916,7 @@ export default {
               if (this.form.done == 1) {
                 msg = "因存在已完成任务,本次修改内容将下周期生效,是否确认提交?";
               } else {
-                msg =  "因不存在已完成任务,本次修改内容将立即生效,是否确认提交?";
+                msg = "因不存在已完成任务,本次修改内容将立即生效,是否确认提交?";
               }
             } else {
               msg = "是否确认修改?";
@@ -975,32 +975,41 @@ export default {
     /** 下发计划 */
     handlePublish(row) {
       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) {
+      if (row.planCycle == 0) {
         this.$modal
-          .confirm("因存在已完成任务,本次任务下发仅支持下周期生成任务", {
-            confirmButtonText: "下周期",
+          .confirm("无周期任务下发将会立即生成任务,是否确认下发?", {
+            confirmButtonText: "确认下发",
             canelButtonText: "取消下发",
           })
           .then(() => {
-            publishPlan(row.id, 0);
-            this.getList();
+            publishPlan(row.id, 1);
           });
+      } else {
+        if (row.planStatus == 0) {
+          msg = "请选择从当前轮次或周期开始生成任务?";
+          this.$refs["DialogThreeState"].show(
+            msg,
+            (state) => {
+              if (state == 0 || state == 1) {
+                publishPlan(row.id, state);
+              }
+            },
+            {
+              yesText: "当前轮次",//1
+              noText: "下周期",//0
+              cancelText: "取消下发",
+            }
+          );
+        } else if (row.planStatus == 2) {
+          this.$modal
+            .confirm("因存在已完成任务,本次任务下发仅支持下周期生成任务", {
+              confirmButtonText: "下周期",
+              canelButtonText: "取消下发",
+            })
+            .then(() => {
+              publishPlan(row.id, 0);
+            });
+        }
       }
     },
     getMsgStr(row, type) {