fix: 修复多模块Bug及功能优化

修复药品汇总、医嘱套餐、转科管理、用药汇总、处方列表、用户管理等多个模块的问题
This commit is contained in:
Ranyunqiao
2026-05-06 10:42:57 +08:00
parent 8a2f7965bd
commit d3c4b612e4
12 changed files with 84 additions and 16 deletions

View File

@@ -267,7 +267,7 @@
/>
</el-select>
</template>
<span v-else>{{ scope.row.methodCode }}</span>
<span v-else>{{ scope.row.methodCode_dictText || scope.row.methodCode }}</span>
</template>
<span v-else>{{ '-' }}</span>
</template>
@@ -597,6 +597,13 @@ function handleEdit(tab, row) {
groupId: item.groupId,
groupOrder: item.groupOrder,
therapyEnum: item.therapyEnum != null ? String(item.therapyEnum) : '1',
// 医嘱类型(药品=1没有则按表名推断
adviceType:
item.adviceType !== undefined
? item.adviceType
: item.orderDefinitionTable === 'med_medication_definition'
? 1
: undefined,
};
});
prescriptionList.value.unshift({

View File

@@ -34,11 +34,12 @@
type="daterange"
start-placeholder="开始日期"
end-placeholder="结束日期"
style="width: 510px"
style="width: 400px"
value-format="YYYY-MM-DD"
:clearable="false"
@change="getSummaryList"
/>
<el-button type="primary" @click="getSummaryList" style="margin-left: 10px">搜索</el-button>
<el-button @click="resetQuery">重置</el-button>
</div>
<div>
<el-button type="primary" plain @click="handleSend">批量发药</el-button>
@@ -178,6 +179,17 @@ function getSummaryList() {
});
}
// 重置查询条件
function resetQuery() {
queryParams.value.applyTime = [
proxy.formatDateStr(new Date().setMonth(new Date().getMonth() - 1), 'YYYY-MM-DD'),
proxy.formatDateStr(new Date(), 'YYYY-MM-DD'),
];
queryParams.value.searchKey = '';
queryParams.value.statusEnum = '';
getSummaryList();
}
function getDetails(row) {
loading.value = true;
getFromSummaryDetails({ summaryNo: row.busNo }).then((res) => {

View File

@@ -272,10 +272,18 @@ function handleGetPrescription() {
function handleMedicineSummary() {
let paramList = getSelectRows();
if (!paramList || paramList.length === 0) {
proxy.$message.warning('请至少选择一条待汇总的药品');
return;
}
let ids = [];
paramList = paramList.forEach((item) => {
paramList.forEach((item) => {
ids.push(...item.dispenseIds);
});
if (ids.length === 0) {
proxy.$message.warning('所选药品未关联发放信息');
return;
}
medicineSummary(ids).then((res) => {
if (res.code == 200) {
proxy.$message.success('操作成功');

View File

@@ -918,10 +918,13 @@ function remakeBlur(row, index) {
editBatchTransfer(index);
}
function handleSave() {
// if (form.purchaseinventoryList.length == 0) {
// proxy.$message.warning('请先生成批量调拨单在进行批量保存!');
// return;
// }
const invalidRow = totalIncentoryInfoList.value.find(
(row) => !row.price || row.price <= 0
);
if (invalidRow) {
proxy.$message.warning('调拨单价不能为空或为0请检查');
return;
}
addTransferProductBatch(totalIncentoryInfoList.value).then((res) => {
if (res.code == 200) {
proxy.$modal.msgSuccess('保存成功');

View File

@@ -1306,10 +1306,12 @@ function handleSave(row, index) {
} else if (row.unitCode == row.unitList.minUnitCode) {
row.unitCode_dictText = row.unitList.minUnitCode_dictText;
}
if (forms.purchaseinventoryList[index].price == 0) {
forms.purchaseinventoryList[index].price = 0;
forms.purchaseinventoryList[index].totalPrice = 0;
if (!forms.purchaseinventoryList[index].price || forms.purchaseinventoryList[index].price <= 0) {
proxy.$message.warning('调拨单价不能为空或为0请检查');
return;
}
forms.purchaseinventoryList[index].totalPrice =
forms.purchaseinventoryList[index].price * forms.purchaseinventoryList[index].itemQuantity;
rowList.value.push(JSON.parse(JSON.stringify(row)));
if (
rowList._rawValue &&
@@ -1355,10 +1357,12 @@ function handleSave(row, index) {
} else if (rows.unitCode == rows.unitList.minUnitCode) {
rows.unitCode_dictText = rows.unitList.minUnitCode_dictText;
}
if (form.purchaseinventoryList[index].price == 0) {
form.purchaseinventoryList[index].price = 0;
form.purchaseinventoryList[index].totalPrice = 0;
if (!form.purchaseinventoryList[index].price || form.purchaseinventoryList[index].price <= 0) {
proxy.$message.warning('调拨单价不能为空或为0请检查');
return;
}
form.purchaseinventoryList[index].totalPrice =
form.purchaseinventoryList[index].price * form.purchaseinventoryList[index].itemQuantity;
rowList.value.push(JSON.parse(JSON.stringify(rows)));
if (
rowList._rawValue &&

View File

@@ -23,7 +23,11 @@
highlight-current
default-expand-all
@node-click="handleNodeClick"
/>
>
<template #default="{ node, data }">
<span v-html="highlightText(data.name)"></span>
</template>
</el-tree>
</div>
</el-col>
<!--用户数据-->
@@ -690,7 +694,13 @@ const { queryParams, form, rules } = toRefs(data);
/** 通过条件过滤节点 */
const filterNode = (value, data) => {
if (!value) return true;
return data.label.indexOf(value) !== -1;
return data.name.indexOf(value) !== -1;
};
/** 高亮匹配关键字 */
const highlightText = (text) => {
if (!deptName.value || !text) return text;
const regex = new RegExp(`(${deptName.value})`, 'gi');
return text.replace(regex, '<span class="tree-highlight">$1</span>');
};
/** 根据名称筛选部门树 */
watch(deptName, (val) => {
@@ -1344,4 +1354,8 @@ getWardList();
top: -10px;
right: -10px;
}
:deep(.tree-highlight) {
color: #409eff;
font-weight: bold;
}
</style>