This commit is contained in:
bb_pan 2025-12-11 11:25:00 +08:00
parent 89189acc25
commit 800234bf18
3 changed files with 42 additions and 12 deletions

View File

@ -17,6 +17,14 @@ export const getRetireApplyDetailAPI = (id) => {
}) })
} }
// 根据maIds获取设备信息
export const getDeviceByMaIdsAPI = (maIds) => {
return request({
url: `/material-mall/deviceRetireApply/getDetail/${maIds}`,
method: 'GET',
})
}
// 获取在修装备和工具列表(统一接口) // 获取在修装备和工具列表(统一接口)
export const getScrapItemListAPI = (data) => { export const getScrapItemListAPI = (data) => {
return request({ return request({

View File

@ -136,14 +136,11 @@
</span> </span>
</template> </template>
</el-table-column> </el-table-column>
<!-- <el-table-column align="center" show-overflow-tooltip prop="address" label="操作"> <el-table-column align="center" show-overflow-tooltip prop="address" label="操作">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="primary" size="mini" @click="onHandleRetire(scope.row)">退役</el-button> <el-button type="text" size="mini" @click="onHandleRetire(scope.row)">退役</el-button>
&lt;!&ndash; <el-button type="primary" size="mini" @click="onHandleRetireEquipment(scope.row)"> </template>
退役装备 </el-table-column>
</el-button> &ndash;&gt;
</template>
</el-table-column>-->
</el-table> </el-table>
</div> </div>
<div class="pagination-wrapper"> <div class="pagination-wrapper">
@ -219,9 +216,15 @@ export default {
}, },
// 退 // 退
onHandleRetire() { onHandleRetire(row) {
console.log('退役按钮') console.log('退役按钮')
this.$router.push('/equipment/equ-retire') // this.$router.push('/equipment/equ-retire')
this.$router.push({
path: '/equipment/retire-apply/detail/new',
query: {
maId: row.maId,
}
})
}, },
// //
onHandleReset() { onHandleReset() {

View File

@ -120,7 +120,7 @@
</template> </template>
<script> <script>
import { getRetireApplyDetailAPI, submitRetireApplyTaskAPI } from '@/api/EquipmentRetireApply/index.js' import { getRetireApplyDetailAPI, submitRetireApplyTaskAPI, getDeviceByMaIdsAPI } from '@/api/EquipmentRetireApply/index.js'
import AddItemDialog from './components/AddItemDialog' import AddItemDialog from './components/AddItemDialog'
import { getToken } from '@/utils/auth' import { getToken } from '@/utils/auth'
@ -159,6 +159,20 @@ export default {
} }
}, },
methods: { methods: {
async getInfo(){
try {
const res = await getDeviceByMaIdsAPI(this.$route.query.maId)
if (!res.data || res.data.length === 0) return
this.detailList = res.data.map(item => ({
...item,
scrapQuantity: item.scrapNum,
retireReason: item.reasonVal,
bmFileInfos: item.bmFileInfos || [],
}))
} catch (error) {
console.log('🚀 ~ error:', error)
}
},
async getDetail() { async getDetail() {
const id = this.$route.params.id const id = this.$route.params.id
if (id === 'new') { if (id === 'new') {
@ -349,7 +363,12 @@ export default {
}, },
created() { created() {
this.getDetail() if (this.$route.params.id) {
this.getDetail()
}
if (this.$route.query.maId) {
this.getInfo()
}
} }
} }
</script> </script>