scorpio 2 anni fa
parent
commit
3a5935a93c

+ 19 - 1
src/views/home/component/inspect/Inspect1.vue

@@ -13,7 +13,7 @@
           @row-save="rowSave"
           @row-update="rowUpdate">
         <template #menu="{row}">
-          <el-button text type='primary' icon='el-icon-plus' @click='report(row)'>
+          <el-button v-if='row.hasReport' text type='primary' icon='el-icon-plus' @click='report(row)'>
             {{ row.isReport === 1 ? "已上报" : "上报" }}
           </el-button>
         </template>
@@ -152,6 +152,24 @@ export default {
       this.loading = true
       this.$api.inspect.list(Object.assign(this.page, data)).then(res => {
         this.data = res.data.records
+        if (this.data.length > 0) {
+          const hasReport = this.data[0].hasReport
+          if (!hasReport) {
+            // hasReport === false 表示未最后一级,不需要上报或者其他操作
+            const index = this.option.column.findIndex(e => e.prop === 'reportTime')
+            this.option.column[index].hide = true
+          }
+          const sort = this.data[0].sort
+          if (sort !== 0) { // sort ===0 第一级,填报内容的第一级用户
+            this.option.delBtn = false
+            this.option.editBtn = false
+            const index = this.option.column.findIndex(e => e.prop === 'reportDeptName')
+            this.option.column[index].hide = false
+          } else { // 第一级部门,不显示上报部门
+            const index = this.option.column.findIndex(e => e.prop === 'reportDeptName')
+            this.option.column[index].hide = true
+          }
+        }
       }).finally(() => {
         this.loading = false
       })

+ 5 - 0
src/views/home/component/inspect/option1.js

@@ -34,6 +34,11 @@ export default {
         }
       ]
     },
+    {
+      label: '上报部门',
+      prop: 'reportDeptName',
+      display: false
+    },
     {
       label: '上报时间',
       prop: 'reportTime',

+ 7 - 2
src/views/home/component/inspect/option2.js

@@ -34,6 +34,11 @@ export default {
         }
       ]
     },
+    {
+      label: '上报部门',
+      prop: 'reportDeptName',
+      display: false
+    },
     {
       label: '上报时间',
       prop: 'reportTime',
@@ -41,12 +46,12 @@ export default {
     },
     {
       label: '整改情况',
-      prop: 'reportTime',
+      prop: 'rectification',
       display: false
     },
     {
       label: '整改完成时间',
-      prop: 'reportTime',
+      prop: 'rectificationTime',
       display: false
     }
   ]

+ 5 - 0
src/views/home/component/inspect/option3.js

@@ -34,6 +34,11 @@ export default {
         }
       ]
     },
+    {
+      label: '上报部门',
+      prop: 'reportDeptName',
+      display: false
+    },
     {
       label: '上报时间',
       prop: 'reportTime',

+ 5 - 0
src/views/home/component/inspect/option4.js

@@ -34,6 +34,11 @@ export default {
         }
       ]
     },
+    {
+      label: '上报部门',
+      prop: 'reportDeptName',
+      display: false
+    },
     {
       label: '上报时间',
       prop: 'reportTime',

+ 7 - 1
src/views/home/component/inspect/option5.js

@@ -34,10 +34,16 @@ export default {
         }
       ]
     },
+    {
+      label: '上报部门',
+      prop: 'reportDeptName',
+      display: false
+    },
     {
       label: '上报时间',
       prop: 'reportTime',
-      display: false
+      display: false,
+      hide: false
     }
   ]
 }