Commit d3900a37 by 杨明

fixed

1 parent 92a1da0d
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
<div class="gift-table"> <div class="gift-table">
<div class="goods-panel"> <div class="goods-panel">
<div v-show="currentIndex == 1" class="car-table"> <div v-show="currentIndex == 1" class="car-table">
<GLTable :hasPage="false" v-loading="loading" ref="carRef" :tableData="carList" :tableParams="carTableParams" @refreshTable="getCarList" @select="handleSelectionCarTable"> <GLTable :hasPage="false" v-loading="loading" ref="carRef" :tableData="carList" :tableParams="carTableParams" @refreshTable="getCarList" @select="handleSelectionCarTable" @selectAll="handleSelectionCarTableAll">
<template slot="price" slot-scope="scope"> <template slot="price" slot-scope="scope">
<el-input v-model="scope.scope.packageAmount" @blur="calcCarValue(scope.scope)" placeholder="请输入" oninput="value=value.match(/\d+\.?\d{0,2}/, '')"></el-input> <el-input v-model="scope.scope.packageAmount" @blur="calcCarValue(scope.scope)" placeholder="请输入" oninput="value=value.match(/\d+\.?\d{0,2}/, '')"></el-input>
</template> </template>
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
<div class="tab-border" :style="{ left: (goodsIndex - 1) * 61 + 2 + 'px' }"></div> <div class="tab-border" :style="{ left: (goodsIndex - 1) * 61 + 2 + 'px' }"></div>
</div> </div>
<div v-for="(item, index) in goodsTabList" :key="index"> <div v-for="(item, index) in goodsTabList" :key="index">
<GLTable v-loading="loading" v-show="goodsIndex == item.type" :ref="'goodsRef' + item.type" :tableData="goodsList" :tableParams="goodsTableParams" @refreshTable="getGoodsList" @select="handleSelectionGoodsTable"></GLTable> <GLTable v-loading="loading" v-show="goodsIndex == item.type" :ref="'goodsRef' + item.type" :tableData="goodsList" :tableParams="goodsTableParams" @refreshTable="getGoodsList" @select="handleSelectionGoodsTable" @select-all="handleSelectionGoodsTableAll"></GLTable>
</div> </div>
</div> </div>
<div v-show="currentIndex == 3"> <div v-show="currentIndex == 3">
...@@ -48,7 +48,7 @@ ...@@ -48,7 +48,7 @@
</div> </div>
</div> </div>
<div v-for="(item, index) in serviceTabList" :key="index"> <div v-for="(item, index) in serviceTabList" :key="index">
<GLTable v-loading="loading" v-show="serviceIndex == item.type" :ref="'serviceRef' + item.type" :tableData="serviceList" :tableParams="serviceTableParams" @refreshTable="getServiceList" @select="handleSelectionServiceTable"> <GLTable v-loading="loading" v-show="serviceIndex == item.type" :ref="'serviceRef' + item.type" :tableData="serviceList" :tableParams="serviceTableParams" @refreshTable="getServiceList" @select="handleSelectionServiceTable" @select-all="handleSelectionServiceTableAll">
<span slot="effectiveType" slot-scope="scope"> <span slot="effectiveType" slot-scope="scope">
<span>{{ toLabelText(scope.scope) }}</span> <span>{{ toLabelText(scope.scope) }}</span>
</span> </span>
...@@ -334,6 +334,13 @@ export default { ...@@ -334,6 +334,13 @@ export default {
console.log(this.selectedServiceList) console.log(this.selectedServiceList)
// this.selectedServiceList = val // this.selectedServiceList = val
}, },
handleSelectionServiceTableAll(selected) {
if (selected.length > 0) {
this.addRows(this.selectedServiceList, selected, 'id')
} else {
this.selectedServiceList = this.deleteRows(this.selectedServiceList, selected, 'id')
}
},
// 选择/取消 生活权益 // 选择/取消 生活权益
handleSelectionGoodsTable(selection, row) { handleSelectionGoodsTable(selection, row) {
if (selection && selection.find(item => item && item.id == row.id)) { if (selection && selection.find(item => item && item.id == row.id)) {
...@@ -343,6 +350,14 @@ export default { ...@@ -343,6 +350,14 @@ export default {
} }
console.log(this.selectedGoodsList) console.log(this.selectedGoodsList)
}, },
handleSelectionGoodsTableAll(selected) {
if (selected.length > 0) {
this.addRows(this.selectedGoodsList, selected, 'id')
} else {
this.selectedGoodsList = this.deleteRows(this.selectedGoodsList, selected, 'id')
}
console.log(this.selectedGoodsList)
},
// 选择/取消 用车权益 // 选择/取消 用车权益
handleSelectionCarTable(selection, row) { handleSelectionCarTable(selection, row) {
if (selection && selection.find(item => item && item.packageCode == row.packageCode)) { if (selection && selection.find(item => item && item.packageCode == row.packageCode)) {
...@@ -352,6 +367,14 @@ export default { ...@@ -352,6 +367,14 @@ export default {
} }
this.calcCarValue() this.calcCarValue()
}, },
handleSelectionCarTableAll(selected) {
if (selected.length > 0) {
this.addRows(this.selectedCarList, selected, 'packageCode')
} else {
this.selectedCarList = this.deleteRows(this.selectedCarList, selected, 'packageCode')
}
this.calcCarValue()
},
addCoupon() { addCoupon() {
openTab('/marketing/couponManage/index') openTab('/marketing/couponManage/index')
}, },
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!