|
@@ -74,6 +74,13 @@
|
|
|
<el-input size="mini" type="number" v-model="scope.row.money"></el-input>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
+ <el-table-column align="left" label="折让金额" prop="" min-width="160" show-overflow-tooltip>
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <div v-if="scope.$index == 0"></div>
|
|
|
+ <el-input v-if="scope.$index == 1" size="mini" type="number" v-model="scope.row.allowanceAmount"></el-input>
|
|
|
+
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
<el-table-column align="left" label="备注" prop="" min-width="160" show-overflow-tooltip>
|
|
|
<template slot-scope="scope">
|
|
|
<el-input size="mini" v-model="scope.row.bz"></el-input>
|
|
@@ -121,6 +128,7 @@ export default {
|
|
|
name: "",
|
|
|
money: "",
|
|
|
bz: "",
|
|
|
+ allowanceAmount: "",
|
|
|
},
|
|
|
],
|
|
|
searchForm: {
|
|
@@ -208,7 +216,6 @@ export default {
|
|
|
let aa = res.data.filter(
|
|
|
(v) => v.customerWalletId != this.dataList[0].name
|
|
|
);
|
|
|
- console.log(aa);
|
|
|
this.$set(this.dataList[index], "typeList", aa);
|
|
|
} else {
|
|
|
this.$set(this.dataList[index], "typeList", res.data);
|
|
@@ -233,11 +240,11 @@ export default {
|
|
|
|
|
|
//保存
|
|
|
async preservationFn() {
|
|
|
- let receiverWalletRebateId;
|
|
|
- let initiatorWalletRebateId;
|
|
|
- let initiatorRemark;
|
|
|
- let receiverRemark;
|
|
|
- let amount;
|
|
|
+ // let receiverWalletRebateId;
|
|
|
+ // let initiatorWalletRebateId;
|
|
|
+ // let initiatorRemark;
|
|
|
+ // let receiverRemark;
|
|
|
+ // let amount;
|
|
|
|
|
|
await this.$refs.searchForm.validate();
|
|
|
|
|
@@ -246,6 +253,10 @@ export default {
|
|
|
this.$message.error("请输入返利金额");
|
|
|
return v;
|
|
|
}
|
|
|
+ if (v.allowanceAmount < 0 || v.money < 0) {
|
|
|
+ this.$message.error("金额必须为正数");
|
|
|
+ return v;
|
|
|
+ }
|
|
|
if (v.customerId == "") {
|
|
|
this.$message.error("请选择经销商");
|
|
|
return v;
|
|
@@ -260,41 +271,45 @@ export default {
|
|
|
return;
|
|
|
}
|
|
|
if (
|
|
|
- Number(this.dataList[0].money) + Number(this.dataList[1].money) !=
|
|
|
- 0
|
|
|
+ Number(this.dataList[0].money) !=
|
|
|
+ Number(this.dataList[1].money) +
|
|
|
+ Number(this.dataList[1].allowanceAmount)
|
|
|
) {
|
|
|
- this.$message.error("返利金额不等,请重新输入");
|
|
|
+ this.$message.error("转入转出金额不等,请重新输入");
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- if (this.dataList[0].money > 0) {
|
|
|
- receiverWalletRebateId = this.dataList[0].name;
|
|
|
- initiatorWalletRebateId = this.dataList[1].name;
|
|
|
- initiatorRemark = this.dataList[1].bz;
|
|
|
- receiverRemark = this.dataList[0].bz;
|
|
|
- amount = this.dataList[0].money;
|
|
|
- } else {
|
|
|
- receiverWalletRebateId = this.dataList[1].name;
|
|
|
- initiatorWalletRebateId = this.dataList[0].name;
|
|
|
- initiatorRemark = this.dataList[0].bz;
|
|
|
- receiverRemark = this.dataList[1].bz;
|
|
|
- amount = this.dataList[1].money;
|
|
|
- }
|
|
|
- await getTransferAdd({
|
|
|
- theTime: this.searchForm.theTime,
|
|
|
- receiverWalletRebateId,
|
|
|
- initiatorWalletRebateId,
|
|
|
- receiverRemark,
|
|
|
- initiatorRemark,
|
|
|
- amount: amount * 1,
|
|
|
- });
|
|
|
+ // if (this.dataList[0].money > 0) {
|
|
|
+ // receiverWalletRebateId = this.dataList[0].name;
|
|
|
+ // initiatorWalletRebateId = this.dataList[1].name;
|
|
|
+ // initiatorRemark = this.dataList[1].bz;
|
|
|
+ // receiverRemark = this.dataList[0].bz;
|
|
|
+ // amount = this.dataList[0].money;
|
|
|
+ // } else {
|
|
|
+ // receiverWalletRebateId = this.dataList[1].name;
|
|
|
+ // initiatorWalletRebateId = this.dataList[0].name;
|
|
|
+ // initiatorRemark = this.dataList[0].bz;
|
|
|
+ // receiverRemark = this.dataList[1].bz;
|
|
|
+ // amount = this.dataList[1].money;
|
|
|
+ // }
|
|
|
+
|
|
|
+ let params = {
|
|
|
+ amount: this.dataList[1].money,
|
|
|
+ initiatorAmount: this.dataList[0].money,
|
|
|
+ initiatorWalletRebateId: this.dataList[0].name,
|
|
|
+ receiverWalletRebateId: this.dataList[1].name,
|
|
|
+ allowanceAmount: this.dataList[1].allowanceAmount,
|
|
|
+ initiatorRemark: this.dataList[0].bz,
|
|
|
+ receiverRemark: this.dataList[1].bz,
|
|
|
+ };
|
|
|
+
|
|
|
+ await getTransferAdd(params);
|
|
|
|
|
|
this.$router.push("/finance/rebate/change_list");
|
|
|
this.$message.success("申请成功");
|
|
|
},
|
|
|
async getUserInfoFn() {
|
|
|
const res = await getUserInfo({ adminUserId: this.userid });
|
|
|
- console.log(res, 1);
|
|
|
this.searchForm.customerNumber = res.data.customerNumber;
|
|
|
this.dataList[0].customerId = res.data.customerId;
|
|
|
this.searchForm.customerName = res.data.customerName;
|