Kaynağa Gözat

提交代码

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

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

@@ -114,47 +114,76 @@ 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)
+      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=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 {
-        orgCode = getCookie('orgCode')
       }
-      this.tableTitle = '未结算计费详单'
-      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
-          )
-        })
+
     },
     //导出excel
     exportAllReportToExcel(tableTitle, dataArr, columnData) {

+ 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

+ 164 - 59
src/views/inward/components/inwardSettlement/timeDetailsWeight.vue

@@ -106,71 +106,176 @@ 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=465&orderType=21&detailStatus=0" +
-            "&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
-            )
-          })
+        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 = '已结算计费详单'
-        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.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=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