Selaa lähdekoodia

辅助指标录入,权限控制

gks 1 vuosi sitten
vanhempi
commit
30cf84c9a2
3 muutettua tiedostoa jossa 119 lisäystä ja 78 poistoa
  1. 88 57
      src/views/GATHER/index.vue
  2. 25 15
      src/views/norm/quotaBonded.vue
  3. 6 6
      src/views/norm/quotafee.vue

+ 88 - 57
src/views/GATHER/index.vue

@@ -244,7 +244,12 @@
             >未提交审核</span
           >
           <span
-            v-if="scope.row.audit == 1 && (scope.row.approveStatus == 0 || scope.row.approveStatus == null) && scope.row.approveTime == null"
+            v-if="
+              scope.row.audit == 1 &&
+              (scope.row.approveStatus == 0 ||
+                scope.row.approveStatus == null) &&
+              scope.row.approveTime == null
+            "
             >未审核</span
           >
 
@@ -471,23 +476,32 @@
           :label="item.normName"
           :name="item.normName"
         >
-        <el-row :gutter="10">
-          <template v-for="listItem in form.feeLists">
-            <el-form
-              v-if="listItem.normId == item.normId"
-              :rules="validatorList(listItem.normfeeCode,listItem.normfeeName,listItem.sendValue)"
-              :model="listItem"
-              :ref="'form' + listItem.normfeeId"
-              :key="listItem.normfeeId"
-              :disabled = "listItem.sendValue == 1"
-            >
-              <!-- :key="index + listIndex + listItem.normId" -->
-              <!-- :rules="rules" ref="form" -->
+          <el-row :gutter="10">
+            <template v-for="listItem in form.feeLists">
+              <el-form
+                v-if="listItem.normId == item.normId"
+                :rules="
+                  validatorList(
+                    listItem.normfeeCode,
+                    listItem.normfeeName,
+                    listItem.sendValue
+                  )
+                "
+                :model="listItem"
+                :ref="'form' + listItem.normfeeId"
+                :key="listItem.normfeeId"
+                :disabled="listItem.sendValue == 1"
+              >
+                <!-- :key="index + listIndex + listItem.normId" -->
+                <!-- :rules="rules" ref="form" -->
 
-                <el-col :span="12" >
+                <el-col :span="12">
                   <el-form-item
                     :label="
-                      listItem.normfeeName + '(' + listItem.funit_dictText + ')'
+                      listItem.normfeeName +
+                      '(' +
+                      listItem.funit_dictText +
+                      ')'
                     "
                     prop="collCalue"
                   >
@@ -499,12 +513,10 @@
                       :placeholder="'请输入' + listItem.normfeeName"
                     ></el-input>
                   </el-form-item>
-              </el-col >
-
-            </el-form>
-
-          </template>
-        </el-row>
+                </el-col>
+              </el-form>
+            </template>
+          </el-row>
           <!-- 这里是第二种写法 -->
           <!-- <el-form :model="form" label-width="300px">
             <el-form-item
@@ -574,32 +586,39 @@
           :label="item.normName"
           :name="item.normName"
         >
-          <template v-for="listItem in form.feeLists">
-            <el-form
-              v-if="listItem.normId == item.normId"
-              :model="listItem"
-              :ref="'form' + listItem.normfeeId"
-              :rules="rules"
-              :key="listItem.normfeeId"
-            >
-              <!-- :rules="rules" ref="form" -->
-              <el-form-item
-                prop="collCalue"
-                :label="
-                  listItem.normfeeName + '(' + listItem.funit_dictText + ')'
-                "
+          <el-row :gutter="10">
+            <template v-for="listItem in form.feeLists">
+              <el-form
+                v-if="listItem.normId == item.normId"
+                :model="listItem"
+                :ref="'form' + listItem.normfeeId"
+                :rules="rules"
+                :key="listItem.normfeeId"
               >
-                <!-- 这里科研失败!想动态绑定校验规则的 -->
-                <!-- :prop="listItem.normfeeId" -->
-                <!-- :rules="rules.listItem.normfeeId" -->
-                <el-input
-                  :disabled="!edit"
-                  v-model="listItem.collCalue"
-                  :placeholder="'请输入' + listItem.normfeeName"
-                ></el-input>
-              </el-form-item>
-            </el-form>
-          </template>
+                <!-- :rules="rules" ref="form" -->
+                <el-col :span="12">
+                  <el-form-item
+                    prop="collCalue"
+                    :label="
+                      listItem.normfeeName +
+                      '(' +
+                      listItem.funit_dictText +
+                      ')'
+                    "
+                  >
+                    <!-- 这里科研失败!想动态绑定校验规则的 -->
+                    <!-- :prop="listItem.normfeeId" -->
+                    <!-- :rules="rules.listItem.normfeeId" -->
+                    <el-input
+                      :disabled="!edit"
+                      v-model="listItem.collCalue"
+                      :placeholder="'请输入' + listItem.normfeeName"
+                    ></el-input>
+                  </el-form-item>
+                </el-col>
+              </el-form>
+            </template>
+          </el-row>
 
           <!-- 这里是第二种写法 -->
           <!-- <el-form :model="form" label-width="150px">
@@ -834,14 +853,28 @@ export default {
         callback();
       }
     },
-    validatorList(code,name,sendValue) {
+    validatorList(code, name, sendValue) {
       if (typeof name != "string") return;
-      if (sendValue==1) return;
+      if (sendValue == 1) return;
 
-      if(code == 'A001' || code == 'A002' || code == 'A003' || code == 'A004' || code == 'A005' || code == 'A006' || code == 'A007' || code == 'A008' ||
-        code == 'C002' || code == 'C003' || code == 'D001' ||
-        code == 'E001' || code == 'E002' || code == 'E003' || code == 'E004' ||
-        code == 'F001' || code == 'F002'
+      if (
+        code == "A001" ||
+        code == "A002" ||
+        code == "A003" ||
+        code == "A004" ||
+        code == "A005" ||
+        code == "A006" ||
+        code == "A007" ||
+        code == "A008" ||
+        code == "C002" ||
+        code == "C003" ||
+        code == "D001" ||
+        code == "E001" ||
+        code == "E002" ||
+        code == "E003" ||
+        code == "E004" ||
+        code == "F001" ||
+        code == "F002"
       ) {
         return {
           collCalue: [
@@ -849,7 +882,7 @@ export default {
             { trigger: "blur", validator: this.validatorFloatNum },
           ],
         };
-      } else if(code == 'A009' || code == 'A010') {
+      } else if (code == "A009" || code == "A010") {
         return {
           collCalue: [
             { required: true, message: "不能为空", trigger: "blur" },
@@ -1034,7 +1067,7 @@ export default {
         }
       });
     },
-    handleCheck(val,value) {
+    handleCheck(val, value) {
       // console.log(value)
       let data = {
         gatherId: this.dataId,
@@ -1074,7 +1107,7 @@ export default {
       })
         .then(({ value }) => {
           // console.log(666,value);
-          this.handleCheck(2,value);
+          this.handleCheck(2, value);
           // this.$message({
           //   type: 'success',
           //   message: '你的邮箱是: ' + value
@@ -1201,7 +1234,6 @@ export default {
       });
     },
 
-
     handleAudit(row) {
       let data = {
         type: "1",
@@ -1302,7 +1334,6 @@ export default {
             }
           });
         });
-
       });
       Promise.all(p)
         .then(() => {

+ 25 - 15
src/views/norm/quotaBonded.vue

@@ -29,9 +29,11 @@
         </el-select>
       </el-form-item>
       <el-form-item>
-        <el-button type="primary" icon="el-icon-search" @click="handleQuery"
-          >搜索</el-button
-        >
+        <el-button
+          type="primary"
+          icon="el-icon-search"
+          @click="handleQuery"
+          >搜索</el-button>
         <el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
       </el-form-item>
     </el-form>
@@ -42,7 +44,7 @@
           type="primary"
           icon="el-icon-plus"
           @click="handleAdd"
-          v-hasPermi="['business:QUOTABONDED:add']"
+          v-if="checkPermi(['business:QUOTABONDED:add'])"
           >新增</el-button
         >
       </el-col>
@@ -52,7 +54,7 @@
           icon="el-icon-edit"
           :disabled="single"
           @click="handleUpdate"
-          v-hasPermi="['business:QUOTABONDED:edit']"
+          v-if="checkPermi(['business:QUOTABONDED:edit'])"
           >修改</el-button
         >
       </el-col>
@@ -62,7 +64,7 @@
           icon="el-icon-delete"
           :disabled="multiple"
           @click="handleDelete"
-          v-hasPermi="['business:QUOTABONDED:remove']"
+          v-if="checkPermi(['business:QUOTABONDED:remove'])"
           >删除</el-button
         >
       </el-col>
@@ -119,11 +121,13 @@
       <el-table-column label="操作" align="center" fixed="right" width="180">
         <template slot-scope="scope">
           <el-button
-            v-if="scope.row.auditStatus == 0 || scope.row.auditStatus == null"
+            v-if="
+              (scope.row.auditStatus == 0 || scope.row.auditStatus == null) &&
+              checkPermi(['business:QUOTABONDED:edit'])
+            "
             size="mini"
             type="text"
             @click="handleApprove(scope.row)"
-            v-hasPermi="['business:QUOTABONDED:remove']"
             >提交审核</el-button
           >
 
@@ -131,42 +135,44 @@
             v-if="
               scope.row.auditStatus == 1 &&
               (scope.row.approvalStatus == 0 ||
-                scope.row.approvalStatus == null)
+                scope.row.approvalStatus == null) &&
+              checkPermi(['business:QUOTABONDED:edit'])
             "
             size="mini"
             type="text"
             @click="handleAdminApprove(scope.row)"
-            v-hasPermi="['business:QUOTABONDED:remove']"
             >审核</el-button
           >
 
           <el-button
             v-if="
               scope.row.approvalStatus == 1 &&
-              (scope.row.reportStatus == 0 || scope.row.reportStatus == null)
+              (scope.row.reportStatus == 0 || scope.row.reportStatus == null) &&
+              checkPermi(['business:QUOTABONDED:edit'])
             "
             size="mini"
             type="text"
             icon="el-icon-delete"
             @click="handleReport(scope.row)"
-            v-hasPermi="['business:QUOTABONDED:remove']"
             >上报</el-button
           >
           <el-button
-            v-if="scope.row.auditStatus == 0 || scope.row.auditStatus == null"
+            v-if="
+              (scope.row.auditStatus == 0 || scope.row.auditStatus == null) &&
+              checkPermi(['business:QUOTABONDED:edit'])
+            "
             size="mini"
             type="text"
             icon="el-icon-edit"
             @click="handleUpdate(scope.row)"
-            v-hasPermi="['business:QUOTABONDED:edit']"
             >修改</el-button
           >
           <el-button
+            v-if="checkPermi(['business:QUOTABONDED:remove'])"
             size="mini"
             type="text"
             icon="el-icon-delete"
             @click="handleDelete(scope.row)"
-            v-hasPermi="['business:QUOTABONDED:remove']"
             >删除</el-button
           >
         </template>
@@ -174,6 +180,7 @@
     </el-table>
 
     <pagination
+      v-if="checkPermi('business:QUOTABONDED:list')"
       v-show="total > 0"
       :total="total"
       :page.sync="queryParams.pageNum"
@@ -326,6 +333,7 @@ import { listQUOTAFEERole } from "@/api/norm/QUOTAFEE";
 import { listAllBONDED } from "@/api/portal/BONDED/BONDED.js";
 import { uploadFiles, downloadFiles } from "@/api/common";
 import { listDept } from "@/api/system/dept";
+import { checkPermi,checkRole } from "@/utils/permission"; // 权限判断函数
 
 export default {
   name: "QUOTABONDED",
@@ -407,6 +415,8 @@ export default {
     this.getDeptList();
   },
   methods: {
+    checkPermi,
+    checkRole,
     // 获取保税区列表
     getDeptList() {
       this.loading = true;

+ 6 - 6
src/views/norm/quotafee.vue

@@ -49,21 +49,21 @@
       <el-table :data="QUOTAFEEList" @selection-change="handleSelectionChange">
         <el-table-column type="selection" width="55" align="center" />
 
-        <el-table-column label="指标分类" width="85" align="center" prop="normName">
+        <el-table-column label="指标分类"  align="center" prop="normName">
         </el-table-column>
         <!--<el-table-column label="保税区id" align="center" prop="bondedId">
         </el-table-column>-->
-        <el-table-column label="指标名称" width="250" align="center" prop="quotaName">
+        <el-table-column label="指标名称"  align="center" prop="quotaName">
         </el-table-column>
-        <el-table-column label="指标内容" width="400" align="center" prop="content">
+        <el-table-column label="指标内容" align="center" prop="content">
         </el-table-column>
-        <el-table-column label="得分" width="85" align="center" prop="score">
+        <el-table-column label="得分"  align="center" prop="score">
         </el-table-column>
-        <el-table-column label="确认方式" width="200" align="center" prop="confirmWay">
+        <el-table-column label="确认方式" align="center" prop="confirmWay">
         </el-table-column>
         <el-table-column label="项次" width="85" align="center" prop="sort">
         </el-table-column>
-        <el-table-column label="操作" align="center" fixed="right" width="150">
+        <el-table-column label="操作" align="center"  width="150">
           <template slot-scope="scope">
             <el-button
               size="mini"