diff --git a/src/api/shipment/shipmentIssue.js b/src/api/shipment/shipmentIssue.js index 4fe28a9..57ae4ce 100644 --- a/src/api/shipment/shipmentIssue.js +++ b/src/api/shipment/shipmentIssue.js @@ -50,4 +50,18 @@ export const getIFSShopOrderByOrderNo = data => createAPI(`/shipmentIssue/getIFS export const searchNotifyMaterialList = data => createAPI(`/shipmentIssue/searchNotifyMaterialList`,'post',data) -export const closeInboundNotification = data => createAPI(`/shipmentIssue/closeInboundNotification`,'post',data) \ No newline at end of file +export const closeInboundNotification = data => createAPI(`/shipmentIssue/closeInboundNotification`,'post',data) + +// ================== rqrq - 发货通知单取消下达功能接口 ================== + +// 检查用户是否有未下达的shipment申请单 - rqrq +export const checkUserHasUnissueShipment = data => createAPI(`/shipmentIssue/checkUserHasUnissueShipment`,'post',data) + +// 取消下达发货申请单 - rqrq +export const cancelIssueShipment = data => createAPI(`/shipmentIssue/cancelIssueShipment`,'post',data) + +// 检查发货通知单物料库存匹配情况(只考虑立库) - rqrq +export const checkShipmentInventory = data => createAPI(`/shipmentIssue/checkShipmentInventory`,'post',data) + +// 推送发货通知单库存预览数据至WCS - rqrq +export const pushShipmentInventoryToWcs = data => createAPI(`/shipmentIssue/pushShipmentInventoryToWcs`,'post',data) \ No newline at end of file diff --git a/src/views/modules/orderIssure/searchIssureNotify.vue b/src/views/modules/orderIssure/searchIssureNotify.vue index 08bac6e..a435fc5 100644 --- a/src/views/modules/orderIssure/searchIssureNotify.vue +++ b/src/views/modules/orderIssure/searchIssureNotify.vue @@ -295,7 +295,7 @@ @@ -330,7 +330,7 @@ @@ -341,9 +341,14 @@ + class-name="wrap-text-column"> + + + {{ scope.row.matchedBarcodes }} + + @@ -1343,7 +1348,7 @@ site: row.site, username: row.username } - + checkUserHasUnissueShopOrder(checkData).then(({ data }) => { if (data && data.code === 0) { // 如果有未下达的申请单 - rqrq @@ -1353,7 +1358,7 @@ }) return } - + // 没有未下达的申请单,执行取消下达 - rqrq this.$confirm(`确定取消下达申请单【${row.notifyNo}】吗?`, '提示', { confirmButtonText: '确定', @@ -1364,7 +1369,7 @@ site: row.site, notifyNo: row.notifyNo } - + cancelIssueNotify(cancelData).then(({ data }) => { if (data && data.code === 0) { this.$message.success('取消下达成功') @@ -1535,6 +1540,13 @@ border-left: 3px solid #67C23A; } +/* rqrq - 匹配条码列自动换行显示 */ +/deep/ .wrap-text-column .cell { + white-space: normal !important; + word-break: break-all !important; + line-height: 1.5 !important; +} + /deep/ .el-table .warning-row { background: #fdf6ec !important; border-left: 3px solid #E6A23C; diff --git a/src/views/modules/shipment/shipmentNotification.vue b/src/views/modules/shipment/shipmentNotification.vue index cf8b1ad..fa69c56 100644 --- a/src/views/modules/shipment/shipmentNotification.vue +++ b/src/views/modules/shipment/shipmentNotification.vue @@ -48,7 +48,7 @@ style="width: 100px; height: 80px" /> - + + 推送WCS + + 取消下达 + + + + + + + + + + + {{ scope.row.isWarehouseSatisfied === 'Y' ? '满足' : '不满足' }} + + + + + + + {{ scope.row.matchedBarcodes }} + + + + + + + + @@ -508,7 +559,11 @@ import { createNotify, getNotifyNoDetail, searchNotifyMaterialList, - closeInboundNotification + closeInboundNotification, + checkUserHasUnissueShipment, + cancelIssueShipment, + checkShipmentInventory, + pushShipmentInventoryToWcs } from '@/api/shipment/shipmentIssue.js' import Chooselist from '@/views/modules/common/Chooselist_eam' import { getChooselist } from '@/api/chooselist/chooselist.js' @@ -538,7 +593,7 @@ export default { orderNo: '', orderType: '', orderStatus: '', - orderStatusList: ['UNISSUE'], + orderStatusList: [], startDate: '', endDate: '', page: 1, @@ -1272,7 +1327,7 @@ export default { status: true, fixed: '', columnWidth: 60, - }, + }, { userId: this.$store.state.user.name, functionId: 701001, @@ -1421,6 +1476,12 @@ export default { materialModalFlag: false, sobomData:{}, notifyNo:'', + // rqrq - 库存预览相关变量 + previewDialogVisible: false, + previewLoading: false, + pushLoading: false, + previewData: [], + currentNotifyRow: null, } }, @@ -1465,7 +1526,7 @@ export default { this.searchData.page = this.pageIndex this.searchData.orderStatus = this.searchData.orderStatusList.join(',') console.log("this.",this.searchData); - + this.searchLoading = true searchNotifyHeader(this.searchData) .then(({ data }) => { @@ -1475,7 +1536,7 @@ export default { this.pageSize = data.page.pageSize this.totalPage = data.page.totalCount console.log("this.dataList",this.dataList); - + // 判断是否全部存在数据 if (this.dataList.length > 0) { // 设置选中行并高亮第一行 @@ -1528,7 +1589,7 @@ export default { site: '', orderNo: '', orderType: '', - orderStatus: '草稿', + orderStatus: '', requiredInboundDate: '', supplierId: '', supplierName: '', @@ -1666,7 +1727,7 @@ export default { } }) }) - + }, // 下达 @@ -1720,7 +1781,7 @@ export default { // 单机选中信息 inboundClickRow(row, column) { console.log("row",row); - + this.currentRow = JSON.parse(JSON.stringify(row)) // 点击主表行时,立即刷新并加载入库明细 this.getNotifyNoDetail() @@ -1845,7 +1906,7 @@ export default { return false } } - + this.notifyOrderData.partNo = row.partNo this.notifyOrderData.orderNo = row.orderNo this.notifyOrderData.itemNo = row.itemNo @@ -1929,12 +1990,12 @@ export default { this.detailList = [] return } - + let inData = { site: this.currentRow.site || localStorage.getItem('site'), notifyNo: this.currentRow.notifyNo, } - + getNotifyNoDetail(inData).then(({ data }) => { if (data.code === 0) { this.detailList = data.rows || [] @@ -2221,7 +2282,7 @@ export default { this.materialModalFlag = true searchNotifyMaterialList(row).then(({ data }) => { if (data.code === 0) { - this.sobomList = data.rows + this.sobomList = data.rows } }).finally(() => { this.bomLoadFlag = false @@ -2267,6 +2328,159 @@ export default { this.authClose = !closeFlag this.authIssue = !issueFlag }, + + /** + * @Description 取消下达处理方法 - rqrq + * @param row 当前行数据 + */ + cancelIssueShipmentHandle(row) { + // 先判断发起人是否有未下达的shipment申请单 - rqrq + let checkData = { + site: row.site, + username: row.username + } + + checkUserHasUnissueShipment(checkData).then(({ data }) => { + if (data && data.code === 0) { + // 如果有未下达的申请单 - rqrq + if (data.row != null) { + this.$alert('该用户有未下达的申请单,请先处理', '提示', { + confirmButtonText: '确定' + }) + return + } + + // 没有未下达的申请单,执行取消下达 - rqrq + this.$confirm(`确定取消下达发货申请单【${row.notifyNo}】吗?`, '提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning' + }).then(() => { + let cancelData = { + site: row.site, + notifyNo: row.notifyNo + } + + cancelIssueShipment(cancelData).then(({ data }) => { + if (data && data.code === 0) { + this.$message.success('取消下达成功') + // 重新加载数据 - rqrq + this.getDataList() + } else { + this.$alert(data.msg, '错误', { + confirmButtonText: '确定' + }) + } + }).catch(() => { + this.$message.error('取消下达失败') + }) + }).catch(() => { + // 用户取消操作 - rqrq + }) + } else { + this.$alert(data.msg, '错误', { + confirmButtonText: '确定' + }) + } + }).catch(() => { + this.$message.error('检查用户申请单失败') + }) + }, + + /** + * @Description 预览库存(发货通知单,只考虑立库) - rqrq + * @param row 当前申请单行数据 + */ + previewInventory(row) { + this.currentNotifyRow = row + this.previewDialogVisible = true + this.previewLoading = true + this.previewData = [] + + let inData = { + site: row.site, + notifyNo: row.notifyNo + } + + checkShipmentInventory(inData).then(({data}) => { + this.previewLoading = false + if (data && data.code === 0) { + this.previewData = data.rows || [] + } else { + this.$alert(data.msg, '错误', { + confirmButtonText: '确定' + }) + } + }).catch(() => { + this.previewLoading = false + this.$message.error('获取库存预览失败') + }) + }, + + /** + * @Description 推送至WCS(发货通知单) - rqrq + */ + pushToWcs() { + if (!this.previewData || this.previewData.length === 0) { + this.$message.warning('没有可推送的数据') + return + } + + // 检查是否有满足条件的数据(orderSatisfactionStatus === 1,绿色) - rqrq + const validData = this.previewData.filter(item => item.orderSatisfactionStatus === 1) + if (validData.length === 0) { + this.$message.warning('没有满足库存要求的订单,无法推送') + return + } + + this.$confirm('确认推送至WCS?', '提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning' + }).then(() => { + this.pushLoading = true + + let pushData = { + site: this.currentNotifyRow.site, + notifyNo: this.currentNotifyRow.notifyNo, + shipmentInventoryList: this.previewData + } + + pushShipmentInventoryToWcs(pushData).then(({data}) => { + if (data && data.code === 0) { + this.$message({ + message: '推送WCS成功', + type: 'success', + duration: 1500 + }) + this.previewDialogVisible = false + this.getDataList() // 刷新列表 + } else { + this.$alert(data.msg, '错误', { + confirmButtonText: '确定' + }) + } + }).catch(() => { + this.$message.error('推送WCS失败') + }).finally(() => { + this.pushLoading = false + }) + }).catch(() => { + // 用户取消 - rqrq + }) + }, + + /** + * @Description 表格行样式(发货通知单:绿色=满足,红色=不满足) - rqrq + */ + getRowStyle({ row }) { + if (row.orderSatisfactionStatus === 1) { + return { backgroundColor: '#67C23A20' } // 绿色背景 + } else if (row.orderSatisfactionStatus === 3) { + return { backgroundColor: '#F56C6C20' } // 红色背景 + } + return {} + }, }, } @@ -2279,4 +2493,11 @@ export default { height: auto; line-height: 1.5; } + +/* rqrq - 匹配条码列自动换行显示 */ +/deep/ .wrap-text-column .cell { + white-space: normal !important; + word-break: break-all !important; + line-height: 1.5 !important; +}