Commit e102acec by 胡悦

Merge branch 'v2.3.3' into huy_dev_v2.3.3

2 parents 0605b0a3 1a641c51
...@@ -75,7 +75,7 @@ ...@@ -75,7 +75,7 @@
</div> </div>
</template> </template>
<template slot="effectiveHtml"> <template slot="effectiveHtml">
<el-radio v-model="editForm.effectiveType" label="3" :disabled="apear != 'couponAdd'">无有效期</el-radio> <el-radio v-model="editForm.effectiveType" label="3" :disabled="apear != 'couponAdd'">永久有效</el-radio>
<br /> <br />
<el-form-item prop="effectiveTime" ref="effectiveTime" style="margin-top: 12px; display: block"> <el-form-item prop="effectiveTime" ref="effectiveTime" style="margin-top: 12px; display: block">
<el-radio v-model="editForm.effectiveType" label="2" :disabled="apear != 'couponAdd'"> <el-radio v-model="editForm.effectiveType" label="2" :disabled="apear != 'couponAdd'">
...@@ -109,7 +109,7 @@ ...@@ -109,7 +109,7 @@
<!-- 库存,集团版集团账号-无限制库存;其他-输入框 --> <!-- 库存,集团版集团账号-无限制库存;其他-输入框 -->
<template slot="stock" slot-scope="scope"> <template slot="stock" slot-scope="scope">
<span v-if="$isGroupUp">无库存限制</span> <span v-if="$isGroupUp">无库存限制</span>
<el-input v-else class="w-150" v-model="editForm[scope.scope.name]" placeholder="请输入库存"> <el-input :disabled="apear != 'couponAdd'" v-else class="w-150" v-model="editForm[scope.scope.name]" placeholder="请输入库存">
<span slot="suffix">张</span> <span slot="suffix">张</span>
</el-input> </el-input>
</template> </template>
...@@ -623,7 +623,7 @@ export default { ...@@ -623,7 +623,7 @@ export default {
this.editForm.scopeApplication = this.editForm.scopeApplication + '' this.editForm.scopeApplication = this.editForm.scopeApplication + ''
} }
//有效期 //有效期
//有效类型 1:固定天数,领取后计算 2:时间段,3:无有效期 //有效类型 1:固定天数,领取后计算 2:时间段,3:永久有效
if (this.editForm.effectiveType == 2) { if (this.editForm.effectiveType == 2) {
this.editForm.effectiveTime = [this.editForm.effectiveStartTime, this.editForm.effectiveEndTime] this.editForm.effectiveTime = [this.editForm.effectiveStartTime, this.editForm.effectiveEndTime]
} }
...@@ -688,7 +688,7 @@ export default { ...@@ -688,7 +688,7 @@ export default {
obj.useChannel = form.useChannel obj.useChannel = form.useChannel
//有效期 //有效期
//有效类型 1:固定天数,领取后计算 2:时间段,3:无有效期 //有效类型 1:固定天数,领取后计算 2:时间段,3:永久有效
obj.effectiveType = form.effectiveType obj.effectiveType = form.effectiveType
if (form.effectiveType == 1) { if (form.effectiveType == 1) {
//固定天数 //固定天数
......
...@@ -122,7 +122,7 @@ ...@@ -122,7 +122,7 @@
<!-- 库存,集团版集团账号-无限制库存;其他-输入框 --> <!-- 库存,集团版集团账号-无限制库存;其他-输入框 -->
<template slot="stock" slot-scope="scope"> <template slot="stock" slot-scope="scope">
<span v-if="$isGroupUp">无库存限制</span> <span v-if="$isGroupUp">无库存限制</span>
<el-input v-else class="w-150" v-model="editForm[scope.scope.name]" placeholder="请输入库存"> <el-input :disabled="apear != 'couponAdd'" v-else class="w-150" v-model="editForm[scope.scope.name]" placeholder="请输入库存">
<span slot="suffix">张</span> <span slot="suffix">张</span>
</el-input> </el-input>
</template> </template>
...@@ -435,7 +435,7 @@ export default { ...@@ -435,7 +435,7 @@ export default {
this.editForm.full = this.editForm.full this.editForm.full = this.editForm.full
} }
//有效期 //有效期
//有效类型 1:固定天数,领取后计算 2:时间段,3:无有效期 //有效类型 1:固定天数,领取后计算 2:时间段,3:永久有效
if (this.editForm.effectiveType == 2) { if (this.editForm.effectiveType == 2) {
this.editForm.effectiveTime = [this.editForm.effectiveStartTime, this.editForm.effectiveEndTime] this.editForm.effectiveTime = [this.editForm.effectiveStartTime, this.editForm.effectiveEndTime]
} }
...@@ -487,7 +487,7 @@ export default { ...@@ -487,7 +487,7 @@ export default {
obj.discountType = '2' obj.discountType = '2'
obj.directionalFlag = '1' obj.directionalFlag = '1'
//有效期 //有效期
//有效类型 1:固定天数,领取后计算 2:时间段,3:无有效期 //有效类型 1:固定天数,领取后计算 2:时间段,3:永久有效
obj.effectiveType = form.effectiveType obj.effectiveType = form.effectiveType
if (form.effectiveType == 1) { if (form.effectiveType == 1) {
//固定天数 //固定天数
......
...@@ -57,7 +57,7 @@ ...@@ -57,7 +57,7 @@
<!-- 库存,集团版集团账号-无限制库存;其他-输入框 --> <!-- 库存,集团版集团账号-无限制库存;其他-输入框 -->
<template slot="stock" slot-scope="scope"> <template slot="stock" slot-scope="scope">
<span v-if="$isGroupUp">无库存限制</span> <span v-if="$isGroupUp">无库存限制</span>
<el-input v-else class="w-150" v-model="editForm[scope.scope.name]" placeholder="请输入库存"> <el-input :disabled="apear != 'couponAdd'" v-else class="w-150" v-model="editForm[scope.scope.name]" placeholder="请输入库存">
<span slot="suffix">张</span> <span slot="suffix">张</span>
</el-input> </el-input>
</template> </template>
...@@ -354,7 +354,7 @@ export default { ...@@ -354,7 +354,7 @@ export default {
this.editForm.scopeApplication = this.editForm.scopeApplication + '' this.editForm.scopeApplication = this.editForm.scopeApplication + ''
} }
//有效期 //有效期
//有效类型 1:固定天数,领取后计算 2:时间段,3:无有效期 //有效类型 1:固定天数,领取后计算 2:时间段,3:永久有效
if (this.editForm.effectiveType == 2) { if (this.editForm.effectiveType == 2) {
this.editForm.effectiveTime = [this.editForm.effectiveStartTime, this.editForm.effectiveEndTime] this.editForm.effectiveTime = [this.editForm.effectiveStartTime, this.editForm.effectiveEndTime]
} }
...@@ -396,7 +396,7 @@ export default { ...@@ -396,7 +396,7 @@ export default {
obj.discountType = '4' obj.discountType = '4'
obj.directionalFlag = '1' obj.directionalFlag = '1'
//有效期 //有效期
//有效类型 1:固定天数,领取后计算 2:时间段,3:无有效期 //有效类型 1:固定天数,领取后计算 2:时间段,3:永久有效
obj.effectiveType = form.effectiveType obj.effectiveType = form.effectiveType
if (form.effectiveType == 1) { if (form.effectiveType == 1) {
//固定天数 //固定天数
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<p class="edit-title">{{ title }}服务券</p> <p class="edit-title">{{ title }}服务券</p>
<glsx-combi-form class="edit-form-container" ref="editFormRef" :isEdit="true" :isBlock="true" :formRef="editChildRef" :formObj="editForm" :formData="editFormData" :formRules="editRule"> <glsx-combi-form class="edit-form-container" ref="editFormRef" :isEdit="true" :isBlock="true" :formRef="editChildRef" :formObj="editForm" :formData="editFormData" :formRules="editRule">
<template slot="effectiveHtml"> <template slot="effectiveHtml">
<el-radio v-model="editForm.effectiveType" label="3" :disabled="apear != 'couponAdd'">无有效期</el-radio> <el-radio v-model="editForm.effectiveType" label="3" :disabled="apear != 'couponAdd'">永久有效</el-radio>
<br /> <br />
<el-form-item prop="effectiveTime" style="margin-top: 12px; display: block"> <el-form-item prop="effectiveTime" style="margin-top: 12px; display: block">
<el-radio v-model="editForm.effectiveType" label="2" :disabled="apear != 'couponAdd'"> <el-radio v-model="editForm.effectiveType" label="2" :disabled="apear != 'couponAdd'">
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
<!-- 库存,集团版集团账号-无限制库存;其他-输入框 --> <!-- 库存,集团版集团账号-无限制库存;其他-输入框 -->
<template slot="stock" slot-scope="scope"> <template slot="stock" slot-scope="scope">
<span v-if="$isGroupUp">无库存限制</span> <span v-if="$isGroupUp">无库存限制</span>
<el-input v-else class="w-150" v-model="editForm[scope.scope.name]" placeholder="请输入库存"> <el-input :disabled="apear != 'couponAdd'" v-else class="w-150" v-model="editForm[scope.scope.name]" placeholder="请输入库存">
<span slot="suffix">张</span> <span slot="suffix">张</span>
</el-input> </el-input>
</template> </template>
...@@ -158,13 +158,15 @@ export default { ...@@ -158,13 +158,15 @@ export default {
label: '会员价', label: '会员价',
name: 'vipPrice', name: 'vipPrice',
width: '150px', width: '150px',
type: 'input' type: 'input',
isHide: false
}, },
{ {
label: '门店价', label: '门店价',
name: 'shopPrice', name: 'shopPrice',
width: '150px', width: '150px',
type: 'input' type: 'input',
isHide: false
}, },
{ {
label: '库存', label: '库存',
...@@ -208,6 +210,13 @@ export default { ...@@ -208,6 +210,13 @@ export default {
created() { created() {
this.editRule.stock[0].required = !this.$isGroupUp this.editRule.stock[0].required = !this.$isGroupUp
let hideAttrList = ['vipPrice', 'shopPrice']
if (this.$isGroupUp) {
hideAttrList.forEach(item => {
let idx = this.editFormData.findIndex(k => k.name == item)
this.editFormData[idx].isHide = true
})
}
}, },
mounted() { mounted() {
...@@ -294,7 +303,7 @@ export default { ...@@ -294,7 +303,7 @@ export default {
} }
//有效期 //有效期
//有效类型 1:固定天数,领取后计算 2:时间段,3:无有效期 //有效类型 1:固定天数,领取后计算 2:时间段,3:永久有效
if (this.editForm.effectiveType == 2) { if (this.editForm.effectiveType == 2) {
this.editForm.effectiveTime = [this.editForm.effectiveStartTime, this.editForm.effectiveEndTime] this.editForm.effectiveTime = [this.editForm.effectiveStartTime, this.editForm.effectiveEndTime]
} }
...@@ -353,7 +362,7 @@ export default { ...@@ -353,7 +362,7 @@ export default {
obj.discountType = '7' obj.discountType = '7'
//有效期 //有效期
//有效类型 1:固定天数,领取后计算 2:时间段,3:无有效期 //有效类型 1:固定天数,领取后计算 2:时间段,3:永久有效
obj.effectiveType = form.effectiveType obj.effectiveType = form.effectiveType
if (form.effectiveType == 1) { if (form.effectiveType == 1) {
//固定天数 //固定天数
......
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
<div class="table-btns" slot="auth-button" slot-scope="scope"> <div class="table-btns" slot="auth-button" slot-scope="scope">
<GLButton v-if="scope.scope.status == '1'" type="text" @click="start(scope.scope)" fn="生效" display="disabled" mode="el-button">生效</GLButton> <GLButton v-if="scope.scope.status == '1'" type="text" @click="start(scope.scope)" fn="生效" display="disabled" mode="el-button">生效</GLButton>
<el-button v-if="scope.scope.status == '2'" type="text" @click="end(scope.scope)">失效</el-button> <el-button v-if="scope.scope.status == '2'" type="text" @click="end(scope.scope)">失效</el-button>
<GLButton v-if="scope.scope.status == '2' || scope.scope.status == '3'" type="text" @click="handleEdit(3, scope.scope)" :fn="scope.scope.discountType == 3 ? '查看代金券' : scope.scope.discountType == 7 ? '查看服务券' : scope.scope.discountType == 2 ? '查看折扣券' : '查看兑换券'" mode="el-button">查看</GLButton> <GLButton v-if="scope.scope.status == '2' || scope.scope.status == '3'" type="text" @click="handleEdit(3, scope.scope)" :fn="scope.scope.discountType == 3 ? '查看代金券' : scope.scope.discountType == 7 ? '查看会员服务' : scope.scope.discountType == 2 ? '查看折扣券' : '查看兑换券'" mode="el-button">查看</GLButton>
<GLButton v-if="scope.scope.status == '1' || scope.scope.status == '3'" type="text" @click="del(scope.scope)" fn="删除" mode="el-button" display="disabled">删除</GLButton> <GLButton v-if="scope.scope.status == '1' || scope.scope.status == '3'" type="text" @click="del(scope.scope)" fn="删除" mode="el-button" display="disabled">删除</GLButton>
<GLButton type="text" @click="receiveDetail(scope.scope)" fn="领取详情" mode="el-button">领取详情</GLButton> <GLButton type="text" @click="receiveDetail(scope.scope)" fn="领取详情" mode="el-button">领取详情</GLButton>
</div> </div>
...@@ -131,7 +131,7 @@ export default { ...@@ -131,7 +131,7 @@ export default {
case 2: case 2:
return dayjs(cellValue.effectiveStartTime).format('YYYY-MM-DD HH:mm:ss') + '-' + dayjs(cellValue.effectiveEndTime).format('YYYY-MM-DD HH:mm:ss') return dayjs(cellValue.effectiveStartTime).format('YYYY-MM-DD HH:mm:ss') + '-' + dayjs(cellValue.effectiveEndTime).format('YYYY-MM-DD HH:mm:ss')
case 3: case 3:
return '无有效期' return '永久有效'
default: default:
return '-' return '-'
} }
......
...@@ -250,8 +250,8 @@ export default { ...@@ -250,8 +250,8 @@ export default {
var params = JSON.parse(JSON.stringify(this.searchForm)) var params = JSON.parse(JSON.stringify(this.searchForm))
params.couponId = this.$route.params.id params.couponId = this.$route.params.id
if (params.daterange) { if (params.daterange) {
params.receiveTimeBegin = this.searchForm.daterange[0] params.receiveTimeBegin = new Date(this.searchForm.daterange[0]).toLocaleDateString().replace(/\//g, '-') + ' 00:00:00'
params.receiveTimeEnd = this.searchForm.daterange[1] params.receiveTimeEnd = new Date(this.searchForm.daterange[1]).toLocaleDateString().replace(/\//g, '-') + ' 23:59:59'
} else { } else {
if (params.beginTime) delete params.beginTime && delete params.endTime if (params.beginTime) delete params.beginTime && delete params.endTime
} }
...@@ -282,8 +282,8 @@ export default { ...@@ -282,8 +282,8 @@ export default {
//时间段 //时间段
this.coupon.effectiveTxt = coupon.effectiveStartTime + ' - ' + coupon.effectiveEndTime this.coupon.effectiveTxt = coupon.effectiveStartTime + ' - ' + coupon.effectiveEndTime
} else if (coupon.effectiveType == 3) { } else if (coupon.effectiveType == 3) {
//无有效期 //永久有效
this.coupon.effectiveTxt = '无有效期' this.coupon.effectiveTxt = '永久有效'
} }
if (coupon.discountType == 3) { if (coupon.discountType == 3) {
......
...@@ -327,8 +327,8 @@ export default { ...@@ -327,8 +327,8 @@ export default {
getParams() { getParams() {
var params = JSON.parse(JSON.stringify(this.searchForm)) var params = JSON.parse(JSON.stringify(this.searchForm))
if (params.daterange) { if (params.daterange) {
params.verificationTimeStart = this.searchForm.daterange[0] params.verificationTimeStart = new Date(this.searchForm.daterange[0]).toLocaleDateString().replace(/\//g, '-') + ' 00:00:00'
params.verificationTimeEnd = this.searchForm.daterange[1] params.verificationTimeEnd = new Date(this.searchForm.daterange[1]).toLocaleDateString().replace(/\//g, '-') + ' 23:59:59'
} else { } else {
if (params.beginTime) delete params.beginTime && delete params.endTime if (params.beginTime) delete params.beginTime && delete params.endTime
} }
...@@ -400,7 +400,7 @@ export default { ...@@ -400,7 +400,7 @@ export default {
handleExport(row) { handleExport(row) {
var params = this.getParams() var params = this.getParams()
this.$apis.record.verificationExportApi(params).then(res => { this.$apis.couponManage.verificationExportApi(params).then(res => {
exportFn(res) exportFn(res)
}) })
}, },
......
...@@ -162,8 +162,8 @@ export default { ...@@ -162,8 +162,8 @@ export default {
//时间段 //时间段
this.effective = coupon.effectiveStartTime + ' ~ ' + coupon.effectiveEndTime this.effective = coupon.effectiveStartTime + ' ~ ' + coupon.effectiveEndTime
} else if (coupon.effectiveType == 3) { } else if (coupon.effectiveType == 3) {
//无有效期 //永久有效
this.effective = '无有效期' this.effective = '永久有效'
} }
if (coupon.discountType == 3) { if (coupon.discountType == 3) {
......
...@@ -362,20 +362,6 @@ export default { ...@@ -362,20 +362,6 @@ export default {
this.$refs.selectLabel.init(this.tagging) this.$refs.selectLabel.init(this.tagging)
}, },
handleSubmit() { handleSubmit() {
// let arr = []
// this.tagging.forEach(item => {
// item.labelList.forEach(tag => {
// arr.push({
// groupId: parseInt(item.labelGroup.id),
// groupName: item.labelGroup.name,
// labelId: parseInt(tag.id),
// labelName: tag.name,
// groupType: item.labelType
// })
// })
// })
// this.taggingList = arr
// console.log(this.taggingList)
this.$refs.basicForm.validate(valid => { this.$refs.basicForm.validate(valid => {
if (valid) { if (valid) {
this.attachmentShow = true this.attachmentShow = true
...@@ -394,7 +380,7 @@ export default { ...@@ -394,7 +380,7 @@ export default {
this.attachmentText = '请输入群发内容' this.attachmentText = '请输入群发内容'
return return
} }
this.$refs.groupForm.validate(v => { this.$refs.groupForm.validate(async(v) => {
if (v) { if (v) {
const params = this.getSiftMembers() const params = this.getSiftMembers()
params.type = 1 params.type = 1
...@@ -412,7 +398,7 @@ export default { ...@@ -412,7 +398,7 @@ export default {
if (item.attType == 1) { if (item.attType == 1) {
const list = emoji.flat(Infinity) const list = emoji.flat(Infinity)
const cutImg = item.attContent.replaceAll('<img src="https://img01.glsx.com.cn/weapp/resource/saas/scrm/emoji/', '') const cutImg = item.attContent.replaceAll('<img src="https://img01.glsx.com.cn/weapp/resource/saas/scrm/emoji/', '')
const replaceImg = cutImg.replace(/(\d){3}.png">/g, function (str) { const replaceImg = cutImg.replace(/(\d){3}.png">/g, function(str) {
let s = list[parseInt(str.split('.')[0]) - 1] let s = list[parseInt(str.split('.')[0]) - 1]
return `[${s}]` return `[${s}]`
}) })
...@@ -427,27 +413,37 @@ export default { ...@@ -427,27 +413,37 @@ export default {
if (params.sendType == 2) { if (params.sendType == 2) {
params.sendTimeStr = this.basicForm.sendTime + ' ' + this.basicForm.sendDate params.sendTimeStr = this.basicForm.sendTime + ' ' + this.basicForm.sendDate
} }
this.addLoading = true const countParams = this.getSiftMembers()
this.$apis.customerTransform.insert(params).then(res => { const count = await this.$apis.customerTransform.customerCount(countParams)
if (res.code == '-1') { console.log(count)
this.$message({ if (count) {
type: 'error', this.addLoading = true
message: res.message this.$apis.customerTransform.insert(params).then(res => {
}) if (res.code == '-1') {
} else if (res.code == 0) { this.$message({
this.$message({ type: 'error',
type: 'success', message: res.message
message: '操作成功!' })
}) } else if (res.code == 0) {
} else { this.$message({
this.$message({ type: 'success',
type: 'error', message: '操作成功!'
message: res.message })
}) } else {
} this.$message({
this.addLoading = false type: 'error',
this.$router.push('/customerTransform/index') message: res.message
}) })
}
this.addLoading = false
this.$router.push('/customerTransform/index')
})
} else {
this.$message({
type: 'error',
message: '客户数不可为0!'
})
}
} }
}) })
} }
...@@ -455,15 +451,6 @@ export default { ...@@ -455,15 +451,6 @@ export default {
}, },
handleSelect(val) { handleSelect(val) {
this.isUpdate = true this.isUpdate = true
// const arr = []
// if (val.length != 0) {
// val.forEach(item => {
// if (item.labelList.length != 0) {
// item.labelList.map(i => arr.push(i))
// }
// // arr.push(item.labelList)
// })
// }
this.tagging = val this.tagging = val
let arr = [] let arr = []
this.tagging.forEach(item => { this.tagging.forEach(item => {
...@@ -538,7 +525,8 @@ export default { ...@@ -538,7 +525,8 @@ export default {
// tagId: tagFlag ? this.tagging.map(item => item.id).join(',') : '', // tagId: tagFlag ? this.tagging.map(item => item.id).join(',') : '',
// tagName: tagFlag ? this.tagging.map(item => item.name).join(',') : '' // tagName: tagFlag ? this.tagging.map(item => item.name).join(',') : ''
// tagId: JSON.stringify(this.tagging) // tagId: JSON.stringify(this.tagging)
labelList: this.taggingList labelList: this.taggingList,
combineType: 2
} }
} }
if (this.basicForm.condition.date) { if (this.basicForm.condition.date) {
...@@ -593,7 +581,9 @@ export default { ...@@ -593,7 +581,9 @@ export default {
const date = new Date(v).getTime() const date = new Date(v).getTime()
if (date < Date.now()) { if (date < Date.now()) {
this.timeOptions = { this.timeOptions = {
selectableRange: `${dayjs().add(1, 'm').format('HH:mm')}:00 - 23:59:59` selectableRange: `${dayjs()
.add(1, 'm')
.format('HH:mm')}:00 - 23:59:59`
} }
} else { } else {
this.timeOptions = { this.timeOptions = {
......
<template> <template>
<div class="tag-main"> <div class="tag-main">
<el-dialog title="选择标签" :visible.sync="dialogVisible" width="50%" :before-close="handleClose"> <el-dialog title="选择标签" :visible.sync="dialogVisible" width="70%" :before-close="handleClose">
<div class="tag-panel"> <div class="tag-panel">
<div class="tag-panel-select"> <div class="tag-panel-select">
<div class="tag-title">预选标签</div> <div class="tag-title">预选标签</div>
<div class="tag-select-box"> <div class="tag-select-box">
<div class="tag-box-header"> <div class="tag-box-header">
<el-input size="small" v-model="labelGroupName" placeholder="请输入搜索内容" clearable @keydown.enter.native="handleSearch"></el-input> <el-input size="small" v-model="labelGroupName" placeholder="请输入搜索内容"></el-input>
<el-button size="small" type="primary" @click="handleSearch">查询</el-button> <el-button size="small" type="primary" @click="handleSearch">查询</el-button>
<el-button size="small" @click="handleReset">重置</el-button> <el-button size="small" @click="handleReset">重置</el-button>
</div> </div>
<div class="checkbox-group-box" :style="{ height: heightBox + 'px' }"> <div class="checkbox-group-box" :style="{ height: heightBox + 'px' }" v-loading="loading">
<div style="margin-bottom: 8px" class="checkbox-box" v-for="(item, index) in labelTreeRets" :key="index" @click.self="item.checked = !item.checked"> <div style="margin-bottom: 8px" v-for="(item, index) in labelTreeRets" :key="index">
<span class="el-tree-node__expand-icon el-icon-caret-right" :class="{ expanded: item.checked }" @click.self="item.checked = !item.checked"></span> <span class="el-tree-node__expand-icon el-icon-caret-right" :class="{ expanded: item.checked }" @click.self="item.checked = !item.checked"></span>
{{ item.labelGroup.name }} <el-checkbox :indeterminate="item.isIndeterminate" v-model="item.checkAll" @change="handleCheckAllChange(item.checkAll, index)">{{ item.labelGroup.name }}({{ item.tagChecked.length }}/{{ item.labelList.length }} 项)</el-checkbox>
<el-tag :size="size">{{ item.labelType }}</el-tag> <el-tag :size="size" class="tag-show">{{ item.labelType }}</el-tag>
<el-radio-group class="tag-group" v-model="item.tagChecked" v-show="item.checked"> <div style="margin: 15px 0"></div>
<el-checkbox-group class="tag-group" v-model="item.tagChecked" @change="handleCheckedChange(item.tagChecked, index)" v-show="item.checked">
<div v-for="(itm, idx) in item.labelList" :key="idx" class="radio-tag"> <div v-for="(itm, idx) in item.labelList" :key="idx" class="radio-tag">
<el-tooltip effect="dark" placement="top" :disabled="itm.name.length < 8"> <el-tooltip effect="dark" placement="top" :disabled="itm.name.length < 8">
<el-radio class="radio-text" :label="itm">{{ itm.name }}</el-radio> <el-checkbox class="check-text" :label="itm">{{ itm.name }}</el-checkbox>
<!-- <el-radio :label="itm">{{ itm.name.length > 4 ? itm.name.slice(0, 3) + '...' : itm.name }}</el-radio> -->
<div slot="content">{{ itm.name }}</div> <div slot="content">{{ itm.name }}</div>
</el-tooltip> </el-tooltip>
</div> </div>
</el-radio-group> </el-checkbox-group>
</div> </div>
</div> </div>
</div> </div>
...@@ -33,10 +33,12 @@ ...@@ -33,10 +33,12 @@
<div class="tag-select-box"> <div class="tag-select-box">
<div class="tag-box-header">标签名称({{ selectNum }}项)</div> <div class="tag-box-header">标签名称({{ selectNum }}项)</div>
<div class="tag-selected-box" :style="{ height: heightBox + 'px' }"> <div class="tag-selected-box" :style="{ height: heightBox + 'px' }">
<template v-for="item in labelTreeRets"> <template v-for="item in labelTreeRetSelect">
<el-tag :title="item.tagChecked.name" v-if="item.tagChecked" type="info" class="tag-selected-item" :key="item.tagChecked" closable :disable-transitions="false" @close="remove(item, idx)"> <template v-for="(tag, idx) in item.tagChecked">
{{ item.tagChecked.name }} <el-tag :title="tag.name" type="info" class="tag-selected-item" :key="idx" v-if="tag" closable :disable-transitions="false" @close="remove(item, idx)">
</el-tag> {{ tag.name }}
</el-tag>
</template>
</template> </template>
</div> </div>
</div> </div>
...@@ -58,47 +60,22 @@ export default { ...@@ -58,47 +60,22 @@ export default {
name: 'activityModel', name: 'activityModel',
data() { data() {
return { return {
loading: false,
heightBox: 200, heightBox: 200,
dialogVisible: false, dialogVisible: false,
labelGroupName: '', labelGroupName: '',
selectNum: 0, selectNum: 0,
searchStatus: false, searchStatus: false,
labelTreeRets: [ labelTreeRetSelect: [],
// { labelTreeRets: []
// labelGroup: { id: '109', name: '湖口123' },
// labelList: [
// { id: '372', name: '12345678' },
// { id: '371', name: '7654321' },
// { id: '370', name: '1234567' }
// ],
// checked: false,
// tagChecked: [],
// isIndeterminate: false,
// checkAll: false
// },
// {
// labelGroup: { id: '65', name: '自店标签111' },
// labelList: [
// { id: '179', name: '标签44' },
// { id: '178', name: '标签33' },
// { id: '176', name: '标签1112' }
// ],
// checked: false,
// tagChecked: [],
// isIndeterminate: false,
// checkAll: false
// }
]
} }
}, },
watch: { watch: {
labelTreeRets: { labelTreeRetSelect: {
handler() { handler() {
this.selectNum = 0 this.selectNum = 0
this.labelTreeRets.forEach(item => { this.labelTreeRetSelect.forEach(item => {
if (item.tagChecked) { this.selectNum += item.tagChecked.length
this.selectNum++
}
}) })
}, },
deep: true deep: true
...@@ -119,18 +96,16 @@ export default { ...@@ -119,18 +96,16 @@ export default {
this.querylabeltree() this.querylabeltree()
}, },
querylabeltree(selectItem) { querylabeltree(selectItem) {
console.log(selectItem, '-----') this.loading = true
this.$apis.customerTransform this.$apis.customerTransform
.querylabeltree({ .querylabeltree({
labelTreeReq: { labelTreeReq: {
pageNum: 1, pageNum: 1,
pageSize: 1000, pageSize: 1000,
shopId: this.$globalState.session.merchantId, shopId: this.$globalState.session.merchantId,
// shopId: '44210934',
labelGroupName: this.labelGroupName, labelGroupName: this.labelGroupName,
// labelTypesStr: '自店标签,企业标签', // labelTypesStr: '自店标签,企业标签',
edition: this.$globalState.session.merchantModel edition: this.$globalState.session.merchantModel
// edition: 4
} }
}) })
.then(res => { .then(res => {
...@@ -142,7 +117,7 @@ export default { ...@@ -142,7 +117,7 @@ export default {
labelGroup: item.labelGroup, labelGroup: item.labelGroup,
labelList: item.labelList, labelList: item.labelList,
checked: false, checked: false,
tagChecked: null, tagChecked: [],
isIndeterminate: false, isIndeterminate: false,
checkAll: false checkAll: false
} }
...@@ -151,55 +126,94 @@ export default { ...@@ -151,55 +126,94 @@ export default {
selectItem.forEach(item => { selectItem.forEach(item => {
this.labelTreeRets.forEach(tag => { this.labelTreeRets.forEach(tag => {
if (item.labelGroup.id == tag.labelGroup.id) { if (item.labelGroup.id == tag.labelGroup.id) {
let labelId = item.labelList[0].id let labelList = []
let index = tag.labelList.findIndex(iem => iem.id == labelId) item.labelList.forEach(x => {
console.log(index) labelList.push(x.id)
// tag.tagChecked = item.tagChecked })
tag.tagChecked = tag.labelList[index] this.$nextTick(() => {
tag.tagChecked = tag.labelList.filter(i => labelList.includes(i.id))
})
} }
}) })
}) })
console.log(this.labelTreeRets) this.labelTreeRets.forEach((item, index) => {
this.$nextTick(() => {
this.handleCheckedChange(item.tagChecked, index)
})
})
this.labelTreeRetSelect = utils.deepClone(this.labelTreeRets)
} else { } else {
const labelTreeRets = utils.deepClone(this.labelTreeRets)
console.log(labelTreeRets)
this.labelTreeRets = res.labelTreeRets.map(item => { this.labelTreeRets = res.labelTreeRets.map(item => {
return { return {
labelType: item.labelType == '企业标签' ? (this.$globalState.session.merchantModel == 1 ? '集团标签' : '企业标签') : item.labelType, labelType: item.labelType == '企业标签' ? (this.$globalState.session.merchantModel == 1 ? '集团标签' : '企业标签') : item.labelType,
labelGroup: item.labelGroup, labelGroup: item.labelGroup,
labelList: item.labelList, labelList: item.labelList,
checked: false, checked: false,
tagChecked: null, tagChecked: [],
isIndeterminate: false, isIndeterminate: false,
checkAll: false checkAll: false
} }
}) })
console.log(labelTreeRets) this.labelTreeRets.forEach((item, index) => {
labelTreeRets.forEach(item => { this.labelTreeRetSelect.forEach(itm => {
this.labelTreeRets.forEach(tag => { if (itm.labelGroup.id == item.labelGroup.id && itm.tagChecked.length > 0) {
if (item.labelGroup.id == tag.labelGroup.id) { let tagChecked = []
let labelId = item.tagChecked ? item.tagChecked.id : '' itm.tagChecked.forEach(x => {
let index = tag.labelList.findIndex(iem => iem.id == labelId) tagChecked.push(x.id)
tag.tagChecked = tag.labelList[index] })
this.$nextTick(() => {
item.tagChecked = item.labelList.filter(i => tagChecked.includes(i.id))
})
this.$nextTick(() => {
this.handleCheckedChange(itm.tagChecked, index, 1)
})
} }
}) })
}) })
if (this.labelTreeRetSelect.length == 0) {
this.labelTreeRetSelect = utils.deepClone(this.labelTreeRets)
}
} }
this.$nextTick(() => {
this.loading = false
})
}) })
}, },
remove(item, idx) { remove(items, idx) {
item.tagChecked = null items.tagChecked.splice(idx, 1)
this.labelTreeRets.forEach(item => {
this.labelTreeRetSelect.forEach(itm => {
if (item.labelGroup.id == itm.labelGroup.id) {
let tagChecked = []
itm.tagChecked.forEach(x => {
tagChecked.push(x.id)
})
this.$nextTick(() => {
item.tagChecked = item.labelList.filter(i => tagChecked.includes(i.id))
})
}
if (item.tagChecked.length == 0) {
this.$nextTick(() => {
item.checkAll = false
})
}
})
})
this.labelTreeRets.forEach((item, index) => {
this.$nextTick(() => {
this.handleCheckedChange(item.tagChecked, index)
})
})
}, },
//选中 //选中
handleSelect() { handleSelect() {
this.dialogVisible = false this.dialogVisible = false
let labelTreeRets = this.labelTreeRets let labelTreeRets = this.labelTreeRetSelect
.map(item => { .map(item => {
if (item.tagChecked) { if (item.tagChecked.length) {
return { return {
labelGroup: item.labelGroup, labelGroup: item.labelGroup,
labelType: item.labelType, labelList: item.tagChecked
labelList: [item.tagChecked]
} }
} }
}) })
...@@ -207,6 +221,45 @@ export default { ...@@ -207,6 +221,45 @@ export default {
console.log(labelTreeRets) console.log(labelTreeRets)
this.$emit('tagSelected', labelTreeRets) this.$emit('tagSelected', labelTreeRets)
}, },
//全选
handleCheckAllChange(val, index) {
console.log(val, index)
console.log(this.labelTreeRetSelect, '==12')
if (val) {
this.labelTreeRets[index].tagChecked = []
this.labelTreeRets[index].labelList.forEach(item => {
this.labelTreeRets[index].tagChecked.push(item)
})
} else {
this.labelTreeRets[index].tagChecked = []
}
this.labelTreeRets[index].isIndeterminate = false
this.labelTreeRets.forEach(item => {
this.labelTreeRetSelect.forEach(itm => {
if (item.labelGroup.id == itm.labelGroup.id) {
itm.tagChecked = utils.deepClone(item.tagChecked)
}
})
})
console.log(this.labelTreeRets, '==1532')
},
//选中
handleCheckedChange(value, index, status) {
console.log(value, index, status)
let checkedCount = value.length
this.labelTreeRets[index].checkAll = checkedCount === this.labelTreeRets[index].labelList.length
this.labelTreeRets[index].isIndeterminate = checkedCount > 0 && checkedCount < this.labelTreeRets[index].labelList.length
if (!status) {
this.labelTreeRets.forEach(item => {
this.labelTreeRetSelect.forEach(itm => {
if (item.labelGroup.id == itm.labelGroup.id) {
itm.tagChecked = utils.deepClone(item.tagChecked)
}
})
})
}
},
// 重置
handleReset() { handleReset() {
this.labelGroupName = '' this.labelGroupName = ''
this.querylabeltree() this.querylabeltree()
...@@ -220,9 +273,6 @@ export default { ...@@ -220,9 +273,6 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
// ::v-deep .el-tag{
// color: red !important;
// }
.dialog-jump { .dialog-jump {
color: #5850ff; color: #5850ff;
float: left; float: left;
...@@ -299,50 +349,30 @@ export default { ...@@ -299,50 +349,30 @@ export default {
font-size: 16px; font-size: 16px;
} }
.tag-group { .tag-group {
margin-left: 26px; margin-left: 40px;
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
.radio-tag { .radio-tag {
display: inline-block; display: inline-block;
width: 50%; width: 50%;
.el-radio { .el-checkbox {
margin: 8px 0; width: 40%;
display: inline-flex; margin-bottom: 6px;
display: flex;
align-items: center; align-items: center;
/deep/.el-radio__inner {
box-shadow: none !important;
}
/deep/.el-radio__label {
display: inline-block;
max-width: 120px;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
word-wrap: break-word;
}
} }
} }
} }
} }
} }
.tag-show {
color: #aaa5fa !important;
font-size: 12px;
border: none;
background: rgba(88, 80, 255, 0.1);
}
.checkbox-group-box { .checkbox-group-box {
overflow: auto; overflow: auto;
.checkbox-box {
cursor: pointer;
font-size: 14px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #333333;
line-height: 20px;
/deep/ {
.el-tag {
color: #aaa5fa !important;
font-size: 12px;
border: none;
background: rgba($color: #5850ff, $alpha: 0.1);
}
}
}
} }
.tag-selected-box { .tag-selected-box {
min-height: 200px; min-height: 200px;
......
...@@ -308,13 +308,13 @@ export default { ...@@ -308,13 +308,13 @@ export default {
width: '180', width: '180',
addHtml: 'accountName' addHtml: 'accountName'
}, },
// { {
// label: '会员类型', label: '会员类型',
// prop: 'memberType', prop: 'memberType',
// formatter: cellValue => { formatter: cellValue => {
// return this.baseDataList.memberTypeList.find(item => item.confId == cellValue.memberType).confName return this.baseDataList.memberTypeList.find(item => item.confId == cellValue.memberType).confName
// } }
// }, },
{ {
label: '状态', label: '状态',
prop: 'status', prop: 'status',
...@@ -424,7 +424,8 @@ export default { ...@@ -424,7 +424,8 @@ export default {
str = '' str = ''
} //限制只能输入一个小数点 } //限制只能输入一个小数点
if (value !== '' && value == 0) { if (value !== '' && value == 0) {
return (str = 1) // return (str = 1)
return (str = 0.01)
} }
if (Number(value) >= 99999) { if (Number(value) >= 99999) {
return (str = 99999) return (str = 99999)
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
<el-input :size="size" v-model="searchForm.packageName" placeholder="请输入名称" clearable></el-input> <el-input :size="size" v-model="searchForm.packageName" placeholder="请输入名称" clearable></el-input>
</el-form-item> </el-form-item>
<el-form-item size="small" label="类型" style="margin-left: -10px"> <el-form-item size="small" label="类型" style="margin-left: -10px">
<el-select size="small" v-model="searchForm.orderType" :disabled="merchantModel == 1 && accountLevel == 1" placeholder="请选择"> <el-select size="small" v-model="searchForm.orderType" placeholder="请选择">
<el-option v-for="item in orderTypeList" :key="item.dictValue" :label="item.dictLabel" :value="item.dictValue"></el-option> <el-option v-for="item in orderTypeList" :key="item.dictValue" :label="item.dictLabel" :value="item.dictValue"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
......
...@@ -32,12 +32,16 @@ ...@@ -32,12 +32,16 @@
</template> </template>
</glsx-descriptions> </glsx-descriptions>
</div> </div>
<template v-if="accountLevel != 4"> <template v-if="detailData.orderType == 1">
<div class="order-info m-b-7"> <div class="order-info m-b-7">
<div class="order-info-title">套餐使用详情</div> <div class="order-info-title">套餐使用详情</div>
<GLTable class="meal-table" ref="mealRef" :searchForm="tableSearchForm" :getListApi="getListApi" :hasPage="false" :tableParams="tableParams"> <GLTable class="meal-table" ref="mealRef" :searchForm="tableSearchForm" :getListApi="getListApi" :hasPage="false" :tableParams="tableParams">
<div slot="verification" slot-scope="scope"> <div slot="verification" slot-scope="scope">
<GLTable :hasNum="false" :hasPage="false" :noDataImg="url" :tableParams="verificationParams" :tableData="scope.scope.verificationPackageCouponList"></GLTable> <GLTable :hasNum="false" :hasPage="false" :noDataImg="url" :tableParams="verificationParams" :tableData="scope.scope.verificationPackageCouponList">
<span slot="verificationDate" slot-scope="scope">
{{ dateFormatFun(scope.scope.verificationDate) }}
</span>
</GLTable>
</div> </div>
<div slot="discountType" slot-scope="scope"> <div slot="discountType" slot-scope="scope">
<img class="content-meal-logo" :src="numToCoupon[scope.scope.discountType]" /> <img class="content-meal-logo" :src="numToCoupon[scope.scope.discountType]" />
...@@ -285,7 +289,8 @@ export default { ...@@ -285,7 +289,8 @@ export default {
}, },
{ {
label: '核销日期', label: '核销日期',
prop: 'verificationDate' prop: 'verificationDate',
addHtml: 'verificationDate'
} }
] ]
}, },
...@@ -302,7 +307,7 @@ export default { ...@@ -302,7 +307,7 @@ export default {
if (window.__POWERED_BY_QIANKUN__) { if (window.__POWERED_BY_QIANKUN__) {
this.accountLevel = this.$globalState.session.accountLevel this.accountLevel = this.$globalState.session.accountLevel
if (this.accountLevel == 4) { if (this.accountLevel == 4) {
this.basicParams.splice(6,1) this.basicParams.splice(6, 1)
} }
} }
this.tableSearchForm = { this.tableSearchForm = {
......
...@@ -97,6 +97,16 @@ export default { ...@@ -97,6 +97,16 @@ export default {
url: url, url: url,
loading: true, loading: true,
selectedSum: 0, selectedSum: 0,
scopeApplication: [
{
confId: '1',
confName: '旗下所有店通用'
},
{
confId: '2',
confName: '旗下品牌店通用'
}
],
orderShow: ['service', 'cash', 'discount', 'exchange'], orderShow: ['service', 'cash', 'discount', 'exchange'],
numToCoupon: { numToCoupon: {
2: 'discount', 2: 'discount',
...@@ -139,7 +149,7 @@ export default { ...@@ -139,7 +149,7 @@ export default {
// return (cellValue.anticipatedCost / 100).toFixed(2) // return (cellValue.anticipatedCost / 100).toFixed(2)
// } // }
// }, // },
{ {
label: '有效期', label: '有效期',
prop: 'effectiveType', prop: 'effectiveType',
addHtml: 'effectiveType' addHtml: 'effectiveType'
...@@ -150,9 +160,15 @@ export default { ...@@ -150,9 +160,15 @@ export default {
addHtml: 'effectiveType' addHtml: 'effectiveType'
}, },
{ {
label: '使用限制', label: '适用范围',
prop: 'useType', name: 'scopeApplication',
addHtml: 'useType' formatter: cellValue => {
var scopeApplication = '-'
if (cellValue.scopeApplication) {
scopeApplication = this.scopeApplication.find(item => item.confId == cellValue.scopeApplication).confName
}
return scopeApplication
}
}, },
{ {
label: '剩余库存', label: '剩余库存',
...@@ -300,7 +316,7 @@ export default { ...@@ -300,7 +316,7 @@ export default {
recoverySelected() { recoverySelected() {
// 翻页,去掉已选项 // 翻页,去掉已选项
var selectedData = this.$refs[this.activeName + 'Ref'].mutiSelectArr.list var selectedData = this.$refs[this.activeName + 'Ref'].mutiSelectArr.list
console.log(selectedData,'4444444444444444') console.log(selectedData, '4444444444444444')
var deleteList = [] var deleteList = []
this.addSelected() this.addSelected()
if (selectedData) { if (selectedData) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!