Browse Source

feat(agvStation): 添加AGV站点删除功能

- 新增deleteAgvStation API接口用于删除站点
- 在表格操作列中添加删除按钮,仅对非活跃站点显示
- 实现删除站点的方法,包括二次确认对话框
- 添加删除加载状态控制
- 导入并注册删除站点的API方法
master
常熟吴彦祖 4 weeks ago
parent
commit
847a2cc811
  1. 2
      src/api/wcsSystem/agvStation.js
  2. 33
      src/views/modules/wcsSystem/agvStation.vue

2
src/api/wcsSystem/agvStation.js

@ -19,3 +19,5 @@ export const addAgvStation = data => createAPI('/wcsSystem/agvStation/add', 'POS
// 修改AGV站点 - rqrq // 修改AGV站点 - rqrq
export const updateAgvStation = data => createAPI('/wcsSystem/agvStation/update', 'POST', data) export const updateAgvStation = data => createAPI('/wcsSystem/agvStation/update', 'POST', data)
// 删除AGV站点 - rqrq
export const deleteAgvStation = data => createAPI('/wcsSystem/agvStation/delete', 'POST', data)

33
src/views/modules/wcsSystem/agvStation.vue

@ -81,10 +81,11 @@
header-align="center" header-align="center"
align="center" align="center"
fixed="right" fixed="right"
width="100"
width="150"
label="操作"> label="操作">
<template slot-scope="scope"> <template slot-scope="scope">
<a type="text" @click="editStation(scope.row)">修改</a> <a type="text" @click="editStation(scope.row)">修改</a>
<a type="text" @click="deleteStation(scope.row)" style="margin-left: 10px;" v-if="scope.row.active === 'N'">删除</a>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -224,6 +225,7 @@ import {
getAgvStationList, getAgvStationList,
addAgvStation, addAgvStation,
updateAgvStation, updateAgvStation,
deleteAgvStation,
getAreaOptions, getAreaOptions,
getStatusOptions getStatusOptions
} from '@/api/wcsSystem/agvStation.js' } from '@/api/wcsSystem/agvStation.js'
@ -438,6 +440,7 @@ export default {
] ]
}, },
saveLoading: false, saveLoading: false,
deleteLoading: false,
// - rqrq // - rqrq
areaOptions: [], areaOptions: [],
statusOptions: [], statusOptions: [],
@ -620,6 +623,34 @@ export default {
}) })
}) })
}, },
// - rqrq
deleteStation(row) {
// - rqrq
this.$confirm(`确定要删除站点 "${row.stationName}" 吗?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.deleteLoading = true
deleteAgvStation({ stationCode: row.stationCode }).then(({data}) => {
if (data && data.code === 0) {
this.$message.success('删除成功')
this.getDataList()
} else {
this.$alert(data.msg || '删除失败', '错误')
}
}).catch(error => {
console.error('删除AGV站点失败:', error)
this.$message.error('删除失败')
}).finally(() => {
this.deleteLoading = false
})
}).catch(() => {
// - rqrq
})
},
// - rqrq // - rqrq
createExportData() { createExportData() {
return this.$http({ return this.$http({

Loading…
Cancel
Save