Kaynağa Gözat

bug-705:协定方两个项目不能重复

张田田 6 gün önce
ebeveyn
işleme
cd359703c5

+ 9 - 0
src/views/business/components/AcupointTable.vue

@@ -892,6 +892,15 @@ export default {
         return;
       }
 
+      // 检查项目是否已存在,不允许重复添加
+      const isDuplicate = this.prescriptions.some(
+        (p) => p.itemId === this.addForm.itemId
+      );
+      if (isDuplicate) {
+        this.$message.warning("该项目已添加,不能重复添加");
+        return;
+      }
+
       // 调用详情接口获取项目完整信息
       let detailData = {};
       try {