删除重复函数
This commit is contained in:
@@ -855,36 +855,7 @@ function handleDelete() {
|
|||||||
groupMarkers.value = getGroupMarkers(prescriptionList.value); // 删除行会出现组号混乱的情况,所以这里重新更新标记
|
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) {
|
function handleNumberClick(item, index) {
|
||||||
prescriptionList.value[index].unitPrice = item.price;
|
prescriptionList.value[index].unitPrice = item.price;
|
||||||
|
|||||||
Reference in New Issue
Block a user