zengyf 2 vuotta sitten
vanhempi
commit
e893a95056
3 muutettua tiedostoa jossa 110 lisäystä ja 4 poistoa
  1. 1 1
      build/utils.js
  2. 1 1
      config/index.js
  3. 108 2
      src/views/appoint/components/saleContract/transportPrice.vue

+ 1 - 1
build/utils.js

@@ -18,7 +18,7 @@ const devPathSrc = path.resolve(__dirname, '../../../src') // node_modules应用
 
 let devModules = ['all']
 //let devModules=['index']
-// let devModules = ['index', 'appoint', 'RMS']
+//let devModules = ['index', 'appoint', 'RMS','sale','statisticalReport','TMS','AMS']
 // let devModules = ['index', 'ADMINISTRATORS']
 
 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: {

+ 108 - 2
src/views/appoint/components/saleContract/transportPrice.vue

@@ -9,7 +9,7 @@
       <el-button type="primary" @click="btnclick(0)">
         <i class="el-icon-plus"></i>新增
       </el-button>
-       <el-button type="primary" @click="exportData()"><i class="el-icon-download"></i>导出(Excel)</el-button>
+       <el-button type="primary" @click="exportAllExcel()"><i class="el-icon-download"></i>导出(Excel)</el-button>
     </div>
 
 <el-tabs v-model="activeName">
@@ -163,6 +163,105 @@ export default {
     };
   },
   methods: {
+    exportAllExcel() {
+      if (this.activeName == 'first') {
+        this.tableTitle = '正在启用的运输单价'
+        this.loading = true;
+      this.isKuang = true;
+      if(this.input){
+        this.axios
+                .post(
+                  "/api/v1/ams/getAmsContractTransportPrice1?apiId=109&deleted=0&con=" +this.input+"&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/ams/getAmsContractTransportPrice1?apiId=109&deleted=0&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 (this.activeName == 'second') {
+        this.tableTitle = '历史启用的运输单价'
+        this.loading = true;
+        this.isKuang = true;
+      if(this.input){
+        this.axios
+                .post(
+                  "/api/v1/ams/getAmsContractTransportPrice1?apiId=109&deleted=1&con=" +this.input+"&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/ams/getAmsContractTransportPrice1?apiId=109&deleted=1&con=" +this.input+"&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.loading=false
+      },
+    //导出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)导出的表格名称
+      })
+    },
     func(){
       this.loading = false;
       this.isKuang = false;
@@ -199,7 +298,12 @@ export default {
     //修改运价
     //删除运价
     deletePrice(row){
-      let mapValue={
+      this.$confirm('您确定要删除吗?','提示',{
+        confirmButtonText:'确定',
+        cancelButtonText:'取消',
+        type:'warning'
+      }).then(()=>{
+        let mapValue={
         addressProvince:row.addressProvince,
         addressDistrict:row.addressDistrict,
         addressTown:row.addressTown,
@@ -214,6 +318,8 @@ export default {
         }
       })
       this.onclick()
+      }).catch({
+      })
     },
     //修改
     async updatePrice(row){