Bladeren bron

Merge branch 'V0.0.5' of http://10.87.21.221:8000/jzyd_yyds/soc_web into V0.0.5

jiawuxian 1 jaar geleden
bovenliggende
commit
26c45e5a76
4 gewijzigde bestanden met toevoegingen van 144 en 71 verwijderingen
  1. 1 1
      src/api/core/accessPlan.js
  2. 64 10
      src/views/core/accessPlan/index.vue
  3. 34 24
      src/views/core/drill/plan/index.vue
  4. 45 36
      src/views/core/edu/plan/index.vue

+ 1 - 1
src/api/core/accessPlan.js

@@ -21,7 +21,7 @@ export function getPlan(id) {
 export function distribute(id,immediateEffect) {
   return request({
     url: `/core/accessPlan/distribute/${id}/${immediateEffect}`,
-    showLoading:true,
+
     method: 'get'
   })
 }

+ 64 - 10
src/views/core/accessPlan/index.vue

@@ -730,8 +730,8 @@ export default {
           let request = {...this.form};
           if (request.id != null) {
             let msg = "";
-            if (this.form.planStatus == 1) {
-              if(this.form.isComplete){
+            if (request.planStatus == 1) {
+              if(request.isComplete==true){
                 msg =  "因不存在已完成任务,本次修改内容将立即生效,是否确认提交?";
               }else{
                 msg = "因存在已完成任务,本次修改内容将下周期生效,是否确认提交?";
@@ -773,16 +773,48 @@ export default {
     handleDelete(row) {
       const ids = row.id || this.ids;
       const names = row.planName || this.names;
+      let msg = "";
+      if (row.planStatus == 1) {
+    if(row.planCycle==1){
+      msg = "本次删除将强制删除今日所有任务?";
+    }else{
+      msg = "本次删除将强制删除当前任务时间及以后所有任务";
+    }
+      }else {
+        msg = '是否确认删除名称为"' + row.planName + '"的任务?';
+      }
+      // this.$modal
+      //   .confirm("删除计划会清除本周期所有任务,确定执行?")
+      //   .then(function () {
+      //     return delPlan(ids);
+      //   })
+      //   .then(() => {
+      //     this.getList();
+      //     this.$modal.msgSuccess("删除成功");
+      //   })
+      //   .catch(() => {});
       this.$modal
-        .confirm("删除计划会清除本周期所有任务,确定执行?")
-        .then(function () {
-          return delPlan(ids);
-        })
+        .confirm(msg)
         .then(() => {
-          this.getList();
-          this.$modal.msgSuccess("删除成功");
+          // 用户点击了确认按钮
+          console.log("执行操作...");
+          this.loading = true;
+          api
+            .delPlan(row.id)
+            .then(() => {
+              this.getList();
+              this.loading = false;
+              this.$modal.msgSuccess("删除成功");
+            })
+            .catch(() => {
+              this.loading = false;
+            });
         })
-        .catch(() => {});
+        .catch(() => {
+          // 用户点击了取消按钮
+          console.log("取消操作...");
+          this.loading = false;
+        });
     },
     // handDistribute(row) {
     //   let msg = "";
@@ -804,7 +836,14 @@ export default {
     handDistribute(row) {
       let msg = "";
       if(row.planStatus==0){
-        let   msg = "请选择下发后立即生成或下周期生成任务?";
+        if (row.planCycle==0) {
+          this.$modal
+          .confirm("确定下发任务并立即生成任务?")
+          .then(() => {
+            this.distribute(row.id, true);
+          });
+        }else{
+          let   msg = "请选择下发后立即生成或下周期生成任务?";
         this.$refs["DialogThreeState"].show(
           msg,
           (state) => {
@@ -818,6 +857,21 @@ export default {
             cancelText: "取消",
           }
         );
+        }
+    
+      }else if(row.planCycle==0 &&row.planStatus==2){
+        this.distribute(row.id, true);
+        // this.$modal
+        // .confirm("确定下发任务并立即生成任务?")
+        //   .then(() => {
+        //     this.distribute(row.id, true);
+        //   });
+      } else{
+        this.$modal
+          .confirm("因存在已完成任务,是否确定从下周期生成任务?")
+          .then(() => {
+            this.distribute(row.id, false);
+          });
       }
  
     },

+ 34 - 24
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 {
@@ -593,7 +594,7 @@ export default {
     getUserOrgType() {
       let tempArray = [];
       this.dict.type.sys_org_type.forEach((x) => {
-        if (Number(x.value) >= this.$store.getters.orgType) {
+        if (Number(x.value) >= this.$store.getters.orgType && (x.value != 7 && x.value != 8)) {
           tempArray.push(x);
         }
       });
@@ -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();
     },

+ 45 - 36
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
@@ -642,7 +642,7 @@ export default {
     getUserOrgType() {
       let tempArry = [];
       this.dict.type.sys_org_type.forEach((x) => {
-        if (Number(x.value) >= this.$store.getters.orgType) {
+        if (Number(x.value) >= this.$store.getters.orgType && (x.value != 7 && x.value != 8)) {
           tempArry.push(x);
         }
       });
@@ -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) {