diff --git a/openhis-ui-vue3/src/views/basicmanage/InvoiceManagement/index.vue b/openhis-ui-vue3/src/views/basicmanage/InvoiceManagement/index.vue index f1e56541..31626b82 100644 --- a/openhis-ui-vue3/src/views/basicmanage/InvoiceManagement/index.vue +++ b/openhis-ui-vue3/src/views/basicmanage/InvoiceManagement/index.vue @@ -265,7 +265,8 @@ export default { employeeAccount: user.userName, // 使用用户账号作为员工账号 status: user.status // 0: 启用(管理员), 1: 禁用(普通人员) })); - console.log('获取到的用户列表:', this.userList); + console.log('[DEBUG] 获取到的用户列表:', this.userList); + console.log('[DEBUG] 第一条用户数据:', this.userList[0]); return Promise.resolve(); }).catch(error => { console.error('获取用户列表失败:', error); @@ -327,7 +328,14 @@ export default { ((record.invoicingStaffId || record.employeeId) ? this.getUserNameById(record.invoicingStaffId || record.employeeId) : '-'), employeeId: record.invoicingStaffId || record.employeeId || '', - employeeAccount: record.employeeAccount || '', // 员工账号字段 + // 员工账号字段:通过employeeId从用户列表中获取 + employeeAccount: (record.employeeAccount) ? record.employeeAccount : + (() => { + const empId = record.invoicingStaffId || record.employeeId; + const account = this.getUserAccountById(empId); + console.log(`[DEBUG] 查找员工账号: employeeId=${empId}, 找到账号=${account}, userList长度=${this.userList.length}`); + return account; + })(), date: record.billBusDate || record.createDate ? new Date(record.billBusDate || record.createDate).toISOString().split('T')[0] : '', startNum: record.startNum || record.beginNumber || '', @@ -481,8 +489,12 @@ export default { // 根据员工ID获取用户账号 getUserAccountById(employeeId) { - if (!employeeId) return ''; + if (!employeeId) { + console.log(`[DEBUG] getUserAccountById: employeeId为空,返回空字符串`); + return ''; + } const user = this.userList.find(u => String(u.employeeId) === String(employeeId)); + console.log(`[DEBUG] getUserAccountById: 查找employeeId=${employeeId}, 匹配结果=`, user); return user ? user.employeeAccount : ''; }, diff --git a/scripts/screenshots/consultationApplication_1772771232211.png b/scripts/screenshots/consultationApplication_1772771232211.png deleted file mode 100644 index 0713ca47..00000000 Binary files a/scripts/screenshots/consultationApplication_1772771232211.png and /dev/null differ