Commit 49b6d5af by 前端

Merge branch 'v3.6.0' into 'master'

V3.6.0

See merge request !3
2 parents fbb1b568 57c45447
/* /*
* @Author: 前端 qianduan01@didihu.com.cn * @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2022-12-13 09:23:56 * @Date: 2022-12-13 09:23:56
* @LastEditors: 前端 qianduan01@didihu.com.cn * @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2022-12-23 15:10:00 * @LastEditTime: 2023-03-09 18:19:51
* @FilePath: \scrm-micro-link\src\api\modules\activity.js * @FilePath: \scrm-micro-link\src\api\modules\activity.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/ */
......
/* /*
* @Author: 前端 qianduan01@didihu.com.cn * @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2022-12-13 16:38:54 * @Date: 2022-12-13 16:38:54
* @LastEditors: 前端 qianduan01@didihu.com.cn * @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2022-12-13 17:29:52 * @LastEditTime: 2023-03-14 14:08:40
* @FilePath: \scrm-micro-link\src\api\modules\giftBag.js * @FilePath: \scrm-micro-link\src\api\modules\giftBag.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/ */
...@@ -17,4 +17,23 @@ const getghDirectionalGiftListApi = params => { ...@@ -17,4 +17,23 @@ const getghDirectionalGiftListApi = params => {
sign: true sign: true
}) })
} }
export default { getghDirectionalGiftListApi } const getEquityListApi = params => {
params.method = 'scrm.api.coupon.equity.list.merchant'
return http({
url: 'rop-scrm-coupon/router',
method: 'GET',
data: 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, brandList }
...@@ -59,6 +59,11 @@ html { ...@@ -59,6 +59,11 @@ html {
.message-Z-zinde { .message-Z-zinde {
z-index: 9999 !important; z-index: 9999 !important;
} }
.ellipsis-1 {
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
}
.flex { .flex {
display: flex; display: flex;
} }
......
...@@ -252,6 +252,10 @@ const subscribe = [ ...@@ -252,6 +252,10 @@ const subscribe = [
optionLabel: '定保招揽' optionLabel: '定保招揽'
}, },
{ {
optionId: 4,
optionLabel: '家庭会员卡'
},
{
optionId: 3, optionId: 3,
optionLabel: '其他' optionLabel: '其他'
} }
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* @Author: limin * @Author: limin
* @Date: 2021-06-07 14:12:32 * @Date: 2021-06-07 14:12:32
* @LastEditors: yangming yangming@didihu.com.cn * @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2023-01-13 17:59:21 * @LastEditTime: 2023-03-02 17:28:20
*/ */
// 根据环境引入不同配置 process.env.VUE_APP_ENV // 根据环境引入不同配置 process.env.VUE_APP_ENV
// let request = require('@/http/request.js') // let request = require('@/http/request.js')
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* @Author: limin * @Author: limin
* @Date: 2021-08-13 14:12:11 * @Date: 2021-08-13 14:12:11
* @LastEditors: yangming yangming@didihu.com.cn * @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2023-01-05 11:27:53 * @LastEditTime: 2023-03-10 18:08:50
* @FilePath: \scrm\scrm-sub-blog\src\main.js * @FilePath: \scrm\scrm-sub-blog\src\main.js
*/ */
import Vue from 'vue' import Vue from 'vue'
...@@ -20,7 +20,7 @@ Vue.prototype.size = 'small' ...@@ -20,7 +20,7 @@ Vue.prototype.size = 'small'
Vue.prototype.defaultLabelWidth = '154px' Vue.prototype.defaultLabelWidth = '154px'
try { try {
const loginpath = JSON.parse(sessionStorage.getItem('SCRM_BASE_SESSION'))?.loginpath const loginpath = JSON.parse(sessionStorage.getItem('SCRM_BASE_SESSION'))?.loginpath
if (loginpath == '/oss') Vue.prototype.loginpath = true if (loginpath === '/oss') Vue.prototype.loginpath = true
} catch (e) { } catch (e) {
console.log(e) console.log(e)
} }
......
<!-- 选择礼包弹窗 -->
<template>
<GLDialog mode="big" class="muti-gift" bigTitle="选择内容" :hasFooter="hasFooter" :before-close="handleGoodsClose" @onOk="handleGoodsConfirm" @onCancel="handleGoodsClose" :visible.sync="isSelectGoodsVisible">
<div class="flex">
<div class="gift-table">
<el-tabs class="gift-tabs" v-model="activeName" @tab-click="handleTabClick">
<el-tab-pane label="卡券" name="card"></el-tab-pane>
<el-tab-pane label="直充" name="recharge"></el-tab-pane>
</el-tabs>
<div>
<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">
<span slot="effectiveType" slot-scope="scope">
<span>{{ toLabelText(scope.scope) }}</span>
</span>
<span slot="stock" slot-scope="scope">
<span>{{ scope.scope.limitStockFlag == 1 ? scope.scope.stock : '无限制' }}</span>
</span>
<span slot="useType" slot-scope="scope">
<span>{{ toRestrictLabelText(scope.scope) }}</span>
</span>
</GLTable>
<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>
<span slot="stock" slot-scope="scope">
<span>{{ scope.scope.limitStockFlag == 1 ? scope.scope.stock : '无限制' }}</span>
</span>
<span slot="useType" slot-scope="scope">
<span>{{ toRestrictLabelText(scope.scope) }}</span>
</span>
</GLTable>
</div>
</div>
<div class="selected-list">
<p class="list-title p-16">已选({{ selectedSum }})</p>
<div class="list-gifts">
<div v-for="(item, index) in orderShow" :key="index">
<div class="gift-box" v-if="selectedList[item].list.length">
<div class="gift-label">
<img class="muti-icon" :src="require(`@/assets/coupon/${item}.png`)" />
</div>
<div class="gift-content">
<template v-for="(subItem, subIndex) in selectedList[item].list">
<div class="gift-item" :key="subItem.id">
<img class="muti-icon" src="@/assets/muti-selected.png" @click="handleGoodsDelete(item, subIndex)" />
<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>
</div>
</div>
</template>
</div>
</div>
</div>
</div>
</div>
</div>
</GLDialog>
</template>
<script>
import url from '@/assets/empty.png'
// import glsxDialog from '@/components/glsx-dialog'
export default {
name: 'selectGoodsDialog',
data() {
return {
// 表格组件
isMount: false,
activeName: 'card',
userInfo: {},
GoodsList: [],
fnCallBack: false,
url: url,
loading: true,
selectedSum: 0,
selectedList: {
card: {
appearance: 1,
list: []
},
// 直充
recharge: {
appearance: 2,
list: []
}
},
initSelected: '',
scopeApplication: [
{
confId: '1',
confName: '旗下所有店通用'
},
{
confId: '2',
confName: '旗下品牌店通用'
}
],
orderShow: ['card', 'recharge'],
numToCoupon: {
1: 'card',
2: 'recharge'
},
// 搜索
searchForm: {
brandName: ''
},
searchFormData: [
{
label: '商品品牌',
name: 'brandName',
type: 'select',
maxlength: 30,
width: '185px',
placeholder: '请选择商品品牌',
optionList: [],
optionId: 'brandName',
optionLabel: 'brandName',
optionsName: 'brandName',
isClear: true
},
{
label: '商品名称',
name: 'goodsName',
type: 'input',
maxlength: 30,
width: '185px',
placeholder: '请输入商品名称',
isClear: true
}
],
// pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
// 表格参数
tableParams: {
listName: 'list',
// 行数据的key
mutiSelectUniqueKey: 'id',
// 多选ref的名称
mutiSelectName: 'list',
tableColumns: [
{
label: '品牌',
prop: 'brandName',
width: 120
},
{
label: '商品名称',
prop: 'goodsName',
width: 180
},
{
label: '劵面额',
prop: 'denomination',
formatter: cellValue => {
return isNaN(cellValue.denomination) ? cellValue.denomination : (cellValue.denomination / 100).toFixed(2) + '元'
}
},
{
label: '有效期',
prop: 'effectiveDays',
formatter: cellValue => {
return cellValue.effectiveDays + '天'
}
}
]
},
tableParamsL: {}
}
},
props: {
isSelectGoodsVisible: {
type: Boolean,
default: false
},
merchantId: [String, Number],
selectedGoodsLists: {
type: Object,
default: () => []
}
},
// components: {
// glsxDialog
// },
mounted() {
for (let i in this.selectedList) {
this.selectedGoodsLists.forEach(item => {
if (item.appearance == this.selectedList[i].appearance) this.selectedList[i].list.push(item)
})
}
this.initSelected = this.$common.utils.deepClone(this.selectedList)
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,
status: 2,
pageNum: isResetPage ? 1 : this.$refs[this.activeName + 'Ref'].page.pageNum,
pageSize: isResetPage ? 10 : this.$refs[this.activeName + 'Ref'].page.pageSize
}
this.loading = true
this.$apis.giftBag
.getEquityListApi(params)
.then(res => {
// 重置分页组件
if (this.$refs[this.activeName + 'Ref'] && isResetPage) {
this.$refs[this.activeName + 'Ref'].page.pageNum = 1
this.$refs[this.activeName + 'Ref'].page.pageSize = 10
}
this.GoodsList = res.list
// this.fnCallBack = true
this.$refs[this.activeName + 'Ref'].tableTotal = res.total
this.recoverySelected()
this.recoveryTotal()
this.$nextTick(() => {
this.initSelected = null
})
this.$refs[this.activeName + 'Ref'].tableHeightValues = '50vh'
})
.finally(() => {
this.loading = false
})
},
handleTabClick() {
this.getList({}, true)
this.recoverySelected()
},
handleSearch() {
this.getList({}, true)
this.recoverySelected()
},
handleReset() {
this.searchForm = {}
this.handleSearch()
},
// 恢复选择
addSelected() {
this.$nextTick(() => {
// this.$refs[this.activeName + 'Ref'].$refs[this.tableParams.mutiSelectName + 'MutiTable'].clearSelection()
var list = this.$common.utils.deepClone(this.selectedList[this.activeName].list)
if (list && list.length) {
list.forEach(row => {
var idx = this.GoodsList.findIndex(k => k.id == row.id)
if (idx != -1) {
this.$refs[this.activeName + 'Ref'].$refs[this.tableParams.mutiSelectName + 'MutiTable'].toggleRowSelection(this.GoodsList[idx], true)
}
})
}
})
},
recoverySelected() {
// 翻页,去掉已选项
var selectedData = this.$refs[this.activeName + 'Ref'].mutiSelectArr.list
console.log(selectedData, '4444444444444444')
var deleteList = []
this.addSelected()
if (selectedData) {
selectedData.forEach(item => {
if (this.selectedList[this.activeName].list.findIndex(subItem => subItem.id == item.id) == -1) {
deleteList.push(item)
}
})
this.deleteSelected(deleteList)
}
},
// 删除选中
deleteSelected(deleteList) {
this.$nextTick(() => {
deleteList.forEach(row => {
var idx = this.GoodsList.findIndex(k => k.id == row.id)
if (idx != -1) {
this.$refs[this.activeName + 'Ref'].$refs[this.tableParams.mutiSelectName + 'MutiTable'].toggleRowSelection(this.GoodsList[idx], false)
}
})
})
},
handleGoodsDelete(attr, idx) {
var deleteList = this.selectedList[attr].list.splice(idx, 1)
this.deleteSelected(deleteList)
this.recoveryTotal()
},
// 计算已选张数
recoveryTotal() {
this.selectedSum = 0
for (let i in this.selectedList) {
this.selectedSum += this.selectedList[i].list.length
}
},
// getSelectionTable(list, val) {
// var currentIdList = this.GoodsList.map(item => item.id)
// var selectedIdList = list.map(item => item.id)
// val.forEach((item, index) => {
// const idx = currentIdList.indexOf(item.id)
// const idxs = selectedIdList.indexOf(item.id)
// if (idx == -1 && idxs == -1) {
// val.splice(index, 1)
// }
// })
// return val
// },
// 选择/取消
handleSelectionTable(val) {
const selectedList = this.initSelected ? this.initSelected[this.activeName].list : this.selectedList[this.activeName].list
var list = this.$common.utils.deepClone(selectedList)
var count = 0
var currentIdList = this.GoodsList.map(item => item.id)
val
.map(item => item.id)
.forEach(k => {
if (currentIdList.indexOf(k) != -1) {
count = count + 1
}
})
if (count <= this.GoodsList.length || count == 0 || !val.length) {
this.selectedList[this.activeName].list = []
}
val.forEach(item => {
let isSelected = list.find(k => k.id == item.id)
console.log(this.selectedList[this.activeName].list, item.id)
if (this.selectedList[this.activeName].list.findIndex(k => k.id == item.id) == '-1') {
this.selectedList[this.activeName].list.push({
id: item.id,
goodId: item.goodId,
appearance: item.appearance,
brandName: item.brandName,
couponAmount: isSelected ? list.find(k => k.id == item.id).couponAmount : 1,
goodsName: item.goodsName,
denomination: item.denomination,
effectiveDays: item.effectiveDays,
rechargeDenomination: item.rechargeDenomination
})
}
})
console.log(this.selectedList[this.activeName].list)
this.recoveryTotal()
},
handleGoodsConfirm() {
// if (!this.GoodsList.length) {
// var params = {
// addOrEdit: 1,
// groupOrStore: this.userInfo.accountLevel == 4 ? 2 : 1,
// $title: '新建礼包'
// }
// this.$router.push({
// path: '/productGroup/editProduct',
// query: params
// })
// return true
// }
var selectedData = []
for (let i in this.selectedList) {
selectedData.push(...this.selectedList[i].list)
}
if (selectedData.length == 0) {
this.$message.error('请选择平台福利券')
return
}
this.$emit('handleGoodsConfirm', selectedData)
},
handleGoodsClose() {
this.$emit('handleGoodsClose')
}
}
}
</script>
<style lang="scss">
.el-message {
z-index: 9999 !important;
}
.muti-gift .el-tabs__active-bar {
display: block;
}
.muti-gift .el-tabs__nav-scroll {
display: block;
border-bottom: 1px solid #eeeeee;
}
.muti-gift .el-tabs__item {
font-weight: 400;
font-size: 16px;
color: #717171;
height: 36px !important;
line-height: 36px !important;
}
.muti-gift .el-tabs__item:hover,
.muti-gift .el-tabs__item.is-active {
color: #5f5efb;
background: #fff !important;
border-width: 0px !important;
}
.muti-gift .m-t-10 {
margin-top: 10px;
}
.muti-gift .gift-table {
width: calc(100% - 280px);
border: 1px solid #eeeeee;
margin-right: 10px;
}
.muti-gift .p-16 {
padding: 16px;
}
.muti-gift .selected-list {
width: 280px;
border-radius: 2px;
border: 1px solid #eeeeee;
.list-title {
font-size: 16px;
border-bottom: 1px solid #f1f1f1;
}
.list-gifts {
height: 61vh;
overflow-y: scroll;
}
.gift-box {
padding: 16px;
.gift-label {
color: #999999;
margin-bottom: 14px;
}
.gift-content {
border-bottom: 1px solid #e5e5e5;
.gift-item {
margin-bottom: 20px;
display: inline-flex;
align-items: center;
.muti-icon {
cursor: pointer;
}
.gift-coupon-name {
display: inline-block;
width: 109px;
margin: 0 5px 0 7px;
}
.gift-sum {
display: inline-block;
width: 82px;
text-align: right;
.el-input-number--mini .el-input__inner {
padding: 0 10px;
}
.sum-input {
display: inline-block;
width: 82px;
}
.el-input--mini .el-input__inner {
border: 0px;
}
.el-input-number--mini .el-input-number__decrease,
.el-input-number--mini .el-input-number__increase {
width: 20px !important;
border: 0px;
background-color: #fff;
}
}
.gift-tips {
display: inline-block;
font-size: 12px;
height: 18px;
line-height: 18px;
color: #999999;
background-color: #eeeded;
margin-right: 7px;
}
}
.gift-item:last-child {
margin-bottom: 0;
}
}
.gift-content:last-child {
border-bottom: 0px;
}
}
}
</style>
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
<el-date-picker v-model="editForm.activityTime" type="datetimerange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" value-format="yyyy-MM-dd HH:mm:ss" :default-time="['00:00:00', '23:59:59']" @change="e => handleTimeChange(e, scope.scope)"></el-date-picker> <el-date-picker v-model="editForm.activityTime" type="datetimerange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" value-format="yyyy-MM-dd HH:mm:ss" :default-time="['00:00:00', '23:59:59']" @change="e => handleTimeChange(e, scope.scope)"></el-date-picker>
</div> </div>
</template> </template>
<el-button slot="selectGiftBtn" type="default" class="el-icon-plus" @click="handleGiftAdd">选择优惠券</el-button> <el-button slot="selectGiftBtn" type="default" class="el-icon-plus" @click="handleGiftAdd">选择服务</el-button>
<div slot="couponListBlock" style="width: 700px" :style="{ 'margin-left': defaultLabelWidth }" v-show="editForm.couponList && editForm.couponList.length != 0"> <div slot="couponListBlock" style="width: 700px" :style="{ 'margin-left': defaultLabelWidth }" v-show="editForm.couponList && editForm.couponList.length != 0">
<div class="gift-block"> <div class="gift-block">
<div class="gift-title"> <div class="gift-title">
...@@ -47,6 +47,30 @@ ...@@ -47,6 +47,30 @@
</div> </div>
</div> </div>
</div> </div>
<template slot="selectGoodsBtn">
<el-button type="default" class="el-icon-plus" @click="handleGoodsAdd">选择福利券</el-button>
</template>
<div slot="goodsListBlock" style="width: 792px" :style="{ 'margin-left': defaultLabelWidth }" v-if="selectedGoodsList && selectedGoodsList.length">
<div class="goods-panel">
<el-table :data="selectedGoodsList" border style="width: 100%">
<el-table-column type="index" label="序号" width="70"></el-table-column>
<el-table-column prop="brandName" label="品牌" width="120"></el-table-column>
<el-table-column prop="goodsName" label="商户名称" width="160"></el-table-column>
<el-table-column prop="couponAmount" label="数量" width="80"></el-table-column>
<el-table-column prop="denomination" label="劵面额" width="140">
<template slot-scope="scope">{{ (scope.row.denomination / 100).toFixed(2) }}元</template>
</el-table-column>
<el-table-column prop="effectiveDays" label="有效期" width="120">
<template slot-scope="scope">{{ scope.row.effectiveDays }}天</template>
</el-table-column>
<el-table-column label="操作" width="100">
<template slot-scope="scope">
<el-button @click="handleDeleteGoods(scope.row)" type="text" size="small">删除</el-button>
</template>
</el-table-column>
</el-table>
</div>
</div>
<!-- <div slot="specificationsHtml" v-if="specificationDetailList.length" class="flex" style="min-width: 600px" id="specificationDetailList"> <!-- <div slot="specificationsHtml" v-if="specificationDetailList.length" class="flex" style="min-width: 600px" id="specificationDetailList">
<div style="width: calc(100%)"> <div style="width: calc(100%)">
<table class="table-spesc" style="width: calc(100%)"> <table class="table-spesc" style="width: calc(100%)">
...@@ -307,6 +331,7 @@ ...@@ -307,6 +331,7 @@
<crowdEditWechat ref="crowdEditWechat" :editForm="editForm" :countDownObj="countDownObj"></crowdEditWechat> <crowdEditWechat ref="crowdEditWechat" :editForm="editForm" :countDownObj="countDownObj"></crowdEditWechat>
</GLDialog> </GLDialog>
<select-gift-dialog :merchantId="editForm.merchantId" v-if="isSelectGiftVisible" :isSelectGiftVisible="isSelectGiftVisible" :selectedGiftList="selectedMealList" @handleGiftConfirm="handleGiftConfirm" @handleGiftClose="handleGiftClose"></select-gift-dialog> <select-gift-dialog :merchantId="editForm.merchantId" v-if="isSelectGiftVisible" :isSelectGiftVisible="isSelectGiftVisible" :selectedGiftList="selectedMealList" @handleGiftConfirm="handleGiftConfirm" @handleGiftClose="handleGiftClose"></select-gift-dialog>
<select-goods-dialog v-if="isSelectGoodsVisible" :isSelectGoodsVisible="isSelectGoodsVisible" :selectedGoodsLists="selectedGoodsList" @handleGoodsConfirm="handleGoodsConfirm" @handleGoodsClose="handleGoodsClose"></select-goods-dialog>
<select-single-pro-dialog v-if="isSingleSelectVisible" :merchantId="editForm.merchantId" :isSingleSelectVisible="isSingleSelectVisible" :propSearch="{ deliveryType: 1 }" :selectedProInfo="selectedProInfo" @handleSingleSelectConfirm="handleSingleSelectConfirm" @handleSingleSelectClose="handleSingleSelectClose(true)"></select-single-pro-dialog> <select-single-pro-dialog v-if="isSingleSelectVisible" :merchantId="editForm.merchantId" :isSingleSelectVisible="isSingleSelectVisible" :propSearch="{ deliveryType: 1 }" :selectedProInfo="selectedProInfo" @handleSingleSelectConfirm="handleSingleSelectConfirm" @handleSingleSelectClose="handleSingleSelectClose(true)"></select-single-pro-dialog>
<!-- :storeSelected="selectedList" --> <!-- :storeSelected="selectedList" -->
<select-store v-if="relateStoreVisible" ref="relateStore" :dialogVisible="relateStoreVisible" :storeSelected="selectedList" :merchantInfo="editForm.merchantId" @handleRelateStoreConfirm="handleRelateStoreConfirm" @handleRelateStoreClose="handleRelateStoreClose"> <select-store v-if="relateStoreVisible" ref="relateStore" :dialogVisible="relateStoreVisible" :storeSelected="selectedList" :merchantInfo="editForm.merchantId" @handleRelateStoreConfirm="handleRelateStoreConfirm" @handleRelateStoreClose="handleRelateStoreClose">
...@@ -346,6 +371,7 @@ import { utils } from 'glsx-common' ...@@ -346,6 +371,7 @@ import { utils } from 'glsx-common'
import crowdEditWechat from './crowdEditWechat.vue' import crowdEditWechat from './crowdEditWechat.vue'
import selectStore from './components/selectStore' import selectStore from './components/selectStore'
import selectGiftDialog from './components/selectGiftDialog.vue' import selectGiftDialog from './components/selectGiftDialog.vue'
import selectGoodsDialog from './components/selectGoodsDialog.vue'
const couponObj = { const couponObj = {
// 折扣券 // 折扣券
discount: { discount: {
...@@ -376,19 +402,38 @@ const couponObj = { ...@@ -376,19 +402,38 @@ const couponObj = {
logo: require('@/assets/coupon/icon-service.png') logo: require('@/assets/coupon/icon-service.png')
} }
} }
const goodsObj = {
// 卡券
card: {
label: '卡券',
appearance: 1,
list: []
},
// 直充
recharge: {
label: '直充',
appearance: 2,
list: []
}
}
const numToCoupon = { const numToCoupon = {
2: 'discount', 2: 'discount',
3: 'cash', 3: 'cash',
4: 'exchange', 4: 'exchange',
7: 'service' 7: 'service'
} }
const numToGoods = {
1: 'card',
2: 'recharge'
}
const orderShow = ['service', 'cash', 'discount', 'exchange'] const orderShow = ['service', 'cash', 'discount', 'exchange']
export default { export default {
name: 'editActivity', name: 'editActivity',
components: { components: {
crowdEditWechat, crowdEditWechat,
selectStore, selectStore,
selectGiftDialog selectGiftDialog,
selectGoodsDialog
}, },
data() { data() {
var validatorPhone = function(rule, value, callback) { var validatorPhone = function(rule, value, callback) {
...@@ -402,6 +447,10 @@ export default { ...@@ -402,6 +447,10 @@ export default {
size: 'small', size: 'small',
editChildRef: 'editChildRef', editChildRef: 'editChildRef',
loading: false, loading: false,
rulesOptions: [
{ label: '用一发一', value: 1 },
{ label: '一次性发放', value: 2 }
],
userInfo: {}, userInfo: {},
// pickerOptions: { // pickerOptions: {
// disabledDate(v) { // disabledDate(v) {
...@@ -415,9 +464,13 @@ export default { ...@@ -415,9 +464,13 @@ export default {
orderShow, orderShow,
choseItemList: [], choseItemList: [],
selectedMealList: [], selectedMealList: [],
selectedGoodsList: [],
couponObj: JSON.parse(JSON.stringify(couponObj)), couponObj: JSON.parse(JSON.stringify(couponObj)),
goodsObj: JSON.parse(JSON.stringify(goodsObj)),
numToCoupon, numToCoupon,
numToGoods,
isSelectGiftVisible: false, isSelectGiftVisible: false,
isSelectGoodsVisible: false,
routeInfo: { routeInfo: {
// 1-新增;2-编辑;3-查看 // 1-新增;2-编辑;3-查看
// add-新增;edit-编辑;detail-详情;copy-复制 // add-新增;edit-编辑;detail-详情;copy-复制
...@@ -729,7 +782,7 @@ export default { ...@@ -729,7 +782,7 @@ export default {
isHide: false isHide: false
}, },
{ {
label: '门店优惠券', label: '门店服务',
name: 'couponList', name: 'couponList',
addHtml: 'selectGiftBtn' addHtml: 'selectGiftBtn'
}, },
...@@ -740,6 +793,17 @@ export default { ...@@ -740,6 +793,17 @@ export default {
addHtml: 'couponListBlock' addHtml: 'couponListBlock'
}, },
{ {
label: '平台福利',
name: 'goodsList',
addHtml: 'selectGoodsBtn'
},
{
label: '',
name: 'goodsListBlock',
addHtml: 'goodsListBlock',
isHide: true
},
{
label: '销售价格', label: '销售价格',
name: 'activityPrice', name: 'activityPrice',
type: 'input' type: 'input'
...@@ -1298,21 +1362,42 @@ export default { ...@@ -1298,21 +1362,42 @@ export default {
// } // }
}, },
methods: { methods: {
//选择优惠券 //选择门店优惠券
handleGiftAdd() { handleGiftAdd() {
if (!this.editForm.merchantId) return this.$message.error('请先选择门店!') if (!this.editForm.merchantId) return this.$message.error('请先选择门店!')
this.selectedMealList = JSON.parse(JSON.stringify(this.couponObj)) this.selectedMealList = JSON.parse(JSON.stringify(this.couponObj))
this.handleGiftClose() this.handleGiftClose()
}, },
//选择商品优惠券
handleGoodsAdd() {
this.handleGoodsClose()
},
handleGiftClose() { handleGiftClose() {
this.isSelectGiftVisible = !this.isSelectGiftVisible this.isSelectGiftVisible = !this.isSelectGiftVisible
}, },
handleGoodsClose() {
this.isSelectGoodsVisible = !this.isSelectGoodsVisible
},
handleGiftConfirm(selectedData) { handleGiftConfirm(selectedData) {
this.handleGiftClose() this.handleGiftClose()
this.couponObj = selectedData this.couponObj = selectedData
this.recoveryTotalPrice() this.recoveryTotalPrice()
this.recoveryGiftList() this.recoveryGiftList()
}, },
setNameHide(name) {
var idx = this.editFormData.findIndex(item => item.name == name)
this.editFormData[idx].isHide = !this.selectedGoodsList.length
},
handleGoodsConfirm(selectedData) {
this.selectedGoodsList = selectedData || []
this.setNameHide('goodsListBlock')
this.handleGoodsClose()
},
handleDeleteGoods(row) {
const index = this.selectedGoodsList.findIndex(k => k.id == row.id)
this.selectedGoodsList.splice(index, 1)
this.setNameHide('goodsListBlock')
},
hasCouponBlock(isValidate = true) { hasCouponBlock(isValidate = true) {
var idx = this.editFormData.findIndex(item => item.name == 'couponListBlock') var idx = this.editFormData.findIndex(item => item.name == 'couponListBlock')
this.editFormData[idx].isHide = !this.editForm.couponList.length this.editFormData[idx].isHide = !this.editForm.couponList.length
...@@ -1338,7 +1423,10 @@ export default { ...@@ -1338,7 +1423,10 @@ export default {
this.couponObj[item].list = [] this.couponObj[item].list = []
}) })
this.editForm.couponList.forEach(item => { this.editForm.couponList.forEach(item => {
this.couponObj[this.numToCoupon[item.discountType]].list.push(item) console.log(this.numToCoupon[item.discountType])
if (this.numToCoupon[item.discountType]) {
this.couponObj[this.numToCoupon[item.discountType]].list.push(item)
}
}) })
// console.log(this.couponObj, 'this.couponObj') // console.log(this.couponObj, 'this.couponObj')
// this.currentCoupons = this.$common.utils.deepClone(this.editForm.couponList) // this.currentCoupons = this.$common.utils.deepClone(this.editForm.couponList)
...@@ -1775,9 +1863,13 @@ export default { ...@@ -1775,9 +1863,13 @@ export default {
this.editForm.couponList.forEach(item => { this.editForm.couponList.forEach(item => {
item.id = item.couponId item.id = item.couponId
item.anticipatedCost = item.couponAnticipatedCost item.anticipatedCost = item.couponAnticipatedCost
item.denomination = item.couponAnticipatedCost
}) })
this.selectedGoodsList = this.editForm.couponList.filter(i => i.discountType == 8)
this.editForm.couponList = this.editForm.couponList.filter(i => i.discountType != 8)
this.recoveryCoupon() this.recoveryCoupon()
this.recoveryTotalPrice() this.recoveryTotalPrice()
this.selectedGoodsList.length && this.setNameHide('goodsListBlock')
// 表单设置 // 表单设置
this.editForm.formDescribeCheck = [] this.editForm.formDescribeCheck = []
this.editForm.selectCarNumberFlag = this.editForm.selectCarNumberFlag || 1 this.editForm.selectCarNumberFlag = this.editForm.selectCarNumberFlag || 1
...@@ -1920,15 +2012,22 @@ export default { ...@@ -1920,15 +2012,22 @@ export default {
}) })
const couponList = this.$common.utils.deepClone(param.couponList) || [] const couponList = this.$common.utils.deepClone(param.couponList) || []
param.couponCreateRequests = couponList.map(item => { const couponLists = couponList.map(item => {
return { return {
couponId: item.couponId ? item.couponId : item.id, couponId: item.couponId ? item.couponId : item.id,
couponAmount: item.couponAmount, couponAmount: item.couponAmount,
couponAnticipatedCost: item.couponAnticipatedCost couponAnticipatedCost: item.couponAnticipatedCost
} }
}) })
const selectedGoodsList = this.selectedGoodsList.map(item => {
return {
couponId: item.id,
couponAmount: item.couponAmount,
couponAnticipatedCost: item.denomination
}
})
param.couponCreateRequests = couponLists.concat(selectedGoodsList)
delete param.couponList delete param.couponList
// 标杆门店总产值/元(已结束战报) // 标杆门店总产值/元(已结束战报)
if (param.activityActionReport.signMerchantProduceCount) { if (param.activityActionReport.signMerchantProduceCount) {
param.activityActionReport.signMerchantProduceCount = (this.editForm.activityActionReport.signMerchantProduceCount * 10000).toFixed(0) param.activityActionReport.signMerchantProduceCount = (this.editForm.activityActionReport.signMerchantProduceCount * 10000).toFixed(0)
...@@ -2602,4 +2701,10 @@ export default { ...@@ -2602,4 +2701,10 @@ export default {
margin-left: 312px; margin-left: 312px;
} }
} }
.provideWay-box {
width: 160px !important;
.el-input {
width: 100% !important;
}
}
</style> </style>
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
<GLTable ref="classifyRef" :getListApi="getListApi" :hasNum="false" :noDataImg="url" :searchForm="tableSearchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn" @setTableFinishFun="setTableFinishFun"> <GLTable ref="classifyRef" :getListApi="getListApi" :hasNum="false" :noDataImg="url" :searchForm="tableSearchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn" @setTableFinishFun="setTableFinishFun">
<div class="sub-tabel" slot="giftInfo" slot-scope="scope"> <div class="sub-tabel" slot="giftInfo" slot-scope="scope">
<div class="gift-detail flex-wrap"> <div class="gift-detail flex-wrap">
<div class="gift-item" v-for="(item, index) in scope.scope.couponList" :key="index"> <div class="gift-item" v-for="(item, index) in filterCouponList(scope.scope.couponList)" :key="index">
<img :src="require(`@/assets/coupon/icon-${attrToIcon[item.discountType]}.png`)" /> <img :src="require(`@/assets/coupon/icon-${attrToIcon[item.discountType]}.png`)" />
<p :class="['gift-coupon-name', item.status == '3' ? ' txt-grey' : '']">{{ item.couponName }} × {{ item.couponAmount }}</p> <p :class="['gift-coupon-name', item.status == '3' ? ' txt-grey' : '']">{{ item.couponName }} × {{ item.couponAmount }}</p>
<p v-show="item.status == '3'" class="gift-tips">已失效</p> <p v-show="item.status == '3'" class="gift-tips">已失效</p>
...@@ -23,11 +23,12 @@ ...@@ -23,11 +23,12 @@
<span :class="['table-circle', scope.scope.activityStatus == 2 ? 'back-green' : 'back-grey']"></span> <span :class="['table-circle', scope.scope.activityStatus == 2 ? 'back-green' : 'back-grey']"></span>
<span>{{ orderStatus.find(item => item.confId == scope.scope.activityStatus)?.confName }}</span> <span>{{ orderStatus.find(item => item.confId == scope.scope.activityStatus)?.confName }}</span>
</div> </div>
<!-- <div slot="coverUrl" slot-scope="scope"> <div slot="activityName" slot-scope="scope">
<div class="image-popover" @click="handleLook(scope.scope)"> <div class="equity-ed">
<img :src="scope.scope.coverUrl" /> <img src="@/assets/equity.png" v-if="filterCouponList(scope.scope.couponList, true).length" />
{{ scope.scope.activityName }}
</div> </div>
</div> --> </div>
<div class="table-btns" slot="auth-button" slot-scope="scope"> <div class="table-btns" slot="auth-button" slot-scope="scope">
<GLTableButton :buttonList="tableButtonList" :buttonItem="scope.scope" :buttonNum="3"></GLTableButton> <GLTableButton :buttonList="tableButtonList" :buttonItem="scope.scope" :buttonNum="3"></GLTableButton>
</div> </div>
...@@ -134,7 +135,9 @@ export default { ...@@ -134,7 +135,9 @@ export default {
}, },
{ {
label: '活动名称', label: '活动名称',
prop: 'activityName' prop: 'activityName',
addHtml: 'activityName',
width: 250
}, },
{ {
label: '商户名称', label: '商户名称',
...@@ -372,6 +375,9 @@ export default { ...@@ -372,6 +375,9 @@ export default {
} }
}) })
}, },
filterCouponList(list, isEquity = false) {
return list.filter(item => (isEquity ? item.discountType == 8 : item.discountType != 8))
},
handleBoard(row) { handleBoard(row) {
this.$router.push({ this.$router.push({
path: '/activityLink/dataBoard', path: '/activityLink/dataBoard',
...@@ -611,4 +617,13 @@ export default { ...@@ -611,4 +617,13 @@ export default {
.gift-detail .gift-item:last-child { .gift-detail .gift-item:last-child {
margin-right: 0; margin-right: 0;
} }
.equity-ed {
display: flex;
align-items: center;
img {
width: 44px;
height: 22px;
margin-right: 6px;
}
}
</style> </style>
...@@ -198,11 +198,16 @@ export default { ...@@ -198,11 +198,16 @@ export default {
} }
} }
}, },
//过滤优惠券列表
VerficationDTOList(row) {
return row.filter(i => i.discountType != 8)
},
getInfo() { getInfo() {
this.$apis.orderManage.orderDetail({ orderCode: this.routeInfo.orderCode }).then(res => { this.$apis.orderManage.orderDetail({ orderCode: this.routeInfo.orderCode }).then(res => {
if (!res) return if (!res) return
this.detailForm = res this.detailForm = res
this.tableData = res.expandedGoldUserCouponDTOS || [] const tableData = res.expandedGoldUserCouponDTOS || []
this.tableData = tableData.filter(i => i.discountType != 8)
this.orderRefund = res.orderRefund || null this.orderRefund = res.orderRefund || null
this.detailForm.createdDateStr = dayjs(this.detailForm.createdDate).format('YYYY-MM-DD HH:mm:ss') this.detailForm.createdDateStr = dayjs(this.detailForm.createdDate).format('YYYY-MM-DD HH:mm:ss')
if (this.orderRefund) { if (this.orderRefund) {
......
/* /*
* @Author: 前端 qianduan01@didihu.com.cn * @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2022-12-13 09:23:57 * @Date: 2022-12-13 09:23:57
* @LastEditors: 前端 qianduan01@didihu.com.cn * @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2022-12-18 12:37:45 * @LastEditTime: 2023-03-01 18:10:25
* @FilePath: \scrm-micro-link\vue.config.js * @FilePath: \scrm-micro-link\vue.config.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/ */
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!