1
This commit is contained in:
@@ -255,8 +255,20 @@ export default {
|
|||||||
// 使用专门的搜索接口
|
// 使用专门的搜索接口
|
||||||
const res = await searchOrders(queryParams)
|
const res = await searchOrders(queryParams)
|
||||||
|
|
||||||
if (res && (res.code === 200 || res.msg === '操作成功')) {
|
console.log('搜索响应:', res) // 调试用
|
||||||
|
|
||||||
|
// 判断响应是否成功(兼容多种响应格式)
|
||||||
|
const isSuccess = res && (
|
||||||
|
res.code === 200 ||
|
||||||
|
res.code === 0 ||
|
||||||
|
res.msg === '操作成功' ||
|
||||||
|
res.msg === '查询成功' ||
|
||||||
|
(res.rows && Array.isArray(res.rows))
|
||||||
|
)
|
||||||
|
|
||||||
|
if (isSuccess) {
|
||||||
const list = (res.rows || res.data || [])
|
const list = (res.rows || res.data || [])
|
||||||
|
console.log('解析到的列表:', list) // 调试用
|
||||||
|
|
||||||
// 处理退款相关字段的默认值
|
// 处理退款相关字段的默认值
|
||||||
this.orderList = list.map(item => ({
|
this.orderList = list.map(item => ({
|
||||||
@@ -268,12 +280,16 @@ export default {
|
|||||||
|
|
||||||
this.total = res.total || 0
|
this.total = res.total || 0
|
||||||
|
|
||||||
|
console.log('最终订单列表:', this.orderList) // 调试用
|
||||||
|
console.log('总数:', this.total) // 调试用
|
||||||
|
|
||||||
if (this.orderList.length === 0) {
|
if (this.orderList.length === 0) {
|
||||||
this.$message.info('未找到匹配的订单')
|
this.$message.info('未找到匹配的订单')
|
||||||
} else {
|
} else {
|
||||||
this.$message.success(`找到 ${this.total} 条匹配的订单`)
|
this.$message.success(`找到 ${this.total} 条匹配的订单`)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
console.error('响应判断失败:', res) // 调试用
|
||||||
this.$message.error(res && res.msg ? res.msg : '搜索失败')
|
this.$message.error(res && res.msg ? res.msg : '搜索失败')
|
||||||
this.orderList = []
|
this.orderList = []
|
||||||
this.total = 0
|
this.total = 0
|
||||||
|
|||||||
Reference in New Issue
Block a user