|
|
@ -160,11 +160,13 @@ export default { |
|
|
|
navBarHeight: 44, |
|
|
|
navBarRealHeight: 44, |
|
|
|
tabs: [ |
|
|
|
{ label: '全部', value: -1, count: 0 }, |
|
|
|
{ label: '已预约', value: 0, count: 0 }, |
|
|
|
{ label: '待质检', value: 1, count: 0 }, |
|
|
|
{ label: '已结款', value: 2, count: 0 }, |
|
|
|
{ label: '已驳回', value: 3, count: 0 } |
|
|
|
{ label: '全部', value: '' , count: 0 }, |
|
|
|
{ label: '待审核', value: 0, count: 0 }, |
|
|
|
{ label: '已预约', value: 1, count: 0 }, |
|
|
|
{ label: '待质检', value: 2, count: 0 }, |
|
|
|
{ label: '已结款', value: 3, count: 0 }, |
|
|
|
{ label: '已驳回', value: 4, count: 0 }, |
|
|
|
{ label: '已取消', value: 5, count: 0 }, |
|
|
|
], |
|
|
|
currentTab: 0, |
|
|
|
orderList: [], |
|
|
@ -199,6 +201,9 @@ export default { |
|
|
|
this.fetchOrderList() |
|
|
|
this.fetchOrderStatusStatistics() |
|
|
|
}, |
|
|
|
onShow() { |
|
|
|
this.fetchOrderStatusStatistics() |
|
|
|
}, |
|
|
|
computed: { |
|
|
|
filteredOrders() { |
|
|
|
if (this.searchText) { |
|
|
@ -240,6 +245,11 @@ export default { |
|
|
|
this.searchMode = false; |
|
|
|
}, |
|
|
|
goToOrderDetail(order) { |
|
|
|
// 新增:记录浏览记录 |
|
|
|
this.$api && this.$api('adminOrderBrowseRecord', { orderIds: order.id }, res => { |
|
|
|
// 可选:处理返回结果或错误,但不影响后续跳转 |
|
|
|
|
|
|
|
}) |
|
|
|
uni.navigateTo({ |
|
|
|
url: '/pages/manager/order-detail?id=' + order.id |
|
|
|
}) |
|
|
@ -263,24 +273,7 @@ export default { |
|
|
|
|
|
|
|
// 根据当前Tab获取对应的status参数 |
|
|
|
const tabValue = this.tabs[this.currentTab].value |
|
|
|
let statusParam = 0 // 默认值 |
|
|
|
|
|
|
|
if (tabValue === -1) { |
|
|
|
// 全部:status = 0 |
|
|
|
statusParam = 0 |
|
|
|
} else if (tabValue === 0) { |
|
|
|
// 已预约:status = 1 |
|
|
|
statusParam = 1 |
|
|
|
} else if (tabValue === 1) { |
|
|
|
// 待质检:status = 2 |
|
|
|
statusParam = 2 |
|
|
|
} else if (tabValue === 2) { |
|
|
|
// 已结款:status = 3 |
|
|
|
statusParam = 3 |
|
|
|
} else if (tabValue === 3) { |
|
|
|
// 已驳回:status = 4 |
|
|
|
statusParam = 4 |
|
|
|
} |
|
|
|
let statusParam = tabValue // 直接用tabValue作为status参数 |
|
|
|
|
|
|
|
const params = { |
|
|
|
pageNo: isLoadMore ? this.pageNo + 1 : 1, |
|
|
@ -345,14 +338,18 @@ export default { |
|
|
|
// if (state === 3) { |
|
|
|
// return { label: '已取消', class: 'gray' } |
|
|
|
// } |
|
|
|
if ((status === 1||status === 0) && state != 3 && state != 4) { |
|
|
|
if ((status === 1&&state === 0) && state != 3 && state != 4) { |
|
|
|
return { label: '已预约', class: 'green' } |
|
|
|
} else if (state === 1) { |
|
|
|
} else if (state === 1 && status === 2) { |
|
|
|
return { label: '待质检', class: 'orange' } |
|
|
|
} else if (status === 3) { |
|
|
|
} else if (status === 3&& state === 2) { |
|
|
|
return { label: '已结款', class: 'blue' } |
|
|
|
} else if (state === 4) { |
|
|
|
return { label: '已驳回', class: 'red' } |
|
|
|
}else if (state === 3) { |
|
|
|
return { label: '已取消', class: 'Turquoise2' } |
|
|
|
}else if (state === 0 && status === 0) { |
|
|
|
return { label: '待审核', class: 'blue' } |
|
|
|
} |
|
|
|
return { label: '未知状态', class: 'gray' } |
|
|
|
}, |
|
|
@ -415,11 +412,13 @@ export default { |
|
|
|
this.$api && this.$api('orderStatusStatistics', { token }, res => { |
|
|
|
if (res.code === 200 && res.result) { |
|
|
|
const stat = res.result; |
|
|
|
this.tabs[1].count = stat.appointed || 0; |
|
|
|
this.tabs[2].count = stat.waitingInspection || 0; |
|
|
|
this.tabs[3].count = stat.completed || 0; |
|
|
|
this.tabs[4].count = stat.rejected || 0; |
|
|
|
this.tabs[0].count = (stat.appointed || 0) + (stat.waitingInspection || 0) + (stat.completed || 0) + (stat.rejected || 0); |
|
|
|
this.tabs[1].count = stat.pendingAudit || 0; // 待审核 |
|
|
|
this.tabs[2].count = stat.appointed || 0; // 已预约 |
|
|
|
this.tabs[3].count = stat.waitingInspection || 0; // 待质检 |
|
|
|
this.tabs[4].count = stat.completed || 0; // 已结款 |
|
|
|
this.tabs[5].count = stat.rejected || 0; // 已驳回 |
|
|
|
this.tabs[6].count = stat.cancelled || 0; // 已取消 |
|
|
|
this.tabs[0].count = (stat.pendingAudit || 0) + (stat.appointed || 0) + (stat.waitingInspection || 0) + (stat.completed || 0) + (stat.rejected || 0) + (stat.cancelled || 0); |
|
|
|
} |
|
|
|
}); |
|
|
|
}, |
|
|
@ -604,6 +603,7 @@ export default { |
|
|
|
&.orange { background: #fff7e6; color: #ffb400; } |
|
|
|
&.blue { background: #e6f0ff; color: #409eff; } |
|
|
|
&.gray { background: #f5f5f5; color: #999; } |
|
|
|
&.Turquoise2 { background: #e0f7fa; color: #009fa8; } /* 新增已取消 */ |
|
|
|
} |
|
|
|
} |
|
|
|
.order-info-wrapper { |
|
|
@ -620,6 +620,7 @@ export default { |
|
|
|
&.orange { background: #fff7e6; color: #ffb400; } |
|
|
|
&.blue { background: #e6f0ff; color: #409eff; } |
|
|
|
&.gray { background: #f5f5f5; color: #999; } |
|
|
|
&.Turquoise2 { background: #e0f7fa; color: #009fa8; } /* 新增已取消 */ |
|
|
|
} |
|
|
|
} |
|
|
|
.order-info { |
|
|
|