Przeglądaj źródła

2023年6月3日10:41:23

纪新园 2 lat temu
rodzic
commit
9420b1cc92

+ 28 - 11
src/views/businessManagement/salesOrder/detailsPageEdit.vue

@@ -123,7 +123,7 @@
                              :value="item.label"></el-option>
                 </el-select>
                 <el-select v-else-if="item.prop === 'storageId'" v-model="form[item.prop]" placeholder="请选择仓库" clearable
-                           filterable style="width: 100%" size="small"
+                           filterable style="width: 100%" size="small" default-first-option
                            :disabled="detailData.seeDisabled || item.disabled || browse">
                   <el-option v-for="(item, index) in storageIdOption" :key="index" :label="item.cname"
                              :value="item.id"></el-option>
@@ -1463,9 +1463,9 @@ export default {
       this.paymentOption = res.data.data
     })
     storageType().then(res => {
-      console.log('1', res.data.data);
       this.storageIdOption = res.data.data.records
-
+      this.form.storageId =  res.data.data.records[0].id
+      this.form.storageName =  res.data.data.records[0].cname
     })
 
     this.getWorkDicts("order_status").then(res => {
@@ -1536,18 +1536,13 @@ export default {
       }
     },
     handleStorageNameChange(row) {
-      console.log(row)
       this.choiceIndexT = row.$index
-      console.log( this.choiceIndexT)
       let index = row.storageQuantityList.findIndex(function(item) {
         return item.storageId === row.storageId;
       });
-      console.log(index)
+      this.goodsShowData[this.choiceIndexT].storageId =row.storageQuantityList[index].storageId;
       this.goodsShowData[this.choiceIndexT].storageQuantity =row.storageQuantityList[index].surplusRouteQuantity;
       this.goodsShowData[this.choiceIndexT].storageName =row.storageQuantityList[index].storageName;
-      this.goodsShowData[this.choiceIndexT].purchaseAmount =row.storageQuantityList[index].stockPrice;
-      console.log(row.storageQuantityList[index].surplusRouteQuantity)
-      console.log(this.goodsShowData[this.choiceIndexT].storageQuantity)
     },
     getGoodsRow(event, row) {
 
@@ -1564,8 +1559,10 @@ export default {
         tradeType: 'GN',
         warehouseId: this.form.storageId
       }).then(res => {
-        console.log(res);
         row.storageQuantityList = res.data.data
+        row.storageId = res.data.data[0].storageId
+        row.storageName = res.data.data[0].storageName
+        row.storageQuantity = res.data.data[0].surplusRouteQuantity
       })
       row.integralMultiples = event.integralMultiples
       this.quantityChange(row)
@@ -1820,6 +1817,9 @@ export default {
           warehouseId: selectedValue
         }).then(res => {
           this.goodsShowData[row.$index].storageQuantityList = res.data.data;
+          this.goodsShowData[row.$index].storageId = res.data.data[0].storageId;
+          this.goodsShowData[row.$index].storageName = res.data.data[0].storageName;
+          this.goodsShowData[row.$index].storageQuantity = res.data.data[0].surplusRouteQuantity;
         })
       }
       this.$refs.crudContact.rowCell(row, row.$index)
@@ -2256,7 +2256,9 @@ export default {
         warehouseId: this.form.storageId
       }).then(res => {
         row.storageQuantityList = res.data.data
-
+        row.storageId = res.data.data[0].storageId
+        row.storageName = res.data.data[0].storageName
+        row.storageQuantity = res.data.data[0].surplusRouteQuantity
       })
       row.integralMultiples = event[0].integralMultiples
       this.quantityChange(row)
@@ -2288,6 +2290,9 @@ export default {
           warehouseId: this.form.storageId
         }).then(res => {
           this.goodsShowData[this.choiceIndexT].storageQuantityList = res.data.data
+          this.goodsShowData[this.choiceIndexT].storageId = res.data.data[0].storageId
+          this.goodsShowData[this.choiceIndexT].storageName = res.data.data[0].storageName
+          this.goodsShowData[this.choiceIndexT].storageQuantity = res.data.data[0].surplusRouteQuantity
         })
       }
       this.dialogVisible = !this.dialogVisible
@@ -2356,6 +2361,9 @@ export default {
           warehouseId: this.form.storageId
         }).then(res => {
           this.$set(this.goodsListSave[item], 'storageQuantityList', res.data.data)
+          this.$set(this.goodsListSave[item], 'storageId', res.data.data[0].storageId)
+          this.$set(this.goodsListSave[item], 'storageName', res.data.data[0].storageName)
+          this.$set(this.goodsListSave[item], 'storageQuantity', res.data.data[0].surplusRouteQuantity)
           // this.goodsListSave[item].storageQuantity =  res.data.data
           this.$set(this.goodsListSave[item], 'priceCategory', this.goodsListSave[item].goodsTypeName)
           // this.goodsListSave[item].priceCategory = this.goodsListSave[item].goodsTypeName
@@ -2435,6 +2443,9 @@ export default {
           console.log('1', res.data.data);
           this.tableData[item].priceCategory = this.tableData[item].goodsTypeName;
           this.tableData[item].storageQuantityList = res.data.data;
+          this.tableData[item].storageId = res.data.data[0].storageId;
+          this.tableData[item].storageName = res.data.data[0].storageName;
+          this.tableData[item].storageQuantity = res.data.data[0].surplusRouteQuantity;
           delete this.tableData[item].goodsTypeName;
           this.tableData[item].itemId = this.tableData[item].id;
           this.$set(this.tableData[item], 'corpName', this.tableData[item].corpName);
@@ -2649,6 +2660,9 @@ export default {
         }).then(res => {
           console.log(2);
           this.$set(list[item], 'storageQuantityList', res.data.data)
+          this.$set(list[item], 'storageId', res.data.data[0].storageId)
+          this.$set(list[item], 'storageName', res.data.data[0].storageName)
+          this.$set(list[item], 'storageQuantity', res.data.data[0].surplusRouteQuantity)
           if (listLength != 0) {
             this.$set(buyFree[item], 'storageQuantityList', res.data.data)
           }
@@ -3731,6 +3745,9 @@ export default {
         }).then(res => {
           console.log(1);
           item.storageQuantityList = res.data.data
+          item.storageId = res.data.data[0].storageId
+          item.storageName = res.data.data[0].storageName
+          item.storageQuantity = res.data.data[0].surplusRouteQuantity
         })
       })
       this.$message.success('刷新成功')