增加发票号码维护界面bug修复和新增门诊医生开立检验申请单前端页面样式、模板初步完成

This commit is contained in:
2025-12-30 13:25:55 +08:00
parent 5d8e7b667f
commit 92d74c47ce
3 changed files with 104 additions and 27 deletions

View File

@@ -52,8 +52,23 @@
<td class="sequence-number">{{ index + 1 }}</td>
<td class="employee-info">
<div class="input-container">
<!-- 操作员字段始终不可编辑 -->
<span class="employee-name">{{ item.operator || '-' }}</span>
<!-- 超级管理员可以编辑操作员字段普通用户不可编辑 -->
<select
v-if="item.isActive && isAdmin"
v-model="item.employeeId"
class="form-control"
@change="updateOperatorFromEmployeeId(item)"
>
<option value="">请选择操作员</option>
<option
v-for="user in userList"
:key="user.employeeId"
:value="user.employeeId"
>
{{ user.name }} ({{ user.employeeId }})
</option>
</select>
<span v-else class="employee-name">{{ item.operator || '-' }}</span>
</div>
</td>
<td class="employee-id-cell">
@@ -180,7 +195,7 @@ export default {
name: '',
nickName: '',
employeeId: '',
status: '' // 0: 启用(管理员), 1: 禁用(普通人员)
status: '' // 0: 启用, 1: 禁用(仅用于显示,不再控制权限)
},
// 用户列表用于操作员下拉选择将在created中从后端获取
userList: [],
@@ -195,10 +210,11 @@ export default {
}
},
computed: {
// 计算属性:判断是否为管理员
// 计算属性:判断是否为超级管理员
isAdmin() {
// 管理员是指在用户管理界面中状态为启用的用户
return this.currentUser.status === '0';
// 只有用户名等于 'admin' 的用户才是超级管理员,可以查看所有数据
const userStore = useUserStore();
return userStore.name === 'admin';
}
},
created() {
@@ -260,14 +276,25 @@ export default {
},
// 从后端加载发票数据
loadInvoiceData() {
// 准备查询参数
const queryParams = {
pageNo: 1,
pageSize: 10000 // 进一步增大分页大小,确保能获取数据库中的所有记录
};
// 非超级管理员用户只能查询自己的发票数据
if (!this.isAdmin && this.currentUser.employeeId) {
queryParams.invoicingStaffId = this.currentUser.employeeId;
console.log('普通用户模式只查询自己的发票数据员工ID:', this.currentUser.employeeId);
} else {
console.log('超级管理员模式,查询所有发票数据');
}
// 使用request工具从后端API获取发票段数据
request({
url: '/basicmanage/invoice-segment/page', // 更新为发票段的API路径
method: 'get',
params: {
pageNo: 1,
pageSize: 10000 // 进一步增大分页大小,确保能获取数据库中的所有记录
}
params: queryParams
}).then(res => {
console.log('获取到的发票段数据响应:', res);
// 添加更多调试信息
@@ -400,24 +427,24 @@ export default {
}
});
},
// 根据用户权限过滤数据
// 根据用户权限过滤数据(作为后端过滤的补充保障)
filterDataByPermission() {
console.log('开始过滤数据,当前用户状态:', this.currentUser.status);
console.log('开始过滤数据,当前用户:', this.currentUser.name, '是否超级管理员:', this.isAdmin);
console.log('过滤前数据总量:', this.invoiceData.length);
if (this.isAdmin) {
// 管理员可以看到所有数据
console.log('管理员模式,显示所有数据');
// 超级管理员可以看到所有数据
console.log('超级管理员模式,显示所有数据');
this.filteredData = [...this.invoiceData];
} else {
// 普通操作员只能看到自己的数据,确保类型一致
console.log('操作员模式,过滤条件:', this.currentUser.employeeId);
// 普通用户只能看到自己的数据,确保类型一致
console.log('普通用户模式,过滤条件:', this.currentUser.employeeId);
const currentEmployeeId = String(this.currentUser.employeeId);
this.filteredData = this.invoiceData.filter(item =>
this.filteredData = this.invoiceData.filter(item =>
String(item.employeeId) === currentEmployeeId
);
}
console.log('过滤后显示的数据量:', this.filteredData.length);
},
@@ -440,6 +467,15 @@ export default {
updateEmployeeId(item, employeeId) {
item.employeeId = employeeId;
},
// 根据员工ID更新操作员名称超级管理员使用
updateOperatorFromEmployeeId(item) {
if (item.employeeId) {
item.operator = this.getUserNameById(item.employeeId);
} else {
item.operator = '';
}
},
// 根据员工ID获取用户名称
getUserNameById(employeeId) {
@@ -449,7 +485,7 @@ export default {
},
addNewRow() {
// 新增行时自动填充当前用户信息
// 新增行时根据用户权限填充信息
// 使用负数作为临时ID避免与后端数据库ID冲突
let maxId = 0;
if (this.invoiceData.length > 0) {
@@ -458,12 +494,12 @@ export default {
const newId = -(maxId + 1);
const newSegmentId = Date.now(); // 生成唯一的segmentId
const currentDate = new Date().toISOString().split('T')[0];
const newRecord = {
id: newId,
segmentId: newSegmentId, // 为新记录设置segmentId
operator: this.currentUser.name, // 自动使用当前用户名称
employeeId: this.currentUser.employeeId,
operator: this.isAdmin ? '' : this.currentUser.name, // 超级管理员可选择,普通用户自动填充
employeeId: this.isAdmin ? '' : this.currentUser.employeeId, // 超级管理员可选择,普通用户自动填充
date: currentDate, // 自动填充当日日期
startNum: '',
endNum: '',
@@ -472,8 +508,8 @@ export default {
isActive: true, // 新增行默认处于编辑状态
isNewRecord: true // 添加标记表示这是新记录
};
console.log('添加新行,自动填充领用日期为当日:', { newRecord });
console.log('添加新行:', this.isAdmin ? '超级管理员模式,可选择操作员' : '普通用户模式,自动填充当前用户信息', { newRecord });
this.invoiceData.push(newRecord);
},
@@ -496,8 +532,8 @@ export default {
return;
}
// 严格检查权限:只能删除自己维护的发票号码段
if (record.operator !== this.currentUser.name) {
// 严格检查权限:超级管理员可以删除所有记录,普通用户只能删除自己维护的发票号码段
if (!this.isAdmin && record.operator !== this.currentUser.name) {
alert('您没有权限删除此记录!只能删除自己维护的发票号码段。');
return;
}

View File

@@ -795,3 +795,35 @@ export function getTestResult(queryParams) {
params: queryParams,
});
}
/**
* 获取检验申请单列表
*/
export function getInspectionApplicationList(queryParams) {
return request({
url: '/doctor-station/inspection/application-list',
method: 'get',
params: queryParams,
});
}
/**
* 保存检验申请单
*/
export function saveInspectionApplication(data) {
return request({
url: '/doctor-station/inspection/application',
method: 'post',
data: data,
});
}
/**
* 删除检验申请单
*/
export function deleteInspectionApplication(id) {
return request({
url: '/doctor-station/inspection/application/' + id,
method: 'delete',
});
}

View File

@@ -161,6 +161,9 @@
<el-tab-pane label="中医" name="tcm">
<tcmAdvice :patientInfo="patientInfo" ref="tcmRef" />
</el-tab-pane>
<el-tab-pane label="检验" name="inspection">
<inspectionApplication :patientInfo="patientInfo" :activeTab="activeTab" ref="inspectionRef" />
</el-tab-pane>
<el-tab-pane label="电子处方" name="eprescription">
<eprescriptionlist :patientInfo="patientInfo" ref="eprescriptionRef" />
</el-tab-pane>
@@ -214,6 +217,7 @@ import PrescriptionInfo from './components/prescription/prescriptionInfo.vue';
import eprescriptionlist from './components/eprescriptionlist.vue';
import HospitalizationDialog from './components/hospitalizationDialog.vue';
import tcmAdvice from './components/tcm/tcmAdvice.vue';
import inspectionApplication from './components/inspection/inspectionApplication.vue';
import { formatDate, formatDateStr } from '@/utils/index';
import useUserStore from '@/store/modules/user';
import { nextTick } from 'vue';
@@ -263,6 +267,7 @@ const registerTime = ref(formatDate(new Date()));
const patientDrawerRef = ref();
const prescriptionRef = ref();
const tcmRef = ref();
const inspectionRef = ref();
const emrRef = ref();
const diagnosisRef = ref();
const waitCount = ref(0);
@@ -396,6 +401,9 @@ function handleClick(tab) {
case 'tcm':
tcmRef.value.getDiagnosisInfo();
break;
case 'inspection':
// 检验tab点击处理逻辑可以在这里添加
break;
case 'eprescription':
eprescriptionRef.value.getList();
break;
@@ -453,6 +461,7 @@ function handleCardClick(item, index) {
nextTick(() => {
prescriptionRef.value.getListInfo();
tcmRef.value.getListInfo();
inspectionRef.value.getList();
diagnosisRef.value.getList();
eprescriptionRef.value.getList();
// emrRef.value.getDetail(item.encounterId);