安全保证金

This commit is contained in:
caoxinyu
2018-12-19 08:38:45 +08:00
parent 249df8f2ed
commit fca23907c4
2 changed files with 326 additions and 108 deletions

View File

@@ -10,14 +10,14 @@ export function initProject() {
}
})
}
export function searchTable1(pageCurrent, pageSize, num1, num2) {
export function searchTable1(pageCurrent, pageSize, num1) {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '安全保证金管理_安全保证金信息查询',
param: '项目流水号=' + num1 + '=int&查询类型=' + num2 + '=int',
param: '项目流水号=' + num1 + '=int',
Pagination: pageCurrent + '&' + pageSize
}
})
@@ -41,7 +41,7 @@ export function addSafetyMargin() {
data: {
type: '2',
name: '安全保证金管理_安全保证金信息_增加',
param: '项目流水号=' + arguments[0] + '&保证金金额=' + arguments[1] + '&交付日期=' + arguments[2] + '&提前X天提醒=' + arguments[3] + '&预计收回日期=' + arguments[4] + '&备注=' + arguments[5]
param: '项目流水号=' + arguments[0] + '&保证金金额=' + arguments[1] + '&交付日期=' + arguments[2] + '&提前X天提醒=' + arguments[3] + '&执行进度流水号=' + arguments[4] + '&备注=' + arguments[5]
}
})
}
@@ -52,7 +52,7 @@ export function editSafetyMargin() {
data: {
type: '2',
name: '安全保证金管理_安全保证金信息_修改',
param: '项目流水号=' + arguments[0] + '&保证金金额=' + arguments[1] + '&交付日期=' + arguments[2] + '&提前X天提醒=' + arguments[3] + '&预计收回日期=' + arguments[4] + '&备注=' + arguments[5] + '&安全保证金流水号=' + arguments[6]
param: '项目流水号=' + arguments[0] + '&保证金金额=' + arguments[1] + '&交付日期=' + arguments[2] + '&提前X天提醒=' + arguments[3] + '&执行进度流水号=' + arguments[4] + '&备注=' + arguments[5] + '&安全保证金流水号=' + arguments[6]
}
})
}
@@ -74,7 +74,7 @@ export function delSafetyMargin() {
data: {
type: '2',
name: '安全保证金管理_安全保证金信息_删除',
param: '安全保证金流水号=' + arguments[0]
param: '安全保证金流水号=' + arguments[0] + '&项目流水号=' + arguments[1]
}
})
}
@@ -112,3 +112,25 @@ export function TakeBack() {
}
})
}
export function searchTableDataProject(pageCurrent, pageSize, num1, num2, num3, num4, num5, num6) {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '合同信息管理_安全保证金_合同信息统计_查询',
param: '项目流水号=' + num1 + '=int&项目流水号_check=' + num2 + '=int&开始日期_check=' + num3 + '=int&结束日期_check=' + num4 + '=int&开始日期=' + num5 + '=date&结束日期=' + num6 + '=date',
Pagination: pageCurrent + '&' + pageSize
}
})
}
export function executionProgressID() {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '合同信息管理_执行进度_查询'
}
})
}

View File

@@ -2,9 +2,9 @@
<div class="app-container">
<!--顶栏结构-->
<el-card>
<el-radio v-model="radio" label="1">未收回</el-radio>
<el-radio v-model="radio" label="2">已收回</el-radio>
<span style="margin-left: 20px">项目名称</span>
<!--<el-radio v-model="radio" label="1">未收回</el-radio>-->
<!--<el-radio v-model="radio" label="2">已收回</el-radio>-->
<span>项目名称</span>
<el-select v-model="entryNameValue" clearable filterable placeholder="项目名称:" size="small" style="margin-left: 10px">
<el-option
v-for="item in entryName"
@@ -12,38 +12,143 @@
:label="item.label"
:value="item.value"/>
</el-select>
<el-button type="success" icon="el-icon-search" size="small" style="margin-left: 10px" @click="PageSize = 10;PageCurrent = 1;fetchTableData1()">查询</el-button>
<el-button type="primary" icon="el-icon-circle-plus-outline" size="small" style="margin-left: 10px;margin-right: 15px" @click="addSafetyMargin();flag1 = 1">增加</el-button>
<span>预警颜色说明</span>
<el-tag type="info">未到时间</el-tag>
<el-tag type="warning">即将拖期</el-tag>
<el-tag type="danger">已拖期</el-tag>
<el-tag type="success">已收回</el-tag>
<span style="margin-left: 10px">开始日期</span>
<el-date-picker
v-model="startTime"
style="width: 200px;"
value-format="yyyy-MM-dd"
size="small"
type="date"
placeholder="请选择开始日期"/>
<span style="margin-left: 10px">结束日期</span>
<el-date-picker
v-model="endTime"
style="width: 200px;"
value-format="yyyy-MM-dd"
size="small"
type="date"
placeholder="请选择结束日期"/>
<el-button type="success" icon="el-icon-search" size="small" style="margin-left: 10px" @click="PageSizeProject = 10;PageCurrentProject = 1;searchTableDataProject()">查询</el-button>
<!--<span>预警颜色说明</span>-->
<!--<el-tag type="info">未到时间</el-tag>-->
<!--<el-tag type="warning">即将拖期</el-tag>-->
<!--<el-tag type="danger">已拖期</el-tag>-->
<!--<el-tag type="success">已收回</el-tag>-->
</el-card>
<!--安全保证金表格-->
<el-card>
<el-table
v-loading="tableData1Loading"
:row-style="tableRowClassName"
:data="tableData1"
v-loading="listLoadingProject"
:data="projectTableData"
style="width: 100%"
height="400"
border
@row-click="fetchTableData2">
<el-table-column align="center" label="项目名称" width="300">
size="mini"
highlight-current-row
@row-click="fetchTableData1">
<el-table-column align="center" label="合同编号" width="200">
<template slot-scope="scope">
<el-tag type="primary">{{ scope.row.合同编号 }}</el-tag>
</template>
</el-table-column>
<el-table-column align="center" label="项目名称" width="200">
<template slot-scope="scope">
{{ scope.row.项目名称 }}
</template>
</el-table-column>
<el-table-column align="center" label="交付日期" width="100">
<el-table-column align="center" label="已完成进度" width="100">
<template slot-scope="scope">
{{ scope.row.执行进度名 }}
</template>
</el-table-column>
<el-table-column align="center" label="合同签订日期">
<template slot-scope="scope">
{{ scope.row.合同签订日期 }}
</template>
</el-table-column>
<el-table-column align="center" label="销售经理" width="80">
<template slot-scope="scope">
{{ scope.row.姓名 }}
</template>
</el-table-column>
<el-table-column align="center" label="客户名称">
<template slot-scope="scope">
{{ scope.row.客户名称 }}
</template>
</el-table-column>
<el-table-column align="center" label="联系人" width="80">
<template slot-scope="scope">
{{ scope.row.联系人 }}
</template>
</el-table-column>
<el-table-column align="center" label="联系电话" width="100">
<template slot-scope="scope">
{{ scope.row.电话 }}
</template>
</el-table-column>
<el-table-column align="center" label="合同信息备注">
<template slot-scope="scope">
{{ scope.row.合同信息备注 }}
</template>
</el-table-column>
<el-table-column label="操作" fixed="right" align="center" width="125px">
<template slot-scope="scope">
<el-button
:disabled="scope.row.是否禁用增加安全保证金"
size="mini"
type="primary"
icon="el-icon-circle-plus-outline"
@click.stop="addSafetyMargin(scope.row);flag1 = 1">安全保证金
</el-button>
</template>
</el-table-column>
</el-table>
<div class="block" style="margin-top: 10px;">
<el-pagination
:current-page="PageCurrentProject"
:page-sizes="[10, 20, 30, 40]"
:page-size="PageSizeProject"
:total="totalProject"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChangeProject"
@current-change="handleCurrentChangeProject"/>
</div>
</el-card>
<!--安全保证金表格-->
<el-card>
<span style="float: right; margin-bottom: 15px">安全保证金记录</span>
<el-table
v-loading="tableData1Loading"
:data="tableData1"
style="width: 100%"
height="79"
border
size="mini"
@row-click="fetchTableData2">
<!--<el-table-column align="center" label="项目名称" width="300">-->
<!--<template slot-scope="scope">-->
<!--{{ scope.row.项目名称 }}-->
<!--</template>-->
<!--</el-table-column>-->
<el-table-column align="center" label="保证金金额" width="100">
<template slot-scope="scope">
<el-tag type="primary" size="small">{{ scope.row.保证金金额 }}</el-tag>
</template>
</el-table-column>
<el-table-column align="center" label="交付日期" width="120">
<template slot-scope="scope">
{{ scope.row.交付日期 }}
</template>
</el-table-column>
<el-table-column align="center" label="保证金金额" width="100">
<el-table-column align="center" label="收回条件" width="100">
<template slot-scope="scope">
{{ scope.row.保证金金额 }}
{{ scope.row.执行进度名 }}
</template>
</el-table-column>
<el-table-column align="center" label="截止时间(天)" width="120">
<template slot-scope="scope">
{{ scope.row.提前x天提醒 }}天内收回
</template>
</el-table-column>
<el-table-column align="center" label="扣款金额" width="100">
@@ -51,27 +156,54 @@
{{ scope.row.扣款金额 }}
</template>
</el-table-column>
<el-table-column :label="AmountReceivable" align="center" width="100">
<el-table-column :label="AmountReceivable" align="center" width="120">
<template slot-scope="scope">
{{ scope.row.应收回金额 }}
</template>
</el-table-column>
<el-table-column align="center" label="计划收回日期" width="150">
<el-table-column label="实际收回金额" align="center" width="120">
<template slot-scope="scope">
{{ scope.row.预计收回日期 }}
{{ scope.row.实际收回日期 === '' || scope.row.实际收回日期 === null ? '0' : scope.row.应收回金额 }}
</template>
</el-table-column>
<el-table-column align="center" label="实际收回日期" width="150">
<!--<el-table-column align="center" label="计划收回日期" width="150">-->
<!--<template slot-scope="scope">-->
<!--{{ scope.row.预计收回日期 }}-->
<!--</template>-->
<!--</el-table-column>-->
<el-table-column align="center" label="是否收回" width="100">
<template slot-scope="scope">
{{ scope.row.实际收回日期 }}
<el-tag v-if="parseInt(scope.row.是否收回) === 2" slot="reference" size="small" type="success" style="width: 66px">已收回</el-tag>
<el-tag v-else-if="parseInt(scope.row.是否收回) === 1" slot="reference" type="danger" size="small" style="width: 66px">未收回</el-tag>
</template>
</el-table-column>
<el-table-column align="center" label="状态" width="120">
<el-table-column align="center" label="实际收回日期" width="130">
<template slot-scope="scope">
<div v-if="scope.row.状态 === '0'">未到预警时间</div>
<div v-else-if="scope.row.状态 === '1'">即将拖期</div>
<div v-else-if="scope.row.状态 === '2'">已拖期</div>
<div v-else >已收回</div>
{{ scope.row.实际收回日期 === '' || scope.row.实际收回日期 === null ? '未收回' : scope.row.实际收回日期 }}
</template>
</el-table-column>
<el-table-column align="center" label="状态" width="100">
<template slot-scope="scope">
<el-popover
placement="top-start"
title="收回计划"
width="200"
trigger="hover">
<div v-show="(scope.row.预计收回日期 === '' || scope.row.预计收回日期 === null) && parseInt(scope.row.是否收回)!== 2 " style="text-align: center">
<h4>{{ scope.row.执行进度名 }} 未完成</h4>
</div>
<div v-show="scope.row.预计收回日期 !== '' && scope.row.预计收回日期 !== null && parseInt(scope.row.是否收回)!== 2">
<h4>{{ scope.row.执行进度名 }}{{ scope.row.节点日期 }}完成计划于{{ scope.row.预计收回日期 }}进行收款距离计划截止还剩{{ parseInt(scope.row.剩余天数) > 0 ? scope.row.剩余天数 : 0 }}</h4>
</div>
<div v-show="parseInt(scope.row.是否收回)=== 2 " style="text-align: center">
<h4>已于{{ scope.row.实际收回日期 }}收回</h4>
</div>
<el-tag v-if="scope.row.预计收回日期!==''&& scope.row.预计收回日期!==null && parseInt(scope.row.是否收回) === 1 && parseInt(scope.row.状态) === 1" slot="reference" size="small" type="warning" style="width: 66px">即将拖期</el-tag>
<el-tag v-else-if="scope.row.预计收回日期!==''&& scope.row.预计收回日期!==null &&parseInt(scope.row.是否收回) === 1 && parseInt(scope.row.状态) === 2" slot="reference" type="danger" size="small" style="width: 66px">已经拖期</el-tag>
<el-tag v-else-if="scope.row.预计收回日期!==''&& scope.row.预计收回日期!==null &&parseInt(scope.row.是否收回) === 1 && parseInt(scope.row.状态) === 0" slot="reference" type="primer" size="small" style="width: 66px">无计划</el-tag>
<el-tag v-else-if="scope.row.预计收回日期!==''&& scope.row.预计收回日期!==null &&parseInt(scope.row.是否收回) === 2" slot="reference" type="success" size="small" style="width: 66px">已完成</el-tag>
<el-tag v-else-if="scope.row.预计收回日期===''||scope.row.预计收回日期===null" slot="reference" size="small" style="width: 66px">进度未完</el-tag>
</el-popover>
</template>
</el-table-column>
<el-table-column align="center" label="备注">
@@ -79,7 +211,7 @@
{{ scope.row.备注 }}
</template>
</el-table-column>
<el-table-column label="操作" fixed="right" align="center" width="400">
<el-table-column label="操作" fixed="right" align="center" width="370">
<template slot-scope="scope">
<el-button
:disabled="disabled"
@@ -108,7 +240,7 @@
</template>
</el-table-column>
</el-table>
<div class="block" style="margin-top: 10px;">
<div v-show="false" class="block" style="margin-top: 10px;">
<el-pagination
:current-page="PageCurrent"
:page-sizes="[10, 20, 30, 40]"
@@ -119,16 +251,16 @@
@current-change="handleCurrentChange"/>
</div>
</el-card>
<!--扣款记录表格-->
<el-card>
<span style="float: right">扣款记录</span>
<span style="float: right; margin-bottom: 15px">扣款记录</span>
<el-table
v-loading="tableData2Loading"
:data="tableData2"
style="width: 100%;margin-top: 15px"
height="230"
border>
border
size="mini">
<el-table-column align="center" label="扣款金额">
<template slot-scope="scope">
{{ scope.row.扣款金额 }}
@@ -177,29 +309,17 @@
@current-change="handleCurrentChange2"/>
</div>
</el-card>
<!--新增编辑保证金信息对话框-->
<el-dialog :title="title" :visible.sync="dialogFormVisible1" center style="min-height: 300px" width="800px">
<el-form ref="form" :model="form" :rules="rules1" label-position="left" label-width="120px" class="demo-ruleForm">
<el-row>
<el-col :span="12">
<el-form-item label="项目名称" prop="项目名称">
<el-select v-model="form.项目名称" clearable filterable placeholder="请选择项目:" size="small">
<el-option
v-for="item in entryName1"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="保证金金额" prop="保证金金额">
<el-input v-model="form.保证金金额" size="small" placeholder="请输入保证金金额" style="width:200px"/>
<el-input-number v-model="form.保证金金额" :precision="2" :step="0.1" style="width: 200px" size="small"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="交付日期" prop="交付日期">
<el-form-item label="缴纳日期" prop="交付日期">
<el-date-picker
v-model="form.交付日期"
style="width: 200px;"
@@ -209,25 +329,40 @@
placeholder="请选择交付日期"/>
</el-form-item>
</el-col>
</el-row>
<!--<el-col :span="12">-->
<!--<el-form-item label="计划收回日期" prop="预计收回日期">-->
<!--<el-date-picker-->
<!--v-model="form.预计收回日期"-->
<!--style="width: 200px;"-->
<!--value-format="yyyy-MM-dd"-->
<!--size="small"-->
<!--type="date"-->
<!--placeholder="请选择计划收回日期"/>-->
<!--</el-form-item>-->
<!--</el-col>-->
<el-row>
<el-col :span="12">
<el-form-item label="计划收回日期" prop="预计收回日期">
<el-date-picker
v-model="form.预计收回日期"
style="width: 200px;"
value-format="yyyy-MM-dd"
size="small"
type="date"
placeholder="请选择计划收回日期"/>
<el-form-item label="收回条件" prop="收回条件">
<el-select v-model="form.收回条件" filterable placeholder="请选择收回条件" style="width: 200px" size="small">
<el-option
v-for="item in plannedTime"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="提前X天提醒我" prop="提前X天提醒我">
<el-input v-model="form.提前X天提醒我" size="small" placeholder="提前X天提醒我" style="width:200px"/>
<el-form-item label="截止时间(天)" prop="提前X天提醒我">
<el-input-number v-model="form.提前X天提醒我" placeholder="请输入截止时间" style="width: 200px" size="small"/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="备注" prop="备注">
<el-input v-model="form.备注" size="small" placeholder="请输入备注" style="width:200px"/>
<el-input v-model="form.备注" type="textarea" autosize size="small" placeholder="请输入备注" style="width:575px"/>
</el-form-item>
</el-col>
</el-row>
@@ -366,7 +501,7 @@
<script>
import elInput from 'element-ui/packages/input'
import { initProject, searchTable1, searchTable2, addSafetyMargin, editSafetyMargin, delSafetyMargin, Withdrawing, delWithdrawing, edtWithdrawing, TakeBack } from '@/api/MarketingCenter/SafetyMargin'
import { initProject, searchTable1, searchTable2, addSafetyMargin, editSafetyMargin, delSafetyMargin, Withdrawing, delWithdrawing, edtWithdrawing, TakeBack, searchTableDataProject, executionProgressID } from '@/api/MarketingCenter/SafetyMargin'
export default {
components: {
elInput
@@ -374,12 +509,23 @@ export default {
data() {
const validateValue = (rule, value, callback) => {
if (value === 0) {
callback(new Error('金额不能为0或大于剩余保证金金额'))
callback(new Error('金额不能为0'))
} else {
callback()
}
}
return {
listLoadingProject: false, // 项目信息加载动画
projectTableData: [], // 项目信息表格
startTime: '', // 开始时间
endTime: '', // 结束时间
PageCurrentProject: 1, // 项目信息表格翻页
PageSizeProject: 10, // 项目信息表格每页显示条数
totalProject: null, // 总条数
plannedTime: [], // 执行情况
entryNameValue_check: '',
startTime_check: '',
endTime_check: '',
disabled: false,
AmountReceivable: '应收回金额',
WithdrawingCode: '',
@@ -390,8 +536,8 @@ export default {
projectCode: '',
projectName: '',
flag1: null,
entryName: '', // 项目名称
entryNameValue: [], // 项目名称数组
entryName: [], // 项目名称
entryNameValue: '', // 项目名称数组
tableData1: [], // 安全保证金信息表数组
tableData2: [], // 安全保证金信息表数组
tableData1Loading: false, // 安全保证金信息表加载动画
@@ -416,7 +562,8 @@ export default {
保证金金额: '',
交付日期: '',
预计收回日期: '',
提前X天提醒我: ''
提前X天提醒我: 15,
收回条件: 1
},
form2: {
扣款金额: '',
@@ -436,9 +583,11 @@ export default {
},
rules1: { // 表单验证规则
项目名称: [{ required: true, message: '请选择项目', trigger: 'change' }],
保证金金额: [{ required: true, message: '请输入保证金金额', trigger: 'blur' }],
保证金金额: [{ required: true, message: '请输入保证金金额', trigger: 'blur' },
{ required: true, trigger: 'blur', validator: validateValue }],
交付日期: [{ required: true, message: '请选择交付日期', trigger: 'change' }],
预计收回日期: [{ required: true, message: '请选择预计收回日期', trigger: 'change' }],
收回条件: [{ required: true, message: '请选择收回条件', trigger: 'change' }],
提前X天提醒我: [{ required: true, message: '提前X天提醒我', trigger: 'blur' }]
},
rules2: { // 表单验证规则
@@ -462,22 +611,61 @@ export default {
},
created() {
this.init()
this.searchTableDataProject()
},
methods: {
init() {
this.getSelect(initProject, ['项目名称', '项目流水号'], 'entryName')
this.getSelect(initProject, ['项目名称', '项目流水号'], 'entryName1')
this.getSelect(executionProgressID, ['执行进度名', '执行进度ID'], 'plannedTime')
},
fetchTableData1() {
if (this.radio === '1') {
this.disabled = false
this.AmountReceivable = '应收回金额'
this.getTable(searchTable1, [this.PageCurrent, this.PageSize, this.entryNameValue, this.radio], ['tableData1', 'total', 'tableData1Loading'])
// 查询合同(项目)信息
searchTableDataProject() {
if (this.entryNameValue === '' || this.entryNameValue === null) {
this.entryNameValue_check = 0
} else {
this.disabled = true
this.AmountReceivable = '实收回金额'
this.getTable(searchTable1, [this.PageCurrent, this.PageSize, this.entryNameValue, this.radio], ['tableData1', 'total', 'tableData1Loading'])
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.listLoadingProject = true
searchTableDataProject(this.PageCurrentProject, this.PageSizeProject, this.entryNameValue, this.entryNameValue_check, this.startTime_check, this.endTime_check, this.startTime, this.endTime).then(response => {
this.tableData1 = []
this.tableData2 = []
this.listLoadingProject = false
const data = response.data
for (let i = 0; i < data.rows.length; i++) {
data.rows[i].合同签订日期 = data.rows[i].合同签订日期.substring(0, data.rows[i].合同签订日期.length - 8)
parseInt(data.rows[i].安全保证金类型) === 1 ? data.rows[i].是否禁用增加安全保证金 = true : data.rows[i].是否禁用增加安全保证金 = false
}
this.projectTableData = data.rows
this.totalProject = data.total
})
},
// 项目信息表格改变每页显示条数
handleSizeChangeProject(val) {
this.PageCurrentProject = 1
this.PageSizeProject = val
this.searchTableDataProject()
},
// 项目信息表格翻页
handleCurrentChangeProject(val) {
this.PageCurrentProject = val
this.searchTableDataProject()
},
fetchTableData1(row) {
this.projectCode = row.项目流水号
this.getTable(searchTable1, [this.PageCurrent, this.PageSize, this.projectCode], ['tableData1', 'total', 'tableData1Loading'])
this.tableData1 = []
this.tableData2 = []
},
fetchTableData2(row) {
this.code = row.安全保证金流水号
@@ -488,11 +676,15 @@ export default {
handleSizeChange(val) {
this.PageCurrent = 1
this.PageSize = val
this.fetchTableData1()
this.getTable(searchTable1, [this.PageCurrent, this.PageSize, this.projectCode], ['tableData1', 'total', 'tableData1Loading'])
this.tableData1 = []
this.tableData2 = []
},
handleCurrentChange(val) {
this.PageCurrent = val
this.fetchTableData1()
this.getTable(searchTable1, [this.PageCurrent, this.PageSize, this.projectCode], ['tableData1', 'total', 'tableData1Loading'])
this.tableData1 = []
this.tableData2 = []
},
handleSizeChange2(val) {
this.PageCurrent2 = 1
@@ -503,57 +695,46 @@ export default {
this.PageCurrent2 = val
this.fetchTableData2()
},
tableRowClassName({ row }) {
if (parseInt(row.是否收回) === 2) {
return 'background: #66cc33'
} else {
if (parseInt(row.状态) === 1) {
return 'background: #ffff66'
} else if (parseInt(row.状态) === 2) {
return 'background: #ff6666'
} else {
return ''
}
}
},
addSafetyMargin() {
addSafetyMargin(row) {
this.title = '增加'
this.dialogFormVisible1 = true
this.projectCode = row.项目流水号
this.addForm('form')
},
editSafetyMargin(row) {
this.editForm(row, 'form')
this.title = '编辑'
this.dialogFormVisible1 = true
this.form.项目名称 = parseInt(row.项目流水号)
this.form.保证金金额 = row.保证金金额
this.form.交付日期 = row.交付日期
this.form.预计收回日期 = row.预计收回日期
this.form.收回条件 = parseInt(row.执行进度流水号)
this.form.提前X天提醒我 = row.提前x天提醒
this.form.备注 = row.备注
this.code = row.安全保证金流水号
// this.projectCode = parseInt(row.项目流水号)
this.projectCode = row.项目流水号
},
addTableData1() {
addSafetyMargin(this.form.项目名称, this.form.保证金金额, this.form.交付日期, this.form.提前X天提醒我, this.form.预计收回日期, this.form.备注).then(response => {
addSafetyMargin(this.projectCode, this.form.保证金金额, this.form.交付日期, this.form.提前X天提醒我, this.form.收回条件, this.form.备注).then(response => {
this.dialogFormVisible1 = false
if (response.data[0].result === '1') {
this.$message.success('添加成功')
this.title = ''
this.fetchTableData1()
this.searchTableDataProject()
this.getTable(searchTable1, [this.PageCurrent, this.PageSize, this.projectCode], ['tableData1', 'total', 'tableData1Loading'])
this.tableData2 = []
} else {
this.$message.error('添加失败')
}
})
},
editTableData1() {
editSafetyMargin(this.form.项目名称, this.form.保证金金额, this.form.交付日期, this.form.提前X天提醒我, this.form.预计收回日期, this.form.备注, this.code).then(response => {
editSafetyMargin(this.projectCode, this.form.保证金金额, this.form.交付日期, this.form.提前X天提醒我, this.form.收回条件, this.form.备注, this.code).then(response => {
this.dialogFormVisible1 = false
if (response.data[0].result === '1') {
this.$message.success('信息更新成功')
this.fetchTableData1()
this.code = ''
this.projectCode = ''
this.searchTableDataProject()
this.getTable(searchTable1, [this.PageCurrent, this.PageSize, this.projectCode], ['tableData1', 'total', 'tableData1Loading'])
this.tableData2 = []
} else {
this.$message.error('信息更新失败')
}
@@ -589,12 +770,27 @@ export default {
this.dialogFormVisible4 = false
},
delSafetyMargin(row) {
this.deleteRow(delSafetyMargin, row.安全保证金流水号, function() { this.fetchTableData1() })
this.$confirm('此操作将永久删除该行, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
delSafetyMargin(row.安全保证金流水号, this.projectCode).then(response => {
if (response.data[0].result === '1') {
this.$message.success('删除成功')
this.searchTableDataProject()
this.getTable(searchTable1, [this.PageCurrent, this.PageSize, this.projectCode], ['tableData1', 'total', 'tableData1Loading'])
this.tableData2 = []
} else {
this.$message.error('数据占用')
}
})
})
},
delWithdrawing(row) {
function a() {
this.getTable(searchTable1, [this.PageCurrent, this.PageSize, this.projectCode], ['tableData1', 'total', 'tableData1Loading'])
this.getTable(searchTable2, [this.PageCurrent2, this.PageSize2, this.code], ['tableData2', 'total2', 'tableData2Loading'])
this.getTable(searchTable1, [this.PageCurrent, this.PageSize, this.entryNameValue, this.radio], ['tableData1', 'total', 'tableData1Loading'])
this.dialogFormVisible2 = false
}
this.deleteRow(delWithdrawing, row.扣款流水号, a)
@@ -614,7 +810,7 @@ export default {
if (response.data[0].result === '1') {
this.$message.success('扣款成功')
this.title = ''
this.getTable(searchTable1, [this.PageCurrent, this.PageSize, this.entryNameValue, this.radio], ['tableData1', 'total', 'tableData1Loading'])
this.getTable(searchTable1, [this.PageCurrent, this.PageSize, this.projectCode], ['tableData1', 'total', 'tableData1Loading'])
this.getTable(searchTable2, [this.PageCurrent2, this.PageSize2, this.code], ['tableData2', 'total2', 'tableData2Loading'])
} else {
this.$message.error('扣款失败')
@@ -636,7 +832,7 @@ export default {
this.dialogFormVisible3 = false
if (response.data[0].result === '1') {
this.$message.success('信息更新成功')
this.getTable(searchTable1, [this.PageCurrent, this.PageSize, this.entryNameValue, this.radio], ['tableData1', 'total', 'tableData1Loading'])
this.getTable(searchTable1, [this.PageCurrent, this.PageSize, this.projectCode], ['tableData1', 'total', 'tableData1Loading'])
this.getTable(searchTable2, [this.PageCurrent2, this.PageSize2, this.code], ['tableData2', 'total2', 'tableData2Loading'])
} else {
this.$message.error('信息更新失败')
@@ -654,7 +850,7 @@ export default {
this.dialogFormVisible4 = false
if (response.data[0].result === '1') {
this.$message.success('信息更新成功')
this.getTable(searchTable1, [this.PageCurrent, this.PageSize, this.entryNameValue, this.radio], ['tableData1', 'total', 'tableData1Loading'])
this.getTable(searchTable1, [this.PageCurrent, this.PageSize, this.projectCode], ['tableData1', 'total', 'tableData1Loading'])
} else {
this.$message.error('信息更新失败')
}