采购合同请款保留两位小时

This commit is contained in:
zhangdingyu
2019-11-13 10:11:26 +08:00
parent 5b6d7fdf35
commit 6948c1962d
2 changed files with 34 additions and 56 deletions

View File

@@ -158,55 +158,6 @@
</tr> </tr>
</table> </table>
</div> </div>
<!--
<el-table v-loading="" :data="contractDetail2" :summary-method="getSummaries" border style="margin-top:10px;max-height: 500px;" height="500px" size="mini" show-summary>
<el-table-column label="离线合同编号" align="center" min-width="150">
<template slot-scope="scope">
{{ scope.row.离线合同编号 }}
</template>
</el-table-column>
<el-table-column label="物料名称" align="center" min-width="150">
<template slot-scope="scope">
{{ scope.row.物料名称 }}
</template>
</el-table-column>
<el-table-column label="物料规格" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.物料规格 }}
</template>
</el-table-column>
<el-table-column label="物料型号" align="center" min-width="200">
<template slot-scope="scope">
{{ scope.row.物料型号 }}
</template>
</el-table-column>
<el-table-column label="数量" align="center" min-width="80">
<template slot-scope="scope">
{{ scope.row.数量 }}
</template>
</el-table-column>
<el-table-column label="单价" align="center" min-width="80" prop="单价">
<template slot-scope="scope">
{{ scope.row.单价 }}
</template>
</el-table-column>
<el-table-column label="合计" align="center" min-width="80" prop="合计">
<template slot-scope="scope">
{{ parseFloat(scope.row.单价||0) * parseInt(scope.row.数量||0) }}
</template>
</el-table-column>
<el-table-column label="交货期要求" align="center" min-width="100" prop="交货期要求">
<template slot-scope="scope">
{{ scope.row.交货期要求 }}
</template>
</el-table-column>
<el-table-column label="备注" align="center" min-width="80" prop="备注">
<template slot-scope="scope">
{{ scope.row.备注 }}
</template>
</el-table-column>
</el-table>
-->
</div> </div>
</template> </template>

View File

@@ -75,7 +75,7 @@
<el-table-column label="操作" align="center" width="200"> <el-table-column label="操作" align="center" width="200">
<template slot-scope="scope"> <template slot-scope="scope">
<el-popover placement="right" width="500" trigger="click"> <el-popover placement="right" width="500" trigger="click">
<el-table :data="gridData" highlight-current-row size="mini" show-summary @row-click="searchContract"> <el-table :data="gridData" :summary-method="getSummaries2" highlight-current-row size="mini" show-summary @row-click="searchContract">
<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">
@@ -84,12 +84,12 @@
</el-table-column> </el-table-column>
<el-table-column min-width="100" align="center" label="已付金额" prop="已付金额"> <el-table-column min-width="100" align="center" label="已付金额" prop="已付金额">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.已付金额 }} {{ parseFloat(scope.row.已付金额).toFixed(2) }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column min-width="100" align="center" label="请款金额" prop="请款金额"> <el-table-column min-width="100" align="center" label="请款金额" prop="请款金额">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.请款金额 }} {{ parseFloat(scope.row.请款金额).toFixed(2) }}
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@@ -200,17 +200,17 @@
</el-table-column> </el-table-column>
<el-table-column label="合同总额" align="center" width="80" prop="合同总额"> <el-table-column label="合同总额" align="center" width="80" prop="合同总额">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.合同总额 ? parseInt(scope.row.合同总额 * 100)/100 : '-' }} {{ scope.row.合同总额 ? (parseInt(scope.row.合同总额 * 100)/100).toFixed(2) : '-' }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="已付金额" align="center" width="80" prop="已付金额"> <el-table-column label="已付金额" align="center" width="80" prop="已付金额">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.已付金额 }} {{ parseFloat(scope.row.已付金额).toFixed(2) }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="申请中金额" align="center" min-width="100" prop="申请中金额"> <el-table-column label="申请中金额" align="center" min-width="100" prop="申请中金额">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.申请中金额 }} {{ parseFloat(scope.row.申请中金额).toFixed(2) }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="请款金额" align="center" min-width="180" prop="请款金额"> <el-table-column label="请款金额" align="center" min-width="180" prop="请款金额">
@@ -219,7 +219,7 @@
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<span>合计<el-input v-model="SUM" readonly size="mini" style="width: 80px; margin: 10px 10px 0 10px"/></span> <span>合计<el-input v-model="SUM" readonly size="mini" style="width: 150px; margin: 10px 10px 0 10px"/></span>
<el-button type="primary" size="small" style="float:right;margin: 10px" icon="el-icon-check" @click="submitRequestFund">确定请款</el-button> <el-button type="primary" size="small" style="float:right;margin: 10px" icon="el-icon-check" @click="submitRequestFund">确定请款</el-button>
</el-dialog> </el-dialog>
@@ -367,6 +367,32 @@ export default {
}) })
return sums return sums
}, },
getSummaries2(param) { // 合计
const { columns, data } = param
const sums = []
columns.forEach((column, index) => {
if (index === 0) {
sums[index] = '总价'
return
} else if (index === 2 || index === 3) {
const values = data.map(item => Number(item[column.property]))
if (!values.every(value => isNaN(value))) {
sums[index] = values.reduce((prev, curr) => {
const value = Number(curr)
if (!isNaN(value)) {
return prev + curr
} else {
return prev
}
}, 0)
sums[index] = sums[index].toFixed(2) + ' 元'
} else {
sums[index] = 'N/A'
}
}
})
return sums
},
handleSizeChange1(val) { handleSizeChange1(val) {
this.pageSize1 = val this.pageSize1 = val
this.pageCurrent1 = 1 this.pageCurrent1 = 1
@@ -431,6 +457,7 @@ export default {
this.offGroup.push(val[i].采购合同流水号) this.offGroup.push(val[i].采购合同流水号)
this.sumGroup.push(val[i].请款金额) this.sumGroup.push(val[i].请款金额)
} }
this.SUM = parseFloat(this.SUM).toFixed(2)
}, },
submitRequestFund() { // 确认请款 submitRequestFund() { // 确认请款
if (this.supplierValue && this.contractGroup.length !== 0) { if (this.supplierValue && this.contractGroup.length !== 0) {