Commit e958fce5 by 周子尧

1

1 parent 3d9003f7
......@@ -13,11 +13,11 @@ import { Http } from 'glsx-common'
let timeout = 30000 //超时时间
export const fetchConfig = function (isEnv = true) {
// console.log(1111111)
// if (isEnv) {
// let { request } = cfg
// Object.assign(request, { timeout })
// return Promise.resolve(cfg)
// }
if (isEnv) {
let { request } = cfg
Object.assign(request, { timeout })
return Promise.resolve(cfg)
}
//return window.fetch('https://', {}).then(res => res.json())
// request({ url: 'https://oss-config.test.glsx.com.cn/mock/5be17454f31545347559d499/config/oss_commodity_center', method: 'get' })
return new Http().get('https://oss-config.test.glsx.com.cn/mock/619c87331072f92988f05a29/marketing/config')
......
......@@ -26,7 +26,7 @@
<el-button type="text" @click="handleDetail(scope.scope)">{{ scope.scope.directionalGiftName }}</el-button>
</span>
<div slot="giftInfo" slot-scope="scope">
<GLTable ref="giftListRef" :hasNum="false" :hasPage="false" :noDataImg="url" :tableParams="giftParams" :tableData="scope.scope.couponList"></GLTable>
<GLTable ref="giftListRef" :hasNum="false" :hasPage="false" :noDataImg="url" :tableParams="giftParams" :tableData="scope.scope | filterTable" @setTableFinishFun="setGiftTableFinishFun"></GLTable>
</div>
</GLTable>
<!-- 表格区域 end -->
......@@ -40,6 +40,27 @@ import url from '@/assets/empty.png'
import { aToExport } from '@/common/constant'
export default {
name: 'giftList',
filters: {
filterTable(list) {
// console.log(params)
// return
let arr1 = list.couponList
let arr2 = list.verificationCouponList
let reduceArr = arr1.map(item => {
// item.numBer = ''
arr2.map(ele => {
if (item.couponId == ele.couponId) {
item.numBer = item.couponAmount - ele.couponAmount
item.delet = ele.couponAmount
// item.couponAmount = ele.couponAmount
}
})
return item
})
console.log(reduceArr)
return reduceArr
}
},
data() {
return {
size: 'small',
......@@ -104,7 +125,6 @@ export default {
]
},
//礼包详情
getGiftListApi: this.$apis.giftBag.getGiftInfoApi,
giftParams: {
listName: 'list',
tableOption: false,
......@@ -125,14 +145,20 @@ export default {
label: '已核销',
prop: 'anticipatedCost ',
formatter: cellValue => {
return 'X' + cellValue.numBer
if (cellValue.delet) {
return 'X' + cellValue.delet
}
}
},
{
label: '可使用',
prop: 'getAmount',
formatter: cellValue => {
return 'X' + cellValue.numBer
if (cellValue.numBer) {
return 'X' + cellValue.numBer
} else {
return 'X' + cellValue.couponAmount
}
}
}
]
......@@ -334,7 +360,7 @@ export default {
},
setTableFinishFun() {
var page = this.$refs.receivedGiftListRef.page
console.log(this.$refs.receivedGiftListRef)
console.log(this.$refs.receivedGiftListRef, '1')
// 添加序号
if (this.$refs.receivedGiftListRef.data) {
this.$refs.receivedGiftListRef.data.forEach((item, index) => {
......@@ -345,7 +371,9 @@ export default {
this.$refs.receivedGiftListRef.data.length ? (this.$refs.receivedGiftListRef.tableHeightValues = '') : this.$refs.receivedGiftListRef.setTableHeightFun()
}
},
setGiftTableFinishFun() {
console.log(this.$refs.giftListRef, '2')
},
handleSearch() {
this.$refs.receivedGiftListRef.refreshTable()
},
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!