2026.6.5 服务单位管理
parent
1105dbb2cf
commit
547325941a
|
|
@ -93,6 +93,16 @@ class BasicInfoApi {
|
|||
data: {...data},
|
||||
);
|
||||
}
|
||||
|
||||
/// 服务单位管理接口
|
||||
static Future<Map<String, dynamic>> getUnitServiceList(Map data) {
|
||||
return HttpManager().request(
|
||||
ApiService.basePath ,
|
||||
'/xgfManager/project/projectPageByUser',
|
||||
method: Method.post,
|
||||
data: {...data},
|
||||
);
|
||||
}
|
||||
/// 企业入职详情
|
||||
static Future<Map<String, dynamic>> getFirmInfo(String id) {
|
||||
return HttpManager().request(
|
||||
|
|
|
|||
|
|
@ -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<UnitServiceListPage> {
|
|||
// Data and state variables
|
||||
List<dynamic> list = [];
|
||||
int currentPage = 1;
|
||||
int rows = 10;
|
||||
int rows = 20;
|
||||
int totalPage = 1;
|
||||
bool isLoading = false;
|
||||
|
||||
|
|
@ -71,31 +72,40 @@ class _UnitServiceListPageState extends State<UnitServiceListPage> {
|
|||
return time;
|
||||
}
|
||||
Future<void> _fetchData() async {
|
||||
// if (isLoading) return;
|
||||
// setState(() => isLoading = true);
|
||||
//
|
||||
// try {
|
||||
//
|
||||
// final data = {
|
||||
// 'pageIndex': currentPage,
|
||||
// 'pageSize': rows,
|
||||
if (isLoading) return;
|
||||
setState(() => isLoading = true);
|
||||
|
||||
try {
|
||||
|
||||
final data = {
|
||||
'pageIndex': currentPage,
|
||||
'pageSize': rows,
|
||||
"eqProjectStatus":4,
|
||||
"searchType":5,
|
||||
// 'eqUserId': SessionService.instance.accountId
|
||||
// };
|
||||
// final response = await BasicInfoApi.getFirmListByUser(data);
|
||||
// setState(() {
|
||||
// if (currentPage == 1) {
|
||||
// list = response['data'];
|
||||
// } else {
|
||||
// list.addAll(response['data']);
|
||||
// }
|
||||
// Map<String, dynamic> page = response['page'];
|
||||
// totalPage = page['totalPage'] ?? 1;
|
||||
// isLoading = false;
|
||||
// });
|
||||
// } catch (e) {
|
||||
// print('Error fetching data: $e');
|
||||
// setState(() => isLoading = false);
|
||||
// }
|
||||
};
|
||||
// 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<String, dynamic> 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<UnitServiceListPage> {
|
|||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
'服务单位名称:${item['corpinfoName'] ?? ''}',
|
||||
'服务单位名称:${item['companyName'] ?? ''}',
|
||||
style: TextStyle(fontSize: 16, fontWeight: FontWeight.bold),
|
||||
),
|
||||
],
|
||||
|
|
@ -136,7 +146,7 @@ class _UnitServiceListPageState extends State<UnitServiceListPage> {
|
|||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
"所属公司: ${item['corpinfoName'] ?? ''}(相关方)",
|
||||
"所属公司: ${item['corpinfoName'] ?? ''}",
|
||||
maxLines: 5,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
|
|
@ -145,14 +155,14 @@ class _UnitServiceListPageState extends State<UnitServiceListPage> {
|
|||
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,
|
||||
),
|
||||
|
|
|
|||
Loading…
Reference in New Issue