|
|
@@ -29,7 +29,7 @@
|
|
|
</view>
|
|
|
<view class="info-row">
|
|
|
<view class="info-label">
|
|
|
- <text class="text-gray">{{ getCreateTime(item) }}</text>
|
|
|
+ <text class="text-gray">{{ getDisplayTime(item) }}</text>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
@@ -43,7 +43,7 @@
|
|
|
import { ref, onBeforeUnmount, onMounted } from 'vue'
|
|
|
import type { acceptOrderInfo } from '../../types/order'
|
|
|
import type { SysDictData } from '../../types/dict'
|
|
|
-import { getOrderList } from '../../api/order/list'
|
|
|
+import { pendingList } from '../../api/order/list'
|
|
|
import { getDictDataByType } from '../../api/dict/index'
|
|
|
|
|
|
// 列表数据
|
|
|
@@ -122,7 +122,7 @@ import { getDictDataByType } from '../../api/dict/index'
|
|
|
// 调用 API,传递关键字参数
|
|
|
const searchKeyword = keyword.value.length > 0 ? keyword.value : null
|
|
|
|
|
|
- const result = await getOrderList(page.value, pageSize, searchKeyword, "pending")
|
|
|
+ const result = await pendingList(page.value, pageSize, searchKeyword)
|
|
|
|
|
|
// 提取响应数据
|
|
|
const resultObj = result as UTSJSONObject
|
|
|
@@ -158,7 +158,9 @@ import { getDictDataByType } from '../../api/dict/index'
|
|
|
model: item['model'] as string | null,
|
|
|
createTime: item['createTime'] as string | null,
|
|
|
suspendReason: item['suspendReason'] as string | null,
|
|
|
- rejectionReason: item['rejectionReason'] as string | null
|
|
|
+ rejectionReason: item['rejectionReason'] as string | null,
|
|
|
+ updateTime: item['updateTime'] as string | null, // 新增字段
|
|
|
+ workEndTime: item['workEndTime'] as string | null // 新增字段
|
|
|
}
|
|
|
newData.push(orderItem)
|
|
|
}
|
|
|
@@ -222,13 +224,35 @@ import { getDictDataByType } from '../../api/dict/index'
|
|
|
const orderInfoItem = item as acceptOrderInfo
|
|
|
return orderInfoItem.pcsDeviceName
|
|
|
}
|
|
|
-
|
|
|
- const getCreateTime = (item: any | null): string|null => {
|
|
|
- if (item == null) return null
|
|
|
- const orderInfoItem = item as acceptOrderInfo
|
|
|
- return orderInfoItem.createTime
|
|
|
+
|
|
|
+ // 根据状态显示不同的时间
|
|
|
+ const getDisplayTime = (item: any | null): string|null => {
|
|
|
+ if (item == null) return null
|
|
|
+ const orderInfoItem = item as acceptOrderInfo
|
|
|
+
|
|
|
+ // 如果是"待接单"状态,显示派单时间
|
|
|
+ if (orderInfoItem.workOrderStatus == 'assigned') {
|
|
|
+ return '下发时间:' + orderInfoItem.assignTime
|
|
|
+ } else if(orderInfoItem.workOrderStatus == 'to_finish') {
|
|
|
+ if(orderInfoItem.workEndTime != null) {
|
|
|
+ return '结束时间:' + orderInfoItem.workEndTime
|
|
|
+ }
|
|
|
+ return '接单时间:' + orderInfoItem.acceptTime
|
|
|
+ } else if(orderInfoItem.workOrderStatus == 'to_approve') {
|
|
|
+ return '申请挂起时间:' + orderInfoItem.updateTime
|
|
|
+ } else if(orderInfoItem.workOrderStatus == 'suspended') {
|
|
|
+ return '审批通过时间:' + orderInfoItem.updateTime
|
|
|
+ } else if(orderInfoItem.workOrderStatus == 'return' || orderInfoItem.workOrderStatus == 'accept_return') {
|
|
|
+ return '退回时间:' + orderInfoItem.updateTime
|
|
|
+ } else if(orderInfoItem.workOrderStatus == 'completed') {
|
|
|
+ return '结单时间:' + orderInfoItem.updateTime
|
|
|
+ }
|
|
|
+
|
|
|
+ // 默认显示创建时间
|
|
|
+ return '创建时间:' + orderInfoItem.createTime
|
|
|
}
|
|
|
|
|
|
+
|
|
|
const getWorkOrderStatus = (item: any | null): string | null => {
|
|
|
if (item == null) return ''
|
|
|
const orderInfoItem = item as acceptOrderInfo
|