Browse Source

提交代码

zyf 2 năm trước cách đây
mục cha
commit
c1bf0db833

+ 1 - 1
build/utils.js

@@ -15,7 +15,7 @@ const devPathSrc = path.resolve(__dirname, '../../../src') // node_modules应用
 // ['index','appoint','configManager','homepage',''inward,'queue','RMS','sale','serviceManager','SporadicManage'
 //       统计报表       组织机构/系统管理 采购  仓储
 //  'statisticalReport','systemConfig','TMS','WMS','workFlow','ADMINISTRATORS']
-// let devModules = ['index', 'statisticalReport', 'appoint']
+//let devModules = ['index', 'statisticalReport', 'appoint',"inward","queue","RMS","sale"]
 let devModules = ['all']
 //let devModules=['index']
 if (pathSrc.indexOf('node_modules') > -1) {

+ 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: {

+ 71 - 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,73 @@ 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')
+      }
+      if (
+        getCookie('orgCode') == 'dagangadmin' ||
+        getCookie('orgCode') == 'zidonghuabu' ||
+        getCookie('orgCode') == 'wuliuchuyunzhongxin'
+      ) {
+        orgCode = null
+      } 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) {
+      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) {
       // 记录重复点击次数

+ 93 - 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,98 @@ export default {
     this.options2GetRequestUrl();
   },
   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')
+      }
+      if (
+        getCookie('orgCode') == 'dagangadmin' ||
+        getCookie('orgCode') == 'zidonghuabu' ||
+        getCookie('orgCode') == 'wuliuchuyunzhongxin'
+      ) {
+        orgCode = null
+      } else {
+        orgCode = getCookie('orgCode')
+      }
+      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
+            )
+          })
+      } 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
+            )
+          })
+      }
+    },
+    //导出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") {