刘璐珈

This commit is contained in:
Vergil
2020-03-03 14:32:24 +08:00
parent ca6652f65e
commit a5621d0048
6 changed files with 93 additions and 12 deletions

View File

@@ -39,6 +39,11 @@
<!-- type="date"-->
<!-- placeholder="请选择结束日期"/>-->
<el-button type="primary" icon="el-icon-search" size="small" style="margin-left: 10px" plain @click="PageSize = 30;PageCurrent = 1;fetchTableData1()">查询</el-button>
<el-tooltip :open-delay="1200" effect="dark" content="导出" placement="top" style="margin: 10px 0 0 630px">
<div style="display: inline-block">
<el-button type="primary" plain class="el-icon-download" size="small" @click="exportExcel">导出</el-button>
</div>
</el-tooltip>
</el-card>
<el-card>
@@ -332,9 +337,10 @@
<script>
import request from '@/utils/request'
import { getNowShotTime } from '@/utils/tool'
import elInput from 'element-ui/packages/input'
import { upload3, readImg } from '@/utils/request'
import { initProject, searchTableData1, typeOfPerformanceBond, searchTableData2, takeBack, executionProgressID, initType, addPerformanceBond, editPerformanceBond, delPerformanceBond, addPerformanceGuarantee, delPerformanceGuarantee } from '@/api/MarketingCenter/PerformanceBond'
import { initProject, searchTableData1, typeOfPerformanceBond, searchTableData2, takeBack, executionProgressID, initType, addPerformanceBond, editPerformanceBond, delPerformanceBond, addPerformanceGuarantee, delPerformanceGuarantee, searchTable_excel } from '@/api/MarketingCenter/PerformanceBond'
export default {
components: {
elInput
@@ -438,6 +444,60 @@ export default {
this.fetchTableData1()
},
methods: {
formatJson(filterVal, jsonData) {
return jsonData.map(v => filterVal.map(j => {
return v[j]
}))
},
exportExcel() {
if (this.entryNameValue === '' || this.entryNameValue === null) {
this.entryNameValue_check = 0
} else {
this.entryNameValue_check = 1
}
if (this.startTime === '' || this.startTime === null) {
this.startTime_check = 0
} else {
this.startTime_check = 1
}
if (this.endTime === '' || this.endTime === null) {
this.endTime_check = 0
} else {
this.endTime_check = 1
}
if (this.customerName === '' || this.customerName === null) {
this.customerName_check = 0
} else {
this.customerName_check = 1
}
// llj新增
this.dateRange ? this.check1 = 1 : (this.check1 = 0, this.dateRange = '')
searchTable_excel(this.entryNameValue, this.entryNameValue_check, this.check1, this.check1, this.dateRange[0], this.dateRange[1], this.customerName_check, this.customerName).then(val => {
console.log(val.data[0], 9911)
for (let i = 0; i < val.data.length; i++) {
val.data[i].履约金 === null ? val.data[i].履约金 = '0.00' : val.data[i].履约金 = (val.data[i].履约金).toFixed(2)
val.data[i].投标转入 === null ? val.data[i].投标转入 = '0.00' : val.data[i].投标转入 = (val.data[i].投标转入).toFixed(2)
val.data[i].收回金额 === null ? val.data[i].收回金额 = '0.00' : val.data[i].收回金额 = (val.data[i].收回金额).toFixed(2)
}
if (val.length !== 0) {
import('@/vendor/Export2Excel').then(excel => {
const tHeader = ['合同编号', '项目名称', '客户名称', '签订日期', '履约金(万元)', '销售经理', '投标转入(万元)', '转入时间', '收回条件', '收回金额(万元)', '收回日期']
const filterVal = ['合同编号', '项目名称', '客户名称', '签订日期', '履约金', '销售经理', '投标转入', '转入时间', '收回条件', '收回金额', '收回日期']
const list = val.data
const data = this.formatJson(filterVal, list)
excel.export_json_to_excel({
header: tHeader,
data,
filename: getNowShotTime() + '履约保证金',
autoWidth: true,
bookType: 'xlsx'
})
})
} else {
this.$message.warning('没有导出内容')
}
})
},
// 初始化条件
init() {
this.getSelect(initProject, ['项目名称', '项目流水号'], 'entryName')
@@ -497,6 +557,7 @@ export default {
},
// 履约保证金查询
fetchTableData2(row) {
console.log(row, 911)
this.projectId = row.项目流水号
typeOfPerformanceBond(this.projectId).then(response => {
const data = response.data[0].履约保证金类型