|
@@ -270,7 +270,7 @@
|
|
|
@focus="handlePriceType(scope.row)"
|
|
|
>
|
|
|
<el-option
|
|
|
- v-for="item in priceList"
|
|
|
+ v-for="item in priceList2"
|
|
|
:key="item.priceTypeId"
|
|
|
:label="item.priceTypeName"
|
|
|
:value="item.priceTypeId"
|
|
@@ -306,7 +306,7 @@
|
|
|
</template>
|
|
|
<template v-else>
|
|
|
<el-select
|
|
|
- v-if="!priceList.length"
|
|
|
+ v-if="!priceList2.length"
|
|
|
v-model="scope.row.rebateWalletIds"
|
|
|
size="mini"
|
|
|
multiple
|
|
@@ -351,7 +351,7 @@
|
|
|
</template>
|
|
|
<template v-else>
|
|
|
<el-select
|
|
|
- v-if="!priceList.length"
|
|
|
+ v-if="!priceList2.length"
|
|
|
v-model="scope.row.walletIds"
|
|
|
size="mini"
|
|
|
multiple
|
|
@@ -445,15 +445,6 @@
|
|
|
<el-button type="primary" size="mini" @click="handleNewInfo">添加</el-button>
|
|
|
<el-button v-loading="fullscreenLoading" type="primary" size="mini" @click="handleSave">保存</el-button>
|
|
|
</div>
|
|
|
- <!-- <el-pagination-->
|
|
|
- <!-- :current-page="dcurrentPage"-->
|
|
|
- <!-- :page-sizes="pageSizeArr"-->
|
|
|
- <!-- :page-size="size"-->
|
|
|
- <!-- layout="total, sizes, prev, pager, next, jumper"-->
|
|
|
- <!-- :total="listTotal"-->
|
|
|
- <!-- @size-change="handleSizeChange2"-->
|
|
|
- <!-- @current-change="handleCurrentChange2"-->
|
|
|
- <!-- />-->
|
|
|
</div>
|
|
|
|
|
|
<el-row>
|
|
@@ -622,7 +613,8 @@ export default {
|
|
|
dpageSize: 10,
|
|
|
dcurrentPage: 1,
|
|
|
fullscreenLoading: false,
|
|
|
- priceList: []
|
|
|
+ priceList: [],
|
|
|
+ priceList2: []
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
@@ -651,25 +643,33 @@ export default {
|
|
|
},
|
|
|
handleEdit(row) {
|
|
|
row.fang = !row.fang
|
|
|
- this.$nextTick(() => {
|
|
|
- this.$refs.plTable.doLayout()
|
|
|
- })
|
|
|
+ !row.fang && this.handleWallet(row)
|
|
|
+ // this.$nextTick(() => {
|
|
|
+ // this.$refs.plTable.doLayout()
|
|
|
+ // })
|
|
|
},
|
|
|
setText(e, index, row, name) {
|
|
|
if (e) {
|
|
|
if (name === 'priceType') {
|
|
|
+ this.NoRebateWalletList2 = []
|
|
|
+ this.rebateList2 = []
|
|
|
+ this.priceList.forEach(k => {
|
|
|
+ if (k.priceTypeId === e) {
|
|
|
+ this.NoRebateWalletList2.push(
|
|
|
+ {
|
|
|
+ id: k.walletId,
|
|
|
+ name: k.walletName
|
|
|
+ }
|
|
|
+ )
|
|
|
+ this.rebateList2.push({
|
|
|
+ walletRebateId: k.walletId2,
|
|
|
+ name: k.walletName2
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
const item = this.priceList.find(k => k.priceTypeId === e)
|
|
|
- this.NoRebateWalletList2 = [{
|
|
|
- id: item.walletId,
|
|
|
- name: item.walletName
|
|
|
- }]
|
|
|
- this.rebateList2 = [{
|
|
|
- walletRebateId: item.walletId2,
|
|
|
- name: item.walletName2
|
|
|
- }]
|
|
|
this.dataList[index][name] = item.priceTypeName
|
|
|
this.$set(row, 'walletIds', [])
|
|
|
-
|
|
|
if (item.walletId) {
|
|
|
this.$set(row, 'walletIds', [...row.walletIds, item.walletId])
|
|
|
}
|
|
@@ -1035,6 +1035,7 @@ export default {
|
|
|
materialNumber: '',
|
|
|
policyId: this.comCode,
|
|
|
price: '',
|
|
|
+ fang: false,
|
|
|
remark: '',
|
|
|
saleTypeCode: '',
|
|
|
saleTypeId: '',
|
|
@@ -1116,7 +1117,7 @@ export default {
|
|
|
this.$emit('upDataIsFlag')
|
|
|
},
|
|
|
getPriceSalesRelaListV2(val) {
|
|
|
- getPriceSalesRelaListV2({
|
|
|
+ return getPriceSalesRelaListV2({
|
|
|
pageNum: 1,
|
|
|
pageSize: -1,
|
|
|
params: [
|
|
@@ -1128,6 +1129,8 @@ export default {
|
|
|
]
|
|
|
}).then(res => {
|
|
|
this.priceList = res.data.records
|
|
|
+ this.priceList2 = this.quChong(res.data.records, 'priceTypeId')
|
|
|
+ return Promise.resolve()
|
|
|
})
|
|
|
},
|
|
|
handlePriceType(e) {
|
|
@@ -1136,6 +1139,59 @@ export default {
|
|
|
if (e.saleTypeCode) {
|
|
|
this.getPriceSalesRelaListV2(e.saleTypeCode)
|
|
|
}
|
|
|
+ },
|
|
|
+ quChong(arr, id) {
|
|
|
+ var result = []
|
|
|
+ const obj = {}
|
|
|
+ for (let i = 0; i < arr.length; i++) {
|
|
|
+ if (!obj[arr[i][id]]) {
|
|
|
+ result.push(arr[i])
|
|
|
+ obj[arr[i][id]] = true
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return result
|
|
|
+ },
|
|
|
+ handleWallet(row) {
|
|
|
+ if (row.saleTypeCode) {
|
|
|
+ this.getPriceSalesRelaListV2(row.saleTypeCode).then(res => {
|
|
|
+ this.NoRebateWalletList2 = []
|
|
|
+ this.rebateList2 = []
|
|
|
+ const rebateListId = []
|
|
|
+ const NoRebateWalletListId = []
|
|
|
+ this.priceList.forEach(k => {
|
|
|
+ if (k.priceTypeName === row.priceType) {
|
|
|
+ rebateListId.push(k.walletId2)
|
|
|
+ NoRebateWalletListId.push(k.walletId)
|
|
|
+ k.walletId && this.NoRebateWalletList2.push(
|
|
|
+ {
|
|
|
+ id: k.walletId,
|
|
|
+ name: k.walletName
|
|
|
+ }
|
|
|
+ )
|
|
|
+ k.walletId2 && this.rebateList2.push({
|
|
|
+ walletRebateId: k.walletId2,
|
|
|
+ name: k.walletName2
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ if (row.walletIds && row.walletIds.length) {
|
|
|
+ row.walletIds.forEach(k => {
|
|
|
+ if (!~NoRebateWalletListId.indexOf(k)) {
|
|
|
+ const item = this.NoRebateWalletList.find(e => e.id === k)
|
|
|
+ this.NoRebateWalletList2.push(item)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ if (row.rebateWalletIds && row.rebateWalletIds.length) {
|
|
|
+ row.rebateWalletIds.forEach(k => {
|
|
|
+ if (!~rebateListId.indexOf(k)) {
|
|
|
+ const item = this.rebateList.find(e => e.walletRebateId === k)
|
|
|
+ this.rebateList2.push(item)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
components: {
|