Commit 0ea1fe14 by 杨明

fixed

1 parent cd6322e0
......@@ -2,7 +2,7 @@
* @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2022-12-13 16:38:54
* @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2023-03-09 10:41:15
* @LastEditTime: 2023-03-14 14:08:40
* @FilePath: \scrm-micro-link\src\api\modules\giftBag.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
......@@ -26,5 +26,14 @@ const getEquityListApi = params => {
sign: true
})
}
const brandList = params => {
params.method = 'scrm.api.equity.goods.brand.list.all'
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true
})
}
export default { getghDirectionalGiftListApi, getEquityListApi }
export default { getghDirectionalGiftListApi, getEquityListApi, brandList }
......@@ -59,6 +59,11 @@ html {
.message-Z-zinde {
z-index: 9999 !important;
}
.ellipsis-1 {
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
}
.flex {
display: flex;
}
......
......@@ -11,6 +11,7 @@
<glsx-combi-form :isEdit="false" labelWidth="70px" class="p-16" style="padding-bottom: 0px;" ref="showSearch" :formObj="searchForm" :formData="searchFormData">
<span slot="footer">
<el-button :size="size" type="primary" @click="handleSearch">查询</el-button>
<el-button :size="size" @click="handleReset">重置</el-button>
</span>
</glsx-combi-form>
<GLTable v-loading="loading" v-show="activeName == 'card'" ref="cardRef" :tableData="GoodsList" :noDataImg="url" :tableParams="tableParams" @refreshTable="getList" @selectionTable="handleSelectionTable">
......@@ -24,7 +25,7 @@
<span>{{ toRestrictLabelText(scope.scope) }}</span>
</span>
</GLTable>
<GLTable v-loading="loading" v-show="activeName == 'recharge'" ref="rechargeRef" :tableData="GoodsList" :noDataImg="url" :tableParams="tableParams" @refreshTable="getList" @selectionTable="handleSelectionTable">
<GLTable v-loading="loading" v-show="activeName == 'recharge'" ref="rechargeRef" :tableData="GoodsList" :noDataImg="url" :tableParams="tableParamsL" @refreshTable="getList" @selectionTable="handleSelectionTable">
<span slot="effectiveType" slot-scope="scope">
<span>{{ toLabelText(scope.scope) }}</span>
</span>
......@@ -49,9 +50,9 @@
<template v-for="(subItem, subIndex) in selectedList[item].list">
<div class="gift-item" :key="subIndex">
<img class="muti-icon" src="@/assets/muti-selected.png" @click="handleGoodsDelete(item, subIndex)" />
<el-tooltip effect="dark" placement="top" :disabled="subItem.brandName.length <= 8">
<p :class="['gift-coupon-name', 'ellipsis-1']">{{ subItem.brandName.length > 8 ? subItem.brandName.slice(0, 8) + '...' : subItem.brandName }}</p>
<div slot="content">{{ subItem.brandName }}</div>
<el-tooltip effect="dark" placement="top" :disabled="couponString(subItem).length <= 8">
<p :class="['gift-coupon-name', 'ellipsis-1']">{{ couponString(subItem) > 8 ? couponString(subItem).slice(0, 8) + '...' : couponString(subItem) }}</p>
<div slot="content">{{ couponString(subItem) }}</div>
</el-tooltip>
<div class="gift-sum">
<el-input-number class="sum-input" v-model="subItem.couponAmount" :min="1" :max="9999" size="mini" label="描述文字"></el-input-number>
......@@ -116,10 +117,14 @@ export default {
{
label: '商品',
name: 'brandName',
type: 'input',
type: 'select',
maxlength: 30,
width: '215px',
placeholder: '请输入券/服务名称进行搜索',
width: '185px',
placeholder: '请选择商品品牌',
optionList: [],
optionId: 'brandName',
optionLabel: 'brandName',
optionsName: 'brandName',
isClear: true
},
{
......@@ -127,8 +132,8 @@ export default {
name: 'goodsName',
type: 'input',
maxlength: 30,
width: '215px',
placeholder: '请输入券/服务名称进行搜索',
width: '185px',
placeholder: '请输入商品名称',
isClear: true
}
],
......@@ -144,7 +149,7 @@ export default {
{
label: '品牌',
prop: 'brandName',
width: 180
width: 120
},
{
label: '商品名称',
......@@ -152,10 +157,10 @@ export default {
width: 180
},
{
label: '劵名额',
label: '劵面额',
prop: 'denomination',
formatter: cellValue => {
return (cellValue.denomination / 100).toFixed(2) + '元'
return isNaN(cellValue.denomination) ? cellValue.denomination : (cellValue.denomination / 100).toFixed(2) + '元'
}
},
{
......@@ -166,7 +171,8 @@ export default {
}
}
]
}
},
tableParamsL: {}
}
},
props: {
......@@ -190,9 +196,35 @@ export default {
})
}
this.getList({}, true)
this.brandList('brandName')
},
methods: {
couponString(val) {
return `${isNaN(val.denomination) ? val.denomination : (val.denomination / 100).toFixed(2) + '元'}${val.brandName}${val.goodsName}${this.activeName == 'recharge' ? val.rechargeDenomination : ''}`
},
filterDenomination(val) {
return isNaN(val) ? val : (val / 100).toFixed(2) + '元'
},
brandList(name) {
this.$apis.giftBag
.brandList({
pageNum: 1,
pageSize: 10000,
supplier: 'HW'
})
.then(res => {
const i = this.searchFormData.findIndex(item => item.optionsName == name)
this.searchFormData[i].optionList = res
console.log(this.searchFormData[i].optionList)
})
},
getList(page, isResetPage = false, isMount = false) {
this.tableParamsL = this.$common.utils.deepClone(this.tableParams)
this.tableParamsL.tableColumns.splice(3, 0, {
label: '直充面额',
prop: 'rechargeDenomination',
width: 100
})
var params = {
...this.searchForm,
appearance: this.activeName == 'card' ? 1 : 2,
......@@ -228,6 +260,10 @@ export default {
this.getList({}, true)
this.recoverySelected()
},
handleReset() {
this.searchForm = {}
this.handleSearch()
},
// 恢复选择
addSelected() {
this.$nextTick(() => {
......@@ -308,6 +344,7 @@ export default {
goodsName: item.goodsName,
denomination: item.denomination,
effectiveDays: item.effectiveDays,
rechargeDenomination: item.rechargeDenomination,
provideWay: 1
})
}
......@@ -331,7 +368,11 @@ export default {
for (let i in this.selectedList) {
selectedData.push(...this.selectedList[i].list)
}
console.log(selectedData)
if (selectedData.length == 0) {
this.$message.error('请选择商品优惠券')
return
}
this.$emit('handleGoodsConfirm', selectedData)
},
handleGoodsClose() {
......@@ -341,6 +382,9 @@ export default {
}
</script>
<style lang="scss">
.el-message {
z-index: 9999 !important;
}
.muti-gift .el-tabs__active-bar {
display: block;
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!