|
@@ -246,7 +246,7 @@
|
|
|
v-model="scope.row.walletRebateId"
|
|
|
placeholder="请选择返利类型"
|
|
|
@change="handelRebateList($event, scope.$index, scope.row)"
|
|
|
- @remove-tag="handleRemove2($event, scope.$index, scope.row)"
|
|
|
+ @remove-tag="handleRemove2($event, scope.$index, scope.row)"
|
|
|
>
|
|
|
<el-option
|
|
|
v-for="(item, index) in scope.row.rebateList"
|
|
@@ -344,7 +344,9 @@
|
|
|
clearable
|
|
|
v-model="scope.row.walletsId"
|
|
|
@change="handelWallets($event, scope.$index, scope.row)"
|
|
|
- @remove-tag="handleRemove($event, scope.$index, scope.row)"
|
|
|
+ @remove-tag="
|
|
|
+ handleRemove($event, scope.$index, scope.row)
|
|
|
+ "
|
|
|
placeholder="请选择现金钱包"
|
|
|
>
|
|
|
<el-option
|
|
@@ -361,7 +363,9 @@
|
|
|
clearable
|
|
|
v-model="scope.row.walletsId"
|
|
|
@change="handelWallets($event, scope.$index, scope.row)"
|
|
|
- @remove-tag="handleRemove($event, scope.$index, scope.row)"
|
|
|
+ @remove-tag="
|
|
|
+ handleRemove($event, scope.$index, scope.row)
|
|
|
+ "
|
|
|
placeholder="请选择现金钱包"
|
|
|
>
|
|
|
<el-option
|
|
@@ -967,77 +971,74 @@ export default {
|
|
|
this.$set(this.items[index], "rebateList", rebateList);
|
|
|
// this.fang = false;
|
|
|
},
|
|
|
- resArr(arr1, arr2) {
|
|
|
+ resArr(arr1, arr2) {
|
|
|
return arr1.filter((v) => arr2.every((val) => val.id != v.id));
|
|
|
},
|
|
|
// xua
|
|
|
- handelWallets(e, index, row) {
|
|
|
- console.log(row,'kjkj4545');
|
|
|
+ handelWallets(e, index, row) {
|
|
|
+ console.log(row, "kjkj4545");
|
|
|
let id = row.cid || row.updPriceBillId;
|
|
|
- if (e && e.length) {
|
|
|
- for (let i = 0; i < e.length; i++) {
|
|
|
- if (!this.wall1.includes(e[e.length - 1])) {
|
|
|
- this.$set(row, 'wallets',[
|
|
|
- ...row.wallets,
|
|
|
- {
|
|
|
- type: "COMMONLY",
|
|
|
- id: "",
|
|
|
- updPriceBillId: id,
|
|
|
- updPriceBillItemId: id,
|
|
|
- walletId: e[e.length - 1],
|
|
|
- },
|
|
|
- ]);
|
|
|
- this.wall1.push(e[e.length - 1])
|
|
|
- }
|
|
|
- }
|
|
|
+ if (e && e.length) {
|
|
|
+ for (let i = 0; i < e.length; i++) {
|
|
|
+ if (!this.wall1.includes(e[e.length - 1])) {
|
|
|
+ this.$set(row, "wallets", [
|
|
|
+ ...row.wallets,
|
|
|
+ {
|
|
|
+ type: "COMMONLY",
|
|
|
+ id: "",
|
|
|
+ updPriceBillId: id,
|
|
|
+ updPriceBillItemId: id,
|
|
|
+ walletId: e[e.length - 1],
|
|
|
+ },
|
|
|
+ ]);
|
|
|
+ this.wall1.push(e[e.length - 1]);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
handleRemove(e, index, row) {
|
|
|
console.log(e);
|
|
|
- const copxyWall = JSON.parse(JSON.stringify(row.wallets))
|
|
|
- for (let i = 0; i < row.wallets.length; i++) {
|
|
|
- if (this.wall1.includes(e) && row.wallets[i].walletId==e) {
|
|
|
+ const copxyWall = JSON.parse(JSON.stringify(row.wallets));
|
|
|
+ for (let i = 0; i < row.wallets.length; i++) {
|
|
|
+ if (this.wall1.includes(e) && row.wallets[i].walletId == e) {
|
|
|
console.log(454);
|
|
|
|
|
|
- this.wall1.splice(i,1)
|
|
|
- copxyWall.splice(i,1)
|
|
|
- }
|
|
|
+ this.wall1.splice(i, 1);
|
|
|
+ copxyWall.splice(i, 1);
|
|
|
}
|
|
|
- this.$set(row,'wallets',copxyWall)
|
|
|
-
|
|
|
+ }
|
|
|
+ this.$set(row, "wallets", copxyWall);
|
|
|
},
|
|
|
- handleRemove2(e, index, row) {
|
|
|
- const copxyWall = JSON.parse(JSON.stringify(row.wallets))
|
|
|
- for (let i = 0; i < row.wallets.length; i++) {
|
|
|
- if (this.wall2.includes(e) && row.wallets[i].walletId==e) {
|
|
|
- copxyWall.splice(i,1)
|
|
|
- this.wall2.splice(i,1)
|
|
|
- }
|
|
|
+ handleRemove2(e, index, row) {
|
|
|
+ const copxyWall = JSON.parse(JSON.stringify(row.wallets));
|
|
|
+ for (let i = 0; i < row.wallets.length; i++) {
|
|
|
+ if (this.wall2.includes(e) && row.wallets[i].walletId == e) {
|
|
|
+ copxyWall.splice(i, 1);
|
|
|
+ this.wall2.splice(i, 1);
|
|
|
}
|
|
|
- this.$set(row,'wallets',copxyWall)
|
|
|
-
|
|
|
- }
|
|
|
-,
|
|
|
- handelRebateList(e, index, row) {
|
|
|
- console.log(row,'kjkj');
|
|
|
+ }
|
|
|
+ this.$set(row, "wallets", copxyWall);
|
|
|
+ },
|
|
|
+ handelRebateList(e, index, row) {
|
|
|
+ console.log(row, "kjkj");
|
|
|
let id = row.cid || row.updPriceBillId;
|
|
|
- if (e && e.length) {
|
|
|
- for (let i = 0; i < e.length; i++) {
|
|
|
- if (!this.wall2.includes(e[e.length - 1])) {
|
|
|
- this.$set(row, "wallets", [
|
|
|
- ...row.wallets,
|
|
|
- {
|
|
|
- type: "REBATE",
|
|
|
- id: "",
|
|
|
- updPriceBillId: id,
|
|
|
- updPriceBillItemId: id,
|
|
|
- walletId: e[e.length - 1],
|
|
|
- },
|
|
|
- ]);
|
|
|
- this.wall2.push(e[e.length - 1])
|
|
|
+ if (e && e.length) {
|
|
|
+ for (let i = 0; i < e.length; i++) {
|
|
|
+ if (!this.wall2.includes(e[e.length - 1])) {
|
|
|
+ this.$set(row, "wallets", [
|
|
|
+ ...row.wallets,
|
|
|
+ {
|
|
|
+ type: "REBATE",
|
|
|
+ id: "",
|
|
|
+ updPriceBillId: id,
|
|
|
+ updPriceBillItemId: id,
|
|
|
+ walletId: e[e.length - 1],
|
|
|
+ },
|
|
|
+ ]);
|
|
|
+ this.wall2.push(e[e.length - 1]);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
- }
|
|
|
},
|
|
|
handleUser(e) {
|
|
|
const adminCompany = this.userList.filter((k) => {
|
|
@@ -1212,25 +1213,23 @@ export default {
|
|
|
|
|
|
res.data.items[i].walletsId = [];
|
|
|
res.data.items[i].walletRebateId = [];
|
|
|
- res.data.items[i].rebateWallets = [];
|
|
|
+ res.data.items[i].rebateWallets = [];
|
|
|
res.data.items[i].wallets = [];
|
|
|
for (let p = 0; p < res.data.items[i].wallets2.length; p++) {
|
|
|
if (res.data.items[i].wallets2[p].type == "COMMONLY") {
|
|
|
walletIds.push(res.data.items[i].wallets2[p].walletId);
|
|
|
- this.$set(res.data.items[i],'wallets',[
|
|
|
+ this.$set(res.data.items[i], "wallets", [
|
|
|
...res.data.items[i].wallets,
|
|
|
- res.data.items[i].wallets2[p]
|
|
|
- ])
|
|
|
+ res.data.items[i].wallets2[p],
|
|
|
+ ]);
|
|
|
} else if (res.data.items[i].wallets2[p].type == "REBATE") {
|
|
|
walletRebateIds.push(res.data.items[i].wallets2[p].walletId);
|
|
|
- this.$set(res.data.items[i],'rebateWallets',[
|
|
|
+ this.$set(res.data.items[i], "rebateWallets", [
|
|
|
...res.data.items[i].rebateWallets,
|
|
|
- res.data.items[i].wallets2[p]
|
|
|
- ])
|
|
|
+ res.data.items[i].wallets2[p],
|
|
|
+ ]);
|
|
|
}
|
|
|
}
|
|
|
- this.$set(res.data.items[i], "walletsId", walletIds);
|
|
|
- this.$set(res.data.items[i], "walletRebateId", walletRebateIds);
|
|
|
|
|
|
this.rebateList.forEach((k) => {
|
|
|
k.saleTypes.forEach((j) => {
|
|
@@ -1238,18 +1237,26 @@ export default {
|
|
|
!linshi.includes(j.saleTypeId) &&
|
|
|
j.saleTypeId == res.data.items[i].saleTypeId
|
|
|
) {
|
|
|
- console.log(res.data.items[i].saleTypeId, "saleTypeId");
|
|
|
+ console.log(k, 998);
|
|
|
+
|
|
|
+ for (let w = 0; w < walletRebateIds.length; w++) {
|
|
|
+
|
|
|
+ if (walletRebateIds[w]!= k.walletRebateId) {
|
|
|
+ walletRebateIds.splice(w,1)
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
rebateList.push(k);
|
|
|
}
|
|
|
});
|
|
|
});
|
|
|
- console.log(rebateList,res.data.items[i].walletRebateId);
|
|
|
+ this.$set(res.data.items[i], "walletsId", walletIds);
|
|
|
+ this.$set(res.data.items[i], "walletRebateId", walletRebateIds);
|
|
|
res.data.items[i].walleList = this.walleList;
|
|
|
res.data.items[i].rebateList = rebateList;
|
|
|
res.data.items[i].fang = false;
|
|
|
}
|
|
|
|
|
|
-
|
|
|
this.items = res.data.items;
|
|
|
this.base = res.data;
|
|
|
this.listLoading = false;
|
|
@@ -1316,7 +1323,6 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
hanleSave() {
|
|
|
-
|
|
|
// for (let i = 0; i < this.items.length; i++) {
|
|
|
// // const wallets = []
|
|
|
// // if (this.items[i].wallets.length) {
|
|
@@ -1330,7 +1336,7 @@ export default {
|
|
|
|
|
|
// }
|
|
|
handleEdit({
|
|
|
- ...this.base,
|
|
|
+ ...this.base,
|
|
|
items: this.items,
|
|
|
saleTypeId: this.saleTypeId,
|
|
|
adminWebsitId: this.adminWebsitId,
|