Browse Source

技术花名册操作按钮权限处理

ljb 11 months ago
parent
commit
da1bb56128
2 changed files with 37 additions and 31 deletions
  1. 20 0
      src/option/technicianRoster.js
  2. 17 31
      src/views/technician-roster/index.vue

+ 20 - 0
src/option/technicianRoster.js

@@ -23,6 +23,7 @@ export default {
       search: true,
       search: true,
       width: 100,
       width: 100,
       align: 'center',
       align: 'center',
+      showOverflowTooltip: true,
       rules: [
       rules: [
         {
         {
           required: true,
           required: true,
@@ -39,6 +40,7 @@ export default {
       width: 160,
       width: 160,
       align: 'center',
       align: 'center',
       search: true,
       search: true,
+      showOverflowTooltip: true,
       rules: [
       rules: [
         {
         {
           required: true,
           required: true,
@@ -55,6 +57,7 @@ export default {
       search: true,
       search: true,
       width: 160,
       width: 160,
       align: 'center',
       align: 'center',
+      showOverflowTooltip: true,
       rules: [
       rules: [
         {
         {
           required: true,
           required: true,
@@ -75,6 +78,7 @@ export default {
       span: 12,
       span: 12,
       width: 50,
       width: 50,
       align: 'center',
       align: 'center',
+      showOverflowTooltip: true,
       rules: [
       rules: [
         {
         {
           required: true,
           required: true,
@@ -91,6 +95,7 @@ export default {
       span: 12,
       span: 12,
       width: 90,
       width: 90,
       align: 'center',
       align: 'center',
+      showOverflowTooltip: true,
       rules: [
       rules: [
         {
         {
           required: true,
           required: true,
@@ -106,6 +111,7 @@ export default {
       span: 12,
       span: 12,
       width: 120,
       width: 120,
       align: 'center',
       align: 'center',
+      showOverflowTooltip: true,
       rules: [
       rules: [
         {
         {
           required: true,
           required: true,
@@ -121,6 +127,7 @@ export default {
       span: 12,
       span: 12,
       width: 140,
       width: 140,
       search: true,
       search: true,
+      showOverflowTooltip: true,
       rules: [
       rules: [
         {
         {
           required: true,
           required: true,
@@ -136,6 +143,7 @@ export default {
       span: 12,
       span: 12,
       width: 140,
       width: 140,
       search: true,
       search: true,
+      showOverflowTooltip: true,
       rules: [
       rules: [
         {
         {
           required: true,
           required: true,
@@ -152,6 +160,7 @@ export default {
       width: 100,
       width: 100,
       align: 'center',
       align: 'center',
       search: true,
       search: true,
+      showOverflowTooltip: true,
       rules: [
       rules: [
         {
         {
           required: true,
           required: true,
@@ -167,6 +176,7 @@ export default {
       span: 12,
       span: 12,
       width: 100,
       width: 100,
       search: true,
       search: true,
+      showOverflowTooltip: true,
       rules: [
       rules: [
         {
         {
           required: true,
           required: true,
@@ -188,6 +198,7 @@ export default {
         label: 'dictValue',
         label: 'dictValue',
         value: 'dictKey',
         value: 'dictKey',
       },
       },
+      showOverflowTooltip: true,
       rules: [
       rules: [
         {
         {
           required: true,
           required: true,
@@ -205,6 +216,7 @@ export default {
       width: 140,
       width: 140,
       align: 'center',
       align: 'center',
       search: true,
       search: true,
+      showOverflowTooltip: true,
       rules: [
       rules: [
         {
         {
           required: true,
           required: true,
@@ -226,6 +238,7 @@ export default {
         label: 'dictValue',
         label: 'dictValue',
         value: 'dictKey',
         value: 'dictKey',
       },
       },
+      showOverflowTooltip: true,
       rules: [
       rules: [
         {
         {
           required: true,
           required: true,
@@ -247,6 +260,7 @@ export default {
         label: 'dictValue',
         label: 'dictValue',
         value: 'dictKey',
         value: 'dictKey',
       },
       },
+      showOverflowTooltip: true,
       rules: [
       rules: [
         {
         {
           required: true,
           required: true,
@@ -261,6 +275,7 @@ export default {
       type: 'input',
       type: 'input',
       span: 12,
       span: 12,
       width: 160,
       width: 160,
+      showOverflowTooltip: true,
       rules: [
       rules: [
         {
         {
           required: true,
           required: true,
@@ -276,6 +291,7 @@ export default {
       span: 12,
       span: 12,
       width: 140,
       width: 140,
       align: 'center',
       align: 'center',
+      showOverflowTooltip: true,
       rules: [
       rules: [
         {
         {
           required: true,
           required: true,
@@ -297,6 +313,7 @@ export default {
         label: 'dictValue',
         label: 'dictValue',
         value: 'dictKey',
         value: 'dictKey',
       },
       },
+      showOverflowTooltip: true,
       rules: [
       rules: [
         {
         {
           required: true,
           required: true,
@@ -312,6 +329,7 @@ export default {
       span: 12,
       span: 12,
       width: 100,
       width: 100,
       align: 'center',
       align: 'center',
+      showOverflowTooltip: true,
       rules: [
       rules: [
         {
         {
           required: true,
           required: true,
@@ -333,6 +351,7 @@ export default {
         label: 'dictValue',
         label: 'dictValue',
         value: 'dictKey',
         value: 'dictKey',
       },
       },
+      showOverflowTooltip: true,
       rules: [
       rules: [
         {
         {
           required: true,
           required: true,
@@ -354,6 +373,7 @@ export default {
         label: 'dictValue',
         label: 'dictValue',
         value: 'dictKey',
         value: 'dictKey',
       },
       },
+      showOverflowTooltip: true,
       rules: [
       rules: [
         {
         {
           required: true,
           required: true,

+ 17 - 31
src/views/technician-roster/index.vue

@@ -6,9 +6,11 @@
       v-model="form"
       v-model="form"
       :page.sync="page"
       :page.sync="page"
       :before-open="handleBeforeOpen"
       :before-open="handleBeforeOpen"
+      :permission="permissionList"
     >
     >
       <template slot="menuLeft">
       <template slot="menuLeft">
         <el-button
         <el-button
+          v-if="!isSelAnnual"
           type="danger"
           type="danger"
           size="small"
           size="small"
           icon="el-icon-delete"
           icon="el-icon-delete"
@@ -18,6 +20,7 @@
           删 除
           删 除
         </el-button>
         </el-button>
         <el-button
         <el-button
+          v-if="!isSelAnnual"
           type="success"
           type="success"
           size="small"
           size="small"
           plain
           plain
@@ -36,6 +39,7 @@
           导出
           导出
         </el-button>
         </el-button>
         <el-button
         <el-button
+          v-if="!isSelAnnual"
           type="primary"
           type="primary"
           size="small"
           size="small"
           plain
           plain
@@ -50,7 +54,7 @@
       
       
     </avue-crud>
     </avue-crud>
 
 
-    <el-dialog title="行政区划数据导入"
+    <el-dialog title="技术人员花名册导入"
       append-to-body
       append-to-body
       :visible.sync="excelBox"
       :visible.sync="excelBox"
       width="555px">
       width="555px">
@@ -74,7 +78,6 @@ import NProgress from 'nprogress';
 import 'nprogress/nprogress.css';
 import 'nprogress/nprogress.css';
 import {getToken} from "@/util/auth";
 import {getToken} from "@/util/auth";
 import {downloadXls} from "@/util/util";
 import {downloadXls} from "@/util/util";
-import {dateNow} from "@/util/date";
 
 
 
 
 export default window.$crudCommon({
 export default window.$crudCommon({
@@ -105,14 +108,13 @@ export default window.$crudCommon({
     }
     }
   },
   },
   computed: {
   computed: {
-    // permissionList() {
-    //   return {
-    //     addBtn: this.vaildData(this.permission.dictbiz_add, false),
-    //     delBtn: this.vaildData(this.permission.dictbiz_delete, false),
-    //     editBtn: this.vaildData(this.permission.dictbiz_edit, false),
-    //     viewBtn: false,
-    //   };
-    // },
+    permissionList() {
+      return {
+        addBtn: !this.isSelAnnual,
+        editBtn: !this.isSelAnnual,
+        delBtn: !this.isSelAnnual,
+      };
+    },
     excelOption() {
     excelOption() {
       return {
       return {
         submitBtn: false,
         submitBtn: false,
@@ -123,7 +125,7 @@ export default window.$crudCommon({
             props: 'yearAndMonth',
             props: 'yearAndMonth',
             type: 'input',
             type: 'input',
             span: 24,
             span: 24,
-            value: this.yearAndMonth,
+            value: this.params.yearAndMonth,
             disabled: true,
             disabled: true,
           },
           },
           {
           {
@@ -137,7 +139,7 @@ export default window.$crudCommon({
               res: 'data'
               res: 'data'
             },
             },
             data: {
             data: {
-              yearAndMonth: this.yearAndMonth,
+              yearAndMonth: this.params.yearAndMonth,
             },
             },
             tip: '请上传 .xls,.xlsx 标准格式文件',
             tip: '请上传 .xls,.xlsx 标准格式文件',
             action: '/api/kd-scientific/technician/import'
             action: '/api/kd-scientific/technician/import'
@@ -153,18 +155,7 @@ export default window.$crudCommon({
     },
     },
   },
   },
   methods: {
   methods: {
-    handleBeforeOpen(done, type) {
-      if (type == 'add' && this.isSelAnnual) {
-        this.$message.warning('请选择月份');
-        return;
-      }
-      done();
-    },
     handleImport() {
     handleImport() {
-      if (this.isSelAnnual) {
-        this.$message.warning("请选择月份");
-        return;
-      }
       this.excelBox = true;
       this.excelBox = true;
     },
     },
     uploadAfter(res, done, loading, column) {
     uploadAfter(res, done, loading, column) {
@@ -180,8 +171,8 @@ export default window.$crudCommon({
         type: "warning"
         type: "warning"
       }).then(() => {
       }).then(() => {
         NProgress.start();
         NProgress.start();
-        exportBlob(`/api/kd-scientific/technician/export?${this.website.tokenHeader}=${getToken()}`).then(res => {
-          downloadXls(res.data, `技术人员花名册${dateNow()}.xlsx`);
+        exportBlob(`/api/kd-scientific/technician/export?${this.website.tokenHeader}=${getToken()}&yearAndMonth=${this.params.yearAndMonth}`).then(res => {
+          downloadXls(res.data, `技术人员花名册${this.params.yearAndMonth}.xlsx`);
           NProgress.done();
           NProgress.done();
         })
         })
       });
       });
@@ -193,17 +184,12 @@ export default window.$crudCommon({
       // });
       // });
     },
     },
     handleReadyLastMonData() {
     handleReadyLastMonData() {
-      if (this.isSelAnnual) {
-        this.$message.warning("请选择月份");
-        return;
-      }
-      
       this.$confirm("确认要读取上个月的数据吗?", "提示", {
       this.$confirm("确认要读取上个月的数据吗?", "提示", {
         confirmButtonText: "确定",
         confirmButtonText: "确定",
         cancelButtonText: "取消",
         cancelButtonText: "取消",
         type: "warning"
         type: "warning"
       }).then(() => {
       }).then(() => {
-        let lastMonth = moment(this.yearAndMonth).subtract(1, 'months').format("YYYY-MM");
+        let lastMonth = moment(this.params.yearAndMonth).subtract(1, 'months').format("YYYY-MM");
         getLastMonthData({ yearAndMonth: lastMonth}).then(res => {
         getLastMonthData({ yearAndMonth: lastMonth}).then(res => {
           let data = res.data;
           let data = res.data;
           if (data.success) {
           if (data.success) {