luobang 2 anos atrás
pai
commit
779a67f9d0

+ 1 - 1
config/index.js

@@ -73,7 +73,7 @@ let proxyTable = {
   // 所有数据的请求域名地址
   '/api/v1': {
     target: 'http://172.16.33.166:80',
-    // target: 'http://localhost:8080',
+    //target: 'http://localhost:8080',
     // target: 'http://192.168.1.104:8080',
     ws: true,
     pathRewrite: {

+ 14 - 0
src/views/TMS/components/bmsship/detailsStatement.vue

@@ -423,6 +423,13 @@ export default {
       let arr = this.tableData.filter(e => {
         return e.batchId == row.batchId;
       });
+      let arr1 = this.tableData.filter(e => {
+        return e.batchId == row.batchId && e.unitPriceId;
+      });
+      if(arr1.length != arr.length){
+        this.$message.warning("单价不全,无法开票!");
+        return;
+      }
       let map = {
         list: arr,
         userId: getCookie("userId"),
@@ -448,6 +455,13 @@ export default {
       let arr = this.tableData.filter(e => {
         return e.batchId == row.batchId;
       });
+      let arr1 = this.tableData.filter(e => {
+        return e.batchId == row.batchId && e.unitPriceId;
+      });
+      if(arr1.length != arr.length){
+        this.$message.warning("单价不全,无法开票!");
+        return;
+      }
       let map = {
         list: arr,
         userId: getCookie("userId"),

+ 2 - 1
src/views/appoint/components/saleContract/addSaleOrderSteelSendCarrier.vue

@@ -475,7 +475,8 @@ export default {
     //校验是否为电话号码
     checkIsTelephone(index) {
       //电话号码校验
-      var reg = /^[1][345789]\d{9}$/;
+      console.log("电话号码"+this.selectionList[index].driverTel);
+      var reg = /^[1][3456789]\d{9}$/;
       if (!reg.test(this.selectionList[index].driverTel)) {
         this.canSend = -1;
         this.$message.warning("电话号码格式不正确,请输入正确的电话号码!");

+ 100 - 2
src/views/inward/components/inwardFactory/countResult.vue

@@ -17,7 +17,7 @@
         <i class="el-icon-search"></i>查询
       </el-button>
       <!-- excel导出 -->
-      <el-button type="primary" @click="exportData()">
+      <el-button type="primary" @click="exportAllExcel()">
         <i class="el-icon-download"></i>导出(Excel)
       </el-button>
     </div>
@@ -94,7 +94,9 @@ export default {
       direction: "rtl",
       orderId: 0,
       stepList: [],
-      tableTitle: "计次统计"
+      tableTitle: "计次统计",
+      exportAllList:[],
+      noSettleDetailsColumn:[]
     };
   },
   created() {
@@ -111,6 +113,102 @@ export default {
     }
   },
   methods: {
+    exportAllExcel() {
+      this.tableTitle = '计次统计'
+      let startTime = null;
+      let endTime = null;
+      if (this.startTime) {
+        startTime = sjTime(this.startTime);
+      }
+      if (this.endTime) {
+        endTime = sjTime(this.endTime);
+      }
+      if (startTime && endTime) {
+        if (startTime < endTime) {
+          console.log(startTime);
+          console.log(endTime);
+          if (
+            getCookie("orgCode") == "dagangadmin" ||
+            getCookie("orgCode") == "zidonghuabu" ||
+            getCookie("orgCode") == "wuliuchuyunzhongxin"
+          ) {
+            this.axios
+              .post(
+                "/api/v1/tms/getAllTimeTaskResult?apiId=458&orderType=26&startTime=" +
+                startTime +
+                "&endTime=" +
+                endTime +
+                "&i=" +
+                new Date()
+              )
+              .then(res => {
+                console.log(res.data.data)
+                console.log(res.data.data)
+                this.exportAllList = res.data.data.list
+                this.noSettleDetailsColumn=res.data.data.columnData
+                this.exportAllReportToExcel(
+                  this.tableTitle,
+                  this.exportAllList,
+                  this.noSettleDetailsColumn
+                )
+              })
+          } else {
+            this.axios
+              .post(
+                "/api/v1/tms/getAllTimeTaskResult?apiId=458&orderType=26&userId=" +
+                getCookie("orgCode") +
+                "&startTime=" +
+                startTime +
+                "&endTime=" +
+                endTime +
+                "&i=" +
+                new Date()
+              )
+              .then(res => {
+                console.log(res.data.data)
+                console.log(res.data.data)
+                this.exportAllList = res.data.data.list
+                this.noSettleDetailsColumn=res.data.data.columnData
+                this.exportAllReportToExcel(
+                  this.tableTitle,
+                  this.exportAllList,
+                  this.noSettleDetailsColumn
+                )
+              })
+          }
+        } else {
+          this.startTime = null;
+          this.endTime = null;
+          this.$message.warning("开始时间要比结束时间早");
+        }
+      } else {
+      }
+
+    },
+    //导出excel
+    exportAllReportToExcel(tableTitle, dataArr, columnData) {
+      var title = tableTitle
+      let tHeader = []
+      let filterVal = []
+      columnData.forEach(e1 => {
+        if (tHeader.indexOf(e1.label) === -1) {
+          tHeader.push(e1.label)
+        }
+        if (filterVal.indexOf(e1.prop) === -1) {
+          filterVal.push(e1.prop)
+        }
+      })
+      //导出为excel
+      this.downloadLoading = true
+      require.ensure([], () => {
+        const {
+          export_json_to_excel
+        } = require('@/assets/excel/Export2Excel.js') //这里必须使用绝对路径,使用@/+存放export2Excel的路径
+        // let list = this.$refs.excelDom.dataTabel;
+        let data = dataArr.map(v => filterVal.map(j => v[j])) //3.formatJson格式转换
+        export_json_to_excel(tHeader, data, title) // (title)导出的表格名称
+      })
+    },
     // -------查看物资详情(已拒绝)
     detailclick1(row) {
       // 记录重复点击次数

+ 66 - 37
src/views/inward/components/inwardFactory/timeTaskResult.vue

@@ -138,47 +138,76 @@ export default {
   methods: {
     //导出excel的前置动作
     exportAllExcel() {
-      let startTime = null
-      let endTime = null
-      let orgCode = null
-      let carrierSsoId = null
-      if (this.startTime && this.endTime) {
-        startTime = sjTime(this.startTime)
-        endTime = sjTime(this.endTime)
+      this.tableTitle = '计时统计'
+      //
+      let startTime = null;
+      let endTime = null;
+      if (this.startTime) {
+        startTime = sjTime(this.startTime);
       }
-      if (getCookie('orgCode') == 'chengyunshang') {
-        carrierSsoId = getCookie('userId')
+      if (this.endTime) {
+        endTime = sjTime(this.endTime);
       }
-      if (
-        getCookie('orgCode') == 'dagangadmin' ||
-        getCookie('orgCode') == 'zidonghuabu' ||
-        getCookie('orgCode') == 'wuliuchuyunzhongxin'
-      ) {
-        orgCode = null
+      if (startTime && endTime) {
+        if (startTime < endTime) {
+          console.log(startTime);
+          console.log(endTime);
+          if (
+            getCookie("orgCode") == "dagangadmin" ||
+            getCookie("orgCode") == "zidonghuabu" ||
+            getCookie("orgCode") == "wuliuchuyunzhongxin"
+          ) {
+            this.axios
+              .post(
+                "/api/v1/tms/getAllTimeTaskResult?apiId=458&orderType=21&startTime=" +
+                startTime +
+                "&endTime=" +
+                endTime +
+                "&i=" +
+                new Date()
+              )
+              .then(res => {
+                console.log("进入了打印界面")
+                console.log(res.data.data)
+                this.exportAllList = res.data.data.list
+                this.noSettleDetailsColumn=res.data.data.columnData
+                this.exportAllReportToExcel(
+                  this.tableTitle,
+                  this.exportAllList,
+                  this.noSettleDetailsColumn
+                )
+              })
+          } else {
+            this.axios
+              .post(
+                "/api/v1/tms/getAllTimeTaskResult?apiId=458&orderType=21&userId=" +
+                getCookie("orgCode") +
+                "&startTime=" +
+                startTime +
+                "&endTime=" +
+                endTime +
+                "&i=" +
+                new Date()
+              )
+              .then(res => {
+                console.log("进入了打印界面")
+                console.log(res.data.data)
+                this.exportAllList = res.data.data.list
+                this.noSettleDetailsColumn = res.data.data.columnData
+                this.exportAllReportToExcel(
+                  this.tableTitle,
+                  this.exportAllList,
+                  this.noSettleDetailsColumn
+                )
+              })
+          }
+        } else {
+          this.startTime = null;
+          this.endTime = null;
+          this.$message.warning("开始时间要比结束时间早");
+        }
       } else {
-        orgCode = getCookie('orgCode')
       }
-      this.tableTitle = '计时统计'
-      this.axios
-        .post(
-          "/api/v1/tms/getAllTimeTaskResult?apiId=458&orderType=21&startTime=" +
-          startTime +
-          "&endTime=" +
-          endTime +
-          "&i=" +
-          new Date()
-        )
-        .then(res => {
-          console.log("进入了打印界面")
-          console.log(res.data.data)
-          this.exportAllList = res.data.data.list
-          this.noSettleDetailsColumn=res.data.data.columnData
-          this.exportAllReportToExcel(
-            this.tableTitle,
-            this.exportAllList,
-            this.noSettleDetailsColumn
-          )
-        })
       },
     //导出excel
     exportAllReportToExcel(tableTitle, dataArr, columnData) {

+ 163 - 57
src/views/inward/components/inwardSettlement/countDetailOrder.vue

@@ -97,69 +97,175 @@ export default {
   },
   methods:{
     exportAllExcel() {
-      let startTime = null
-      let endTime = null
-      let orgCode = null
-      let carrierSsoId = null
-      if (this.startTime && this.endTime) {
-        startTime = sjTime(this.startTime)
-        endTime = sjTime(this.endTime)
-      }
-      if (getCookie('orgCode') == 'chengyunshang') {
-        carrierSsoId = getCookie('userId')
+      let startTime = null;
+      let endTime = null;
+      if (this.startTime) {
+        startTime = sjTime(this.startTime);
       }
-      if (
-        getCookie('orgCode') == 'dagangadmin' ||
-        getCookie('orgCode') == 'zidonghuabu' ||
-        getCookie('orgCode') == 'wuliuchuyunzhongxin'
-      ) {
-        orgCode = null
-      } else {
-        orgCode = getCookie('orgCode')
+      if (this.endTime) {
+        endTime = sjTime(this.endTime);
       }
       if (this.activeName == 'first') {
         this.tableTitle = '未结算计费详单'
-        this.axios
-          .post(
-            "/api/v1/bms/getInwardWeightDetailsOrder?apiId=515&orderType=26&detailStatus=0" +
-            "&startTime=" +
-            startTime +
-            "&endTime=" +
-            endTime +
-            "&i" +
-            new Date()
-          )
-          .then(res => {
-            console.log(res.data.data)
-            this.exportAllList = res.data.data.list
-            this.noSettleDetailsColumn=res.data.data.columnData
-            this.exportAllReportToExcel(
-              this.tableTitle,
-              this.exportAllList,
-              this.noSettleDetailsColumn
-            )
-          })
+        if (startTime && endTime) {
+          if (startTime < endTime) {
+            if (
+              getCookie("orgCode") == "dagangadmin" ||
+              getCookie("orgCode") == "zidonghuabu" ||
+              getCookie("orgCode") == "wuliuchuyunzhongxin"
+            ) {
+              this.axios
+                .post(
+                  "/api/v1/bms/getInwardWeightDetailsOrder?apiId=515&orderType=26&detailStatus=0" +
+                  "&startTime=" +
+                  startTime +
+                  "&endTime=" +
+                  endTime +
+                  "&i" +
+                  new Date()
+                )
+                .then(res => {
+                  console.log(res.data.data)
+                  this.exportAllList = res.data.data.list
+                  this.noSettleDetailsColumn=res.data.data.columnData
+                  this.exportAllReportToExcel(
+                    this.tableTitle,
+                    this.exportAllList,
+                    this.noSettleDetailsColumn
+                  )
+                })
+            } else if (getCookie("orgCode") == "chengyunshang") {
+              this.axios
+                .post(
+                  "/api/v1/bms/getInwardWeightDetailsOrder?apiId=515&orderType=26&detailStatus=0&carrierSsoId=" +
+                  getCookie("userId") +
+                  "&startTime=" +
+                  startTime +
+                  "&endTime=" +
+                  endTime +
+                  "&i" +
+                  new Date()
+                )
+                .then(res => {
+                  console.log(res.data.data)
+                  this.exportAllList = res.data.data.list
+                  this.noSettleDetailsColumn=res.data.data.columnData
+                  this.exportAllReportToExcel(
+                    this.tableTitle,
+                    this.exportAllList,
+                    this.noSettleDetailsColumn
+                  )
+                })
+            } else {
+              this.axios
+                .post(
+                  "/api/v1/bms/getInwardWeightDetailsOrder?apiId=515&orderType=26&detailStatus=0&userId=" +
+                  getCookie("orgCode") +
+                  "&startTime=" +
+                  startTime +
+                  "&endTime=" +
+                  endTime +
+                  "&i" +
+                  new Date()
+                )
+                .then(res => {
+                  console.log(res.data.data)
+                  this.exportAllList = res.data.data.list
+                  this.noSettleDetailsColumn=res.data.data.columnData
+                  this.exportAllReportToExcel(
+                    this.tableTitle,
+                    this.exportAllList,
+                    this.noSettleDetailsColumn
+                  )
+                })
+            }
+          } else {
+            this.startTime = null;
+            this.endTime = null;
+            this.$message.warning("开始时间要比结束时间早");
+          }
+        }
+
       } else if (this.activeName == 'second') {
         this.tableTitle = '已结算计费详单'
-        this.axios
-          .post(
-            "/api/v1/bms/getInwardWeightDetailsOrder?apiId=515&orderType=26&detailStatus=0" +
-            "&startTime=" +
-            startTime +
-            "&endTime=" +
-            endTime +
-            "&i" +
-            new Date()
-          )
-          .then(res => {
-            this.exportAllList = res.data.data.list
-            this.noSettleDetailsColumn=res.data.data.columnData
-            this.exportAllReportToExcel(
-              this.tableTitle,
-              this.exportAllList,
-              this.settleDetailsColumn
-            )
-          })
+        if (startTime && endTime) {
+          if (startTime < endTime) {
+            if (
+              getCookie("orgCode") == "dagangadmin" ||
+              getCookie("orgCode") == "zidonghuabu" ||
+              getCookie("orgCode") == "wuliuchuyunzhongxin"
+            ) {
+              this.axios
+                .post(
+                  "/api/v1/bms/getInwardWeightDetailsOrder?apiId=515&orderType=26&detailStatus=1" +
+                  "&startTime=" +
+                  startTime +
+                  "&endTime=" +
+                  endTime +
+                  "&i" +
+                  new Date()
+                )
+                .then(res => {
+                  console.log(res.data.data)
+                  this.exportAllList = res.data.data.list
+                  this.noSettleDetailsColumn=res.data.data.columnData
+                  this.exportAllReportToExcel(
+                    this.tableTitle,
+                    this.exportAllList,
+                    this.noSettleDetailsColumn
+                  )
+                })
+            } else if (getCookie("orgCode") == "chengyunshang") {
+              this.axios
+                .post(
+                  "/api/v1/bms/getInwardWeightDetailsOrder?apiId=515&orderType=26&detailStatus=1&carrierSsoId=" +
+                  getCookie("userId") +
+                  "&startTime=" +
+                  startTime +
+                  "&endTime=" +
+                  endTime +
+                  "&i" +
+                  new Date()
+                )
+                .then(res => {
+                  console.log(res.data.data)
+                  this.exportAllList = res.data.data.list
+                  this.noSettleDetailsColumn=res.data.data.columnData
+                  this.exportAllReportToExcel(
+                    this.tableTitle,
+                    this.exportAllList,
+                    this.noSettleDetailsColumn
+                  )
+                })
+            } else {
+              this.axios
+                .post(
+                  "/api/v1/bms/getInwardWeightDetailsOrder?apiId=515&orderType=26&detailStatus=1&userId=" +
+                  getCookie("orgCode") +
+                  "&startTime=" +
+                  startTime +
+                  "&endTime=" +
+                  endTime +
+                  "&i" +
+                  new Date()
+                )
+                .then(res => {
+                  console.log(res.data.data)
+                  this.exportAllList = res.data.data.list
+                  this.noSettleDetailsColumn=res.data.data.columnData
+                  this.exportAllReportToExcel(
+                    this.tableTitle,
+                    this.exportAllList,
+                    this.noSettleDetailsColumn
+                  )
+                })
+            }
+          } else {
+            this.startTime = null;
+            this.endTime = null;
+            this.$message.warning("开始时间要比结束时间早");
+          }
+        }
       }
     },
     //导出excel

+ 198 - 1
src/views/inward/components/inwardSettlement/timeDetailsWeight.vue

@@ -15,7 +15,7 @@
       <el-button type="primary" class="btn" @click="onclick">
         <i class="el-icon-search"></i>查询
       </el-button>
-      <el-button type="primary" @click="exportData()"
+      <el-button type="primary" @click="exportAllExcel()"
         ><i class="el-icon-download"></i>导出(Excel)</el-button
       >
       <span style="margin-left: 1rem;">合计时间:</span>
@@ -105,6 +105,203 @@ export default {
     this.options2GetRequestUrl();
   },
   methods: {
+    exportAllExcel() {
+      let startTime = null;
+      let endTime = null;
+      if (this.startTime) {
+        startTime = sjTime(this.startTime);
+      }
+      if (this.endTime) {
+        endTime = sjTime(this.endTime);
+      }
+      if (this.activeName == 'first') {
+        this.tableTitle = '未结算计费详单'
+        if (startTime && endTime) {
+          if (startTime < endTime) {
+            if (
+              getCookie("orgCode") == "dagangadmin" ||
+              getCookie("orgCode") == "zidonghuabu" ||
+              getCookie("orgCode") == "wuliuchuyunzhongxin"
+            ) {
+              this.axios
+                .post(
+                  "/api/v1/bms/getInwardWeightDetailsOrder?apiId=465&orderType=21&detailStatus=0" +
+                  "&startTime=" +
+                  startTime +
+                  "&endTime=" +
+                  endTime +
+                  "&i" +
+                  new Date()
+                )
+                .then(res => {
+                  console.log(res.data.data)
+                  this.exportAllList = res.data.data.list
+                  this.noSettleDetailsColumn=res.data.data.columnData
+                  this.exportAllReportToExcel(
+                    this.tableTitle,
+                    this.exportAllList,
+                    this.noSettleDetailsColumn
+                  )
+                })
+            }else if (getCookie("orgCode") == "chengyunshang"){
+              this.axios
+                .post(
+                  "/api/v1/bms/getInwardWeightDetailsOrder?apiId=465&orderType=21&detailStatus=0&carrierSsoId=" +
+                  getCookie("userId") +
+                  "&startTime=" +
+                  startTime +
+                  "&endTime=" +
+                  endTime +
+                  "&i" +
+                  new Date()
+                )
+                .then(res => {
+                  console.log(res.data.data)
+                  this.exportAllList = res.data.data.list
+                  this.noSettleDetailsColumn=res.data.data.columnData
+                  this.exportAllReportToExcel(
+                    this.tableTitle,
+                    this.exportAllList,
+                    this.noSettleDetailsColumn
+                  )
+                })
+            }else {
+              this.axios
+                .post(
+                  "/api/v1/bms/getInwardWeightDetailsOrder?apiId=465&orderType=21&detailStatus=0&userId=" +
+                  getCookie("orgCode") +
+                  "&startTime=" +
+                  startTime +
+                  "&endTime=" +
+                  endTime +
+                  "&i" +
+                  new Date()
+                )
+                .then(res => {
+                  console.log(res.data.data)
+                  this.exportAllList = res.data.data.list
+                  this.noSettleDetailsColumn=res.data.data.columnData
+                  this.exportAllReportToExcel(
+                    this.tableTitle,
+                    this.exportAllList,
+                    this.noSettleDetailsColumn
+                  )
+                })
+            }
+          }else {
+            this.startTime = null;
+            this.endTime = null;
+            this.$message.warning("开始时间要比结束时间早");
+          }
+        } else {
+        }
+      } else if (this.activeName == 'second') {
+        this.tableTitle = '已结算计费详单'
+        if (startTime && endTime) {
+          if (startTime < endTime) {
+            if (
+              getCookie("orgCode") == "dagangadmin" ||
+              getCookie("orgCode") == "zidonghuabu" ||
+              getCookie("orgCode") == "wuliuchuyunzhongxin"
+            ) {
+              this.axios
+                .post(
+                  "/api/v1/bms/getInwardWeightDetailsOrder?apiId=465&orderType=21&detailStatus=1" +
+                  "&startTime=" +
+                  startTime +
+                  "&endTime=" +
+                  endTime +
+                  "&i" +
+                  new Date()
+                )
+                .then(res => {
+                  console.log(res.data.data)
+                  this.exportAllList = res.data.data.list
+                  this.noSettleDetailsColumn=res.data.data.columnData
+                  this.exportAllReportToExcel(
+                    this.tableTitle,
+                    this.exportAllList,
+                    this.noSettleDetailsColumn
+                  )
+                })
+            }else if (getCookie("orgCode") == "chengyunshang"){
+              this.axios
+                .post(
+                  "/api/v1/bms/getInwardWeightDetailsOrder?apiId=465&orderType=21&detailStatus=1&carrierSsoId=" +
+                  getCookie("userId") +
+                  "&startTime=" +
+                  startTime +
+                  "&endTime=" +
+                  endTime +
+                  "&i" +
+                  new Date()
+                )
+                .then(res => {
+                  console.log(res.data.data)
+                  this.exportAllList = res.data.data.list
+                  this.noSettleDetailsColumn=res.data.data.columnData
+                  this.exportAllReportToExcel(
+                    this.tableTitle,
+                    this.exportAllList,
+                    this.noSettleDetailsColumn
+                  )
+                })
+            }else {
+              this.axios
+                .post(
+                  "/api/v1/bms/getInwardWeightDetailsOrder?apiId=465&orderType=21&detailStatus=1&userId=" +
+                  getCookie("orgCode") +
+                  "&startTime=" +
+                  startTime +
+                  "&endTime=" +
+                  endTime +
+                  "&i" +
+                  new Date()
+                )
+                .then(res => {
+                  console.log(res.data.data)
+                  this.exportAllList = res.data.data.list
+                  this.noSettleDetailsColumn=res.data.data.columnData
+                  this.exportAllReportToExcel(
+                    this.tableTitle,
+                    this.exportAllList,
+                    this.noSettleDetailsColumn
+                  )
+                })
+            }
+          }else {
+            this.startTime = null;
+            this.endTime = null;
+            this.$message.warning("开始时间要比结束时间早");
+          }
+        } else {
+        }
+      }
+    },
+    //导出excel
+    exportAllReportToExcel(tableTitle, dataArr, columnData) {
+      var title = tableTitle
+      let tHeader = []
+      let filterVal = []
+      columnData.forEach(e1 => {
+        if (tHeader.indexOf(e1.label) === -1) {
+          tHeader.push(e1.label)
+        }
+        if (filterVal.indexOf(e1.prop) === -1) {
+          filterVal.push(e1.prop)
+        }
+      })
+      //导出为excel
+      this.downloadLoading = true
+      require.ensure([], () => {
+        const {
+          export_json_to_excel
+        } = require('@/assets/excel/Export2Excel.js') //这里必须使用绝对路径,使用@/+存放export2Excel的路径
+        // let list = this.$refs.excelDom.dataTabel;
+        let data = dataArr.map(v => filterVal.map(j => v[j])) //3.formatJson格式转换
+        export_json_to_excel(tHeader, data, title) // (title)导出的表格名称
+      })
+    },
     //未结算数据
     options1GetRequestUrl() {
       if (getCookie("orgCode") == "chengyunshang") {

+ 133 - 4
src/views/statisticalReport/components/Ship_dynamic_table.vue

@@ -157,7 +157,8 @@ export default {
       runStockString:null,
       stockStringArr: [],
       downStockStringArr: [],
-      runStockStringArr:[]
+      runStockStringArr:[],
+      loadTable:[]
     };
   },
   created() {},
@@ -166,6 +167,7 @@ export default {
     this.getStockString();
     this.getDownStockString();
     this.getRunStockList();
+    this.searchLoadData();
     // console.log(this.$refs.excelDom);
   },
   methods: {
@@ -193,9 +195,14 @@ export default {
         let table_book = XLSX.utils.table_to_book(tables);
         console.log("table_book:",table_book);
         console.log("sheet:",table_book.Sheets.Sheet1);
+        //限制单元格样式范围
+        let rangeList=['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q',,'R','S','T','U','V']
+        //得到自定义过滤数组
+        let filterList=this.exportFilter(table_book.Sheets.Sheet1);
+        console.log("filterList:",filterList);
         //这里遍历单元格给单元格对象设置属性,s为控制样式的属性
         Object.keys(table_book.Sheets.Sheet1).forEach((key) => {
-          if (key.indexOf('!') < 0) {
+          if (key.indexOf('!') < 0 && rangeList.indexOf(this.getCol(key)) >= 0 && filterList.indexOf(key)< 0) {
             table_book.Sheets.Sheet1[key].s = {
               font:{
                 name:"宋体",
@@ -213,8 +220,37 @@ export default {
                   right: { style: 'thin' }
               }
             }
+            //库存三列特殊对待
+            if(table_book.Sheets.Sheet1[key].t=='s' && table_book.Sheets.Sheet1[key].v && (table_book.Sheets.Sheet1[key].v.includes('下游港口库存') || table_book.Sheets.Sheet1[key].v.includes('万港库存') || table_book.Sheets.Sheet1[key].v.includes('在途货物'))){
+              
+              table_book.Sheets.Sheet1[key].s = {
+              font:{
+                name:"宋体",
+                sz:10
+              },
+              alignment: {
+                vertical: 'center',
+                wrapText: true,
+              },
+              border: { 
+                  top: { style: 'thin' },
+                  bottom: { style: 'thin' },
+                  left: { style: 'thin' },
+                  right: { style: 'thin' }
+              }
+            }
+            }
           }
        })
+       //表头字体重新设置
+      table_book.Sheets.Sheet1['A1'].s.font={
+                name:"宋体",
+                sz:16,
+                bold:true
+      }
+      //画一个简报
+       this.drawExcel(table_book.Sheets.Sheet1);
+       //处理合并行样式
        this.addRangeBorder(table_book.Sheets.Sheet1['!merges'],table_book.Sheets.Sheet1);
        console.log("sheet:",table_book.Sheets.Sheet1);
         //导出
@@ -232,10 +268,82 @@ export default {
         }
         return table_write;
     },
+    drawExcel(sheet){
+      //画一个进口矿水联运情况简报
+      let style={
+                font:{
+                name:"宋体",
+                sz:10
+                },
+                alignment: {//对齐方式
+                  horizontal: 'center',//水平居中
+                  vertical: 'center',//竖直居中
+                  wrapText: true,//自动换行
+                },
+                border: { // 设置边框
+                    top: { style: 'thin' },
+                    bottom: { style: 'thin' },
+                    left: { style: 'thin' },
+                    right: { style: 'thin' }
+                }
+              };
+      Object.keys(sheet).forEach((key) => {
+          if (key.indexOf('!') < 0 && sheet[key].v=='万州港发货信息') {
+             let row = this.getRow(key);
+             console.log("万州港发货信息:",row);
+            //第一行表头
+            sheet['I'+row]={
+              t:'s',
+              v:'进口矿水联运情况简报',
+              s:style
+            };
+            for(let i=row+1; i<this.loadTable.length+row+3;i++){
+                sheet['I'+i]={
+                  t:'s',
+                  v:'',
+                  s:style
+                };
+            }
+            //表格合并
+            for(let i=row-1; i<this.loadTable.length+row+2;i++){
+                sheet['!merges'].push({
+                s:{
+                  r:i,
+                  c:8,
+                },
+                e:{
+                  r:i,
+                  c:15,
+                }
+              });
+            }
+           return;
+          }
+       });
+    },
+    exportFilter(sheet){
+      //导出过滤方法
+      let keys=[];
+      Object.keys(sheet).forEach((key) => {
+          if (key.indexOf('!') < 0 && sheet[key].v=='万州港发货信息') {
+             let row = this.getRow(key);
+             console.log("万州港发货信息:",row);
+             for(let i=row; i<this.loadTable.length+row+3;i++){
+                keys.push('F'+i);
+             }
+          }else if(key.indexOf('!') < 0 && sheet[key].v=='控制线等闸船舶动态'){
+            let row = this.getRow(key);
+             console.log("控制线等闸船舶动态:",row);
+             for(let i=row;i<row+2;i++){
+                keys.push('Q'+i);
+             }
+          }
+       })
+       return keys;
+    },
     addRangeBorder (range, ws) {
-      let cols = ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"];
+      let cols = ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V"];
       range.forEach(item => {
-        console.log(item)
         let style = {
           s: {
             border: {
@@ -257,6 +365,13 @@ export default {
       })
       return ws;
     },
+    getRow(key){
+      return parseInt(key.replace(/[^0-9]/ig,""));
+    },
+    getCol(key){
+      let row=key.replace(/[^0-9]/ig,"");
+      return key.replace(row,"");
+    },
     appendOne(Sheet,row){
       //从后面新增1行,并行合并
         let seArr=Sheet['!fullref'].split(":");
@@ -481,6 +596,20 @@ export default {
           }
         });
    },
+   //查询装车数据
+   searchLoadData() {
+      let map = {}
+      this.axios.post('/api/v1/tms/getLoadData', map).then(res => {
+        if (res.data.code == '200') {
+          this.loadTable = res.data.data;
+        } else {
+          this.$message({
+            type: 'error',
+            message: res.data.data
+          })
+        }
+      })
+    },
   }
 };
 </script>

+ 6 - 12
src/views/statisticalReport/components/salesLogisticsStatistics/saleSteelReports.vue

@@ -1267,18 +1267,12 @@ export default {
   computed: {},
   mounted() {
     let that = this
-    window.addEventListener('resize', function() {
-      let timer = null
-      if (timer) clearTimeout(timer)
-      timer = setTimeout(function() {
-        let tableOffsetTop = that.$refs.tableRef.$el.offsetTop
-        console.log(
-          that.$refs.tableRef.$el.offsetTop,
-          'that.$refs.tableRef.$el'
-        )
-        that.maxHeight = window.innerHeight - tableOffsetTop - 20
-        console.log(that.maxHeight, 'maxHeight')
-      }, 5000)
+    this.$nextTick(() => {
+      window.onresize = () => {
+        return (() => {
+          this.maxHeight = window.innerHeight - 150
+        })()
+      }
     })
     this.$refs.tableRef.bodyWrapper.addEventListener('scroll', e => {
       if (this.debounceS) return

+ 44 - 14
src/views/statisticalReport/components/tableItem.vue

@@ -2,7 +2,8 @@
   <div>
     <table v-show="false">
       <tr>
-        <td colspan="22">达州钢铁每日船舶动态明细表</td>
+        <td colspan="18">达州钢铁每日船舶动态明细表</td>
+        <td colspan="4">{{deadline}}</td> 
       </tr>
     </table>
 
@@ -34,7 +35,7 @@
           <span class="empty-desc">暂无数据</span>
         </div>
       </template>
-      <div slot="append" style="width: 100%">
+      <div slot="append" style="width: 100%;">
         <!-- 下游港口库存 -->
         <div class="appendSlot" style="margin-top:20px">
           <span class="normalFirst"
@@ -142,12 +143,7 @@
               </el-table-column>
               <el-table-column width="200px" label="备注"> </el-table-column>
             </el-table-column>
-            <el-table-column label="进口矿水联运情况简报">
-              <el-table-column> </el-table-column>
-              <el-table-column> </el-table-column>
-              <el-table-column> </el-table-column>
-              <el-table-column> </el-table-column>
-            </el-table-column>
+            
           </el-table>
         </div>
         <el-divider></el-divider>
@@ -336,7 +332,8 @@ export default {
       runStockStringArr: [],
       spanArr: [],
       loadTable: [],
-      controlLinesTable: []
+      controlLinesTable: [],
+      deadline:null
     }
   },
   mounted() {
@@ -345,8 +342,19 @@ export default {
     this.getRunStockList()
     this.searchLoadData()
     this.getControlLines()
+    this.initialDate()
   },
   methods: {
+    initialDate(){
+      let now=new Date();
+      this.deadline=now.getFullYear()+'年'+(now.getMonth()+1)+'月'+now.getDate()+'日';
+      if(now.getHours()>=8&&now.getHours()<18){
+        this.deadline+='(数据截止于8:00)';
+      }else{
+        this.deadline+='(数据截止于18:00)';
+      }
+      console.log("deadline:",this.deadline);
+    },
     getStockString() {
       let that = this
       this.axios
@@ -574,9 +582,31 @@ export default {
         one: spanOneArr
       }
     },
+    flitterData1(arr) {
+      var spanOneArr = []
+      let concatOne = 0
+      arr.forEach((item, index) => {
+        if (index === 0) {
+          spanOneArr.push(1)
+        } else {
+          // name 修改
+          if (item.materialType === arr[index - 1].materialType) {
+            // 第一列需合并相同内容的判断条件
+            spanOneArr[concatOne] += 1
+            spanOneArr.push(0)
+          } else {
+            spanOneArr.push(1)
+            concatOne = index
+          }
+        }
+      })
+      return {
+        one: spanOneArr
+      }
+    },
     objectSpanMethod({ row, column, rowIndex, columnIndex }) {
       if (columnIndex === 0) {
-        const _row = this.flitterData(this.tableData).one[rowIndex]
+        const _row = this.flitterData1(this.tableData).one[rowIndex]
         const _col = _row > 0 ? 1 : 0
         return {
           rowspan: _row,
@@ -712,12 +742,12 @@ export default {
 <style lang="scss" scoped>
 .el-table {
   .appendSlot {
-    margin-left: 5%;
+    margin-left: 1%;
     font-size: 18px;
     line-height: 20px;
-    .normalFirst {
-      margin-left: 42px;
-    }
+    // .normalFirst {
+    //   margin-left: 42px;
+    // }
     .normal {
       margin-left: 20px;
       font-weight: 500;