This commit is contained in:
liushuai
2020-03-03 15:07:35 +08:00
6 changed files with 93 additions and 12 deletions

View File

@@ -28,6 +28,19 @@ export function searchTableData1(pageCurrent, pageSize, num1, num2, num3, num4,
} }
}) })
} }
export function searchTable_excel(num1, num2, num3, num4, num5, num6, num7, num8) {
return request({
url: '',
method: 'post',
data: {
UserID: state.state.user.id,
ModularID: router.currentRoute.path,
type: '1',
name: '报表_履约保证金_导出',
param: '项目流水号=' + num1 + '=int&项目流水号_check=' + num2 + '=int&开始日期_check=' + num3 + '=int&结束日期_check=' + num4 + '=int&开始日期=' + num5 + '=date&结束日期=' + num6 + '=date&客户名称_check=' + num7 + '=int&客户名称=' + num8 + '=string'
}
})
}
export function typeOfPerformanceBond(num1) { export function typeOfPerformanceBond(num1) {
return request({ return request({
url: '', url: '',

View File

@@ -40,9 +40,9 @@
<!-- placeholder="请选择结束日期"/>--> <!-- 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-button type="primary" icon="el-icon-search" size="small" style="margin-left: 10px" plain @click="PageSize = 30;PageCurrent = 1;fetchTableData1()">查询</el-button>
<el-button type="distribution" icon="el-icon-circle-plus-outline" size="small" style="margin-left: 10px;margin-right: 15px" @click="addBidBond();flag1 = 2">保证金</el-button> <el-button type="distribution" icon="el-icon-circle-plus-outline" size="small" style="margin-left: 10px;margin-right: 15px" @click="addBidBond();flag1 = 2">保证金</el-button>
<el-tooltip :open-delay="1200" effect="dark" content="导出" placement="top"> <el-tooltip :open-delay="1200" effect="dark" content="导出" style="margin: 10px 0 0 590px;width: 50px" placement="top">
<div style="display: inline-block"> <div style="display: inline-block">
<el-button type="primary" plain class="el-icon-download" size="small" style="margin: 10px 0 0 600px" @click="exportExcel">导出</el-button> <el-button type="primary" plain class="el-icon-download" size="small" style="" @click="exportExcel">导出</el-button>
</div> </div>
</el-tooltip> </el-tooltip>
</el-card> </el-card>
@@ -446,7 +446,7 @@
</el-row> </el-row>
<el-row> <el-row>
<el-form-item label="截止时间(天)" prop="截止时间"> <el-form-item label="截止时间(天)" prop="截止时间">
<el-input-number v-model="PerformanceBondform.截止时间" placeholder="请输入截止时间" style="width: 200px" size="small"/> <el-input v-positive="'int'" v-model="PerformanceBondform.截止时间" placeholder="请输入截止时间" type="number" style="width: 200px" size="small"/>
</el-form-item> </el-form-item>
</el-row> </el-row>
</el-form> </el-form>

View File

@@ -1,14 +1,14 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<el-tabs id="PurchasingCenter/PurchaseTaskAllocate" v-model="tabName" type="border-card"> <el-tabs id="PurchasingCenter/PurchaseTaskAllocate" v-model="tabName" type="border-card" @tab-click="handleClick">
<el-tab-pane label="投标保证金" name="投标保证金"> <el-tab-pane label="投标保证金" name="投标保证金">
<BidBond/> <BidBond v-if="handle === '投标保证金'"/>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="履约保证金" name="履约保证金"> <el-tab-pane label="履约保证金" name="履约保证金">
<PerformanceBond/> <PerformanceBond v-if="handle === '履约保证金'"/>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="安全保证金" name="安全保证金"> <el-tab-pane label="安全保证金" name="安全保证金">
<SafetyMargin/> <SafetyMargin v-if="handle === '安全保证金'"/>
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
</div> </div>
@@ -24,8 +24,15 @@ export default {
}, },
data() { data() {
return { return {
handle: '',
tabName: '投标保证金' tabName: '投标保证金'
} }
},
methods: {
handleClick(tab) {
this.handle = tab.name
}
} }
} }
</script> </script>

View File

@@ -39,6 +39,11 @@
<!-- type="date"--> <!-- type="date"-->
<!-- placeholder="请选择结束日期"/>--> <!-- 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-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>
<el-card> <el-card>
@@ -332,9 +337,10 @@
<script> <script>
import request from '@/utils/request' import request from '@/utils/request'
import { getNowShotTime } from '@/utils/tool'
import elInput from 'element-ui/packages/input' import elInput from 'element-ui/packages/input'
import { upload3, readImg } from '@/utils/request' 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 { export default {
components: { components: {
elInput elInput
@@ -438,6 +444,60 @@ export default {
this.fetchTableData1() this.fetchTableData1()
}, },
methods: { 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() { init() {
this.getSelect(initProject, ['项目名称', '项目流水号'], 'entryName') this.getSelect(initProject, ['项目名称', '项目流水号'], 'entryName')
@@ -497,6 +557,7 @@ export default {
}, },
// 履约保证金查询 // 履约保证金查询
fetchTableData2(row) { fetchTableData2(row) {
console.log(row, 911)
this.projectId = row.项目流水号 this.projectId = row.项目流水号
typeOfPerformanceBond(this.projectId).then(response => { typeOfPerformanceBond(this.projectId).then(response => {
const data = response.data[0].履约保证金类型 const data = response.data[0].履约保证金类型

View File

@@ -150,7 +150,7 @@ export default {
name: '省份', name: '省份',
type: 'pie', type: 'pie',
radius: '55%', radius: '55%',
center: ['50%', '60%'], center: ['70%', '60%'],
data: dataX, data: dataX,
itemStyle: { itemStyle: {
emphasis: { emphasis: {

View File

@@ -40,9 +40,9 @@
<!-- type="date"--> <!-- type="date"-->
<!-- placeholder="请选择结束日期"/>--> <!-- placeholder="请选择结束日期"/>-->
<el-button type="primary" icon="el-icon-search" size="small" style="margin-left: 10px" plain @click="PageSizeProject = 30;PageCurrentProject = 1;searchTableDataProject()">查询</el-button> <el-button type="primary" icon="el-icon-search" size="small" style="margin-left: 10px" plain @click="PageSizeProject = 30;PageCurrentProject = 1;searchTableDataProject()">查询</el-button>
<el-tooltip :open-delay="1200" effect="dark" content="导出" placement="top"> <el-tooltip :open-delay="1200" effect="dark" content="导出" placement="top" style="margin: 10px 0 0 645px">
<div style="display: inline-block"> <div style="display: inline-block">
<el-button type="primary" plain class="el-icon-download" size="small" style="margin: 10px 0 0 630px" @click="exportExcel">导出</el-button> <el-button type="primary" plain class="el-icon-download" size="small" @click="exportExcel">导出</el-button>
</div> </div>
</el-tooltip> </el-tooltip>
</el-card> </el-card>
@@ -650,7 +650,7 @@ export default {
data() { data() {
const validateValue = (rule, value, callback) => { const validateValue = (rule, value, callback) => {
if (value === 0) { if (value === 0) {
callback(new Error('金额不能为0')) callback()
} else { } else {
callback() callback()
} }