Sfoglia il codice sorgente

角色管理权限

gks 1 anno fa
parent
commit
86e6388b83
3 ha cambiato i file con 123 aggiunte e 40 eliminazioni
  1. 9 0
      src/api/portal/GATHER/GATHER.js
  2. 113 39
      src/views/GATHER/index.vue
  3. 1 1
      src/views/system/role/index.vue

+ 9 - 0
src/api/portal/GATHER/GATHER.js

@@ -92,6 +92,15 @@ export function approve(data) {
   })
 }
 
+// 驳回审核
+export function bsqAudit(data) {
+  return request({
+    url: '/gather/bsqAudit',
+    method: 'post',
+    params: data
+  })
+}
+
 // 下载导入模板
 export function download(id) {
   return request({

+ 113 - 39
src/views/GATHER/index.vue

@@ -277,8 +277,6 @@
               >录入</el-button
             >
           </template>
-          <!-- && checkPermi(['gather:GATHER:add'])) -->
-
           <template
             v-if="
               scope.row.collStatus == 1 &&
@@ -287,7 +285,7 @@
             "
           >
             <el-popconfirm
-              title="确定提交审核吗?"
+              title="确定提交绩效审核吗?"
               @confirm="handleAudit(scope.row)"
             >
               <el-button
@@ -302,9 +300,12 @@
           <!--              已采集,未上报,未提交审核 或 审核拒绝-->
 
           <!-- collStatus = 1 , audit = 1 , -->
-          <!-- <template>{{ scope.row.collStatus == 1 &&
-                scope.row.audit == 1 &&
-                (scope.row.approveStatus == 0 || scope.row.approveStatus == null)}} </template> -->
+          <!-- <template>
+            {{ scope.row.collStatus }} || {{ scope.row.audit }}||
+            {{ scope.row.approveStatus }} || {{ scope.row.reportStatus }} ||
+            {{ checkPermi(["gather:GATHER:check"]) }}普通 ---
+            {{ checkPermi(["gather:GATHER:approve"]) }}管理
+          </template> -->
           <template
             v-if="
               scope.row.collStatus == 1 &&
@@ -314,18 +315,19 @@
               checkPermi(['gather:GATHER:approve'])
             "
           >
-            <el-popconfirm
+            <!-- <el-popconfirm
               title="确定提交吗?"
               @confirm="handleApprove(scope.row)"
+            > -->
+            <el-button
+              @click="handleApprove(scope.row)"
+              style="margin: 0 2px"
+              size="mini"
+              type="text"
+              slot="reference"
+              >提交审核</el-button
             >
-              <el-button
-                style="margin: 0 2px"
-                size="mini"
-                type="text"
-                slot="reference"
-                >提交审核</el-button
-              >
-            </el-popconfirm>
+            <!-- </el-popconfirm> -->
           </template>
 
           <!--              已采集,未上报,审核通过 -->
@@ -360,12 +362,13 @@
             >查看</el-button
           >
           <!-- {{scope.row.collStatus}}--{{scope.row.approveStatus}} -->
+
           <el-button
             style="margin: 0 2px"
             v-if="
-              scope.row.collStatus == 1 &&         // 已采集
-              scope.row.approveStatus == 0 &&              // 未审核
-              checkPermi(['gather:GATHER:edit'])   // 编辑权限
+              scope.row.collStatus == 1 && // 已采集
+              scope.row.audit == 0 && // 未审核
+              checkPermi(['gather:GATHER:edit']) // 编辑权限
             "
             size="mini"
             type="text"
@@ -461,17 +464,20 @@
           :label="item.normName"
           :name="item.normName"
         >
-          <template v-for="(listItem) in form.feeLists">
+          <template v-for="listItem in form.feeLists">
             <el-form
               v-if="listItem.normId == item.normId"
               :rules="validatorList(listItem.normfeeName)"
               :model="listItem"
               :ref="'form' + listItem.normfeeId"
               :key="listItem.normfeeId"
-            > <!-- :key="index + listIndex + listItem.normId" -->
+            >
+              <!-- :key="index + listIndex + listItem.normId" -->
               <!-- :rules="rules" ref="form" -->
               <el-form-item
-                :label="listItem.normfeeName + '(' + listItem.funit_dictText + ')'"
+                :label="
+                  listItem.normfeeName + '(' + listItem.funit_dictText + ')'
+                "
                 prop="collCalue"
               >
                 <!-- 这里科研失败!想动态绑定校验规则的 -->
@@ -501,7 +507,7 @@
       </el-tabs>
       <template v-else-if="this.form.type == 1">
         <el-form
-          v-for="(listItem) in form.feeLists"
+          v-for="listItem in form.feeLists"
           :model="listItem"
           :ref="'form' + listItem.normfeeId"
           :rules="rules"
@@ -509,7 +515,9 @@
         >
           <!-- :rules="rules" ref="form" -->
           <el-form-item
-            :label="listItem.normfeeName + '(' + listItem.funit_dictText + ')'"
+            :label="
+              listItem.normfeeName + '(' + listItem.funit_dictText + ')'
+            "
             prop="collCalue"
           >
             <!-- 这里科研失败!想动态绑定校验规则的 -->
@@ -532,6 +540,7 @@
     <!-- 查看或修改 -->
     <el-dialog
       center
+      @close="handleClose"
       :title="title"
       :visible.sync="openDetail"
       width="50%"
@@ -549,7 +558,7 @@
           :label="item.normName"
           :name="item.normName"
         >
-          <template v-for="(listItem) in form.feeLists">
+          <template v-for="listItem in form.feeLists">
             <el-form
               v-if="listItem.normId == item.normId"
               :model="listItem"
@@ -560,7 +569,9 @@
               <!-- :rules="rules" ref="form" -->
               <el-form-item
                 prop="collCalue"
-                :label="listItem.normfeeName + '(' + listItem.funit_dictText + ')'"
+                :label="
+                  listItem.normfeeName + '(' + listItem.funit_dictText + ')'
+                "
               >
                 <!-- 这里科研失败!想动态绑定校验规则的 -->
                 <!-- :prop="listItem.normfeeId" -->
@@ -592,7 +603,7 @@
 
       <template v-else-if="this.form.type == 1">
         <el-form
-          v-for="(listItem) in form.feeLists"
+          v-for="listItem in form.feeLists"
           :model="listItem"
           :ref="'form' + listItem.normfeeId"
           :rules="rules"
@@ -600,7 +611,9 @@
         >
           <!-- :rules="rules" ref="form" -->
           <el-form-item
-            :label="listItem.normfeeName + '(' + listItem.funit_dictText + ')'"
+            :label="
+              listItem.normfeeName + '(' + listItem.funit_dictText + ')'
+            "
             prop="collCalue"
           >
             <!-- 这里科研失败!想动态绑定校验规则的 -->
@@ -633,6 +646,12 @@
         <el-button type="primary" @click="submitForm('edit')" v-if="edit"
           >确 定</el-button
         >
+        <el-button type="primary" v-if="check" @click="handleCheck(1)"
+          >通 过</el-button
+        >
+        <el-button type="warning" v-if="check" @click="handleCheck(2)"
+          >驳 回</el-button
+        >
         <el-button type="primary" @click="cancel">返 回</el-button>
       </div>
     </el-dialog>
@@ -654,6 +673,7 @@ import {
   download,
   upload,
   uploadnew,
+  bsqAudit,
 } from "@/api/portal/GATHER/GATHER.js";
 import importFile from "./importFile.vue";
 import { saveAs } from "file-saver";
@@ -665,6 +685,10 @@ export default {
   name: "GATHER",
   data() {
     return {
+      // 审核、驳回
+      check: false,
+      // 数据id
+      dataId: null,
       edit: Boolean, //false 查看  true修改
       tabList: [],
       feeLists: [],
@@ -769,7 +793,7 @@ export default {
       let reg = /^[+-]?(0|([1-9]\d*))(\.\d+)?$/g;
       if (!reg.test(value)) {
         callback(new Error("请输入数字和正确格式的数字"));
-      } else if (typeof value == 'string' && value.split(".").length > 2) {
+      } else if (typeof value == "string" && value.split(".").length > 2) {
         callback(new Error("请输入正确格式的数字")); //防止输入多个小数点
       }
       // else if (value.indexOf('.') != -1 && value.split('.')[1].length > 2) {
@@ -783,7 +807,7 @@ export default {
       let reg = /^[+]?(0|([1-9]\d*))(\.\d+)?$/g;
       if (!reg.test(value)) {
         callback(new Error("请输入正数和正确格式的数字"));
-      } else if (typeof value == 'string' && value.split(".").length > 2) {
+      } else if (typeof value == "string" && value.split(".").length > 2) {
         callback(new Error("请输入正确格式的数字")); //防止输入多个小数点
       }
       // else if (value.indexOf('.') != -1 && value.split('.')[1].length > 2) {
@@ -880,6 +904,10 @@ export default {
       this.radio = this.GATHERList.indexOf(row);
       this.rowData = row;
     },
+
+    handleClose() {
+      this.check = false;
+    },
     /**
      * 打开上传弹窗
      * @params string type  old/new
@@ -937,18 +965,63 @@ export default {
       });
     },
     //提交审核
-    handleApprove(data) {
-      let datas = {
-        gatherId: data.id,
-        type: "1",
-      };
-      approve(datas).then((res) => {
-        if (res.code == 200) {
-          this.$modal.msgSuccess("提交审核成功");
-          this.getList();
+    handleApprove(row) {
+      this.tabList = [];
+      this.form = [];
+      const id = row.id || this.ids;
+      this.edit = false;
+      this.check = true;
+      this.dataId = row.id;
+      getGATHER(id).then((response) => {
+        //深拷贝,而不是拷贝地址
+        this.form = JSON.parse(JSON.stringify(response.data));
+        this.openDetail = true;
+        this.title = "数据查看";
+        //深拷贝,而不是拷贝地址
+        this.tabList = JSON.parse(JSON.stringify(response.data.feeLists));
+        let dataList = response.data.feeLists;
+        //去重获取tab
+        //遍历如果遇到相同的id则删掉
+        for (var i = 0; i < this.tabList.length - 1; i++) {
+          //设置激活的tab
+          if (i == 0) {
+            this.activeName = this.tabList[0].normName;
+          }
+          for (var j = i + 1; j < this.tabList.length; j++) {
+            if (this.tabList[i].normId == this.tabList[j].normId) {
+              this.tabList.splice(j, 1);
+              //因为数组长度减小1,所以直接 j++ 会漏掉一个元素,所以要 j--
+              j--;
+            }
+          }
         }
       });
     },
+    handleCheck(val) {
+      let data = {
+        gatherId: this.dataId,
+        type: 1,
+      };
+      let audit = {
+        gatherId: this.dataId,
+        auditType: 2,
+      };
+      if (val == 1) {
+        approve(data).then((res) => {
+          if (res.code == 200) {
+            this.$modal.msgSuccess("通过审核成功");
+            this.getList();
+          }
+        });
+      } else {
+        bsqAudit(audit).then((res) => {
+          if (res.code == 200) {
+            this.$modal.msgSuccess("驳回成功");
+            this.getList();
+          }
+        });
+      }
+    },
 
     handleClick(tab, event) {},
     /** 查询数据采集列表 */
@@ -962,6 +1035,7 @@ export default {
     },
     // 取消按钮
     cancel() {
+      this.check = false;
       this.open = false;
       this.openDetail = false;
       this.openUpload = false;
@@ -1153,7 +1227,7 @@ export default {
       p = this.form.feeLists.map((item, index) => {
         return new Promise((resolve, reject) => {
           this.$refs["form" + item.normfeeId][0].validate((valid) => {
-          // this.$refs["form" + index].validate((valid) => {
+            // this.$refs["form" + index].validate((valid) => {
             if (valid) {
               resolve(); //完成态
             } else {

+ 1 - 1
src/views/system/role/index.vue

@@ -119,7 +119,7 @@
         </template>
       </el-table-column>
       <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
-        <template slot-scope="scope" v-if="scope.row.roleId !== 1">
+        <template slot-scope="scope" v-if="scope.row.roleId !== 1 && scope.row.roleId !== 10 && scope.row.roleId !== 8 && scope.row.roleId !== 9" >
           <el-button
             size="mini"
             type="text"