diff --git a/src/api/orderIssure/noOrderIssueNotify.js b/src/api/orderIssure/noOrderIssueNotify.js index aca7647..71ca91b 100644 --- a/src/api/orderIssure/noOrderIssueNotify.js +++ b/src/api/orderIssure/noOrderIssueNotify.js @@ -9,4 +9,6 @@ export const getNoOrderMaterialList = data => createAPI(`/orderIssure/issureNoti export const saveNoOrderMaterialDetail = data => createAPI(`/orderIssure/issureNotify/saveNoOrderMaterialDetail`,'post',data) export const searchNoOrderNotifyHeader = data => createAPI(`/orderIssure/issureNotify/searchNoOrderNotifyHeader`,'post',data) -export const getNotifyNoOrderDetailByType = data => createAPI(`/orderIssure/issureNotify/getNotifyNoOrderDetailByType`,'post',data) \ No newline at end of file +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 diff --git a/src/views/modules/noOrderIssue/newNoOrderIssueNotify.vue b/src/views/modules/noOrderIssue/newNoOrderIssueNotify.vue index 18f76af..a1cb5fb 100644 --- a/src/views/modules/noOrderIssue/newNoOrderIssueNotify.vue +++ b/src/views/modules/noOrderIssue/newNoOrderIssueNotify.vue @@ -108,8 +108,19 @@ - 添加 + + + + + + + 添加行 + 添加 + + @@ -343,6 +354,7 @@ + @@ -354,8 +366,10 @@ import { saveNoOrderNotify, getNotifyNoOrderDetail, getNoOrderMaterialList, - saveNoOrderMaterialDetail + saveNoOrderMaterialDetail, + queryPartAttributeData, } from '@/api/orderIssure/noOrderIssueNotify.js' +import noorderUploadExcel from './noorder_upload_excel.vue' import { deleteNotify, getAllNotifyStatus, @@ -378,6 +392,7 @@ export default { name: 'newSoIssueNotify', components: { Chooselist, + noorderUploadExcel, }, watch: { // notifyOrderData: { @@ -1071,6 +1086,8 @@ export default { // 申请明细弹框相关 isMaterialDetailModal: false, // 标识是否从申请明细弹框打开选择物料弹框 clickrow:{}, + partNo:'', + addLineLoading:false, } }, @@ -1590,6 +1607,65 @@ export default { this.seqNoData.releaseNo = '' this.seqNoData.sequenceNo = '' }, + // 添加行:从接口查询数据并添加到列表 + addRowFromQuery() { + if(!this.partNo){ + this.$message.warning('请输入物料号!') + return + } + + // 初始化seqNoList如果不存在 + if (!this.seqNoList) { + this.seqNoList = [] + } + + // 准备查询参数 + const queryParams = { + site: this.$store.state.user.site, + componentPartNo: this.partNo || '', // 使用物料号输入框的值 + orderType: this.orderType, // 使用订单类型 + } + this.addLineLoading = true + queryPartAttributeData(queryParams) + .then(({ data }) => { + if (data.code === 0 && data.rows ) { + // 过滤掉已存在的物料(根据partNo判断) + const existingPartNos = this.seqNoList.map((item) => item.partNo) + const newRows = existingPartNos.includes(data.rows.partNo) + + if (newRows) { + this.$message.warning('查询到的物料已存在于列表中!') + return + } + // 确保数据结构完整 + const newRow = { + partNo: data.rows.partNo || '', + height: data.rows.height || '', + isInWh: data.rows.isInWh || '', + componentPartNo: data.rows.partNo || '', + orderNo: '', + releaseNo: '', + sequenceNo: '', + lineItemNo: '', + materialLineStatus: '', + componentPartDesc: '', + uom: '', + startDate: '', + finishDate: '', + needDate: '', + } + this.seqNoList.push(newRow) + this.$set(this, 'partNo', '') // 清空物料号输入框 + } else { + this.$message.warning(data.msg || '查询无数据') + } + }) + .catch((error) => { + this.$message.error(error.msg || '查询失败,请稍后重试') + }).finally(() => { + this.addLineLoading = false + }) + }, deleteSeqNoByOrderNo() { if (this.seqNoData.orderNo == null || this.seqNoData.orderNo == '') { this.$message.warning('请输入OrderNo!') @@ -2175,7 +2251,15 @@ export default { } }) }, - + importModel() { + let data = { + site: this.$store.state.user.site, + notifyNo: this.notifyData.notifyNo, + } + this.$nextTick(() => { + this.$refs.noorderUploadExcel.init(data) + }) + }, // 获取 tableDefault 列 async getColumnList(tableId, columnId) { let queryTable = { diff --git a/src/views/modules/noOrderIssue/noOrderNotification.vue b/src/views/modules/noOrderIssue/noOrderNotification.vue index f9e37ec..f7b0637 100644 --- a/src/views/modules/noOrderIssue/noOrderNotification.vue +++ b/src/views/modules/noOrderIssue/noOrderNotification.vue @@ -1390,6 +1390,7 @@ export default { columnWidth: 80, }, ], + columnDetailList2:[], rules: { bu: [ { diff --git a/src/views/modules/noOrderIssue/noorder_upload_excel.vue b/src/views/modules/noOrderIssue/noorder_upload_excel.vue new file mode 100644 index 0000000..01a7cb4 --- /dev/null +++ b/src/views/modules/noOrderIssue/noorder_upload_excel.vue @@ -0,0 +1,184 @@ + + + + + + + + + 下载 Excel 模板 + + + + + + + + + {{ uploading ? '正在上传中,请稍候...' : '将文件拖到此处,或点击上传' }} + + + + + + + + {{ uploading ? '上传中...' : '保存' }} + + 关闭 + + + + + +