|
@@ -125,11 +125,11 @@
|
|
|
fixed="right"
|
|
|
header-align="center"
|
|
|
align="center"
|
|
|
- width="180"
|
|
|
+ width="120"
|
|
|
label="操作">
|
|
|
<template slot-scope="scope">
|
|
|
<el-button v-if="isAuth('prod:equipment:update')" type="text" size="small" @click="addOrUpdateHandle(scope.row.id, false)">编辑</el-button>
|
|
|
- <el-button v-if="isAuth('prod:equipment:updateState')" type="text" size="small" @click="damaged(scope.row.id)">报损</el-button>
|
|
|
+ <el-button v-if="isAuth('prod:equipment:updateState') && Number(scope.row.state) < 3" type="text" size="small" @click="damaged(scope.row.id)">报损</el-button>
|
|
|
<!-- <el-button v-if="isAuth('prod:equipment:record')" type="text" size="small" @click="addOrUpdateHandle(scope.row.id, true)">点检记录</el-button>-->
|
|
|
</template>
|
|
|
</el-table-column>
|
|
@@ -247,7 +247,30 @@
|
|
|
},
|
|
|
// 报损
|
|
|
damaged (id) {
|
|
|
- // todo
|
|
|
+ if (!id) return
|
|
|
+ this.$confirm(`确定报损?`, '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
+ }).then(() => {
|
|
|
+ this.$http({
|
|
|
+ url: this.$http.adornUrl(`/biz-service/equipment/updateState/${id}`),
|
|
|
+ method: 'POST'
|
|
|
+ }).then(({data}) => {
|
|
|
+ if (data && data.code === '200') {
|
|
|
+ this.$message({
|
|
|
+ message: '操作成功',
|
|
|
+ type: 'success',
|
|
|
+ duration: 1500,
|
|
|
+ onClose: () => {
|
|
|
+ this.getDataList()
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ this.$message.error(data.msg)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }).catch(() => {})
|
|
|
},
|
|
|
// 转换属性“状态”
|
|
|
formatState (row) {
|