Ver código fonte

演练/培训计划:下发,撤回,删除逻辑变更

jingyuanchao 1 ano atrás
pai
commit
7597a9e433

+ 2 - 2
src/api/core/drill/drillPlan.js

@@ -59,9 +59,9 @@ export function roleList(query) {
 }
 
 //下发计划
-export function publishPlan(id) {
+export function publishPlan(id, state) {
   return request({
-    url: '/core/drillPlan/publish/' + id,
+    url: '/core/drillPlan/publish/' + id + '/' + state,
     method: 'get'
   })
 }

+ 2 - 2
src/api/core/edu/plan.js

@@ -64,9 +64,9 @@ export function roleList(query) {
 }
 
 //下发计划
-export function publishPlan(id) {
+export function publishPlan(id, status) {
   return request({
-    url: '/core/plan/publish/' + id,
+    url: '/core/plan/publish/' + id + '/' + status,
     method: 'get'
   })
 }

+ 112 - 58
src/views/core/drill/plan/index.vue

@@ -99,7 +99,8 @@
                   icon="el-icon-search"
                   size="mini"
                   @click="handleQuery"
-                  >搜索</el-button
+                >搜索
+                </el-button
                 >
               </el-col>
               <el-col :span="1.5">
@@ -108,7 +109,8 @@
                   icon="el-icon-refresh"
                   size="mini"
                   @click="resetQuery"
-                  >重置</el-button
+                >重置
+                </el-button
                 >
               </el-col>
               <el-col :span="1.5">
@@ -118,7 +120,7 @@
                   size="mini"
                   @click="handleAdd"
                   v-hasPermi="['core:drillPlan:add']"
-                  >新增任务
+                >新增任务
                 </el-button>
               </el-col>
               <right-toolbar
@@ -135,7 +137,7 @@
             row-key="id"
             :tree-props="{ children: 'children' }"
           >
-            <el-table-column label="序号" align="center" width="60" prop="no" />
+            <el-table-column label="序号" align="center" width="60" prop="no"/>
             <el-table-column
               label="任务名称"
               align="left"
@@ -220,7 +222,7 @@
                   icon="el-icon-arrow-down"
                   @click="handlePublish(scope.row)"
                   v-hasPermi="['core:drillPlan:publish']"
-                  >下发
+                >下发
                 </el-button>
                 <el-button
                   v-if="checkCanRevocation(scope.row)"
@@ -229,7 +231,7 @@
                   icon="el-icon-top-left"
                   @click="handleRevocation(scope.row)"
                   v-hasPermi="['core:plan:edit']"
-                  >撤回
+                >撤回
                 </el-button>
                 <el-button
                   v-if="checkCanEdit(scope.row)"
@@ -238,7 +240,7 @@
                   icon="el-icon-edit-outline"
                   @click="handleUpdate(scope.row)"
                   v-hasPermi="['core:drillPlan:edit']"
-                  >编辑
+                >编辑
                 </el-button>
                 <el-button
                   v-if="checkCanDel(scope.row)"
@@ -247,7 +249,7 @@
                   icon="el-icon-delete"
                   @click="handleDelete(scope.row)"
                   v-hasPermi="['core:drillPlan:remove']"
-                  >删除
+                >删除
                 </el-button>
               </template>
             </el-table-column>
@@ -352,15 +354,15 @@
           </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">
+                          <el-checkbox v-model="form.buildTaskNow">
                               默认从下个周期...
                               <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-checkbox>-->
+                            </el-checkbox>
               <el-checkbox v-model="form.buildTaskNow">
                 默认从下个周期生成任务,
                 <br />
@@ -368,7 +370,7 @@
               </el-checkbox>
             </el-form-item>
           </el-col>
-          <!--          <el-col :span="12">
+                   <el-col :span="12">
             <el-form-item label="机构类型" prop="execOrgType">
               <el-select
                 v-model="form.execOrgType"
@@ -403,27 +405,27 @@
               </el-select>
             </el-form-item>
           </el-col>
-        </el-row>
-        <!-- <el-row>
-           <el-col :span="12">
-             <el-form-item label="演练角色" prop="planRoleId">
-               <el-select v-model="form.planRoleId" placeholder="请选择" multiple style="width:100%">
-                 <el-option v-for="item in roleList" :key="item.id" :label="item.name" :value="item.id"></el-option>
-               </el-select>
-             </el-form-item>
-           </el-col>
 
-           <el-col :span="12">
-             <el-form-item v-if="this.form.id" label="计划状态" prop="planStatus">
-               <el-select v-model="form.planStatus" placeholder="请选择计划状态" style="width: 100%;">
-                 <el-option v-for="dict in dict.type.drill_plan_status" :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="24">
+          <!-- <el-row>
+             <el-col :span="12">
+               <el-form-item label="演练角色" prop="planRoleId">
+                 <el-select v-model="form.planRoleId" placeholder="请选择" multiple style="width:100%">
+                   <el-option v-for="item in roleList" :key="item.id" :label="item.name" :value="item.id"></el-option>
+                 </el-select>
+               </el-form-item>
+             </el-col>
+
+             <el-col :span="12">
+               <el-form-item v-if="this.form.id" label="计划状态" prop="planStatus">
+                 <el-select v-model="form.planStatus" placeholder="请选择计划状态" style="width: 100%;">
+                   <el-option v-for="dict in dict.type.drill_plan_status" :key="dict.value" :label="dict.label"
+                              :value="parseInt(dict.value)"></el-option>
+                 </el-select>
+               </el-form-item>
+             </el-col>
+          </el-row>-->
+
+          <el-col :span="12">
             <el-form-item
               v-show="form.execOrgType"
               label="演练机构"
@@ -443,7 +445,7 @@
         <el-row>
           <el-col :span="24">
             <el-form-item label="备注" prop="remark">
-              <el-input v-model="form.remark" placeholder="请输入备注" />
+              <el-input v-model="form.remark" placeholder="请输入备注"/>
             </el-form-item>
           </el-col>
         </el-row>
@@ -465,6 +467,7 @@
         <el-button @click="cancel">取 消</el-button>
       </div>
     </DialogCom>
+    <DialogThreeState ref="DialogThreeState"></DialogThreeState>
     <!-- <DialogSelectFile
       ref="DialogSelectFile"
       :defaultSelect=defaultSelect
@@ -488,12 +491,13 @@ import {
 } from "@/api/core/drill/drillPlan";
 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 OrgTreeSelect from "@/components/orgTreeSelect";
 import dayjs from "dayjs";
-import { mapGetters } from "vuex";
+import {mapGetters} from "vuex";
+import DialogThreeState from "@/components/message/threeStateMessageBox.vue";
 export default {
   name: "Plan",
   dicts: [
@@ -502,7 +506,7 @@ export default {
     "drill_plan_cycle",
     "core_drill_category",
   ],
-  components: { OrgTree, KFileUpload, OrgTreeSelect },
+  components: {OrgTree, KFileUpload, OrgTreeSelect,DialogThreeState},
   mixins: [tableList],
   data() {
     return {
@@ -545,19 +549,19 @@ export default {
       // 表单校验
       rules: {
         planName: [
-          { 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"},
         ],
         category: [
-          { 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"}
@@ -585,7 +589,7 @@ export default {
     this.orgId = this.$store.getters.orgId;
   },
   computed: {
-   
+
     getUserOrgType() {
       let tempArray = [];
       this.dict.type.sys_org_type.forEach((x) => {
@@ -667,8 +671,7 @@ export default {
       /* return (row.belongOrgId == this.$store.getters.orgId || row.createOrgId == this.$store.getters.orgId)
          && (row.issue != 1 || (row.issue == 1 && row.done != 1))*/
       return (
-        (row.standard == 1 || row.standard == 2) &&
-        row.done != 1 &&
+        (row.standard == 1 || row.standard == 2) && /*row.done != 1 &&*/
         this.checkCanEdit(row)
       );
     },
@@ -728,6 +731,7 @@ export default {
         standard: null,
         category: null,
         checkSub: true,
+        done: null,
       };
       this.resetForm("form");
     },
@@ -819,7 +823,7 @@ export default {
       }
       this.$refs["form"].validate((valid) => {
         if (valid) {
-          let request = { ...this.form };
+          let request = {...this.form};
           console.log("request", request);
           if (this.form.planExecOrgIdList) {
             const list = Array.isArray(this.form.planExecOrgIdList)
@@ -830,8 +834,18 @@ export default {
             request.planExecOrgIdList = [];
           }
           if (request.id != null) {
+            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);
               })
@@ -841,7 +855,8 @@ export default {
                 this.getList();
                 this.$refs["upload"].clearFiles();
               })
-              .catch(() => {});
+              .catch(() => {
+              });
           } else {
             addPlan(request).then((response) => {
               this.$modal.msgSuccess("新增成功");
@@ -855,9 +870,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);
         })
@@ -865,28 +892,54 @@ 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(() => {});
+          });
       }
+      this.getList();
     },
     //撤回计划
     handleRevocation(row) {
       if (row.id != null) {
+        let msg = "";
+        if (row.done == 1) {
+          msg =
+            "本次操作将对下周期及以后任务生效,对当前及历史任务不造成影响,是否确认提交?";
+        } else {
+          msg =
+            "本次操作将对当前轮次及以后任务生效,并删除所有历史未完成任务,是否确认提交?";
+        }
         this.$modal
-          .confirm("撤回会清除本周期所有任务,是否继续?")
+          .confirm(msg)
           .then(function () {
             return revocationPlan(row.id);
           })
@@ -894,7 +947,8 @@ export default {
             this.$modal.msgSuccess("撤回成功");
             this.getList();
           })
-          .catch(() => {});
+          .catch(() => {
+          });
       }
     },
     /** 导出按钮操作 */

+ 130 - 79
src/views/core/edu/plan/index.vue

@@ -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"
+                &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>-->
+                                </el-popover>&ndash;&gt;
               </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);