增添優化功能
This commit is contained in:
@@ -23,7 +23,7 @@ class ExpenseApiService {
|
||||
// 1. 獲取費用申請清單
|
||||
Future<List<ExpenseApply>> fetchExpenses(String empNo) async {
|
||||
// 根據 index.js 邏輯,queryFilter 應符合後端 split('^') 的期待
|
||||
String queryFilter = "1^100^ApplyDate^*^EmpNo^$empNo";
|
||||
String queryFilter = "1^100^ApplyDate^*^^eipm24^EmpNo^$empNo^^";
|
||||
return await _apiService.fetchList<ExpenseApply>(
|
||||
tableName: "acc_ExpsApply",
|
||||
pk: "ApplyId",
|
||||
|
||||
@@ -115,7 +115,7 @@ class ExpenseDetail extends StatelessWidget {
|
||||
children: [
|
||||
_buildDetailRow(Icons.event, '費用日期', DateFormat('yyyy-MM-dd').format(expense.applyDate)),
|
||||
const Divider(height: 30),
|
||||
_buildDetailRow(Icons.badge_outlined, '申請人工號', expense.empNo),
|
||||
_buildDetailRow(Icons.badge_outlined, '申請人工號', '${expense.empNo} ${expense.personCName}'),
|
||||
const Divider(height: 30),
|
||||
_buildDetailRow(Icons.category, '費用類別', expense.expCName ?? expense.expId ?? '未分類'),
|
||||
const Divider(height: 30),
|
||||
|
||||
@@ -25,6 +25,7 @@ class ExpenseApply {
|
||||
final int? applyId;
|
||||
final DateTime applyDate;
|
||||
final String empNo;
|
||||
final String? personCName; // new
|
||||
final String? rowData; // 費用說明
|
||||
final String? picPath; // 圖片檔名/路徑
|
||||
final String? expId; // [新增] 類別 ID
|
||||
@@ -62,6 +63,7 @@ class ExpenseApply {
|
||||
this.applyId,
|
||||
required this.applyDate,
|
||||
required this.empNo,
|
||||
this.personCName, //關聯擴充欄位
|
||||
this.rowData,
|
||||
this.picPath,
|
||||
this.expId,
|
||||
@@ -76,6 +78,7 @@ class ExpenseApply {
|
||||
applyId: int.tryParse(json['ApplyId']?.toString() ?? ''),
|
||||
applyDate: json['ApplyDate'] != null ? DateTime.parse(json['ApplyDate']) : DateTime.now(),
|
||||
empNo: json['EmpNo'] as String? ?? '',
|
||||
personCName: json['personCName'] as String? ?? '', // new
|
||||
rowData: json['RowData'] as String?,
|
||||
picPath: json['PicPath'] as String?,
|
||||
expId: json['ExpId'] as String? ?? '', // [新增]
|
||||
|
||||
Reference in New Issue
Block a user