采购请款付款(制造)

This commit is contained in:
Vergil
2020-03-10 17:49:45 +08:00
parent f37dd57e61
commit a5f61aa3b8

View File

@@ -2,13 +2,18 @@
<div class="app-container"> <div class="app-container">
<el-card> <el-card>
<el-table v-loading="" :data="tableData" border stripe style="width: 100%;max-height: 500px;" height="300px" size="mini"> <el-table v-loading="" :data="tableData" border stripe style="width: 100%" height="600px" size="mini">
<el-table-column label="类别" align="center" width="70">
<template slot-scope="scope">
{{ scope.row.类别 }}
</template>
</el-table-column>
<el-table-column label="供应商" align="center" min-width="170"> <el-table-column label="供应商" align="center" min-width="170">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.供应商名称 }} {{ scope.row.供应商名称 }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="请款金额" align="center" min-width="100" prop="请款金额"> <el-table-column label="请款金额" align="right" min-width="100" prop="请款金额">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.请款金额 }} {{ scope.row.请款金额 }}
</template> </template>
@@ -26,7 +31,7 @@
<el-table-column label="审核" align="center" width="320"> <el-table-column label="审核" align="center" width="320">
<template slot-scope="scope"> <template slot-scope="scope">
<el-popover placement="right" width="400" trigger="click"> <el-popover placement="right" width="400" trigger="click">
<el-table :data="gridData1" stripe size="mini" show-summary> <el-table v-show="scope.row.类别==='采购'" :data="gridData1" stripe size="mini" show-summary>
<el-table-column width="50" align="center" type="index" label="序号"/> <el-table-column width="50" align="center" type="index" label="序号"/>
<el-table-column min-width="150" align="center" label="采购合同编号"> <el-table-column min-width="150" align="center" label="采购合同编号">
<template slot-scope="scope"> <template slot-scope="scope">
@@ -39,6 +44,37 @@
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<el-table v-show="scope.row.类别==='离线'" :data="gridData" stripe size="mini" show-summary>
<el-table-column width="50" align="center" type="index" label="序号"/>
<el-table-column min-width="150" align="center" label="离线合同编号">
<template slot-scope="scope">
{{ scope.row.离线合同编号 }}
</template>
</el-table-column>
<el-table-column min-width="100" align="center" label="合同总额" prop="请款金额">
<template slot-scope="scope">
{{ scope.row.请款金额 }}
</template>
</el-table-column>
</el-table>
<el-table v-show="scope.row.类别==='备料'" :data="gridData1" stripe size="mini" show-summary>
<el-table-column width="50" align="center" type="index" label="序号"/>
<el-table-column min-width="150" align="center" label="发票号">
<template slot-scope="scope">
{{ scope.row.发票号 }}
</template>
</el-table-column>
<el-table-column min-width="150" align="center" label="供应商名称">
<template slot-scope="scope">
{{ scope.row.供应商名称 }}
</template>
</el-table-column>
<el-table-column min-width="100" align="center" label="开票金额" prop="开票金额">
<template slot-scope="scope">
{{ scope.row.开票金额 }}
</template>
</el-table-column>
</el-table>
<el-button slot="reference" type="text" size="mini" icon="el-icon-search" style="margin-right: 10px" @click="searchTable01(scope.row)">查看详情</el-button> <el-button slot="reference" type="text" size="mini" icon="el-icon-search" style="margin-right: 10px" @click="searchTable01(scope.row)">查看详情</el-button>
</el-popover> </el-popover>
<el-button type="text" size="mini" icon="el-icon-check" @click="yesApproval(scope.row)">通过</el-button> <el-button type="text" size="mini" icon="el-icon-check" @click="yesApproval(scope.row)">通过</el-button>
@@ -58,7 +94,7 @@
@current-change="handleCurrentChange"/> @current-change="handleCurrentChange"/>
</div> </div>
</el-card> </el-card>
<el-card> <el-card v-if="false">
<el-table v-loading="" :data="tableData2" border stripe style="width: 100%;max-height: 300px;" height="300px" size="mini"> <el-table v-loading="" :data="tableData2" border stripe style="width: 100%;max-height: 300px;" height="300px" size="mini">
<el-table-column label="供应商" align="center" min-width="170"> <el-table-column label="供应商" align="center" min-width="170">
<template slot-scope="scope"> <template slot-scope="scope">
@@ -115,7 +151,7 @@
@current-change="handleCurrentChange2"/> @current-change="handleCurrentChange2"/>
</div> </div>
</el-card> </el-card>
<el-card> <el-card v-if="false">
<el-table v-loading="" :data="tableData3" border stripe style="width: 100%;max-height: 300px;" height="300px" size="mini"> <el-table v-loading="" :data="tableData3" border stripe style="width: 100%;max-height: 300px;" height="300px" size="mini">
<el-table-column label="供应商" align="center" min-width="170"> <el-table-column label="供应商" align="center" min-width="170">
<template slot-scope="scope"> <template slot-scope="scope">
@@ -213,7 +249,7 @@ export default {
]) ])
}, },
created() { created() {
this.fetchData() this.searchTable()
}, },
methods: { methods: {
fetchData() { fetchData() {
@@ -223,18 +259,68 @@ export default {
}, },
searchTable() { searchTable() {
initApproval1(this.pageCurrent, this.pageSize, 2).then(response => { initApproval1(this.pageCurrent, this.pageSize, 2).then(response => {
for (let j = 0; j < response.data.rows.length; j++) { if (response.data.rows.length !== 0) {
response.data.rows[j].含税总金额 = parseInt(response.data.rows[j].含税总金额 * 100) / 100 for (let i = 0; i < response.data.rows.length; i++) {
response.data.rows[j].欠款金额 = parseInt(response.data.rows[j].欠款金额 * 100) / 100 response.data.rows[i].含税总金额 = parseInt(response.data.rows[i].含税总金额 * 100) / 100
response.data.rows[i].欠款金额 = parseInt(response.data.rows[i].欠款金额 * 100) / 100
this.tableData.push({
采购合同请款流水号: response.data.rows[i].采购合同请款流水号,
供应商名称: response.data.rows[i].供应商名称,
请款金额: response.data.rows[i].请款金额,
姓名: response.data.rows[i].姓名,
请款时间: response.data.rows[i].请款时间,
类别: '采购'
})
}
} }
this.tableData = response.data.rows initApprovalOffline(this.pageCurrent2, this.pageSize2, 2).then(response2 => {
this.total = response.data.total if (response2.data.rows.length !== 0) {
for (let i = 0; i < response2.data.rows.length; i++) {
this.tableData.push({
离线合同请款流水号: response2.data.rows[i].离线合同请款流水号,
供应商名称: response2.data.rows[i].供应商名称,
请款金额: response2.data.rows[i].请款金额,
姓名: response2.data.rows[i].姓名,
请款时间: response2.data.rows[i].请款时间,
类别: '离线'
})
}
}
initApprovalMaterials(this.pageCurrent3, this.pageSize3, 2).then(response3 => {
if (response3.data.rows.length !== 0) {
for (let i = 0; i < response3.data.rows.length; i++) {
this.tableData.push({
采购计划请款流水号: response3.data.rows[i].采购计划请款流水号,
供应商名称: response3.data.rows[i].供应商名称,
请款金额: response3.data.rows[i].请款金额,
姓名: response3.data.rows[i].姓名,
请款时间: response3.data.rows[i].请款时间,
类别: '备料'
})
}
}
this.total = response.data.total + response2.data.total + response3.data.total
})
})
}) })
}, },
searchTable01(row) { // 查看详情(请款信息包含的合同) // 查看详情(请款信息包含的合同)
searchRequsetFundDetail3(row.采购合同请款流水号).then(response => { searchTable01(row) {
this.gridData1 = response.data this.gridData1 = []
}) this.gridData = []
if (row.类别 === '采购') {
searchRequsetFundDetail3(row.采购合同请款流水号).then(response => {
this.gridData1 = response.data
})
} else if (row.类别 === '离线') {
searchRequsetFundDetail(row.离线合同请款流水号).then(response => {
this.gridData = response.data
})
} else if (row.类别 === '备料') {
searchRequsetFundDetail1(row.采购计划请款流水号).then(response => {
this.gridData1 = response.data
})
}
}, },
handleSizeChange(val) { handleSizeChange(val) {
this.pageSize = val this.pageSize = val
@@ -293,12 +379,28 @@ export default {
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
execApproval(row.采购合同请款流水号, 1, '通过', this.id, 2).then(response => { if (row.类别 === '采购') {
if (response.data[0].result === '1') { execApproval(row.采购合同请款流水号, 1, '通过', this.id, 2).then(response => {
this.$message.success('执行成功') if (response.data[0].result === '1') {
this.searchTable() this.$message.success('执行成功')
} else { this.$message.error('执行失败') } this.searchTable()
}) } else { this.$message.error('执行失败') }
})
} else if (row.类别 === '离线') {
execApprovalOffline(row.离线合同请款流水号, 1, '通过', this.id, 2).then(response => {
if (response.data[0].result === '1') {
this.$message.success('执行成功')
this.searchTable2()
} else { this.$message.error('执行失败') }
})
} else if (row.类别 === '备料') {
execMaterials(row.采购计划请款流水号, 1, '通过', this.id, 2).then(response => {
if (response.data[0].result === '1') {
this.$message.success('执行成功')
this.searchTable3()
} else { this.$message.error('执行失败') }
})
}
}).catch(() => { }).catch(() => {
this.$message({ this.$message({
type: 'info', type: 'info',
@@ -311,12 +413,28 @@ export default {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消' cancelButtonText: '取消'
}).then(({ value }) => { }).then(({ value }) => {
execApproval(row.采购合同请款流水号, 2, value, this.id, 2).then(response => { if (row.类别 === '采购') {
if (response.data[0].result === '1') { execApproval(row.采购合同请款流水号, 2, value, this.id, 2).then(response => {
this.$message.success('执行成功') if (response.data[0].result === '1') {
this.searchTable() this.$message.success('执行成功')
} else { this.$message.error('执行失败') } this.searchTable()
}) } else { this.$message.error('执行失败') }
})
} else if (row.类别 === '离线') {
execApprovalOffline(row.离线合同请款流水号, 2, value, this.id, 2).then(response => {
if (response.data[0].result === '1') {
this.$message.success('执行成功')
this.searchTable2()
} else { this.$message.error('执行失败') }
})
} else if (row.类别 === '备料') {
execMaterials(row.采购计划请款流水号, 2, value, this.id, 2).then(response => {
if (response.data[0].result === '1') {
this.$message.success('执行成功')
this.searchTable3()
} else { this.$message.error('执行失败') }
})
}
}).catch(() => { }).catch(() => {
this.$message({ this.$message({
type: 'info', type: 'info',