This commit is contained in:
linfso 2025-04-30 16:35:14 +08:00
parent 822506330b
commit 233b036465
2 changed files with 73 additions and 43 deletions

View File

@ -7,7 +7,7 @@
<span slot="label"> <span slot="label">
<span style="color: red">收退款类型</span> <span style="color: red">收退款类型</span>
</span> </span>
<el-radio-group v-model="form.recType"> <el-radio-group v-model="form.recType" @change="onRecTypeChange">
<el-radio :label="1">收款</el-radio> <el-radio :label="1">收款</el-radio>
<el-radio :label="2">退款</el-radio> <el-radio :label="2">退款</el-radio>
</el-radio-group> </el-radio-group>
@ -338,7 +338,7 @@
{{scope.row.hasApplyFee}} {{scope.row.hasApplyFee}}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="openBillMoney" :label="$t('收款金额')" align="center" width="120"> <el-table-column prop="openBillMoney" :label="$t('收/退款金额')" align="center" width="120">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input-number :min="0.00" :max="scope.row.canApplyFee" v-model="scope.row.payMoney" placeholder="" :controls="false" :precision="2" @blur="(val)=>handleCalcFeeItem(scope.row)" @keyup.enter.native="handleCalcFeeItem(scope.row)" > <el-input-number :min="0.00" :max="scope.row.canApplyFee" v-model="scope.row.payMoney" placeholder="" :controls="false" :precision="2" @blur="(val)=>handleCalcFeeItem(scope.row)" @keyup.enter.native="handleCalcFeeItem(scope.row)" >
<span slot="suffix">(CNY)</span> <span slot="suffix">(CNY)</span>
@ -468,11 +468,13 @@ export default {
initData() { initData() {
this.reset(); this.reset();
this.form.recType=1;
this.form.payScope='1'; this.form.payScope='1';
this.form.payRelList=[]; this.form.payRelList=[];
this.changePayScope(); this.changePayScope();
this.form.recType=1;
console.log("===>initData2222===>",this.settleBillNo) console.log("===>initData2222===>",this.settleBillNo)
if(this.settleBillNo){ if(this.settleBillNo){
this.loading = true; this.loading = true;
@ -500,10 +502,19 @@ export default {
totalFee=origFee totalFee=origFee
} }
if(this.form.recType==1){
this.form.payMoney = totalFee.toFixed(2); this.form.payMoney = totalFee.toFixed(2);
}
else if(this.form.recType==2){
this.form.refundMoney = totalFee.toFixed(2);
}
}, },
async changePayScope(){ async changePayScope(){
// 收/ 退款
if(this.form.payScope==1){ if(this.form.payScope==1){
this.form.payRelList=[]; this.form.payRelList=[];
let hasPayMap = {} let hasPayMap = {}
@ -533,9 +544,15 @@ export default {
console.log("===>=hasPayMap1111==>",hasPayMap[itemSubBill.billNo]) console.log("===>=hasPayMap1111==>",hasPayMap[itemSubBill.billNo])
if(itemSubBill.billNo in hasPayMap){ if(itemSubBill.billNo in hasPayMap){
if(this.form.recType==1){
relItem.hasApplyFee=hasPayMap[itemSubBill.billNo]; relItem.hasApplyFee=hasPayMap[itemSubBill.billNo];
relItem.payMoney=itemSubBill.billFee-hasPayMap[itemSubBill.billNo]; relItem.payMoney=itemSubBill.billFee-hasPayMap[itemSubBill.billNo];
} }
else if(this.form.recType==2){
relItem.hasApplyFee=hasPayMap[itemSubBill.billNo];
relItem.payMoney=hasPayMap[itemSubBill.billNo];
}
}
if(relItem.payMoney>0){ if(relItem.payMoney>0){
@ -547,9 +564,9 @@ export default {
this.handleCalcFeeItem(); this.handleCalcFeeItem();
}else{ }else{
this.form.payRelList=[]; this.form.payRelList=[];
} }
}, },
async addBillToApply(){ async addBillToApply(){
this.form.payRelList=[]; this.form.payRelList=[];
@ -585,9 +602,15 @@ export default {
relItem.hasApplyFee=0; relItem.hasApplyFee=0;
if(relItem.billNo in hasPayMap){ if(relItem.billNo in hasPayMap){
if(this.form.recType==1){
relItem.hasApplyFee=hasPayMap[itemSubBill.billNo]; relItem.hasApplyFee=hasPayMap[itemSubBill.billNo];
relItem.payMoney=relItem.billFee-hasPayMap[itemSubBill.billNo]; relItem.payMoney=relItem.billFee-hasPayMap[itemSubBill.billNo];
} }
else if(this.form.recType==2){
relItem.hasApplyFee=hasPayMap[itemSubBill.billNo];
relItem.payMoney=hasPayMap[itemSubBill.billNo];
}
}
if(relItem.payMoney>0){ if(relItem.payMoney>0){
this.form.payRelList.push(relItem); this.form.payRelList.push(relItem);
} }
@ -595,6 +618,9 @@ export default {
this.handleCalcFeeItem(); this.handleCalcFeeItem();
} }
}, },
onRecTypeChange(){
this.changePayScope();
},
onPayeeSelect(item){ onPayeeSelect(item){
this.form.payMan=item; this.form.payMan=item;
}, },
@ -673,6 +699,9 @@ export default {
}, },
/** 提交按钮 */ /** 提交按钮 */
submitForm() { submitForm() {
// 必须要有金额才能保存
this.$refs["form"].validate(valid => { this.$refs["form"].validate(valid => {
if (valid) { if (valid) {
if(this.form.tradeDate){ if(this.form.tradeDate){

View File

@ -38,8 +38,9 @@
</el-table-column> </el-table-column>
<el-table-column :label="$t('交易时间')" align="center" prop="tradeDate" width="170" :show-overflow-tooltip="true" > <el-table-column :label="$t('交易时间')" align="center" prop="tradeDate" width="170" :show-overflow-tooltip="true" >
<template slot-scope="scope"> <template slot-scope="scope">
<span v-if="scope.row.recType == '1'">{{ scope.row.tradeDate }}</span> <span>{{ scope.row.tradeDate }}</span>
<span v-if="scope.row.recType == '2'">{{ scope.row.refundDate }}</span> <!-- <span v-if="scope.row.recType == '1'">{{ scope.row.tradeDate }}</span> -->
<!-- <span v-if="scope.row.recType == '2'">{{ scope.row.refundDate }}</span> -->
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('流水号')" align="center" prop="payId" width="170" :show-overflow-tooltip="true"/> <el-table-column :label="$t('流水号')" align="center" prop="payId" width="170" :show-overflow-tooltip="true"/>