55门诊医生站-》中医:诊断字段
This commit is contained in:
@@ -890,9 +890,12 @@ function selectAdviceBase(key, row, pIndex) {
|
||||
type: 'minUnit',
|
||||
});
|
||||
}
|
||||
const rowData = JSON.parse(JSON.stringify(row));
|
||||
prescription.prescriptionList[rowIndex.value] = {
|
||||
...prescription.prescriptionList[rowIndex.value],
|
||||
...JSON.parse(JSON.stringify(row)),
|
||||
...prescription.prescriptionList[rowIndex.value], // 保留原有属性(如 uniqueKey, groupId)
|
||||
...rowData, // 覆盖药品信息
|
||||
statusEnum: 1, // 【关键修复】强制状态为“待签发/草稿”,确保能被保存过滤器捕获
|
||||
adviceDefinitionId: rowData.adviceDefinitionId // 确保这个字段有值,后端会根据这个字段过滤空行
|
||||
};
|
||||
prescription.prescriptionList[rowIndex.value].orgId = undefined;
|
||||
prescription.prescriptionList[rowIndex.value].dose = undefined;
|
||||
@@ -1233,44 +1236,27 @@ function handleSingOut(pIndex) {
|
||||
}
|
||||
|
||||
// 处理行checkbox选中
|
||||
/**
|
||||
* 处理行 checkbox 选中 (修改版)
|
||||
* 删除了根据 groupId 自动联动的逻辑,支持单选。
|
||||
*/
|
||||
function handleCheckBoxChange(value, index, row, pIndex) {
|
||||
const prescription = tcmPrescriptionList.value[pIndex];
|
||||
// 选中将当前行索引记录下来,取消将当前行索引删除
|
||||
|
||||
// 1. 基础逻辑:记录或移除当前选中行的索引
|
||||
if (value) {
|
||||
// 选中时,将当前行索引记录到 groupIndexList
|
||||
prescription.groupIndexList.push(index);
|
||||
} else {
|
||||
prescription.groupIndexList.splice(prescription.groupIndexList.indexOf(index), 1);
|
||||
}
|
||||
// 如果选中或取消行有组号,将全部相同组号的行全部选中,并记录或删除这些行的索引
|
||||
if (row.groupId) {
|
||||
// 获取组号相同行
|
||||
let sameGroupIdList = prescription.prescriptionList.filter((item) => {
|
||||
return item.groupId == row.groupId;
|
||||
});
|
||||
// 如果只有一个组号的情况不做处理
|
||||
if (sameGroupIdList.length == 1) {
|
||||
return;
|
||||
} else {
|
||||
sameGroupIdList.forEach((item) => {
|
||||
// 排除掉当前选中行
|
||||
if (row.uniqueKey != item.uniqueKey) {
|
||||
// 同步选中状态
|
||||
let currentIndex = prescription.prescriptionList.findIndex(
|
||||
(k) => k.uniqueKey == item.uniqueKey
|
||||
);
|
||||
prescription.prescriptionList[currentIndex].check = value;
|
||||
if (value) {
|
||||
prescription.groupIndexList.push(currentIndex); // 或使用索引或唯一标识
|
||||
} else if (!value) {
|
||||
prescription.groupIndexList.splice(
|
||||
prescription.groupIndexList.indexOf(currentIndex),
|
||||
1
|
||||
);
|
||||
}
|
||||
}
|
||||
});
|
||||
// 取消选中时,从 groupIndexList 中移除
|
||||
const targetIndex = prescription.groupIndexList.indexOf(index);
|
||||
if (targetIndex !== -1) {
|
||||
prescription.groupIndexList.splice(targetIndex, 1);
|
||||
}
|
||||
}
|
||||
|
||||
// --- 原有的 groupId 联动逻辑已删除 ---
|
||||
// 这样医生就可以单独勾选某一味药进行“删除”或“打印”操作,而不会影响同处方的其他药物。
|
||||
}
|
||||
|
||||
// 校验每个组号数量是否大于5和对应分组金额是否大于500
|
||||
|
||||
Reference in New Issue
Block a user