This commit is contained in:
chenjianan
2018-12-17 18:21:36 +08:00
5 changed files with 285 additions and 43 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">
@@ -70,7 +70,7 @@
</el-table-column>
<el-table-column align="center" label="联系人" width="80">
<template slot-scope="scope">
{{ scope.row.姓名 }}
{{ scope.row.联系人 }}
</template>
</el-table-column>
<el-table-column align="center" label="联系电话" width="100">
@@ -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 {
@@ -549,6 +608,7 @@ export default {
this.form2.保证金金额 = row.履约保证金金额
this.form2.保证金类型 = row.保金类型
this.form2.收回条件 = parseInt(row.执行进度流水号)
this.title1 = '编辑履约保证金'
},
delPerformanceBond(row) {
this.$confirm('此操作将永久删除该行, 是否继续?', '提示', {
@@ -578,6 +638,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('删除失败')
}
})
})
}
}
}

View File

@@ -68,6 +68,12 @@
<el-tag v-else type="info" size="small">未付款</el-tag>
</template>
</el-table-column>
<el-table-column label="到货状态" width="100" align="center">
<template slot-scope="scope">
<el-tag v-if="scope.row.单据状态==='3'" type="success" size="small">已到货</el-tag>
<el-tag v-else type="info" size="small">未到货</el-tag>
</template>
</el-table-column>
<el-table-column label="表单号" align="center" width="280px">
<template slot-scope="scope">
{{ scope.row.表单号 }}
@@ -143,9 +149,6 @@
</template>
</el-table-column>
<el-table-column label="付款日期" align="center" width="240px">
<!--<template slot-scope="scope">-->
<!--{{scope.row.实际付款时间}}-->
<!--</template>-->
<el-table-column label="入库" align="center" width="140px">
<template slot-scope="scope">
{{ scope.row.入库时间 }}
@@ -176,7 +179,7 @@
class="el-icon-edit"
@click="Withdrawing(scope.$index, scope.row, 'form')">扣款</el-button>
<el-button
:disabled="scope.row.实际付款时间!==''"
:disabled="scope.row.实际付款时间!==''||scope.row.单据状态!=='3'"
size="mini"
type="success"
class="el-icon-check"
@@ -376,8 +379,6 @@ export default {
day = '0' + day
}
this.实际付款时间 = time.getFullYear() + '/' + month + '/' + day
// payment(row.外协加工任务单流水号).then(response => {
// }).then(() => {
payTime(row.外协加工任务单流水号, this.实际付款时间).then(response => {
if (response.data[0].result === '1') {
this.$message.success('付款成功')
@@ -386,7 +387,6 @@ export default {
this.$message.error('付款失败')
}
})
// })
}).catch(() => {
this.$message({
type: 'info',

View File

@@ -20,18 +20,18 @@
<el-card>
<el-table v-loading="loading2" :data="List" highlight-current-row height="350" border @row-click="searchProcess" >
<el-table-column label="付款状态" width="100" align="center">
<template slot-scope="scope">
<el-tag v-if="scope.row.实际付款时间!==''" type="success" size="small" style="margin: 0px">已付款</el-tag>
<el-tag v-else type="info" size="small" style="margin: 0px">未付款</el-tag>
</template>
</el-table-column>
<el-table-column label="收货状态" width="100" align="center">
<template slot-scope="scope">
<el-tag v-if="scope.row.单据状态==='作废'" type="success" size="small" style="margin: 0px">已收货</el-tag>
<el-tag v-else type="info" size="small" style="margin: 0px">未收货</el-tag>
</template>
</el-table-column>
<el-table-column label="付款状态" width="100" align="center">
<template slot-scope="scope">
<el-tag v-if="scope.row.实际付款时间!==''" type="success" size="small" style="margin: 0px">已付款</el-tag>
<el-tag v-else type="info" size="small" style="margin: 0px">未付款</el-tag>
</template>
</el-table-column>
<el-table-column label="表单号" align="center" min-width="200px">
<template slot-scope="scope">
{{ scope.row.表单号 }}