|
|
@@ -13,7 +13,7 @@
|
|
|
<!-- 付款信息 -->
|
|
|
<headerTitle title="付款信息" size="16px"></headerTitle>
|
|
|
<div style="margin: 10px 0; font-size: 14px; color: #606266;">
|
|
|
- <span>预付金额:{{ row.amount || 0 }} 元</span>
|
|
|
+ <span>预付金额:{{ row.prepayTotalPrice || 0 }} 元</span>
|
|
|
<span style="margin-left: 20px;">已付金额:{{ paidAmount }} 元</span>
|
|
|
<span style="margin-left: 20px;">未付金额:{{ unpaidAmount }} 元</span>
|
|
|
</div>
|
|
|
@@ -38,14 +38,14 @@
|
|
|
:toolkit="[]"
|
|
|
>
|
|
|
<!-- 付款时间 -->
|
|
|
- <template v-slot:payTime="{ row: r, $index }">
|
|
|
+ <template v-slot:paidDate="{ row: r, $index }">
|
|
|
<el-form-item
|
|
|
- :prop="`tableData.${$index}.payTime`"
|
|
|
+ :prop="`tableData.${$index}.paidDate`"
|
|
|
:rules="{ required: true, message: '请选择付款时间', trigger: 'change' }"
|
|
|
class="table-form-item"
|
|
|
>
|
|
|
<el-date-picker
|
|
|
- v-model="r.payTime"
|
|
|
+ v-model="r.paidDate"
|
|
|
type="date"
|
|
|
placeholder="年/月/日"
|
|
|
value-format="yyyy-MM-dd"
|
|
|
@@ -55,14 +55,14 @@
|
|
|
</el-form-item>
|
|
|
</template>
|
|
|
<!-- 已付金额 -->
|
|
|
- <template v-slot:paidAmount="{ row: r, $index }">
|
|
|
+ <template v-slot:paidTotalPrice="{ row: r, $index }">
|
|
|
<el-form-item
|
|
|
- :prop="`tableData.${$index}.paidAmount`"
|
|
|
+ :prop="`tableData.${$index}.paidTotalPrice`"
|
|
|
:rules="{ required: true, message: '请输入已付金额', trigger: 'blur' }"
|
|
|
class="table-form-item"
|
|
|
>
|
|
|
<el-input
|
|
|
- v-model="r.paidAmount"
|
|
|
+ v-model="r.paidTotalPrice"
|
|
|
placeholder="请输入"
|
|
|
size="small"
|
|
|
@input="calcAmount"
|
|
|
@@ -70,27 +70,23 @@
|
|
|
</el-form-item>
|
|
|
</template>
|
|
|
<!-- 支付类型 -->
|
|
|
- <template v-slot:payType="{ row: r, $index }">
|
|
|
+ <template v-slot:paymentType="{ row: r, $index }">
|
|
|
<el-form-item
|
|
|
- :prop="`tableData.${$index}.payType`"
|
|
|
+ :prop="`tableData.${$index}.paymentType`"
|
|
|
:rules="{ required: true, message: '请选择支付类型', trigger: 'change' }"
|
|
|
class="table-form-item"
|
|
|
>
|
|
|
- <el-select
|
|
|
- v-model="r.payType"
|
|
|
+ <DictSelection
|
|
|
+ v-model="r.paymentType"
|
|
|
+ dictName="支付类型"
|
|
|
placeholder="请选择"
|
|
|
- size="small"
|
|
|
- style="width: 100%"
|
|
|
- >
|
|
|
- <el-option label="现金" value="现金"></el-option>
|
|
|
- <el-option label="银票" value="银票"></el-option>
|
|
|
- <el-option label="商票" value="商票"></el-option>
|
|
|
- </el-select>
|
|
|
+ class="payment-select"
|
|
|
+ />
|
|
|
</el-form-item>
|
|
|
</template>
|
|
|
<!-- 附件 -->
|
|
|
- <template v-slot:attachment="{ row: r }">
|
|
|
- <fileMain v-model="r.attachment" :limit="1"></fileMain>
|
|
|
+ <template v-slot:files="{ row: r }">
|
|
|
+ <fileMain v-model="r.files" :limit="1"></fileMain>
|
|
|
</template>
|
|
|
<!-- 备注 -->
|
|
|
<template v-slot:remark="{ row: r }">
|
|
|
@@ -126,6 +122,10 @@
|
|
|
<script>
|
|
|
import headerTitle from '@/components/header-title';
|
|
|
import fileMain from '@/components/addDoc/index.vue';
|
|
|
+ import {
|
|
|
+ getPrepaymentInfo,
|
|
|
+ saveDetailDetail
|
|
|
+ } from '@/api/financialManage/prepayment';
|
|
|
|
|
|
export default {
|
|
|
components: {
|
|
|
@@ -149,32 +149,32 @@
|
|
|
fixed: 'left'
|
|
|
},
|
|
|
{
|
|
|
- prop: 'payTime',
|
|
|
+ prop: 'paidDate',
|
|
|
label: '付款时间',
|
|
|
align: 'center',
|
|
|
minWidth: 160,
|
|
|
- slot: 'payTime'
|
|
|
+ slot: 'paidDate'
|
|
|
},
|
|
|
{
|
|
|
- prop: 'paidAmount',
|
|
|
+ prop: 'paidTotalPrice',
|
|
|
label: '已付金额',
|
|
|
align: 'center',
|
|
|
minWidth: 140,
|
|
|
- slot: 'paidAmount'
|
|
|
+ slot: 'paidTotalPrice'
|
|
|
},
|
|
|
{
|
|
|
- prop: 'payType',
|
|
|
+ prop: 'paymentType',
|
|
|
label: '支付类型',
|
|
|
align: 'center',
|
|
|
minWidth: 140,
|
|
|
- slot: 'payType'
|
|
|
+ slot: 'paymentType'
|
|
|
},
|
|
|
{
|
|
|
- prop: 'attachment',
|
|
|
+ prop: 'files',
|
|
|
label: '附件',
|
|
|
align: 'center',
|
|
|
minWidth: 120,
|
|
|
- slot: 'attachment'
|
|
|
+ slot: 'files'
|
|
|
},
|
|
|
{
|
|
|
prop: 'remark',
|
|
|
@@ -203,24 +203,24 @@
|
|
|
}, 0).toFixed(2);
|
|
|
},
|
|
|
unpaidAmount() {
|
|
|
- const total = parseFloat(this.row.amount) || 0;
|
|
|
+ const total = parseFloat(this.row.prepayTotalPrice) || 0;
|
|
|
const paid = parseFloat(this.paidAmount) || 0;
|
|
|
return (total - paid).toFixed(2);
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
- open(row) {
|
|
|
+ async open(row) {
|
|
|
this.visible = true;
|
|
|
- this.row = row || {};
|
|
|
- this.form.tableData = [];
|
|
|
+ this.info = await getPrepaymentInfo(row.id);
|
|
|
+ this.form.tableData = this.info.detailList || [];
|
|
|
},
|
|
|
|
|
|
addRow() {
|
|
|
this.form.tableData.push({
|
|
|
- payTime: '',
|
|
|
- paidAmount: '',
|
|
|
- payType: '',
|
|
|
- attachment: [],
|
|
|
+ paidDate: '',
|
|
|
+ paidTotalPrice: '',
|
|
|
+ paymentType: '',
|
|
|
+ files: [],
|
|
|
remark: ''
|
|
|
});
|
|
|
},
|
|
|
@@ -246,28 +246,34 @@
|
|
|
}
|
|
|
for (let i = 0; i < this.form.tableData.length; i++) {
|
|
|
const item = this.form.tableData[i];
|
|
|
- if (!item.payTime) {
|
|
|
+ if (!item.paidDate) {
|
|
|
this.$message.warning(`第${i + 1}行付款时间不能为空`);
|
|
|
return;
|
|
|
}
|
|
|
- if (!item.paidAmount) {
|
|
|
+ if (!item.paidTotalPrice) {
|
|
|
this.$message.warning(`第${i + 1}行已付金额不能为空`);
|
|
|
return;
|
|
|
}
|
|
|
- if (!item.payType) {
|
|
|
+ if (!item.paymentType) {
|
|
|
this.$message.warning(`第${i + 1}行支付类型不能为空`);
|
|
|
return;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
this.loading = true;
|
|
|
- // TODO: 调用付款保存接口
|
|
|
- setTimeout(() => {
|
|
|
+ const params = this.form.tableData.map(item => {
|
|
|
+ return {
|
|
|
+ ...item,
|
|
|
+ prepayId: this.row.id,
|
|
|
+ prepayCode: this.row.code,
|
|
|
+ }
|
|
|
+ })
|
|
|
+ saveDetailDetail(params).then(res => {
|
|
|
this.loading = false;
|
|
|
this.$message.success('付款成功');
|
|
|
this.updateVisible(false);
|
|
|
this.$emit('done');
|
|
|
- }, 500);
|
|
|
+ });
|
|
|
},
|
|
|
|
|
|
updateVisible(value) {
|