Просмотр исходного кода

中药制剂添加药品使用 scope.$index

cc12458 8 месяцев назад
Родитель
Сommit
bf16333885
1 измененных файлов с 4 добавлено и 6 удалено
  1. 4 6
      src/components/MedicineAndChina.vue

+ 4 - 6
src/components/MedicineAndChina.vue

@@ -694,16 +694,15 @@ export default {
     // 搜索展示药品
     // 搜索展示药品
     searchDrug(e, scope) {
     searchDrug(e, scope) {
       this.tableData3[scope.$index].key = e;
       this.tableData3[scope.$index].key = e;
-
       this.page = scope.row.page;
       this.page = scope.row.page;
 
 
-      // debounce(this.getTableDrug(e, 1, scope.$index), 1000)
-      debounce(this.getTableDrug(scope.row.key, 1, scope.row.id - 1), 10000);
-
-      let index = scope.row.id ? scope.row.id - 1 : 0;
+      let index = scope.$index;
       this.index = index;
       this.index = index;
+      this.tableData3[index].id = index + 1;
       this.tableData3[index].key = e;
       this.tableData3[index].key = e;
       this.tableData3[index].search_i = 0;
       this.tableData3[index].search_i = 0;
+      // debounce(this.getTableDrug(e, 1, scope.$index), 1000)
+      debounce(this.getTableDrug(scope.row.key, 1, index), 10000);
     },
     },
     // 药品名称 输入框失去焦点
     // 药品名称 输入框失去焦点
     drugBlur(e, scope) {
     drugBlur(e, scope) {
@@ -839,7 +838,6 @@ export default {
       const oneself = i === scope.row.id - 1;
       const oneself = i === scope.row.id - 1;
       if (i !== -1 && !oneself) {
       if (i !== -1 && !oneself) {
         this.$message.warning("请勿重复添加药品");
         this.$message.warning("请勿重复添加药品");
-        clearTimeout(medicineBlurTimer);
         return;
         return;
       }
       }