删除重复函数

This commit is contained in:
叶锦涛
2025-11-19 16:37:01 +08:00
parent dfe35bb7f0
commit a6561e2ca6

View File

@@ -855,36 +855,7 @@ function handleDelete() {
groupMarkers.value = getGroupMarkers(prescriptionList.value); // 删除行会出现组号混乱的情况,所以这里重新更新标记
}
// 判断处方单是否可删除
function isPrescriptionDeletable(prescriptionIndex) {
// 条件1处方单没有药品
const medicineCount = getPrescriptionMedicineCount(prescriptionIndex);
if (medicineCount > 0) {
return false;
}
// 条件2处方单未收费已签发的处方不能删除
// 检查是否有已签发的药品statusEnum == 2 表示已签发)
const hasChargedItems = prescriptionList.value.some(item => item.statusEnum === 2);
if (hasChargedItems) {
return false;
}
return true;
}
// 删除处方单
function handleDeletePrescriptionClick(prescriptionIndex) {
if (!isPrescriptionDeletable(prescriptionIndex)) {
proxy.$modal.msgWarning('该处方单不可删除');
return;
}
proxy.$modal.confirm('确认删除该处方单吗?').then(() => {
tcmPrescriptionList.value.splice(prescriptionIndex, 1);
proxy.$modal.msgSuccess('删除成功');
}).catch(() => {});
}
function handleNumberClick(item, index) {
prescriptionList.value[index].unitPrice = item.price;