From 10abd686072546ef5d36d239d64280af2c44216e 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: Mon, 6 Oct 2025 16:36:52 +0800 Subject: [PATCH] 1 --- .../orderIssure/searchIssureNotify.vue | 46 ++++++++++++++----- 1 file changed, 35 insertions(+), 11 deletions(-) diff --git a/src/views/modules/orderIssure/searchIssureNotify.vue b/src/views/modules/orderIssure/searchIssureNotify.vue index 448fd14..e466d09 100644 --- a/src/views/modules/orderIssure/searchIssureNotify.vue +++ b/src/views/modules/orderIssure/searchIssureNotify.vue @@ -105,8 +105,8 @@ @@ -154,6 +154,19 @@ style="width: 100px; height: 80px"/> + + + + @@ -329,8 +342,10 @@ - 推送至WCS - 关闭 + + {{ previewLoading ? '推送中...' : '推送至WCS' }} + + 关闭 @@ -1011,7 +1026,6 @@ previewDialogVisible: false, previewLoading: false, previewData: [], - currentRow: {} // 当前查看的申请单行数据 } }, mounted () { @@ -1225,9 +1239,11 @@ // 从预览对话框推送至WCS pushToWCS() { // 筛选绿色和黄色的数据(orderSatisfactionStatus = 1 或 2) - const validData = this.previewData.filter(item => - item.orderSatisfactionStatus === 1 || item.orderSatisfactionStatus === 2 - ) + // const validData = this.previewData.filter(item => + // item.orderSatisfactionStatus === 1 || item.orderSatisfactionStatus === 2 + // ) + //全部推送 后端判断 + const validData = this.previewData if (validData.length === 0) { this.$message.warning('没有可推送的数据(只推送绿色和黄色状态的数据)') @@ -1239,6 +1255,9 @@ cancelButtonText: '取消', type: 'warning' }).then(() => { + // 显示加载状态 - rqrq + this.previewLoading = true + const inData = { site: this.currentRow.site, notifyNo: this.currentRow.notifyNo, @@ -1246,6 +1265,7 @@ } pushInventoryToWcs(inData).then(({data}) => { + this.previewLoading = false if (data && data.code === 0) { this.$message({ message: '推送WCS成功', @@ -1255,13 +1275,17 @@ this.previewDialogVisible = false this.searchTable() } else { - this.$alert(data.msg, '错误', { + this.$alert(data.msg || '推送失败', '错误', { confirmButtonText: '确定' }) } - }).catch(() => { - this.$message.error('推送WCS失败') + }).catch((error) => { + this.previewLoading = false + this.$message.error(error.message || '推送WCS失败,请重试') }) + }).catch(() => { + // 用户取消操作 - rqrq + console.log('用户取消推送') }) },