From 0aafbfdcf940c7412c50c4f3836a826ab1c52bc7 Mon Sep 17 00:00:00 2001 From: shenzhouyu Date: Mon, 1 Dec 2025 17:03:25 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AF=BC=E5=85=A5=E6=B7=BB=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../noOrderIssue/newNoOrderIssueNotify.vue | 34 +++++++++++++-- .../noOrderIssue/noorder_upload_excel.vue | 43 +++++++------------ 2 files changed, 45 insertions(+), 32 deletions(-) diff --git a/src/views/modules/noOrderIssue/newNoOrderIssueNotify.vue b/src/views/modules/noOrderIssue/newNoOrderIssueNotify.vue index 0acbe31..d7f93fa 100644 --- a/src/views/modules/noOrderIssue/newNoOrderIssueNotify.vue +++ b/src/views/modules/noOrderIssue/newNoOrderIssueNotify.vue @@ -123,14 +123,14 @@ - + 添加物料行 选择物料 - + 导入 @@ -2113,6 +2113,8 @@ export default { needDate: '', } this.seqNoList.push(newRow) + console.log('添加的新行:', newRow) // 调试用; + this.$set(this, 'partNo', '') // 清空物料号输入框 } else { this.$message.warning(data.msg || '查询无数据') @@ -2672,7 +2674,31 @@ export default { this.authDelete = !deleteFlag }, - searchTable() {}, + 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].qtyIssued || 0, + orderNo: '', + releaseNo: '', + sequenceNo: '', + lineItemNo: '', + materialLineStatus: '', + componentPartDesc: '', + uom: '', + startDate: '', + finishDate: '', + needDate: '', + } + this.seqNoList.push(newRow) + } + } + + }, getAllNotifyStatus() { let inData = { site: this.$store.state.user.site, diff --git a/src/views/modules/noOrderIssue/noorder_upload_excel.vue b/src/views/modules/noOrderIssue/noorder_upload_excel.vue index 01a7cb4..e17d2ce 100644 --- a/src/views/modules/noOrderIssue/noorder_upload_excel.vue +++ b/src/views/modules/noOrderIssue/noorder_upload_excel.vue @@ -2,18 +2,17 @@
- + 下载 Excel 模板 - + --> + :before-upload="beforeUploadHandle" :on-change="onChange" :auto-upload="false" :disabled="uploading" style="text-align: left;" :file-list="fileList">
{{ uploading ? '正在上传中,请稍候...' : '将文件拖到此处,或点击上传' }} @@ -53,6 +52,7 @@ export default { notifyNo: '', }, uploading: false, // 上传状态标志 + returnData: '', // 返回的数据 } }, methods: { @@ -61,6 +61,8 @@ export default { init (data) { this.fileList = [] this.uploading = false // 重置上传状态 + console.log("init data",this.fileList); + // 打开页面 this.visible = true this.notifyData=JSON.parse(JSON.stringify(data)) @@ -106,11 +108,17 @@ export default { deleteFile(){ this.fileList = [] + this.visible = false this.uploading = false // 重置上传状态 // 清空文件上传记录 this.$refs.uploadFile.clearFiles() // 刷新报工的页面 - this.$emit('refreshTable') + }, + successCallback(){ + this.fileList = [] + this.visible = false + this.uploading = false // 重置上传状态 + this.$emit('refreshTable',this.returnData) }, // 保存当前的数据 @@ -143,9 +151,10 @@ export default { // 调用新的上传接口 uploadNoorderNotifyExcel(formData).then(({ data }) => { if (data.code === 0) { + this.returnData = data.rows this.$message.success(data.msg || 'Excel文件上传成功') // 关闭窗口并刷新页面 - this.closeDialog() + this.successCallback() } else { this.$message.error(data.msg || 'Excel文件上传失败') } @@ -157,28 +166,6 @@ export default { this.uploading = false }) }, - - // 下载模板文件 - async downloadFile () { - // 这里可以根据需要实现模板下载功能 - // 暂时提示用户模板格式 - this.$alert( - '模板格式说明:\n' + - '第1列:工厂编码(site)\n' + - '第2列:订单号(orderNo)\n' + - '第3列:发布号(releaseNo)\n' + - '第4列:序列号(sequenceNo)\n' + - '第5列:BOM行号(bomLineNo,必须为正整数)\n' + - '第6列:物料编码(materialPartNo)\n' + - '第7列:需求日期(needDate,格式:YYYY-MM-DD)\n' + - '第8列:数量(qty,必须为数字)', - '模板格式说明', - { - confirmButtonText: '确定', - type: 'info' - } - ) - }, } }