|
|
@ -83,9 +83,8 @@ |
|
|
|
<el-table :key="tableKey" v-loading="listLoading" :data="list" :border="true" style="width: 100%;" @selection-change="handleSelectionChange"> |
|
|
|
<el-table-column type="selection" align="center" width="50"/> |
|
|
|
<el-table-column label="序号" type="index" width="80" :index="indexMethod" align="center"/> |
|
|
|
<el-table-column label="操作" width="180px" align="center"> |
|
|
|
<el-table-column label="操作" width="100" align="center"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-button type="primary" size="mini" :disabled="!scope.row.updateBtn" @click="toEdit(scope.row)">编辑</el-button> |
|
|
|
<el-button type="primary" size="mini" @click="toInfo(scope.row)">查看</el-button> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
@ -171,6 +170,13 @@ export default { |
|
|
|
btnKey: 'toAdd', |
|
|
|
btnLabel: '新增' |
|
|
|
}, |
|
|
|
{ |
|
|
|
type: 'primary', |
|
|
|
size: 'small', |
|
|
|
icon: 'edit', |
|
|
|
btnKey: 'toEdit', |
|
|
|
btnLabel: '编辑' |
|
|
|
}, |
|
|
|
{ |
|
|
|
type: 'danger', |
|
|
|
size: 'small', |
|
|
@ -330,6 +336,9 @@ export default { |
|
|
|
case 'toAdd': |
|
|
|
this.toAdd() |
|
|
|
break |
|
|
|
case 'toEdit': |
|
|
|
this.toEdit() |
|
|
|
break |
|
|
|
case 'doDel': |
|
|
|
this.doDel() |
|
|
|
break |
|
|
@ -448,9 +457,17 @@ export default { |
|
|
|
this.viewState = 2 |
|
|
|
this.$refs['divAdd'].showAdd() |
|
|
|
}, |
|
|
|
toEdit(row) { |
|
|
|
this.viewState = 3 |
|
|
|
this.$refs['divAdd'].showEdit(row) |
|
|
|
toEdit() { |
|
|
|
if (this.multipleSelection.length === 1) { |
|
|
|
if (!this.multipleSelection[0].updateBtn) { |
|
|
|
this.viewState = 3 |
|
|
|
this.$refs['divAdd'].showEdit(this.multipleSelection) |
|
|
|
} else { |
|
|
|
this.$message({ showClose: true, type: 'error', message: '该记录已报备且仍在有效期内,无法再次编辑' }) |
|
|
|
} |
|
|
|
} else { |
|
|
|
this.$message({ showClose: true, type: 'error', message: '请选择一条记录进行操作' }) |
|
|
|
} |
|
|
|
}, |
|
|
|
toInfo(row) { |
|
|
|
this.viewState = 4 |
|
|
|