From 547325941ac46c59786cf7248857befec7319b61 Mon Sep 17 00:00:00 2001 From: xufei <727302827@qq.com> Date: Fri, 5 Jun 2026 15:59:42 +0800 Subject: [PATCH] =?UTF-8?q?2026.6.5=20=E6=9C=8D=E5=8A=A1=E5=8D=95=E4=BD=8D?= =?UTF-8?q?=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/http/modules/basic_info_api.dart | 10 +++ .../home/unit/unit_service_list_page.dart | 70 +++++++++++-------- 2 files changed, 50 insertions(+), 30 deletions(-) diff --git a/lib/http/modules/basic_info_api.dart b/lib/http/modules/basic_info_api.dart index 28bda1e..31aa69d 100644 --- a/lib/http/modules/basic_info_api.dart +++ b/lib/http/modules/basic_info_api.dart @@ -93,6 +93,16 @@ class BasicInfoApi { data: {...data}, ); } + + /// 服务单位管理接口 + static Future> getUnitServiceList(Map data) { + return HttpManager().request( + ApiService.basePath , + '/xgfManager/project/projectPageByUser', + method: Method.post, + data: {...data}, + ); + } /// 企业入职详情 static Future> getFirmInfo(String id) { return HttpManager().request( diff --git a/lib/pages/home/unit/unit_service_list_page.dart b/lib/pages/home/unit/unit_service_list_page.dart index 86226b6..2b05311 100644 --- a/lib/pages/home/unit/unit_service_list_page.dart +++ b/lib/pages/home/unit/unit_service_list_page.dart @@ -2,6 +2,7 @@ import 'dart:convert'; import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; +import 'package:qhd_prevention/customWidget/toast_util.dart'; import 'package:qhd_prevention/pages/home/unit/unit_join_detail_page.dart'; import 'package:qhd_prevention/pages/home/unit/unit_quit_apply_page.dart'; import 'package:qhd_prevention/pages/my_appbar.dart'; @@ -23,7 +24,7 @@ class _UnitServiceListPageState extends State { // Data and state variables List list = []; int currentPage = 1; - int rows = 10; + int rows = 20; int totalPage = 1; bool isLoading = false; @@ -71,31 +72,40 @@ class _UnitServiceListPageState extends State { return time; } Future _fetchData() async { - // if (isLoading) return; - // setState(() => isLoading = true); - // - // try { - // - // final data = { - // 'pageIndex': currentPage, - // 'pageSize': rows, - // 'eqUserId': SessionService.instance.accountId - // }; - // final response = await BasicInfoApi.getFirmListByUser(data); - // setState(() { - // if (currentPage == 1) { - // list = response['data']; - // } else { - // list.addAll(response['data']); - // } - // Map page = response['page']; - // totalPage = page['totalPage'] ?? 1; - // isLoading = false; - // }); - // } catch (e) { - // print('Error fetching data: $e'); - // setState(() => isLoading = false); - // } + if (isLoading) return; + setState(() => isLoading = true); + + try { + + final data = { + 'pageIndex': currentPage, + 'pageSize': rows, + "eqProjectStatus":4, + "searchType":5, + // 'eqUserId': SessionService.instance.accountId + }; + // LoadingDialogHelper.show(); + final response = await BasicInfoApi.getUnitServiceList(data); + // LoadingDialogHelper.hide(); + if (response['success']) { + setState(() { + if (currentPage == 1) { + list = response['data']; + } else { + list.addAll(response['data']); + } + Map page = response['page']; + totalPage = page['totalPage'] ?? 1; + isLoading = false; + }); + }else { + ToastUtil.showNormal(context, '获取列表失败'); + setState(() => isLoading = false); + } + } catch (e) { + print('Error fetching data: $e'); + setState(() => isLoading = false); + } } //查看 @@ -125,7 +135,7 @@ class _UnitServiceListPageState extends State { mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Text( - '服务单位名称:${item['corpinfoName'] ?? ''}', + '服务单位名称:${item['companyName'] ?? ''}', style: TextStyle(fontSize: 16, fontWeight: FontWeight.bold), ), ], @@ -136,7 +146,7 @@ class _UnitServiceListPageState extends State { mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Text( - "所属公司: ${item['corpinfoName'] ?? ''}(相关方)", + "所属公司: ${item['corpinfoName'] ?? ''}", maxLines: 5, overflow: TextOverflow.ellipsis, ), @@ -145,14 +155,14 @@ class _UnitServiceListPageState extends State { const SizedBox(height: 8), Text( - "项目名称: ${item['corpinfoName'] ?? ''}", + "项目名称: ${item['projectName'] ?? ''}", maxLines: 5, overflow: TextOverflow.ellipsis, ), const SizedBox(height: 8), Text( - "项目类型: ${statusInfo['${item['status']}'] ?? ''}", + "项目类型: ${item['qualificationsTypeName']??''}", maxLines: 5, overflow: TextOverflow.ellipsis, ),