|
|
@@ -920,24 +920,37 @@ export class OrderManagementPage {
|
|
|
* @param newStatus 新的工作状态
|
|
|
*/
|
|
|
async updatePersonWorkStatus(personName: string, newStatus: WorkStatus) {
|
|
|
- // 找到人员行
|
|
|
- const personRow = this.page.locator('[role="dialog"]').locator('table tbody tr').filter({ hasText: personName });
|
|
|
+ const dialog = this.page.locator('[role="dialog"]');
|
|
|
+
|
|
|
+ // 找到所有表格,选择第二个表格(绑定人员列表)
|
|
|
+ // 第一个表格是待添加人员列表,第二个是绑定人员列表
|
|
|
+ const allTables = await dialog.locator('table').all();
|
|
|
+ const boundPersonsTable = allTables[1]; // 第二个表格
|
|
|
+
|
|
|
+ // 在该表格中找到包含人员姓名的行
|
|
|
+ const allRows = boundPersonsTable.locator('tbody tr');
|
|
|
+ const targetRow = allRows.filter({ hasText: personName });
|
|
|
+
|
|
|
+ // 工作状态在倒数第二列(最后一列是薪资)
|
|
|
+ const cells = targetRow.locator('td');
|
|
|
+ const cellCount = await cells.count();
|
|
|
+
|
|
|
+ // 工作状态是倒数第二列(索引 cellCount - 2)
|
|
|
+ const workStatusCell = cells.nth(cellCount - 2);
|
|
|
+ const workStatusSelect = workStatusCell.locator('[role="combobox"]');
|
|
|
+
|
|
|
+ await workStatusSelect.click();
|
|
|
|
|
|
- // 点击编辑工作状态按钮
|
|
|
- const editButton = personRow.getByRole('button', { name: /编辑|修改/ });
|
|
|
- await editButton.click();
|
|
|
+ // 等待下拉选项显示
|
|
|
await this.page.waitForTimeout(300);
|
|
|
|
|
|
- // 选择新的工作状态
|
|
|
+ // 使用中文标签选择选项
|
|
|
const workStatusLabel = WORK_STATUS_LABELS[newStatus];
|
|
|
- await selectRadixOption(this.page, '工作状态', workStatusLabel);
|
|
|
-
|
|
|
- // 提交
|
|
|
- const submitButton = this.page.getByRole('button', { name: /^(更新|保存|确定)$/ });
|
|
|
- await submitButton.click();
|
|
|
+ const option = this.page.getByRole('option').filter({ hasText: workStatusLabel });
|
|
|
+ await option.click();
|
|
|
|
|
|
await this.page.waitForLoadState('networkidle');
|
|
|
- await this.page.waitForTimeout(1000);
|
|
|
+ await this.page.waitForTimeout(500);
|
|
|
}
|
|
|
|
|
|
// ===== 附件管理 =====
|