|
@@ -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){
|