|
@@ -133,10 +133,17 @@ $(function () {
|
|
|
tracCodgCount = tracCodgList.length;
|
|
|
}
|
|
|
|
|
|
- console.log('药品:', drug.drugname, '处方数量:', prescriptionQuantity, '追溯码数量:', tracCodgCount);
|
|
|
+ console.log('药品:', drug.drugname, '处方数量:', prescriptionQuantity, '追溯码数量:', tracCodgCount, '拆零状态:', drug.serial);
|
|
|
|
|
|
- // 检查数量是否匹配
|
|
|
- if (tracCodgCount !== prescriptionQuantity) {
|
|
|
+ // ================= 新增:根据药品类型区分验证逻辑 =================
|
|
|
+ // 目的:拆零药品不强制上传追溯码,不拆零药品维持原样
|
|
|
+ // 判断逻辑:serial="01"为拆零药品,serial="99"为不拆零药品
|
|
|
+
|
|
|
+ let isSplitDrug = (drug.serial === '01'); // 拆零药品
|
|
|
+ let isNonSplitDrug = (drug.serial === '99'); // 不拆零药品
|
|
|
+
|
|
|
+ // 只有不拆零药品才检查追溯码数量是否匹配
|
|
|
+ if (isNonSplitDrug && tracCodgCount !== prescriptionQuantity) {
|
|
|
hasMismatch = true;
|
|
|
let difference = tracCodgCount - prescriptionQuantity;
|
|
|
let differenceText = '';
|
|
@@ -149,6 +156,12 @@ $(function () {
|
|
|
|
|
|
mismatchMessage += '药品【' + drug.drugname + '】: 处方数量 ' + prescriptionQuantity + ',追溯码数量 ' + tracCodgCount + ',' + differenceText + ';\n';
|
|
|
}
|
|
|
+
|
|
|
+ // 拆零药品不检查追溯码数量,直接跳过
|
|
|
+ if (isSplitDrug) {
|
|
|
+ console.log('拆零药品【' + drug.drugname + '】不强制上传追溯码,跳过数量验证');
|
|
|
+ }
|
|
|
+ // ================= 新增结束 =================
|
|
|
}
|
|
|
|
|
|
// 如果数量不匹配,阻止发药并显示错误提示
|
|
@@ -3722,19 +3735,33 @@ function validateTracCodgQuantity(realNo, orderNo, receiptNo, times, patientId,
|
|
|
tracCodgCount = tracCodgList.length;
|
|
|
}
|
|
|
|
|
|
- console.log('药品:', drug.drugname, '处方数量:', prescriptionQuantity, '追溯码数量:', tracCodgCount);
|
|
|
+ console.log('药品:', drug.drugname, '处方数量:', prescriptionQuantity, '追溯码数量:', tracCodgCount, '拆零状态:', drug.serial);
|
|
|
+
|
|
|
+ // ================= 新增:根据药品类型区分验证逻辑 =================
|
|
|
+ // 目的:拆零药品不强制上传追溯码,不拆零药品维持原样
|
|
|
+ // 判断逻辑:serial="01"为拆零药品,serial="99"为不拆零药品
|
|
|
|
|
|
- // 检查数量是否匹配
|
|
|
- if (tracCodgCount !== prescriptionQuantity) {
|
|
|
+ let isSplitDrug = (drug.serial === '01'); // 拆零药品
|
|
|
+ let isNonSplitDrug = (drug.serial === '99'); // 不拆零药品
|
|
|
+
|
|
|
+ // 只有不拆零药品才检查追溯码数量是否匹配
|
|
|
+ if (isNonSplitDrug && tracCodgCount !== prescriptionQuantity) {
|
|
|
hasMismatch = true;
|
|
|
let mismatchInfo = {
|
|
|
drugName: drug.drugname,
|
|
|
prescriptionQuantity: prescriptionQuantity,
|
|
|
tracCodgCount: tracCodgCount,
|
|
|
- difference: tracCodgCount - prescriptionQuantity
|
|
|
+ difference: tracCodgCount - prescriptionQuantity,
|
|
|
+ isSplitDrug: isSplitDrug
|
|
|
};
|
|
|
mismatchDetails.push(mismatchInfo);
|
|
|
}
|
|
|
+
|
|
|
+ // 拆零药品不检查追溯码数量,直接跳过
|
|
|
+ if (isSplitDrug) {
|
|
|
+ console.log('拆零药品【' + drug.drugname + '】不强制上传追溯码,跳过数量验证');
|
|
|
+ }
|
|
|
+ // ================= 新增结束 =================
|
|
|
}
|
|
|
|
|
|
// 如果有不匹配的情况,显示确认弹框
|