aXin-0810 1 anno fa
parent
commit
1a5a24e084
1 ha cambiato i file con 18 aggiunte e 7 eliminazioni
  1. 18 7
      src/views/supply/reserve/components/reserve_form.vue

+ 18 - 7
src/views/supply/reserve/components/reserve_form.vue

@@ -849,16 +849,27 @@ export default {
 
     // 更改经销商
     async changeDealer(index) {
-      console.log(444, index, this.goodsList, this.goodsList[index].customerNumber)
       if (this.goodsList[index].customerNumber) {
         let obj = this.dealerList.find(o => o.number == this.goodsList[index].customerNumber)
-        this.goodsList[index].customerName = obj.name
-        this.goodsList[index].customerId = obj.id
-        this.goodsList[index].warehouseList = await this.getListStock(obj.id)
+        this.goodsList.splice(index, 1, {
+          ...this.goodsList[index],
+          customerName: obj.name,
+          customerId: obj.id,
+          warehouseList: await this.getListStock(obj.id)
+        })
+        // this.goodsList[index].customerName = obj.name
+        // this.goodsList[index].customerId = obj.id
+        // this.goodsList[index].warehouseList = await this.getListStock(obj.id)
       } else {
-        this.goodsList[index].customerName = ''
-        this.goodsList[index].customerId = ''
-        this.goodsList[index].warehouseList = []
+        this.goodsList.splice(index, 1, {
+          ...this.goodsList[index],
+          customerName: '',
+          customerId: '',
+          warehouseList: []
+        })
+        // this.goodsList[index].customerName = ''
+        // this.goodsList[index].customerId = ''
+        // this.goodsList[index].warehouseList = []
       }
     },