履约保证金履约保函功能

This commit is contained in:
caoxinyu
2018-12-17 11:13:22 +08:00
parent cdfa0b6bc4
commit bc63207899
3 changed files with 270 additions and 29 deletions

View File

@@ -108,3 +108,25 @@ export function delPerformanceBond() {
} }
}) })
} }
export function addPerformanceGuarantee() {
return request({
url: '',
method: 'post',
data: {
type: '2',
name: '合同信息管理_履约保证金_履约保函新增',
param: '项目流水号=' + arguments[0]
}
})
}
export function delPerformanceGuarantee() {
return request({
url: '',
method: 'post',
data: {
type: '2',
name: '合同信息管理_履约保证金_履约保函_删除',
param: '项目流水号=' + arguments[0]
}
})
}

View File

@@ -817,7 +817,7 @@ export default {
if (response.data[0].result === '1') { if (response.data[0].result === '1') {
this.$message.success('删除成功') this.$message.success('删除成功')
this.getTable(addressSearch, [this.pageCurrent1, this.pageSize1], ['addressData', 'total1']) this.getTable(addressSearch, [this.pageCurrent1, this.pageSize1], ['addressData', 'total1'])
} else { this.$message.error('数据占用') } } else { this.$message.error('删除失败') }
}) })
}).catch(() => { }).catch(() => {
this.$message({ this.$message({
@@ -1106,7 +1106,7 @@ export default {
} }
}) })
if (data[0].result === '0') { if (data[0].result === '0') {
this.$message.error('数据占用') this.$message.error('删除失败')
} }
}, },
handlePictureCardPreview(file) { handlePictureCardPreview(file) {
@@ -1126,7 +1126,7 @@ export default {
this.$message.error('只能上传图片。。') this.$message.error('只能上传图片。。')
} }
if (!isLt4M) { if (!isLt4M) {
this.$message.error('上传头像图片大小不能超过 4MB!') this.$message.error('上传图片大小不能超过 4MB!')
} }
return isJPG && isLt4M && isInvoiceNum return isJPG && isLt4M && isInvoiceNum

View File

@@ -32,11 +32,11 @@
<el-table <el-table
v-loading="listLoading1" v-loading="listLoading1"
:data="tableData1" :data="tableData1"
highlight-current-row
style="width: 100%" style="width: 100%"
height="400" height="400"
border border
size="mini" size="mini"
highlight-current-row
@row-click="fetchTableData2"> @row-click="fetchTableData2">
<el-table-column align="center" label="合同编号" width="200"> <el-table-column align="center" label="合同编号" width="200">
<template slot-scope="scope"> <template slot-scope="scope">
@@ -96,7 +96,7 @@
size="mini" size="mini"
type="primary" type="primary"
icon="el-icon-circle-plus-outline" icon="el-icon-circle-plus-outline"
@click.stop="openAddInvoiceRecordingDialog(); flag = 3">履约保函</el-button> @click.stop="addPerformanceGuarantee(scope.row)">履约保函</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@@ -114,7 +114,7 @@
<el-card> <el-card>
<template> <template>
<el-tabs v-model="activeName" type="card"> <el-tabs v-model="activeName" type="card">
<el-tab-pane label="履约保证金" name="first"> <el-tab-pane :disabled="performanceBondDisabled" label="履约保证金" name="first">
<el-table <el-table
v-loading="listLoading2" v-loading="listLoading2"
:data="tableData2" :data="tableData2"
@@ -197,21 +197,22 @@
</el-table-column> </el-table-column>
</el-table> </el-table>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="履约保函" name="second"> <el-tab-pane :disabled="performanceGuaranteeDisabled" label="履约保函" name="second">
<div> <el-button type="danger" icon="el-icon-delete" size="small" style="float: right" @click="delPerformanceGuarantee">删除</el-button>
<!--<el-upload--> <div v-show="performanceGuaranteeShow" style="width: 150px; height: 150px; margin: auto;left: 50%;right: 50%">
<!--:on-preview="handlePictureCardPreview"--> <el-upload
<!--:on-remove="handleRemove"--> :on-preview="handlePictureCardPreview"
<!--:file-list="fileList"--> :on-remove="handleRemove"
<!--:before-upload="beforeUpload"--> :file-list="fileList"
<!--:on-success="onSuccess"--> :before-upload="beforeUpload"
<!--:action="'http://localhost:8411/submit/upload3.ashx?ProjectId='+ ProjectId"--> :on-success="onSuccess"
<!--list-type="picture-card">--> :action="'http://localhost:8411/submit/upload3.ashx?ProjectId='+ projectId"
<!--<i class="el-icon-plus"/>--> list-type="picture-card">
<!--</el-upload>--> <i class="el-icon-plus"/>
<!--<el-dialog :visible.sync="dialogVisible">--> </el-upload>
<!--<img :src="dialogImageUrl" width="100%" alt="">--> <el-dialog :visible.sync="dialogVisible">
<!--</el-dialog>--> <img :src="dialogImageUrl" width="100%" alt="">
</el-dialog>
</div> </div>
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
@@ -284,8 +285,9 @@
</template> </template>
<script> <script>
import request from '@/utils/request'
import elInput from 'element-ui/packages/input' import elInput from 'element-ui/packages/input'
import { initProject, searchTableData1, typeOfPerformanceBond, searchTableData2, takeBack, executionProgressID, initType, addPerformanceBond, editPerformanceBond, delPerformanceBond } from '@/api/MarketingCenter/PerformanceBond' import { initProject, searchTableData1, typeOfPerformanceBond, searchTableData2, takeBack, executionProgressID, initType, addPerformanceBond, editPerformanceBond, delPerformanceBond, addPerformanceGuarantee, delPerformanceGuarantee } from '@/api/MarketingCenter/PerformanceBond'
export default { export default {
components: { components: {
elInput elInput
@@ -319,6 +321,12 @@ export default {
dialogFormVisible1: false, // 履约保证金对话框 dialogFormVisible1: false, // 履约保证金对话框
plannedTime: [], plannedTime: [],
performanceBondType: [], performanceBondType: [],
performanceBondDisabled: true, // 履约保证金标签页是否禁用
performanceGuaranteeDisabled: true, // 履约保函是否禁用
dialogVisible: false, // 履约保函复印件
dialogImageUrl: '',
fileList: [],
performanceGuaranteeShow: true,
form: { form: {
实际收回日期: '' 实际收回日期: ''
}, },
@@ -354,9 +362,21 @@ export default {
}, },
// 查询合同(项目)信息 // 查询合同(项目)信息
fetchTableData1() { fetchTableData1() {
if (this.entryNameValue === '' || this.entryNameValue === null) { this.entryNameValue_check = 0 } else { this.entryNameValue_check = 1 } if (this.entryNameValue === '' || this.entryNameValue === null) {
if (this.startTime === '' || this.startTime === null) { this.startTime_check = 0 } else { this.startTime_check = 1 } this.entryNameValue_check = 0
if (this.endTime === '' || this.endTime === null) { this.endTime_check = 0 } else { this.endTime_check = 1 } } 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
}
this.listLoading1 = true this.listLoading1 = true
searchTableData1(this.PageCurrent, this.PageSize, this.entryNameValue, this.entryNameValue_check, this.startTime_check, this.endTime_check, this.startTime, this.endTime).then(response => { searchTableData1(this.PageCurrent, this.PageSize, this.entryNameValue, this.entryNameValue_check, this.startTime_check, this.endTime_check, this.startTime, this.endTime).then(response => {
this.tableData2 = [] this.tableData2 = []
@@ -394,6 +414,8 @@ export default {
if (data === 1) { if (data === 1) {
this.activeName = 'first' this.activeName = 'first'
this.listLoading2 = true this.listLoading2 = true
this.performanceBondDisabled = false
this.performanceGuaranteeDisabled = true
searchTableData2(this.projectId).then(response => { searchTableData2(this.projectId).then(response => {
this.listLoading2 = false this.listLoading2 = false
const data = response.data const data = response.data
@@ -405,11 +427,18 @@ export default {
} }
this.tableData2 = data this.tableData2 = data
}) })
} else if (data === 1) { } else if (data === 2) {
this.activeName = 'second' this.activeName = 'second'
this.performanceBondDisabled = true
this.performanceGuaranteeDisabled = false
this.performanceGuaranteeShow = true
this.getFileList()
} else { } else {
this.$message.warning('未缴纳履约保证金') this.$message.warning('未缴纳履约保证金')
this.tableData2 = [] this.tableData2 = []
this.performanceGuaranteeShow = false
this.performanceBondDisabled = true
this.performanceGuaranteeDisabled = true
} }
}) })
}, },
@@ -435,6 +464,8 @@ export default {
if (data === 1) { if (data === 1) {
this.activeName = 'first' this.activeName = 'first'
this.listLoading2 = true this.listLoading2 = true
this.performanceBondDisabled = false
this.performanceGuaranteeDisabled = true
searchTableData2(this.projectId).then(response => { searchTableData2(this.projectId).then(response => {
this.listLoading2 = false this.listLoading2 = false
const data = response.data const data = response.data
@@ -446,10 +477,18 @@ export default {
} }
this.tableData2 = data this.tableData2 = data
}) })
} else if (data === 1) { } else if (data === 2) {
this.activeName = 'second' this.activeName = 'second'
this.performanceBondDisabled = true
this.performanceGuaranteeDisabled = false
this.performanceGuaranteeShow = true
this.getFileList()
} else { } else {
this.$message.warning('未缴纳履约保证金') this.$message.warning('未缴纳履约保证金')
this.performanceBondDisabled = true
this.performanceGuaranteeDisabled = true
this.tableData2 = []
this.performanceGuaranteeShow = false
} }
}) })
} else { } else {
@@ -485,6 +524,8 @@ export default {
if (data === 1) { if (data === 1) {
this.activeName = 'first' this.activeName = 'first'
this.listLoading2 = true this.listLoading2 = true
this.performanceBondDisabled = false
this.performanceGuaranteeDisabled = true
searchTableData2(this.projectId).then(response => { searchTableData2(this.projectId).then(response => {
this.listLoading2 = false this.listLoading2 = false
const data = response.data const data = response.data
@@ -496,10 +537,18 @@ export default {
} }
this.tableData2 = data this.tableData2 = data
}) })
} else if (data === 1) { } else if (data === 2) {
this.activeName = 'second' this.activeName = 'second'
this.performanceBondDisabled = true
this.performanceGuaranteeDisabled = false
this.performanceGuaranteeShow = true
this.getFileList()
} else { } else {
this.$message.warning('未缴纳履约保证金') this.$message.warning('未缴纳履约保证金')
this.performanceBondDisabled = true
this.performanceGuaranteeDisabled = true
this.tableData2 = []
this.performanceGuaranteeShow = false
} }
}) })
} else { } else {
@@ -518,6 +567,8 @@ export default {
if (data === 1) { if (data === 1) {
this.activeName = 'first' this.activeName = 'first'
this.listLoading2 = true this.listLoading2 = true
this.performanceBondDisabled = false
this.performanceGuaranteeDisabled = true
searchTableData2(this.projectId).then(response => { searchTableData2(this.projectId).then(response => {
this.listLoading2 = false this.listLoading2 = false
const data = response.data const data = response.data
@@ -529,10 +580,18 @@ export default {
} }
this.tableData2 = data this.tableData2 = data
}) })
} else if (data === 1) { } else if (data === 2) {
this.activeName = 'second' this.activeName = 'second'
this.performanceBondDisabled = true
this.performanceGuaranteeDisabled = false
this.performanceGuaranteeShow = true
this.getFileList()
} else { } else {
this.$message.warning('未缴纳履约保证金') this.$message.warning('未缴纳履约保证金')
this.performanceBondDisabled = true
this.performanceGuaranteeDisabled = true
this.tableData2 = []
this.performanceGuaranteeShow = false
} }
}) })
} else { } else {
@@ -578,6 +637,166 @@ export default {
} }
}) })
}) })
},
addPerformanceGuarantee(row) {
this.projectId = row.项目流水号
this.$confirm('是否新增履约保函', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
addPerformanceGuarantee(this.projectId).then(response => {
if (response.data[0].result === '1') {
this.$message.success('添加成功')
this.activeName = 'second'
this.performanceBondDisabled = true
this.performanceGuaranteeDisabled = false
this.fetchTableData1()
typeOfPerformanceBond(this.projectId).then(response => {
const data = response.data[0].履约保证金类型
return data
}).then(data => {
if (data === 1) {
this.activeName = 'first'
this.listLoading2 = true
this.performanceBondDisabled = false
this.performanceGuaranteeDisabled = true
searchTableData2(this.projectId).then(response => {
this.listLoading2 = false
const data = response.data
for (let i = 0; i < data.length; i++) {
data[i].实际收回日期 !== '' && data[i].实际收回日期 !== null ? data[i].实际收回日期 = data[i].实际收回日期.substring(0, data[i].实际收回日期.length - 8) : data[i].实际收回日期
data[i].节点日期 !== '' && data[i].节点日期 !== null ? data[i].节点日期 = data[i].节点日期.substring(0, data[i].节点日期.length - 8) : data[i].节点日期
data[i].计划收款日期 !== '' && data[i].计划收款日期 !== null ? data[i].计划收款日期 = data[i].计划收款日期.substring(0, data[i].计划收款日期.length - 8) : data[i].计划收款日期
data[i].计划收款日期 === '' || data[i].计划收款日期 === null || parseInt(data[i].是否收回) === 1 ? data[i].是否禁用收回 = true : data[i].是否禁用收回 = false
}
this.tableData2 = data
})
} else if (data === 2) {
this.activeName = 'second'
this.performanceBondDisabled = true
this.performanceGuaranteeDisabled = false
this.performanceGuaranteeShow = true
this.getFileList()
} else {
this.$message.warning('未缴纳履约保证金')
this.tableData2 = []
this.performanceGuaranteeShow = false
this.performanceBondDisabled = true
this.performanceGuaranteeDisabled = true
}
})
} else {
this.$message.error('添加失败')
}
})
})
},
async getFileList() {
const { data } = await request({
url: '',
method: 'post',
data: {
type: '3',
name: `select * from 合同信息管理_履约保证金_履约保函 where 是否启用 = 1 and 项目流水号 = ${this.projectId}`
}
})
this.fileList = data.map(item => {
return {
_id: item.履约保函流水号,
name: item.文件标识,
url: 'http://localhost:8411/webpage/img/' + item.文件标识
}
})
},
async handleRemove(file, fileList) {
const { data } = await request({
url: '',
method: 'post',
data: {
type: '4',
name: `update 合同信息管理_履约保证金_履约保函 set 是否启用 = 0 where 履约保函流水号 = ${file._id}`
}
})
if (data[0].result === '0') {
this.$message.error('上传失败')
}
},
handlePictureCardPreview(file) {
this.dialogImageUrl = file.url
this.dialogVisible = true
},
beforeUpload(file) {
const isJPG = /^image\/.*/.test(file.type)
const isLt4M = file.size / 1024 / 1024 < 4
const isInvoiceNum = !!this.projectId
if (!isJPG) {
this.$message.error('只能上传图片。。')
}
if (!isLt4M) {
this.$message.error('上传图片大小不能超过 4MB!')
}
return isJPG && isLt4M && isInvoiceNum
},
onSuccess(res, file, fileList) {
fileList = []
if (res[0].result === '1') {
this.getFileList()
} else {
this.$message.error('上传失败')
}
},
delPerformanceGuarantee() {
this.$confirm('是否删除履约保函', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
delPerformanceGuarantee(this.projectId).then(response => {
if (response.data[0].result === '1') {
this.$message.success('删除成功')
this.fetchTableData1()
typeOfPerformanceBond(this.projectId).then(response => {
const data = response.data[0].履约保证金类型
return data
}).then(data => {
if (data === 1) {
this.activeName = 'first'
this.listLoading2 = true
this.performanceBondDisabled = false
this.performanceGuaranteeDisabled = true
searchTableData2(this.projectId).then(response => {
this.listLoading2 = false
const data = response.data
for (let i = 0; i < data.length; i++) {
data[i].实际收回日期 !== '' && data[i].实际收回日期 !== null ? data[i].实际收回日期 = data[i].实际收回日期.substring(0, data[i].实际收回日期.length - 8) : data[i].实际收回日期
data[i].节点日期 !== '' && data[i].节点日期 !== null ? data[i].节点日期 = data[i].节点日期.substring(0, data[i].节点日期.length - 8) : data[i].节点日期
data[i].计划收款日期 !== '' && data[i].计划收款日期 !== null ? data[i].计划收款日期 = data[i].计划收款日期.substring(0, data[i].计划收款日期.length - 8) : data[i].计划收款日期
data[i].计划收款日期 === '' || data[i].计划收款日期 === null || parseInt(data[i].是否收回) === 1 ? data[i].是否禁用收回 = true : data[i].是否禁用收回 = false
}
this.tableData2 = data
})
} else if (data === 2) {
this.activeName = 'second'
this.performanceBondDisabled = true
this.performanceGuaranteeDisabled = false
this.performanceGuaranteeShow = true
this.getFileList()
} else {
this.$message.warning('未缴纳履约保证金')
this.tableData2 = []
this.performanceGuaranteeShow = false
this.performanceBondDisabled = true
this.performanceGuaranteeDisabled = true
}
})
} else {
this.$message.error('删除失败')
}
})
})
} }
} }
} }