Kaynağa Gözat

提交代码

zyf 2 yıl önce
ebeveyn
işleme
f6dc238880

+ 6 - 4
src/views/inward/components/inwardBillet/addInwardBillet.vue

@@ -292,9 +292,6 @@ export default {
         {
           value: 'Φ14'
         },
-        {
-          value: 'Φ16'
-        },
         {
           value: 'Φ36'
         },
@@ -547,7 +544,12 @@ export default {
       //提交
       this.axios.post('/api/v1/ams/addBilletRequirement', map).then(res => {
         if (res.data.code == '200') {
-          this.$message.success('派发成功!')
+          this.$message({
+            type: 'success',
+            message: '派发成功!',
+            duration: 1000,
+            offset: '250'
+          })
           this.getRequestUrl()
         }
       })

+ 354 - 88
src/views/statisticalReport/components/salesLogisticsStatistics/saleSteelReports.vue

@@ -91,6 +91,9 @@
           <el-button type="primary" @click="operation()"
             ><i class="el-icon-edit"></i>更改</el-button
           >
+          <!-- <el-button type="primary" @click="batchoperation()"
+            ><i class="el-icon-edit"></i>批量更改</el-button
+          > -->
           <el-button
             type="primary"
             @click="checkPoint()"
@@ -99,8 +102,9 @@
           >
         </el-form-item>
         <el-form-item>
-          <el-button type="primary" @click="openReceive()" >
-            <i class="el-icon-document"></i>签收抵达</el-button>
+          <el-button type="primary" @click="openReceive()">
+            <i class="el-icon-document"></i>签收抵达</el-button
+          >
         </el-form-item>
         <el-form-item>
           <span style="margin-left: 1rem;font-size:16px">车数/件数:</span>
@@ -112,7 +116,7 @@
     </div>
     <div class="table">
       <el-table
-        :data="tableData"
+        :data="visibleList"
         :span-method="objectSpanMethod"
         ref="tableRef"
         border
@@ -786,6 +790,124 @@
         </div>
       </el-dialog>
     </div>
+    <!-- <div class="dialog">
+      <el-dialog
+        title="运单详情"
+        :visible.sync="centerDialogVisibleBatch"
+        width="90%"
+        center
+      >
+        <div class="steelMapClass">
+          <div class="steelMapClass2">
+            <div class="steelMapClass22">
+              <span>收货地址:</span>
+              <el-select
+                v-model="batchAddressProvince"
+                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="batchAddressDistrict"
+                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="batchAddressTown"
+                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="batchPlace"
+                :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="batchAddressClick"
+                v-if="!notRoutList.includes('addressClick')"
+                >提交</el-button
+              >
+            </div>
+          </div>
+          <div class="steelMapClass3">
+            <div class="steelMapClass32">
+              <span>收货客户电话:</span>
+              <el-input
+                v-model="steelMap.consigneeTel"
+                style="width:150px"
+                :disabled="notRoutList.includes('consigeeTel')"
+              ></el-input>
+              <el-button
+                type="success"
+                circle
+                @click="updateconsigneeTel"
+                v-if="!notRoutList.includes('consigeeTel')"
+                >提交</el-button
+              >
+            </div>
+            <div class="steelMapClass33">
+              <span>承运商:</span>
+              <el-autocomplete
+                style="width:120px"
+                v-model="steelMap.carrierName"
+                :fetch-suggestions="querySearchCarrier"
+                placeholder="请输入承运商"
+                @select="handleSelectCarrier"
+                :disabled="notRoutList.includes('carrierName')"
+              >
+              </el-autocomplete>
+              <el-button
+                type="success"
+                circle
+                @click="updateTruckCarrierDebounce"
+                v-if="!notRoutList.includes('carrierName')"
+                >提交</el-button
+              >
+            </div>
+          </div>
+        </div>
+        <span slot="footer" class="dialog-footer">
+          <el-button @click="centerDialogVisibleBatch = false">返 回</el-button>
+        </span>
+      </el-dialog>
+    </div> -->
     <div style="height: 100%">
       <vxe-modal
         width="1237"
@@ -811,10 +933,18 @@
         ><currentLocation :carNumber="carNumber"></currentLocation
       ></vxe-modal>
     </div>
-    <el-dialog title="抵达签收" :visible.sync="arrivalReceiving" :before-close="closeUpload">
+    <el-dialog
+      title="抵达签收"
+      :visible.sync="arrivalReceiving"
+      :before-close="closeUpload"
+    >
       <el-form :inline="true" style="margin-left:20%">
         <el-form-item label="车牌号码">
-          <el-input v-model="capacityNumber" disabled style="width:300px"></el-input>
+          <el-input
+            v-model="capacityNumber"
+            disabled
+            style="width:300px"
+          ></el-input>
         </el-form-item>
         <el-form-item label="签收地址">
           <el-input v-model="location" style="width:300px"></el-input>
@@ -828,15 +958,16 @@
             :on-change="fileChange1"
             :on-exceed="exceed"
             accept=".jpg,.jpeg,.png,.gif,.bmp,.pdf,.JPG,.JPEG,.PBG,.GIF,.BMP,.PDF"
-            :auto-upload="false">
+            :auto-upload="false"
+          >
             <i class="el-icon-plus"></i>
           </el-upload>
           <el-dialog :visible.sync="dialogVisible1">
-            <img width="100%" :src="dialogImageUrl" alt="">
+            <img width="100%" :src="dialogImageUrl" alt="" />
           </el-dialog>
         </el-form-item>
         <el-form-item label="签收图片(空货箱、质保书、签收单)">
-           <el-upload
+          <el-upload
             ref="receive"
             list-type="picture-card"
             action="null"
@@ -844,15 +975,22 @@
             :on-change="fileChange2"
             :on-exceed="exceed"
             accept=".jpg,.jpeg,.png,.gif,.bmp,.pdf,.JPG,.JPEG,.PBG,.GIF,.BMP,.PDF"
-            :auto-upload="false">
+            :auto-upload="false"
+          >
             <i class="el-icon-plus"></i>
           </el-upload>
           <el-dialog :visible.sync="dialogVisible2">
-            <img width="100%" :src="dialogImageUrl" alt="">
+            <img width="100%" :src="dialogImageUrl" alt="" />
           </el-dialog>
         </el-form-item>
       </el-form>
-      <el-button type="primary" @click="arrivalAndReceive" :loading="isLoading" style="margin-left:40%">确定</el-button>
+      <el-button
+        type="primary"
+        @click="arrivalAndReceive"
+        :loading="isLoading"
+        style="margin-left:40%"
+        >确定</el-button
+      >
     </el-dialog>
   </div>
 </template>
@@ -869,6 +1007,17 @@ export default {
   },
   data() {
     return {
+      batchAddressProvince: '',
+      batchAddressDistrict: '',
+      batchAddressTown: '',
+      batchPlace: '',
+      centerDialogVisibleBatch: false,
+      reallyList: [],
+      visibleList: [],
+      itemHeight: 30,
+      scrollTop: 0,
+      totalHeight: 0,
+      debounceS: false,
       carNumber: '',
       //弹出框
       centerDialogVisible: false,
@@ -1039,16 +1188,17 @@ export default {
       filterMap: {},
       //权限控制
       notRoutList: [],
-      location:null,
-      orderNumber:null,
-      capacityNumber:null,
-      arrivalReceiving:false,
-      fileListArrival:[],
-      fileListReceive:[],
+      location: null,
+      orderNumber: null,
+      capacityNumber: null,
+      arrivalReceiving: false,
+      fileListArrival: [],
+      fileListReceive: [],
       dialogImageUrl: '',
       dialogVisible1: false,
       dialogVisible2: false,
-      isLoading:false
+      isLoading: false,
+      batchList: []
     }
   },
   created() {
@@ -1088,6 +1238,34 @@ export default {
       },
       deep: true,
       immediate: true
+    },
+    scrollTop: {
+      immediate: true,
+      handler(val) {
+        this.$nextTick(() => {
+          console.log(val)
+          const start = Math.floor(val / this.itemHeight)
+          console.log(start)
+          this.visibleList = []
+          this.visibleList = this.tableData.slice(
+            start,
+            start + Math.floor(this.maxHeight / this.itemHeight) + 1
+          )
+          console.log(this.visibleList)
+          this.getSpanArr(this.visibleList)
+          this.top = start * this.itemHeight
+          this.$nextTick(() => {
+            window.onresize = () => {
+              return (() => {
+                this.maxHeight = window.innerHeight - 150
+              })()
+            }
+          })
+          this.$refs.tableRef.$el.getElementsByClassName(
+            'el-table__body'
+          )[0].style.top = `${start * this.itemHeight}px`
+        })
+      }
     }
   },
   computed: {},
@@ -1099,103 +1277,161 @@ export default {
         })()
       }
     })
+    this.$refs.tableRef.bodyWrapper.addEventListener('scroll', e => {
+      if (this.debounceS) return
+      this.debounceS = true
+      this.scrollTop = e.target.scrollTop
+      setTimeout(() => {
+        this.debounceS = false
+      }, 50)
+    })
   },
   activated() {
     this.maxHeight = window.innerHeight - 150
   },
   computed: {},
   methods: {
+    hanleScroll() {
+      console.log('我滚动了')
+    },
+    // batchAddressClick() {
+    //   const loading = this.$loading({
+    //     lock: true,
+    //     text: '正在修改收货地址',
+    //     spinner: 'el-icon-loading',
+    //     background: 'rgba(0, 0, 0, 0.7)'
+    //   })
+    //   this.batchList.forEach(e => {
+    //     e.addressProvince = this.batchAddressProvince
+    //     e.addressDistrict = this.batchAddressDistrict
+    //     e.place = this.batchPlace
+    //     e.isCloseEas = Number(1)
+    //     e.isNewCar = Number(1)
+    //     e.shipperAddressId = this.addressId
+    //     this.axios
+    //       .post('/api/v1/ams/updateCarAddress', e)
+    //       .then(res => {
+    //         if (res.data.code == '200') {
+    //           this.$message.success('修改收货地址成功!')
+    //           this.getSteelReport()
+    //         } else {
+    //           this.$message.error('修改失败,请联系管理员!')
+    //           this.getSteelReport()
+    //         }
+    //       })
+    //       .catch(() => {
+    //         this.$message.error('修改失败,请联系管理员!')
+    //         this.getSteelReport()
+    //       })
+    //   })
+    // },
+    // batchoperation() {
+    //   if (this.batchList.length > 0) {
+    //     console.log(this.batchList)
+    //     this.getAllProvince()
+    //     this.onchangeProvince()
+    //     this.onchangeCity()
+    //     this.centerDialogVisibleBatch = true
+    //   } else {
+    //     this.$message({
+    //       type: 'info',
+    //       offset: '250',
+    //       message: '请先选择'
+    //     })
+    //   }
+    // },
     openReceive() {
       if (Object.values(this.steelMap).length == 0) {
         this.$message.warning('请选择需要补录的实绩')
         return
       }
-      let row = this.steelMap;
-      if(!row.outGateTime){
+      let row = this.steelMap
+      if (!row.outGateTime) {
         this.$message.warning('该车未出厂,不允许签收')
         return
       }
-      if (row.arrivalAddress != null && row.arrivalAddress!=null) {
+      if (row.arrivalAddress != null && row.arrivalAddress != null) {
         this.$message.warning('该车已有抵达签收实绩,不允许签收')
         return
       }
-      this.location=row.addressPlace;
-      this.orderNumber=row.orderNo;
-      this.capacityNumber=row.capacityNo;
-      this.arrivalReceiving=true;
+      this.location = row.addressPlace
+      this.orderNumber = row.orderNo
+      this.capacityNumber = row.capacityNo
+      this.arrivalReceiving = true
     },
-    arrivalAndReceive(){
-      if(!this.location){
-        this.$message.warning('请填写签收地址');
-        return;
+    arrivalAndReceive() {
+      if (!this.location) {
+        this.$message.warning('请填写签收地址')
+        return
       }
-      if(this.fileListArrival.length < 1){
-        this.$message.warning('请上传抵达图片');
-        return;
+      if (this.fileListArrival.length < 1) {
+        this.$message.warning('请上传抵达图片')
+        return
       }
-      if(this.fileListReceive.length < 3){
-        this.$message.warning('签收图最少三张');
-        return;
+      if (this.fileListReceive.length < 3) {
+        this.$message.warning('签收图最少三张')
+        return
       }
-      this.isLoading=true;
+      this.isLoading = true
       //上传抵达
-      let formData = new window.FormData();
-      formData.append("file",this.fileListArrival[0].raw);
-      formData.append("orderNumber",this.orderNumber);
-      formData.append("resultArrivalAddress",this.location);
-      let options = {  // 设置axios的参数
-         url: '/api/v1/otms/addtmstruckArrivalResult',
-         data: formData,
-         method: 'post',
-         headers: { 
+      let formData = new window.FormData()
+      formData.append('file', this.fileListArrival[0].raw)
+      formData.append('orderNumber', this.orderNumber)
+      formData.append('resultArrivalAddress', this.location)
+      let options = {
+        // 设置axios的参数
+        url: '/api/v1/otms/addtmstruckArrivalResult',
+        data: formData,
+        method: 'post',
+        headers: {
           'Content-Type': 'multipart/form-data'
-         }
+        }
       }
-      this.axios(options).then((res) => {
-        console.log("arrivalRes:",res);
+      this.axios(options).then(res => {
+        console.log('arrivalRes:', res)
         //上传签收
-        let formData = new window.FormData();
-        let request=''
-        this.fileListReceive.forEach((item,index)=>{
-          formData.append("file"+index,item.raw);
+        let formData = new window.FormData()
+        let request = ''
+        this.fileListReceive.forEach((item, index) => {
+          formData.append('file' + index, item.raw)
         })
-        formData.append("orderNumber",this.orderNumber);
-        formData.append("resultArrivalAddress",this.location);
-        formData.append("num",request.length);
-        let options = { 
-         url: '/api/v1/otms/addTmstruckReceiptResult',
-         data: formData,
-         method: 'post',
-         headers: { 
-          'Content-Type': 'multipart/form-data'
-         }
+        formData.append('orderNumber', this.orderNumber)
+        formData.append('resultArrivalAddress', this.location)
+        formData.append('num', request.length)
+        let options = {
+          url: '/api/v1/otms/addTmstruckReceiptResult',
+          data: formData,
+          method: 'post',
+          headers: {
+            'Content-Type': 'multipart/form-data'
+          }
         }
-        this.axios(options).then((res) => {
-          console.log("receiveRes:",res);
-          if(res.data.data==4){
-            this.$message.error("新增抵达失败!");
-            this.isLoading=false;
-          }else{
-            this.$message.success("上传成功!");
-            this.closeUpload();
-            this.$router.go(0);
+        this.axios(options).then(res => {
+          console.log('receiveRes:', res)
+          if (res.data.data == 4) {
+            this.$message.error('新增抵达失败!')
+            this.isLoading = false
+          } else {
+            this.$message.success('上传成功!')
+            this.closeUpload()
+            this.$router.go(0)
           }
-        });
+        })
       })
     },
-    fileChange1(file, fileList){
-      this.fileListArrival=fileList;
+    fileChange1(file, fileList) {
+      this.fileListArrival = fileList
     },
-    fileChange2(file, fileList){
-      this.fileListReceive=fileList;
+    fileChange2(file, fileList) {
+      this.fileListReceive = fileList
     },
-    exceed(){
-      this.$message.warning("超出上传数量!");
+    exceed() {
+      this.$message.warning('超出上传数量!')
     },
-    closeUpload(){
-      this.arrivalReceiving=false;
-      this.$refs.arrival.clearFiles();
-      this.$refs.receive.clearFiles();
+    closeUpload() {
+      this.arrivalReceiving = false
+      this.$refs.arrival.clearFiles()
+      this.$refs.receive.clearFiles()
     },
     //防抖函数--防止用户重复点击
     debounce(func, delay) {
@@ -1210,6 +1446,7 @@ export default {
       }
     },
     // handleSelectionChange(selection) {
+    //   this.batchList = selection
     //   console.log(selection)
     // },
     //筛选
@@ -1418,8 +1655,9 @@ export default {
         column.property == 'arrivalAddress' ||
         column.property == 'receiptAddress'
       ) {
-        return 'color : blue'
+        return 'color : blue', 'height:30px'
       }
+      return 'height:30px'
     },
     rowClick(row, column, event) {
       this.steelMap = {}
@@ -1852,6 +2090,7 @@ export default {
       this.axios
         .post('/api/v1/uc/updateDriverTel', {
           orderId: parseInt(this.steelMap.orderId),
+          saleOrderMaterialId: parseInt(this.steelMap.saleOrderMaterialId),
           driverTel: this.steelMap.capacityTel
         })
         .then(res => {
@@ -2354,10 +2593,13 @@ export default {
         )
         .then(res => {
           this.tableData = res.data.data
-          this.filters1 = res.data.data.consigneeName
-          console.log('客户数据')
-          console.log(res.data.data.consigneeName)
-          this.getSpanArr(res.data.data)
+          this.totalHeight += this.itemHeight
+          this.visibleList = []
+          this.visibleList = this.tableData.slice(
+            0,
+            Math.floor(this.maxHeight / this.itemHeight) + 1
+          )
+          this.getSpanArr(this.visibleList)
           loading.close()
         })
     },
@@ -2367,6 +2609,12 @@ export default {
     },
     //获取钢材统计报表
     getSteelReport() {
+      const loading = this.$loading({
+        lock: true,
+        text: '正在获取数据,请稍候',
+        spinner: 'el-icon-loading',
+        background: 'rgba(0, 0, 0, 0.7)'
+      })
       this.isRowClick = 0
       let startTime = null
       let endTime = null
@@ -2433,7 +2681,17 @@ export default {
         )
         .then(res => {
           this.tableData = res.data.data
-          this.getSpanArr(res.data.data)
+          this.totalHeight += this.itemHeight
+          this.visibleList = []
+          this.visibleList = this.tableData.slice(
+            0,
+            Math.floor(this.maxHeight / this.itemHeight) + 1
+          )
+          this.getSpanArr(this.visibleList)
+          loading.close()
+        })
+        .catch(() => {
+          loading.close()
         })
     }
   }
@@ -2566,3 +2824,11 @@ export default {
   }
 }
 </style>
+<style lang="scss">
+.el-table__body-wrapper {
+  overflow-y: auto;
+  .el-table__body {
+    position: absolute;
+  }
+}
+</style>

+ 102 - 109
src/views/statisticalReport/components/salesLogisticsStatistics/unloadingSteelReports.vue

@@ -54,7 +54,7 @@
           >
         </el-form-item>
         <el-form-item>
-          <el-button type="primary" @click="addSaleOrder"
+          <el-button type="primary" @click="addSaleOrder1"
             >重新生成计划</el-button
           >
         </el-form-item>
@@ -439,7 +439,8 @@ export default {
         'saleOrderReceiveCustomer',
         'salerName',
         'saleOrderNo',
-        'saleArea'
+        'saleArea',
+        'saleOrderId'
       ],
       saleOrderMapList: [
         'orderNo',
@@ -479,18 +480,12 @@ export default {
     }
     this.remarkDateNew = this.getRemarkDate()
     this.remarkDateOld = this.getRemarkDateOld()
+    this.addSaleOrder1 = this.debounce(() => {
+      this.addSaleOrder()
+    }, 3000)
     this.getSteelReport()
   },
-  watch: {
-    tableData: {
-      handler(oldVal, newVal) {
-        this.filterListChange()
-        this.toggleSelection(newVal)
-      },
-      deep: true,
-      immediate: true
-    }
-  },
+  watch: {},
   computed: {},
   mounted() {
     this.$nextTick(() => {
@@ -506,12 +501,18 @@ export default {
   },
   computed: {},
   methods: {
-    toggleSelection() {
-      this.$nextTick(() => {
-        this.$refs.tableRef.toggleAllSelection()
-      })
+    //防抖函数--防止用户重复点击
+    debounce(func, delay) {
+      let timer = null
+      return function(...args) {
+        if (timer !== null) {
+          clearTimeout(timer)
+        }
+        timer = setTimeout(function() {
+          func.apply(this, args)
+        }, delay)
+      }
     },
-    handleSelectionChange() {},
     //记录每一行的合并数
     getSpanArr(data) {
       //每次调用方法初始化
@@ -550,97 +551,86 @@ export default {
       }
     },
     addSaleOrder() {
-      //
-      let remark = '10.20钢材成都组'
-      console.log(remark.split(this.getRemarkDateOld)[0])
-      const loading = this.$loading({
-        lock: true,
-        text: '正在快马加鞭为您生成上传销售订单,请稍候',
-        spinner: 'el-icon-loading',
-        background: 'rgba(0, 0, 0, 0.7)'
-      })
-      let closeEntryList = []
-      this.$refs.tableRef.selection.forEach(e => {
-        let map = {}
-        e.saleRemark = this.remarkDateNew + e.saleRemark.split[1]
-        map.saleMaterialId = e.saleMaterialId
-        map.closeEntryId = e.closeEntryId
-        map.number = e.saleOrderNo
-        closeEntryList.push(map)
-      })
-      console.log(this.$refs.tableRef.selection)
-      return
-      const map1 = this.$refs.tableRef.selection.reduce((result, item) => {
-        result[item.saleOrderNo] = result[item.saleOrderNo] || []
-        result[item.saleOrderNo].push(item)
-        return result
-      }, {})
-      let result = Object.values(map1)
-      //遍历数组
-      let saleOrderListMap = []
-      console.log(result)
-      result.forEach((saleOrderList, index) => {
-        let map = {}
-        let arr = []
-        saleOrderList.forEach(e => {
-          let mapMaterial = {}
-          Object.keys(e).forEach(e1 => {
-            if (this.saleOrderList.includes(e1)) {
-              map[e1] = e[e1]
-            }
-            if (this.saleOrderMapList.includes(e1)) {
-              mapMaterial[e1] = e[e1]
-            }
+      this.$confirm(
+        `确定将所选${this.$refs.tableRef.selection.length}条分录重新上传金蝶?`,
+        '提示',
+        {
+          cancelButtonText: '取消',
+          confirmButtonText: '确定',
+          center: true
+        }
+      )
+        .then(() => {
+          const loading = this.$loading({
+            lock: true,
+            text: '正在快马加鞭为您生成上传销售订单,请稍候',
+            spinner: 'el-icon-loading',
+            background: 'rgba(0, 0, 0, 0.7)'
           })
-          mapMaterial.saleDateOfReceipt = sjTime(this.saleDateOfReceipt)
-          arr.push(mapMaterial)
-        })
-        map.shipperId = 1
-        map.mapList = arr
-        map.isUploadEas = 1
-        saleOrderListMap.push(map)
-      })
-      this.axios
-        .post('/api/v1/ams/addSteelSaleOrderList', saleOrderListMap)
-        .then(res => {
-          if (res.data.code == '200') {
-            loading.close()
-            this.getSteelReport()
-            this.$message.success('新增上传销售订单成功!')
-            this.tableData = []
-          } else {
-            this.$message.error(res.data.data)
-            this.getSteelReport()
-            loading.close()
-            this.tableData = []
-          }
-        })
-        .catch(e => {
-          this.$message.error('生成错误!')
-          loading.close()
-          this.tableData = []
-        })
-      const loadings = this.$loading({
-        lock: true,
-        text: '正在关闭上一个分录,请稍候',
-        spinner: 'el-icon-loading',
-        background: 'rgba(0, 0, 0, 0.7)'
-      })
-      this.axios
-        .post('/api/v1/ams/closingEntries', closeEntryList)
-        .then(res => {
-          if (res.data.code == '200') {
-            loadings.close()
-            this.$message.success('关闭成功')
-          } else {
-            this.$message.error('关闭失败')
-            this.getSteelReport()
-            loadings.close()
-          }
+          let closeEntryList = []
+          this.$refs.tableRef.selection.forEach(e => {
+            let map = {}
+            e.saleRemark = this.remarkDateNew + e.saleRemark.split[1]
+            map.saleMaterialId = e.saleMaterialId
+            map.closeEntryId = e.closeEntryId
+            map.number = e.saleOrderNo
+            closeEntryList.push(map)
+          })
+          const map1 = this.$refs.tableRef.selection.reduce((result, item) => {
+            result[item.saleOrderNo] = result[item.saleOrderNo] || []
+            result[item.saleOrderNo].push(item)
+            return result
+          }, {})
+          let result = Object.values(map1)
+          //遍历数组
+          let saleOrderListMap = []
+          console.log(result)
+          result.forEach((saleOrderList, index) => {
+            let map = {}
+            let arr = []
+            saleOrderList.forEach(e => {
+              let mapMaterial = {}
+              Object.keys(e).forEach(e1 => {
+                if (this.saleOrderList.includes(e1)) {
+                  map[e1] = e[e1]
+                }
+                if (this.saleOrderMapList.includes(e1)) {
+                  mapMaterial[e1] = e[e1]
+                }
+              })
+              mapMaterial.saleDateOfReceipt = sjTime(this.saleDateOfReceipt)
+              arr.push(mapMaterial)
+            })
+            map.shipperId = 1
+            map.mapList = arr
+            map.isUploadEas = 1
+            saleOrderListMap.push(map)
+          })
+          this.axios
+            .post('/api/v1/ams/addUnloadSteelSaleOrderList', saleOrderListMap)
+            .then(res => {
+              if (res.data.code == '200') {
+                this.axios
+                  .post('/api/v1/ams/closingEntries', closeEntryList)
+                  .then(res => {
+                    if (res.data.code == '200') {
+                      this.getSteelReport()
+                      loading.close()
+                      this.$message({
+                        type: 'success',
+                        offset: '250'
+                      })
+                    }
+                  })
+              }
+            })
         })
-        .catch(e => {
-          this.$message.error('关闭错误!')
-          loadings.close()
+        .catch(() => {
+          this.$message({
+            type: 'info',
+            message: '取消操作',
+            offset: '200'
+          })
         })
     },
     getRemarkDate() {
@@ -890,9 +880,9 @@ export default {
         )
         .then(res => {
           this.tableData = res.data.data
-          this.filters1 = res.data.data.consigneeName
-          console.log('客户数据')
-          console.log(res.data.data.consigneeName)
+          this.$nextTick(() => {
+            this.$refs.tableRef.toggleAllSelection()
+          })
           this.getSpanArr(res.data.data)
           loading.close()
         })
@@ -969,6 +959,9 @@ export default {
         )
         .then(res => {
           this.tableData = res.data.data
+          this.$nextTick(() => {
+            this.$refs.tableRef.toggleAllSelection()
+          })
           this.getSpanArr(res.data.data)
         })
     }