Переглянути джерело

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

luowei 1 рік тому
батько
коміт
8252cf73d4

+ 2 - 2
.env.development

@@ -6,7 +6,7 @@ ENV = 'development'
 
 # 开发环境
 #测试地址
-VUE_APP_BASE_API = 'http://47.92.229.224:8080'
+#VUE_APP_BASE_API = 'http://47.92.229.224:8080'
 #罗俊
 #VUE_APP_BASE_API = 'http://10.87.21.60:8080'
 #罗伟
@@ -20,7 +20,7 @@ VUE_APP_BASE_API = 'http://47.92.229.224:8080'
 # VUE_APP_BASE_API = 'http://10.87.23.62:8080'
 # VUE_APP_BASE_API = 'http://localhost:8080'
 # 开发环境
-# VUE_APP_BASE_API = 'http://10.87.21.103:8080'
+VUE_APP_BASE_API = 'http://10.87.21.103:8080'
 # 路由懒加载
 VUE_CLI_BABEL_TRANSPILE_MODULES = true
 

+ 75 - 75
src/components/K-FileUpload/index.vue

@@ -1,13 +1,14 @@
 <template>
   <div class="upload-file">
     <el-upload
-    multiple
-    drag
-    v-if="isShowUploadBtn"
-    :action="uploadFileUrl"
-    :before-upload="handleBeforeUpload"
-    :on-error="uploadedSuccessfully"
-    :on-success="handleUploadSuccess"
+      :disabled="disabled"
+      multiple
+      drag
+      v-if="isShowUploadBtn"
+      :action="uploadFileUrl"
+      :before-upload="handleBeforeUpload"
+      :on-error="uploadedSuccessfully"
+      :on-success="handleUploadSuccess"
       :file-list="fileList"
       :limit="limit"
       :accept="accept"
@@ -23,14 +24,16 @@
       <!-- <el-button size="mini" type="primary">{{ btnName }}</el-button> -->
       <!-- 上传提示 -->
       <div class="el-upload__tip" slot="tip" v-if="showTip">
-        文件<template v-if="fileSize">大小不超过<b style="color: #f56c6c">{{ fileSize }}MB</b></template>
+        文件
+        <template v-if="fileSize">大小不超过<b style="color: #f56c6c">{{ fileSize }}MB</b></template>
         <template v-if="fileType"> 格式为<b style="color: #f56c6c">{{ fileType.join("/") }}</b></template>
         的文件
       </div>
     </el-upload>
 
     <!-- 详情页面显示列表 -->
-    <transition-group v-if="!isShowUploadBtn" class="upload-file-list el-upload-list el-upload-list--text" name="el-fade-in-linear" tag="ul">
+    <transition-group v-if="!isShowUploadBtn" class="upload-file-list el-upload-list el-upload-list--text"
+                      name="el-fade-in-linear" tag="ul">
       <li :key="file.url" class="el-upload-list__item ele-upload-list__item-content" v-for="(file) in fileList">
         <el-link :href="file.url.indexOf('http') > -1? file.url: imageUrl(file.url)" :underline="false" target="_blank">
           <span class="el-icon-document"> {{ file.name }} </span>
@@ -41,8 +44,8 @@
 </template>
 
 <script>
-import { getToken } from "@/utils/auth";
-import { upload } from "@/api/system/public";
+import {getToken} from "@/utils/auth";
+import {upload} from "@/api/system/public";
 import {imageUrl} from "@/utils/ruoyi";
 
 export default {
@@ -57,6 +60,10 @@ export default {
       type: Number,
       default: 5,
     },
+    disabled: {
+      type: Boolean,
+      default: false,
+    },
     // 大小限制(MB)
     fileSize: {
       type: Number,
@@ -65,7 +72,7 @@ export default {
     // 文件类型, 例如['png', 'jpg', 'jpeg']
     fileType: {
       type: Array,
-      default: () => ["pdf", "jpg", "png", "bmp","zip","rar","7z"],
+      default: () => ["pdf", "jpg", "png", "bmp", "zip", "rar", "7z"],
     },
     // 是否显示提示
     isShowTip: {
@@ -91,12 +98,12 @@ export default {
         Authorization: "Bearer " + getToken(),
       },
       fileList: [],
-      fileValueList:[],
+      fileValueList: [],
       accept: this.getAcceptByFileType()//".pdf,.jpg,.png,.bmp",
     };
   },
   watch: {
-    defaultValue:{
+    defaultValue: {
       handler(val) {
         if (val) {
           let temp = 1;
@@ -104,8 +111,7 @@ export default {
           // 首先将值转为数组
           const list = Array.isArray(val) ? val : this.value.split(',');
           console.log("watch fileList", list)
-          if(list.length>this.limit)
-          {
+          if (list.length > this.limit) {
             this.handleExceed();
             return;
           }
@@ -116,20 +122,19 @@ export default {
               let itemObj = JSON.parse(item);
               // console.log("watch fileList itemObj", itemObj)
               if ('name' in itemObj && 'url' in itemObj) {
-                item=itemObj
-              }
-              else {
-                item = { name: item, url: item };
+                item = itemObj
+              } else {
+                item = {name: item, url: item};
               }
             }
             item.uid = item.uid || new Date().getTime() + temp++;
             return item;
           });
-          this.fileValueList=[...this.fileList];
+          this.fileValueList = [...this.fileList];
           this.$emit("input", this.listToTagObj(this.fileValueList));
         } else {
           this.fileList = [];
-          this.fileValueList=[];
+          this.fileValueList = [];
           return [];
         }
       },
@@ -152,11 +157,9 @@ export default {
   methods: {
     imageUrl,
 
-    getAcceptByFileType()
-    {
-      if(this.fileType)
-      {
-        let arr= this.fileType.map(x=> "."+x);
+    getAcceptByFileType() {
+      if (this.fileType) {
+        let arr = this.fileType.map(x => "." + x);
         return arr.join(",");
       }
       return "";
@@ -184,10 +187,9 @@ export default {
         }
       }
 
-      if(this.fileList.findIndex(x=>x.name==file.name)>-1)
-      {
+      if (this.fileList.findIndex(x => x.name == file.name) > -1) {
         this.$modal.msgError(`不能上传相同名称的文件或图片!`);
-          return false;
+        return false;
       }
 
       this.$modal.loading("正在上传文件,请稍候...");
@@ -204,32 +206,31 @@ export default {
       this.$modal.closeLoading()
     },
     // 上传成功回调
-    handleUploadSuccess(res, file,fileList) {
+    handleUploadSuccess(res, file, fileList) {
       console.log("handleUploadSuccess", res, file, fileList);
-      this.fileList=fileList;
+      this.fileList = fileList;
       this.$emit("input", this.listToTagObj(this.fileValueList));
     },
     // 删除文件
     handleDelete(item) {
       if (item && item.status === "success") {
-        console.log("handleDelete index",item)
-      //this.fileList.splice(item, 1);
-      // console.log("handleDelete",item,this.fileValueList)
+        console.log("handleDelete index", item)
+        //this.fileList.splice(item, 1);
+        // console.log("handleDelete",item,this.fileValueList)
 
-      let index = this.fileValueList.findIndex(x=>x.name==item.name);
-      // console.log("handleDelete",index,this.fileValueList)
-      if(index>-1)
-      {
-        this.fileValueList.splice(index, 1);
+        let index = this.fileValueList.findIndex(x => x.name == item.name);
+        // console.log("handleDelete",index,this.fileValueList)
+        if (index > -1) {
+          this.fileValueList.splice(index, 1);
+        }
+        //this.fileValueList.splice(item, 1);
+        console.log("handleDelete deleted", this.fileValueList)
+        this.fileList = this.listToTagObj(this.fileValueList);
+        this.$emit("input", this.listToTagObj(this.fileValueList));
       }
-      //this.fileValueList.splice(item, 1);
-      console.log("handleDelete deleted",this.fileValueList)
-      this.fileList = this.listToTagObj(this.fileValueList);
-      this.$emit("input", this.listToTagObj(this.fileValueList));
-    }
     },
     // 上传失败结束处理 必须调用,否则失败文件也会显示
-    uploadedSuccessfully(err,file,fileList) {
+    uploadedSuccessfully(err, file, fileList) {
     },
     // 获取文件名称
     getFileName(name) {
@@ -250,14 +251,14 @@ export default {
     uploadFile(fileObj) {
       let formData = new FormData();
       formData.append('file', fileObj.file);
-      console.log("this.fileValueList.length",this.fileValueList.length)
-      if (this.fileValueList.length<=this.limit){
+      console.log("this.fileValueList.length", this.fileValueList.length)
+      if (this.fileValueList.length <= this.limit) {
         upload(formData).then(res => {
           /*上传成功*/
           this.$modal.closeLoading();
           //let imgUrl = process.env.VUE_APP_BASE_API + res.data.url;
           let arr = [];
-          arr.push({ name: res.data.realName, url: res.data.url });
+          arr.push({name: res.data.realName, url: res.data.url});
           this.fileValueList = this.fileValueList.concat(arr);
           this.$modal.msgSuccess("上传成功!");
           fileObj.onSuccess();
@@ -281,40 +282,39 @@ export default {
     },
 
     listToTagObj(list) {
-      let tempArry=[];
+      let tempArry = [];
       for (let i in list) {
         // console.log("listToString2 i",i);
-        tempArry.push(JSON.stringify( {url:list[i].url,name:list[i].name}));
+        tempArry.push(JSON.stringify({url: list[i].url, name: list[i].name}));
       }
-      console.log("listToString2",tempArry);
+      console.log("listToString2", tempArry);
       return tempArry;
     },
     onPreview(file) {
-        console.log(file);
-        var name = file.name;
-        let index = this.fileValueList.findIndex(x=>x.name==file.name);
-        this.fileValueList[index]
-        var url = this.fileValueList[index].url;
-        if(process.env.VUE_APP_BASE_API!=='/')
-        {
-          url=process.env.VUE_APP_BASE_API+this.fileValueList[index].url;
-        }
-        // console.log("process.env.VUE_APP_BASE_API",process.env.VUE_APP_BASE_API,process)
+      console.log(file);
+      var name = file.name;
+      let index = this.fileValueList.findIndex(x => x.name == file.name);
+      this.fileValueList[index]
+      var url = this.fileValueList[index].url;
+      if (process.env.VUE_APP_BASE_API !== '/') {
+        url = process.env.VUE_APP_BASE_API + this.fileValueList[index].url;
+      }
+      // console.log("process.env.VUE_APP_BASE_API",process.env.VUE_APP_BASE_API,process)
 
-        // console.log("process.env.VUE_APP_BASE_API url",url)
-        const a = document.createElement("a");
-        a.setAttribute("download", name);
-        a.setAttribute("target", "_blank");
-        a.setAttribute("href", url);
-        a.click();
-      },
-      clearFiles(){
-        if(this.$refs["fileUpload"])
-          this.$refs["fileUpload"].clearFiles();
+      // console.log("process.env.VUE_APP_BASE_API url",url)
+      const a = document.createElement("a");
+      a.setAttribute("download", name);
+      a.setAttribute("target", "_blank");
+      a.setAttribute("href", url);
+      a.click();
+    },
+    clearFiles() {
+      if (this.$refs["fileUpload"])
+        this.$refs["fileUpload"].clearFiles();
 
-        this.fileList = [];
-        this.fileValueList = [];
-      },
+      this.fileList = [];
+      this.fileValueList = [];
+    },
   }
 };
 </script>

+ 12 - 4
src/components/common/textarea.vue

@@ -5,13 +5,15 @@
       :rows="row"
       v-model="pv"
       :maxlength="length"
+      :disabled="disabled"
       :placeholder="placeholder"
     ></el-input>
-    <div class="k-textarea__length">{{pv ? pv.length : 0}} / {{length}}</div>
+    <div class="k-textarea__length">{{ pv ? pv.length : 0 }} / {{ length }}</div>
   </div>
 </template>
 <script>
 import sync from "../utils/computed.sync";
+
 export default {
   data() {
     return {};
@@ -22,20 +24,26 @@ export default {
   watch: {},
   props: {
     value: {},
-    row:{
-      type:Number,
+    disabled: {
+      type: Boolean,
+      default: false,
+    },
+    row: {
+      type: Number,
       default: 5,
     },
     length: {},
     placeholder: {}
   },
   methods: {},
-  mounted() {}
+  mounted() {
+  }
 };
 </script>
 <style lang="scss">
 .k-textarea {
   position: relative;
+
   &__length {
     position: absolute;
     bottom: 0;

+ 5 - 0
src/components/orgTree/orgQuerySelector.vue

@@ -1,6 +1,7 @@
 <template>
   <div class="org_query_selector">
     <treeselect
+
       v-model="val"
       :options="treeList"
       :normalizer="normalizer"
@@ -36,6 +37,10 @@ export default {
     value: {
       type: String,
     },
+    multiple:{
+      type:Boolean,
+      default:true,
+    },
     label: {
       type: String,
       default: "shortName",

+ 4 - 4
src/components/orgTreeSelect/index.vue

@@ -12,15 +12,15 @@
       placeholder="请输入查询机构名称"></el-input>
     <!--  下拉框   -->
     <el-row :gutter="20" type="flex" align="middle">
-      <el-col :span="14" :xs="24">
-        <el-select :disabled="disable" :popper-append-to-body="false" v-model="queryForm.type" placeholder="请选择过滤机构类型" clearable
+      <el-col :span="checkShow? 13:24" :xs="24">
+        <el-select :disabled="disable" :popper-append-to-body="false" v-model="queryForm.type" placeholder="请选择机构类型" clearable
           @change="serchTreeHandler">
           <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-col>
-      <el-col :span="10" :xs="24">
-        <el-checkbox v-if="checkShow" :disabled="!queryForm.type" v-model="checked">按过滤机构类型勾选</el-checkbox>
+      <el-col v-if="checkShow" :span="11" :xs="24">
+        <el-checkbox  :disabled="!queryForm.type" v-model="checked">仅通过机构类型选择</el-checkbox>
       </el-col>
     </el-row>
     <!--  机构树   -->

+ 3 - 7
src/directive/permission/hasPermi.js

@@ -7,11 +7,11 @@ import store from "@/store";
 
 export default {
   inserted(el, binding, vnode) {
-   
+
     const { value } = binding;
     const all_permission = "*:*:*";
     const permissions = store.getters && store.getters.permissions;
-    
+
     if (value && value instanceof Array && value.length > 0) {
       const permissionFlag = value;
 
@@ -20,15 +20,11 @@ export default {
           all_permission === permission || permissionFlag.includes(permission)
         );
       });
-      console.log(el, binding,'vnode')
-      console.log(hasPermissions,'hasPermissions');
-      
       if (!hasPermissions) {
-        //console.log(el.parentNode,'el')
         el.parentNode && el.parentNode.removeChild(el);
       }
     } else {
       throw new Error(`请设置操作权限标签值`);
     }
   },
-};
+};

+ 5 - 5
src/views/core/accessPlan/index.vue

@@ -270,7 +270,7 @@
                   type="text"
                   v-if="
                     scope.row.parentOrgId == isEdit &&
-                    scope.row.parentId == null 
+                    scope.row.parentId == null
                   "
                   icon="el-icon-delete"
                   @click="handleDelete(scope.row)"
@@ -752,7 +752,7 @@ export default {
                 this.$modal.msgSuccess("编辑成功");
                 this.open = false;
                 this.getList();
-            
+
               })
               .catch(() => {
               });
@@ -834,7 +834,7 @@ export default {
     //     })
     //     .catch(() => {});
     //   }
- 
+
     // },
 
     handDistribute(row) {
@@ -862,7 +862,7 @@ export default {
           }
         );
         }
-    
+
       }else if(row.planCycle==0 &&row.planStatus==2){
         this.distribute(row.id, true);
         // this.$modal
@@ -877,7 +877,7 @@ export default {
             this.distribute(row.id, false);
           });
       }
- 
+
     },
     distribute(id, immediateEffect) {
       this.loading = true;

+ 31 - 9
src/views/core/drill/plan/index.vue

@@ -301,6 +301,7 @@
                 v-model="form.planCycle"
                 placeholder="请选择任务周期"
                 style="width: 100%"
+                :disabled="tableDisable()"
               >
                 <el-option
                   v-for="dict in dict.type.drill_plan_cycle"
@@ -315,6 +316,7 @@
             <el-form-item label="任务次数" prop="execTimes">
               <template>
                 <el-input-number
+                  :disabled="tableDisable()"
                   style="width: 100%"
                   v-model="form.execTimes"
                   :min="1"
@@ -328,6 +330,7 @@
           <el-col :span="12" v-show="form.planCycle == 0">
             <el-form-item prop="startDate" label="开始日期">
               <el-date-picker
+                :disabled="tableDisable()"
                 style="width: 100%"
                 v-model="form.startDate"
                 @change="startDateChanged"
@@ -342,6 +345,7 @@
           <el-col :span="12" v-show="form.planCycle == 0">
             <el-form-item prop="endDate" label="结束日期">
               <el-date-picker
+                :disabled="tableDisable()"
                 style="width: 100%"
                 v-model="form.endDate"
                 :picker-options="endDatepickerOptions"
@@ -391,6 +395,7 @@
           <el-col :span="12">
             <el-form-item label="机构类型" prop="execOrgType">
               <el-select
+                :disabled="tableDisable()"
                 style="width: 100%"
                 v-model="form.execOrgType"
                 placeholder="请选择机构类型"
@@ -432,6 +437,7 @@
               prop="planExecOrgIdList"
             >
               <org-tree-select
+                :disabled="tableDisable()"
                 v-model="form.planExecOrgIdList"
                 :queryData="form.execOrgType"
                 ref="orgTreeSelect"
@@ -445,7 +451,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="请输入备注"  :disabled="tableDisable()"/>
             </el-form-item>
           </el-col>
         </el-row>
@@ -453,6 +459,7 @@
           <el-col :span="12">
             <el-form-item label="上传文件" prop="fileList">
               <K-file-upload
+                :disabled="tableDisable()"
                 ref="upload"
                 :defaultValue="formFileListDefualtValue"
                 v-model="form.fileList"
@@ -660,10 +667,9 @@ export default {
     },
     //所属机构为当前用户登录机构时才显示 “编辑、删除”按钮
     checkCanEdit(row) {
-      // console.log("checkCanEdit",this.$store.getters.orgId,row.belongOrgId)
+       console.log("checkCanEdit",this.$store.getters.orgId,row.belongOrgId)
       return (
-        row.belongOrgId == this.$store.getters.orgId ||
-        row.createOrgId == this.$store.getters.orgId
+        row.belongOrgId == this.$store.getters.orgId
       );
     },
     checkCanDel(row) {
@@ -954,12 +960,25 @@ export default {
     handleRevocation(row) {
       if (row.id != null) {
         let msg = "";
-        if (row.done == 1) {
-          msg =
-            "因存在已完成任务,撤回后下周期起将不再生成任务";
+        //无周期
+        if (row.planCycle == 0) {
+          if (row.done == 1) {
+            msg = '因存在已完成任务,无周期任务不允许撤回,如需删除下发任务请点击"删除"';
+            this.$alert(msg,'系统提示',{
+              confirmButtonText:"确认"
+            })
+            return
+          } else {
+            msg = "因存在不已完成任务,撤回后将删除所有生成任务";
+          }
         } else {
-          msg =
-            "因存在不已完成任务,撤回后将删除所有生成任务";
+          //有周期
+          if (row.done == 1) {
+            msg =
+              "因存在已完成任务,撤回后下周期起将不再生成任务";
+          } else {
+            msg = "因存在不已完成任务,撤回后将删除所有生成任务";
+          }
         }
         this.$modal
           .confirm(msg)
@@ -984,6 +1003,9 @@ export default {
         `plan_${new Date().getTime()}.xlsx`
       );
     },
+    tableDisable(){
+      return this.form.planStatus==1;
+    },
     // showSelectFile() {
     //   this.$refs["DialogSelectFile"].show();
     // },

+ 33 - 10
src/views/core/edu/plan/index.vue

@@ -354,8 +354,10 @@
                 style="width: 100%"
                 v-model="form.planCycle"
                 placeholder="请选择任务周期"
+                :disabled="tableDisable()"
               >
                 <el-option
+
                   v-for="dict in dict.type.edu_plan_cycle"
                   :key="dict.value"
                   :label="dict.label"
@@ -368,6 +370,7 @@
             <el-form-item label="任务次数" prop="execTimes">
               <template>
                 <el-input-number
+                  :disabled="tableDisable()"
                   style="width: 100%"
                   v-model="form.execTimes"
                   :min="1"
@@ -389,6 +392,7 @@
           <el-col :span="12" v-show="form.planCycle == 0">
             <el-form-item prop="startDate" label="开始日期">
               <el-date-picker
+                :disabled="tableDisable()"
                 style="width: 100%"
                 v-model="form.startDate"
                 @change="startDateChanged"
@@ -403,6 +407,7 @@
           <el-col :span="12" v-show="form.planCycle == 0">
             <el-form-item prop="endDate" label="结束日期">
               <el-date-picker
+                :disabled="tableDisable()"
                 style="width: 100%"
                 v-model="form.endDate"
                 :picker-options="endDatepickerOptions"
@@ -435,6 +440,7 @@
                 v-model="form.execOrgType"
                 placeholder="请选择受训机构类型"
                 @change="execOrgTypeChanged()"
+                :disabled="tableDisable()"
               >
                 <el-option
                   v-for="dict in getUserOrgType"
@@ -465,7 +471,7 @@
                 :queryData="form.execOrgType"
                 ref="orgTreeSelect"
                 :enabledCheckOrgTypes="form.execOrgType"
-                :disable="true"
+                :disabled="tableDisable()"
               >
               </org-tree-select>
             </el-form-item>
@@ -481,6 +487,7 @@
                 type="textarea"
                 show-word-limit
                 placeholder="请输入备注"
+                :disabled="tableDisable()"
               />
             </el-form-item>
           </el-col>
@@ -489,6 +496,7 @@
           <el-col :span="12">
             <el-form-item label="上传文件" prop="fileList">
               <K-file-upload
+                :disabled="tableDisable()"
                 ref="upload"
                 :defaultValue="formFileListDefualtValue"
                 v-model="form.fileList"
@@ -497,7 +505,7 @@
           </el-col>
           <el-col :span="12">
             <el-form-item label="">
-              <el-button type="primary" @click="showSelectFile"
+              <el-button type="primary" @click="showSelectFile"  v-if="!tableDisable()"
               >选取知识库文件
               </el-button
               >
@@ -678,7 +686,6 @@ export default {
     },
     /** 查询教育培训计划列表 */
     getList() {
-      console.log("12312312312312")
       this.loading = true;
       listPlan(this.queryParams).then((response) => {
         this.planList = response.rows;
@@ -716,6 +723,9 @@ export default {
       }
       return time.getTime() < new Date(startDate).getTime();
     },
+    tableDisable(){
+      return this.form.planStatus==1;
+    },
 
     checkCanPublish(row) {
       //是标准计划且未下发,状态为草稿或停用,且所属机构为当前用户登录机构时才显示 “下发”按钮
@@ -736,8 +746,7 @@ export default {
     //所属机构为当前用户登录机构或等于创建机构时才显示 “编辑、删除”按钮
     checkCanEdit(row) {
       return (
-        row.belongOrgId == this.$store.getters.orgId ||
-        row.createOrgId == this.$store.getters.orgId
+        row.belongOrgId == this.$store.getters.orgId
       );
     },
     checkCanDel(row) {
@@ -1036,13 +1045,27 @@ export default {
     //撤回计划
     handleRevocation(row) {
       let msg = "";
-      if (row.done == 1) {
-        msg =
-          "因存在已完成任务,撤回后下周期起将不再生成任务";
+      //无周期
+      if (row.planCycle == 0) {
+        if (row.done == 1) {
+          msg = '因存在已完成任务,无周期任务不允许撤回,如需删除下发任务请点击"删除"';
+          this.$alert(msg,'系统提示',{
+            confirmButtonText:"确认"
+          })
+          return
+        } else {
+          msg = "因存在不已完成任务,撤回后将删除所有生成任务";
+        }
       } else {
-        msg =
-          "因存在不已完成任务,撤回后将删除所有生成任务";
+        //有周期
+        if (row.done == 1) {
+          msg =
+            "因存在已完成任务,撤回后下周期起将不再生成任务";
+        } else {
+          msg = "因存在不已完成任务,撤回后将删除所有生成任务";
+        }
       }
+
       this.$modal
         .confirm(msg, "提示")
         .then(() => {

+ 12 - 4
src/views/index.vue

@@ -45,10 +45,11 @@
           <el-tabs type="border-card">
             <el-tab-pane label="通知公告">
               <div class="tab-panel">
-                <div class="msg-item" v-for="(v,i) in msgsList" :key="v.id" @click="showMsg(v)">
-                    <span>{{v.title}}</span>
-                    <span>{{v.publishTime}}</span>
+                <div v-if="msgsList && msgsList.length > 0" class="msg-item" v-for="(v,i) in msgsList" :key="v.id" @click="showMsg(v)">
+                    <span class="item-title">{{v.title}}</span>
+                    <span class="item-time">{{v.publishTime}}</span>
                 </div>
+                <el-empty v-else description="暂无数据"></el-empty>
               </div>
             </el-tab-pane>
             <el-tab-pane label="知识库">
@@ -141,7 +142,7 @@ export default {
           return JSON.parse(v)
         });
         this.fileList.forEach(v=>{
-          v.createTime = dayjs(v.createTime).format('YYYY-DD-MM')
+          v.createTime = dayjs(v.createTime).format('YYYY-MM-DD')
         })
       })
     }
@@ -214,6 +215,13 @@ export default {
     text-overflow: ellipsis;
     text-align: start;
   }
+  .item-title{
+    flex:.75;
+  }
+  .item-time{
+    flex:.25;
+    text-align: right;
+  }
 }
 .file-item{
   font-size: 15px;

+ 124 - 0
src/views/resumption/plan/dialog.detail.vue

@@ -0,0 +1,124 @@
+<template>
+  <div class="rule-type">
+    <DialogCom title="检查任务详情" :visible.sync="isShow" width="1500px">
+      <el-descriptions :column="4" border>
+        <el-descriptions-item label="任务名称">{{
+          formData.planName
+        }}</el-descriptions-item>
+        <el-descriptions-item label="任务类型">{{
+          getLabel(dict.type.resumption_plan_type,formData.planType)          
+        }}</el-descriptions-item>
+        <el-descriptions-item label="任务周期">{{
+           getLabel(dict.type.resumption_plan_cycle,formData.planCycle)
+        }}</el-descriptions-item>
+        <el-descriptions-item label="任务时间">{{
+          getLabel(dict.type.resumption_plan_exec,formData.planExec)
+        }}</el-descriptions-item>
+        <el-descriptions-item label="机构类型">{{
+          getLabel(orgTypeOptions,formData.execOrgType)
+        }}</el-descriptions-item>
+        <el-descriptions-item label="履职人员">
+          {{resumptionRoles.filter(r=>formData.roleList.includes(r.id)).map(r=>r.name).join("、")}}
+        </el-descriptions-item>
+        <el-descriptions-item label="任务次数"  :span="2">{{
+          formData.count
+        }}</el-descriptions-item>
+        <el-descriptions-item label="备注" :span="4">{{
+          formData.note
+        }}</el-descriptions-item>
+      </el-descriptions>
+      <el-table :data="tableData" style="width: 100%" height="400px">
+        <el-table-column prop="ruleName" label="履职手册"> </el-table-column>
+        <el-table-column prop="itemName" label="履职项"> </el-table-column>
+        <el-table-column prop="pointName" label="履职内容" width="300px">
+          <template slot-scope="scope">
+            <pre>{{ scope.row.pointName }}</pre>
+          </template>
+        </el-table-column>
+        <el-table-column v-if="false" prop="ofOrgId" label="所属机构id">
+        </el-table-column>
+        <el-table-column prop="areaName" label="履职区域"> </el-table-column>
+        <el-table-column prop="checkName" label="履职点位" v-if="false">
+        </el-table-column>
+        <el-table-column label="是否扫描">
+          <template v-slot="{ row }">
+            {{ row.pointScan ? "是" : "否" }}
+          </template>
+        </el-table-column>
+
+        <el-table-column label="必完成项">
+          <template v-slot="{ row }">
+            {{ row.required ? "是" : "否" }}
+          </template>
+        </el-table-column>
+      </el-table>
+      <div slot="footer" class="dialog-footer" style="margin-top:20px">       
+        <el-button @click="onHide">关闭</el-button>
+      </div>
+    </DialogCom>
+  </div>
+</template>
+
+<script>
+import { findAllRole } from "@/api/system/role";
+import * as api from "@/api/resumption/plan";
+import { getLabel } from "@/views/commonOption.js";
+export default {
+  dicts: [
+    "resumption_plan_type",
+    "resumption_plan_cycle",
+    "resumption_org_type",
+    "resumption_plan_status",
+    "sys_org_type",
+    "resumption_plan_exec",
+  ],
+  props: {
+    orgTypeOptions: {
+      type: Array,
+    },
+    ruleTypeOptions: {
+      type: Array,
+    },
+  },
+  data() {
+    return {
+      isShow: false,
+      tableData: [],
+      formData: {
+        roleList:[]
+      },
+      resumptionRoles:[],
+    };
+  },
+  methods: {
+    getLabel,
+    show(id) {
+      this.tableData = null;
+      api.get(id).then((r) => {
+        this.formData = r.data;
+        this.tableData = r.data.itemList;
+        this.isShow = true;
+        if (this.formData.execOrgType) {
+          this.getRolesByOrg();
+        }
+      });
+    },
+    getRolesByOrg() {
+      if (this.formData.execOrgType != null) {
+        let params = {
+          orgType: this.formData.execOrgType,
+        };
+        debugger
+        findAllRole(params).then((res) => {
+          this.resumptionRoles = res.data;
+        });
+      }
+    },
+    onHide() {
+      this.isShow = false;
+    },
+  },
+};
+</script>
+
+<style></style>

+ 39 - 35
src/views/resumption/plan/index.vue

@@ -307,7 +307,7 @@
                   >撤回</el-button
                 >
                 <el-button
-                  v-if="eqOrg(r.row)"
+                  v-if="showEditBtn(r.row)"
                   size="mini"
                   type="text"
                   icon="el-icon-edit-outline"
@@ -316,6 +316,14 @@
                   >编辑</el-button
                 >
                 <el-button
+                  v-if="!showEditBtn(r.row)"
+                  size="mini"
+                  type="text"
+                  icon="el-icon-edit-outline"
+                  @click="onDetail(r.row.id)"
+                  >详情</el-button
+                >
+                <el-button
                   v-if="showDelete(r.row)"
                   size="mini"
                   type="text"
@@ -344,6 +352,11 @@
       :orgTypeOptions="orgTypeOptions"
       :ruleTypeOptions="dict.type.rule_type"
     ></dialog-edit>
+    <dialog-detail
+      ref="detailDialog"
+      :orgTypeOptions="orgTypeOptions"
+      :ruleTypeOptions="dict.type.rule_type"
+    ></dialog-detail>
     <DialogDistribute ref="dialogDistribute" @select="sel"></DialogDistribute>
     <DialogThreeState ref="DialogThreeState"> </DialogThreeState>
   </div>
@@ -354,6 +367,7 @@ import DialogDistribute from "@/views/resumption/plan/distribute.vue";
 import OrgTree from "@/components/orgTree/orgQuerySelector.vue";
 import { mapState, mapMutations, mapGetters } from "vuex";
 import DialogEdit from "./dialog.edit";
+import DialogDetail from "./dialog.detail";
 import * as api from "@/api/resumption/plan";
 import { statusOptions, getLabel } from "./../../commonOption";
 import { allRole } from "@/api/system/role";
@@ -373,6 +387,7 @@ export default {
     OrgTree,
     DialogDistribute,
     DialogThreeState,
+    DialogDetail
   },
   data() {
     const { params, query } = this.$route;
@@ -423,46 +438,32 @@ export default {
   watch: {},
   computed: {
     ...mapGetters(["orgId", "orgName"]),
-    orgTypeOptions(){
-     if(!this.dict || !this.dict.type.sys_org_type==null)  {
-      return []
-     }
-     
-     return this.dict.type.sys_org_type.filter(t=>!["1","2","7","8"].includes(t.value))
-    }
+    orgTypeOptions() {
+      if (!this.dict || !this.dict.type.sys_org_type == null) {
+        return [];
+      }
+
+      return this.dict.type.sys_org_type.filter(
+        (t) => !["1", "2", "7", "8"].includes(t.value)
+      );
+    },
   },
   methods: {
     ...mapMutations([]),
-    //判断是否跟当前用户同机构
-    eqOrg(row) {
+    //是否显示编辑按钮
+    showEditBtn(row) {
+      if (row == null || row == undefined) {
+        return false;
+      }
+
+      //只能编辑所属机构是自己的
+      return row.planOfOrgId == this.orgId;
       // console.log(row.planOfOrgId,"row.planOfOrgId");
       // console.log(this.orgId,"this.orgId");
-      if (
-        row != null &&
-        row != undefined &&
-        (row.planCreateOrgId == this.orgId ||
-          (row.planOfOrgType == 3 && row.planOfOrgId == this.orgId))
-      ) {
-        return true;
-      }
-      return false;
     },
-    // eqOrg2(row) {
-    //   // console.log(row.planCreateOrgId,"row.planCreateOrgId");
-    //   // console.log(this.orgId,"this.orgId");
-    //   if (
-    //     row != null &&
-    //     row != undefined &&
-    //     row.planCreateOrgId == this.orgId &&
-    //     row.planOfOrgId == this.orgId
-    //   ) {
-    //     return true;
-    //   }
-    //   return false;
-    // },
-    showPublish(row) {      
+    showPublish(row) {
       //有父计划且父计划不是使用中状态,不能下发
-      if (row.parentStatus != 1 && row.parentId>0) {
+      if (row.parentStatus != 1 && row.parentId > 0) {
         return false;
       }
       //可以下发:本机构创建+状态为草稿、停用的计划
@@ -486,7 +487,7 @@ export default {
     },
     showDelete(row) {
       //本机构创建的计划,才能删除
-      return row.planCreateOrgId == this.orgId && row.planOfOrgId==this.orgId;
+      return row.planCreateOrgId == this.orgId && row.planOfOrgId == this.orgId;
     },
     showWithDraw(row) {
       //本机构创建是自己+状态为使用中
@@ -707,6 +708,9 @@ export default {
     onEdit(id, other = {}) {
       this.$refs.editDialog.show(id, other);
     },
+    onDetail(id) {
+      this.$refs.detailDialog.show(id);
+    },
     async onDel(row) {
       let msg = "";
       if (row.planStatus == 0) {

+ 4 - 0
src/views/system/dept/index.vue

@@ -836,6 +836,10 @@ this.isEdit=response.isEdit;
           this.getList();
           this.$modal.msgSuccess("删除成功");
           this.getDeptTree();
+          this.$store.dispatch("getOrgTree");
+          this.$store.dispatch("getDepTree");
+          this.$store.dispatch("getBusinessTree");
+          this.$store.dispatch("getWholeTree");
         })
         .catch(() => {});
     },