From c71bfa5b8376bee7a20dba36154d59107e88ae57 Mon Sep 17 00:00:00 2001 From: "zangch@mesnac.com" Date: Wed, 21 Jan 2026 19:31:58 +0800 Subject: [PATCH] =?UTF-8?q?fix(order):=20=E8=A7=A3=E5=86=B3=E8=AE=A2?= =?UTF-8?q?=E5=8D=95=E4=BF=A1=E6=81=AF=E5=88=97=E8=A1=A8=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=A4=84=E7=90=86=E5=92=8C=E6=9D=83=E9=99=90=E6=8E=A7=E5=88=B6?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 移除开始生产、更新数量、完工提报按钮的权限控制指令 - 优化listOrderInfo接口响应数据处理逻辑,支持数组和对象两种格式 - 添加对response.data和response.rows的数据兼容性处理 - 统一错误处理逻辑,设置默认空数组和总数为0 - 使用finally确保loading状态正确重置 - 修复import语句中的多余斜杠路径问题 --- src/views/base/orderInfo/execution.vue | 28 +++++++++++++++++--------- src/views/base/orderInfo/index.vue | 27 ++++++++++++++++++------- 2 files changed, 38 insertions(+), 17 deletions(-) diff --git a/src/views/base/orderInfo/execution.vue b/src/views/base/orderInfo/execution.vue index 4bfee85..6fe6389 100644 --- a/src/views/base/orderInfo/execution.vue +++ b/src/views/base/orderInfo/execution.vue @@ -50,21 +50,18 @@ size="mini" type="primary" @click="handleStart(scope.row)" - v-hasPermi="['base:orderInfo:start']" >开始生产 更新数量 完工提报 { - this.orderList = response.rows; - this.total = response.total; - this.loading = false; - }).catch(() => { - this.loading = false; - }); + listOrderInfo(this.queryParams) + .then(response => { + const data = response && response.data ? response.data : response; + if (Array.isArray(data)) { + this.orderList = data; + this.total = data.length; + } else { + this.orderList = (data && data.rows) ? data.rows : []; + this.total = (data && data.total) ? data.total : this.orderList.length; + } + }) + .catch(() => { + this.orderList = []; + this.total = 0; + }) + .finally(() => { + this.loading = false; + }); }, handleQuery() { this.queryParams.pageNum = 1; diff --git a/src/views/base/orderInfo/index.vue b/src/views/base/orderInfo/index.vue index 1184a29..652ed95 100644 --- a/src/views/base/orderInfo/index.vue +++ b/src/views/base/orderInfo/index.vue @@ -382,8 +382,8 @@ import { updateOrderInfo, releaseOrderPlan, replaceProductionLine } from '@/api/base/orderInfo' -import { findProductLineList } from '@//api/base/productLine' -import { addSAPCalendar } from '@//api/production/calendarInfo' +import { findProductLineList } from '@/api/base/productLine' +import { addSAPCalendar } from '@/api/production/calendarInfo' export default { name: 'OrderInfo', @@ -482,11 +482,24 @@ export default { this.queryParams.params['beginEndTime'] = this.daterangeEndTime[0] this.queryParams.params['endEndTime'] = this.daterangeEndTime[1] } - listOrderInfo(this.queryParams).then(response => { - this.orderInfoList = response.rows - this.total = response.total - this.loading = false - }) + listOrderInfo(this.queryParams) + .then(response => { + const data = response && response.data ? response.data : response + if (Array.isArray(data)) { + this.orderInfoList = data + this.total = data.length + } else { + this.orderInfoList = (data && data.rows) ? data.rows : [] + this.total = (data && data.total) ? data.total : this.orderInfoList.length + } + }) + .catch(() => { + this.orderInfoList = [] + this.total = 0 + }) + .finally(() => { + this.loading = false + }) findProductLineList({ productLineType: 1 }).then(response => { this.productLineList = response.data })