|
|
@@ -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
|
|
|
})
|