Commit 9ac97f6d by 前端

Merge branch 'v2.3.0' into 'v2.4.0'

V2.3.0

See merge request !156
2 parents 1a641c51 6b756417
import { http, http_common } from '@/main' import { http, http_common, http2 } from '@/main'
const defaultPath = 'scrm.api.carlife.' const defaultPath = 'scrm.api.carlife.'
const getMerchantGoodsListApi = params => { const getMerchantGoodsListApi = params => {
...@@ -94,4 +94,38 @@ const pictureUpload = params => { ...@@ -94,4 +94,38 @@ const pictureUpload = params => {
noSignAttr: ['file'] noSignAttr: ['file']
}) })
} }
export default { getMerchantGoodsListApi, getGoodsListApi, uploadImgApi, uploadVideoApi, getMerchantList, getSimpleMerchantList, getZoneListApi, getClassifyListApi, pictureUpload }
const querylabeltree = params => {
params.method = 'scrm.api.datahub.labelgroup.queryLabelTree'
// params.sessionId = session
return http2({
url: '/rop-scrm-datahub/router',
method: 'POST',
data: params,
sign: true
})
}
// 人群列表
const getCrowdTreeListApi = params => {
params.method = 'scrm.api.datahub.user.queryCrowdTree'
return http2({
url: '/rop-scrm-datahub/router',
method: 'POST',
data: params,
sign: true
})
}
// 跟进员工类型
const getStaffTypeListApi = params => {
params.method = 'entmicro.api.staff.listEntBusinessType'
return http({
url: '/rop-scrm-entmicro/router',
method: 'POST',
data: params,
sign: true
})
}
export default { getMerchantGoodsListApi, getGoodsListApi, uploadImgApi, uploadVideoApi, getMerchantList, getSimpleMerchantList, getZoneListApi, getClassifyListApi, pictureUpload, querylabeltree, getCrowdTreeListApi, getStaffTypeListApi }
...@@ -4,7 +4,6 @@ const defaultPath = 'scrm.api.coupon.' ...@@ -4,7 +4,6 @@ const defaultPath = 'scrm.api.coupon.'
//优惠券列表 //优惠券列表
const getCouponListApi = params => { const getCouponListApi = params => {
// params.method = `${defaultPath}list.merchant`
params.method = 'scrm.backstage.coupon.list.merchant' params.method = 'scrm.backstage.coupon.list.merchant'
return http({ return http({
url: 'rop-scrm-coupon/router', url: 'rop-scrm-coupon/router',
......
...@@ -77,6 +77,16 @@ const exportGiftInfoApi = params => { ...@@ -77,6 +77,16 @@ const exportGiftInfoApi = params => {
// 编辑-选择定向礼包列表 // 编辑-选择定向礼包列表
const getDirectionalGiftListApi = params => { const getDirectionalGiftListApi = params => {
params.method = 'scrm.api.coupon.directional.gift.coupon.list'
// params.method = 'scrm.api.coupon.gh.group.equity.coupon.list'
return http({
url: 'rop-scrm-coupon/router',
method: 'GET',
data: params,
sign: true
})
}
const getghDirectionalGiftListApi = params => {
// params.method = 'scrm.api.coupon.directional.gift.coupon.list' // params.method = 'scrm.api.coupon.directional.gift.coupon.list'
params.method = 'scrm.api.coupon.gh.group.equity.coupon.list' params.method = 'scrm.api.coupon.gh.group.equity.coupon.list'
return http({ return http({
...@@ -109,4 +119,4 @@ const templateModal = params => { ...@@ -109,4 +119,4 @@ const templateModal = params => {
}) })
} }
export default { getFollowerStaffListApi, getListApi, giftExportApi, deleteGiftApi, getGiftInfoApi, getReceivedGiftInfoApi, exportGiftInfoApi, getDirectionalGiftListApi, insertGiftApi, templateModal } export default { getFollowerStaffListApi, getListApi, giftExportApi, deleteGiftApi, getGiftInfoApi, getReceivedGiftInfoApi, exportGiftInfoApi, getDirectionalGiftListApi, insertGiftApi, templateModal ,getghDirectionalGiftListApi }
...@@ -40,7 +40,8 @@ const orderRefund = params => { ...@@ -40,7 +40,8 @@ const orderRefund = params => {
url: '/rop-scrm-equity/router', url: '/rop-scrm-equity/router',
method: 'GET', method: 'GET',
data: params, data: params,
sign: true sign: true,
returnAll: true
}) })
} }
//套餐使用详情 //套餐使用详情
......
...@@ -15,7 +15,17 @@ const getCustomerListApi = params => { ...@@ -15,7 +15,17 @@ const getCustomerListApi = params => {
// 标签获取客户列表 // 标签获取客户列表
const getCustomerByTagListApi = params => { const getCustomerByTagListApi = params => {
params.method = 'entmicro.api.customer.getCustomerPageByTag' params.method = 'entmicro.api.customer.getCustomerPageByTag'
params.source = 'scrm-home' return http({
url: 'rop-scrm-entmicro/router',
method: 'POST',
data: params,
sign: true
})
}
// 人群获取客户列表
const getCustomerCrowdApi = params => {
params.method = 'entmicro.api.customer.crowd.page'
return http({ return http({
url: 'rop-scrm-entmicro/router', url: 'rop-scrm-entmicro/router',
method: 'POST', method: 'POST',
...@@ -78,6 +88,17 @@ const getSopStaffTaskListApi = params => { ...@@ -78,6 +88,17 @@ const getSopStaffTaskListApi = params => {
}) })
} }
// sop-完成率-根据evnetid获取失败事件列表
const getFailEventList = params => {
params.method = 'scrm.api.sop.sopEvent.listEventFailByEventId'
return http({
url: 'rop-scrm-sop/router',
method: 'POST',
data: params,
sign: true
})
}
// 校验当前商户的企微群发任务情况 // 校验当前商户的企微群发任务情况
const getTaskStatusApi = params => { const getTaskStatusApi = params => {
params.method = 'scrm.api.sop.task.merchantWWMsgTaskStatusCheck' params.method = 'scrm.api.sop.task.merchantWWMsgTaskStatusCheck'
...@@ -204,4 +225,4 @@ const getMomentListApi = params => { ...@@ -204,4 +225,4 @@ const getMomentListApi = params => {
}) })
} }
export default { getCustomerListApi, getCustomerByTagListApi, getSopInfoListApi, getSopBaseInfoApi, getEventListApi, getSopCustomerStatisticsListApi, getSopStaffTaskListApi, getTaskStatusApi, parseEventCountApi, deleteSopEventApi, endSopEventApi, batchEditSopEventApi, insertOrUpdateSopApi, getSopInfoDetailApi, getGroupListApi, getMaterialListApi, getMomentListApi } export default { getCustomerListApi, getCustomerByTagListApi, getCustomerCrowdApi, getSopInfoListApi, getSopBaseInfoApi, getEventListApi, getSopCustomerStatisticsListApi, getSopStaffTaskListApi, getFailEventList, getTaskStatusApi, parseEventCountApi, deleteSopEventApi, endSopEventApi, batchEditSopEventApi, insertOrUpdateSopApi, getSopInfoDetailApi, getGroupListApi, getMaterialListApi, getMomentListApi }
...@@ -523,6 +523,14 @@ html { ...@@ -523,6 +523,14 @@ html {
border-radius: 4px 0px 0px 0px; border-radius: 4px 0px 0px 0px;
border: 1px solid #f4f6fc !important; border: 1px solid #f4f6fc !important;
} }
.marketing .tips-icon {
display: inline-block;
width: 14px;
height: 14px;
margin-right: 12px;
vertical-align: middle;
cursor: pointer;
}
.el-message--info { .el-message--info {
height: 40px; height: 40px;
......
...@@ -6,12 +6,11 @@ ...@@ -6,12 +6,11 @@
<el-form-item v-if="!item.isHide" :key="index" :id="item.name" :labelWidth="isEdit ? '144px' : labelWidth" :class="{ 'no-label': !item.label, isBlock: isBlock }" :style="{ 'margin-bottom': isEdit ? '24px' : '', 'margin-right': isEdit ? '0px' : '30px', ...item.style }" :label="item.label" :prop="item.name"> <el-form-item v-if="!item.isHide" :key="index" :id="item.name" :labelWidth="isEdit ? '144px' : labelWidth" :class="{ 'no-label': !item.label, isBlock: isBlock }" :style="{ 'margin-bottom': isEdit ? '24px' : '', 'margin-right': isEdit ? '0px' : '30px', ...item.style }" :label="item.label" :prop="item.name">
<span v-if="!item.isHide && item.tips" class="tips-block" slot="label"> <span v-if="!item.isHide && item.tips" class="tips-block" slot="label">
<span class="tips-label">{{ item.label }}</span> <span class="tips-label">{{ item.label }}</span>
<el-tooltip popper-class="tooltip-class" effect="dark" :content="item.tips" :placement="item.placement || 'top'"> <el-popover placement="top" width="200" trigger="hover" :content="item.tips">
<span class="tips-icon"></span> <img slot="reference" class="tips-icon" src="./images/icon-tip.png" />
</el-tooltip> </el-popover>
{{ item.label }}
</span> </span>
<span v-else-if="!item.isHide && item.label" slot="label"> <span v-else-if="!item.isHide && item.label && !item.tips" slot="label">
<span class="combi-form-label" :style="{ width: item.labelWidth ? item.labelWidth + labelPaddingRight + 'px' : '', 'padding-right': isEdit ? '12px' : labelPaddingRight + 'px' }">{{ item.label }}</span> <span class="combi-form-label" :style="{ width: item.labelWidth ? item.labelWidth + labelPaddingRight + 'px' : '', 'padding-right': isEdit ? '12px' : labelPaddingRight + 'px' }">{{ item.label }}</span>
</span> </span>
<slot v-if="item.addHtml" :name="item.addHtml" :scope="item"></slot> <slot v-if="item.addHtml" :name="item.addHtml" :scope="item"></slot>
...@@ -54,9 +53,12 @@ ...@@ -54,9 +53,12 @@
<slot :name="item.suffixSlot" :scope="item"></slot> <slot :name="item.suffixSlot" :scope="item"></slot>
</div> </div>
<!-- radio --> <!-- radio -->
<el-radio-group v-else-if="item.type === 'radio'" v-model="formObj[item.name]" v-bind="item.attrs ? item.attrs : {}" v-on="item.listeners ? item.listeners : {}" :disabled="item.isDisabled" @change="item.handleRadioChange"> <div v-else-if="item.type === 'radio'">
<el-radio-group v-model="formObj[item.name]" v-bind="item.attrs ? item.attrs : {}" v-on="item.listeners ? item.listeners : {}" :disabled="item.isDisabled" @change="item.handleRadioChange">
<el-radio v-for="subItem in item.optionList" :key="subItem[item.optionId]" :disabled="subItem.isDisabled" :label="subItem[item.optionId]">{{ subItem[item.optionLabel] }}</el-radio> <el-radio v-for="subItem in item.optionList" :key="subItem[item.optionId]" :disabled="subItem.isDisabled" :label="subItem[item.optionId]">{{ subItem[item.optionLabel] }}</el-radio>
</el-radio-group> </el-radio-group>
<slot :name="item.suffixSlot" :scope="item"></slot>
</div>
<el-date-picker v-else-if="item.type === 'datePicker'" v-model="formObj[item.name]" v-bind="item.attrs ? item.attrs : {}" v-on="item.listeners ? item.listeners : {}" :type="item.dateType || 'daterange'" :disabled="item.isDisabled" :value-format="item.valueFormat" :style="{ width: item.width || defaultWidth }" :clearable="item.isClear || false" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" :picker-options="item.customPickerOptions || pickerOption[item.pickerOptions]"></el-date-picker> <el-date-picker v-else-if="item.type === 'datePicker'" v-model="formObj[item.name]" v-bind="item.attrs ? item.attrs : {}" v-on="item.listeners ? item.listeners : {}" :type="item.dateType || 'daterange'" :disabled="item.isDisabled" :value-format="item.valueFormat" :style="{ width: item.width || defaultWidth }" :clearable="item.isClear || false" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" :picker-options="item.customPickerOptions || pickerOption[item.pickerOptions]"></el-date-picker>
<template v-else-if="item.type === 'upload'"> <template v-else-if="item.type === 'upload'">
<p class="photo-top-tips">{{ item.topTips }}</p> <p class="photo-top-tips">{{ item.topTips }}</p>
...@@ -307,36 +309,20 @@ export default { ...@@ -307,36 +309,20 @@ export default {
background-color: #fff; background-color: #fff;
} }
/* 提示图标 */ /* 提示图标 */
.glsx-combi-form .tips-block { /* .glsx-combi-form .tips-block {
position: relative; position: relative;
} } */
.glsx-combi-form .tips-label { .glsx-combi-form .tips-label {
margin-right: 20px; margin-right: 2px;
} }
.glsx-combi-form .tips-icon { .glsx-combi-form .tips-icon {
position: absolute;
display: inline-block; display: inline-block;
width: 12px; width: 14px;
height: 12px; height: 14px;
top: 3px; margin-right: 12px;
right: 14px; vertical-align: middle;
margin-right: 4px;
cursor: pointer; cursor: pointer;
border: 1px dotted #7f7f7f;
border-radius: 50%;
} }
.glsx-combi-form .tips-icon::before {
content: '?';
position: absolute;
width: 8px;
height: 8px;
top: -8px;
left: 1px;
font-size: 10px;
}
/* .glsx-combi-form .tips {
margin: 0;
} */
.glsx-combi-form .combi-form-label { .glsx-combi-form .combi-form-label {
display: inline-block; display: inline-block;
box-sizing: border-box; box-sizing: border-box;
......
...@@ -17,6 +17,7 @@ import selectMutiProForcouponDialog from '@/components/selectMutiProDialog/index ...@@ -17,6 +17,7 @@ import selectMutiProForcouponDialog from '@/components/selectMutiProDialog/index
import tableTooltip from '@/components/table-tooltip/index.vue' import tableTooltip from '@/components/table-tooltip/index.vue'
import glsxRows from '@/components/glsx-rows/index.vue' import glsxRows from '@/components/glsx-rows/index.vue'
import glsxDescriptions from '@/components/glsx-descriptions/index.vue' import glsxDescriptions from '@/components/glsx-descriptions/index.vue'
import selectTag from '@/components/selectTag/index.vue'
Vue.component('glsx-combi-form', glsxCombiForm) Vue.component('glsx-combi-form', glsxCombiForm)
Vue.component('glsx-dialog', glsxDialog) Vue.component('glsx-dialog', glsxDialog)
...@@ -27,3 +28,4 @@ Vue.component('select-muti-pro-forcoupon-dialog', selectMutiProForcouponDialog) ...@@ -27,3 +28,4 @@ Vue.component('select-muti-pro-forcoupon-dialog', selectMutiProForcouponDialog)
Vue.component('table-tooltip', tableTooltip) Vue.component('table-tooltip', tableTooltip)
Vue.component('glsx-rows', glsxRows) Vue.component('glsx-rows', glsxRows)
Vue.component('glsx-descriptions', glsxDescriptions) Vue.component('glsx-descriptions', glsxDescriptions)
Vue.component('select-tag', selectTag)
\ No newline at end of file \ No newline at end of file
<template>
<div class="tag-main">
<el-dialog title="选择标签" :visible.sync="dialogVisible" width="70%" :before-close="handleClose">
<div class="tag-panel">
<div class="tag-panel-select">
<div class="tag-title">预选标签</div>
<div class="tag-select-box">
<div class="tag-box-header">
<el-input size="small" v-model="labelGroupName" placeholder="请输入搜索内容"></el-input>
<el-button size="small" type="primary" @click="handleSearch">查询</el-button>
</div>
<div class="checkbox-group-box" :style="{ height: heightBox + 'px' }" v-loading="loading">
<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>
<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>
<div style="margin: 15px 0"></div>
<el-checkbox-group class="tag-group" v-model="item.tagChecked" @change="handleCheckedChange(item.tagChecked, index)" v-if="item.checked">
<el-checkbox v-for="(itm, idx) in item.labelList" :label="itm" :key="idx">{{ itm.name }}</el-checkbox>
</el-checkbox-group>
</div>
</div>
</div>
</div>
<div class="tag-panel-selected">
<div class="tag-title">已选标签</div>
<div class="tag-select-box">
<div class="tag-box-header">标签名称({{ selectNum }}项)</div>
<div class="tag-selected-box" :style="{ height: heightBox + 'px' }">
<template v-for="item in labelTreeRetSelect">
<template v-for="(tag, idx) in item.tagChecked">
<el-tag :title="tag.name" type="info" class="customer-tag-selected-item" :key="idx" v-if="tag" closable :disable-transitions="false" @close="remove(item, idx)">
<!-- {{ tag.name }} -->
{{ tag.name.length > 11 ? tag.name.slice(0, 11) + '...' : tag.name }}
</el-tag>
</template>
</template>
</div>
</div>
</div>
</div>
<span slot="footer" class="dialog-footer">
<a class="dialog-jump" @click="jumpUrl" v-if="this.$globalState.session.accountLevel == 4 && this.$globalState.session.merchantModel == 2">没有意向标签?点我创建</a>
<el-button size="small" @click="handleClose">
取 消
</el-button>
<el-button size="small" type="primary" @click="handleSelect">确 定</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import { utils } from 'glsx-common'
import util from '@/utils/util'
export default {
name: 'activityModel',
data() {
return {
loading: false,
heightBox: 200,
dialogVisible: false,
labelGroupName: '',
selectNum: 0,
searchStatus: false,
labelTreeRetSelect: [],
labelTreeRets: []
}
},
watch: {
labelTreeRetSelect: {
handler() {
this.selectNum = 0
this.labelTreeRetSelect.forEach(item => {
this.selectNum += item.tagChecked.length
})
},
deep: true
}
},
methods: {
jumpUrl() {
util.openUrl(location.origin + '/custom/tagsManage/index')
this.dialogVisible = false
},
init(item) {
this.labelGroupName = ''
this.dialogVisible = true
this.querylabeltree(item)
},
handleSearch() {
this.searchStatus = true
this.querylabeltree()
},
querylabeltree(selectItem) {
this.loading = true
this.$apis.common
.querylabeltree({
labelTreeReq: {
pageNum: 1,
pageSize: 1000,
shopId: this.$globalState.session.merchantId,
labelGroupName: this.labelGroupName,
labelTypesStr: '自店标签,企业标签',
edition: this.$globalState.session.merchantModel
}
})
.then(res => {
if (selectItem && selectItem.length > 0) {
this.labelTreeRets = res.labelTreeRets.map(item => {
return {
labelGroup: item.labelGroup,
labelList: item.labelList,
checked: false,
tagChecked: [],
isIndeterminate: false,
checkAll: false
}
})
//回显
selectItem.forEach(item => {
this.labelTreeRets.forEach(tag => {
if (item.labelGroup.id == tag.labelGroup.id) {
let labelList = []
item.labelList.forEach(x => {
labelList.push(x.id)
})
this.$nextTick(() => {
tag.tagChecked = tag.labelList.filter(i => labelList.includes(i.id))
})
}
})
})
this.labelTreeRets.forEach((item, index) => {
this.$nextTick(() => {
this.handleCheckedChange(item.tagChecked, index, 1)
})
})
this.$nextTick(() => {
this.labelTreeRetSelect = utils.deepClone(this.labelTreeRets)
})
} else {
this.labelTreeRets = res.labelTreeRets.map(item => {
return {
labelGroup: item.labelGroup,
labelList: item.labelList,
checked: false,
tagChecked: [],
isIndeterminate: false,
checkAll: false
}
})
this.labelTreeRets.forEach((item, index) => {
this.labelTreeRetSelect.forEach(itm => {
if (itm.labelGroup.id == item.labelGroup.id && itm.tagChecked.length > 0) {
let tagChecked = []
itm.tagChecked.forEach(x => {
tagChecked.push(x.id)
})
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
})
})
},
handleClose() {
this.labelTreeRetSelect = []
this.dialogVisible = false
},
remove(items, idx) {
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, 1)
})
})
},
//选中
handleSelect() {
this.dialogVisible = false
let labelTreeRets = this.labelTreeRetSelect
.map(item => {
if (item.tagChecked.length) {
return {
labelGroup: item.labelGroup,
labelList: item.tagChecked
}
}
})
.filter(item => item)
console.log(labelTreeRets)
this.$emit('tagSelected', labelTreeRets)
},
//全选
handleCheckAllChange(val, index) {
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)
}
})
})
},
//选中
handleCheckedChange(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)
}
})
})
}
}
},
mounted() {
let clientHeight = document.documentElement.clientHeight
this.heightBox = clientHeight - 0.15 * clientHeight - 350
}
}
</script>
<style lang="scss" scoped>
.dialog-jump {
color: #5850ff;
float: left;
line-height: 24px;
text-decoration: underline;
cursor: pointer;
}
.tag-panel {
display: flex;
.tag-panel-select {
width: 60%;
/deep/ {
.el-checkbox__label {
width: 100%;
vertical-align: middle;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
word-wrap: break-word;
}
}
}
.tag-panel-selected {
width: 40%;
margin-left: 10px;
.tag-box-header {
font-size: 14px;
font-weight: 400;
color: #333333;
line-height: 20px;
padding-left: 20px !important;
}
}
.tag-title {
font-size: 16px;
font-weight: 400;
color: #333333;
line-height: 22px;
}
.tag-select-box {
margin-top: 10px;
border-radius: 2px;
border: 1px solid #eeeeee;
padding: 6px;
.tag-box-header {
box-sizing: border-box;
display: flex;
height: 56px;
align-items: center;
border-bottom: 1px solid #eeeeee;
margin: -6px;
margin-bottom: 10px;
padding: 0px 6px;
/deep/ {
.el-input {
width: 60%;
margin-right: 10px;
}
}
}
.tag-selected-item {
margin: 0px 6px 6px 0px;
height: 26px;
line-height: 24px;
font-size: 14px;
color: #666;
max-width: auto !important;
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
}
.el-tree-node__expand-icon {
color: #5850ff;
font-size: 16px;
}
.tag-group {
margin-left: 40px;
display: flex;
flex-wrap: wrap;
.el-checkbox {
width: 40%;
margin-bottom: 6px;
display: flex;
align-items: center;
}
}
}
}
.checkbox-group-box {
overflow: auto;
}
.tag-selected-box {
min-height: 200px;
}
</style>
...@@ -89,6 +89,12 @@ const staticRoutes = Object.freeze([ ...@@ -89,6 +89,12 @@ const staticRoutes = Object.freeze([
meta: {} meta: {}
}, },
{ {
name: 'editMemberService',
path: '/couponManage/editMemberService',
component: resolve => require([`@/views/couponManage/editMemberService.vue`], resolve),
meta: {}
},
{
name: 'editCashCoupon', name: 'editCashCoupon',
path: '/couponManage/editCashCoupon/:addOrEdit', path: '/couponManage/editCashCoupon/:addOrEdit',
component: resolve => require([`@/views/couponManage/editCashCoupon.vue`], resolve), component: resolve => require([`@/views/couponManage/editCashCoupon.vue`], resolve),
......
...@@ -8,15 +8,15 @@ export function debounce(func, wait = 200) { ...@@ -8,15 +8,15 @@ export function debounce(func, wait = 200) {
} }
} }
export function dateFormat(dateTime, format = 'YYYY-MM-DD HH:mm') { export function dateFormat(dateTime, format = 'YYYY-MM-DD HH:mm:ss') {
const date = new Date(dateTime) const date = new Date(dateTime)
const config = { const config = {
YYYY: date.getFullYear(), YYYY: date.getFullYear(),
MM: date.getMonth() + 1, //getMonth() 方法根据本地时间返回指定日期的月份(从 0 到 11) MM: date.getMonth() + 1, //getMonth() 方法根据本地时间返回指定日期的月份(从 0 到 11)
DD: date.getDate(), DD: date.getDate(),
HH: date.getHours(), HH: date.getHours(),
mm: date.getMinutes(), mm: date.getMinutes()<10?'0'+date.getMinutes():date.getMinutes(),
ss: date.getSeconds() ss: date.getSeconds()<10?'0'+date.getSeconds():date.getSeconds()
} }
for (const key in config) { for (const key in config) {
format = format.replace(key, config[key]) format = format.replace(key, config[key])
......
...@@ -751,7 +751,7 @@ export default { ...@@ -751,7 +751,7 @@ export default {
var merchantval = true var merchantval = true
if (this.$isGroupUp) { if (this.$isGroupUp) {
this.$refs.merchantRef.$refs[this.editChildRef].validate(merchantVaild => { this.$refs.merchantRef.$refs[this.editChildRef].validate(merchantVaild => {
this.merchantval = merchantVaild merchantval = merchantVaild
}) })
} }
if (valid && merchantval) { if (valid && merchantval) {
......
...@@ -534,7 +534,7 @@ export default { ...@@ -534,7 +534,7 @@ export default {
var merchantval = true var merchantval = true
if (this.$isGroupUp) { if (this.$isGroupUp) {
this.$refs.merchantRef.$refs[this.editChildRef].validate(merchantVaild => { this.$refs.merchantRef.$refs[this.editChildRef].validate(merchantVaild => {
this.merchantval = merchantVaild merchantval = merchantVaild
}) })
} }
if (valid && merchantval) { if (valid && merchantval) {
......
<!-- 编辑兑换券 --> <!-- 编辑兑换券 -->
<template> <template>
<div class="edit-share marketing p-t-20 edit-box"> <div class="edit-share marketing p-t-20 edit-box">
<div class="container edit-container" style="position: relative" v-loading="loading"> <div class="container edit-container" style="position: relative; min-height: 700px;" v-loading="loading">
<div class="right_show"> <div class="right_show">
<div class="card-top"></div> <div class="card-top"></div>
<div class="slider"> <div class="slider">
...@@ -437,7 +437,7 @@ export default { ...@@ -437,7 +437,7 @@ export default {
var merchantval = true var merchantval = true
if (this.$isGroupUp) { if (this.$isGroupUp) {
this.$refs.merchantRef.$refs[this.editChildRef].validate(merchantVaild => { this.$refs.merchantRef.$refs[this.editChildRef].validate(merchantVaild => {
this.merchantval = merchantVaild merchantval = merchantVaild
}) })
} }
if (valid && merchantval) { if (valid && merchantval) {
......
<!-- 编辑服务券 -->
<template> <template>
<div class="edit-share marketing p-t-20 edit-box"> <div class="live-room marketing edit-box">
<div class="container edit-container" v-loading="loading"> <div class="topMsg">
<p class="edit-title">{{ title }}服务券</p> <p class="pageTitle">基本信息</p>
<glsx-combi-form class="edit-form-container" ref="editFormRef" :isEdit="true" :isBlock="true" :formRef="editChildRef" :formObj="editForm" :formData="editFormData" :formRules="editRule"> </div>
<template slot="effectiveHtml"> <div class="live-room container" style="padding-top: 20px;">
<el-radio v-model="editForm.effectiveType" label="3" :disabled="apear != 'couponAdd'">永久有效</el-radio> <el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="120px" class="demo-ruleForm">
<br /> <el-form-item size="small" label="服务名称" prop="couponName" style="width: 440px">
<el-form-item prop="effectiveTime" style="margin-top: 12px; display: block"> <el-input size="small" :disabled="disabledContent" v-model.trim="ruleForm.couponName" maxlength="20" placeholder="请输入服务名称,如“精洗轿车”"></el-input>
<el-radio v-model="editForm.effectiveType" label="2" :disabled="apear != 'couponAdd'">
<el-date-picker v-model="editForm.effectiveTime" type="daterange" style="width: 295px" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" value-format="yyyy-MM-dd" :disabled="editForm.effectiveType != 2 || apear != 'couponAdd'" clearable></el-date-picker>
</el-radio>
</el-form-item> </el-form-item>
<el-form-item prop="effectiveDays"> <el-form-item size="small" label="预估成本/元" prop="anticipatedCost" style="width: 440px">
<el-radio v-model="editForm.effectiveType" label="1" :disabled="apear != 'couponAdd'"> <el-input size="small" :disabled="disabledCost" v-model.trim="ruleForm.anticipatedCost" maxlength="20" placeholder="请输入预估成本"></el-input>
</el-form-item>
<el-form-item size="small" label="有效期" prop="effectiveType">
<div class="radioGroupWrap">
<el-radio-group v-model="ruleForm.effectiveType" :disabled="disabledContent">
<el-radio :label="3" class="itemBlock">无有效期</el-radio>
<!-- effectiveType:1, effectiveDays:5 -->
<el-radio :label="1">
领取后 领取后
<el-input v-model="editForm.effectiveDays" style="width: 100px; margin-left: 5px; margin-right: 5px" :disabled="apear != 'couponAdd' || editForm.effectiveType != 1" /> <el-input v-model="ruleForm.effectiveDays" maxlength="4" @input="
val => {
ruleForm.effectiveDays = val.replace(/[^\d]/g, '')
}
" :disabled="title == '查看' || title == '编辑' || ruleForm.effectiveType != 1" placeholder="请输入" size="small" style="width: 100px"></el-input>
天内有效 天内有效
</el-radio> </el-radio>
<!-- effectiveStartTime effectiveEndTime +具体时间 -->
<el-radio :label="2">
<el-date-picker :size="small" :disabled="title == '查看' || title == '编辑' || ruleForm.effectiveType != 2" style="width: 230px" v-model="ruleForm.daterange" type="daterange" value-format="yyyy-MM-dd" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" :picker-options="pickerOptions || {}"></el-date-picker>
</el-radio>
</el-radio-group>
</div>
</el-form-item> </el-form-item>
</template> <el-form-item size="small" label="使用限制" prop="customUseLimit">
<template slot="useTypeHtml"> <div class="radioGroupWrap">
<el-radio v-model="editForm.useType" label="0" :disabled="apear != 'couponAdd'">无限制</el-radio> <el-radio-group v-model="ruleForm.customUseLimit" :disabled="disabledContent">
<br /> <el-radio :label="0" class="itemBlock">不限制使用次数</el-radio>
<el-form-item prop="usageTimes" style="margin-top: 12px; display: block"> <!-- useType:1 useAmount:6 -->
<el-radio v-model="editForm.useType" label="1" :disabled="apear != 'couponAdd'"> <el-radio :label="1">
有效期内可使用 有效期内可使用
<el-input v-model="editForm.usageTimes" style="width: 100px; margin-left: 5px; margin-right: 5px" :disabled="apear != 'couponAdd' || editForm.useType != 1" /> <el-button @click="sub1" class="addsubBtn" :disabled="title == '查看' || title == '编辑' || ruleForm.customUseLimit != 1">-</el-button>
<div class="numWrap">{{ ruleForm.limitTime1 }}</div>
<el-button @click="add1" class="addsubBtn" :disabled="title == '查看' || title == '编辑' || ruleForm.customUseLimit != 1">+</el-button>
次
</el-radio>
<el-radio :label="2">
有效期内每
<el-input v-model="ruleForm.limitDays" maxlength="4" @input="
val => {
ruleForm.limitDays = val.replace(/[^\d]/g, '')
}
" :disabled="title == '查看' || title == '编辑' || ruleForm.customUseLimit != 2" placeholder="请输入" size="small" style="width: 100px"></el-input>
天内可使用
<el-button @click.stop="sub2" class="addsubBtn" :disabled="title == '查看' || title == '编辑' || ruleForm.customUseLimit != 2">-</el-button>
<span class="numWrap">{{ ruleForm.limitTime2 }}</span>
<el-button @click.stop="add2" class="addsubBtn" :disabled="title == '查看' || title == '编辑' || ruleForm.customUseLimit != 2">+</el-button>
次 次
</el-radio> </el-radio>
</el-radio-group>
</div>
</el-form-item> </el-form-item>
<el-radio v-model="editForm.useType" label="2" :disabled="apear != 'couponAdd'"> <el-form-item v-if="!$isGroupUp" size="small" label="会员价" prop="vipPrice" style="width: 315px">
<el-form-item prop="useLimitDays"> <el-input size="small" :disabled="disabledContent" maxlength="8" v-model="ruleForm.vipPrice" placeholder="请输入" @keyup.native="ruleForm.vipPrice = oninput(ruleForm.vipPrice)">
有效期内 <!-- <template slot="append">元</template> -->
<el-input v-model="editForm.useLimitDays" style="width: 100px; margin-left: 5px; margin-right: 5px" :disabled="apear != 'couponAdd' || editForm.useType != 2" /> <span slot="suffix" class="suffix-label">元</span>
天可使用 </el-input>
</el-form-item> </el-form-item>
<el-form-item prop="usageTimes2"> <el-form-item v-if="!$isGroupUp" size="small" label="门店价" prop="shopPrice" style="width: 315px">
<el-input v-model="editForm.usageTimes2" style="width: 100px; margin-right: 5px" :disabled="apear != 'couponAdd' || editForm.useType != 2" /> <el-input size="small" :disabled="disabledContent" maxlength="8" v-model="ruleForm.shopPrice" placeholder="请输入" @keyup.native="ruleForm.shopPrice = oninput(ruleForm.shopPrice)">
次 <!-- <template slot="append">元</template> -->
<span slot="suffix" class="suffix-label">元</span>
</el-input>
</el-form-item> </el-form-item>
</el-radio>
</template>
<!-- 库存,集团版集团账号-无限制库存;其他-输入框 --> <!-- 库存,集团版集团账号-无限制库存;其他-输入框 -->
<template slot="stock" slot-scope="scope"> <el-form-item size="small" label="库存" prop="stock" style="width: 315px">
<span v-if="$isGroupUp">无库存限制</span> <!-- <el-input size="small" :disabled="title == '查看'" maxlength="6" v-model.number="ruleForm.stock" placeholder="请输入"></el-input> -->
<el-input :disabled="apear != 'couponAdd'" v-else class="w-150" v-model="editForm[scope.scope.name]" placeholder="请输入库存"> <span v-if="$isGroupUp">永久有效</span>
<el-input :disabled="title == '查看'" v-else class="w-150" v-model="ruleForm.stock" placeholder="请输入库存">
<span slot="suffix">张</span> <span slot="suffix">张</span>
</el-input> </el-input>
</template> </el-form-item>
<template slot="useDescriptionHtml"> <el-form-item size="small" label="使用说明" prop="useDescription" style="width: 670px">
<el-input type="textarea" v-model="editForm.useDescription" style="width: 320px" :autosize="{ minRows: 2, maxRows: 4 }" maxlength="200" :disabled="apear == 'couponSee'" /> <el-input size="small" :rows="6" :disabled="disabledDescription" type="textarea" v-model="ruleForm.useDescription" placeholder="请输入" maxlength="200" show-word-limit></el-input>
</template> </el-form-item>
</glsx-combi-form> <el-form-item size="small" style="margin-left: -100px" v-show="isEdit">
<div v-if="$isGroupUp"> <el-button style="margin-left: 80px" @click="editMessage">编辑</el-button>
</el-form-item>
<!-- <el-form-item size="small">
<el-button type="primary" @click="submitForm('ruleForm')" size="small">创建</el-button>
<el-button type="primary" @click="resetForm('ruleForm')" size="small">重置</el-button>
</el-form-item> -->
</el-form>
<div class="edit-container" v-if="$isGroupUp">
<p class="edit-title">适用门店配置</p> <p class="edit-title">适用门店配置</p>
<glsx-combi-form class="edit-form-container" ref="merchantRef" :isEdit="true" :isBlock="true" :formRef="editChildRef" :formObj="editForm" :formData="merchantEditFormData" :formRules="merchantRule"></glsx-combi-form> <glsx-combi-form class="edit-form-container" ref="merchantRef" :isEdit="true" :isBlock="true" :formRef="editChildRef" :formObj="ruleForm" :formData="merchantEditFormData" :formRules="merchantRule"></glsx-combi-form>
</div>
<!-- <div class="serviceCard">
<div class="cardtop">
<img src="@/assets/serviceMemberCard.png" alt="" />
<span class="serviceName ellipsis-1" :title="ruleForm.couponName">{{ ruleForm.couponName || '-' }}</span>
<span class="effectiveRange">{{ limitText }}</span>
<span class="timeRange">{{ effectiveRangeText }}</span>
<div class="grayLine"></div>
<div class="desc">使用说明:</div>
<span class="detailDesc">{{ ruleForm.useDescription }}</span>
</div>
</div> -->
<div class="right_show">
<div class="card-top"></div>
<div class="slider">
<div class="card_one">
<div :class="ruleForm.status == 3 ? 'darkColor' : ''" class="cname">{{ ruleForm.couponName }}</div>
<img src="../../images/unService.png" class="couponImg" v-if="ruleForm.status == 3" />
<img src="../../images/service.png" class="couponImg" v-else />
<!-- <div class="ctype">
<div class="ctypeName"></div>
</div> -->
<div class="validityPeriod">
<!-- <span class="ctime_name">有效期:</span> -->
<span>{{ effectiveRangeText }}</span>
</div> </div>
<div style="height: 1px;background-color: rgb(238, 238, 238);margin: 0 16px;"></div>
<div :class="ruleForm.status == 3 ? 'darkColor' : ''" class="ctime">
<!-- <span class="ctime_name">使用限制:</span> -->
<span class="ctime_content">{{ limitText }}</span>
</div> </div>
<!-- <div class="left_show"> <div class="ccode">
<div class="card-panel-top"> <img src="../../assets/coupon/code2.png" />
<div class="card-h-title">会员券</div>
<div class="card-extime" v-if="editForm.effectiveType == 3">有效期:无限制</div>
<div class="card-extime" v-if="editForm.effectiveType == 1">有效期:{{editForm.effectiveDays}}天</div>
<div class="card-extime" v-if="editForm.effectiveType == 2">有效期:{{couponTime}}</div>
<div class="card-name">{{editForm.couponName}}</div>
<div class="card-day" v-if="editForm.useType == 0">使用限制:无限定次数</div>
<div class="card-day" v-if="editForm.useType == 1">使用限制:{{editForm.usageTimes}}次</div>
<div class="card-day" v-if="editForm.useType == 2">使用限制:每{{editForm.useLimitDays}}天可以使用{{editForm.usageTimes2}}次</div>
</div> </div>
<div class="card-panel-bottom"> <div style="height: 1px;background-color: rgb(238, 238, 238);margin: 7px 16px 8px;"></div>
<div class="card-remark">使用说明:</div> <div class="process">
<div class="card-remark">{{editForm.useDescription}}</div> <img src="../../images/unArrow.png" v-if="ruleForm.status == 3" />
<img src="../../images/arrow.png" v-else />
<span class="process_text">导航到店</span>
<img class="rightArrow" src="../../images/rightArrow.png" />
<img src="../../images/unCar.png" v-if="ruleForm.status == 3" />
<img src="../../images/car.png" v-else />
<span class="process_text">开始服务</span>
<img class="rightArrow" src="../../images/rightArrow.png" />
<img src="../../images/unTicket.png" v-if="ruleForm.status == 3" />
<img src="../../images/ticket.png" v-else />
<span class="process_text">出示核销码</span>
</div>
</div>
<div class="card_two">
<div class="cremarks">有效日期:</div>
<div class="validityPeriod" style="margin: 0 8px 8px 8px;">
<span>{{ effectiveRangeText }}</span>
</div>
<div class="cremarks">使用说明:</div>
<div class="cremarks_content" style="white-space:pre-wrap">{{ ruleForm.useDescription }}</div>
</div> </div>
</div> -->
<div class="footer" :style="{ left: footerLeft + 'px', width: footerWidth + 'px' }">
<el-button type="primary" v-if="apear != 'couponSee'" @click="handleConfirm">确定</el-button>
<el-button v-if="apear != 'couponSee'" @click="handleCancel">取消</el-button>
<el-button v-if="apear == 'couponSee'" @click="handleCancel">返回</el-button>
</div> </div>
</div> </div>
</div>
<div class="footer-panel" :style="{
left: footerLeft + 'px',
width: footerWidth + 'px'
}">
<el-button type="primary" @click="submitForm('ruleForm')" size="medium" :loading="sloading" v-if="showSubmit">确定</el-button>
<el-button type="default" @click="goBack" size="medium">取消</el-button>
</div>
<!-- :hasScroll="false" :noBtnOk="true" :noCancel="true" :noClose="false" -->
<glsx-dialog title="" top="30vh" :hasScroll="false" width="547px" btnCloseLabel="取消" :noClose="false" :noCancel="true" btnSize="small" :isVisible="isDialogVisible" :showClose="false" @closeDialog="handleClose" @confirmDialog="handleConfirm">
<div class="content-body">
<img src="@/assets/icon-warning.png" alt="" />
<div>当前有内容信息未保存,是否继续返回?</div>
</div>
</glsx-dialog>
</div>
</template> </template>
<script> <script>
import glsxDialog from '@/components/glsx-dialog'
import { limitPrice } from '@/common/constant' import { limitPrice } from '@/common/constant'
import { createService, detailService, updateService } from '@/api/modules/service'
export default { export default {
name: 'editCashCoupon', components: {
glsxDialog
},
data() { data() {
var checkZero = (rule, value, callback) => {
setTimeout(() => {
if (value == 0) {
callback(new Error('请输入有效数字值'))
} else {
callback()
}
})
}
var checkStock = (rule, value, callback) => {
if (this.$isGroupUp) {
return callback()
}
if (value <= 0) {
return callback(new Error('库存不能为空或负数'))
}
setTimeout(() => {
if (!(/^[0-9]*$/.test(value))) {
callback(new Error('请输入数字值'))
} else {
if (value < 0) {
callback(new Error('必须大于或等于0'))
} else {
callback()
}
}
}, 1000)
}
return { return {
size: 'small', isEdit: false,
title: '创建', showSubmit: true,
titleObj: { disabledDescription: false,
1: '创建晒单', disabledCost: false,
2: '编辑晒单' sloading: false,
}, isDialogVisible: false,
footerLeft: '0',
footerWidth: '0',
editChildRef: 'editChildRef', editChildRef: 'editChildRef',
loading: false, pickerOptions: {
// pickerOptions: { disabledDate(time) {
// disabledDate(v) {//禁用当前之前的日期 return time.getTime() < Date.now() - 8.64e7 // 如果没有后面的-8.64e7就是不可以选择今天的
// return v.getTime() < new Date().getTime() - 86400000; }
// },
// disabledDate(time) {//禁用当前之后的日期
// return time.getTime() > Date.now() - 8.64e6
// }
// },
routeInfo: {
// 1-新增;2-编辑;3-查看
addOrEdit: 1,
id: ''
}, },
apear: '', ruleForm: {
isDisabled: true, anticipatedCost: '',
couponTime: '',
editForm: {
couponName: '', couponName: '',
effectiveType: '3', // region: '',
useType: '0', // date1: '',
usageTimes: 1, // date2: '',
usageTimes2: 1, // delivery: false,
// type: [],
// resource: '',
effectiveType: 3, //有效期(默认无有效期)
effectiveDays: '',
customUseLimit: 0, //使用限制(默认不限制使用次数)
limitTime1: 1,
limitDays: '30',
limitTime2: 5,
vipPrice: '',
shopPrice: '',
stock: '',
useDescription: '',
daterange: [],
scopeApplication: '' scopeApplication: ''
}, },
editRule: { copyRuleForm: {},
couponName: [{ required: true, message: '请输入优惠券名称', trigger: 'change' }], rules: {
anticipatedCost: [{ required: true, message: '请输入预估成本', trigger: 'change' }],
couponName: [{ required: true, message: '请输入服务名称', trigger: 'blur' }],
// region: [{ required: true, message: '请选择活动区域', trigger: 'change' }],
// date1: [{ type: 'date', required: true, message: '请选择日期', trigger: 'change' }],
// date2: [{ type: 'date', required: true, message: '请选择时间', trigger: 'change' }],
// type: [{ type: 'array', required: true, message: '请至少选择一个活动性质', trigger: 'change' }],
effectiveType: [{ required: true, message: '请选择有效期', trigger: 'change' }], effectiveType: [{ required: true, message: '请选择有效期', trigger: 'change' }],
effectiveTime: [{ required: true, message: '有效期不能为空', trigger: 'change' }], customUseLimit: [{ required: true, message: '请选择使用限制', trigger: 'change' }],
effectiveDays: [{ required: true, message: '有效天数不能为空', trigger: 'blur' }], vipPrice: [
useType: [{ required: true, message: '请选择使用限制', trigger: 'change' }], { required: true, message: '请输入会员价', trigger: 'blur' },
usageTimes: [{ required: true, message: '使用次数不能为空', trigger: 'blur' }], { validator: checkZero, trigger: 'blur' }
useLimitDays: [{ required: true, message: '有效期天数不能为空', trigger: 'blur' }], ],
usageTimes2: [{ required: true, message: '使用次数不能为空', trigger: 'blur' }], shopPrice: [
vipPrice: [{ required: true, message: '会员价不能为空', trigger: 'change' }], { required: true, message: '请输入门店价', trigger: 'blur' },
shopPrice: [{ required: true, message: '门店价不能为空', trigger: 'change' }], { validator: checkZero, trigger: 'blur' }
stock: [{ required: true, message: '库存不能为空', trigger: 'change' }],
useDescription: [{ required: true, message: '使用说明不能为空', trigger: 'change' }]
},
editFormData: [
{
label: '服务名称',
name: 'couponName',
width: '320px',
type: 'input',
maxlength: 20
},
{
label: '有效期',
name: 'effectiveType',
addHtml: 'effectiveHtml'
},
{
label: '使用限制',
name: 'useType',
addHtml: 'useTypeHtml'
},
{
label: '会员价',
name: 'vipPrice',
width: '150px',
type: 'input',
isHide: false
},
{
label: '门店价',
name: 'shopPrice',
width: '150px',
type: 'input',
isHide: false
},
{
label: '库存',
name: 'stock',
addHtml: 'stock'
// width: '150px',
// type: 'input'
},
{
label: '使用说明',
name: 'useDescription',
addHtml: 'useDescriptionHtml'
}
], ],
stock: [
{ required: true, message: '请输入库存', trigger: 'blur' },
{ validator: checkStock, trigger: 'blur' }
]
// useDescription: [{ required: true, message: '请填写活动形式', trigger: 'blur' }]
},
merchantId: '',
merchantName: '',
title: this.$route.query.title || '',
// 适用门店 // 适用门店
merchantRule: { merchantRule: {
scopeApplication: [{ required: true, message: '请选择适用范围', trigger: 'change' }] scopeApplication: [{ required: true, message: '请选择适用范围', trigger: 'change' }]
...@@ -207,287 +300,605 @@ export default { ...@@ -207,287 +300,605 @@ export default {
] ]
} }
}, },
computed: {
disabledContent() {
if (this.title == '查看' || this.title == '编辑') {
return true
}
return false
},
limitText() {
if (this.ruleForm.customUseLimit == 0) {
return `不限次数`
} else if (this.ruleForm.customUseLimit == 1) {
return `有效期内可使用${this.ruleForm.limitTime1}次`
} else if (this.ruleForm.customUseLimit == 2 && this.ruleForm.effectiveType != 3) {
return `有效期内每${this.ruleForm.limitDays}天内可使用${this.ruleForm.limitTime2}次`
} else if (this.ruleForm.customUseLimit == 2 && this.ruleForm.effectiveType == 3) {
return '不限次数'
}
return '不限次数'
},
effectiveRangeText() {
if (this.ruleForm.effectiveType == 1) {
return `领取后${this.ruleForm.effectiveDays}天内有效`
} else if (this.ruleForm.effectiveType == 2) {
return `${this.ruleForm.daterange[0]}-${this.ruleForm.daterange[1]}`
}
return '永久有效'
}
// 有效期内可使用3次
},
created() { created() {
this.editRule.stock[0].required = !this.$isGroupUp this.copyRuleForm = JSON.parse(JSON.stringify(this.ruleForm)) //深拷贝一份数据
let hideAttrList = ['vipPrice', 'shopPrice'] if (window.__POWERED_BY_QIANKUN__) {
if (this.$isGroupUp) { //运行在qiankun容器中
hideAttrList.forEach(item => { this.merchantId = this.$globalState.session.merchantId
let idx = this.editFormData.findIndex(k => k.name == item) this.merchantName = this.$globalState.session.merchantName
this.editFormData[idx].isHide = true }
}) if (this.title == '编辑' || this.title == '查看') {
this.isEdit = true
var breadcrumbTitle = this.title
this.getPageDetail()
} }
this.rules.stock[0].required = !this.$isGroupUp
}, },
mounted() { mounted() {
this.footerLeft = document.querySelector('.base-container-right').offsetLeft this.footerLeft = document.querySelector('.base-container-right').offsetLeft
this.footerWidth = document.documentElement.clientWidth - this.footerLeft this.footerWidth = document.documentElement.clientWidth - this.footerLeft
this.routeInfo = this.$route.params if (this.title == '查看' || this.title == '编辑') {
// this.title = this.titleObj[this.routeInfo.addOrEdit] this.disabledCost = true
this.routeInfo.addOrEdit != 1 ? this.getInfo() : '' this.disabledDescription = true
var id = this.routeInfo.id this.showSubmit = false
var addOrEdit = this.routeInfo.addOrEdit }
if (id) { if (this.title == '查看') {
if (addOrEdit == 3) {
this.apear = 'couponSee'
this.title = '查看'
this.setAllDisabled('merchantEditFormData') this.setAllDisabled('merchantEditFormData')
} else if (addOrEdit == 2) {
this.apear = 'couponEdit'
this.title = '编辑'
}
this.isDisabled = true
this.editFormData[0].isDisabled = this.isDisabled
this.editFormData[3].isDisabled = this.isDisabled
this.editFormData[4].isDisabled = this.isDisabled
this.editFormData[5].isDisabled = this.isDisabled
} else {
this.apear = 'couponAdd'
this.title = '创建'
this.isDisabled = false
} }
}, },
watch: { watch: {
'editForm.effectiveDays'(newValue, oldValue) { 'ruleForm.anticipatedCost'(newValue, oldValue) {
this.editForm.effectiveDays = limitPrice(newValue, oldValue, 3, 0) this.ruleForm.anticipatedCost = limitPrice(newValue, oldValue, 4, 2, 0, 10000)
},
'editForm.usageTimes'(newValue, oldValue) {
this.editForm.usageTimes = limitPrice(newValue, oldValue, 3, 0)
},
'editForm.useLimitDays'(newValue, oldValue) {
this.editForm.useLimitDays = limitPrice(newValue, oldValue, 4, 0)
},
'editForm.usageTimes2'(newValue, oldValue) {
this.editForm.usageTimes2 = limitPrice(newValue, oldValue, 3, 0)
},
'editForm.vipPrice'(newValue, oldValue) {
this.editForm.vipPrice = limitPrice(newValue, oldValue, 5, 2)
},
'editForm.shopPrice'(newValue, oldValue) {
this.editForm.shopPrice = limitPrice(newValue, oldValue, 5, 2)
},
'editForm.stock'(newValue, oldValue) {
this.editForm.stock = limitPrice(newValue, oldValue, 6, 0, 1)
},
'editForm.effectiveTime'(newValue, oldValue) {
if (newValue && newValue.length > 0) {
this.couponTime = this.setDateString(newValue[0], true) + ' - ' + this.setDateString(newValue[1], true)
} else {
this.couponTime = ''
}
} }
}, },
methods: { methods: {
setAllDisabled(editName) { setAllDisabled(editName) {
this[editName].forEach(item => { this[editName].forEach(item => {
item.isDisabled = true item.isDisabled = true
}) })
}, },
setDateString(objField, special) { editMessage() {
var value = typeof objField == 'string' ? objField.split(' ')[0] : special ? objField.format('YYYY年MM月DD日') : objField.format('YYYY年MM月DD日') this.disabledCost = false
return value this.disabledDescription = false
this.showSubmit = true
}, },
getPageDetail() {
getInfo() { let params = {}
this.loading = true params.couponId = this.$route.query.couponId
this.$apis.couponManage detailService(params).then(res => {
.getCouponDetailApi({ couponId: this.routeInfo.id }) this.ruleForm = res
.then(res => { this.ruleForm.anticipatedCost = (res.anticipatedCost / 100).toFixed(2)
this.editForm = this.$common.utils.deepClone(res) this.ruleForm.customUseLimit = res.useType
this.editForm.effectiveType = this.editForm.effectiveType + ''
this.editForm.useType = this.editForm.useType + ''
if (this.$isGroupUp) { if (this.$isGroupUp) {
this.editForm.scopeApplication = this.editForm.scopeApplication + '' this.ruleForm.scopeApplication = res.scopeApplication + ''
} }
if (res.effectiveType == 1) {
//有效期 this.ruleForm.effectiveDays = res.effectiveDays
//有效类型 1:固定天数,领取后计算 2:时间段,3:永久有效 }
if (this.editForm.effectiveType == 2) { if (res.effectiveType == 2) {
this.editForm.effectiveTime = [this.editForm.effectiveStartTime, this.editForm.effectiveEndTime] this.ruleForm.daterange = [res.effectiveStartTime, res.effectiveEndTime]
} }
//类型(0:不限制次数,1:根据有效期限制多少次,2:根据间隔多少天限制多少次) // this.ruleForm.limitTime1 = ''
if (this.editForm.useType == 1) { // this.ruleForm.limitTime2 = ''
this.editForm.usageTimes = this.editForm.useAmount // this.limitDays = ''
} else if (this.editForm.useType == 2) { if (res.useType == 1) {
this.editForm.usageTimes2 = this.editForm.useAmount this.ruleForm.limitTime1 = res.useAmount
} }
}).finally(() => { if (res.useType == 2) {
this.loading = false this.ruleForm.limitTime2 = res.useAmount
this.ruleForm.limitDays = res.useLimitDays
}
this.copyRuleForm = JSON.parse(JSON.stringify(this.ruleForm)) //深拷贝一份数据
}) })
}, },
submitForm(formName) {
validateRules() { this.$refs[formName].validate(valid => {
var form = this.editForm var merchantval = true
if (form.effectiveType == '2') { if (this.$isGroupUp) {
//判断 有效期-日期选择是否验证 this.$refs.merchantRef.$refs[this.editChildRef].validate(merchantVaild => {
this.editRule.effectiveTime[0].required = true merchantval = merchantVaild
} else { })
this.editRule.effectiveTime[0].required = false
} }
if (form.effectiveType == '1') { if (valid && merchantval) {
//判断 有效期-有效天数是否验证 if (this.isEdit == true) {
this.editRule.effectiveDays[0].required = true this.updateService()
} else { } else {
this.editRule.effectiveDays[0].required = false this.createService()
} }
if (form.useType == '1') {
//判断 使用限制-有效期内使用次数是否验证
this.editRule.usageTimes[0].required = true
} else { } else {
this.editRule.usageTimes[0].required = false return false
}
})
},
//创建服务
createService() {
let params = {
effectiveDays: '',
useAmount: '',
useLimitDays: ''
}
params.anticipatedCost = this.ruleForm.anticipatedCost * 100
params.directionalFlag = '1'
params.couponName = this.ruleForm.couponName
//有效期
params.effectiveType = this.ruleForm.effectiveType
//使用限制
params.useType = this.ruleForm.customUseLimit
//有效期 effectiveType: 3 1 2
if (this.ruleForm.effectiveType == 1 && !parseInt(this.ruleForm.effectiveDays)) {
this.$message.error('请输入有效期')
return false
} }
if (form.useType == '2') { params.effectiveDays = this.ruleForm.effectiveDays
//判断 使用限制-有效天数和使用次数是否验证 if (this.ruleForm.effectiveType == 2) {
this.editRule.useLimitDays[0].required = true if (!this.ruleForm.daterange) {
this.editRule.usageTimes2[0].required = true this.$message.error('请输入有效期')
return false
} else { } else {
this.editRule.useLimitDays[0].required = false params.effectiveStartTime = this.ruleForm.daterange[0] + ' 00:00:00'
this.editRule.usageTimes2[0].required = false params.effectiveEndTime = this.ruleForm.daterange[1] + ' 23:59:59'
} }
}, }
//使用限制
getCouponInfoParams() { if (this.ruleForm.customUseLimit == 1) {
var obj = {} if (!parseInt(this.ruleForm.limitTime1)) {
var id = this.routeInfo.id this.$message.error('请输入有效期使用次数')
var form = this.$common.utils.deepClone(this.editForm) return false
if (id) {
obj.couponId = id
} else { } else {
//编辑时只允许编辑使用说明 params.useAmount = this.ruleForm.limitTime1
//优惠券名称
obj.couponName = form.couponName
//优惠券类型 1:满减券,2:折扣券,3:代金券,4:实物券 5:购车代金券 6:商品折扣券,7:服务券
obj.discountType = '7'
//有效期
//有效类型 1:固定天数,领取后计算 2:时间段,3:永久有效
obj.effectiveType = form.effectiveType
if (form.effectiveType == 1) {
//固定天数
obj.effectiveDays = form.effectiveDays
} else if (form.effectiveType == 2) {
//时间段
const d = form.effectiveTime
if (d && d.length > 0) {
obj.effectiveStartTime = d[0] + ' 00:00:00'
obj.effectiveEndTime = d[1] + ' 23:59:59'
} }
} }
if (this.ruleForm.customUseLimit == 2) {
//类型(0:不限制次数,1:根据有效期限制多少次,2:根据间隔多少天限制多少次) if (!parseInt(this.ruleForm.limitTime2) || !parseInt(this.ruleForm.limitDays)) {
obj.useType = form.useType this.$message.error('请输入有效期使用次数')
if (form.useType == 1) { return false
obj.useAmount = form.usageTimes } else {
} else if (form.useType == 2) { params.useLimitDays = this.ruleForm.limitDays
obj.useLimitDays = form.useLimitDays params.useAmount = this.ruleForm.limitTime2
obj.useAmount = form.usageTimes2 }
} }
//会员价 params.vipPrice = this.ruleForm.vipPrice
obj.vipPrice = form.vipPrice params.shopPrice = this.ruleForm.shopPrice
//门店价 // params.stock = this.ruleForm.stock
obj.shopPrice = form.shopPrice
//库存 //库存
obj.limitStockFlag = this.$isGroupUp ? 2 : 1 params.limitStockFlag = this.$isGroupUp ? 2 : 1
if (!this.$isGroupUp) { if (!this.$isGroupUp) {
obj.stock = form.stock params.stock = this.ruleForm.stock
} else { } else {
obj.scopeApplication = form.scopeApplication params.scopeApplication = this.ruleForm.scopeApplication
}
} }
//使用描述 params.useDescription = this.ruleForm.useDescription
obj.useDescription = form.useDescription
return obj
},
handleConfirm() { params.discountType = 7
this.validateRules() params.merchantId = this.merchantId
this.$refs.editFormRef.$refs[this.editChildRef].validate(valid => { params.merchantName = this.merchantName
var merchantval = true this.sloading = true
if (this.$isGroupUp) { createService(params)
this.$refs.merchantRef.$refs[this.editChildRef].validate(merchantVaild => { .then(res => {
this.merchantval = merchantVaild if (res.code == 0) {
this.sloading = false
this.$message.success('操作成功')
this.$router.push('/couponManage/index')
} else {
this.sloading = false
this.$message({
type: 'error',
message: res.message
}) })
} }
if (valid && merchantval) { })
var params = this.getCouponInfoParams() .catch(err => {
let method = '' this.sloading = false
if (params.couponId) { })
method = 'updateCouponApi' //后台修改优惠券 .finally(() => {
this.sloading = false
})
},
//更新服务
updateService() {
let param = {}
param.anticipatedCost = this.ruleForm.anticipatedCost * 100
param.discountType = 7
param.merchantId = this.merchantId
param.merchantName = this.merchantName
param.couponId = this.$route.query.couponId
param.stock = this.ruleForm.stock
param.useDescription = this.ruleForm.useDescription
this.sloading = true
updateService(param)
.then(res => {
if (res.code == 0) {
this.sloading = false
this.$message.success('编辑服务成功')
this.$router.push('/couponManage/index')
} else { } else {
method = 'createCouponApi' //后台创建优惠券 this.sloading = false
}
this.$apis.couponManage[method](params).then(res => {
this.$message({ this.$message({
message: res.code == '0' ? '操作成功' : '操作失败', type: 'error',
type: res.code == '0' ? 'success' : 'error' message: res.message
}) })
if (res.code == '0') {
this.handleCancel()
} }
}) })
} .catch(err => {
this.sloading = false
}) })
}, .finally(() => {
handleCancel() { this.sloading = false
this.$router.push({
path: '/couponManage/index'
}) })
},
goBack() {
if (JSON.stringify(this.ruleForm) == JSON.stringify(this.copyRuleForm) || this.title == '查看') {
this.$router.push('/couponManage/index')
} else {
// this.$message.error('是否保存信息')
this.isDialogVisible = true
}
},
handleClose() {
this.isDialogVisible = false
},
handleConfirm() {
this.$router.push('/couponManage/index')
},
oninput(value) {
let str = value
let len1 = str.substr(0, 1)
let len2 = str.substr(1, 1) //如果第一位是0,第二位不是点,就用数字把点替换掉
if (str.length > 1 && len1 == 0 && len2 != '.') {
str = str.substr(1, 1)
} //第一位不能是.
if (len1 == '.') {
str = ''
}
if (len1 == '+') {
str = ''
}
if (len1 == '-') {
str = ''
} //限制只能输入一个小数点
if (Number(value) >= 999999999) {
return (str = 999999999)
}
if (str.indexOf('.') != -1) {
let str_ = str.substr(str.indexOf('.') + 1)
if (str_.indexOf('.') != -1) {
str = str.substr(0, str.indexOf('.') + str_.indexOf('.') + 1)
}
}
//正则替换
// (/[^\-\d.]/g, ''))"
str = str.replace(/[^\d.^]+/g, '') // 保留数字和小数点
str = str.replace(/^\D*([0-9]\d*\.?\d{0,2})?.*$/, '$1') // 小数点后只能输 2 位
return str
},
sub1() {
if (this.ruleForm.limitTime1 <= 0) {
return
}
this.ruleForm.limitTime1--
},
add1() {
this.ruleForm.limitTime1++
},
sub2() {
if (this.ruleForm.limitTime2 <= 0) {
return
}
this.ruleForm.limitTime2--
},
add2() {
this.ruleForm.limitTime2++
} }
} }
} }
</script> </script>
<style scoped>
.left_show { <style lang="scss" scoped>
width: 400px; .live-room {
/*min-height: 600px;*/ .topMsg {
background: #fff; margin: 20px 0px 0;
/*border: 1px solid #eee;*/ padding: 0 20px;
position: relative; background-color: #fff;
height: 56px;
border-bottom: 1px solid#DCDFE6;
display: flex; display: flex;
flex-direction: column; justify-content: space-between;
align-items: center;
.pageTitle {
position: relative;
// margin-bottom: 20px;
// height: 20px;
font-size: 20px;
font-weight: 700;
color: #333333;
line-height: 20px;
letter-spacing: 1px;
}
}
.container {
margin: 0 0px 100px;
position: relative;
/deep/ .el-form-item__content {
.radioGroupWrap {
width: 550px;
height: 164px;
background-color: #f4f6fc;
padding-top: 10px;
padding-left: 20px;
}
}
.numWrap {
display: inline-block;
background-color: #fff;
min-width: 34px;
height: 22px;
text-align: center;
line-height: 22px;
margin: 0 2px;
vertical-align: text-bottom;
}
.addsubBtn {
background-color: #fff;
color: #5850ff;
padding: 5px 9px;
}
.el-radio {
display: block;
&:not(:first-child) {
margin-top: 18px;
}
}
.itemBlock {
margin-top: 10px;
}
}
.footer-panel {
display: flex;
align-items: center;
justify-content: center;
position: fixed;
width: 100%;
bottom: 0px;
height: 64px;
background: #ffffff;
z-index: 999;
box-shadow: 0px -1px 1px 0px rgba(88, 80, 255, 0.1);
}
/deep/ .el-dialog__header {
border: 0;
}
/deep/ .el-dialog__body {
border-bottom: 1px solid #e6e6e6;
padding: 20px 25px;
.content-body {
text-align: center;
height: 98px;
line-height: 26px;
div {
font-size: 16px;
color: #333333;
font-weight: 400;
font-weight: 400;
color: #333333;
}
}
}
/deep/ .el-dialog__footer {
border: 0;
text-align: center;
padding-top: 15px;
padding-bottom: 15px;
.el-button--small {
padding: 8px 26px;
}
}
}
.right_show {
position: absolute; position: absolute;
top: 110px; z-index: 10;
left: 50%; height: 566px;
width: 290px;
right: 44px;
top: 92px;
background-image: url(../../assets/coupon/phone.png);
}
.right_show .card-top {
height: 59px;
width: 251px;
margin-left: 18px;
margin-top: 55px;
} }
.left_show .card-panel-top { .card_one {
/* margin-top: 200px; */ width: 243px;
width: 365px; height: 285px;
height: 122px; background: #ffffff;
background-color: rgba(245, 154, 35, 0.7); border-radius: 4px;
border: none; margin-left: 22px;
margin-top: 5.81px;
}
.cname {
margin: 16px 0 10px 16px;
display: inline-block;
font-size: 18px;
font-family: PingFangSC-Semibold, PingFang SC;
font-weight: 600;
color: #fc5b32;
max-width: 164px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
height: 35px;
}
.ctype {
width: 48px;
height: 20px;
background: #5850ff;
border-radius: 2px;
margin-right: 8px;
margin-top: 8px;
display: inline-block;
float: right;
}
.ctypeName {
width: 36px;
height: 17px;
font-family: PingFangSC-Regular;
font-size: 12px;
color: #ffffff;
font-weight: 400;
margin-left: 6px;
}
.ctime {
margin: 8px 16px 9px;
text-align: center; text-align: center;
line-height: 24px; color: #fc5b32;
position: relative;
} }
.card-h-title { /* .ctime_name {
position: absolute; width: 48px;
height: 17px;
font-family: PingFangSC-Regular;
font-size: 12px;
color: #333333;
font-weight: 400;
} */
.ctime_content {
height: 17px;
font-family: PingFangSC-Regular;
font-size: 12px;
font-weight: 400;
margin-left: 5px;
}
.ccode {
width: 120px;
height: 120px;
margin: 0 16px;
margin: auto;
}
.ccodeName {
width: 68px;
height: 17px;
font-family: PingFangSC-Medium;
font-size: 12px;
color: #1d1d1d;
font-weight: 500; font-weight: 500;
font-size: 20px; margin-left: 88px;
top: 20px; margin-top: 8px;
transform: rotate(-45deg);
} }
.card-panel-bottom {
width: 353px; .link-top {
min-height: 90px; width: 227px;
background-color: rgba(250, 205, 145, 1); height: 1px;
padding: 6px; background: #eeeeee;
margin-left: 8px;
margin-top: 8px;
} }
.card-extime {
.code_d {
margin-left: 98px;
margin-top: 10px; margin-top: 10px;
} }
.card-name {
margin: 16px 0px; .card_two {
font-size: 16px; width: 243px;
height: 162px;
background: #ffffff;
border-radius: 4px;
margin-left: 22px;
margin-top: 8px;
} }
.card-day {
margin-top: 10px; .cremarks {
padding-left: 8px;
padding-top: 8px;
width: 60px;
height: 17px;
font-family: PingFangSC-Regular;
font-size: 12px;
color: #333333;
font-weight: 400;
} }
.card-remark {
.cremarks_content {
margin-left: 8px;
margin-right: 8px;
margin-top: 4px;
width: 227px;
height: 80px;
font-family: PingFangSC-Regular;
font-size: 12px;
color: #666666;
font-weight: 400;
word-break: break-word; word-break: break-word;
overflow: auto;
}
.promptCopy {
font-size: 14px;
font-family: PingFangSC-Regular, PingFang SC;
color: #999;
margin-left: -10px;
}
.couponImg {
width: 69px;
height: 69px;
position: sticky;
float: right;
margin-top: -6px;
margin-right: -6px;
}
.validityPeriod {
font-size: 12px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #a0a0a0;
margin: 0 16px 8px 16px;
}
.process {
display: flex;
align-items: center;
justify-content: center;
margin-bottom: 2px;
}
.process .process_text {
margin-left: 2px;
font-size: 12px;
color: #333;
}
.process img {
width: 12px;
height: 12px;
}
.process .rightArrow {
padding: 0 4px;
}
.slider {
height: 380px;
overflow: auto;
}
.slider::-webkit-scrollbar-thumb {
background: transparent;
}
.darkColor {
color: #999;
} }
</style> </style>
...@@ -349,7 +349,13 @@ export default { ...@@ -349,7 +349,13 @@ export default {
//新增服务券 //新增服务券
addService() { addService() {
this.$router.push('/couponManage/editMemberService/1') // this.$router.push('/couponManage/editMemberService/1')
this.$router.push({
path: '/couponManage/editMemberService',
query: {
$title: encodeURI('创建服务')
}
})
}, },
//新增折扣劵 //新增折扣劵
...@@ -371,7 +377,15 @@ export default { ...@@ -371,7 +377,15 @@ export default {
goto = '/couponManage/editCashCoupon/' goto = '/couponManage/editCashCoupon/'
} else if (row.discountType == '7') { } else if (row.discountType == '7') {
//服务券 //服务券
goto = '/couponManage/editMemberService/' this.$router.push({
path: '/couponManage/editMemberService',
query: {
couponId: row.id,
title: addOrEdit == 2 ? '编辑' : '查看',
$title: encodeURI('编辑服务')
}
})
return true
} else if (row.discountType == '2') { } else if (row.discountType == '2') {
//折扣劵 //折扣劵
goto = '/couponManage/editDiscountCoupon/' goto = '/couponManage/editDiscountCoupon/'
......
...@@ -167,7 +167,7 @@ export default { ...@@ -167,7 +167,7 @@ export default {
label: '领取用户', label: '领取用户',
prop: 'userName', prop: 'userName',
formatter: cellValue => { formatter: cellValue => {
return cellValue.userName + ' ' + cellValue.phone return cellValue.userName == cellValue.phone ? cellValue.userName : cellValue.userName + ' ' + cellValue.phone
} }
}, },
{ {
...@@ -203,7 +203,7 @@ export default { ...@@ -203,7 +203,7 @@ export default {
// }, // },
{ {
confId: '1', confId: '1',
confName: '已领取' confName: '未使用'
}, },
{ {
confId: '2', confId: '2',
...@@ -211,7 +211,7 @@ export default { ...@@ -211,7 +211,7 @@ export default {
}, },
{ {
confId: '3', confId: '3',
confName: '已过期' confName: '已失效'
} }
], ],
wechatUserFlagList: [ wechatUserFlagList: [
......
...@@ -202,7 +202,22 @@ export default { ...@@ -202,7 +202,22 @@ export default {
label: '券来源', label: '券来源',
prop: 'packageName', prop: 'packageName',
formatter: cellValue => { formatter: cellValue => {
return cellValue.packageId ? cellValue.packageName : cellValue.directionalGiftId ? cellValue.directionalGiftName : '-' let txt = ''
if (this.$isGroupUp) {
txt = cellValue.packageId ? cellValue.packageName : cellValue.directionalGiftId ? cellValue.directionalGiftName : '-'
} else {
txt = {
'': '-',
1: '营销活动',
2: '营销活动',
3: '会员服务套餐',
4: '营销活动',
5: '关联商品购买',
6: '通过集团套餐赠送',
7: '通过定向礼包赠送'
}[cellValue.receiveWay]
}
return txt
} }
}, },
{ {
......
...@@ -45,14 +45,14 @@ ...@@ -45,14 +45,14 @@
</div> </div>
</div> </div>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<!-- <a class="dialog-jump" @click="jumpUrl" v-if="this.$globalState.session.accountLevel == 4 && this.$globalState.session.merchantModel == 2">没有意向标签?点我创建</a> --> <el-button size="small" @click="handleClose">
<el-button size="small" @click="dialogVisible = false">取 消</el-button> 取 消
</el-button>
<el-button size="small" type="primary" @click="handleSelect">确 定</el-button> <el-button size="small" type="primary" @click="handleSelect">确 定</el-button>
</span> </span>
</el-dialog> </el-dialog>
</div> </div>
</template> </template>
<script> <script>
import { utils } from 'glsx-common' import { utils } from 'glsx-common'
import util from '@/utils/util' import util from '@/utils/util'
...@@ -110,7 +110,6 @@ export default { ...@@ -110,7 +110,6 @@ export default {
}) })
.then(res => { .then(res => {
if (selectItem && selectItem.length > 0) { if (selectItem && selectItem.length > 0) {
console.log(res.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,
...@@ -138,10 +137,12 @@ export default { ...@@ -138,10 +137,12 @@ export default {
}) })
this.labelTreeRets.forEach((item, index) => { this.labelTreeRets.forEach((item, index) => {
this.$nextTick(() => { this.$nextTick(() => {
this.handleCheckedChange(item.tagChecked, index) this.handleCheckedChange(item.tagChecked, index, 1)
}) })
}) })
this.$nextTick(() => {
this.labelTreeRetSelect = utils.deepClone(this.labelTreeRets) this.labelTreeRetSelect = utils.deepClone(this.labelTreeRets)
})
} else { } else {
this.labelTreeRets = res.labelTreeRets.map(item => { this.labelTreeRets = res.labelTreeRets.map(item => {
return { return {
...@@ -179,6 +180,10 @@ export default { ...@@ -179,6 +180,10 @@ export default {
}) })
}) })
}, },
handleClose() {
this.labelTreeRetSelect = []
this.dialogVisible = false
},
remove(items, idx) { remove(items, idx) {
items.tagChecked.splice(idx, 1) items.tagChecked.splice(idx, 1)
this.labelTreeRets.forEach(item => { this.labelTreeRets.forEach(item => {
...@@ -201,7 +206,7 @@ export default { ...@@ -201,7 +206,7 @@ export default {
}) })
this.labelTreeRets.forEach((item, index) => { this.labelTreeRets.forEach((item, index) => {
this.$nextTick(() => { this.$nextTick(() => {
this.handleCheckedChange(item.tagChecked, index) this.handleCheckedChange(item.tagChecked, index, 1)
}) })
}) })
}, },
...@@ -223,8 +228,6 @@ export default { ...@@ -223,8 +228,6 @@ export default {
}, },
//全选 //全选
handleCheckAllChange(val, index) { handleCheckAllChange(val, index) {
console.log(val, index)
console.log(this.labelTreeRetSelect, '==12')
if (val) { if (val) {
this.labelTreeRets[index].tagChecked = [] this.labelTreeRets[index].tagChecked = []
this.labelTreeRets[index].labelList.forEach(item => { this.labelTreeRets[index].labelList.forEach(item => {
...@@ -241,11 +244,9 @@ export default { ...@@ -241,11 +244,9 @@ export default {
} }
}) })
}) })
console.log(this.labelTreeRets, '==1532')
}, },
//选中 //选中
handleCheckedChange(value, index, status) { handleCheckedChange(value, index, status) {
console.log(value, index, status)
let checkedCount = value.length let checkedCount = value.length
this.labelTreeRets[index].checkAll = checkedCount === this.labelTreeRets[index].labelList.length this.labelTreeRets[index].checkAll = checkedCount === this.labelTreeRets[index].labelList.length
this.labelTreeRets[index].isIndeterminate = checkedCount > 0 && checkedCount < this.labelTreeRets[index].labelList.length this.labelTreeRets[index].isIndeterminate = checkedCount > 0 && checkedCount < this.labelTreeRets[index].labelList.length
...@@ -271,7 +272,6 @@ export default { ...@@ -271,7 +272,6 @@ export default {
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.dialog-jump { .dialog-jump {
color: #5850ff; color: #5850ff;
...@@ -339,7 +339,6 @@ export default { ...@@ -339,7 +339,6 @@ export default {
line-height: 24px; line-height: 24px;
font-size: 14px; font-size: 14px;
color: #666; color: #666;
max-width: 200px;
text-overflow: ellipsis; text-overflow: ellipsis;
overflow: hidden; overflow: hidden;
white-space: nowrap; white-space: nowrap;
...@@ -352,9 +351,6 @@ export default { ...@@ -352,9 +351,6 @@ export default {
margin-left: 40px; margin-left: 40px;
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
.radio-tag {
display: inline-block;
width: 50%;
.el-checkbox { .el-checkbox {
width: 40%; width: 40%;
margin-bottom: 6px; margin-bottom: 6px;
...@@ -363,7 +359,6 @@ export default { ...@@ -363,7 +359,6 @@ export default {
} }
} }
} }
}
} }
.tag-show { .tag-show {
color: #aaa5fa !important; color: #aaa5fa !important;
...@@ -375,6 +370,7 @@ export default { ...@@ -375,6 +370,7 @@ export default {
overflow: auto; overflow: auto;
} }
.tag-selected-box { .tag-selected-box {
min-height: 200px; // min-height: 200px;
overflow: auto;
} }
</style> </style>
\ No newline at end of file \ No newline at end of file
...@@ -150,7 +150,10 @@ export default { ...@@ -150,7 +150,10 @@ export default {
{ {
label: '用户信息', label: '用户信息',
prop: 'accountName' prop: 'accountName',
formatter: cellValue => {
return cellValue.accountName + ' ' + cellValue.mobile
}
}, },
{ {
label: '订单号', label: '订单号',
...@@ -167,12 +170,8 @@ export default { ...@@ -167,12 +170,8 @@ export default {
}, },
created() { created() {
if (window.__POWERED_BY_QIANKUN__) { if (window.__POWERED_BY_QIANKUN__) {
console.log('kkk', this.$globalState)
this.merchantModel = this.$globalState.session.merchantModel this.merchantModel = this.$globalState.session.merchantModel
this.accountLevel = this.$globalState.session.accountLevel this.accountLevel = this.$globalState.session.accountLevel
if (this.merchantModel == 1 && this.accountLevel == 1) {
this.searchForm.orderType = 2
}
} }
}, },
mounted() {}, mounted() {},
...@@ -231,6 +230,13 @@ export default { ...@@ -231,6 +230,13 @@ export default {
this.refundVisible = !this.refundVisible this.refundVisible = !this.refundVisible
}, },
refundConfirmDialog() { refundConfirmDialog() {
if (this.refund == '') {
this.$message({
message: '请输入退款说明',
type: 'error'
})
return
}
const params = { const params = {
reason: this.refund, reason: this.refund,
orderCode: this.orderCode orderCode: this.orderCode
...@@ -251,8 +257,7 @@ export default { ...@@ -251,8 +257,7 @@ export default {
this.$router.push({ this.$router.push({
path: '/memberCenter/orderDetail', path: '/memberCenter/orderDetail',
query: { query: {
id: row.id, id: row.id
detail: row
} }
}) })
}, },
...@@ -302,10 +307,12 @@ export default { ...@@ -302,10 +307,12 @@ export default {
.choseRow { .choseRow {
display: flex; display: flex;
height: auto; height: auto;
width: auto; width:auto;
position: relative; position: relative;
width:285px;
left: calc(100% - 285px); left: calc(100% - 285px);
.choseItem { .choseItem {
display:inline-block;
cursor: pointer; cursor: pointer;
text-align: center; text-align: center;
font-size: 12px; font-size: 12px;
......
...@@ -27,6 +27,13 @@ ...@@ -27,6 +27,13 @@
<template slot="orderType" slot-scope="scope"> <template slot="orderType" slot-scope="scope">
<span>{{ scope.scope.orderType == 1 ? '套餐' : '权益卡' }}</span> <span>{{ scope.scope.orderType == 1 ? '套餐' : '权益卡' }}</span>
</template> </template>
<template slot="amount">
<span>1</span>
</template>
<template slot="totalPrice" slot-scope="scope">
<span>{{ scope.scope.originalPrice * 1 }}</span>
</template>
<template slot="orderStatus" slot-scope="scope"> <template slot="orderStatus" slot-scope="scope">
<span>{{ scope.scope.orderStatus == 2 ? '待收货' : scope.scope.orderStatus == 3 ? '已完成' : scope.scope.orderStatus == 4 ? '售后中' : scope.scope.orderStatus == 5 ? '退款失败' : scope.scope.orderStatus == 6 ? '已退款' : '' }}</span> <span>{{ scope.scope.orderStatus == 2 ? '待收货' : scope.scope.orderStatus == 3 ? '已完成' : scope.scope.orderStatus == 4 ? '售后中' : scope.scope.orderStatus == 5 ? '退款失败' : scope.scope.orderStatus == 6 ? '已退款' : '' }}</span>
</template> </template>
...@@ -59,80 +66,6 @@ ...@@ -59,80 +66,6 @@
<el-button type="primary" @click="goBack">返回</el-button> <el-button type="primary" @click="goBack">返回</el-button>
</div> </div>
</div> </div>
<!-- <div class="live-room container">
<div class="topMsg">
<div class="orderNo">订单编号:{{ detail.orderCode }}</div>
<div class="orderTime">下单时间:{{ detail.createDate }}</div>
<el-button type="primary" size="small" class="backBtn" @click="goBack">
返回
</el-button>
</div>
<div class="midMsgWrap">
<div class="midMsgTitle">
<span>支付信息</span>
<span>用户信息</span>
<span>服务名称</span>
<span>已核/总次数</span>
</div>
<div class="midMsgContent">
<div class="item">
<div>付款状态:已付款</div>
<div>
付款金额:{{ detail.realPayPrice }}
<span v-show="detail.realPayPrice">元</span>
</div>
<div>付款方式:微信支付</div>
<div>付款时间:{{ detail.createDate }}</div>
</div>
<div class="item">
<div class="userName">用户名称:{{ detail.accountName }}</div>
<div class="phoneNumber">用户手机号:{{ detail.mobile }}</div>
</div>
<div class="item">
<div v-for="(item, index) in detail.list" :key="index">{{ item.serviceName }}</div>
</div>
<div class="item">
<div v-for="(item, index) in detail.list" :key="index">{{ item.serviceAmount }}/{{ item.serviceCount }}次</div>
</div>
</div>
</div>
<div id="tableWrap">
<div class="tableWrapBox">
<el-table :data="tableData" style="width: 100%" :header-cell-style="{ height: '54px', background: '#F4F6FC', color: '#333333', fontSize: '14px' }">
<el-table-column label="商品名称" align="center">
<template slot-scope="scope">
<div v-for="(item, index) in scope.row.couponList" :key="index">{{ item.couponName }}</div>
</template>
</el-table-column>
<el-table-column label="类型" align="center">
<template slot-scope="scope">
<span>{{ scope.row.orderType == 1 ? '套餐' : '权益卡' }}</span>
</template>
</el-table-column>
<el-table-column label="有效期" align="center" v-if="detail.orderType == 2">
<template slot-scope="scope">
<span>{{ scope.row.effectiveNum == '-1' ? '无限制' : scope.row.effectiveNum + '天' }}</span>
</template>
</el-table-column>
<el-table-column prop="originalPrice" label="单价/元" align="center"></el-table-column>
<el-table-column prop="amount" label="数量" align="center"></el-table-column>
<el-table-column prop="totalPrice" label="小计/元" align="center"></el-table-column>
<el-table-column prop="realPayPrice" label="实收金额" align="center">
<template slot-scope="scope">
<span style="color:#EB4E4E">{{ scope.row.realPayPrice }}</span>
</template>
</el-table-column>
<el-table-column prop="orderStatus" label="状态" align="center">
<template slot-scope="scope">
<div>{{ scope.row.refundReason }}</div>
</template>
</el-table-column>
</el-table>
</div>
</div>
</div> -->
</div> </div>
</template> </template>
...@@ -233,8 +166,8 @@ export default { ...@@ -233,8 +166,8 @@ export default {
}, },
{ {
colList: [ colList: [
{ thColspan: 1, tdColspan: 2, label: '数量', name: 'amount' }, { thColspan: 1, tdColspan: 2, label: '数量', name: 'amount', addHtml: 'amount' },
{ thColspan: 1, tdColspan: 2, label: '小计/元', name: 'totalPrice' } { thColspan: 1, tdColspan: 2, label: '小计/元', name: 'totalPrice', addHtml: 'totalPrice' }
] ]
}, },
{ {
...@@ -306,9 +239,6 @@ export default { ...@@ -306,9 +239,6 @@ export default {
created() { created() {
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) {
this.basicParams.splice(6, 1)
}
} }
this.tableSearchForm = { this.tableSearchForm = {
id: this.$route.query.id id: this.$route.query.id
...@@ -316,20 +246,13 @@ export default { ...@@ -316,20 +246,13 @@ export default {
this.getOrderPageDetail() this.getOrderPageDetail()
}, },
mounted() { mounted() {},
// this.$nextTick(() => {
// let clientHeight = document.documentElement.clientHeight
// let offsettop = document.getElementById('tableWrap').offsetTop
// document.getElementById('tableWrap').style.minHeight = clientHeight - offsettop - 120 + 'px'
// })
},
methods: { methods: {
dateFormatFun(date) { dateFormatFun(date) {
return dateFormat(date) return dateFormat(date)
}, },
getOrderPageDetail() { getOrderPageDetail() {
getOrderPageDetail({ id: this.$route.query.id }).then(res => { getOrderPageDetail({ id: this.$route.query.id }).then(res => {
// this.mylist=res.list
if (res.code == '0') { if (res.code == '0') {
this.detailData = res.data this.detailData = res.data
} else { } else {
......
...@@ -23,6 +23,9 @@ ...@@ -23,6 +23,9 @@
<span slot="effectiveType" slot-scope="scope"> <span slot="effectiveType" slot-scope="scope">
<span>{{ toLabelText(scope.scope) }}</span> <span>{{ toLabelText(scope.scope) }}</span>
</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 slot="useType" slot-scope="scope">
<span>{{ toRestrictLabelText(scope.scope) }}</span> <span>{{ toRestrictLabelText(scope.scope) }}</span>
</span> </span>
...@@ -31,6 +34,9 @@ ...@@ -31,6 +34,9 @@
<span slot="effectiveType" slot-scope="scope"> <span slot="effectiveType" slot-scope="scope">
<span>{{ toLabelText(scope.scope) }}</span> <span>{{ toLabelText(scope.scope) }}</span>
</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 slot="useType" slot-scope="scope">
<span>{{ toCashRestrictLabelText(scope.scope) }}</span> <span>{{ toCashRestrictLabelText(scope.scope) }}</span>
</span> </span>
...@@ -39,6 +45,9 @@ ...@@ -39,6 +45,9 @@
<span slot="effectiveType" slot-scope="scope"> <span slot="effectiveType" slot-scope="scope">
<span>{{ toLabelText(scope.scope) }}</span> <span>{{ toLabelText(scope.scope) }}</span>
</span> </span>
<span slot="stock" slot-scope="scope">
<span>{{ scope.scope.limitStockFlag == 1 ? scope.scope.stock : '无限制' }}</span>
</span>
<span slot="useType"> <span slot="useType">
<span>-</span> <span>-</span>
</span> </span>
...@@ -47,6 +56,9 @@ ...@@ -47,6 +56,9 @@
<span slot="effectiveType" slot-scope="scope"> <span slot="effectiveType" slot-scope="scope">
<span>{{ toLabelText(scope.scope) }}</span> <span>{{ toLabelText(scope.scope) }}</span>
</span> </span>
<span slot="stock" slot-scope="scope">
<span>{{ scope.scope.limitStockFlag == 1 ? scope.scope.stock : '无限制' }}</span>
</span>
<span slot="useType"> <span slot="useType">
<span>-</span> <span>-</span>
</span> </span>
...@@ -142,13 +154,6 @@ export default { ...@@ -142,13 +154,6 @@ export default {
label: '名称', label: '名称',
prop: 'couponName' prop: 'couponName'
}, },
// {
// label: '预估成本/元',
// prop: 'anticipatedCost',
// formatter: cellValue => {
// return (cellValue.anticipatedCost / 100).toFixed(2)
// }
// },
{ {
label: '有效期', label: '有效期',
prop: 'effectiveType', prop: 'effectiveType',
...@@ -156,8 +161,8 @@ export default { ...@@ -156,8 +161,8 @@ export default {
}, },
{ {
label: '可用次数', label: '可用次数',
prop: 'effectiveType', prop: 'useType',
addHtml: 'effectiveType' addHtml: 'useType'
}, },
{ {
label: '适用范围', label: '适用范围',
...@@ -172,7 +177,8 @@ export default { ...@@ -172,7 +177,8 @@ export default {
}, },
{ {
label: '剩余库存', label: '剩余库存',
prop: 'residueAmount' prop: 'stock',
addHtml: 'stock'
} }
] ]
} }
...@@ -236,7 +242,7 @@ export default { ...@@ -236,7 +242,7 @@ export default {
} }
this.loading = true this.loading = true
this.$apis.giftBag this.$apis.giftBag
.getDirectionalGiftListApi(params) .getghDirectionalGiftListApi(params)
.then(res => { .then(res => {
// 重置分页组件 // 重置分页组件
if (this.$refs[this.activeName + 'Ref'] && isResetPage) { if (this.$refs[this.activeName + 'Ref'] && isResetPage) {
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
/> />
</div> </div>
<tip-panel class="list-panel" panelMinHeight="40px" :panelContent="panelContent" v-if="isFirstShow" @closePanel="closePanel"></tip-panel> <tip-panel class="list-panel" panelMinHeight="40px" :panelContent="panelContent" v-if="isFirstShow" @closePanel="closePanel"></tip-panel>
<template v-if="accountLevel == 4"> <template v-if="accountLevel == 4 && merchantModel == 1">
<div class="setmeal-tabs flex-default m-t-10"> <div class="setmeal-tabs flex-default m-t-10">
<template v-for="(tab, index) in tabList"> <template v-for="(tab, index) in tabList">
<div :class="['tab', tab.checked ? 'active' : '']" @click="changeTab(index)" :key="index">{{ tab.text }}</div> <div :class="['tab', tab.checked ? 'active' : '']" @click="changeTab(index)" :key="index">{{ tab.text }}</div>
...@@ -33,10 +33,9 @@ ...@@ -33,10 +33,9 @@
<ticket :choseItemList="scope.scope.list"></ticket> <ticket :choseItemList="scope.scope.list"></ticket>
</div> </div>
</span> </span>
<span class="table-btns" slot="optionsFun" slot-scope="scope" :data="scope.scope"> <span class="table-btns" slot="optionsFun" slot-scope="scope" :data="scope.scope">
<!-- 是否置顶推荐:1 是;2 否 --> <template v-if="!(accountLevel == 4 && activetab == 1)">
<el-button type="text" v-if="scope.scope.topFlag == 1">已指定推荐</el-button>
<GLButton type="text" @click="handleUpdateToTop(scope.scope)" v-if="scope.scope.topFlag == 2" fn="置顶推荐">置顶推荐</GLButton>
<template v-if="scope.scope.state === 0"> <template v-if="scope.scope.state === 0">
<!-- <el-button type="text" @click="handleEdit(scope.scope)">编辑</el-button> <!-- <el-button type="text" @click="handleEdit(scope.scope)">编辑</el-button>
...@@ -59,6 +58,9 @@ ...@@ -59,6 +58,9 @@
<GLButton type="text" @click="handleUpOption(scope.scope)" fn="上架">上架</GLButton> <GLButton type="text" @click="handleUpOption(scope.scope)" fn="上架">上架</GLButton>
<GLButton type="text" @click="handleDelete(scope.scope)" fn="删除">删除</GLButton> <GLButton type="text" @click="handleDelete(scope.scope)" fn="删除">删除</GLButton>
</template> </template>
<GLButton type="text" @click="handleUpdateToTop(scope.scope)" v-if="scope.scope.topFlag == 2" fn="置顶推荐">置顶推荐</GLButton>
<el-button type="text" v-if="scope.scope.topFlag == 1">已置顶推荐</el-button>
</template>
</span> </span>
</GLTable> </GLTable>
</div> </div>
...@@ -141,33 +143,25 @@ export default { ...@@ -141,33 +143,25 @@ export default {
{ {
label: '套餐名称', label: '套餐名称',
prop: 'packageName', prop: 'packageName',
width: '180' width: 220
}, },
{ {
label: '套餐售价/元', label: '套餐售价/元',
prop: 'packagePrice', prop: 'packagePrice'
width: 140
}, },
{ {
label: '说明', label: '说明',
prop: 'notes', prop: 'notes',
width: 160, width: 300,
line: 4 line: 4
}, },
{ {
label: '购买人数', label: '售出数量',
prop: 'buyNumber', prop: 'buyNumber'
line: 1
}, },
{ {
label: '套餐总价',
prop: 'referencePrice'
},
{
label: '状态', label: '状态',
prop: 'state', prop: 'state',
width: '80',
formatter: cellValue => { formatter: cellValue => {
return this.baseDataList.stateList.find(item => item.confId == cellValue.state).confName return this.baseDataList.stateList.find(item => item.confId == cellValue.state).confName
} }
...@@ -176,7 +170,7 @@ export default { ...@@ -176,7 +170,7 @@ export default {
label: '操作', label: '操作',
prop: 'optionsFun', prop: 'optionsFun',
addHtml: 'optionsFun', addHtml: 'optionsFun',
width: 160 width: 220
} }
] ]
}, },
...@@ -191,7 +185,7 @@ export default { ...@@ -191,7 +185,7 @@ export default {
}, },
computed: { computed: {
getListApi() { getListApi() {
const { activetab, merchantModel, accountLevel } = this const { activetab } = this
let listApi = getSetMealListApi let listApi = getSetMealListApi
if (activetab == 1) { if (activetab == 1) {
listApi = getSetMealListApi listApi = getSetMealListApi
...@@ -202,39 +196,48 @@ export default { ...@@ -202,39 +196,48 @@ export default {
} }
}, },
created() { created() {
console.log(this.$route.query.activetab)
if (window.__POWERED_BY_QIANKUN__) { if (window.__POWERED_BY_QIANKUN__) {
//运行在qiankun容器中 //运行在qiankun容器中
this.merchantId = this.$globalState.session.merchantId this.merchantId = this.$globalState.session.merchantId
this.merchantModel = this.$globalState.session.merchantModel this.merchantModel = this.$globalState.session.merchantModel
this.accountLevel = this.$globalState.session.accountLevel this.accountLevel = this.$globalState.session.accountLevel
// this.userType = this.$globalState.session.userType // this.userType = this.$globalState.session.userType
if (this.merchantModel == 2) {
this.activetab = 0
}
} }
this.searchForm = { this.searchForm = {
merchantId: this.merchantId merchantId: this.merchantId
// merchantName // merchantName
} }
if (this.$route.query && this.$route.query.activetab) {
this.activetab = 0
// this.changeTab(this.activetab)
this.tabList.forEach(item => (item.checked = false))
this.tabList[this.activetab].checked = true
}
this.dynamicFile() this.dynamicFile()
this.getLoginCountFun() this.getLoginCountFun()
}, },
mounted() {}, mounted() {},
methods: { methods: {
dynamicFile() { dynamicFile() {
const { activetab, merchantModel, accountLevel } = this let { activetab, accountLevel } = this
const saleParam = { const saleParam = {
label: '在本店售出数量', label: '售出数量',
prop: 'buyNumber', prop: 'buyNumber'
width: 140
} }
const referencePrice = { const referencePrice = {
label: '套餐总价', label: '套餐总价',
prop: 'referencePrice' prop: 'referencePrice'
} }
// accountLevel == 4
if (activetab == 1 && accountLevel == 4) { if ((activetab == 1 && accountLevel == 4) || accountLevel != 4) {
this.tableParams.tableColumns.splice(5, 1, saleParam) this.tableParams.tableColumns.splice(4, 1, saleParam)
} else { } else if (activetab == 0 && accountLevel == 4) {
this.tableParams.tableColumns.splice(5, 1, referencePrice) this.tableParams.tableColumns.splice(4, 1, referencePrice)
} }
}, },
changeTab(index) { changeTab(index) {
...@@ -433,8 +436,8 @@ export default { ...@@ -433,8 +436,8 @@ export default {
} }
.setmeal-tabs { .setmeal-tabs {
cursor: pointer; cursor: pointer;
width: auto;
position: relative; position: relative;
width:200px;
left: calc(100% - 196px); left: calc(100% - 196px);
.tab { .tab {
background: #fafafa; background: #fafafa;
......
...@@ -13,15 +13,9 @@ ...@@ -13,15 +13,9 @@
<el-form-item size="small" label="服务内容" class="is-required"> <el-form-item size="small" label="服务内容" class="is-required">
<el-button @click="handleGiftAdd" size="small" class="default-blue-btn">选择服务</el-button> <el-button @click="handleGiftAdd" size="small" class="default-blue-btn">选择服务</el-button>
<div class="gift-block m-t-10" :style="{ 'margin-left': labelWidth }" v-show="choseItemList.length != 0"> <div class="gift-block m-t-10" :style="{ 'margin-left': labelWidth }" v-show="choseItemList.length != 0">
<!-- <div class="gift-title">
合计:
<span class="price">{{ totalEstimatedCost }}</span>
元
</div> -->
<div v-for="(item, index) in orderShow" :key="index"> <div v-for="(item, index) in orderShow" :key="index">
<div class="gift-box flex-top" v-show="couponObj[item].list.length"> <div class="gift-box flex-top" v-show="couponObj[item].list.length">
<img class="gift-logo" :src="couponObj[item].logo" alt="" /> <img class="gift-logo" :src="couponObj[item].logo" alt="" />
<!-- <div class="gift-label">{{ couponObj[item].label }}:</div> -->
<div class="gift-content"> <div class="gift-content">
<div class="gift-item" v-for="(subItem, subIndex) in couponObj[item].list" :key="subIndex"> <div class="gift-item" v-for="(subItem, subIndex) in couponObj[item].list" :key="subIndex">
<span :class="['circle', subItem.status == '3' ? ' grey' : '']"></span> <span :class="['circle', subItem.status == '3' ? ' grey' : '']"></span>
...@@ -33,23 +27,11 @@ ...@@ -33,23 +27,11 @@
</div> </div>
</div> </div>
</div> </div>
<!-- <div class="allChoseWrap" v-if="this.choseItemList.length > 0">
<div class="choseItem" v-for="(item, index) in choseItemList" :key="index">
<span>{{ item.couponName }}×{{ item.serviceQuantity }}</span>
<div class="close-x" @click="closeChoseItemFun(item, index)">×</div>
</div>
</div> -->
<div class="el-form-item__error" v-if="setmealContentRules">请选择套餐</div> <div class="el-form-item__error" v-if="setmealContentRules">请选择套餐</div>
<!-- <div class="totalWrap" v-if="this.choseItemList.length > 0">
<span>合计:</span>
<span>{{ totalPrice }}元</span>
</div> -->
</el-form-item> </el-form-item>
<el-form-item size="small" label="套餐售价" prop="packagePrice" style="width: 315px"> <el-form-item size="small" label="套餐售价" prop="packagePrice" style="width: 315px">
<el-input size="small" v-model="ruleForm.packagePrice" placeholder="请输入套餐售价" @keyup.native="ruleForm.packagePrice = oninput(ruleForm.packagePrice)"> <el-input size="small" v-model="ruleForm.packagePrice" placeholder="请输入套餐售价" @keyup.native="ruleForm.packagePrice = oninput(ruleForm.packagePrice)">
<!-- <template slot="append">元</template> -->
<span slot="suffix" class="suffix-label">元</span> <span slot="suffix" class="suffix-label">元</span>
</el-input> </el-input>
</el-form-item> </el-form-item>
...@@ -83,18 +65,14 @@ ...@@ -83,18 +65,14 @@
</el-form-item> </el-form-item>
</el-form> </el-form>
</div> </div>
<div <div class="footer-panel">
class="footer-panel" <div>
:style="{
left: footerLeft + 'px',
width: footerWidth + 'px'
}"
>
<el-button type="primary" @click="submitForm()" size="medium" :loading="sloading">创建</el-button> <el-button type="primary" @click="submitForm()" size="medium" :loading="sloading">创建</el-button>
<el-button type="primary" @click="goBack" size="medium">取消</el-button> <el-button type="primary" @click="goBack" size="medium">取消</el-button>
</div> </div>
</div>
<!-- :modalAppendToBody="false" --> <!-- :modalAppendToBody="false" -->
<glsx-dialog title="套餐服务" class="setmealServiceDialog" width="1142px" :noCancel="true" :noClose="false" btnSize="small" :isVisible="setmealDialogVisible" @closeDialog="handleClose" @confirmDialog="handleConfirm"> <!-- <glsx-dialog title="套餐服务" class="setmealServiceDialog" width="1142px" :noCancel="true" :noClose="false" btnSize="small" :isVisible="setmealDialogVisible" @closeDialog="handleClose" @confirmDialog="handleConfirm">
<div class="content-body"> <div class="content-body">
<div class="subTitle"> <div class="subTitle">
<span>请选择套餐服务:</span> <span>请选择套餐服务:</span>
...@@ -116,13 +94,6 @@ ...@@ -116,13 +94,6 @@
<div class="useTime" v-if="item.useType == 0">有效期内无限制</div> <div class="useTime" v-if="item.useType == 0">有效期内无限制</div>
<div class="useTime" v-if="item.useType == 1">有效期内可使用{{ item.useAmount }}次</div> <div class="useTime" v-if="item.useType == 1">有效期内可使用{{ item.useAmount }}次</div>
<div class="useTime" v-if="item.useType == 2">每{{ item.useLimitDays }}天可以使用{{ item.useAmount }}次</div> <div class="useTime" v-if="item.useType == 2">每{{ item.useLimitDays }}天可以使用{{ item.useAmount }}次</div>
<!-- <div class="select-package-time" ng-show="item.effectiveType == 3">有效期:无有效期</div>
<div class="select-package-time" ng-show="item.effectiveType == 1">有效期:{{item.effectiveDays}}天</div>
<div class="select-package-time" ng-show="item.effectiveType == 2">有效期:{{item.effectiveStartTime.split(' ')[0]}} - {{item.effectiveEndTime.split(' ')[0]}}</div>
<div class="select-package-time" ng-show="item.useType == 0">有效期内无限制</div>
<div class="select-package-time" ng-show="item.useType == 1">有效期内可使用{{item.useAmount}}次</div>
<div class="select-package-time" ng-show="item.useType == 2">每{{item.useLimitDays}}天可以使用{{item.useAmount}}次</div> -->
</div> </div>
<div class="optionBtns" v-if="item.serviceQuantity > 0"> <div class="optionBtns" v-if="item.serviceQuantity > 0">
...@@ -144,7 +115,7 @@ ...@@ -144,7 +115,7 @@
<span class="redText">{{ totalPrice }}</span> <span class="redText">{{ totalPrice }}</span>
</div> </div>
</div> </div>
</glsx-dialog> </glsx-dialog> -->
<glsx-dialog title="" top="30vh" :hasScroll="false" class="tipDialog" width="547px" btnCloseLabel="取消" :noClose="false" :noCancel="true" btnSize="small" :isVisible="isTipDialogVisible" :showClose="false" @closeDialog="handleTipClose" @confirmDialog="handleTipConfirm"> <glsx-dialog title="" top="30vh" :hasScroll="false" class="tipDialog" width="547px" btnCloseLabel="取消" :noClose="false" :noCancel="true" btnSize="small" :isVisible="isTipDialogVisible" :showClose="false" @closeDialog="handleTipClose" @confirmDialog="handleTipConfirm">
<div class="content-body"> <div class="content-body">
<img src="@/assets/icon-warning.png" alt="" /> <img src="@/assets/icon-warning.png" alt="" />
...@@ -197,7 +168,6 @@ export default { ...@@ -197,7 +168,6 @@ export default {
merchantName: '', merchantName: '',
setmealContentRules: false, setmealContentRules: false,
//弹窗 //弹窗
setmealDialogVisible: false,
//弹窗2(提示弹窗) //弹窗2(提示弹窗)
isTipDialogVisible: false, isTipDialogVisible: false,
selectNum: 0, selectNum: 0,
...@@ -274,23 +244,7 @@ export default { ...@@ -274,23 +244,7 @@ export default {
this.getCardContentFun() this.getCardContentFun()
this.getSetmealServiceFun() //获取服务套餐,执行完了之后去获取编辑详情 this.getSetmealServiceFun() //获取服务套餐,执行完了之后去获取编辑详情
}, },
watch: {
// allItemList: {
// deep: true,
// handler(val) {
// this.choseItemList = this.allItemList.filter(item => item.serviceQuantity > 0)
// this.choseItemList = this.choseItemList.map(ele => {
// return {
// ...ele,
// serviceId: ele.id
// }
// })
// }
// }
},
mounted() { mounted() {
this.footerLeft = document.querySelector('.base-container-right').offsetLeft
this.footerWidth = document.documentElement.clientWidth - this.footerLeft
}, },
methods: { methods: {
getCardContentFun() { getCardContentFun() {
...@@ -311,8 +265,6 @@ export default { ...@@ -311,8 +265,6 @@ export default {
this.choseItemList.push(k) this.choseItemList.push(k)
}) })
}) })
console.log(this.choseItemList, 'choseItemList')
// this.hasCouponBlock()
}, },
handleGiftDelete(attr, idx) { handleGiftDelete(attr, idx) {
this.couponObj[attr].list.splice(idx, 1) this.couponObj[attr].list.splice(idx, 1)
...@@ -333,7 +285,6 @@ export default { ...@@ -333,7 +285,6 @@ export default {
this.totalEstimatedCost = (this.totalEstimatedCost / 100).toFixed(2) this.totalEstimatedCost = (this.totalEstimatedCost / 100).toFixed(2)
}, },
handleGiftAdd() { handleGiftAdd() {
console.log(this.couponObj)
this.selectedMealList = JSON.parse(JSON.stringify(this.couponObj)) this.selectedMealList = JSON.parse(JSON.stringify(this.couponObj))
this.handleGiftClose() this.handleGiftClose()
}, },
...@@ -343,7 +294,6 @@ export default { ...@@ -343,7 +294,6 @@ export default {
handleGiftConfirm(selectedData) { handleGiftConfirm(selectedData) {
this.handleGiftClose() this.handleGiftClose()
this.couponObj = selectedData this.couponObj = selectedData
// this.recoveryTotalPrice()
this.recoveryGiftList() this.recoveryGiftList()
}, },
recoveryCoupon() { recoveryCoupon() {
...@@ -353,26 +303,6 @@ export default { ...@@ -353,26 +303,6 @@ export default {
this.choseItemList.forEach(item => { this.choseItemList.forEach(item => {
this.couponObj[this.numToCoupon[item.discountType]].list.push(item) this.couponObj[this.numToCoupon[item.discountType]].list.push(item)
}) })
console.log(this.couponObj, 'this.couponObj')
// this.currentCoupons = this.$common.utils.deepClone(this.editForm.couponList)
// this.currentPeople = this.$common.utils.deepClone(this.editForm.staffList)
// this.hasCouponBlock(false)
},
openDialog() {
this.allItemList.forEach(item => {
item.serviceQuantity = 0
})
this.allItemList.forEach(item => {
for (let i = 0; i < this.choseItemList.length; i++) {
if (this.choseItemList[i].serviceId == item.id) {
item.serviceQuantity = this.choseItemList[i].serviceQuantity
}
}
})
this.selectNumFun()
this.setmealDialogVisible = true
this.setmealContentRules = false
}, },
//编辑详情 //编辑详情
getServiceInfo() { getServiceInfo() {
...@@ -391,9 +321,6 @@ export default { ...@@ -391,9 +321,6 @@ export default {
} }
}) })
this.recoveryCoupon() this.recoveryCoupon()
// this.recoveryTotalPrice()
console.log('编辑内容', this.choseItemList, this.totalPrice)
this.copyTotalPrice = this.totalPrice this.copyTotalPrice = this.totalPrice
this.copyRuleForm = JSON.parse(JSON.stringify(this.ruleForm)) //深拷贝一份数据 this.copyRuleForm = JSON.parse(JSON.stringify(this.ruleForm)) //深拷贝一份数据
this.copyChoseItemList = this.choseItemList this.copyChoseItemList = this.choseItemList
...@@ -415,56 +342,14 @@ export default { ...@@ -415,56 +342,14 @@ export default {
serviceQuantity: 0 serviceQuantity: 0
} }
}) })
console.log(this.allItemList, '服务套餐')
if (this.id) { if (this.id) {
this.getServiceInfo() //获取编辑详情 this.getServiceInfo() //获取编辑详情
} }
}) })
}, },
//选中该条服务套餐
handlePackage(item, index) {
if (item.serviceQuantity == 0) {
item.serviceQuantity++
this.selectNumFun()
}
},
//删除该条服务套餐(让item.serviceQuantity==0)
closeChoseItemFun(item, index) {
this.totalPrice = ((this.totalPrice * 100 - item.vipPrice * item.serviceQuantity * 100) / 100).toFixed(2)
// item.serviceQuantity = 0
// this.allItemList.forEach(ele => {
// if (ele.id == item.serviceId) {
// ele.serviceQuantity = 0
// }
// })
// this.selectNumFun()
this.choseItemList.splice(index, 1)
},
selectNumFun() {
this.selectNum = 0
this.totalPrice = 0
this.allItemList.forEach(item => {
if (item.serviceQuantity) {
this.selectNum++
this.totalPrice = ((this.totalPrice * 100 + item.vipPrice * item.serviceQuantity * 100) / 100).toFixed(2)
}
})
},
cutPackage(item, index) {
item.serviceQuantity--
this.selectNumFun()
},
addPackage(item, index) {
item.serviceQuantity++
this.selectNumFun()
},
submitForm(formName) { submitForm(formName) {
console.log(formName)
this.$refs.ruleForm.validate(valid => { this.$refs.ruleForm.validate(valid => {
console.log(valid)
if (!valid) { if (!valid) {
console.log(this.choseItemList, 'this.choseItemList')
if (this.choseItemList.length <= 0) { if (this.choseItemList.length <= 0) {
this.setmealContentRules = true this.setmealContentRules = true
} }
...@@ -511,7 +396,6 @@ export default { ...@@ -511,7 +396,6 @@ export default {
this.sloading = false this.sloading = false
}) })
} else { } else {
console.log('创建')
//调创建的接口 //调创建的接口
let params = {} let params = {}
params.referencePrice = this.totalPrice params.referencePrice = this.totalPrice
...@@ -521,7 +405,6 @@ export default { ...@@ -521,7 +405,6 @@ export default {
params.packagePrice = this.ruleForm.packagePrice params.packagePrice = this.ruleForm.packagePrice
params.notes = this.ruleForm.notes params.notes = this.ruleForm.notes
params.switchStatus = this.ruleForm.switchStatus ? 1 : 0 params.switchStatus = this.ruleForm.switchStatus ? 1 : 0
console.log(this.choseItemList)
let list = this.choseItemList let list = this.choseItemList
for (var i in list) { for (var i in list) {
params[`list[${i}].serviceQuantity`] = list[i].couponAmount params[`list[${i}].serviceQuantity`] = list[i].couponAmount
...@@ -536,7 +419,7 @@ export default { ...@@ -536,7 +419,7 @@ export default {
type: res.code == '0' ? 'success' : 'error' type: res.code == '0' ? 'success' : 'error'
}) })
if (res.code == '0') { if (res.code == '0') {
this.$router.push('/memberCenter/setmeal') this.$router.push('/memberCenter/setmeal?activetab=0')
} }
}) })
.catch(err => { .catch(err => {
...@@ -601,36 +484,6 @@ export default { ...@@ -601,36 +484,6 @@ export default {
str = str.replace(/^\D*([0-9]\d*\.?\d{0,2})?.*$/, '$1') // 小数点后只能输 2 位 str = str.replace(/^\D*([0-9]\d*\.?\d{0,2})?.*$/, '$1') // 小数点后只能输 2 位
return str return str
}, },
handleConfirm() {
var idx = this.allItemList.some(item => item.serviceQuantity > 0)
if (!idx) {
this.$message.error('请选择服务套餐')
return
}
// this.$emit('selectItem', this.allItemList,this.totalPrice);
this.choseItemList = this.allItemList.filter(item => item.serviceQuantity > 0)
this.choseItemList = this.choseItemList.map(ele => {
return {
...ele,
serviceId: ele.id
}
})
console.log('确定之后choseItemList', this.choseItemList)
this.setmealDialogVisible = false
},
handleClose() {
this.setmealDialogVisible = false
this.totalPrice = 0
this.choseItemList.forEach(item => {
this.totalPrice = ((this.totalPrice * 100 + item.vipPrice * item.serviceQuantity * 100) / 100).toFixed(2)
})
// this.totalPrice = this.choseItemList.reduce(function(preValue, choseItem) {
// //第二个参数这里是对象,不是number(n)
// return preValue + choseItem.vipPrice * choseItem.serviceQuantity
// }, 0)
// this.getSetmealServiceFun()
},
handleTipClose() { handleTipClose() {
this.isTipDialogVisible = false this.isTipDialogVisible = false
}, },
...@@ -843,16 +696,22 @@ export default { ...@@ -843,16 +696,22 @@ export default {
} }
} }
.footer-panel { .footer-panel {
display: flex;
align-items: center;
justify-content: center;
position: fixed; position: fixed;
width: 100%;
bottom: 0px; bottom: 0px;
height: 64px; height: 78px;
left: 220px;
width: 100%;
background: #ffffff; background: #ffffff;
z-index: 999;
box-shadow: 0px -1px 1px 0px rgba(88, 80, 255, 0.1); box-shadow: 0px -1px 1px 0px rgba(88, 80, 255, 0.1);
z-index: 999;
div {
display: inline-block;
position: relative;
transform: translate(-50%, -50%);
left: 50%;
top: 50%;
margin-left: -110px;
}
} }
.setmealServiceDialog { .setmealServiceDialog {
/deep/.el-dialog__headerbtn { /deep/.el-dialog__headerbtn {
......
<template> <template>
<div> <div>
<base-info v-show="activeName == 'baseInfo'" ref="baseInfoRef" :routeInfo="routeInfo" @handleTabChange="jumpEvent"></base-info> <base-info v-show="activeName == 'baseInfo'" ref="baseInfoRef" :routeInfo="routeInfo" @handleTabChange="jumpEvent"></base-info>
<edit-event v-if="activeName == 'editEvent'" :eventObj="eventObj" :condLimitObj="condLimitObj" @handleTabChange="jumpBaseInfo" @handleInfoConfirm="handleInfoConfirm"></edit-event> <edit-event v-if="activeName == 'editEvent'" :eventObj="eventObj" :parentCustomerObj="parentCustomerObj" @handleTabChange="jumpBaseInfo" @handleInfoConfirm="handleInfoConfirm"></edit-event>
</div> </div>
</template> </template>
...@@ -21,14 +21,19 @@ export default { ...@@ -21,14 +21,19 @@ export default {
}, },
// 编辑-标记idx // 编辑-标记idx
eventIndex: '', eventIndex: '',
condLimitObj: {
// 1-有;0-无
hasPhone: 0,
hasQw: 0
},
eventObj: { eventObj: {
addOrEdit: 'add', addOrEdit: 'add',
info: {} info: {}
},
parentCustomerObj: {
// 人群,标签,指定
currentCustomerTypeName: '',
parentPredictObj: {
total: '',
qiwei: '',
phone: ''
},
list: []
} }
} }
}, },
...@@ -48,6 +53,8 @@ export default { ...@@ -48,6 +53,8 @@ export default {
}, },
handleInfoConfirm(info) { handleInfoConfirm(info) {
this.eventObj.addOrEdit == 'add' ? this.$refs.baseInfoRef.editForm.eventList.push(info.baseInfo) : this.$set(this.$refs.baseInfoRef.editForm.eventList, this.eventIndex, info.baseInfo) this.eventObj.addOrEdit == 'add' ? this.$refs.baseInfoRef.editForm.eventList.push(info.baseInfo) : this.$set(this.$refs.baseInfoRef.editForm.eventList, this.eventIndex, info.baseInfo)
this.$refs.baseInfoRef.parentCustomerObj.phone = info.predictCountObj.phone
this.$refs.baseInfoRef.parentCustomerObj.qiwei = info.predictCountObj.qiwei
this.$refs.baseInfoRef.dealSopTime() this.$refs.baseInfoRef.dealSopTime()
this.jumpBaseInfo({ activeName: 'baseInfo' }) this.jumpBaseInfo({ activeName: 'baseInfo' })
}, },
...@@ -55,9 +62,8 @@ export default { ...@@ -55,9 +62,8 @@ export default {
jumpEvent(obj) { jumpEvent(obj) {
this.$set(this.eventObj, 'addOrEdit', obj.addOrEdit) this.$set(this.eventObj, 'addOrEdit', obj.addOrEdit)
this.$set(this.eventObj, 'info', obj.info) this.$set(this.eventObj, 'info', obj.info)
this.parentCustomerObj = obj.parentCustomerObj
this.eventIndex = obj.eventIndex this.eventIndex = obj.eventIndex
this.$set(this.condLimitObj, 'hasPhone', obj.condLimitObj.hasPhone)
this.$set(this.condLimitObj, 'hasQw', obj.condLimitObj.hasQw)
this.activeName = obj.activeName this.activeName = obj.activeName
} }
} }
......
...@@ -10,17 +10,39 @@ ...@@ -10,17 +10,39 @@
</div> </div>
<div slot="customerInfoList" slot-scope="scope"> <div slot="customerInfoList" slot-scope="scope">
<div v-if="!scope.scope.isDisabled"> <div v-if="!scope.scope.isDisabled">
<el-button class="default-blue-btn" :size="size" @click="handleSelectCustomer">选择客户</el-button> <!-- <el-button class="default-blue-btn" :size="size" @click="handleSelectCustomer">选择客户</el-button>
<el-button v-show="editForm.customerInfoList.length" :size="size" @click="handleResetCustomer">重置客户</el-button> <el-button v-show="editForm.customerInfoList.length" :size="size" @click="handleResetCustomer">重置客户</el-button> -->
<el-radio-group v-model="editForm[scope.scope.name]" @change="handleCustTypeChange">
<el-radio v-for="(item, index) in scope.scope.customerRadioList" :key="index" :label="item.confId">{{ item.confName }}</el-radio>
</el-radio-group>
</div> </div>
<div v-show="editForm.customerInfoList.length != 0" class="customer-box m-t-10"> <div v-for="(item, pIdx) in customerDataList" :key="pIdx">
<div class="customer-title">{{ condLimitObj.hasQw ? '已加' : '没加' }}企微/{{ condLimitObj.hasPhone ? '有' : '没有' }}手机号:{{ editForm.customerInfoList.length }}人</div> <div v-show="item.confId == editForm[scope.scope.name]">
<el-button v-show="item.list.length == 0" class="default-blue-btn el-icon-plus" :size="size" @click="handleSelectCustomer(pIdx)">去选择</el-button>
<!-- <div v-show="editForm.customerInfoList.length != 0" class="customer-box m-t-10"> -->
<div v-show="item.list.length != 0">
<div class="customer-box m-t-10">
<div class="customer-title">{{ item.confName }}客户:预估{{ item.customerCount }}人</div>
<div :key="key" class="el-input-tag input-tag-wrapper"> <div :key="key" class="el-input-tag input-tag-wrapper">
<el-tag v-for="(item, idx) in editForm.customerInfoList" :key="idx" class="customer-tag" :size="size" type="info" :closable="!scope.scope.isDisabled" :disable-transitions="false" @close="handleDeleteCustomer(idx)"> <template v-if="item.confName == '标签'">
<i class="el-icon-user-solid"></i> <div v-for="(subItem, subIdx) in item.list" :key="subIdx">
{{ item.customerName }} <el-tag v-for="(k, n) in subItem.labelList" :key="n" class="customer-tag" :size="size" type="info" :closable="!scope.scope.isDisabled" :disable-transitions="false" @close="handleDeleteCustomer(n, subIdx, item.confName)">
<span>{{ subItem.labelGroup.name }}:{{ k.name }}</span>
</el-tag> </el-tag>
</div> </div>
</template>
<template v-else>
<el-tag v-for="(subItem, subIdx) in item.list" :key="subIdx" class="customer-tag" :size="size" type="info" :closable="!scope.scope.isDisabled" :disable-transitions="false" @close="handleDeleteCustomer(subIdx)">
<!-- <i class="el-icon-user-solid"></i> -->
<span>{{ subItem[item.listConf.confName] }}</span>
</el-tag>
</template>
</div>
</div>
<el-button v-if="!editDisabled" type="text" @click="handleSelectCustomer(pIdx)">编辑</el-button>
<el-button v-if="!editDisabled" type="text" @click="handleResetCustomer(pIdx)">重置</el-button>
</div>
</div>
</div> </div>
</div> </div>
</glsx-combi-form> </glsx-combi-form>
...@@ -75,13 +97,16 @@ ...@@ -75,13 +97,16 @@
<el-button type="primary" @click="handleConfirm">确定</el-button> <el-button type="primary" @click="handleConfirm">确定</el-button>
<el-button type="default" @click="handleCancel">取消</el-button> <el-button type="default" @click="handleCancel">取消</el-button>
</div> </div>
<SelectLabel ref="selectLabel" @tagSelected="handleSelect" :dialogVisible="isTagVisible"></SelectLabel> <select-Crowd v-if="isCrowdCustVisible" :dialogVisible="isCrowdCustVisible" :selectedCrowdList="customerDataList[0].list" @handleCrowdCustClose="handleCrowdCustClose" @handleCrowdCustConfirm="handleDialogConfirm"></select-Crowd>
<select-tag ref="selectTagForm" @tagSelected="handleDialogConfirm" :dialogVisible="isTagVisible"></select-tag>
<select-customer v-if="isAppointCustVisible" :dialogVisible="isAppointCustVisible" :selectedCustomerList="customerDataList[2].list" @handleAppointCustClose="handleAppointCustClose" @handleAppointCustConfirm="handleDialogConfirm"></select-customer>
</div> </div>
</template> </template>
<script> <script>
import url from '@/assets/empty.png' import url from '@/assets/empty.png'
import SelectLabel from './components/selectLabel.vue' import selectCustomer from './components/selectCustomer'
import selectCrowd from './components/selectCrowd'
export default { export default {
name: 'baseInfo', name: 'baseInfo',
data() { data() {
...@@ -103,31 +128,70 @@ export default { ...@@ -103,31 +128,70 @@ export default {
3: 'coupon', 3: 'coupon',
4: 'nickname' 4: 'nickname'
}, },
markCondLimitObj: { parentCustomerObj: {
// 1-有;0-无 // 人群,标签,指定
hasPhone: -1, currentCustomerTypeName: '',
hasQw: -1 parentPredictObj: {
total: '',
qiwei: '',
phone: ''
}, },
condLimitObj: { list: []
// 1-有;0-无
hasPhone: 0,
hasQw: 0
}, },
// 标签弹窗 // 标签弹窗
isTagVisible: false, isTagVisible: false,
tagging: [], isAppointCustVisible: false,
isCrowdCustVisible: false,
// tagging: [],
currentCustomerIdx: -1,
// confId值与customerRadioList对应;confName判断标识,不要改
customerDataList: [
{
confId: 2,
confName: '人群',
reqListName: 'crowdList',
customerCount: '',
listConf: {
confId: 'crowdId',
confName: 'crowdName'
},
list: []
},
{
confId: 3,
confName: '标签',
reqListName: 'labelList',
customerCount: '',
list: []
},
{
confId: 1,
confName: '指定',
reqListName: 'customerList',
customerCount: '',
listConf: {
confId: 'id',
confName: 'customerName'
},
list: []
}
],
editForm: { editForm: {
sopName: '', sopName: '',
// sopTime: '2022-01-01', // sopTime: '2022-01-01',
startDate: '', startDate: '',
endDate: '', endDate: '',
// tagging: [], // tagging: [],
customerOptType: '',
customerInfoList: [], customerInfoList: [],
customerIds: [], // customerIds: [],
customerOptUpdate: '2',
eventList: [] eventList: []
}, },
editRule: { editRule: {
sopName: [{ required: true, message: '请输入SOP名称', trigger: 'change' }], sopName: [{ required: true, message: '请输入SOP名称', trigger: 'change' }],
customerOptUpdate: [{ required: true, message: '请选择更新人群', trigger: 'change' }],
customerOptType: [{ required: true, message: '请选择有效对象', trigger: 'change' }],
customerInfoList: [{ required: true, message: '请选择营销对象', trigger: 'change' }] customerInfoList: [{ required: true, message: '请选择营销对象', trigger: 'change' }]
}, },
isEdit: true, isEdit: true,
...@@ -146,9 +210,43 @@ export default { ...@@ -146,9 +210,43 @@ export default {
}, },
{ {
label: '营销对象', label: '营销对象',
name: 'customerInfoList', // name: 'customerInfoList',
name: 'customerOptType',
addHtml: 'customerInfoList', addHtml: 'customerInfoList',
customerRadioList: [
{
confId: 2,
confName: '按人群选择客户'
},
{
confId: 3,
confName: '按标签选择客户'
},
{
confId: 1,
confName: '选择指定客户'
}
],
isDisabled: false isDisabled: false
},
{
label: '更新人群',
name: 'customerOptUpdate',
tips: '选择自动更新,每次营销事件执行时会按客户条件重新更新营销对象;选择从不更新,以当前客户条件匹配的客户作为固定的营销对象',
type: 'radio',
optionId: 'confId',
optionLabel: 'confName',
isDisabled: false,
optionList: [
{
confId: '1',
confName: '自动更新'
},
{
confId: '2',
confName: '从不更新'
}
]
} }
], ],
baseData: { baseData: {
...@@ -170,10 +268,6 @@ export default { ...@@ -170,10 +268,6 @@ export default {
} }
}, },
components: {
SelectLabel
},
props: { props: {
routeInfo: { routeInfo: {
type: Object, type: Object,
...@@ -188,6 +282,11 @@ export default { ...@@ -188,6 +282,11 @@ export default {
} }
}, },
components: {
selectCustomer,
selectCrowd
},
watch: { watch: {
editForm: { editForm: {
handler(val) { handler(val) {
...@@ -207,21 +306,106 @@ export default { ...@@ -207,21 +306,106 @@ export default {
methods: { methods: {
judgeDisable() { judgeDisable() {
var list = ['sopName', 'customerInfoList'] var list = ['sopName', 'customerOptType', 'customerOptUpdate']
list.forEach(item => { list.forEach(item => {
var idx = this.editFormData.findIndex(k => k.name == item) var idx = this.editFormData.findIndex(k => k.name == item)
this.editFormData[idx].isDisabled = this.editDisabled this.editFormData[idx].isDisabled = this.editDisabled
}) })
}, },
recoverCrowdList() {
var list = []
this.editForm[this.customerDataList[this.currentCustomerIdx].reqListName].forEach(item => {
list.push({
crowdId: item.crowdId,
crowdName: item.crowdName,
crowdDesc: item.crowdDesc,
total: item.total
})
})
this.customerDataList[this.currentCustomerIdx].list = JSON.parse(JSON.stringify(list))
this.changeCustomer()
},
recoverLabelList() {
var list = []
var groupIdList = []
this.customerDataList[this.currentCustomerIdx].list = JSON.parse(JSON.stringify(list))
this.editForm[this.customerDataList[this.currentCustomerIdx].reqListName].forEach(item => {
let pIdx = groupIdList.findIndex(k => k == item.labelGroupId)
if (list.length && pIdx != -1) {
list[pIdx].labelList.push({
id: item.labelId,
name: item.labelName
})
} else {
groupIdList.push(item.labelGroupId)
list.push({
labelGroup: {
id: item.labelGroupId,
name: item.labelGroupName
},
labelList: [
{
id: item.labelId,
name: item.labelName
}
]
})
}
})
this.customerDataList[this.currentCustomerIdx].list = JSON.parse(JSON.stringify(list))
this.changeCustomer()
},
recoverAppointList() {
var list = []
var sexToObj = {
U: 0,
M: 1,
W: 2
}
this.editForm[this.customerDataList[this.currentCustomerIdx].reqListName].forEach(item => {
list.push({
id: item.customerId,
customerName: item.customerName,
customerPhone: item.customerPhone,
customerSex: sexToObj[item.customerSex],
isJoin: item.customerWxAdd == 'Y' ? 1 : 0,
addTime: item.customerTimeAdd,
oneId: item.externalUserId
})
})
this.customerDataList[this.currentCustomerIdx].list = JSON.parse(JSON.stringify(list))
this.changeCustomer()
},
recoverCustomerList() {
switch (this.customerDataList[this.currentCustomerIdx].confName) {
case '人群':
this.recoverCrowdList()
break
case '标签':
this.recoverLabelList()
break
case '指定':
this.recoverAppointList()
break
}
},
getInfo() { getInfo() {
this.$apis.sop.getSopInfoDetailApi({ sopId: this.routeInfo.id }).then(res => { this.$apis.sop.getSopInfoDetailApi({ sopId: this.routeInfo.id }).then(res => {
// console.log(res) // console.log(res)
this.editForm = res this.editForm = res
this.editForm.customerInfoList = this.editForm.customerInfoList || [] this.currentCustomerIdx = this.customerDataList.findIndex(item => item.confId == this.editForm.customerOptType)
this.editForm.customerInfoList.forEach(item => { this.recoverCustomerList()
item.id = item.customerId this.editForm.customerOptUpdate = this.editForm.customerOptUpdate + ''
}) // this.editForm.customerInfoList = this.editForm.customerInfoList || []
this.editForm.customerInfoList.length && this.recoveryCondLimit() // this.editForm.customerInfoList.forEach(item => {
// item.id = item.customerId
// })
// this.editForm.customerInfoList.length && this.recoveryCondLimit()
this.editForm.eventList.forEach(item => { this.editForm.eventList.forEach(item => {
if (item.object) { if (item.object) {
item.object.objectId = item.objectId item.object.objectId = item.objectId
...@@ -252,94 +436,159 @@ export default { ...@@ -252,94 +436,159 @@ export default {
}) })
}, },
// 恢复企微和手机号限制 getCustomerByCrowdList() {
recoveryCondLimit() { var params = {
var obj = this.editForm.customerInfoList[0] pageSize: 1,
this.condLimitObj.hasQw = obj.isJoin pageNum: 1,
this.condLimitObj.hasPhone = obj.customerPhone ? 1 : 0 crowdId: this.customerDataList[this.currentCustomerIdx].list[0].crowdId
this.markCondLimitObj = { }
hasQw: this.condLimitObj.hasQw, this.$apis.sop.getCustomerCrowdApi(params).then(res => {
hasPhone: this.condLimitObj.hasPhone this.customerDataList[this.currentCustomerIdx].customerCount = res.count
} })
}, },
changeCustomer(obj) { getCustomerByTagList() {
this.editForm.customerInfoList = obj.selectedCustomerList var params = {
this.condLimitObj = obj.condLimitObj combineType: 2,
if (this.markCondLimitObj.hasQw != -1) { pageSize: 1,
if (this.markCondLimitObj.hasQw != obj.condLimitObj.hasQw || this.markCondLimitObj.hasPhone != obj.condLimitObj.hasPhone) { pageNum: 1,
this.editForm.eventList = [] tagLists: []
} }
} this.customerDataList[this.currentCustomerIdx].list &&
this.markCondLimitObj = { this.customerDataList[this.currentCustomerIdx].list.forEach(item => {
hasQw: this.condLimitObj.hasQw, item.labelList.length &&
hasPhone: this.condLimitObj.hasPhone item.labelList.forEach(subItem => {
} params.tagLists.push({
groupId: item.labelGroup.id,
groupName: item.labelGroup.name,
groupType: item.labelType,
labelId: subItem.id,
labelName: subItem.name
})
})
})
this.$apis.sop.getCustomerByTagListApi(params).then(res => {
this.customerDataList[this.currentCustomerIdx].customerCount = res.count
})
}, },
// 选择标签 changeCustomer() {
handleSelect(obj) { // 预估人数
// this.tagging = obj.selectedLabelList switch (this.customerDataList[this.currentCustomerIdx].confName) {
if (this.editForm.eventList.length && (this.markCondLimitObj.hasQw != obj.condLimitObj.hasQw || this.markCondLimitObj.hasPhone != obj.condLimitObj.hasPhone)) { case '人群':
this.$confirm('修改的客户类型(是否加企微、是否有手机号)不一致,原有营销渠道可能不可用,系统自动重置原有营销事件。是否确定修改?', '提示', { this.customerDataList[this.currentCustomerIdx].list.length && this.getCustomerByCrowdList()
confirmButtonText: '确定', break
cancelButtonText: '取消', case '标签':
type: 'warning', this.customerDataList[this.currentCustomerIdx].list.length && this.getCustomerByTagList()
callback: action => { break
if (action == 'confirm') { case '指定':
this.changeCustomer(obj) this.customerDataList[this.currentCustomerIdx].customerCount = this.customerDataList[this.currentCustomerIdx].list.length
} break
} }
}) this.editForm.customerInfoList = JSON.parse(JSON.stringify(this.customerDataList[this.currentCustomerIdx].list))
} else {
this.changeCustomer(obj)
}
this.key = new Date()
this.$refs.editFormRef.$refs[this.editChildRef].validateField('customerInfoList') this.$refs.editFormRef.$refs[this.editChildRef].validateField('customerInfoList')
// this.key = new Date()
},
// 选择标签
handleDialogConfirm(obj) {
console.log(obj)
switch (this.customerDataList[this.currentCustomerIdx].confName) {
case '人群':
this.handleCrowdCustClose()
break
case '标签':
break
case '指定':
this.handleAppointCustClose()
break
}
this.customerDataList[this.currentCustomerIdx].list = obj
this.changeCustomer()
},
// 营销对象类型
handleCustTypeChange(val) {
let idx = this.customerDataList.findIndex(item => item.confId == val)
this.currentCustomerIdx = idx
this.changeCustomer()
},
handleCrowdCustClose() {
this.isCrowdCustVisible = !this.isCrowdCustVisible
}, },
handleSelectCustomer() { handleAppointCustClose() {
this.isAppointCustVisible = !this.isAppointCustVisible
},
handleSelectCustomer(idx) {
this.currentCustomerIdx = idx
// 0-人群;1-标签;2-指定客户
switch (idx) {
case 0:
this.handleCrowdCustClose()
break
case 1:
this.isTagVisible = !this.isTagVisible this.isTagVisible = !this.isTagVisible
this.$refs.selectLabel.init({ condLimitObj: this.condLimitObj, tagList: [], customerInfoList: JSON.parse(JSON.stringify(this.editForm.customerInfoList)), activeName: 'customer' }) this.$refs.selectTagForm.init(this.customerDataList[idx].list)
break
case 2:
this.handleAppointCustClose()
break
}
}, },
handleResetCustomer() { handleResetCustomer() {
if (this.editForm.eventList.length) { if (this.editForm.eventList.length) {
this.$confirm('重置客户将清空当前已选客户。是否确定重置?', '提示', { this.$confirm('重置将清空当前已选营销对象。是否确定重置?', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning', type: 'warning',
callback: action => { callback: action => {
if (action == 'confirm') { if (action == 'confirm') {
this.editForm.customerInfoList = [] this.customerDataList[this.currentCustomerIdx].list = []
this.$refs.editFormRef.$refs[this.editChildRef].validateField('customerInfoList') this.changeCustomer()
this.editForm.eventList = [] this.editForm.eventList = []
} }
} }
}) })
} else { } else {
this.editForm.customerInfoList = [] this.customerDataList[this.currentCustomerIdx].list = []
this.$refs.editFormRef.$refs[this.editChildRef].validateField('customerInfoList') this.changeCustomer()
} }
}, },
handleDeleteCustomer(idx) { deleteCustPop() {
if (this.editForm.customerInfoList.length == 1 && this.editForm.eventList.length) {
this.$confirm('修改的客户类型(是否加企微、是否有手机号)不一致,原有营销渠道可能不可用,系统自动重置原有营销事件。是否确定修改?', '提示', { this.$confirm('修改的客户类型(是否加企微、是否有手机号)不一致,原有营销渠道可能不可用,系统自动重置原有营销事件。是否确定修改?', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning', type: 'warning',
callback: action => { callback: action => {
if (action == 'confirm') { if (action == 'confirm') {
this.editForm.customerInfoList.splice(idx, 1) // this.editForm.customerInfoList.splice(idx, 1)
this.$refs.editFormRef.$refs[this.editChildRef].validateField('customerInfoList') // this.$refs.editFormRef.$refs[this.editChildRef].validateField('customerInfoList')
this.customerDataList[this.currentCustomerIdx].list = []
this.changeCustomer()
this.editForm.eventList = [] this.editForm.eventList = []
} }
} }
}) })
},
handleDeleteCustomer(idx, pIdx, attr) {
let currentList = this.customerDataList[this.currentCustomerIdx].list
let isLastOne = attr == '标签' ? currentList.map(item => item.labelList.length).reduce((prev, cur) => prev + cur) : currentList.length
if (isLastOne == 1 && this.editForm.eventList.length) {
this.deleteCustPop()
} else { } else {
this.editForm.customerInfoList.splice(idx, 1) if (attr == '标签') {
this.$refs.editFormRef.$refs[this.editChildRef].validateField('customerInfoList') currentList[pIdx].labelList.splice(idx, 1)
currentList[pIdx].labelList.length == 0 && currentList.splice(idx, 1)
} else {
this.customerDataList[this.currentCustomerIdx].list.splice(idx, 1)
}
this.changeCustomer()
} }
}, },
...@@ -376,7 +625,72 @@ export default { ...@@ -376,7 +625,72 @@ export default {
}, },
handleEventEdit(addOrEdit, row, idx) { handleEventEdit(addOrEdit, row, idx) {
this.$emit('handleTabChange', { activeName: 'editEvent', addOrEdit: addOrEdit, eventIndex: addOrEdit == 'add' ? '-1' : idx, condLimitObj: this.condLimitObj, info: { ...row, sopName: this.editForm.sopName } }) let currentCustObj = JSON.parse(JSON.stringify(this.customerDataList[this.currentCustomerIdx]))
this.parentCustomerObj.currentCustomerTypeName = currentCustObj.confName
this.parentCustomerObj.parentPredictObj.total = currentCustObj.customerCount
this.parentCustomerObj.list = currentCustObj.list
// 指定客户需自己算
if (currentCustObj.confName == '指定') {
this.parentCustomerObj.parentPredictObj.phone = 0
this.parentCustomerObj.parentPredictObj.qiwei = 0
this.parentCustomerObj.list.forEach(item => {
item.customerPhone && this.parentCustomerObj.parentPredictObj.phone++
item.isJoin == 1 && this.parentCustomerObj.parentPredictObj.qiwei++
})
}
this.$emit('handleTabChange', { activeName: 'editEvent', addOrEdit: addOrEdit, eventIndex: addOrEdit == 'add' ? '-1' : idx, parentCustomerObj: this.parentCustomerObj, info: { ...row, sopName: this.editForm.sopName } })
},
reqCrowdAttrs() {
var list = JSON.parse(JSON.stringify(this.customerDataList[this.currentCustomerIdx].list))
return list
},
reqLabelAttrs() {
var list = []
this.customerDataList[this.currentCustomerIdx].list.forEach(item => {
item.labelList.forEach(subItem => {
list.push({
labelGroupId: item.labelGroup.id,
labelGroupName: item.labelGroup.name,
labelId: subItem.id,
labelName: subItem.name
})
})
})
return list
},
reqAppointAttrs() {
var list = []
var sexToObj = {
0: 'U',
1: 'M',
2: 'W'
}
this.customerDataList[this.currentCustomerIdx].list.forEach(item => {
list.push({
customerId: item.id,
customerName: item.customerName,
customerPhone: item.customerPhone,
customerSex: item.customerSex ? sexToObj[item.customerSex] : 'U',
customerWxAdd: item.isJoin ? 'Y' : 'N',
customerTimeAdd: item.addTime,
externalUserId: item.oneid
})
})
return list
},
reqCustAttrs() {
switch (this.customerDataList[this.currentCustomerIdx].confName) {
case '人群':
return this.reqCrowdAttrs()
case '标签':
return this.reqLabelAttrs()
case '指定':
return this.reqAppointAttrs()
}
}, },
handleConfirm() { handleConfirm() {
...@@ -387,8 +701,15 @@ export default { ...@@ -387,8 +701,15 @@ export default {
return true return true
} }
var params = this.$common.utils.deepClone(this.editForm) var params = this.$common.utils.deepClone(this.editForm)
params.customerIds = this.editForm.customerInfoList.map(item => item.id).join(',') // params.customerIds = this.editForm.customerInfoList.map(item => item.id).join(',')
params[this.customerDataList[this.currentCustomerIdx].reqListName] = JSON.stringify(this.reqCustAttrs())
params.customerCount = this.customerDataList[this.currentCustomerIdx].customerCount
delete params.customerInfoList delete params.customerInfoList
this.customerDataList.forEach((item, index) => {
if (index != this.currentCustomerIdx) {
delete params[item.reqListName]
}
})
if (this.routeInfo.addOrEdit == 'edit') { if (this.routeInfo.addOrEdit == 'edit') {
params.id = this.routeInfo.id params.id = this.routeInfo.id
params.eventList = [] params.eventList = []
...@@ -397,14 +718,19 @@ export default { ...@@ -397,14 +718,19 @@ export default {
if (new Date(item.eventStartDate) > new Date()) { if (new Date(item.eventStartDate) > new Date()) {
params.eventList.push({ params.eventList.push({
eventContent: item.eventContent, eventContent: item.eventContent,
eventCount: item.eventCount, // eventCount: item.eventCount,
eventStartDate: item.eventStartDate, eventStartDate: item.eventStartDate,
eventTime: item.eventTime, eventTime: item.eventTime,
pushChannelType: item.pushChannelType, pushChannelType: item.pushChannelType,
repeatFlag: item.repeatFlag, repeatFlag: item.repeatFlag,
repeatMode: item.repeatMode, repeatMode: item.repeatMode,
sopName: item.sopName, predictCount: item.predictCount,
sopId: this.routeInfo.id // sopName: item.sopName,
// sopId: this.routeInfo.id,
followerTypeId: item.followerTypeId,
followerTypeName: item.followerTypeName,
reachesType: item.reachesType,
reachesTypeSet: item.reachesTypeSet
}) })
if (item.id) { if (item.id) {
params.eventList[idx].id = item.id params.eventList[idx].id = item.id
...@@ -434,7 +760,6 @@ export default { ...@@ -434,7 +760,6 @@ export default {
} }
}) })
} }
params.eventList = JSON.stringify(params.eventList)
// console.log(params) // console.log(params)
if (this.editDisabled) { if (this.editDisabled) {
var batchEditParams = { var batchEditParams = {
...@@ -453,6 +778,7 @@ export default { ...@@ -453,6 +778,7 @@ export default {
} }
}) })
} else { } else {
params.eventList = JSON.stringify(params.eventList)
// 新增事件或者事件未开始,调这里 // 新增事件或者事件未开始,调这里
this.$apis.sop.insertOrUpdateSopApi(params).then(res => { this.$apis.sop.insertOrUpdateSopApi(params).then(res => {
this.$message({ this.$message({
...@@ -504,14 +830,14 @@ export default { ...@@ -504,14 +830,14 @@ export default {
height: 39px; height: 39px;
line-height: 39px; line-height: 39px;
padding: 0 10px; padding: 0 10px;
border-bottom: 1px solid #dcdfe6; // border-bottom: 1px solid #dcdfe6;
} }
.input-tag-wrapper { .input-tag-wrapper {
max-height: 227px; max-height: 227px;
overflow: auto; overflow: auto;
position: relative; position: relative;
font-size: 14px; font-size: 14px;
padding: 10px; padding: 0 10px 10px;
box-sizing: border-box; box-sizing: border-box;
color: #666; color: #666;
display: inline-block; display: inline-block;
......
<template>
<div class="select-crowd">
<el-dialog title="选择人群" :visible="dialogVisible" width="1080px" :before-close="handleClose" :close-on-click-modal="false">
<glsx-combi-form ref="showSearch" :formObj="searchForm" :formData="searchFormData">
<span slot="footer">
<el-button :size="size" type="primary" @click="getList">查询</el-button>
</span>
</glsx-combi-form>
<GLTable ref="crowdRef" :pageConf="pageConf" :hasNum="false" :noDataImg="url" :tableData="crowdList" :tableTotal="total" :tableParams="tableParams" @refreshTable="getList" :setTableFinishFun="setTableFinishFun">
<div slot="radioHtml" class="crowd-table" slot-scope="scope">
<el-radio v-model="selectedCrowdId" :label="scope.scope.crowdId" @click.native="handleClick(scope.scope)"></el-radio>
</div>
</GLTable>
<span slot="footer" class="dialog-footer">
<el-button size="small" @click="handleClose">取 消</el-button>
<el-button size="small" type="primary" @click="handleConfirm">确 定</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import url from '@/assets/empty.png'
export default {
name: 'selectCrowd',
data() {
return {
url: url,
searchForm: {
req: {
crowdType: 2
}
},
total: 0,
crowdList: [],
heightBox: 200,
selectedCrowdId: '',
// 搜索
searchFormData: [
{
label: '关键字',
name: 'keyword',
type: 'input',
placeholder: '请输入人群名称'
}
],
// 表格
// getListApi: this.$apis.common.getCrowdTreeListApi,
tableParams: {
listName: 'crowdUnitList',
// 行数据的key
// mutiSelectUniqueKey: 'crowdId',
// checkSelectKey: 'crowdId',
// checkSelectVal: [],
// 多选ref的名称
// mutiSelectName: 'list',
tableColumns: [
{
label: '',
prop: '',
width: 80,
addHtml: 'radioHtml'
},
{
label: '序号',
prop: 'idx',
width: 80
},
{
label: '人群名称',
prop: 'crowdName',
formatter: cellValue => {
return cellValue.crowdName || '-'
}
},
{
label: '人群描述',
prop: 'crowdDesc',
formatter: cellValue => {
return cellValue.crowdDesc || '-'
}
},
{
label: '预估人数',
prop: 'total',
width: '160px'
}
]
},
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'count' },
baseData: {}
}
},
props: {
dialogVisible: {
type: Boolean,
default: false
},
selectedCrowdList: {
type: Array,
default: () => []
}
},
mounted() {
let clientHeight = document.documentElement.clientHeight
this.heightBox = clientHeight - 0.15 * clientHeight - 425
this.getList()
},
methods: {
getList() {
var params = {
req: {
...this.searchForm,
pageNum: this.$refs.crowdRef ? this.$refs.crowdRef.page.pageNum : 1,
pageSize: this.$refs.crowdRef ? this.$refs.crowdRef.page.pageSize : 10
}
}
this.$apis.common.getCrowdTreeListApi(params).then(res => {
this.crowdList = res.crowdUnitList
this.total = res.total
var page = this.$refs.crowdRef.page
// 添加序号
this.crowdList.forEach((item, index) => {
item.idx = index + (page[this.pageConf.pageNum] - 1) * page[this.pageConf.pageSize] + 1
})
this.selectedCrowdList.length && (this.selectedCrowdId = this.selectedCrowdList[0].crowdId)
// this.recoverySelected()
this.$refs.crowdRef.tableHeightValues = '460px'
})
},
setTableFinishFun() {
this.crowdList = this.$refs.crowdRef.data
// this.recoverySelected()
//接收到的数据为空
// this.$refs.crowdRef.tableHeightValues = this.$refs.crowdRef.data.length ? '' : '400px'
this.$refs.crowdRef.tableHeightValues = '460px'
},
handleClick(val) {
let temp = JSON.parse(JSON.stringify(val))
delete temp.idx
this.selectedCrowdList = [temp]
},
handleClose() {
this.$emit('handleCrowdCustClose')
},
handleConfirm() {
this.$emit('handleCrowdCustConfirm', this.selectedCrowdList)
}
}
}
</script>
<style lang="scss">
.select-crowd {
.title {
margin-bottom: 12px;
}
.customer-tag-box {
display: flex;
margin: 20px 16px;
.tag-label {
display: inline-block;
height: 30px;
line-height: 30px;
}
.input-tag-wrapper {
max-height: 75px;
overflow: auto;
position: relative;
font-size: 14px;
background-color: #fff;
background-image: none;
border-radius: 4px;
border: 1px solid #dcdfe6;
box-sizing: border-box;
color: #666;
display: inline-block;
outline: none;
padding: 5px;
flex-wrap: wrap;
transition: border-color 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
width: 648px;
display: flex;
align-items: center;
cursor: pointer;
i {
color: #75acff;
margin-right: 3px;
font-size: 14px;
}
}
}
// .customer-list {
// width: calc(100% - 280px);
// margin-right: 10px;
// }
.p-16 {
padding: 16px;
}
.crowd-table .el-radio__label {
display: none;
}
}
</style>
<template> <template>
<div class="select-cutomer"> <div class="select-cutomer">
<div class="title">备注:为确保营销渠道正常触达,仅支持选择同条件客户(是否加企微、是否有手机号)</div> <el-dialog title="选择客户" :visible="dialogVisible" width="1080px" :before-close="handleClose" :close-on-click-modal="false">
<!-- <div class="title">备注:为确保营销渠道正常触达,仅支持选择同条件客户(是否加企微、是否有手机号)</div> -->
<glsx-combi-form ref="showSearch" :formObj="searchForm" :formData="searchFormData">
<span slot="footer">
<el-button :size="size" type="primary" @click="handleSearch">查询</el-button>
</span>
</glsx-combi-form>
<div class="flex-default"> <div class="flex-default">
<div class="customer-list"> <div class="customer-list">
<div class="customer-tag-box"> <!-- <div class="customer-tag-box">
<span class="tag-label">用户标签:</span> <span class="tag-label">用户标签:</span>
<div class="el-input-tag input-tag-wrapper" @click="handleClickTag"> <div class="el-input-tag input-tag-wrapper" @click="handleClickTag">
<span v-if="!selectedLabelList.length" style="color: #BFBFBF;">请选择标签筛选客户</span> <span v-if="!selectedLabelList.length" style="color: #BFBFBF;">请选择标签筛选客户</span>
...@@ -11,8 +17,9 @@ ...@@ -11,8 +17,9 @@
<el-tag v-for="(tagItem, idx1) in tag.labelList" :key="idx1" :size="size" type="info" :disable-transitions="false">{{ tagItem.name }}</el-tag> <el-tag v-for="(tagItem, idx1) in tag.labelList" :key="idx1" :size="size" type="info" :disable-transitions="false">{{ tagItem.name }}</el-tag>
</span> </span>
</div> </div>
</div> </div> -->
<GLTable ref="customerRef" :getListApi="getListApi" :pageConf="pageConf" :noDataImg="url" :searchForm="searchForm" :tableParams="tableParams" :beforeSearchFn="beforeSearchFn" @setTableFinishFun="setTableFinishFun" @selectionTable="handleSelectionTable"></GLTable> <p class="list-title p-16">客户列表(最多仅可选200个客户)</p>
<GLTable ref="customerRef" :getListApi="getListApi" :pageConf="pageConf" :noDataImg="url" :searchForm="searchForm" :tableParams="tableParams" @setTableFinishFun="setTableFinishFun" @selectionTable="handleSelectionTable"></GLTable>
</div> </div>
<div class="selected-list"> <div class="selected-list">
<p class="list-title p-16">已选({{ Array.isArray(selectedCustomerList) ? selectedCustomerList.length : 0 }})</p> <p class="list-title p-16">已选({{ Array.isArray(selectedCustomerList) ? selectedCustomerList.length : 0 }})</p>
...@@ -24,6 +31,12 @@ ...@@ -24,6 +31,12 @@
</div> </div>
</div> </div>
</div> </div>
<span slot="footer" class="dialog-footer">
<!-- <a class="dialog-jump" @click="jumpUrl" v-if="this.$globalState.session.accountLevel == 4 && this.$globalState.session.merchantModel == 2">没有意向标签?点我创建</a> -->
<el-button size="small" @click="handleClose">取 消</el-button>
<el-button size="small" type="primary" @click="handleConfirm">确 定</el-button>
</span>
</el-dialog>
</div> </div>
</template> </template>
...@@ -38,6 +51,23 @@ export default { ...@@ -38,6 +51,23 @@ export default {
searchForm: {}, searchForm: {},
customerList: [], customerList: [],
heightBox: 200, heightBox: 200,
// 搜索
searchFormData: [
{
label: '客户名称',
name: 'customerName',
type: 'input',
isClear: true,
maxlength: 50
},
{
label: '客户手机号',
name: 'customerPhone',
type: 'input',
isClear: true,
maxlength: 11
}
],
// 表格 // 表格
getListApi: this.$apis.sop.getCustomerListApi, getListApi: this.$apis.sop.getCustomerListApi,
tableParams: { tableParams: {
...@@ -119,6 +149,10 @@ export default { ...@@ -119,6 +149,10 @@ export default {
}, },
props: { props: {
dialogVisible: {
type: Boolean,
default: false
},
selectedLabelList: { selectedLabelList: {
type: Array, type: Array,
default: () => [] default: () => []
...@@ -126,47 +160,41 @@ export default { ...@@ -126,47 +160,41 @@ export default {
selectedCustomerList: { selectedCustomerList: {
type: Array, type: Array,
default: () => [] default: () => []
},
condLimitObj: {
type: Object,
default: () => {
return {
// 1-有;0-无
hasPhone: 0,
hasQw: 0
}
}
} }
}, },
mounted() { mounted() {
let clientHeight = document.documentElement.clientHeight let clientHeight = document.documentElement.clientHeight
this.heightBox = clientHeight - 0.15 * clientHeight - 350 this.heightBox = clientHeight - 0.15 * clientHeight - 425
}, },
methods: { methods: {
beforeSearchFn() { // beforeSearchFn() {
return new Promise(resolve => { // return new Promise(resolve => {
this.searchForm = { // this.searchForm = {
combineType: 2, // combineType: 2,
tagLists: [] // tagLists: []
} // }
this.selectedLabelList.length && // this.selectedLabelList.length &&
this.selectedLabelList.forEach(item => { // this.selectedLabelList.forEach(item => {
item.labelList.length && // item.labelList.length &&
item.labelList.forEach(subItem => { // item.labelList.forEach(subItem => {
this.searchForm.tagLists.push({ // this.searchForm.tagLists.push({
groupId: item.labelGroup.id, // groupId: item.labelGroup.id,
groupName: item.labelGroup.name, // groupName: item.labelGroup.name,
groupType: item.labelType, // groupType: item.labelType,
labelId: subItem.id, // labelId: subItem.id,
labelName: subItem.name // labelName: subItem.name
}) // })
}) // })
}) // })
this.getListApi = this.selectedLabelList.length ? this.$apis.sop.getCustomerByTagListApi : this.$apis.sop.getCustomerListApi // this.getListApi = this.selectedLabelList.length ? this.$apis.sop.getCustomerByTagListApi : this.$apis.sop.getCustomerListApi
resolve() // resolve()
}) // })
// },
handleSearch() {
this.$refs.customerRef.refreshTable()
}, },
setTableFinishFun() { setTableFinishFun() {
...@@ -184,33 +212,26 @@ export default { ...@@ -184,33 +212,26 @@ export default {
this.$refs.customerRef.$refs[this.tableParams.mutiSelectName + 'MutiTable'].toggleRowSelection(this.tableList[idx], true) this.$refs.customerRef.$refs[this.tableParams.mutiSelectName + 'MutiTable'].toggleRowSelection(this.tableList[idx], true)
} }
}) })
// 找到不符合条件的,变为不可选 if (this.selectedCustomerList.length >= 5) {
this.tableParams.checkSelectVal = [] let tableIds = this.selectedCustomerList.map(item => item.id)
if (this.selectedCustomerList.length) { console.log(tableIds)
this.tableList.forEach((row, idx) => { this.tableList.forEach((row, idx) => {
if (row.isJoin != this.condLimitObj.hasQw || !!row.customerPhone != this.condLimitObj.hasPhone) { if (!tableIds.includes(row.id)) {
this.tableParams.checkSelectVal.push(row.id) this.tableParams.checkSelectVal.push(row.id)
this.$refs.customerRef.$refs[this.tableParams.mutiSelectName + 'MutiTable'].toggleRowSelection(this.tableList[idx], false) this.$refs.customerRef.$refs[this.tableParams.mutiSelectName + 'MutiTable'].toggleRowSelection(this.tableList[idx], false)
} }
}) })
} else {
this.tableParams.checkSelectVal = []
} }
}) })
}, },
dealCondLimit(val) {
this.condLimitObj.hasQw = val ? val.isJoin : 0
this.condLimitObj.hasPhone = val ? (val.customerPhone ? 1 : 0) : 0
},
handleClickTag() {
this.$emit('handleChangeTag', { condLimitObj: this.condLimitObj, tagList: this.selectedLabelList, customerInfoList: this.selectedCustomerList, activeName: 'tag' })
},
handleSelectionTable(val) { handleSelectionTable(val) {
// 未选客户时,筛选客户条件 // 未选客户时,筛选客户条件
if (!this.selectedCustomerList.length) { // if (!this.selectedCustomerList.length) {
this.dealCondLimit(val[0]) // this.dealCondLimit(val[0])
} // }
let currentList = JSON.parse(JSON.stringify(this.selectedCustomerList)) let currentList = JSON.parse(JSON.stringify(this.selectedCustomerList))
let tableIds = this.tableList.map(item => item.id) let tableIds = this.tableList.map(item => item.id)
this.selectedCustomerList = JSON.parse(JSON.stringify(val)) this.selectedCustomerList = JSON.parse(JSON.stringify(val))
...@@ -221,6 +242,13 @@ export default { ...@@ -221,6 +242,13 @@ export default {
} }
}) })
this.recoverySelected() this.recoverySelected()
},
handleClose() {
this.$emit('handleAppointCustClose')
},
handleConfirm() {
this.$emit('handleAppointCustConfirm', this.selectedCustomerList)
} }
} }
} }
...@@ -268,7 +296,7 @@ export default { ...@@ -268,7 +296,7 @@ export default {
} }
.customer-list { .customer-list {
width: calc(100% - 280px); width: calc(100% - 280px);
border: 1px solid #eeeeee; // border: 1px solid #eeeeee;
margin-right: 10px; margin-right: 10px;
} }
.p-16 { .p-16 {
...@@ -277,7 +305,7 @@ export default { ...@@ -277,7 +305,7 @@ export default {
.selected-list { .selected-list {
width: 280px; width: 280px;
border-radius: 2px; border-radius: 2px;
border: 1px solid #eeeeee; // border: 1px solid #eeeeee;
i { i {
color: #75acff; color: #75acff;
margin-right: 3px; margin-right: 3px;
...@@ -290,6 +318,7 @@ export default { ...@@ -290,6 +318,7 @@ export default {
.list-customers { .list-customers {
// box-sizing: border-box; // box-sizing: border-box;
// height: 61vh; // height: 61vh;
border: 1px solid #eeeeee;
padding: 10px; padding: 10px;
overflow-y: scroll; overflow-y: scroll;
.customer-tag { .customer-tag {
......
...@@ -76,7 +76,23 @@ ...@@ -76,7 +76,23 @@
<!-- 营销渠道 --> <!-- 营销渠道 -->
<div class="container edit-container"> <div class="container edit-container">
<p class="edit-title">营销渠道</p> <p class="edit-title">营销渠道</p>
<glsx-combi-form class="edit-form-container m-r-20" ref="editFormRefChannel" :isEdit="isEdit" :labelWidth="labelWidth" defaultWidth="320px" :isBlock="true" :formRef="editChildRef" :formObj="editForm" :formData="editFormDataChannel" :formRules="editRule"></glsx-combi-form> <glsx-combi-form class="edit-form-container m-r-20" ref="editFormRefChannel" :isEdit="isEdit" :labelWidth="labelWidth" defaultWidth="320px" :isBlock="true" :formRef="editChildRef" :formObj="editForm" :formData="editFormDataChannel" :formRules="editRule">
<div v-show="editForm.pushChannelType" slot="channelSuffix" class="edit-tips m-t-8">预估受众用户总数:{{ editForm.pushChannelType == 2 ? predictCountObj.phone : predictCountObj.qiwei }} /{{ predictCountObj.total }}</div>
<template slot="reachesType" slot-scope="scope">
<el-radio-group v-model="editForm[scope.scope.name]" @change="handleReachesType" :disabled="editForm.repeatFlag == 'N'">
<el-radio v-for="(item, index) in scope.scope.optionList" :key="index" :label="item[scope.scope.optionId]">{{ item[scope.scope.optionLabel] }}</el-radio>
</el-radio-group>
<span class="m-l-20" v-if="editForm[scope.scope.name] == 2" id="reachesTypeSet">
同一用户最多参与
<el-form-item prop="reachesTypeSet">
<el-input v-model="editForm.reachesTypeSet"></el-input>
<span class="txt-red" v-if="+maxReachesTypeSet < editForm.reachesTypeSet">该用户最多能参与{{ maxReachesTypeSet }}次</span>
<span class="txt-red" v-else-if="editForm.reachesTypeSet < 2">只能输入2及以上的数字</span>
</el-form-item>
次
</span>
</template>
</glsx-combi-form>
</div> </div>
<div class="footer" :style="{ left: footerLeft + 'px', width: footerWidth + 'px' }"> <div class="footer" :style="{ left: footerLeft + 'px', width: footerWidth + 'px' }">
<el-button type="primary" @click="handleConfirm">确定</el-button> <el-button type="primary" @click="handleConfirm">确定</el-button>
...@@ -89,6 +105,7 @@ ...@@ -89,6 +105,7 @@
</template> </template>
<script> <script>
import { limitPrice } from '@/common/constant'
import ActivityModel from './components/activityModel' import ActivityModel from './components/activityModel'
import materialModel from './components/materialModel' import materialModel from './components/materialModel'
import nicknameModel from './components/nicknameModel' import nicknameModel from './components/nicknameModel'
...@@ -105,6 +122,12 @@ export default { ...@@ -105,6 +122,12 @@ export default {
isNicknameVisible: false, isNicknameVisible: false,
editStatus: false, editStatus: false,
labelWidth: '144px', labelWidth: '144px',
maxReachesTypeSet: '',
predictCountObj: {
total: '',
qiwei: '',
phone: ''
},
editForm: { editForm: {
sopName: '', sopName: '',
eventStartDate: '', eventStartDate: '',
...@@ -115,10 +138,16 @@ export default { ...@@ -115,10 +138,16 @@ export default {
repeatTime: '', repeatTime: '',
eventEndDate: '', eventEndDate: '',
pushChannelType: '', pushChannelType: '',
// 预估可触达人数
predictCount: '',
// 营销内容 // 营销内容
eventContent: '', eventContent: '',
eventCount: '', // eventCount: '',
object: {} object: {},
//营销渠道
followerTypeId: '',
reachesType: 1,
reachesTypeSet: ''
}, },
// 营销内容 // 营销内容
previewList: [], previewList: [],
...@@ -155,7 +184,10 @@ export default { ...@@ -155,7 +184,10 @@ export default {
eventEndDate: [{ required: true, message: '请选择营销结束日期', trigger: 'change' }], eventEndDate: [{ required: true, message: '请选择营销结束日期', trigger: 'change' }],
eventContent: [{ required: true, message: '请输入营销内容', trigger: 'change' }], eventContent: [{ required: true, message: '请输入营销内容', trigger: 'change' }],
repeatFlag: [{ required: true, message: '请选择是否重复', trigger: 'change' }], repeatFlag: [{ required: true, message: '请选择是否重复', trigger: 'change' }],
pushChannelType: [{ required: true, message: '请选择营销渠道', trigger: 'change' }] pushChannelType: [{ required: true, message: '请选择营销渠道', trigger: 'change' }],
followerTypeId: [{ required: true, message: '请选择跟进员工类型', trigger: 'change' }],
reachesType: [{ required: true, message: '请选择参与次数', trigger: 'change' }],
reachesTypeSet: [{ required: true, message: '请输入参与次数', trigger: 'change' }]
}, },
isEdit: true, isEdit: true,
sopNameFormData: [ sopNameFormData: [
...@@ -232,6 +264,9 @@ export default { ...@@ -232,6 +264,9 @@ export default {
this.editForm.repeatMode = 1 this.editForm.repeatMode = 1
this.editForm.repeatTime = '' this.editForm.repeatTime = ''
this.editForm.eventEndDate = '' this.editForm.eventEndDate = ''
// 参与次数
this.editForm.reachesType = 1
this.editForm.reachesTypeSet = 1
} }
} }
}, },
...@@ -292,7 +327,9 @@ export default { ...@@ -292,7 +327,9 @@ export default {
{ {
label: '营销渠道', label: '营销渠道',
name: 'pushChannelType', name: 'pushChannelType',
tips: '企业微信和微信朋友圈会自动给客户的跟进专员派发群发任务;短信会自动推送至客户手机。',
type: 'radio', type: 'radio',
suffixSlot: 'channelSuffix',
optionId: 'confId', optionId: 'confId',
optionLabel: 'confName', optionLabel: 'confName',
optionList: [ optionList: [
...@@ -311,12 +348,45 @@ export default { ...@@ -311,12 +348,45 @@ export default {
confName: '微信朋友圈', confName: '微信朋友圈',
isDisabled: false isDisabled: false
} }
] ],
handleRadioChange: val => {
this.getCustomerNum()
}
},
{
label: '跟进员工类型',
name: 'followerTypeId',
tips: '系统优先按照跟进员工类型匹配营销对象的跟进员工',
type: 'select',
optionList: [],
optionId: 'id',
optionLabel: 'businessName',
optionsName: 'staffTypeList'
},
{
label: '参与次数',
name: 'reachesType',
addHtml: 'reachesType',
optionId: 'confId',
optionLabel: 'confName',
optionList: [
{
confId: 1,
confName: '单次',
isDisabled: false
},
{
confId: 2,
confName: '多次',
isDisabled: false
}
],
} }
], ],
baseData: { baseData: {
weekList: [], weekList: [],
monthList: [] monthList: [],
staffTypeList: []
} }
} }
}, },
...@@ -332,13 +402,18 @@ export default { ...@@ -332,13 +402,18 @@ export default {
} }
} }
}, },
condLimitObj: { parentCustomerObj: {
type: Object, type: Object,
default: () => { default: () => {
return { return {
// 1-有;0-无 // 人群,标签,指定
hasPhone: 0, currentCustomerTypeName: '',
hasQw: 0 parentPredictObj: {
total: '',
qiwei: '',
phone: ''
},
list: []
} }
} }
} }
...@@ -357,26 +432,23 @@ export default { ...@@ -357,26 +432,23 @@ export default {
}, },
deep: true deep: true
}, },
'editForm.object.additionalType'(val) { 'editForm.reachesTypeSet'(newValue, oldValue) {
var idx = this.editFormDataChannel.findIndex(item => item.name == 'pushChannelType') this.editForm.reachesTypeSet = limitPrice(newValue, oldValue, 5, 0, 1, 9999, 'zNumReg')
this.editFormDataChannel[idx].optionList[0].isDisabled = val == '4' || !this.condLimitObj.hasQw
this.editFormDataChannel[idx].optionList[1].isDisabled = val == '4' || !this.condLimitObj.hasPhone
if (this.condLimitObj.hasQw) {
this.editFormDataChannel[idx].optionList[2].isDisabled = [1, 2, 3].includes(val)
}
} }
}, },
created() { created() {
this.getDay('weekList', 7) this.getDay('weekList', 7)
this.getDay('monthList', 31) this.getDay('monthList', 31)
this.limitQwPhone() this.predictCountObj = JSON.parse(JSON.stringify(this.parentCustomerObj.parentPredictObj))
// this.limitQwPhone()
}, },
mounted() { mounted() {
this.footerLeft = document.querySelector('.base-container-right').offsetLeft this.footerLeft = document.querySelector('.base-container-right').offsetLeft
this.footerWidth = document.documentElement.clientWidth - this.footerLeft this.footerWidth = document.documentElement.clientWidth - this.footerLeft
Object.assign(this.editForm, this.eventObj.info) Object.assign(this.editForm, this.eventObj.info)
this.getStaffTypeList()
this.$nextTick(() => { this.$nextTick(() => {
this.editStatus = false this.editStatus = false
}) })
...@@ -384,16 +456,37 @@ export default { ...@@ -384,16 +456,37 @@ export default {
}, },
methods: { methods: {
limitQwPhone() { getOptionsList(formName, hasAll = true, refreshSigle) {
// 有企微 - 企业微信、微信朋友圈 if (refreshSigle) {
// 有手机号 - 短信 var item = this[formName].find(k => k.name == refreshSigle)
var channelIdx = this.editFormDataChannel.findIndex(item => item.name == 'pushChannelType') var index = this[formName].findIndex(k => k.name == refreshSigle)
// 企微 this.$set(this[formName][index], 'optionList', this.$common.utils.deepClone(this.baseData[item.optionsName]))
this.editFormDataChannel[channelIdx].optionList[0].isDisabled = !this.condLimitObj.hasQw if (hasAll && this.baseData[item.optionsName].length && this.baseData[item.optionsName][0][this[formName][index].optionLabel] !== '全部') {
// 短信 const temp = {}
this.editFormDataChannel[channelIdx].optionList[1].isDisabled = !this.condLimitObj.hasPhone temp[this[formName][index].optionId] = ''
// 微信朋友圈 temp[this[formName][index].optionLabel] = '全部'
this.editFormDataChannel[channelIdx].optionList[2].isDisabled = !this.condLimitObj.hasQw this[formName][index].optionList.unshift(temp)
}
} else {
this[formName].forEach((item, index) => {
if (item.type === 'select' && this.baseData[item.optionsName].length) {
this.$set(this[formName][index], 'optionList', this.$common.utils.deepClone(this.baseData[item.optionsName]))
if (hasAll && this.baseData[item.optionsName].length && this.baseData[item.optionsName][0][this[formName][index].optionLabel] !== '全部') {
const temp = {}
temp[this[formName][index].optionId] = ''
temp[this[formName][index].optionLabel] = '全部'
this[formName][index].optionList.unshift(temp)
}
}
})
}
},
getStaffTypeList() {
this.$apis.common.getStaffTypeListApi({ flag: 0 }).then(res => {
this.baseData.staffTypeList = res
this.getOptionsList('editFormDataChannel', false, 'followerTypeId')
})
}, },
getDay(attrName, day) { getDay(attrName, day) {
...@@ -414,6 +507,11 @@ export default { ...@@ -414,6 +507,11 @@ export default {
let index = this.editFormDataTime.findIndex(k => k.name == item) let index = this.editFormDataTime.findIndex(k => k.name == item)
this.editFormDataTime[index].isHide = this.editForm.repeatFlag == 'N' this.editFormDataTime[index].isHide = this.editForm.repeatFlag == 'N'
}) })
if (this.editForm.repeatFlag == 'N') {
// 参与次数
this.editForm.reachesType = 1
this.editForm.reachesTypeSet = 1
}
}, },
recoveryEndTime() { recoveryEndTime() {
...@@ -436,6 +534,11 @@ export default { ...@@ -436,6 +534,11 @@ export default {
this.previewList = this.editForm.object ? [{ attContent: JSON.parse(JSON.stringify(this.editForm.object)), additionalType: this.editForm.object.additionalType }] : [] this.previewList = this.editForm.object ? [{ attContent: JSON.parse(JSON.stringify(this.editForm.object)), additionalType: this.editForm.object.additionalType }] : []
this.recoveryRepeat() this.recoveryRepeat()
this.recoveryEndTime() this.recoveryEndTime()
this.getCustomerNum()
},
handleReachesType(val) {
this.editForm.reachesTypeSet = val == 1 ? 1 : ''
}, },
// 素材 // 素材
...@@ -515,6 +618,58 @@ export default { ...@@ -515,6 +618,58 @@ export default {
}, },
// 营销内容 // 营销内容
getCustomerNum() {
switch (this.parentCustomerObj.currentCustomerTypeName) {
case '人群':
this.getCustomerByCrowdList()
break
case '标签':
this.getCustomerByTagList()
break
case '指定':
break
}
},
getCustomerByCrowdList() {
var params = {
pageSize: 1,
pageNum: 1,
crowdId: this.parentCustomerObj.list[0].crowdId
}
// 1-企业微信;2-短信;3-微信朋友圈
this.editForm.pushChannelType == 2 ? (params.customerPhone = '1') : (params.isJoin = 1)
this.$apis.sop.getCustomerCrowdApi(params).then(res => {
this.predictCountObj[this.editForm.pushChannelType == 2 ? 'phone' : 'qiwei'] = res.count
})
},
getCustomerByTagList() {
var params = {
combineType: 2,
pageSize: 1,
pageNum: 1,
tagLists: []
}
this.parentCustomerObj.list.list &&
this.parentCustomerObj.list.list.forEach(item => {
item.labelList.length &&
item.labelList.forEach(subItem => {
params.tagLists.push({
groupId: item.labelGroup.id,
groupName: item.labelGroup.name,
groupType: item.labelType,
labelId: subItem.id,
labelName: subItem.name
})
})
})
// 1-企业微信;2-短信;3-微信朋友圈
this.editForm.pushChannelType == 2 ? (params.customerPhone = '1') : (params.isJoin = 1)
this.$apis.sop.getCustomerByTagListApi(params).then(res => {
this.predictCountObj[this.editForm.pushChannelType == 2 ? 'phone' : 'qiwei'] = res.count
})
},
// 跳转 // 跳转
whereToGo(id) { whereToGo(id) {
document.getElementById(id).scrollIntoView() document.getElementById(id).scrollIntoView()
...@@ -550,14 +705,25 @@ export default { ...@@ -550,14 +705,25 @@ export default {
this.submit = false this.submit = false
return true return true
} }
// 跟进员工类型followerTypeId
this.editForm.followerTypeName = this.baseData.staffTypeList.find(item => item.id).businessName
// 预估可触达人数
this.editForm.predictCount = this.predictCountObj[this.editForm.pushChannelType == 2 ? 'phone' : 'qiwei']
console.log(this.editForm)
if (this.editForm.repeatFlag == 'Y') { if (this.editForm.repeatFlag == 'Y') {
this.$apis.sop.parseEventCountApi(countParams).then(res => { this.$apis.sop.parseEventCountApi(countParams).then(res => {
this.editForm.eventCount = res.eventStatistics.eventCount // this.editForm.eventCount = res.eventStatistics.eventCount
this.$emit('handleInfoConfirm', { baseInfo: this.editForm }) this.maxReachesTypeSet = res.eventStatistics.eventCount
if (this.maxReachesTypeSet < this.editForm.reachesTypeSet || this.editForm.reachesTypeSet < 2) {
this.whereToGo('reachesTypeSet')
this.submit = false
return true
}
this.$emit('handleInfoConfirm', { baseInfo: this.editForm, predictCountObj: this.predictCountObj })
}) })
} else { } else {
this.editForm.eventCount = 1 // this.editForm.eventCount = 1
this.$emit('handleInfoConfirm', { baseInfo: this.editForm }) this.$emit('handleInfoConfirm', { baseInfo: this.editForm, predictCountObj: this.predictCountObj })
} }
}, },
cancelJump() { cancelJump() {
......
...@@ -15,14 +15,26 @@ ...@@ -15,14 +15,26 @@
</div> </div>
<p class="analysis-num">{{ sopInfo.sopStatistics ? sopInfo.sopStatistics.eventCount : '-' }}</p> <p class="analysis-num">{{ sopInfo.sopStatistics ? sopInfo.sopStatistics.eventCount : '-' }}</p>
</div> </div>
<div class="analysis-block"> <div class="analysis-block back-image-green">
<div class="analysis-title-block m-b-20"> <div class="analysis-title-block m-b-20">
已完成事件数 已完成事件数
<img src="@/assets/sop/completed-event.png" /> <img src="@/assets/sop/completed-event.png" />
</div> </div>
<p class="analysis-num">{{ sopInfo.sopStatistics ? sopInfo.sopStatistics.finishEventCount : '-' }}</p> <p class="analysis-num">{{ sopInfo.sopStatistics ? sopInfo.sopStatistics.finishEventCount : '-' }}</p>
</div> </div>
<div class="analysis-block"> <div class="analysis-block back-image-orange">
<div class="analysis-title-block m-b-20">
<div>
失败事件数
<el-popover placement="top" width="200" trigger="hover" content="因企微、短信等限制无法正常执行的事件">
<img slot="reference" class="tips-icon" src="@/assets/icon-tip.png" />
</el-popover>
</div>
<img src="@/assets/sop/completed-event.png" />
</div>
<p class="analysis-num">{{ sopInfo.sopStatistics ? sopInfo.sopStatistics.failEventCount || '-' : '-' }}</p>
</div>
<div class="analysis-block back-image-blue">
<div class="analysis-title-block m-b-20"> <div class="analysis-title-block m-b-20">
完成率 完成率
</div> </div>
...@@ -34,7 +46,14 @@ ...@@ -34,7 +46,14 @@
<p class="m-b-10">日营销事件明细</p> <p class="m-b-10">日营销事件明细</p>
<!-- 表格区域 开始 --> <!-- 表格区域 开始 -->
<GLTable ref="completeListRef" :getListApi="getListApi" :noDataImg="url" :searchForm="searchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn" @setTableFinishFun="setTableFinishFun"></GLTable> <GLTable ref="completeListRef" :getListApi="getListApi" :noDataImg="url" :searchForm="searchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn" @setTableFinishFun="setTableFinishFun">
<template slot="failEventCount" slot-scope="scope">
<el-popover v-show="scope.scope.failEventList" placement="bottom-end" width="200" trigger="click" :content="scope.scope.failEventList">
<span class="cursor-pointer" slot="reference" @click="handleGetFailEvent(scope.scope)">{{ scope.scope.eventStatistics ? scope.scope.eventStatistics.failEventCount : '-' }}</span>
</el-popover>
<span v-show="!scope.scope.failEventList" class="cursor-pointer" slot="reference" @click="handleGetFailEvent(scope.scope)">{{ scope.scope.eventStatistics ? scope.scope.eventStatistics.failEventCount : '-' }}</span>
</template>
</GLTable>
<!-- 表格区域 end --> <!-- 表格区域 end -->
</div> </div>
</div> </div>
...@@ -111,11 +130,17 @@ export default { ...@@ -111,11 +130,17 @@ export default {
}, },
{ {
label: '已完成事件数', label: '已完成事件数',
prop: 'eventStatistics', prop: 'finishEventCount',
width: '140', width: '140',
formatter: cellValue => { formatter: cellValue => {
return cellValue.eventStatistics ? cellValue.eventStatistics.finishEventCount : '-' return cellValue.eventStatistics ? cellValue.eventStatistics.finishEventCount : '-'
} }
},
{
label: '失败事件数',
prop: 'failEventCount',
width: '140',
addHtml: 'failEventCount'
} }
] ]
}, },
...@@ -150,11 +175,19 @@ export default { ...@@ -150,11 +175,19 @@ export default {
getBaseInfo() { getBaseInfo() {
this.$apis.sop.getSopBaseInfoApi({ sopId: this.sopId }).then(res => { this.$apis.sop.getSopBaseInfoApi({ sopId: this.sopId }).then(res => {
this.sopInfo = res this.sopInfo = res
console.log(this.sopInfo)
this.sopInfo.completedPercent = Math.round((this.sopInfo.sopStatistics.finishEventCount / this.sopInfo.sopStatistics.eventCount) * 100).toFixed(0) + '%' this.sopInfo.completedPercent = Math.round((this.sopInfo.sopStatistics.finishEventCount / this.sopInfo.sopStatistics.eventCount) * 100).toFixed(0) + '%'
this.drawPie() this.drawPie()
}) })
}, },
handleGetFailEvent(row) {
this.$apis.sop.getFailEventList({ id: row.id }).then(res => {
let idx = this.$refs.completeListRef.data.findIndex(item => item.id == row.id)
this.$refs.completeListRef.data[idx].failEventList = res
})
},
drawPie() { drawPie() {
let chartDom = document.getElementById('completePie') let chartDom = document.getElementById('completePie')
let myChart = echarts.init(chartDom) let myChart = echarts.init(chartDom)
...@@ -197,7 +230,7 @@ export default { ...@@ -197,7 +230,7 @@ export default {
margin-right: 20px; margin-right: 20px;
flex-basis: 0 0 auto; flex-basis: 0 0 auto;
background: #ffffff; background: #ffffff;
background-image: linear-gradient(0deg, #f8f8fc 0%, #f4f4ff 100%); background-image: linear-gradient(0deg, #f8f8fc 0%, #f0f7ff 100%);
box-shadow: 0px 10px 20px 0px rgba(88, 80, 255, 0.1); box-shadow: 0px 10px 20px 0px rgba(88, 80, 255, 0.1);
.analysis-title-block { .analysis-title-block {
display: flex; display: flex;
...@@ -220,6 +253,15 @@ export default { ...@@ -220,6 +253,15 @@ export default {
font-weight: 600; font-weight: 600;
} }
} }
.analysis-block.back-image-green {
background-image: linear-gradient(0deg, #f8f8fc 0%, #f0fffa 100%);
}
.analysis-block.back-image-orange {
background-image: linear-gradient(0deg, #f8f8fc 0%, #fff6f0 100%);
}
.analysis-block.back-image-blue {
background-image: linear-gradient(0deg, #f8f8fc 0%, #f0f0ff 100%);
}
} }
} }
</style> </style>
...@@ -24,14 +24,14 @@ ...@@ -24,14 +24,14 @@
</div> </div>
<p class="analysis-num">{{ baseData.sopEventList.length ? sopInfo.customerCount : '-' }}</p> <p class="analysis-num">{{ baseData.sopEventList.length ? sopInfo.customerCount : '-' }}</p>
</div> </div>
<div class="analysis-block"> <div class="analysis-block back-image-green">
<div class="analysis-title-block m-b-20"> <div class="analysis-title-block m-b-20">
已触达客户数 已触达客户数
<img src="@/assets/sop/touch-customer.png" /> <img src="@/assets/sop/touch-customer.png" />
</div> </div>
<p class="analysis-num">{{ baseData.sopEventList.length ? selectedEventInfo.eventStatistics.reachCustomerCount : '-' }}</p> <p class="analysis-num">{{ baseData.sopEventList.length ? selectedEventInfo.eventStatistics.reachCustomerCount : '-' }}</p>
</div> </div>
<div class="analysis-block"> <div class="analysis-block back-image-blue">
<div class="analysis-title-block m-b-20"> <div class="analysis-title-block m-b-20">
触达率 触达率
</div> </div>
...@@ -107,6 +107,17 @@ export default { ...@@ -107,6 +107,17 @@ export default {
} }
}, },
{ {
label: '推送人',
prop: 'pusherName'
},
{
label: '推送时间',
prop: 'pusherTime',
formatter: cellValue => {
return cellValue.pusherTime ? dayjs(cellValue.pusherTime).format('YYYY-MM-DD HH:mm:ss') : '-'
}
},
{
label: '初次查看事件', label: '初次查看事件',
prop: 'firstViewDate', prop: 'firstViewDate',
formatter: cellValue => { formatter: cellValue => {
...@@ -120,6 +131,10 @@ export default { ...@@ -120,6 +131,10 @@ export default {
return cellValue.viewCount || '-' return cellValue.viewCount || '-'
} }
} }
// {
// label: '查看总时长',
// prop: ''
// }
] ]
}, },
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' }, pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
...@@ -263,7 +278,7 @@ export default { ...@@ -263,7 +278,7 @@ export default {
margin-right: 20px; margin-right: 20px;
flex-basis: 0 0 auto; flex-basis: 0 0 auto;
background: #ffffff; background: #ffffff;
background-image: linear-gradient(0deg, #f8f8fc 0%, #f4f4ff 100%); background-image: linear-gradient(0deg, #f8f8fc 0%, #f0f7ff 100%);
box-shadow: 0px 10px 20px 0px rgba(88, 80, 255, 0.1); box-shadow: 0px 10px 20px 0px rgba(88, 80, 255, 0.1);
.analysis-title-block { .analysis-title-block {
display: flex; display: flex;
...@@ -286,6 +301,12 @@ export default { ...@@ -286,6 +301,12 @@ export default {
font-weight: 600; font-weight: 600;
} }
} }
.analysis-block.back-image-green {
background-image: linear-gradient(0deg, #f8f8fc 0%, #f0fffa 100%);
}
.analysis-block.back-image-blue {
background-image: linear-gradient(0deg, #f8f8fc 0%, #f0f0ff 100%);
}
} }
} }
</style> </style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!