增加发票号码维护界面bug修复和新增门诊医生开立检验申请单前端页面样式、模板初步完成
This commit is contained in:
@@ -52,8 +52,23 @@
|
|||||||
<td class="sequence-number">{{ index + 1 }}</td>
|
<td class="sequence-number">{{ index + 1 }}</td>
|
||||||
<td class="employee-info">
|
<td class="employee-info">
|
||||||
<div class="input-container">
|
<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>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td class="employee-id-cell">
|
<td class="employee-id-cell">
|
||||||
@@ -180,7 +195,7 @@ export default {
|
|||||||
name: '',
|
name: '',
|
||||||
nickName: '',
|
nickName: '',
|
||||||
employeeId: '',
|
employeeId: '',
|
||||||
status: '' // 0: 启用(管理员), 1: 禁用(普通人员)
|
status: '' // 0: 启用, 1: 禁用(仅用于显示,不再控制权限)
|
||||||
},
|
},
|
||||||
// 用户列表,用于操作员下拉选择(将在created中从后端获取)
|
// 用户列表,用于操作员下拉选择(将在created中从后端获取)
|
||||||
userList: [],
|
userList: [],
|
||||||
@@ -195,10 +210,11 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
// 计算属性:判断是否为管理员
|
// 计算属性:判断是否为超级管理员
|
||||||
isAdmin() {
|
isAdmin() {
|
||||||
// 管理员是指在用户管理界面中状态为启用的用户
|
// 只有用户名等于 'admin' 的用户才是超级管理员,可以查看所有数据
|
||||||
return this.currentUser.status === '0';
|
const userStore = useUserStore();
|
||||||
|
return userStore.name === 'admin';
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
@@ -260,14 +276,25 @@ export default {
|
|||||||
},
|
},
|
||||||
// 从后端加载发票数据
|
// 从后端加载发票数据
|
||||||
loadInvoiceData() {
|
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工具从后端API获取发票段数据
|
||||||
request({
|
request({
|
||||||
url: '/basicmanage/invoice-segment/page', // 更新为发票段的API路径
|
url: '/basicmanage/invoice-segment/page', // 更新为发票段的API路径
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params: {
|
params: queryParams
|
||||||
pageNo: 1,
|
|
||||||
pageSize: 10000 // 进一步增大分页大小,确保能获取数据库中的所有记录
|
|
||||||
}
|
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
console.log('获取到的发票段数据响应:', res);
|
console.log('获取到的发票段数据响应:', res);
|
||||||
// 添加更多调试信息
|
// 添加更多调试信息
|
||||||
@@ -400,18 +427,18 @@ export default {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
// 根据用户权限过滤数据
|
// 根据用户权限过滤数据(作为后端过滤的补充保障)
|
||||||
filterDataByPermission() {
|
filterDataByPermission() {
|
||||||
console.log('开始过滤数据,当前用户状态:', this.currentUser.status);
|
console.log('开始过滤数据,当前用户:', this.currentUser.name, '是否超级管理员:', this.isAdmin);
|
||||||
console.log('过滤前数据总量:', this.invoiceData.length);
|
console.log('过滤前数据总量:', this.invoiceData.length);
|
||||||
|
|
||||||
if (this.isAdmin) {
|
if (this.isAdmin) {
|
||||||
// 管理员可以看到所有数据
|
// 超级管理员可以看到所有数据
|
||||||
console.log('管理员模式,显示所有数据');
|
console.log('超级管理员模式,显示所有数据');
|
||||||
this.filteredData = [...this.invoiceData];
|
this.filteredData = [...this.invoiceData];
|
||||||
} else {
|
} else {
|
||||||
// 普通操作员只能看到自己的数据,确保类型一致
|
// 普通用户只能看到自己的数据,确保类型一致
|
||||||
console.log('操作员模式,过滤条件:', this.currentUser.employeeId);
|
console.log('普通用户模式,过滤条件:', this.currentUser.employeeId);
|
||||||
const currentEmployeeId = String(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
|
String(item.employeeId) === currentEmployeeId
|
||||||
@@ -441,6 +468,15 @@ export default {
|
|||||||
item.employeeId = employeeId;
|
item.employeeId = employeeId;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// 根据员工ID更新操作员名称(超级管理员使用)
|
||||||
|
updateOperatorFromEmployeeId(item) {
|
||||||
|
if (item.employeeId) {
|
||||||
|
item.operator = this.getUserNameById(item.employeeId);
|
||||||
|
} else {
|
||||||
|
item.operator = '';
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
// 根据员工ID获取用户名称
|
// 根据员工ID获取用户名称
|
||||||
getUserNameById(employeeId) {
|
getUserNameById(employeeId) {
|
||||||
if (!employeeId) return '';
|
if (!employeeId) return '';
|
||||||
@@ -449,7 +485,7 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
addNewRow() {
|
addNewRow() {
|
||||||
// 新增行时自动填充当前用户信息
|
// 新增行时根据用户权限填充信息
|
||||||
// 使用负数作为临时ID,避免与后端数据库ID冲突
|
// 使用负数作为临时ID,避免与后端数据库ID冲突
|
||||||
let maxId = 0;
|
let maxId = 0;
|
||||||
if (this.invoiceData.length > 0) {
|
if (this.invoiceData.length > 0) {
|
||||||
@@ -462,8 +498,8 @@ export default {
|
|||||||
const newRecord = {
|
const newRecord = {
|
||||||
id: newId,
|
id: newId,
|
||||||
segmentId: newSegmentId, // 为新记录设置segmentId
|
segmentId: newSegmentId, // 为新记录设置segmentId
|
||||||
operator: this.currentUser.name, // 自动使用当前用户名称
|
operator: this.isAdmin ? '' : this.currentUser.name, // 超级管理员可选择,普通用户自动填充
|
||||||
employeeId: this.currentUser.employeeId,
|
employeeId: this.isAdmin ? '' : this.currentUser.employeeId, // 超级管理员可选择,普通用户自动填充
|
||||||
date: currentDate, // 自动填充当日日期
|
date: currentDate, // 自动填充当日日期
|
||||||
startNum: '',
|
startNum: '',
|
||||||
endNum: '',
|
endNum: '',
|
||||||
@@ -473,7 +509,7 @@ export default {
|
|||||||
isNewRecord: true // 添加标记表示这是新记录
|
isNewRecord: true // 添加标记表示这是新记录
|
||||||
};
|
};
|
||||||
|
|
||||||
console.log('添加新行,自动填充领用日期为当日:', { newRecord });
|
console.log('添加新行:', this.isAdmin ? '超级管理员模式,可选择操作员' : '普通用户模式,自动填充当前用户信息', { newRecord });
|
||||||
this.invoiceData.push(newRecord);
|
this.invoiceData.push(newRecord);
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -496,8 +532,8 @@ export default {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 严格检查权限:只能删除自己维护的发票号码段
|
// 严格检查权限:超级管理员可以删除所有记录,普通用户只能删除自己维护的发票号码段
|
||||||
if (record.operator !== this.currentUser.name) {
|
if (!this.isAdmin && record.operator !== this.currentUser.name) {
|
||||||
alert('您没有权限删除此记录!只能删除自己维护的发票号码段。');
|
alert('您没有权限删除此记录!只能删除自己维护的发票号码段。');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -795,3 +795,35 @@ export function getTestResult(queryParams) {
|
|||||||
params: 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',
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|||||||
@@ -161,6 +161,9 @@
|
|||||||
<el-tab-pane label="中医" name="tcm">
|
<el-tab-pane label="中医" name="tcm">
|
||||||
<tcmAdvice :patientInfo="patientInfo" ref="tcmRef" />
|
<tcmAdvice :patientInfo="patientInfo" ref="tcmRef" />
|
||||||
</el-tab-pane>
|
</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">
|
<el-tab-pane label="电子处方" name="eprescription">
|
||||||
<eprescriptionlist :patientInfo="patientInfo" ref="eprescriptionRef" />
|
<eprescriptionlist :patientInfo="patientInfo" ref="eprescriptionRef" />
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
@@ -214,6 +217,7 @@ import PrescriptionInfo from './components/prescription/prescriptionInfo.vue';
|
|||||||
import eprescriptionlist from './components/eprescriptionlist.vue';
|
import eprescriptionlist from './components/eprescriptionlist.vue';
|
||||||
import HospitalizationDialog from './components/hospitalizationDialog.vue';
|
import HospitalizationDialog from './components/hospitalizationDialog.vue';
|
||||||
import tcmAdvice from './components/tcm/tcmAdvice.vue';
|
import tcmAdvice from './components/tcm/tcmAdvice.vue';
|
||||||
|
import inspectionApplication from './components/inspection/inspectionApplication.vue';
|
||||||
import { formatDate, formatDateStr } from '@/utils/index';
|
import { formatDate, formatDateStr } from '@/utils/index';
|
||||||
import useUserStore from '@/store/modules/user';
|
import useUserStore from '@/store/modules/user';
|
||||||
import { nextTick } from 'vue';
|
import { nextTick } from 'vue';
|
||||||
@@ -263,6 +267,7 @@ const registerTime = ref(formatDate(new Date()));
|
|||||||
const patientDrawerRef = ref();
|
const patientDrawerRef = ref();
|
||||||
const prescriptionRef = ref();
|
const prescriptionRef = ref();
|
||||||
const tcmRef = ref();
|
const tcmRef = ref();
|
||||||
|
const inspectionRef = ref();
|
||||||
const emrRef = ref();
|
const emrRef = ref();
|
||||||
const diagnosisRef = ref();
|
const diagnosisRef = ref();
|
||||||
const waitCount = ref(0);
|
const waitCount = ref(0);
|
||||||
@@ -396,6 +401,9 @@ function handleClick(tab) {
|
|||||||
case 'tcm':
|
case 'tcm':
|
||||||
tcmRef.value.getDiagnosisInfo();
|
tcmRef.value.getDiagnosisInfo();
|
||||||
break;
|
break;
|
||||||
|
case 'inspection':
|
||||||
|
// 检验tab点击处理逻辑可以在这里添加
|
||||||
|
break;
|
||||||
case 'eprescription':
|
case 'eprescription':
|
||||||
eprescriptionRef.value.getList();
|
eprescriptionRef.value.getList();
|
||||||
break;
|
break;
|
||||||
@@ -453,6 +461,7 @@ function handleCardClick(item, index) {
|
|||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
prescriptionRef.value.getListInfo();
|
prescriptionRef.value.getListInfo();
|
||||||
tcmRef.value.getListInfo();
|
tcmRef.value.getListInfo();
|
||||||
|
inspectionRef.value.getList();
|
||||||
diagnosisRef.value.getList();
|
diagnosisRef.value.getList();
|
||||||
eprescriptionRef.value.getList();
|
eprescriptionRef.value.getList();
|
||||||
// emrRef.value.getDetail(item.encounterId);
|
// emrRef.value.getDetail(item.encounterId);
|
||||||
|
|||||||
Reference in New Issue
Block a user