Browse Source

feat(noOrderIssue): 添加目的地选择和自动保存功能

- 在无订单通知界面添加目的地下拉选择组件
- 实现目的地修改后的自动保存功能
- 添加三个新的API接口用于更新目的地、获取明细信息和区域选项
- 在预览对话框打开时并行加载库存数据、明细信息和区域下拉框数据
- 实现目的地编辑权限控制(仅shoporder类型可编辑)
- 添加目的地更新状态提示和错误处理机制
- 实现推送WCS前的目的地保存状态检查
master
常熟吴彦祖 6 days ago
parent
commit
e1e49c981a
  1. 11
      src/api/orderIssure/noOrderIssueNotify.js
  2. 59
      src/views/modules/automatedWarehouse/palletMergeQuery.vue
  3. 160
      src/views/modules/automatedWarehouse/sopManagement.vue
  4. 133
      src/views/modules/noOrderIssue/noOrderNotification.vue

11
src/api/orderIssure/noOrderIssueNotify.js

@ -15,3 +15,14 @@ export const uploadNoorderNotifyExcel = data => createAPI(`/orderIssure/issureNo
// 上传报废Excel并查询库存信息 - rqrq // 上传报废Excel并查询库存信息 - rqrq
export const uploadBaoFeiExcel = data => createAPI(`/orderIssure/issureNotify/uploadBaoFeiExcel`,'post',data) export const uploadBaoFeiExcel = data => createAPI(`/orderIssure/issureNotify/uploadBaoFeiExcel`,'post',data)
// ==================== 推送WCS相关 - rqrq ====================
// 更新申请单明细的目的地 - rqrq
export const updateProductionArea = data => createAPI(`/orderIssure/issureNotify/updateProductionArea`,'post',data)
// 获取第一条申请单明细的信息 - rqrq
export const getFirstOrderListDetail = data => createAPI(`/orderIssure/issureNotify/getFirstOrderListDetail`,'post',data)
// 获取可选区域列表(用于目的地下拉框)- rqrq
export const getAreaOptionsForChange = data => createAPI(`/wcsIntegration/getAreaOptionsForChange`,'post',data)

59
src/views/modules/automatedWarehouse/palletMergeQuery.vue

@ -18,6 +18,15 @@
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<!-- 最大已用数量查询条件 - rqrq -->
<el-form-item label="最大已用数量">
<el-input
v-model="searchData.maxPositionCount"
placeholder="请输入"
style="width: 120px" type="number"
>
</el-input>
</el-form-item>
<el-form-item :label="' '"> <el-form-item :label="' '">
<el-button type="primary" @click="searchTable()" :disabled="!searchData.palletType">查询</el-button> <el-button type="primary" @click="searchTable()" :disabled="!searchData.palletType">查询</el-button>
</el-form-item> </el-form-item>
@ -74,6 +83,17 @@
</el-table-column> </el-table-column>
</el-table> </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>
</div> </div>
</template> </template>
@ -93,9 +113,16 @@ export default {
submitLoading: false, submitLoading: false,
selectedRows: [], selectedRows: [],
palletTypeOptions: [], palletTypeOptions: [],
// - rqrq
pageIndex: 1,
pageSize: 20,
totalPage: 0,
searchData: { searchData: {
site: this.$store.state.user.site || '55', site: this.$store.state.user.site || '55',
palletType: ''
palletType: '',
maxPositionCount: null, // - rqrq
page: 1,
limit: 20
}, },
// - rqrq // - rqrq
columnList: [ columnList: [
@ -236,6 +263,8 @@ export default {
handlePalletTypeChange() { handlePalletTypeChange() {
this.dataList = [] this.dataList = []
this.selectedRows = [] this.selectedRows = []
this.totalPage = 0
this.pageIndex = 1
if (this.$refs.mainTable) { if (this.$refs.mainTable) {
this.$refs.mainTable.clearSelection() this.$refs.mainTable.clearSelection()
} }
@ -254,10 +283,24 @@ export default {
this.$refs.mainTable.clearSelection() this.$refs.mainTable.clearSelection()
} }
// - rqrq
this.searchData.page = this.pageIndex
this.searchData.limit = this.pageSize
searchPalletMergeList(this.searchData).then(({ data }) => { searchPalletMergeList(this.searchData).then(({ data }) => {
this.dataListLoading = false this.dataListLoading = false
if (data && data.code == 0) { if (data && data.code == 0) {
// - rqrq
if (data.page) {
this.dataList = data.page.list || []
this.pageIndex = data.page.currPage
this.pageSize = data.page.pageSize
this.totalPage = data.page.totalCount
} else {
// - rqrq
this.dataList = data.rows || [] this.dataList = data.rows || []
this.totalPage = this.dataList.length
}
if (this.dataList.length === 0) { if (this.dataList.length === 0) {
this.$message({ this.$message({
message: '没有找到需要合托的托盘', message: '没有找到需要合托的托盘',
@ -267,14 +310,27 @@ export default {
} }
} else { } else {
this.dataList = [] this.dataList = []
this.totalPage = 0
this.$alert(data.msg || '查询失败', '错误', { confirmButtonText: '确定' }) this.$alert(data.msg || '查询失败', '错误', { confirmButtonText: '确定' })
} }
}).catch(() => { }).catch(() => {
this.dataListLoading = false this.dataListLoading = false
this.dataList = [] this.dataList = []
this.totalPage = 0
this.$message.error('查询失败') this.$message.error('查询失败')
}) })
}, },
// - rqrq
sizeChangeHandle(val) {
this.pageSize = val
this.pageIndex = 1
this.searchTable()
},
// - rqrq
currentChangeHandle(val) {
this.pageIndex = val
this.searchTable()
},
// / - rqrq // / - rqrq
handleRowClick(row) { handleRowClick(row) {
this.$refs.mainTable.toggleRowSelection(row) this.$refs.mainTable.toggleRowSelection(row)
@ -341,4 +397,3 @@ export default {
margin-right: 4px; margin-right: 4px;
} }
</style> </style>

160
src/views/modules/automatedWarehouse/sopManagement.vue

@ -50,31 +50,6 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="按钮/功能">
<el-select
v-model="queryData.functionButton"
placeholder="全部按钮"
style="width: 150px"
filterable
clearable>
<el-option label="全部按钮" value=""></el-option>
<el-option
v-for="item in buttonOptions"
:key="item"
:label="item"
:value="item">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="错误类型">
<el-select v-model="queryData.searchErrorType" placeholder="请选择" style="width: 100px" clearable>
<el-option label="全部" value=""></el-option>
<el-option label="后端" value="BACKEND"></el-option>
<el-option label="前端" value="FRONTEND"></el-option>
</el-select>
</el-form-item>
<el-form-item label="错误信息"> <el-form-item label="错误信息">
<el-input v-model="queryData.searchErrorMessage" style="width: 180px" placeholder="错误信息关键字" clearable></el-input> <el-input v-model="queryData.searchErrorMessage" style="width: 180px" placeholder="错误信息关键字" clearable></el-input>
</el-form-item> </el-form-item>
@ -86,7 +61,7 @@
</el-form> </el-form>
<!-- 当前选中页面信息 - rqrq --> <!-- 当前选中页面信息 - rqrq -->
<div v-if="currentUrlConfig" class="url-info-card">
<div v-if="false" class="url-info-card">
<el-card shadow="never"> <el-card shadow="never">
<div slot="header" class="clearfix"> <div slot="header" class="clearfix">
<span> <span>
@ -117,33 +92,27 @@
<el-table-column prop="seqNo" label="序号" width="60" header-align="center" align="center"></el-table-column> <el-table-column prop="seqNo" label="序号" width="60" header-align="center" align="center"></el-table-column>
<el-table-column prop="errorMessage" label="错误信息" min-width="280" header-align="center" show-overflow-tooltip>
<el-table-column prop="errorMessage" label="错误信息" min-width="300" header-align="center" show-overflow-tooltip>
<template slot-scope="scope"> <template slot-scope="scope">
<span style="color: #F56C6C">{{ scope.row.errorMessage }}</span> <span style="color: #F56C6C">{{ scope.row.errorMessage }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="errorType" label="类型" width="80" header-align="center" align="center">
<template slot-scope="scope">
<el-tag :type="scope.row.errorType === 'BACKEND' ? 'warning' : 'info'" size="mini">
{{ scope.row.errorType === 'BACKEND' ? '后端' : '前端' }}
</el-tag>
</template>
</el-table-column>
<!-- <el-table-column prop="errorType" label="类型" width="80" header-align="center" align="center">-->
<!-- <template slot-scope="scope">-->
<!-- <el-tag :type="scope.row.errorType === 'BACKEND' ? 'warning' : 'info'" size="mini">-->
<!-- {{ scope.row.errorType === 'BACKEND' ? '后端' : '前端' }}-->
<!-- </el-tag>-->
<!-- </template>-->
<!-- </el-table-column>-->
<el-table-column prop="errorSource" label="错误来源" width="180" header-align="center" show-overflow-tooltip>
<template slot-scope="scope">
<span style="color: #909399; font-size: 12px">{{ scope.row.errorSource }}</span>
</template>
</el-table-column>
<el-table-column prop="defaultSolution" label="默认处理方式" min-width="220" header-align="center" show-overflow-tooltip>
<el-table-column prop="defaultSolution" label="默认处理方式" min-width="250" header-align="center" show-overflow-tooltip>
<template slot-scope="scope"> <template slot-scope="scope">
<span style="color: #67C23A">{{ scope.row.defaultSolution || '-' }}</span> <span style="color: #67C23A">{{ scope.row.defaultSolution || '-' }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="userSolution" label="用户补充处理方式" min-width="220" header-align="center" show-overflow-tooltip>
<el-table-column prop="userSolution" label="用户补充处理方式" min-width="250" header-align="center" show-overflow-tooltip>
<template slot-scope="scope"> <template slot-scope="scope">
<span style="color: #409EFF">{{ scope.row.userSolution || '-' }}</span> <span style="color: #409EFF">{{ scope.row.userSolution || '-' }}</span>
</template> </template>
@ -201,7 +170,7 @@
<el-row style="margin-top: 52px"> <el-row style="margin-top: 52px">
<el-col :span="24"> <el-col :span="24">
<el-form-item label="默认处理方式"> <el-form-item label="默认处理方式">
<el-input type="textarea" :rows="4" resize="none" v-model="editForm.defaultSolution" placeholder="请输入默认处理方式"></el-input>
<el-input type="textarea" :rows="4" resize="none" v-model="editForm.defaultSolution" readonly></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
@ -231,7 +200,6 @@ import {
getModuleListByPlatform, getModuleListByPlatform,
getPageListByPlatformAndModule, getPageListByPlatformAndModule,
getErrorDetailList, getErrorDetailList,
getFunctionButtonsByUrl,
updateErrorDetail updateErrorDetail
} from "@/api/sys/sop.js" } from "@/api/sys/sop.js"
@ -245,14 +213,11 @@ export default {
platformOptions: [], platformOptions: [],
moduleOptions: [], moduleOptions: [],
pageOptions: [], pageOptions: [],
buttonOptions: [],
currentUrlConfig: null, currentUrlConfig: null,
queryData: { queryData: {
platform: '', platform: '',
moduleName: '', moduleName: '',
url: '', url: '',
functionButton: '',
searchErrorType: '',
searchErrorMessage: '', searchErrorMessage: '',
page: 1, page: 1,
limit: 20 limit: 20
@ -274,57 +239,91 @@ export default {
} }
}, },
mounted() { mounted() {
this.height = window.innerHeight - 320
// 使nextTickDOM - rqrq
this.$nextTick(() => {
this.height = window.innerHeight - 220
})
this.loadPlatformOptions() this.loadPlatformOptions()
}, },
methods: { methods: {
// PC - rqrq
loadPlatformOptions() { loadPlatformOptions() {
getPlatformList({}).then(({ data }) => { getPlatformList({}).then(({ data }) => {
if (data && data.code == 0) { if (data && data.code == 0) {
this.platformOptions = data.rows || [] this.platformOptions = data.rows || []
// PCPC - rqrq
if (this.platformOptions.includes('PC')) {
this.queryData.platform = 'PC'
} else if (this.platformOptions.length > 0) {
this.queryData.platform = this.platformOptions[0]
}
//
if (this.queryData.platform) {
this.loadModuleOptions(this.queryData.platform, true)
}
}
})
},
// - rqrq
loadModuleOptions(platform, selectFirst) {
getModuleListByPlatform({ platform: platform }).then(({ data }) => {
if (data && data.code == 0) {
this.moduleOptions = data.rows || []
// - rqrq
if (selectFirst && this.moduleOptions.length > 0) {
this.queryData.moduleName = this.moduleOptions[0]
this.loadPageOptions(platform, this.queryData.moduleName, true)
}
} }
}) })
}, },
// - rqrq
loadPageOptions(platform, moduleName, selectFirst) {
getPageListByPlatformAndModule({
platform: platform,
moduleName: moduleName
}).then(({ data }) => {
if (data && data.code == 0) {
this.pageOptions = data.rows || []
// - rqrq
if (selectFirst && this.pageOptions.length > 0) {
this.queryData.url = this.pageOptions[0].url
this.currentUrlConfig = this.pageOptions[0]
this.getDataList()
}
}
})
},
// - rqrq
handlePlatformChange(platform) { handlePlatformChange(platform) {
this.queryData.moduleName = '' this.queryData.moduleName = ''
this.queryData.url = '' this.queryData.url = ''
this.moduleOptions = [] this.moduleOptions = []
this.pageOptions = [] this.pageOptions = []
this.buttonOptions = []
this.currentUrlConfig = null this.currentUrlConfig = null
this.dataList = [] this.dataList = []
this.totalPage = 0 this.totalPage = 0
if (platform) { if (platform) {
getModuleListByPlatform({ platform: platform }).then(({ data }) => {
if (data && data.code == 0) {
this.moduleOptions = data.rows || []
}
})
// - rqrq
this.loadModuleOptions(platform, true)
} }
}, },
// - rqrq
handleModuleChange(moduleName) { handleModuleChange(moduleName) {
this.queryData.url = '' this.queryData.url = ''
this.pageOptions = [] this.pageOptions = []
this.buttonOptions = []
this.currentUrlConfig = null this.currentUrlConfig = null
this.dataList = [] this.dataList = []
this.totalPage = 0 this.totalPage = 0
if (moduleName) { if (moduleName) {
getPageListByPlatformAndModule({
platform: this.queryData.platform,
moduleName: moduleName
}).then(({ data }) => {
if (data && data.code == 0) {
this.pageOptions = data.rows || []
}
})
// - rqrq
this.loadPageOptions(this.queryData.platform, moduleName, true)
} }
}, },
// - rqrq
handlePageChange(url) { handlePageChange(url) {
this.buttonOptions = []
if (url) { if (url) {
this.currentUrlConfig = this.pageOptions.find(item => item.url === url) this.currentUrlConfig = this.pageOptions.find(item => item.url === url)
this.loadButtonOptions(url)
this.getDataList() this.getDataList()
} else { } else {
this.currentUrlConfig = null this.currentUrlConfig = null
@ -332,13 +331,7 @@ export default {
this.totalPage = 0 this.totalPage = 0
} }
}, },
loadButtonOptions(url) {
getFunctionButtonsByUrl({ url: url }).then(({ data }) => {
if (data && data.code == 0) {
this.buttonOptions = data.rows || []
}
})
},
// - rqrq
getDataList() { getDataList() {
if (!this.queryData.url) { if (!this.queryData.url) {
this.$message.warning('请先选择功能页面') this.$message.warning('请先选择功能页面')
@ -362,25 +355,13 @@ export default {
this.$alert('查询失败', '错误', { confirmButtonText: '确定' }) this.$alert('查询失败', '错误', { confirmButtonText: '确定' })
}) })
}, },
// - rqrq
resetQuery() { resetQuery() {
this.queryData = {
platform: '',
moduleName: '',
url: '',
functionButton: '',
searchErrorType: '',
searchErrorMessage: '',
page: 1,
limit: 20
}
this.moduleOptions = []
this.pageOptions = []
this.buttonOptions = []
this.currentUrlConfig = null
this.dataList = []
this.totalPage = 0
this.queryData.searchErrorMessage = ''
this.pageIndex = 1 this.pageIndex = 1
this.getDataList()
}, },
// - rqrq
editSolution(row) { editSolution(row) {
this.editForm = { this.editForm = {
url: row.url, url: row.url,
@ -394,6 +375,7 @@ export default {
} }
this.editDialogVisible = true this.editDialogVisible = true
}, },
// - rqrq
saveSolution() { saveSolution() {
this.saveLoading = true this.saveLoading = true
const updateData = { const updateData = {
@ -420,11 +402,13 @@ export default {
this.saveLoading = false this.saveLoading = false
}) })
}, },
// - - rqrq
sizeChangeHandle(val) { sizeChangeHandle(val) {
this.pageSize = val this.pageSize = val
this.pageIndex = 1 this.pageIndex = 1
this.getDataList() this.getDataList()
}, },
// - - rqrq
currentChangeHandle(val) { currentChangeHandle(val) {
this.pageIndex = val this.pageIndex = val
this.getDataList() this.getDataList()

133
src/views/modules/noOrderIssue/noOrderNotification.vue

@ -218,6 +218,31 @@
:close-on-click-modal="false" :close-on-click-modal="false"
v-drag v-drag
width="95%"> width="95%">
<!-- rqrq - 目的地显示/编辑区域 -->
<el-form :inline="true" label-position="left" style="margin-bottom: 10px;">
<el-form-item label="单据目的地:" style="margin-bottom: 0;">
<el-select
v-if="isDestinationEditable"
v-model="currentProductionArea"
placeholder="请选择目的地"
style="width: 300px;"
filterable
:disabled="previewLoading || destinationUpdating"
@change="onProductionAreaChange">
<el-option
v-for="item in areaOptions"
:key="item.areaId"
:label="item.areaId + ' - ' + item.areaDesc"
:value="item.areaId">
</el-option>
</el-select>
<span v-if="destinationUpdating" style="margin-left: 10px; color: #409EFF;">保存中...</span>
<span v-else-if="isDestinationEditable" style="margin-left: 10px; color: #909399; font-size: 12px;">修改后自动保存</span>
<span v-if="!isDestinationEditable" style="font-weight: bold;">
{{ getAreaDisplayText(currentProductionArea) }}
</span>
</el-form-item>
</el-form>
<el-table <el-table
:data="previewData" :data="previewData"
border border
@ -719,7 +744,10 @@ import {
getNotifyNoOrderDetailByType, getNotifyNoOrderDetailByType,
noOrderList, noOrderList,
saveNoOrderMaterialDetail, saveNoOrderMaterialDetail,
getNoOrderMaterialList
getNoOrderMaterialList,
updateProductionArea, // rqrq - API
getFirstOrderListDetail, // rqrq - API
getAreaOptionsForChange // rqrq - API
} from '@/api/orderIssure/noOrderIssueNotify.js' } from '@/api/orderIssure/noOrderIssueNotify.js'
// rqrq - WCSAPI使API // rqrq - WCSAPI使API
import { import {
@ -1705,6 +1733,12 @@ export default {
previewLoading: false, previewLoading: false,
previewData: [], previewData: [],
currentNotifyRow: null, // WCS - rqrq currentNotifyRow: null, // WCS - rqrq
areaOptions: [], // - rqrq
currentProductionArea: '', // - rqrq
originalProductionArea: '', // - rqrq
currentOrderType: '', // - rqrq
isDestinationEditable: false, // - rqrq
destinationUpdating: false, // - rqrq
} }
}, },
@ -2931,28 +2965,109 @@ export default {
this.previewDialogVisible = true this.previewDialogVisible = true
this.previewLoading = true this.previewLoading = true
this.previewData = [] this.previewData = []
// - rqrq
this.currentProductionArea = ''
this.originalProductionArea = ''
this.currentOrderType = ''
this.isDestinationEditable = false
this.areaOptions = []
let inData = { let inData = {
site: row.site, site: row.site,
notifyNo: row.notifyNo notifyNo: row.notifyNo
} }
checkIssueNotifyInventory(inData).then(({data}) => {
// + + - rqrq
Promise.all([
checkIssueNotifyInventory(inData),
getFirstOrderListDetail(inData),
getAreaOptionsForChange({})
]).then(([inventoryRes, detailRes, areaRes]) => {
this.previewLoading = false this.previewLoading = false
if (data && data.code === 0) {
this.previewData = data.rows || []
// - rqrq
if (inventoryRes.data && inventoryRes.data.code === 0) {
this.previewData = inventoryRes.data.rows || []
console.log('库存预览数据:', this.previewData) console.log('库存预览数据:', this.previewData)
} else { } else {
this.$alert(data.msg, '错误', {
this.$alert(inventoryRes.data.msg, '错误', {
confirmButtonText: '确定' confirmButtonText: '确定'
}) })
} }
}).catch(() => {
// - rqrq
if (detailRes.data && detailRes.data.code === 0 && detailRes.data.row) {
const detail = detailRes.data.row
this.currentProductionArea = detail.productionArea || ''
this.originalProductionArea = detail.productionArea || ''
this.currentOrderType = detail.orderType || ''
// order_typeshoporder - rqrq
this.isDestinationEditable = this.currentOrderType === 'shoporder'
console.log('明细信息:', detail, '是否可编辑:', this.isDestinationEditable)
}
// - rqrq
if (areaRes.data && areaRes.data.code === 0) {
this.areaOptions = areaRes.data.rows || []
console.log('区域下拉框数据:', this.areaOptions)
}
}).catch((error) => {
this.previewLoading = false this.previewLoading = false
console.error('获取预览数据失败:', error)
this.$message.error('获取库存预览失败') this.$message.error('获取库存预览失败')
}) })
}, },
/**
* @Description 获取区域显示文本 - rqrq
* @param areaId 区域ID
* @return String 区域ID + 区域名称
*/
getAreaDisplayText(areaId) {
if (!areaId) return '未设置'
const area = this.areaOptions.find(item => item.areaId === areaId)
if (area) {
return area.areaId + ' - ' + area.areaDesc
}
return areaId
},
/**
* @Description 目的地下拉框值改变时自动保存 - rqrq
* @param newValue 新的目的地值
*/
onProductionAreaChange(newValue) {
// - rqrq
if (newValue === this.originalProductionArea) {
return
}
this.destinationUpdating = true
const updateData = {
site: this.currentNotifyRow.site,
notifyNo: this.currentNotifyRow.notifyNo,
productionArea: newValue
}
updateProductionArea(updateData).then(({data}) => {
this.destinationUpdating = false
if (data && data.code === 0) {
this.$message.success('目的地已更新')
this.originalProductionArea = newValue // - rqrq
} else {
this.$message.error(data.msg || '更新目的地失败')
// - rqrq
this.currentProductionArea = this.originalProductionArea
}
}).catch((error) => {
this.destinationUpdating = false
this.$message.error(error.message || '更新目的地失败')
// - rqrq
this.currentProductionArea = this.originalProductionArea
})
},
/** /**
* @Description 根据订单满足状态设置行样式 - rqrq * @Description 根据订单满足状态设置行样式 - rqrq
*/ */
@ -2971,6 +3086,12 @@ export default {
* @Description 从预览对话框推送至WCS - rqrq * @Description 从预览对话框推送至WCS - rqrq
*/ */
pushToWCS() { pushToWCS() {
// - rqrq
if (this.destinationUpdating) {
this.$message.warning('目的地正在保存中,请稍候...')
return
}
// - rqrq // - rqrq
const validData = this.previewData const validData = this.previewData

Loading…
Cancel
Save