瀏覽代碼

教育培训需求变更 代码提交

jingyuanchao 2 年之前
父節點
當前提交
ff017e6e19

+ 7 - 0
src/api/core/drill/drillPlan.js

@@ -66,3 +66,10 @@ export function publishPlan(id) {
   })
 }
 
+export function revocationPlan(id) {
+  return request({
+    url: '/core/drillPlan/revocationPlan/' + id,
+    method: 'get'
+  })
+
+}

+ 7 - 0
src/api/core/edu/plan.js

@@ -71,3 +71,10 @@ export function publishPlan(id) {
   })
 }
 
+export function revocationPlan(id) {
+  return request({
+    url: '/core/plan/revocationPlan/' + id,
+    method: 'get'
+  })
+}
+

+ 95 - 59
src/views/core/drill/plan/index.vue

@@ -4,7 +4,7 @@
       <!--机构数据-->
       <el-col :span="4" :xs="24">
         <org-tree v-model="queryParams.belongOrgId" @defaultKey="getDefaultKey" @checkChange="checkChange"
-                  @click="clickTreeNode" businessTree></org-tree>
+                  @click="clickTreeNode" businessTree :defuaultCheckSub="false"></org-tree>
       </el-col>
       <!--搜索栏-->
       <el-col :span="20" :xs="24">
@@ -25,7 +25,7 @@
           </el-form-item>
           <el-form-item label="计划状态" prop="planStatus">
             <el-select v-model="queryParams.planStatus" placeholder="请选择计划状态" clearable>
-              <el-option v-for="dict in dict.type.plan_status" :key="dict.value" :label="dict.label"
+              <el-option v-for="dict in dict.type.drill_plan_status" :key="dict.value" :label="dict.label"
                          :value="dict.value"/>
             </el-select>
           </el-form-item>
@@ -55,7 +55,8 @@
           <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
         </el-row>
 
-        <el-table height="500" max-height="550px" border :data="planList" @selection-change="handleSelectionChange" row-key="id"
+        <el-table height="500" max-height="550px" border :data="planList" @selection-change="handleSelectionChange"
+                  row-key="id"
                   :tree-props="{ children: 'children' }">
           <el-table-column label="序号" align="center" width="60" prop="no"/>
           <el-table-column label="计划名称" align="center" width="200" prop="planName"/>
@@ -66,7 +67,7 @@
               <dict-tag :options="dict.type.sys_org_type" :value="scope.row.execOrgType"/>
             </template>
           </el-table-column>
-          <el-table-column prop="planRoleNameList" label="演练角色" width="200" >
+          <el-table-column prop="planRoleNameList" label="演练角色" width="200">
             <template slot-scope="scope">
               <template v-if="scope.row.planRoleNameList">
                 <el-tag size="mini" type="success" style="margin-right: 5px;"
@@ -87,7 +88,7 @@
           </el-table-column>
           <el-table-column label="计划状态" align="center" prop="planStatus">
             <template slot-scope="scope">
-              <dict-tag :options="dict.type.plan_status" :value="scope.row.planStatus"/>
+              <dict-tag :options="dict.type.drill_plan_status" :value="scope.row.planStatus"/>
             </template>
           </el-table-column>
           <el-table-column label="演练次数" align="center" prop="execTimes"/>
@@ -117,11 +118,13 @@
     <el-dialog :title="title" :visible.sync="open" :close="cancel" width="850px" height="800px" append-to-body>
       <el-form ref="form" :model="form" :rules="rules" label-width="110px">
         <el-row>
-          <el-col :span="12">
+          <el-col :span="24">
             <el-form-item label="计划名称" prop="planName">
               <el-input v-model="form.planName" placeholder="请输入计划名称"/>
             </el-form-item>
           </el-col>
+        </el-row>
+        <el-row>
           <el-col :span="12">
             <el-form-item label="计划周期" prop="planCycle">
               <el-select v-model="form.planCycle" placeholder="请选择计划周期" style="width: 100%;">
@@ -130,6 +133,19 @@
               </el-select>
             </el-form-item>
           </el-col>
+
+          <el-col :span="12" v-show="form.planCycle != 0">
+            <el-form-item label="立即生效" prop="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-form-item>
+          </el-col>
+
         </el-row>
         <el-row>
           <el-col :span="12" v-show="form.planCycle == 0">
@@ -142,69 +158,57 @@
           </el-col>
           <el-col :span="12" v-show="form.planCycle == 0">
             <el-form-item prop="endDate" label="结束日期">
-              <el-date-picker style="width: 100%;" v-model="form.endDate" :picker-options="endDatepickerOptions" align="right" type="date"
+              <el-date-picker style="width: 100%;" v-model="form.endDate" :picker-options="endDatepickerOptions"
+                              align="right" type="date"
                               placeholder="选择结束日期">
               </el-date-picker>
             </el-form-item>
           </el-col>
         </el-row>
 
+
         <el-row>
           <el-col :span="12">
+            <el-form-item label="演练机构类型" prop="execOrgType">
+              <el-select v-model="form.execOrgType" placeholder="请选择执行机构类型" @change="execOrgTypeChanged()"
+                         style="width: 100%;">
+                <el-option v-for="dict in dict.type.sys_org_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="execTimes">
               <template>
                 <el-input-number style="width: 100%;" v-model="form.execTimes" :min="1" :max="10"></el-input-number>
               </template>
             </el-form-item>
           </el-col>
-          <el-col :span="12">
-            <el-form-item label="计划状态" prop="planStatus">
-              <el-select v-model="form.planStatus" placeholder="请选择计划状态" style="width: 100%;">
-                <el-option v-for="dict in dict.type.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="12" v-show="form.planCycle != 0">
-            <el-form-item label="立即生效" prop="buildTaskNow">
-              <el-checkbox v-model="form.buildTaskNow">
-                勾选后在当前周期开始生效
-              </el-checkbox>
+          <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 label="演练机构类型" prop="execOrgType">
-              <el-select v-model="form.execOrgType" placeholder="请选择执行机构类型" @change="execOrgTypeChanged()" style="width: 100%;">
-                <el-option v-for="dict in dict.type.sys_org_type" :key="dict.value" :label="dict.label"
+            <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="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="24">
-            <!--            <el-form-item label="培训机构" prop="planExecOrgIdList">
-                          <tree-select v-model="form.planExecOrgIdList" :options="deptOptions" :show-count="true"
-                                       :normalizer="tenantIdnormalizer" :props="{ checkStrictly: true, label: 'name' }"
-                                       placeholder="请选择培训机构"/>
-                        </el-form-item>-->
-
             <el-form-item v-show="form.execOrgType" label="演练机构" prop="planExecOrgIdList">
               <org-tree-select
-                v-model="form.planExecOrgIdList"
-                :queryData="form.execOrgType"
-                ref="orgTreeSelect"
-                :enabledCheckOrgTypes="form.execOrgType"
-                :disable="true">
+                v-model="form.planExecOrgIdList" :queryData="form.execOrgType" ref="orgTreeSelect"
+                :enabledCheckOrgTypes="form.execOrgType" :disable="true">
               </org-tree-select>
             </el-form-item>
           </el-col>
@@ -249,7 +253,8 @@ import {
   listPlanRole,
   publishPlan,
   roleList,
-  updatePlan
+  updatePlan,
+  revocationPlan
 } from "@/api/core/drill/drillPlan";
 import tableList from "@/mixins/tableList";
 import OrgTree from "@/components/orgTree";
@@ -260,8 +265,8 @@ import OrgTreeSelect from '@/components/orgTreeSelect'
 
 export default {
   name: "Plan",
-  dicts: ['plan_cycle', 'sys_org_type', 'plan_status', 'drill_plan_cycle'],
-  components: {OrgTree, KFileUpload, DialogSelectFile,OrgTreeSelect},
+  dicts: ['sys_org_type', 'drill_plan_status', 'drill_plan_cycle'],
+  components: {OrgTree, KFileUpload, DialogSelectFile, OrgTreeSelect},
   mixins: [tableList],
   data() {
     return {
@@ -293,13 +298,13 @@ export default {
         planStatus: null,
         planRoleId: null,
         planName: null,
-        checkSub:true,
+        checkSub: false,
         pageNum: 1,
         pageSize: 10,
         belongOrgId: null
 
       },
-      formFileListDefualtValue:[],
+      formFileListDefualtValue: [],
       // 表单参数
       form: {},
       // 表单校验
@@ -384,18 +389,27 @@ export default {
     },
     //已完成下发的计划不显示下发按钮
     checkCanPublish(row) {
-      return row.issue == 0 && row.standard == 1;
+      if (row.issue == 0 && row.standard == 1 && (row.planStatus == 0 || row.planStatus == 2)) {
+        return true
+      }
+      return false;
 
     },
+    //撤回按钮
+    checkCanRevocation(row) {
+      return row.planStatus == 1 && row.standard == 1 && this.checkCanEdit(row);
+    },
     //所属机构为当前用户登录机构时才显示 “编辑、删除”按钮
     checkCanEdit(row) {
       // console.log("checkCanEdit",this.$store.getters.orgId,row.belongOrgId)
-      return row.belongOrgId == this.$store.getters.orgId
+      return (row.belongOrgId == this.$store.getters.orgId || row.createOrgId == this.$store.getters.orgId)
+
     },
     checkCanDel(row) {
       // console.log("checkCanEdit",this.$store.getters.orgId,row)
       //计划创建机构为当前机构且不是顶级机构创建的计划才显示“删除”按钮
-      return row.belongOrgId == this.$store.getters.orgId && row.createByTopOrg == 1 && row.issue == 0
+      return (row.belongOrgId == this.$store.getters.orgId || row.createOrgId == this.$store.getters.orgId)
+        && (row.issue != 1 || (row.issue == 1 && row.done != 1))
     },
     //省联社下发的计划不显示“删除”按钮
     checkCreateByTopOrg(row) {
@@ -433,7 +447,7 @@ export default {
         remark: null,
         planRoleId: null,
         fileList: null,
-        checkSub:true
+        checkSub: true
 
       };
       this.resetForm("form");
@@ -498,7 +512,7 @@ export default {
       const id = row.id || this.ids
       getPlan(id).then(response => {
         this.form = response.data;
-        this.formFileListDefualtValue=this.form.fileList;
+        this.formFileListDefualtValue = this.form.fileList;
         this.open = true;
         this.title = "修改预案演练计划";
       });
@@ -507,20 +521,23 @@ export default {
     submitForm() {
       this.$refs["form"].validate(valid => {
         if (valid) {
-          let request={...this.form};
-          if(this.form.planExecOrgIdList){
+          let request = {...this.form};
+          if (this.form.planExecOrgIdList) {
             const list = Array.isArray(this.form.planExecOrgIdList) ? this.form.planExecOrgIdList : [this.form.planExecOrgIdList];
-          request.planExecOrgIdList = list;
-        }
-          else{
+            request.planExecOrgIdList = list;
+          } else {
             request.planExecOrgIdList = [];
           }
           if (request.id != null) {
-            updatePlan(request).then(response => {
+            this.$modal.confirm(this.getMsgStr(request,'修改')).then(function () {
+              return updatePlan(request);
+            }).then(() => {
               this.$modal.msgSuccess("修改成功");
               this.open = false;
               this.getList();
+            }).catch(() => {
             });
+
           } else {
             addPlan(request).then(response => {
               this.$modal.msgSuccess("新增成功");
@@ -534,7 +551,7 @@ export default {
     /** 删除按钮操作 */
     handleDelete(row) {
       const ids = row.id || this.ids;
-      this.$modal.confirm('是否确认删除预案演练计划编号为"' + ids + '"的数据项?').then(function () {
+      this.$modal.confirm(this.getMsgStr(row, '删除')).then(function () {
         return delPlan(ids);
       }).then(() => {
         this.getList();
@@ -545,7 +562,7 @@ export default {
     /** 下发计划 */
     handlePublish(row) {
       if (row.id != null) {
-        this.$modal.confirm('是否确认下发该计划?').then(function () {
+        this.$modal.confirm(this.getMsgStr(row, '下发')).then(function () {
           return publishPlan(row.id);
         }).then(() => {
           this.$modal.msgSuccess("计划下发成功");
@@ -554,6 +571,18 @@ export default {
         });
       }
     },
+    //撤回计划
+    handleRevocation(row) {
+      if (row.id != null) {
+        this.$modal.confirm(this.getMsgStr(row, '撤回')).then(function () {
+          return revocationPlan(row.id);
+        }).then(() => {
+          this.$modal.msgSuccess("计划撤回成功");
+          this.getList();
+        }).catch(() => {
+        });
+      }
+    },
     /** 导出按钮操作 */
     handleExport() {
       this.download('system/plan/export', {
@@ -564,6 +593,13 @@ export default {
       // this.$refs.DialogSelectFile.show();
       this.$refs["DialogSelectFile"].show();
     },
+    getMsgStr(row, type) {
+      let str = '是否确认' + type + '该计划?';
+      if (row.standard == 1) {
+        str = '此操作将会影响所有行社计划,' + str;
+      }
+      return str;
+    },
     fileSelected(list) {
       console.log("fileSelected", list);
       if (!list) return;

+ 123 - 98
src/views/core/edu/plan/index.vue

@@ -4,7 +4,7 @@
       <!--机构数据-->
       <el-col :span="4" :xs="24">
         <org-tree v-model="queryParams.belongOrgId" @defaultKey="getDefaultKey" @checkChange="checkChange"
-                  @click="clickTreeNode" hangsheTree></org-tree>
+                  @click="clickTreeNode" hangsheTree :defuaultCheckSub="false"></org-tree>
       </el-col>
       <!--搜索栏-->
       <el-col :span="20" :xs="24">
@@ -23,16 +23,16 @@
           </el-form-item>
           <el-form-item label="计划状态" prop="planStatus">
             <el-select v-model="queryParams.planStatus" placeholder="请选择计划状态" clearable>
-              <el-option v-for="dict in dict.type.plan_status" :key="dict.value" :label="dict.label"
+              <el-option v-for="dict in dict.type.edu_plan_status" :key="dict.value" :label="dict.label"
                          :value="dict.value"/>
             </el-select>
           </el-form-item>
-<!--          <el-form-item label="培训角色" prop="planRoleId">
-            <el-select v-model="queryParams.planRoleId" placeholder="请选择培训角色" clearable>
-              <el-option v-for="item in planRoleList" :key="item.roleId" :label="item.roleName"
-                         :value="item.roleId"></el-option>
-            </el-select>
-          </el-form-item>-->
+          <!--          <el-form-item label="培训角色" prop="planRoleId">
+                      <el-select v-model="queryParams.planRoleId" placeholder="请选择培训角色" clearable>
+                        <el-option v-for="item in planRoleList" :key="item.roleId" :label="item.roleName"
+                                   :value="item.roleId"></el-option>
+                      </el-select>
+                    </el-form-item>-->
           <el-form-item label="计划周期" prop="planCycle">
             <el-select v-model="queryParams.planCycle" placeholder="请选择计划周期" clearable>
               <el-option v-for="dict in dict.type.edu_plan_cycle" :key="dict.value" :label="dict.label"
@@ -80,7 +80,7 @@
           border
           height="550"
           size="small" :data="planList" @selection-change="handleSelectionChange" row-key="id">
-                  <!-- :tree-props="{ children: 'children' }" -->
+          <!-- :tree-props="{ children: 'children' }" -->
           <el-table-column label="序号" align="center" prop="no" width="60"/>
           <el-table-column label="培训主题" align="left" width="200" prop="planName"/>
           <el-table-column label="创建机构" align="left" width="180" prop="createOrgName"/>
@@ -90,20 +90,20 @@
               <dict-tag :options="dict.type.sys_org_type" :value="scope.row.execOrgType"/>
             </template>
           </el-table-column>
-<!--          <el-table-column prop="planRoleNameList" width="180" label="培训角色">
-            <template slot-scope="scope">
-              <template v-if="scope.row.planRoleNameList">
-                <el-tag size="mini" type="success"
-                        v-for="(item, index) in (scope.row.planRoleNameList || '').split(',')"
-                        :key="index">
-                  {{ item }}
-                </el-tag>
-              </template>
-              <template v-else>
-                <el-tag size="mini">{{ scope.row.checkOrgTypeText }}</el-tag>
-              </template>
-            </template>
-          </el-table-column>-->
+          <!--          <el-table-column prop="planRoleNameList" width="180" label="培训角色">
+                      <template slot-scope="scope">
+                        <template v-if="scope.row.planRoleNameList">
+                          <el-tag size="mini" type="success"
+                                  v-for="(item, index) in (scope.row.planRoleNameList || '').split(',')"
+                                  :key="index">
+                            {{ item }}
+                          </el-tag>
+                        </template>
+                        <template v-else>
+                          <el-tag size="mini">{{ scope.row.checkOrgTypeText }}</el-tag>
+                        </template>
+                      </template>
+                    </el-table-column>-->
           <el-table-column label="计划周期" align="center" prop="planCycle">
             <template slot-scope="scope">
               <dict-tag :options="dict.type.edu_plan_cycle" :value="scope.row.planCycle"/>
@@ -112,7 +112,7 @@
           <el-table-column label="培训次数" align="center" prop="execTimes"/>
           <el-table-column label="计划状态" align="center" prop="planStatus">
             <template slot-scope="scope">
-              <dict-tag :options="dict.type.plan_status" :value="scope.row.planStatus"/>
+              <dict-tag :options="dict.type.edu_plan_status" :value="parseInt(scope.row.planStatus)"/>
             </template>
           </el-table-column>
           <el-table-column label="修改人" align="center" prop="updateBy"/>
@@ -122,6 +122,9 @@
               <el-button v-if="checkCanPublish(scope.row)" size="mini" type="text" icon="el-icon-down"
                          @click="handlePublish(scope.row)" v-hasPermi="['core:plan:edit']">下发
               </el-button>
+              <el-button v-if="checkCanRevocation(scope.row)" size="mini" type="text" icon="el-icon-down"
+                         @click="handleRevocation(scope.row)" v-hasPermi="['core:plan:edit']">撤回
+              </el-button>
               <el-button v-if="checkCanEdit(scope.row)" size="mini" type="text" icon="el-icon-edit-outline"
                          @click="handleUpdate(scope.row)" v-hasPermi="['core:plan:edit']">编辑
               </el-button>
@@ -138,7 +141,7 @@
       </el-col>
     </el-row>
     <!-- 添加或修改教育培训计划对话框 -->
-    <DialogCom :title="title" :visible.sync="open" @close="cancel" width="850px" height="800px" append-to-body >
+    <DialogCom :title="title" :visible.sync="open" @close="cancel" width="850px" height="800px" append-to-body>
       <el-form ref="form" :model="form" :rules="rules" label-width="110px">
         <el-row>
           <el-col :span="24">
@@ -156,16 +159,27 @@
               </el-select>
             </el-form-item>
           </el-col>
-          <el-col :span="12">
-            <el-form-item label="机构类型" prop="execOrgType">
-              <el-select style="width: 100%" v-model="form.execOrgType" placeholder="请选择执行机构类型" @change="execOrgTypeChanged()">
 
-                <el-option v-for="dict in getUserOrgType" :key="dict.value" :label="dict.label"
-                           :value="parseInt(dict.value)"></el-option>
 
-              </el-select>
+          <el-col :span="12" v-show="form.planCycle != 0">
+            <el-form-item label="立即生效" prop="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-form-item>
+
           </el-col>
+          <!--     <el-col :span="12">
+                 <el-form-item label="培训角色" prop="planRoleId">
+                   <el-select style="width: 100%"  v-model="form.planRoleId" placeholder="请选择" multiple>
+                     <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-row>
         <el-row>
           <el-col :span="12" v-show="form.planCycle == 0">
@@ -178,7 +192,8 @@
           </el-col>
           <el-col :span="12" v-show="form.planCycle == 0">
             <el-form-item prop="endDate" label="结束日期">
-              <el-date-picker style="width: 100%"  v-model="form.endDate" :picker-options="endDatepickerOptions" align="right" type="date"
+              <el-date-picker style="width: 100%" v-model="form.endDate" :picker-options="endDatepickerOptions"
+                              align="right" type="date"
                               placeholder="选择结束日期">
               </el-date-picker>
             </el-form-item>
@@ -187,9 +202,10 @@
 
         <el-row>
           <el-col :span="12">
-            <el-form-item label="计划状态" prop="planStatus">
-              <el-select  style="width: 100%"  v-model="form.planStatus" placeholder="请选择计划状态">
-                <el-option v-for="dict in dict.type.plan_status" :key="dict.value" :label="dict.label"
+            <el-form-item label="机构类型" prop="execOrgType">
+              <el-select style="width: 100%" v-model="form.execOrgType" placeholder="请选择执行机构类型"
+                         @change="execOrgTypeChanged()">
+                <el-option v-for="dict in getUserOrgType" :key="dict.value" :label="dict.label"
                            :value="parseInt(dict.value)"></el-option>
               </el-select>
             </el-form-item>
@@ -203,36 +219,18 @@
           </el-col>
         </el-row>
         <el-row>
-          <el-col :span="12" v-show="form.planCycle != 0">
-            <el-form-item label="立即生效" prop="buildTaskNow">
-              <el-checkbox v-model="form.buildTaskNow">
-                勾选后在当前周期开始生效
-              </el-checkbox>
-            </el-form-item>
-          </el-col>
           <el-col :span="12">
-<!--            <el-form-item label="培训角色" prop="planRoleId">
-              <el-select style="width: 100%"  v-model="form.planRoleId" placeholder="请选择" multiple>
-                <el-option v-for="item in roleList" :key="item.id" :label="item.name" :value="item.id"></el-option>
+            <el-form-item v-if="this.form.id" label="计划状态" prop="planStatus">
+              <el-select style="width: 100%" v-model="form.planStatus" placeholder="请选择计划状态">
+                <el-option v-for="dict in dict.type.edu_plan_status" :key="dict.value" :label="dict.label"
+                           :value="parseInt(dict.value)"></el-option>
               </el-select>
-            </el-form-item>-->
+            </el-form-item>
           </el-col>
-        </el-row>
-        <el-row>
-          <el-col :span="24">
-            <!--            <el-form-item label="培训机构" prop="planExecOrgIdList">
-                          <tree-select v-model="form.planExecOrgIdList" :options="deptOptions" :show-count="true"
-                                       :normalizer="tenantIdnormalizer" :props="{ checkStrictly: true, label: 'name' }"
-                                       placeholder="请选择培训机构"/>
-                        </el-form-item>-->
-
+          <el-col :span="12">
             <el-form-item v-show="form.execOrgType" label="培训机构" prop="planExecOrgIdList">
-              <org-tree-select
-                v-model="form.planExecOrgIdList"
-                :queryData="form.execOrgType"
-                ref="orgTreeSelect"
-                :enabledCheckOrgTypes="form.execOrgType"
-                :disable="true">
+              <org-tree-select v-model="form.planExecOrgIdList" :queryData="form.execOrgType"
+                ref="orgTreeSelect" :enabledCheckOrgTypes="form.execOrgType" :disable="true">
               </org-tree-select>
             </el-form-item>
           </el-col>
@@ -282,7 +280,8 @@ import {
   listPlanRole,
   publishPlan,
   roleList,
-  updatePlan
+  updatePlan,
+  revocationPlan
 } from "@/api/core/edu/plan";
 import OrgTreeSelect from '@/components/orgTreeSelect'
 import tableList from "@/mixins/tableList";
@@ -293,7 +292,7 @@ import DialogSelectFile from "./dialog.select.file.vue";
 
 export default {
   name: "Plan",
-  dicts: ['plan_cycle', 'sys_org_type', 'plan_status', 'edu_plan_cycle'],
+  dicts: ['sys_org_type', 'edu_plan_cycle', 'edu_plan_status'],
   components: {OrgTreeSelect, OrgTree, KFileUpload, DialogSelectFile},
   mixins: [tableList],
   data() {
@@ -331,7 +330,7 @@ export default {
         pageNum: 1,
         pageSize: 10,
         belongOrgId: null,
-        checkSub: true
+        checkSub: false
 
       },
       formFileListDefualtValue: [],
@@ -374,23 +373,21 @@ export default {
       },
     };
   },
-  computed:{
-   getUserOrgType(){
-    console.log("computed allSysOrgTypes",this.dict.type.sys_org_type,this.$store.getters.orgType);
-    let tempArry =[];
-    this.dict.type.sys_org_type.forEach(x=>{
-      if(Number(x.value)>=this.$store.getters.orgType)
-      {
-        tempArry.push(x);
-      }
-    });
-    // console.log("computed getUserOrgType",tempArry);
-    return tempArry;
-   }
+  computed: {
+    getUserOrgType() {
+      let tempArry = [];
+      this.dict.type.sys_org_type.forEach(x => {
+        if (Number(x.value) >= this.$store.getters.orgType) {
+          tempArry.push(x);
+        }
+      });
+      // console.log("computed getUserOrgType",tempArry);
+      return tempArry;
+    }
   },
   created() {
     this.getList();
-   // this.initPlanRoleList();
+    // this.initPlanRoleList();
     this.orgId = this.$store.getters.orgId;
   },
   methods: {
@@ -439,21 +436,26 @@ export default {
       }
       return time.getTime() < new Date(startDate).getTime()
     },
+    //草稿状态显示按钮“下发、编辑、删除”,使用中显示按钮“撤回、编辑、删除”,停用状态显示按钮“下发、编辑、删除”;
     //已完成下发的计划不显示下发按钮
     checkCanPublish(row) {
-      if (row.issue == 0 && row.standard == 1 && row.planStatus == 0) {
+      if (row.issue == 0 && row.standard == 1 && (row.planStatus == 0 || row.planStatus == 2)) {
         return true
       }
       return false;
     },
-    //所属机构为当前用户登录机构时才显示 “编辑、删除”按钮
+    //撤回按钮
+    checkCanRevocation(row) {
+      return row.planStatus == 1 && row.standard == 1 && this.checkCanEdit(row);
+    },
+    //所属机构为当前用户登录机构或等于创建机构时才显示 “编辑、删除”按钮
     checkCanEdit(row) {
-      return row.belongOrgId == this.$store.getters.orgId
+      return (row.belongOrgId == this.$store.getters.orgId || row.createOrgId == this.$store.getters.orgId)
     },
     checkCanDel(row) {
-      // 计划所属机构=当前登陆人机构  && 创建机构为省联社  && 不是被下发的  && 计划下不存在已有执行任务的情况
-      console.log("checkCanDel",row,row.belongOrgId == this.$store.getters.orgId,row.issue != 1,row.done != 1)
-      return row.belongOrgId == this.$store.getters.orgId && (row.issue != 1 || (row.issue == 1 && row.done != 1))
+      // 计划所属机构or创建机构 =当前登陆人机构  && 创建机构为省联社  && 不是被下发的  && 计划下不存在已有执行任务的情况
+      return (row.belongOrgId == this.$store.getters.orgId || row.createOrgId == this.$store.getters.orgId)
+        && (row.issue != 1 || (row.issue == 1 && row.done != 1))
     },
     //省联社下发的计划不显示“删除”按钮
     checkCreateByTopOrg(row) {
@@ -511,7 +513,7 @@ export default {
     },
     // 节点单击事件
     clickTreeNode(data) {
-     // this.initPlanRoleList();
+      // this.initPlanRoleList();
       this.queryParams.belongOrgId = data.id;
       this.handleQuery();
     },
@@ -558,8 +560,8 @@ export default {
       getPlan(id).then(response => {
         this.form = response.data;
 
-       //将 this.form.planExecOrgIdList中的元素转为字符串
-        if(this.form.planExecOrgIdList == null){
+        //将 this.form.planExecOrgIdList中的元素转为字符串
+        if (this.form.planExecOrgIdList == null) {
           this.form.planExecOrgIdList = [];
         }
         this.form.planExecOrgIdList = this.form.planExecOrgIdList.map(element => element.toString());
@@ -580,11 +582,16 @@ export default {
             request.planExecOrgIdList = [];
           }
           if (request.id != null) {
-            updatePlan(request).then(response => {
+            console.log("updatePlan", request)
+            this.$modal.confirm(this.getMsgStr(request,'修改')).then(function () {
+              return updatePlan(request);
+            }).then(() => {
               this.$modal.msgSuccess("修改成功");
               this.open = false;
               this.getList();
+            }).catch(() => {
             });
+
           } else {
             addPlan(request).then(response => {
               this.$modal.msgSuccess("新增成功");
@@ -598,7 +605,7 @@ export default {
     /** 删除按钮操作 */
     handleDelete(row) {
       const ids = row.id || this.ids;
-      this.$modal.confirm('是否确认删除教育培训计划:' + row.planName).then(function () {
+      this.$modal.confirm(this.getMsgStr(row,'删除')).then(function () {
         return delPlan(ids);
       }).then(() => {
         this.getList();
@@ -609,7 +616,7 @@ export default {
     /** 下发计划 */
     handlePublish(row) {
       if (row.id != null) {
-        this.$modal.confirm('是否确认下发该计划?').then(function () {
+        this.$modal.confirm(this.getMsgStr(row,'下发')).then(function () {
           return publishPlan(row.id);
         }).then(() => {
           this.$modal.msgSuccess("计划下发成功");
@@ -618,6 +625,25 @@ export default {
         });
       }
     },
+    getMsgStr(row,type){
+      let str='是否确认'+type+'该计划?';
+      if (row.standard==1){
+        str='此操作将会影响所有行社计划,'+str;
+      }
+      return str;
+    },
+    //撤回计划
+    handleRevocation(row) {
+      if (row.id != null) {
+        this.$modal.confirm(this.getMsgStr(row,'撤回')).then(function () {
+          return revocationPlan(row.id);
+        }).then(() => {
+          this.$modal.msgSuccess("计划撤回成功");
+          this.getList();
+        }).catch(() => {
+        });
+      }
+    },
     /** 导出按钮操作 */
     handleExport() {
       this.download('system/plan/export', {
@@ -629,16 +655,15 @@ export default {
     },
     fileSelected(list) {
       if (!list) return;
-      let tempArry=[];
+      let tempArry = [];
       list.forEach(x => {
-        tempArry=tempArry.concat(x.fileList);
+        tempArry = tempArry.concat(x.fileList);
       })
-      console.log("tempArry",tempArry,this.form.fileList);
-      if(this.form.fileList){
-        this.formFileListDefualtValue =this.form.fileList.concat(tempArry);
-      }
-      else{
-        this.formFileListDefualtValue =tempArry;
+      console.log("tempArry", tempArry, this.form.fileList);
+      if (this.form.fileList) {
+        this.formFileListDefualtValue = this.form.fileList.concat(tempArry);
+      } else {
+        this.formFileListDefualtValue = tempArry;
       }
 
     },

+ 9 - 5
src/views/core/edu/task/index.vue

@@ -26,12 +26,12 @@
             />
           </el-select>
       </el-form-item>
-      <el-form-item label="计划时间" prop="rangen">
+      <el-form-item label="任务时间段" prop="rangen">
         <el-date-picker
           v-model="queryParams.range"
           type="daterange"
           value-format="yyyy-MM-dd"
-          placeholder="请选择开始日期">
+          placeholder="请选择任务时间段">
         </el-date-picker>
       </el-form-item>
 <!--      <el-form-item label="培训类型" prop="type">
@@ -87,15 +87,19 @@
       <el-table-column label="序号" align="center" prop="no" />
       <el-table-column label="培训主题" width="200" align="left" prop="title" />
       <el-table-column label="培训机构" width="200" align="left" prop="orgName" />
-      <el-table-column label="开始时间" align="center" prop="startDate" width="180">
+<!--      <el-table-column label="开始时间" align="center" prop="startDate" width="180"></el-table-column>
+      <el-table-column label="截止时间" align="center" prop="endDate" width="180"></el-table-column>-->
+      <el-table-column label="任务时间段" align="center" prop="endDate" width="400">
+        <template slot-scope="scope">
+          {{scope.row.startDate}} - {{scope.row.endDate}}
+        </template>
       </el-table-column>
-      <el-table-column label="截止时间" align="center" prop="endDate" width="180"></el-table-column>
       <el-table-column label="培训进度" align="center" prop="status" >
         <template slot-scope="scope">
             <dict-tag :options="dict.type.edu_training_do_status" :value="scope.row.status"/>
           </template>
       </el-table-column>
-      <el-table-column label="培训登记时间" align="center" prop="trainingStartDateTime" width="180">
+      <el-table-column label="培训时间" align="center" prop="trainingStartDateTime" width="180">
       </el-table-column>
 
       <!-- <el-table-column label="培训角色" width="180" align="center" >