md
This commit is contained in:
parent
822506330b
commit
233b036465
@ -7,7 +7,7 @@
|
||||
<span slot="label">
|
||||
<span style="color: red">收退款类型</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="2">退款</el-radio>
|
||||
</el-radio-group>
|
||||
@ -338,7 +338,7 @@
|
||||
{{scope.row.hasApplyFee}}
|
||||
</template>
|
||||
</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">
|
||||
<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>
|
||||
@ -468,11 +468,13 @@ export default {
|
||||
initData() {
|
||||
|
||||
this.reset();
|
||||
|
||||
this.form.recType=1;
|
||||
this.form.payScope='1';
|
||||
this.form.payRelList=[];
|
||||
this.changePayScope();
|
||||
|
||||
this.form.recType=1;
|
||||
|
||||
console.log("===>initData2222===>",this.settleBillNo)
|
||||
if(this.settleBillNo){
|
||||
this.loading = true;
|
||||
@ -500,56 +502,71 @@ export default {
|
||||
totalFee=origFee
|
||||
|
||||
}
|
||||
this.form.payMoney = totalFee.toFixed(2);
|
||||
|
||||
if(this.form.recType==1){
|
||||
this.form.payMoney = totalFee.toFixed(2);
|
||||
}
|
||||
else if(this.form.recType==2){
|
||||
this.form.refundMoney = totalFee.toFixed(2);
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
async changePayScope(){
|
||||
if(this.form.payScope==1){
|
||||
this.form.payRelList=[];
|
||||
let hasPayMap = {}
|
||||
let resMap=await listHasPayMap({settleBillNo:this.settleBillNo});
|
||||
if(resMap.rows&&resMap.rows.length>0){
|
||||
for(let i=0;i<resMap.rows.length;i++){
|
||||
let item=resMap.rows[i];
|
||||
hasPayMap[item.billNo] = item.sumMoney
|
||||
}
|
||||
|
||||
// 收/ 退款
|
||||
if(this.form.payScope==1){
|
||||
this.form.payRelList=[];
|
||||
let hasPayMap = {}
|
||||
let resMap=await listHasPayMap({settleBillNo:this.settleBillNo});
|
||||
if(resMap.rows&&resMap.rows.length>0){
|
||||
for(let i=0;i<resMap.rows.length;i++){
|
||||
let item=resMap.rows[i];
|
||||
hasPayMap[item.billNo] = item.sumMoney
|
||||
}
|
||||
console.log("===>hasPayMap==>",hasPayMap);
|
||||
}
|
||||
console.log("===>hasPayMap==>",hasPayMap);
|
||||
|
||||
let qParam={
|
||||
settleBillNo:this.settleBillNo,
|
||||
pageNum:1,
|
||||
pageSize:2000
|
||||
}
|
||||
let qParam={
|
||||
settleBillNo:this.settleBillNo,
|
||||
pageNum:1,
|
||||
pageSize:2000
|
||||
}
|
||||
|
||||
// 查询子账单
|
||||
let res=await listEmisSettleSubBill(qParam);
|
||||
console.log("===>=res==>",res)
|
||||
if(res.code==200){
|
||||
res.rows.forEach(itemSubBill=>{
|
||||
let relItem={...itemSubBill};
|
||||
relItem.payMoney=itemSubBill.billFee;
|
||||
relItem.hasApplyFee=0;
|
||||
// 查询子账单
|
||||
let res=await listEmisSettleSubBill(qParam);
|
||||
console.log("===>=res==>",res)
|
||||
if(res.code==200){
|
||||
res.rows.forEach(itemSubBill=>{
|
||||
let relItem={...itemSubBill};
|
||||
relItem.payMoney=itemSubBill.billFee;
|
||||
relItem.hasApplyFee=0;
|
||||
|
||||
console.log("===>=hasPayMap1111==>",hasPayMap[itemSubBill.billNo])
|
||||
if(itemSubBill.billNo in hasPayMap){
|
||||
console.log("===>=hasPayMap1111==>",hasPayMap[itemSubBill.billNo])
|
||||
if(itemSubBill.billNo in hasPayMap){
|
||||
if(this.form.recType==1){
|
||||
relItem.hasApplyFee=hasPayMap[itemSubBill.billNo];
|
||||
relItem.payMoney=itemSubBill.billFee-hasPayMap[itemSubBill.billNo];
|
||||
}
|
||||
|
||||
|
||||
if(relItem.payMoney>0){
|
||||
this.form.payRelList.push(relItem);
|
||||
else if(this.form.recType==2){
|
||||
relItem.hasApplyFee=hasPayMap[itemSubBill.billNo];
|
||||
relItem.payMoney=hasPayMap[itemSubBill.billNo];
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
this.handleCalcFeeItem();
|
||||
|
||||
}else{
|
||||
if(relItem.payMoney>0){
|
||||
this.form.payRelList.push(relItem);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
this.handleCalcFeeItem();
|
||||
|
||||
}else{
|
||||
this.form.payRelList=[];
|
||||
}
|
||||
|
||||
this.form.payRelList=[];
|
||||
}
|
||||
},
|
||||
async addBillToApply(){
|
||||
this.form.payRelList=[];
|
||||
@ -585,8 +602,14 @@ export default {
|
||||
relItem.hasApplyFee=0;
|
||||
|
||||
if(relItem.billNo in hasPayMap){
|
||||
relItem.hasApplyFee=hasPayMap[itemSubBill.billNo];
|
||||
relItem.payMoney=relItem.billFee-hasPayMap[itemSubBill.billNo];
|
||||
if(this.form.recType==1){
|
||||
relItem.hasApplyFee=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){
|
||||
this.form.payRelList.push(relItem);
|
||||
@ -595,6 +618,9 @@ export default {
|
||||
this.handleCalcFeeItem();
|
||||
}
|
||||
},
|
||||
onRecTypeChange(){
|
||||
this.changePayScope();
|
||||
},
|
||||
onPayeeSelect(item){
|
||||
this.form.payMan=item;
|
||||
},
|
||||
@ -673,6 +699,9 @@ export default {
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
|
||||
// 必须要有金额才能保存
|
||||
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
if(this.form.tradeDate){
|
||||
|
||||
@ -38,8 +38,9 @@
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('交易时间')" align="center" prop="tradeDate" width="170" :show-overflow-tooltip="true" >
|
||||
<template slot-scope="scope">
|
||||
<span v-if="scope.row.recType == '1'">{{ scope.row.tradeDate }}</span>
|
||||
<span v-if="scope.row.recType == '2'">{{ scope.row.refundDate }}</span>
|
||||
<span>{{ scope.row.tradeDate }}</span>
|
||||
<!-- <span v-if="scope.row.recType == '1'">{{ scope.row.tradeDate }}</span> -->
|
||||
<!-- <span v-if="scope.row.recType == '2'">{{ scope.row.refundDate }}</span> -->
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('流水号')" align="center" prop="payId" width="170" :show-overflow-tooltip="true"/>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user