|
@@ -78,7 +78,9 @@
|
|
|
show-overflow-tooltip
|
|
|
>
|
|
|
<template slot-scope="scope">
|
|
|
+ <div v-if="scope.$index == 0">{{ searchForm.customerName }}</div>
|
|
|
<el-select
|
|
|
+ v-if="scope.$index == 1"
|
|
|
filterable
|
|
|
v-model="scope.row.customerId"
|
|
|
placeholder="请选择"
|
|
@@ -109,9 +111,9 @@
|
|
|
>
|
|
|
<el-option
|
|
|
v-for="item in scope.row.typeList"
|
|
|
- :key="item.id"
|
|
|
+ :key="item.customerWalletId"
|
|
|
:label="item.name"
|
|
|
- :value="item.id"
|
|
|
+ :value="item.customerWalletId"
|
|
|
>
|
|
|
</el-option>
|
|
|
</el-select>
|
|
@@ -169,7 +171,20 @@ export default {
|
|
|
data() {
|
|
|
return {
|
|
|
listLoading: false, // 列表加载loading
|
|
|
- dataList: [],
|
|
|
+ dataList: [
|
|
|
+ {
|
|
|
+ customerId: "",
|
|
|
+ name: "",
|
|
|
+ money: "",
|
|
|
+ bz: "",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ customerId: "",
|
|
|
+ name: "",
|
|
|
+ money: "",
|
|
|
+ bz: "",
|
|
|
+ },
|
|
|
+ ],
|
|
|
searchForm: {
|
|
|
customerId: "",
|
|
|
customerName: "",
|
|
@@ -186,19 +201,19 @@ export default {
|
|
|
this.getCustomerData();
|
|
|
},
|
|
|
methods: {
|
|
|
- func(arr, target) {
|
|
|
- var obj = {};
|
|
|
- for (var i = 0; i < arr.length; i++) {
|
|
|
- var item = arr[i].money;
|
|
|
- if (obj[item] === undefined) {
|
|
|
- var x = target - item;
|
|
|
- obj[x] = i;
|
|
|
- } else {
|
|
|
- return [obj[item], i];
|
|
|
- }
|
|
|
- }
|
|
|
- return null;
|
|
|
- },
|
|
|
+ // func(arr, target) {
|
|
|
+ // var obj = {};
|
|
|
+ // for (var i = 0; i < arr.length; i++) {
|
|
|
+ // var item = arr[i].money;
|
|
|
+ // if (obj[item] === undefined) {
|
|
|
+ // var x = target - item;
|
|
|
+ // obj[x] = i;
|
|
|
+ // } else {
|
|
|
+ // return [obj[item], i];
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // return null;
|
|
|
+ // },
|
|
|
|
|
|
resetFn() {
|
|
|
this.dataList.forEach((v) => {
|
|
@@ -241,23 +256,42 @@ export default {
|
|
|
let initiatorRemark;
|
|
|
let receiverRemark;
|
|
|
let amount;
|
|
|
- let res = this.func(this.dataList, 0);
|
|
|
- console.log(res);
|
|
|
-
|
|
|
- if (this.dataList[res[0]].money > 0) {
|
|
|
- receiverWalletRebateId = this.dataList[res[0]].customerWalletId;
|
|
|
- initiatorWalletRebateId = this.dataList[res[1]].customerWalletId;
|
|
|
- receiverRemark = this.dataList[res[0]].bz;
|
|
|
- initiatorRemark = this.dataList[res[1]].bz;
|
|
|
- amount = this.dataList[res[0]].money;
|
|
|
+ // let res = this.func(this.dataList, 0);
|
|
|
+ // console.log(res);
|
|
|
+ // if (this.dataList[res[0]].money > 0) {
|
|
|
+ // receiverWalletRebateId = this.dataList[res[0]].customerWalletId;
|
|
|
+ // initiatorWalletRebateId = this.dataList[res[1]].customerWalletId;
|
|
|
+ // receiverRemark = this.dataList[res[0]].bz;
|
|
|
+ // initiatorRemark = this.dataList[res[1]].bz;
|
|
|
+ // amount = this.dataList[res[0]].money;
|
|
|
+ // } else {
|
|
|
+ // receiverWalletRebateId = this.dataList[res[1]].customerWalletId;
|
|
|
+ // initiatorWalletRebateId = this.dataList[res[0]].customerWalletId;
|
|
|
+ // receiverRemark = this.dataList[res[1]].bz;
|
|
|
+ // initiatorRemark = this.dataList[res[0]].bz;
|
|
|
+ // amount = this.dataList[res[1]].money;
|
|
|
+ // }
|
|
|
+ // await getTransferAdd({
|
|
|
+ // receiverWalletRebateId,
|
|
|
+ // initiatorWalletRebateId,
|
|
|
+ // receiverRemark,
|
|
|
+ // initiatorRemark,
|
|
|
+ // amount: amount * 1,
|
|
|
+ // });
|
|
|
+ console.log(this.dataList);
|
|
|
+ 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[res[1]].customerWalletId;
|
|
|
- initiatorWalletRebateId = this.dataList[res[0]].customerWalletId;
|
|
|
- receiverRemark = this.dataList[res[1]].bz;
|
|
|
- initiatorRemark = this.dataList[res[0]].bz;
|
|
|
- amount = this.dataList[res[1]].money;
|
|
|
+ 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({
|
|
|
receiverWalletRebateId,
|
|
|
initiatorWalletRebateId,
|
|
@@ -269,22 +303,21 @@ export default {
|
|
|
},
|
|
|
async getUserInfoFn() {
|
|
|
const res = await getUserInfo({ adminUserId: this.userid });
|
|
|
- console.log(res);
|
|
|
- this.searchForm.customerId = res.data.customerId;
|
|
|
+ console.log(res, 1);
|
|
|
+ this.searchForm.customerNumber = res.data.customerNumber;
|
|
|
+ this.dataList[0].customerId = res.data.customerId;
|
|
|
this.searchForm.customerName = res.data.customerName;
|
|
|
-
|
|
|
- const res2 = await getWalletCustomerList({
|
|
|
- customerId: res.data.customerId,
|
|
|
- type: "REBATE",
|
|
|
- });
|
|
|
- console.log(res2);
|
|
|
-
|
|
|
- res2.data.forEach((v) => {
|
|
|
- v.money = "";
|
|
|
- v.bz = "";
|
|
|
- });
|
|
|
- this.dataList = res2.data;
|
|
|
- console.log(this.dataList);
|
|
|
+ // const res2 = await getWalletCustomerList({
|
|
|
+ // customerId: res.data.customerId,
|
|
|
+ // type: "REBATE",
|
|
|
+ // });
|
|
|
+ // console.log(res2, 5555);
|
|
|
+ // res2.data.forEach((v) => {
|
|
|
+ // v.money = "";
|
|
|
+ // v.bz = "";
|
|
|
+ // });
|
|
|
+ // this.dataList = res2.data;
|
|
|
+ // console.log(this.dataList);
|
|
|
},
|
|
|
},
|
|
|
};
|