Browse Source
feat(agvStation): 添加AGV站点删除功能
feat(agvStation): 添加AGV站点删除功能
- 新增deleteAgvStation API接口用于删除站点 - 在表格操作列中添加删除按钮,仅对非活跃站点显示 - 实现删除站点的方法,包括二次确认对话框 - 添加删除加载状态控制 - 导入并注册删除站点的API方法master
4 changed files with 422 additions and 5 deletions
-
17src/api/system/importantErrorConfig.js
-
8src/views/modules/check/currentPhysicalInventory.vue
-
365src/views/modules/system/importantErrorConfig.vue
-
37src/views/modules/warehouse/sysErrorLog.vue
@ -0,0 +1,17 @@ |
|||
import { createAPI } from "@/utils/httpRequest.js"; |
|||
|
|||
// ========== 查询相关 ========== - rqrq
|
|||
|
|||
// 查询重要错误配置列表 - rqrq
|
|||
export const getImportantErrorConfigList = data => createAPI('/api/importantErrorConfig/list', 'POST', data) |
|||
|
|||
// ========== 保存相关 ========== - rqrq
|
|||
|
|||
// 新增重要错误配置 - rqrq
|
|||
export const addImportantErrorConfig = data => createAPI('/api/importantErrorConfig/add', 'POST', data) |
|||
|
|||
// 修改重要错误配置 - rqrq
|
|||
export const updateImportantErrorConfig = data => createAPI('/api/importantErrorConfig/update', 'POST', data) |
|||
|
|||
// 删除重要错误配置 - rqrq
|
|||
export const deleteImportantErrorConfig = data => createAPI('/api/importantErrorConfig/delete', 'POST', data) |
|||
@ -0,0 +1,365 @@ |
|||
<template> |
|||
<div class="mod-config"> |
|||
<!-- 查询表单 - rqrq --> |
|||
<el-form :inline="true" label-position="top" style="margin-top: 1px; margin-left: 0px;"> |
|||
<el-form-item label="工厂编码"> |
|||
<el-input v-model="queryData.site" style="width: 120px" placeholder="工厂编码" clearable @keyup.enter.native="getDataList()"></el-input> |
|||
</el-form-item> |
|||
<el-form-item label="错误描述"> |
|||
<el-input v-model="queryData.searchErrorDesc" style="width: 200px" placeholder="错误描述关键词" clearable @keyup.enter.native="getDataList()"></el-input> |
|||
</el-form-item> |
|||
<el-form-item label="是否启用"> |
|||
<el-select v-model="queryData.active" style="width: 120px" placeholder="全部" clearable> |
|||
<el-option label="启用" value="Y"></el-option> |
|||
<el-option label="禁用" value="N"></el-option> |
|||
</el-select> |
|||
</el-form-item> |
|||
|
|||
<el-form-item label=" "> |
|||
<el-button type="primary" @click="getDataList()">查询</el-button> |
|||
<el-button @click="resetQuery()">重置</el-button> |
|||
<el-button type="primary" class="yzzButtonAn" @click="addConfig()">新增</el-button> |
|||
</el-form-item> |
|||
</el-form> |
|||
|
|||
<!-- 数据表格 - rqrq --> |
|||
<el-table |
|||
:data="dataList" |
|||
:height="height" |
|||
border |
|||
highlight-current-row |
|||
v-loading="dataListLoading" |
|||
style="width: 100%;"> |
|||
<el-table-column |
|||
prop="id" |
|||
header-align="center" |
|||
align="center" |
|||
label="ID" |
|||
width="80"> |
|||
</el-table-column> |
|||
<el-table-column |
|||
prop="site" |
|||
header-align="center" |
|||
align="center" |
|||
label="工厂编码" |
|||
width="100"> |
|||
</el-table-column> |
|||
<el-table-column |
|||
prop="errorDesc" |
|||
header-align="center" |
|||
align="left" |
|||
label="错误描述关键词" |
|||
min-width="200" |
|||
show-overflow-tooltip> |
|||
</el-table-column> |
|||
<el-table-column |
|||
prop="active" |
|||
header-align="center" |
|||
align="center" |
|||
label="是否启用" |
|||
width="100"> |
|||
<template slot-scope="scope"> |
|||
<el-tag |
|||
:type="scope.row.active === 'Y' ? 'success' : 'danger'" |
|||
size="small"> |
|||
{{ scope.row.active === 'Y' ? '启用' : '禁用' }} |
|||
</el-tag> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column |
|||
prop="remark" |
|||
header-align="center" |
|||
align="left" |
|||
label="备注" |
|||
min-width="200" |
|||
show-overflow-tooltip> |
|||
</el-table-column> |
|||
<el-table-column |
|||
prop="createdBy" |
|||
header-align="center" |
|||
align="center" |
|||
label="创建人" |
|||
width="100"> |
|||
</el-table-column> |
|||
<el-table-column |
|||
prop="createdTime" |
|||
header-align="center" |
|||
align="center" |
|||
label="创建时间" |
|||
width="160"> |
|||
</el-table-column> |
|||
|
|||
<!-- 操作列 - rqrq --> |
|||
<el-table-column |
|||
header-align="center" |
|||
align="center" |
|||
fixed="right" |
|||
width="150" |
|||
label="操作"> |
|||
<template slot-scope="scope"> |
|||
<a type="text" @click="editConfig(scope.row)">修改</a> |
|||
<a type="text" @click="deleteConfig(scope.row)" style="margin-left: 10px;">删除</a> |
|||
</template> |
|||
</el-table-column> |
|||
</el-table> |
|||
|
|||
<!-- 分页 - rqrq --> |
|||
<el-pagination |
|||
@size-change="sizeChangeHandle" |
|||
@current-change="currentChangeHandle" |
|||
:current-page="pageIndex" |
|||
:page-sizes="[20, 50, 100, 1000]" |
|||
:page-size="pageSize" |
|||
:total="totalPage" |
|||
layout="total, sizes, prev, pager, next, jumper"> |
|||
</el-pagination> |
|||
|
|||
<!-- 新增/修改弹窗 - rqrq --> |
|||
<el-dialog |
|||
:title="dialogTitle" |
|||
:visible.sync="dialogVisible" |
|||
:close-on-click-modal="false" |
|||
v-drag |
|||
width="700px"> |
|||
<el-form :model="formData" :rules="formRules" ref="configForm" label-position="top" style="margin-top: 1px; margin-left: 0px;"> |
|||
<el-row :gutter="20"> |
|||
<el-col :span="12"> |
|||
<el-form-item label="工厂编码" prop="site"> |
|||
<el-input v-model="formData.site" placeholder="请输入工厂编码(如:55)"></el-input> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="12"> |
|||
<el-form-item label="是否启用" prop="active"> |
|||
<el-select v-model="formData.active" placeholder="请选择" style="width: 100%"> |
|||
<el-option label="启用" value="Y"></el-option> |
|||
<el-option label="禁用" value="N"></el-option> |
|||
</el-select> |
|||
</el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
|
|||
<el-row> |
|||
<el-col :span="24"> |
|||
<el-form-item label="错误描述关键词" prop="errorDesc"> |
|||
<el-input v-model="formData.errorDesc" placeholder="请输入错误描述关键词(如:栈板不存在、WCS返回失败)"></el-input> |
|||
</el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
|
|||
<el-row> |
|||
<el-col :span="24"> |
|||
<el-form-item label="备注说明"> |
|||
<el-input v-model="formData.remark" type="textarea" :rows="3" resize='none' placeholder="请输入备注说明"></el-input> |
|||
</el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
</el-form> |
|||
|
|||
<div slot="footer" class="dialog-footer" style="margin-top: 52px"> |
|||
<el-button type="primary" @click="saveConfig" :disabled="saveLoading"> |
|||
{{ saveLoading ? '保存中...' : '确定' }} |
|||
</el-button> |
|||
<el-button @click="dialogVisible = false" :disabled="saveLoading">取消</el-button> |
|||
</div> |
|||
</el-dialog> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import { |
|||
getImportantErrorConfigList, |
|||
addImportantErrorConfig, |
|||
updateImportantErrorConfig, |
|||
deleteImportantErrorConfig |
|||
} from '@/api/system/importantErrorConfig.js' |
|||
|
|||
export default { |
|||
data() { |
|||
return { |
|||
// 查询条件 - rqrq |
|||
queryData: { |
|||
site: '', |
|||
searchErrorDesc: '', |
|||
active: '', |
|||
page: 1, |
|||
limit: 20 |
|||
}, |
|||
// 表格高度 - rqrq |
|||
height: 450, |
|||
// 数据列表 - rqrq |
|||
dataList: [], |
|||
// 分页参数 - rqrq |
|||
pageIndex: 1, |
|||
pageSize: 20, |
|||
totalPage: 0, |
|||
dataListLoading: false, |
|||
// 弹窗相关 - rqrq |
|||
dialogVisible: false, |
|||
dialogTitle: '', |
|||
dialogType: '', // add 或 edit |
|||
formData: {}, |
|||
formRules: { |
|||
site: [ |
|||
{ required: true, message: '请输入工厂编码', trigger: 'blur' } |
|||
], |
|||
errorDesc: [ |
|||
{ required: true, message: '请输入错误描述关键词', trigger: 'blur' } |
|||
], |
|||
active: [ |
|||
{ required: true, message: '请选择是否启用', trigger: 'change' } |
|||
] |
|||
}, |
|||
saveLoading: false, |
|||
deleteLoading: false |
|||
} |
|||
}, |
|||
mounted() { |
|||
this.$nextTick(() => { |
|||
// 计算表格高度 - rqrq |
|||
this.height = window.innerHeight - 220; |
|||
}) |
|||
}, |
|||
activated() { |
|||
this.getDataList() |
|||
}, |
|||
methods: { |
|||
// 获取数据列表 - rqrq |
|||
getDataList() { |
|||
this.dataListLoading = true |
|||
this.queryData.page = this.pageIndex |
|||
this.queryData.limit = this.pageSize |
|||
|
|||
getImportantErrorConfigList(this.queryData).then(({data}) => { |
|||
this.dataListLoading = false |
|||
if (data && data.code === 0) { |
|||
this.dataList = data.page.list || [] |
|||
this.totalPage = data.page.totalCount || 0 |
|||
} else { |
|||
this.dataList = [] |
|||
this.totalPage = 0 |
|||
this.$alert(data.msg || '查询失败', '错误', { confirmButtonText: '确定' }) |
|||
} |
|||
}).catch(error => { |
|||
this.dataListLoading = false |
|||
console.error('查询重要错误配置列表失败:', error) |
|||
this.$alert('查询失败', '错误', { confirmButtonText: '确定' }) |
|||
}) |
|||
}, |
|||
|
|||
// 重置查询条件 - rqrq |
|||
resetQuery() { |
|||
this.queryData = { |
|||
site: '', |
|||
searchErrorDesc: '', |
|||
active: '', |
|||
page: 1, |
|||
limit: 20 |
|||
} |
|||
this.pageIndex = 1 |
|||
this.getDataList() |
|||
}, |
|||
|
|||
// 每页数量变化 - rqrq |
|||
sizeChangeHandle(val) { |
|||
this.pageSize = val |
|||
this.pageIndex = 1 |
|||
this.getDataList() |
|||
}, |
|||
|
|||
// 当前页变化 - rqrq |
|||
currentChangeHandle(val) { |
|||
this.pageIndex = val |
|||
this.getDataList() |
|||
}, |
|||
|
|||
// 新增配置 - rqrq |
|||
addConfig() { |
|||
this.dialogTitle = '新增重要错误配置' |
|||
this.dialogType = 'add' |
|||
this.formData = { |
|||
site: this.$store.state.user.site || '55', |
|||
errorDesc: '', |
|||
active: 'Y', |
|||
remark: '' |
|||
} |
|||
this.dialogVisible = true |
|||
this.$nextTick(() => { |
|||
this.$refs.configForm.clearValidate() |
|||
}) |
|||
}, |
|||
|
|||
// 修改配置 - rqrq |
|||
editConfig(row) { |
|||
this.dialogTitle = '修改重要错误配置' |
|||
this.dialogType = 'edit' |
|||
this.formData = Object.assign({}, row) |
|||
this.dialogVisible = true |
|||
this.$nextTick(() => { |
|||
this.$refs.configForm.clearValidate() |
|||
}) |
|||
}, |
|||
|
|||
// 保存配置 - rqrq |
|||
saveConfig() { |
|||
this.$refs.configForm.validate((valid) => { |
|||
if (!valid) { |
|||
return |
|||
} |
|||
this.saveLoading = true |
|||
|
|||
const apiMethod = this.dialogType === 'add' ? addImportantErrorConfig : updateImportantErrorConfig |
|||
|
|||
apiMethod(this.formData).then(({data}) => { |
|||
if (data && data.code === 0) { |
|||
this.$message.success(this.dialogType === 'add' ? '新增成功' : '修改成功') |
|||
this.dialogVisible = false |
|||
this.getDataList() |
|||
} else { |
|||
this.$alert(data.msg || '操作失败', '错误') |
|||
} |
|||
}).catch(error => { |
|||
console.error('保存重要错误配置失败:', error) |
|||
this.$alert('保存失败', '错误', { confirmButtonText: '确定' }) |
|||
}).finally(() => { |
|||
this.saveLoading = false |
|||
}) |
|||
}) |
|||
}, |
|||
|
|||
// 删除配置 - rqrq |
|||
deleteConfig(row) { |
|||
// 二次确认 - rqrq |
|||
this.$confirm(`确定要删除错误描述 "${row.errorDesc}" 的配置吗?`, '提示', { |
|||
confirmButtonText: '确定', |
|||
cancelButtonText: '取消', |
|||
type: 'warning' |
|||
}).then(() => { |
|||
this.deleteLoading = true |
|||
|
|||
deleteImportantErrorConfig({ id: row.id }).then(({data}) => { |
|||
if (data && data.code === 0) { |
|||
this.$message.success('删除成功') |
|||
this.getDataList() |
|||
} else { |
|||
this.$alert(data.msg || '删除失败', '错误') |
|||
} |
|||
}).catch(error => { |
|||
console.error('删除重要错误配置失败:', error) |
|||
this.$message.error('删除失败') |
|||
}).finally(() => { |
|||
this.deleteLoading = false |
|||
}) |
|||
}).catch(() => { |
|||
// 用户取消删除 - rqrq |
|||
}) |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style scoped> |
|||
/* 表格样式优化 - rqrq */ |
|||
.mod-config { |
|||
padding: 10px; |
|||
} |
|||
</style> |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue