|
|
@@ -54,7 +54,6 @@ interface OrderCardProps {
|
|
|
status: string
|
|
|
statusLabel: string
|
|
|
statusClass: string
|
|
|
- expectedPeople: number
|
|
|
actualPeople: number
|
|
|
startDate: string
|
|
|
endDate: string
|
|
|
@@ -88,10 +87,6 @@ const OrderCard: React.FC<OrderCardProps> = ({ order, onViewDetail }) => {
|
|
|
|
|
|
{/* 订单信息网格 */}
|
|
|
<View className="grid grid-cols-2 gap-3 text-sm mb-3">
|
|
|
- <View className="flex flex-col">
|
|
|
- <Text className="text-gray-500">预计人数</Text>
|
|
|
- <Text className="text-gray-800">{order.expectedPeople}人</Text>
|
|
|
- </View>
|
|
|
<View className="flex flex-col">
|
|
|
<Text className="text-gray-500">实际人数</Text>
|
|
|
<Text className="text-gray-800">{order.actualPeople}人</Text>
|
|
|
@@ -100,8 +95,8 @@ const OrderCard: React.FC<OrderCardProps> = ({ order, onViewDetail }) => {
|
|
|
<Text className="text-gray-500">开始日期</Text>
|
|
|
<Text className="text-gray-800">{order.startDate}</Text>
|
|
|
</View>
|
|
|
- <View className="flex flex-col">
|
|
|
- <Text className="text-gray-500">预计结束</Text>
|
|
|
+ <View className="flex flex-col col-span-2">
|
|
|
+ <Text className="text-gray-500">实际结束</Text>
|
|
|
<Text className="text-gray-800">{order.endDate}</Text>
|
|
|
</View>
|
|
|
</View>
|
|
|
@@ -214,7 +209,8 @@ const OrderList: React.FC = () => {
|
|
|
const data = await response.json()
|
|
|
// 转换API数据到UI格式 - 使用RPC推断的OrderData类型
|
|
|
const transformedOrders = (data.data || []).map((order: OrderData) => {
|
|
|
- const orderPersonsCount = order.orderPersons?.length || 0
|
|
|
+ // personCount 由后端计算返回,但 RPC 类型暂未更新,使用类型断言
|
|
|
+ const orderPersonsCount = (order as any).personCount ?? order.orderPersons?.length ?? 0
|
|
|
const talentName = order.orderPersons && order.orderPersons.length > 0
|
|
|
? order.orderPersons[0].person?.name || '关联人才'
|
|
|
: '待关联'
|
|
|
@@ -227,10 +223,9 @@ const OrderList: React.FC = () => {
|
|
|
status: order.orderStatus || 'draft',
|
|
|
statusLabel: getStatusLabel(order.orderStatus),
|
|
|
statusClass: getStatusClass(order.orderStatus),
|
|
|
- expectedPeople: 0, // 预计人数字段不存在于API,暂设为0
|
|
|
actualPeople: orderPersonsCount,
|
|
|
startDate: order.expectedStartDate ? new Date(order.expectedStartDate).toISOString().split('T')[0] : '未设置',
|
|
|
- endDate: order.actualEndDate ? new Date(order.actualEndDate).toISOString().split('T')[0] : '未设置',
|
|
|
+ endDate: order.actualEndDate ? new Date(order.actualEndDate).toISOString().split('T')[0] : '未结束',
|
|
|
talentName: talentName,
|
|
|
position: '未设置' // 岗位字段不存在于API
|
|
|
// 注意:统计数据现在由 OrderCard 组件通过 useOrderStats hook 单独获取
|