Преглед изворни кода

Merge branch 'master' of https://git.steerinfo.com/DAL-DAZHOU/icore-pass

luobang пре 2 година
родитељ
комит
411a11933e

+ 122 - 17
src/views/statisticalReport/components/salesLogisticsStatistics/saleSteelReports.vue

@@ -1126,7 +1126,7 @@
     <el-dialog :visible.sync="dialogVisible" width="80%">
       <img width="100%" :src="dialogImageUrl" alt="" />
     </el-dialog>
-    <el-dialog :visible.sync="batchCarrierVisible" width="30%" center>
+    <el-dialog :visible.sync="batchCarrierVisible" width="55%" center>
       <div class="batchCarrierClass">
         <el-form :inline="true">
           <span>批量授权承运商</span>
@@ -1162,13 +1162,79 @@
             </el-autocomplete>
           </el-form-item>
           <el-form-item>
-            <el-button @click="batchCapacityVisible = false">取 消</el-button>
+            <el-button @click="batchCarrierVisible = false">取 消</el-button>
             <el-button type="primary" @click="batchEditCapacity"
               >确 定</el-button
             >
           </el-form-item>
         </el-form>
       </div>
+      <div class="steelMapClass22">
+          <span>收货地址:</span>
+          <el-select
+            v-model="steelMap.addressProvince"
+            filterable
+            placeholder="请选择"
+            @change="onchangeProvince"
+            style="width:120px"
+            :disabled="notRoutList.includes('province')"
+          >
+            <el-option
+              v-for="item in provinceList"
+              :key="item.id"
+              :label="item.addressProvince"
+              :value="item.id"
+            ></el-option>
+          </el-select>
+          <el-select
+            v-model="steelMap.addressDistrict"
+            filterable
+            placeholder="请选择"
+            @change="onchangeCity"
+            style="width:120px"
+            :disabled="notRoutList.includes('city')"
+          >
+            <el-option
+              v-for="item in cityList"
+              :key="item.id"
+              :label="item.addressDistrict"
+              :value="item.id"
+            ></el-option>
+          </el-select>
+          <el-select
+            v-model="steelMap.addressTown"
+            filterable
+            placeholder="请选择"
+            @change="onchangeCounty"
+            style="width:120px"
+            :disabled="notRoutList.includes('country')"
+          >
+            <el-option
+              v-for="item in countyList"
+              :key="item.id"
+              :label="item.addressTown"
+              :value="item.id"
+            ></el-option>
+          </el-select>
+          <el-autocomplete
+            class="inline-input"
+            v-model="steelMap.place"
+            :fetch-suggestions="querySearch1"
+            placeholder="请输入具体收货地址"
+            :trigger-on-focus="false"
+            @select="handleSelect1"
+            style="width:250px"
+            :disabled="notRoutList.includes('place')"
+          >
+          </el-autocomplete>
+          <el-button
+            type="success"
+            circle
+            @click="batchUpdateCarAddress"
+            v-if="!notRoutList.includes('addressClick')"
+            >提交</el-button
+          >
+        </div>
     </el-dialog>
     <div class="dialog">
       <el-dialog
@@ -1907,6 +1973,8 @@ export default {
       this.scrollLeft = e.target.scrollLeft
       this.scrollUpdateSelectFlag = 1
     })
+    //基础数据查询
+    this.getAllProvince();
   },
   activated() {
     this.maxHeight =
@@ -1919,7 +1987,7 @@ export default {
       this.capacityId = null
       this.batchCapacityList = []
       console.log(this.$refs.tableRef.selection)
-      //按照saleOrderMaterialId查询物资数量
+      //按照saleOrderMaterialId查询物资数量size,用于确定派车的线路ID
       this.$refs.tableRef.selection.forEach(item1 => {
         item1.size = this.visibleList.filter(item2 => {
           return item1.saleOrderMaterialId == item2.saleOrderMaterialId
@@ -1927,21 +1995,22 @@ export default {
       })
       this.batchCapacityList = this.$refs.tableRef.selection
       console.log(this.batchCapacityList)
-      if (this.batchCapacityList.length > 0) {
-        this.batchCapacityVisible = true
-      } else {
-        this.$message({
-          type: 'warning',
-          message: '请选择要批量更改车牌号的订单',
-          offset: '250',
-          duration: '2500'
-        })
-      }
+      // if (this.batchCapacityList.length > 0) {
+      //   this.batchCapacityVisible = true
+      // } else {
+      //   this.$message({
+      //     type: 'warning',
+      //     message: '请选择要批量更改车牌号的订单',
+      //     offset: '250',
+      //     duration: '2500'
+      //   })
+      // }
     },
     batchCapacitySelect(selection) {
       this.capacityNo = selection.capacityNumber
       this.capacityId = selection.capacityId
     },
+    //批量修改车牌号
     batchEditCapacity() {
       if (this.capacityId && this.capacityNo) {
         if (
@@ -1955,12 +2024,17 @@ export default {
           this.$message.error('请输入正确格式的车牌号!')
           return
         }
+        console.log("this.batchCapacityList",this.batchCapacityList);
         this.batchCapacityList.forEach(row => {
           row.capacityId = this.capacityId
           row.capacityNumber = this.capacityNo
           //是否校验GPS
           row.isCheckGPS = this.isCheckGPS
           row.userId = getCookie('userId')
+          if (row.carrierIds == 0) {
+              this.$message.error('请先授权承运商!')
+              return
+          }
           if (row.capacityIds != 0) {
             this.axios
               .post('/api/v1/ams/updateCapacityNumberInFactory', row)
@@ -1972,10 +2046,6 @@ export default {
                 }
               })
           } else {
-            if (row.carrierIds == 0) {
-              this.$message.error('请先授权承运商!')
-              return
-            }
             row.lineId = this.lineSpelling[row.size]
             let arr = []
             arr.push(row)
@@ -2364,6 +2434,10 @@ export default {
     batchCarrier() {
       if (this.batchCarrierList.length > 0) {
         this.batchCarrierVisible = true
+        this.showBatchCapacity();
+        this.onchangeProvince()
+        this.onchangeCity()
+        this.addressId = this.steelMap.shipperAddressId
       } else {
         this.$message({
           type: 'warning',
@@ -3594,6 +3668,37 @@ export default {
           loading.close()
         })
     },
+    //批量修改收货地址
+    batchUpdateCarAddress() {
+      const loading = this.$loading({
+        lock: true,
+        text: '正在修改收货地址',
+        spinner: 'el-icon-loading',
+        background: 'rgba(0, 0, 0, 0.7)'
+      })
+      this.batchCapacityList.forEach(row => {
+        let map = row
+        map.place = this.steelMap.place
+        map.isCloseEas = Number(1)
+        map.isNewCar = Number(1)
+        map.shipperAddressId = this.addressId
+        this.axios
+        .post('/api/v1/ams/updateCarAddress', map)
+        .then(res => {
+          if (res.data.code == '200') {
+            this.$message.success('修改收货地址成功!')
+          } else {
+            this.$message.error('修改失败,请联系管理员!')
+          }
+        })
+        .catch(() => {
+          this.$message.error('修改失败,请联系管理员!')
+        })
+      })
+      this.getSteelReport()
+      loading.close()
+      this.batchCarrierVisible=false;
+    },
     //将序号确定下来
     // getNodeNum(data) {
     //   for (var i = 0; i < data.length; i++) {