履约保证金履约保函功能

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

View File

@@ -32,11 +32,11 @@
<el-table
v-loading="listLoading1"
:data="tableData1"
highlight-current-row
style="width: 100%"
height="400"
border
size="mini"
highlight-current-row
@row-click="fetchTableData2">
<el-table-column align="center" label="合同编号" width="200">
<template slot-scope="scope">
@@ -96,7 +96,7 @@
size="mini"
type="primary"
icon="el-icon-circle-plus-outline"
@click.stop="openAddInvoiceRecordingDialog(); flag = 3">履约保函</el-button>
@click.stop="addPerformanceGuarantee(scope.row)">履约保函</el-button>
</template>
</el-table-column>
</el-table>
@@ -114,7 +114,7 @@
<el-card>
<template>
<el-tabs v-model="activeName" type="card">
<el-tab-pane label="履约保证金" name="first">
<el-tab-pane :disabled="performanceBondDisabled" label="履约保证金" name="first">
<el-table
v-loading="listLoading2"
:data="tableData2"
@@ -197,21 +197,22 @@
</el-table-column>
</el-table>
</el-tab-pane>
<el-tab-pane label="履约保函" name="second">
<div>
<!--<el-upload-->
<!--:on-preview="handlePictureCardPreview"-->
<!--:on-remove="handleRemove"-->
<!--:file-list="fileList"-->
<!--:before-upload="beforeUpload"-->
<!--:on-success="onSuccess"-->
<!--:action="'http://localhost:8411/submit/upload3.ashx?ProjectId='+ ProjectId"-->
<!--list-type="picture-card">-->
<!--<i class="el-icon-plus"/>-->
<!--</el-upload>-->
<!--<el-dialog :visible.sync="dialogVisible">-->
<!--<img :src="dialogImageUrl" width="100%" alt="">-->
<!--</el-dialog>-->
<el-tab-pane :disabled="performanceGuaranteeDisabled" label="履约保函" name="second">
<el-button type="danger" icon="el-icon-delete" size="small" style="float: right" @click="delPerformanceGuarantee">删除</el-button>
<div v-show="performanceGuaranteeShow" style="width: 150px; height: 150px; margin: auto;left: 50%;right: 50%">
<el-upload
:on-preview="handlePictureCardPreview"
:on-remove="handleRemove"
:file-list="fileList"
:before-upload="beforeUpload"
:on-success="onSuccess"
:action="'http://localhost:8411/submit/upload3.ashx?ProjectId='+ projectId"
list-type="picture-card">
<i class="el-icon-plus"/>
</el-upload>
<el-dialog :visible.sync="dialogVisible">
<img :src="dialogImageUrl" width="100%" alt="">
</el-dialog>
</div>
</el-tab-pane>
</el-tabs>
@@ -284,8 +285,9 @@
</template>
<script>
import request from '@/utils/request'
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 {
components: {
elInput
@@ -319,6 +321,12 @@ export default {
dialogFormVisible1: false, // 履约保证金对话框
plannedTime: [],
performanceBondType: [],
performanceBondDisabled: true, // 履约保证金标签页是否禁用
performanceGuaranteeDisabled: true, // 履约保函是否禁用
dialogVisible: false, // 履约保函复印件
dialogImageUrl: '',
fileList: [],
performanceGuaranteeShow: true,
form: {
实际收回日期: ''
},
@@ -354,9 +362,21 @@ export default {
},
// 查询合同(项目)信息
fetchTableData1() {
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.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
}
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 => {
this.tableData2 = []
@@ -394,6 +414,8 @@ export default {
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
@@ -405,11 +427,18 @@ export default {
}
this.tableData2 = data
})
} else if (data === 1) {
} 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
}
})
},
@@ -435,6 +464,8 @@ export default {
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
@@ -446,10 +477,18 @@ export default {
}
this.tableData2 = data
})
} else if (data === 1) {
} else if (data === 2) {
this.activeName = 'second'
this.performanceBondDisabled = true
this.performanceGuaranteeDisabled = false
this.performanceGuaranteeShow = true
this.getFileList()
} else {
this.$message.warning('未缴纳履约保证金')
this.performanceBondDisabled = true
this.performanceGuaranteeDisabled = true
this.tableData2 = []
this.performanceGuaranteeShow = false
}
})
} else {
@@ -485,6 +524,8 @@ export default {
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
@@ -496,10 +537,18 @@ export default {
}
this.tableData2 = data
})
} else if (data === 1) {
} else if (data === 2) {
this.activeName = 'second'
this.performanceBondDisabled = true
this.performanceGuaranteeDisabled = false
this.performanceGuaranteeShow = true
this.getFileList()
} else {
this.$message.warning('未缴纳履约保证金')
this.performanceBondDisabled = true
this.performanceGuaranteeDisabled = true
this.tableData2 = []
this.performanceGuaranteeShow = false
}
})
} else {
@@ -518,6 +567,8 @@ export default {
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
@@ -529,10 +580,18 @@ export default {
}
this.tableData2 = data
})
} else if (data === 1) {
} else if (data === 2) {
this.activeName = 'second'
this.performanceBondDisabled = true
this.performanceGuaranteeDisabled = false
this.performanceGuaranteeShow = true
this.getFileList()
} else {
this.$message.warning('未缴纳履约保证金')
this.performanceBondDisabled = true
this.performanceGuaranteeDisabled = true
this.tableData2 = []
this.performanceGuaranteeShow = false
}
})
} 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('删除失败')
}
})
})
}
}
}