浏览代码

Merge branch '20201109_pc_vue_new_branch' of http://git.shengws.com/csx/Vue_New into 20201109_pc_vue_new_branch

see999 3 年前
父节点
当前提交
64c9b55f3b
共有 2 个文件被更改,包括 84 次插入58 次删除
  1. 82 56
      src/xt_pages/stock/drugs/drugStockOutOrderAdd.vue
  2. 2 2
      src/xt_pages/stock/stockOutOrderAdd.vue

+ 82 - 56
src/xt_pages/stock/drugs/drugStockOutOrderAdd.vue 查看文件

@@ -119,6 +119,7 @@
119 119
                     :trigger-on-focus="false"
120 120
                     placeholder="请输入药品名称"
121 121
                     @select="handleSelect"
122
+                    @input="changeGoodName(scope.$index)"
122 123
                     style="width:160px;"
123 124
                   >
124 125
                     <i class="el-icon-search el-input__icon" slot="suffix"></i>
@@ -695,6 +696,7 @@ export default {
695 696
             searchArray = response.data.data.list;
696 697
             
697 698
              var list = response.data.data.list
699
+             console.log("list99999999",list)
698 700
              this.drugList = list
699 701
              var manufacturerList = response.data.data.manufacturerList
700 702
              this.manufacturerList = manufacturerList
@@ -711,64 +713,88 @@ export default {
711 713
           }
712 714
         })
713 715
       },
716
+      changeGoodName(val){
717
+        this.currentIndex = val
718
+      },
714 719
       handleSelect(val){
715
-         if(this.recordInfo.recordData.length == 1){
716
-            this.recordInfo.recordData[0].drug_id = val.id
717
-            this.recordInfo.recordData[0].drug_name = val.drug_name
718
-            this.recordInfo.recordData[0].drug_type = val.drug_type
719
-            this.recordInfo.recordData[0].dosage = val.dosage
720
-            this.recordInfo.recordData[0].max_unit = val.max_unit
721
-            this.recordInfo.recordData[0].unval = val.unval
722
-            this.recordInfo.recordData[0].min_unit = val.min_unit
723
-            this.recordInfo.recordData[0].packing_unit = val.packing_unit
724
-            this.recordInfo.recordData[0].number = val.number
725
-            this.recordInfo.recordData[0].last_price = val.last_price
726
-            this.recordInfo.recordData[0].manufacturer = val.manufacturer
727
-         for(let i=0;i<this.recordInfo.recordData.length;i++){       
728
-           this.recordInfo.recordData[i].name = this.recordInfo.recordData[i].dosage + this.recordInfo.recordData[i].max_unit + "*" + this.recordInfo.recordData[i].unval + this.recordInfo.recordData[i].min_unit + "/"+this.recordInfo.recordData[i].packing_unit
729
-           this.totalPrice += this.recordInfo.recordData[i].last_price * this.recordInfo.recordData[i].warehousing_count
730
-           for(let j=0;j<this.drugTypeList.length;j++){
731
-               if(this.recordInfo.recordData[i].drug_type == this.drugTypeList[j].id){
732
-                  this.recordInfo.recordData[i].drug_type = this.drugTypeList[j].name
733
-               } 
734
-           }
735
-         }
736
-         }else{
737
-            var arr = []
738
-            for(let i=0;i<this.recordInfo.recordData.length;i++){ 
739
-              if(this.recordInfo.recordData[i].drug_id> 0){
740
-                 arr.push(this.recordInfo.recordData[i])
741
-              }
742
-            } 
743
-            this.recordInfo.recordData = arr
744
-            const tempObj = {}
745
-            tempObj['drug_name'] = val.drug_name
746
-            tempObj['drug_id'] = val.id
747
-            tempObj['number'] = ''
748
-            tempObj['product_date'] = ''
749
-            tempObj['expiry_date'] = ''
750
-            tempObj['warehousing_count'] = ''
751
-            tempObj['retail_price'] = ''
752
-            tempObj['price'] = ''
753
-            tempObj['remark'] = ''
754
-            tempObj['dealer'] = ''
755
-            tempObj['manufacturer'] = ''
756
-            tempObj['min_unit'] = ''
757
-            tempObj['batch_number'] = ''
758
-            tempObj['drug_type'] = ''
759
-            this.recordInfo.recordData.push(tempObj) 
760
-         }
761
-
762
-        for(let i=0;i<this.recordInfo.recordData.length;i++){       
763
-          this.recordInfo.recordData[i].name = this.recordInfo.recordData[i].dosage + this.recordInfo.recordData[i].max_unit + "*" + this.recordInfo.recordData[i].unval + this.recordInfo.recordData[i].min_unit + "/"+this.recordInfo.recordData[i].packing_unit
764
-          this.totalPrice += this.recordInfo.recordData[i].last_price * this.recordInfo.recordData[i].warehousing_count
765
-          for(let j=0;j<this.drugTypeList.length;j++){
766
-             if(this.recordInfo.recordData[i].drug_type == this.drugTypeList[j].id){
767
-                this.recordInfo.recordData[i].drug_type = this.drugTypeList[j].name
768
-              } 
769
-           }
720
+        for(let i=0;i<this.recordInfo.recordData.length;i++){
721
+          if(this.currentIndex == i){
722
+            this.recordInfo.recordData[i].drug_id = val.id
723
+            this.recordInfo.recordData[i].drug_name = val.drug_name
724
+            this.recordInfo.recordData[i].drug_type = val.drug_type
725
+            this.recordInfo.recordData[i].dose = val.dose
726
+            this.recordInfo.recordData[i].dose_unit = val.dose_unit
727
+            this.recordInfo.recordData[i].max_unit = val.max_unit
728
+            this.recordInfo.recordData[i].min_number = val.min_number
729
+            this.recordInfo.recordData[i].min_unit = val.min_unit
730
+            this.recordInfo.recordData[i].packing_unit = val.packing_unit
731
+            this.recordInfo.recordData[i].number = val.number
732
+            this.recordInfo.recordData[i].last_price = val.last_price
733
+            this.recordInfo.recordData[i].manufacturer = val.manufacturer
734
+            this.recordInfo.recordData[i].name = this.recordInfo.recordData[i].dose + this.recordInfo.recordData[i].dose_unit + "*" + this.recordInfo.recordData[i].min_number + this.recordInfo.recordData[i].min_unit + "/"+this.recordInfo.recordData[i].max_unit
735
+          }
770 736
         }
771
-      },
737
+      }, 
738
+      // handleSelect(val){
739
+      //     console.log("val222222",val)
740
+      //    if(this.recordInfo.recordData.length == 1){
741
+      //       this.recordInfo.recordData[0].drug_id = val.id
742
+      //       this.recordInfo.recordData[0].drug_name = val.drug_name
743
+      //       this.recordInfo.recordData[0].drug_type = val.drug_type
744
+      //       this.recordInfo.recordData[0].dose = val.dose
745
+      //       this.recordInfo.recordData[0].dose_unit = val.dose_unit
746
+      //       this.recordInfo.recordData[0].max_unit = val.max_unit
747
+      //       this.recordInfo.recordData[0].min_number = val.min_number
748
+      //       this.recordInfo.recordData[0].min_unit = val.min_unit
749
+      //       this.recordInfo.recordData[0].packing_unit = val.packing_unit
750
+      //       this.recordInfo.recordData[0].number = val.number
751
+      //       this.recordInfo.recordData[0].last_price = val.last_price
752
+      //       this.recordInfo.recordData[0].manufacturer = val.manufacturer
753
+      //    for(let i=0;i<this.recordInfo.recordData.length;i++){       
754
+      //      this.recordInfo.recordData[i].name = this.recordInfo.recordData[i].dose + this.recordInfo.recordData[i].dose_unit + "*" + this.recordInfo.recordData[i].min_number + this.recordInfo.recordData[i].min_unit + "/"+this.recordInfo.recordData[i].max_unit
755
+      //      this.totalPrice += this.recordInfo.recordData[i].last_price * this.recordInfo.recordData[i].warehousing_count
756
+      //      for(let j=0;j<this.drugTypeList.length;j++){
757
+      //          if(this.recordInfo.recordData[i].drug_type == this.drugTypeList[j].id){
758
+      //             this.recordInfo.recordData[i].drug_type = this.drugTypeList[j].name
759
+      //          } 
760
+      //      }
761
+      //    }
762
+      //    }else{
763
+      //       var arr = []
764
+      //       for(let i=0;i<this.recordInfo.recordData.length;i++){ 
765
+      //         if(this.recordInfo.recordData[i].drug_id> 0){
766
+      //            arr.push(this.recordInfo.recordData[i])
767
+      //         }
768
+      //       } 
769
+      //       this.recordInfo.recordData = arr
770
+      //       const tempObj = {}
771
+      //       tempObj['drug_name'] = val.drug_name
772
+      //       tempObj['drug_id'] = val.id
773
+      //       tempObj['number'] = ''
774
+      //       tempObj['product_date'] = ''
775
+      //       tempObj['expiry_date'] = ''
776
+      //       tempObj['warehousing_count'] = ''
777
+      //       tempObj['retail_price'] = ''
778
+      //       tempObj['price'] = ''
779
+      //       tempObj['remark'] = ''
780
+      //       tempObj['dealer'] = ''
781
+      //       tempObj['manufacturer'] = ''
782
+      //       tempObj['min_unit'] = ''
783
+      //       tempObj['batch_number'] = ''
784
+      //       tempObj['drug_type'] = ''
785
+      //       this.recordInfo.recordData.push(tempObj) 
786
+      //    }
787
+
788
+      //   for(let i=0;i<this.recordInfo.recordData.length;i++){       
789
+      //     this.recordInfo.recordData[i].name = this.recordInfo.recordData[i].dosage + this.recordInfo.recordData[i].max_unit + "*" + this.recordInfo.recordData[i].unval + this.recordInfo.recordData[i].min_unit + "/"+this.recordInfo.recordData[i].packing_unit
790
+      //     this.totalPrice += this.recordInfo.recordData[i].last_price * this.recordInfo.recordData[i].warehousing_count
791
+      //     for(let j=0;j<this.drugTypeList.length;j++){
792
+      //        if(this.recordInfo.recordData[i].drug_type == this.drugTypeList[j].id){
793
+      //           this.recordInfo.recordData[i].drug_type = this.drugTypeList[j].name
794
+      //         } 
795
+      //      }
796
+      //   }
797
+      // },
772 798
       getDictionaryDataConfig(module, filed_name) {
773 799
         return getDictionaryDataConfig(module, filed_name)
774 800
       },

+ 2 - 2
src/xt_pages/stock/stockOutOrderAdd.vue 查看文件

@@ -580,8 +580,8 @@ export default {
580 580
           const params = {
581 581
             stockOut: this.recordInfo.recordData
582 582
           };
583
-          console.log(this.recordInfo.recordData);
584
-         
583
+          console.log("2323223223",this.recordInfo.recordData);
584
+          
585 585
           postWarehouseOut(
586 586
             params,
587 587
             this.warehouse_out_time,