From 5b3927012fec41e4af405359a1df7eb53910fb42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B8=B8=E7=86=9F=E5=90=B4=E5=BD=A6=E7=A5=96?= Date: Tue, 13 Jan 2026 16:23:02 +0800 Subject: [PATCH] 1 --- src/api/orderIssure/noOrderIssueNotify.js | 5 +- .../noOrderIssue/baofei_upload_excel.vue | 211 ++++++++++++++++++ .../noOrderIssue/newNoOrderIssueNotify.vue | 210 ++++++++++++++--- static/downLoad/报废领料模板.xlsx | Bin 0 -> 8606 bytes 4 files changed, 389 insertions(+), 37 deletions(-) create mode 100644 src/views/modules/noOrderIssue/baofei_upload_excel.vue create mode 100644 static/downLoad/报废领料模板.xlsx diff --git a/src/api/orderIssure/noOrderIssueNotify.js b/src/api/orderIssure/noOrderIssueNotify.js index 71ca91b..bc8e76c 100644 --- a/src/api/orderIssure/noOrderIssueNotify.js +++ b/src/api/orderIssure/noOrderIssueNotify.js @@ -11,4 +11,7 @@ export const searchNoOrderNotifyHeader = data => createAPI(`/orderIssure/issureN export const getNotifyNoOrderDetailByType = data => createAPI(`/orderIssure/issureNotify/getNotifyNoOrderDetailByType`,'post',data) export const queryPartAttributeData = data => createAPI(`/factory/partAttribute/queryPartAttributeData`,'post',data) -export const uploadNoorderNotifyExcel = data => createAPI(`/orderIssure/issureNotify/uploadNoorderNotifyExcel`,'post',data) \ No newline at end of file +export const uploadNoorderNotifyExcel = data => createAPI(`/orderIssure/issureNotify/uploadNoorderNotifyExcel`,'post',data) + +// 上传报废Excel并查询库存信息 - rqrq +export const uploadBaoFeiExcel = data => createAPI(`/orderIssure/issureNotify/uploadBaoFeiExcel`,'post',data) \ No newline at end of file diff --git a/src/views/modules/noOrderIssue/baofei_upload_excel.vue b/src/views/modules/noOrderIssue/baofei_upload_excel.vue new file mode 100644 index 0000000..56d5763 --- /dev/null +++ b/src/views/modules/noOrderIssue/baofei_upload_excel.vue @@ -0,0 +1,211 @@ + + + diff --git a/src/views/modules/noOrderIssue/newNoOrderIssueNotify.vue b/src/views/modules/noOrderIssue/newNoOrderIssueNotify.vue index 1b8269e..faf209b 100644 --- a/src/views/modules/noOrderIssue/newNoOrderIssueNotify.vue +++ b/src/views/modules/noOrderIssue/newNoOrderIssueNotify.vue @@ -97,46 +97,50 @@ - + 分切订单 销售发货 成品订单 + 报废单 - - + + 从订单添加 - - + + - - + + - 添加物料行 - 选择物料 - 导入 + 导入 + 报废导入 - - + + @@ -145,9 +149,13 @@ - + {{ scope.row.availableQty }} + + + {{ scope.row.remark }} + {{ scope.row[item.columnProp] }} @@ -447,6 +455,7 @@ + @@ -462,6 +471,7 @@ import { queryPartAttributeData, } from '@/api/orderIssure/noOrderIssueNotify.js' import noorderUploadExcel from './noorder_upload_excel.vue' +import baofeiUploadExcel from './baofei_upload_excel.vue' import { deleteNotify, getAllNotifyStatus, @@ -487,6 +497,7 @@ export default { components: { Chooselist, noorderUploadExcel, + baofeiUploadExcel, }, watch: { // notifyOrderData: { @@ -799,7 +810,7 @@ export default { sortLv: 0, status: true, fixed: false, - columnWidth: 200, + columnWidth: 120, }, { userId: this.$store.state.user.name, @@ -894,6 +905,25 @@ export default { fixed: false, columnWidth: 80, }, + { + // rqrq - 新增批次号列 + userId: this.$store.state.user.name, + functionId: 555001, + serialNumber: '555001Table3BatchNo', + tableId: '555001Table3', + tableName: '领料申请BOM子表', + columnProp: 'batchNo', + headerAlign: 'center', + align: 'center', + columnLabel: '批次号', + columnHidden: false, + columnImage: false, + columnSortable: false, + sortLv: 0, + status: true, + fixed: false, + columnWidth: 80, + }, { userId: this.$store.state.user.name, functionId: 555001, @@ -1260,6 +1290,57 @@ export default { 'shoporder': '成品订单' } return typeMap[this.orderType] || '未知类型' + }, + // 新增工单物料弹窗表格列配置(根据订单类型动态显示批次号列) - rqrq + displayColumnList2() { + // 基础列配置 + let baseColumns = [...this.columnList2] + + // 如果订单类型是报废,在物料号后面插入批次号列 - rqrq + if (this.orderType === 'baofei') { + const batchColumn = { + userId: this.$store.state.user.name, + functionId: 555001, + serialNumber: '555001Table2BatchNo', + tableId: '555001Table2', + tableName: '查询工单及物料', + columnProp: 'batchNo', + headerAlign: 'center', + align: 'center', + columnLabel: '批次号', + columnHidden: false, + columnImage: false, + columnSortable: false, + sortLv: 0, + status: true, + fixed: false, + columnWidth: 120, + } + const remarkColumn = { + userId: this.$store.state.user.name, + functionId: 555001, + serialNumber: '555001Table2Remark', + tableId: '555001Table2', + tableName: '查询工单及物料', + columnProp: 'remark', + headerAlign: 'center', + align: 'center', + columnLabel: '导入数量', + columnHidden: false, + columnImage: false, + columnSortable: false, + sortLv: 0, + status: true, + fixed: false, + columnWidth: 120, + } + // 在第一个列(物料号)后面插入批次号列 - rqrq + baseColumns.splice(1, 0, batchColumn) + baseColumns.splice(2, 0, remarkColumn) + + } + + return baseColumns } }, @@ -1361,6 +1442,19 @@ export default { return '' }, + // 报废导入表格行样式:导入数量大于可用库存时行变红 - rqrq + seqNoTableRowClassName({ row, rowIndex }) { + // 只有报废类型且remark存在时才判断 - rqrq + if (this.orderType === 'baofei' && row.remark !== undefined) { + const remarkQty = Number(row.remark || 0) + const availableQty = Number(row.availableQty || 0) + // 导入数量大于可用库存时变红 - rqrq + if (remarkQty > availableQty) { + return 'baofei-error-row' + } + } + return '' + }, // 列表方法的回调 getBaseData(val) { if (this.tagNo === 515) { @@ -2184,7 +2278,7 @@ export default { } this.seqNoList.push(newRow) console.log('添加的新行:', newRow) // 调试用; - + this.$set(this, 'partNo', '') // 清空物料号输入框 } else { this.$message.warning(data.msg || '查询无数据') @@ -2747,28 +2841,53 @@ export default { searchTable(rows) { if( rows.length > 0){ for (let i = 0; i < rows.length; i++) { - // 确保数据结构完整 - const newRow = { - partNo: rows[i].componentPartNo || '', - height: rows[i].height || '', - isInWh: rows[i].isInWh || '', - applyQty: rows[i].qtyRequired || 0, - availableQty: rows[i].availableQty || 0, - orderNo: '', - releaseNo: '', - sequenceNo: '', - lineItemNo: '', - materialLineStatus: '', - componentPartDesc: '', - uom: '', - startDate: '', - finishDate: '', - needDate: '', - } - this.seqNoList.push(newRow) + // 判断是否为报废导入数据(有batchNo字段)- rqrq + if (rows[i].batchNo !== undefined || rows[i].remark !== undefined) { + // 报废导入数据结构 - rqrq + const newRow = { + partNo: rows[i].partNo || '', // 第一列:物料号 + batchNo: rows[i].batchNo || '', // 第二列:批次号 + remark: rows[i].remark || 0, // 第三列:导入数量(如果为空则为0) + applyQty: rows[i].applyQty || 0, // 第四列:申请数量(使用可用库存) + isInWh: rows[i].isInWh || 'N', // 是否在立库 + availableQty: rows[i].availableQty || 0, // 可用库存 + // 以下字段保持兼容性 - rqrq + height: '', + orderNo: '', + releaseNo: '', + sequenceNo: '', + lineItemNo: '', + materialLineStatus: '', + componentPartDesc: '', + uom: '', + startDate: '', + finishDate: '', + needDate: '', + } + this.seqNoList.push(newRow) + } else { + // 其他导入数据结构(原逻辑)- rqrq + const newRow = { + partNo: rows[i].componentPartNo || '', + height: rows[i].height || '', + isInWh: rows[i].isInWh || '', + applyQty: rows[i].qtyRequired || 0, + availableQty: rows[i].availableQty || 0, + orderNo: '', + releaseNo: '', + sequenceNo: '', + lineItemNo: '', + materialLineStatus: '', + componentPartDesc: '', + uom: '', + startDate: '', + finishDate: '', + needDate: '', + } + this.seqNoList.push(newRow) + } } } - }, getAllNotifyStatus() { let inData = { @@ -2818,6 +2937,17 @@ export default { this.$refs.noorderUploadExcel.init(data) }) }, + + + importModel2() { + let data = { + site: this.$store.state.user.site, + notifyNo: this.notifyData.notifyNo, + } + this.$nextTick(() => { + this.$refs.baofeiUploadExcel.init(data) + }) + }, // 获取 tableDefault 列 async getColumnList(tableId, columnId) { let queryTable = { @@ -2858,6 +2988,14 @@ export default { background: #f86868 !important; } +/* rqrq - 报废导入:导入数量大于可用库存时行变红 */ +/deep/ .el-table .baofei-error-row { + background: #fef0f0 !important; +} +/deep/ .el-table .baofei-error-row td { + color: #F56C6C !important; +} + /* 在