Commit 7cdac9cd by 前端

第一轮BUG修复

1 parent f2ddd239
<template>
<div class="basic-panel">
<el-popover placement="top" popper-class="base-popper" trigger="hover" :content="content" v-if="tooltipStatus">
<div class="basic-title" slot="reference">{{ content | ellipsis(this) }}</div>
</el-popover>
<div class="basic-title" v-else>{{ content | ellipsis(this) }}</div>
</div>
</template>
<script>
export default {
name: 'basic-dialog',
props: {
content: {
type: String,
default: ''
},
textLength: {
type: Number,
default: 8
}
},
data() {
return {
tooltipStatus: false
}
},
filters: {
ellipsis(value,that) {
console.log(value,that)
if (value.length > that.textLength) {
that.tooltipStatus = true
return value.slice(0, that.textLength) + '...'
}
return value
}
},
mounted() {
// this.$nextTick(() => {
// const title = document.querySelector('.basic-title-s')
// console.log(title.innerText, this.content)
// if (title.innerText == this.content) {
// this.tooltipStatus = false
// } else {
// this.tooltipStatus = true
// }
// })
}
}
</script>
<style lang="scss">
.basic-panel {
display: inline-block;
}
</style>
const TYPE = Object.freeze({
none: ''
})
// 权限校验
function permission(ctx) {
console.log(ctx)
if (!ctx) return TYPE.none
const {
props: { fn, mode },
parent: {
$GLBUTTION_PERMISSIONS: { routes = [], routerBase }
}
} = ctx
const router = routes.find(route => location.pathname === `${routerBase}${route.path.split(':/')[0]}`)
if (router && router.meta && router.meta.permissions && router.meta.permissions.includes(fn)) {
return mode
}
return TYPE.none
}
export default {
functional: true,
name: 'GLButton',
props: {
fn: {
type: String
},
mode: {
type: String,
default: 'el-button'
}
},
render: function(createElement, context) {
return createElement(permission(context), context.data, context.children)
}
}
\ No newline at end of file \ No newline at end of file
...@@ -8,4 +8,29 @@ ...@@ -8,4 +8,29 @@
*/ */
import Vue from 'vue' import Vue from 'vue'
import glsxCombiForm from '@/components/glsx-combi-form/index.vue' import glsxCombiForm from '@/components/glsx-combi-form/index.vue'
import glsxDialog from '@/components/glsx-dialog/index.vue'
import selectMutiProDialog from '@/components/selectMutiProDialog/index.vue'
import selectSingleProDialog from '@/components/selectSingleProDialog/index.vue'
import relateStoreDialog from '@/components/relate-store-dialog'
import selectMutiProForcouponDialog from '@/components/selectMutiProDialog/indexForCoupon.vue'
import tableTooltip from '@/components/table-tooltip/index.vue'
import glsxRows from '@/components/glsx-rows/index.vue'
import glsxDescriptions from '@/components/glsx-descriptions/index.vue'
import selectTag from '@/components/selectTag/index.vue'
import searchForm from '@/components/search-form/index.vue'
import _button from '@/components/glsx-button/index'
import _title from '@/components/basic-title/index'
Vue.component('glsx-combi-form', glsxCombiForm) Vue.component('glsx-combi-form', glsxCombiForm)
Vue.component('glsx-dialog', glsxDialog)
Vue.component('select-muti-pro-dialog', selectMutiProDialog)
Vue.component('select-single-pro-dialog', selectSingleProDialog)
Vue.component('relate-store-dialog', relateStoreDialog)
Vue.component('select-muti-pro-forcoupon-dialog', selectMutiProForcouponDialog)
Vue.component('table-tooltip', tableTooltip)
Vue.component('glsx-rows', glsxRows)
Vue.component('glsx-descriptions', glsxDescriptions)
Vue.component('select-tag', selectTag)
Vue.component('search-form', searchForm)
Vue.component('GLButton', _button)
Vue.component('GLTitle', _title)
<template> <template>
<div class="tag-main select-tag"> <div class="tag-main select-tag">
<GLDialog bigTitle="选择标签" mode="big" :visible.sync="dialogVisible" :before-close="handleClose"> <GLDialog bigTitle="选择标签"
mode="big"
:visible.sync="dialogVisible"
:before-close="handleClose">
<div class="tag-panel"> <div class="tag-panel">
<div class="tag-panel-select"> <div class="tag-panel-select">
<div class="tag-title">预选标签</div> <div class="tag-title">预选标签</div>
<div class="tag-select-box"> <div class="tag-select-box">
<div class="tag-box-header"> <div class="tag-box-header">
<el-input size="small" v-model="labelGroupName" placeholder="请输入搜索内容"></el-input> <el-input size="small"
<el-button size="small" type="primary" @click="handleSearch">查询</el-button> v-model="labelGroupName"
placeholder="请输入搜索内容"></el-input>
<el-button size="small"
type="primary"
@click="handleSearch">查询</el-button>
</div> </div>
<div class="checkbox-group-box" :style="{ height: heightBox + 'px' }" v-loading="loading"> <div class="checkbox-group-box"
<div style="margin-bottom: 8px" v-for="(item, index) in labelTreeRets" :key="index"> :style="{ height: heightBox + 'px' }"
<span class="el-tree-node__expand-icon el-icon-caret-right" :class="{ expanded: item.checked }" 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> @click.self="item.checked = !item.checked"></span>
<el-checkbox :indeterminate="item.isIndeterminate" v-model="item.checkAll" <el-checkbox :indeterminate="item.isIndeterminate"
v-model="item.checkAll"
@change="handleCheckAllChange(item.checkAll, index)">{{ @change="handleCheckAllChange(item.checkAll, index)">{{
item.labelGroup.name item.labelGroup.name
}}({{ item.tagChecked.length }}/{{ item.labelList.length }} 项) }}({{ item.tagChecked.length }}/{{ item.labelList.length }} 项)
</el-checkbox> </el-checkbox>
<div style="margin: 15px 0"></div> <div style="margin: 15px 0"></div>
<el-checkbox-group class="tag-group" v-model="item.tagChecked" <el-checkbox-group class="tag-group"
@change="handleCheckedChange(item.tagChecked, index)" v-if="item.checked"> v-model="item.tagChecked"
<el-checkbox v-for="(itm, idx) in item.labelList" :label="itm" :key="idx">{{ itm.name }}</el-checkbox> @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> </el-checkbox-group>
</div> </div>
</div> </div>
...@@ -31,31 +48,50 @@ ...@@ -31,31 +48,50 @@
<div class="tag-title">已选标签 <div class="tag-title">已选标签
<!-- <image src="@/assets/icon-info.png"/>--> <!-- <image src="@/assets/icon-info.png"/>-->
<el-tooltip effect="light" popper-class="tool-gltip"> <el-tooltip effect="light"
<img class="tag-img" src="@/assets/icon-tip.png" alt=""/> popper-class="tool-gltip">
<img class="tag-img"
src="@/assets/icon-tip.png"
alt="" />
<div slot="content"> <div slot="content">
<div class="tag-content"> <div class="tag-content">
<p class="tag-ex">说明:</p> <p class="tag-ex">说明:</p>
<p>标签组内已选标签取<span class="tag-ex">并集(或)</span>,即满足一个条件即可、标签组之间取<span class="tag-ex">交集(且)</span>,即同时满足标签组条件。</p> <p>标签组内已选标签取<span class="tag-ex">并集(或)</span>,即满足一个条件即可、标签组之间取<span
<img src="@/assets/sop/groupTips.png" alt=""/> class="tag-ex">交集(且)</span>,即同时满足标签组条件。</p>
<img src="@/assets/sop/groupTips.png"
alt="" />
</div> </div>
</div> </div>
</el-tooltip> </el-tooltip>
</div> </div>
<div class="tag-select-box"> <div class="tag-select-box">
<div class="tag-box-header">标签名称({{ selectNum }}项)</div> <div class="tag-box-header">标签名称({{ selectNum }}项)</div>
<div class="tag-selected-box" :style="{ height: heightBox + 'px' }"> <div class="tag-selected-box"
<div v-show="!!selectNum" class="tag-line-and" :style="{ height: heightBox + 'px' }"> :style="{ height: heightBox + 'px' }">
<div v-show="!!selectNum"
class="tag-line-and"
:style="{ height: heightBox + 'px' }">
<p class="tag-line"></p> <p class="tag-line"></p>
<p class="tag-and" :style="{ top: heightBox / 2 - 20 + 'px' }">且</p> <p class="tag-and"
:style="{ top: heightBox / 2 - 20 + 'px' }">且</p>
</div> </div>
<div class="label-box"> <div class="label-box">
<div v-for="(item, index) in labelTreeRetSelect" :key="index"> <div v-for="(item, index) in labelTreeRetSelect"
<p class="tag-selected-label" v-show="item.tagChecked.length">{{ item.labelGroup.name }}:</p> :key="index">
<span v-for="(tag, idx) in item.tagChecked" :key="idx"> <p class="tag-selected-label"
<span class="tag-txt" v-show="idx != 0">或</span> v-show="item.tagChecked.length">{{ item.labelGroup.name }}:</p>
<el-tag :title="tag.name" type="info" class="customer-tag-selected-item" :key="idx" v-if="tag" <span v-for="(tag, idx) in item.tagChecked"
closable :disable-transitions="false" @close="remove(item, idx)"> :key="idx">
<span class="tag-txt"
v-show="idx != 0">或</span>
<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.length > 11 ? tag.name.slice(0, 11) + '...' : tag.name }} {{ tag.name.length > 11 ? tag.name.slice(0, 11) + '...' : tag.name }}
</el-tag> </el-tag>
</span> </span>
...@@ -65,20 +101,25 @@ ...@@ -65,20 +101,25 @@
</div> </div>
</div> </div>
</div> </div>
<span slot="footer" class="dialog-footer"> <span slot="footer"
<a class="dialog-jump" @click="jumpUrl" class="dialog-footer">
<a class="dialog-jump"
@click="jumpUrl"
v-if="this.$globalState.session.accountLevel == 4 && this.$globalState.session.merchantModel == 2">没有意向标签?点我创建</a> v-if="this.$globalState.session.accountLevel == 4 && this.$globalState.session.merchantModel == 2">没有意向标签?点我创建</a>
<el-button size="small" @click="handleClose"> <el-button size="small"
@click="handleClose">
取 消 取 消
</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>
</GLDialog> </GLDialog>
</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'
export default { export default {
...@@ -132,91 +173,92 @@ export default { ...@@ -132,91 +173,92 @@ export default {
this.querylabeltree() this.querylabeltree()
}, },
querylabeltree(selectItem) { querylabeltree(selectItem) {
console.log('selectItem', selectItem);
this.loading = true this.loading = true
this.$apis.common this.$apis.common
.querylabeltree({ .querylabeltree({
labelTreeReq: { labelTreeReq: {
pageNum: 1, pageNum: 1,
pageSize: 1000, pageSize: 1000,
shopId: this.$globalState.session.merchantId, shopId: this.$globalState.session.merchantId,
// shopId:'44209846', // shopId:'44209846',
labelGroupName: this.labelGroupName, labelGroupName: this.labelGroupName,
labelTypesStr: this.labelTypesStr, labelTypesStr: this.labelTypesStr,
edition: this.$globalState.session.merchantModel, edition: this.$globalState.session.merchantModel,
belongType: this.isGroupTag ? 2 : 1 belongType: this.isGroupTag ? 2 : 1
} }
}) })
.then(res => { .then(res => {
if (selectItem && selectItem.length > 0) { if (selectItem && selectItem.length > 0) {
this.labelTreeRets = res.labelTreeRets.map(item => { this.labelTreeRets = res.labelTreeRets.map(item => {
return { return {
labelGroup: item.labelGroup, labelGroup: item.labelGroup,
labelList: item.labelList, labelList: item.labelList,
labelType: item.labelType, labelType: item.labelType,
checked: false, checked: false,
tagChecked: [], tagChecked: [],
isIndeterminate: false, isIndeterminate: false,
checkAll: 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))
})
} }
}) })
//回显 })
selectItem.forEach(item => { this.labelTreeRets.forEach((item, index) => {
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.$nextTick(() => {
this.labelTreeRetSelect = utils.deepClone(this.labelTreeRets) this.handleCheckedChange(item.tagChecked, index, 1)
}) })
} else { })
this.labelTreeRets = res.labelTreeRets.map(item => { this.$nextTick(() => {
return { this.labelTreeRetSelect = utils.deepClone(this.labelTreeRets)
labelGroup: item.labelGroup, })
labelList: item.labelList, } else {
labelType: item.labelType, this.labelTreeRets = res.labelTreeRets.map(item => {
checked: false, return {
tagChecked: [], labelGroup: item.labelGroup,
isIndeterminate: false, labelList: item.labelList,
checkAll: false labelType: item.labelType,
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)
})
} }
}) })
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
}) })
if (this.labelTreeRetSelect.length == 0) {
this.labelTreeRetSelect = utils.deepClone(this.labelTreeRets)
}
}
this.$nextTick(() => {
this.loading = false
}) })
})
}, },
handleClose() { handleClose() {
this.labelTreeRetSelect = [] this.labelTreeRetSelect = []
...@@ -252,16 +294,16 @@ export default { ...@@ -252,16 +294,16 @@ export default {
handleSelect() { handleSelect() {
this.dialogVisible = false this.dialogVisible = false
let labelTreeRets = this.labelTreeRetSelect let labelTreeRets = this.labelTreeRetSelect
.map(item => { .map(item => {
if (item.tagChecked.length) { if (item.tagChecked.length) {
return { return {
labelGroup: item.labelGroup, labelGroup: item.labelGroup,
labelList: item.tagChecked, labelList: item.tagChecked,
labelType: item.labelType labelType: item.labelType
}
} }
}) }
.filter(item => item) })
.filter(item => item)
this.$emit('tagSelected', labelTreeRets) this.$emit('tagSelected', labelTreeRets)
}, },
//全选 //全选
...@@ -469,14 +511,14 @@ export default { ...@@ -469,14 +511,14 @@ export default {
min-height: 200px; min-height: 200px;
display: flex; display: flex;
} }
/deep/ .el-tooltip__popper.is-light{ /deep/ .el-tooltip__popper.is-light {
width: 1000px !important; width: 1000px !important;
} }
.tool-gltip { .tool-gltip {
/deep/.el-tooltip__popper.is-light{ /deep/.el-tooltip__popper.is-light {
width: 1000px !important; width: 1000px !important;
} }
/deep/.el-tooltip__popper{ /deep/.el-tooltip__popper {
width: 1000px !important; width: 1000px !important;
} }
.tag-content { .tag-content {
...@@ -484,10 +526,10 @@ export default { ...@@ -484,10 +526,10 @@ export default {
overflow: hidden; overflow: hidden;
width: 500px; width: 500px;
paddding: 10px; paddding: 10px;
p{ p {
margin: 3px 0; margin: 3px 0;
} }
.tag-ex{ .tag-ex {
color: #333333; color: #333333;
font-weight: 600; font-weight: 600;
} }
...@@ -496,7 +538,7 @@ export default { ...@@ -496,7 +538,7 @@ export default {
</style> </style>
<style> <style>
.tool-gltip { .tool-gltip {
max-width: 520px!important; max-width: 520px !important;
width: 520px!important; width: 520px !important;
} }
</style> </style>
...@@ -19,6 +19,7 @@ Vue.config.productionTip = false ...@@ -19,6 +19,7 @@ Vue.config.productionTip = false
Vue.prototype.$apis = apis Vue.prototype.$apis = apis
Vue.prototype.size = 'small' Vue.prototype.size = 'small'
Vue.prototype.setMinHeight = setMinHeight Vue.prototype.setMinHeight = setMinHeight
Vue.prototype.defaultLabelWidth = '154px' Vue.prototype.defaultLabelWidth = '154px'
start() start()
export { bootstrap, mount, unmount } from '@/setup' export { bootstrap, mount, unmount } from '@/setup'
......
...@@ -19,8 +19,8 @@ let router = null ...@@ -19,8 +19,8 @@ let router = null
let instance = null let instance = null
Vue.use(ElementUI) Vue.use(ElementUI)
Vue.use(GLTable) Vue.use(GLTable)
export async function bootstrap({ history, common, messenger, globalState ,routerBase}) { export async function bootstrap({ history, common, messenger, globalState, routerBase }) {
const { response, request, sign, secret, sign_common, request_common, request_merchant ,merchantId} = await fetchConfig(common) const { response, request, sign, secret, sign_common, request_common, request_merchant, merchantId } = await fetchConfig(common)
Vue.prototype.$history = history Vue.prototype.$history = history
Vue.prototype.$messenger = messenger Vue.prototype.$messenger = messenger
Vue.prototype.$globalState = globalState Vue.prototype.$globalState = globalState
...@@ -28,8 +28,9 @@ export async function bootstrap({ history, common, messenger, globalState ,route ...@@ -28,8 +28,9 @@ export async function bootstrap({ history, common, messenger, globalState ,route
Vue.prototype.$message = message Vue.prototype.$message = message
Vue.prototype.$messageBox = messageBox Vue.prototype.$messageBox = messageBox
Vue.prototype.$hmdMerchantId = merchantId Vue.prototype.$hmdMerchantId = merchantId
// 集团版集团账号 Vue.prototype.$tracker = common.tracker
Vue.prototype.$isGroupUp = globalState.session.accountLevel != 4 // 集团版集团账号
Vue.prototype.$isGroupUp = globalState.session.accountLevel != 4
Vue.prototype.$http = new common.Http({ response, request, sign, secret, alert: message.error, headers: { token: globalState.session.token } }) Vue.prototype.$http = new common.Http({ response, request, sign, secret, alert: message.error, headers: { token: globalState.session.token } })
Vue.prototype.$http_common = new common.Http({ response, signWay: 'md5', request: request_common, sign: sign_common, secret, alert: ElementUI.Message.error, headers: { TGT: globalState.session.token } }) Vue.prototype.$http_common = new common.Http({ response, signWay: 'md5', request: request_common, sign: sign_common, secret, alert: ElementUI.Message.error, headers: { TGT: globalState.session.token } })
Vue.prototype.$http_tag = new common.Http({ response, request, sign, secret, alert: ElementUI.Message.error, headers: { token: globalState.session.token } }) Vue.prototype.$http_tag = new common.Http({ response, request, sign, secret, alert: ElementUI.Message.error, headers: { token: globalState.session.token } })
......
...@@ -390,9 +390,9 @@ export default { ...@@ -390,9 +390,9 @@ export default {
}, },
mounted() { mounted() {
// this.handleRefresh() this.handleRefresh()
// this.getListData() this.getListData()
// this.getOptionsList('searchFormData') this.getOptionsList('searchFormData')
}, },
methods: { methods: {
......
<template> <template>
<div class="marketing live-room"> <div class="marketing live-room">
<div class="topMsg"> <div class="topMsg">
<p class="pageTitle" v-if="!id">创建套餐</p> <p class="pageTitle"
<p class="pageTitle" v-else>编辑套餐</p> v-if="!id">创建套餐</p>
<p class="pageTitle"
v-else>编辑套餐</p>
<!-- <el-button type="primary" size="small" @click="goBack">返回</el-button> --> <!-- <el-button type="primary" size="small" @click="goBack">返回</el-button> -->
</div> </div>
<div class="live-room container marketing gl-form-page"> <div class="live-room container marketing gl-form-page">
<el-form ref="ruleForm" :rules="rules" :model="ruleForm" class="demo-ruleForm"> <el-form ref="ruleForm"
<el-form-item size="small" label="套餐名称:" prop="packageName"> :rules="rules"
<el-input size="small" v-model="ruleForm.packageName" maxlength="15" placeholder="请输入套餐名称"></el-input> :model="ruleForm"
class="demo-ruleForm">
<el-form-item size="small"
label="套餐名称:"
prop="packageName">
<el-input size="small"
v-model="ruleForm.packageName"
maxlength="15"
placeholder="请输入套餐名称"></el-input>
</el-form-item> </el-form-item>
<el-form-item size="small" label="服务内容:" class="is-required"> <el-form-item size="small"
<el-button @click="handleGiftAdd" size="small" class="default-blue-btn">选择服务</el-button> label="服务内容:"
<div class="gift-block m-t-10" :style="{ 'margin-left': defaultLabelWidth }" v-show="choseItemList.length != 0"> class="is-required">
<div v-for="(item, index) in orderShow" :key="index"> <el-button @click="handleGiftAdd"
<div class="gift-box flex-top" v-show="couponObj[item].list.length"> size="small"
<img class="gift-logo" :src="couponObj[item].logo" alt="" /> class="default-blue-btn">选择服务</el-button>
<div class="gift-block m-t-10"
:style="{ 'margin-left': defaultLabelWidth }"
v-show="choseItemList.length != 0">
<div v-for="(item, index) in orderShow"
:key="index">
<div class="gift-box flex-top"
v-show="couponObj[item].list.length">
<img class="gift-logo"
:src="couponObj[item].logo"
alt="" />
<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>
<div :class="['gift-coupon-name', subItem.status == '3' ? ' txt-grey' : '']">{{ subItem.couponName }} × {{ subItem.couponAmount }}</div> <div :class="['gift-coupon-name', subItem.status == '3' ? ' txt-grey' : '']">
<div v-show="subItem.status == '3'" class="gift-tips">已失效</div> {{ subItem.couponName }} × {{ subItem.couponAmount }}</div>
<i class="el-icon-delete" @click="handleGiftDelete(item, subIndex)"></i> <div v-show="subItem.status == '3'"
class="gift-tips">已失效</div>
<i class="el-icon-delete"
@click="handleGiftDelete(item, subIndex)"></i>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<div class="el-form-item__error" v-if="setmealContentRules">请选择套餐</div> <div class="el-form-item__error"
v-if="setmealContentRules">请选择套餐</div>
</el-form-item> </el-form-item>
<el-form-item size="small" label="会员专享:" v-if="isHmd" prop="memberPayFlags"> <el-form-item size="small"
label="会员专享:"
v-if="isHmd"
prop="memberPayFlags">
<el-checkbox-group v-model="ruleForm.memberPayFlags"> <el-checkbox-group v-model="ruleForm.memberPayFlags">
<el-checkbox v-for="(item, index) in memberList" :key="index" :label="item.name">{{ item.label }}</el-checkbox> <el-checkbox v-for="(item, index) in memberList"
:key="index"
:label="item.name">{{ item.label }}</el-checkbox>
</el-checkbox-group> </el-checkbox-group>
<span class="give-tip" style="margin: -15px 0 0 154px">仅勾选的等级用户方可购买会员套餐</span> <span class="give-tip"
style="margin: -15px 0 0 154px">仅勾选的等级用户方可购买会员套餐</span>
</el-form-item> </el-form-item>
<el-form-item label="赠送金卡会员:" prop="giveGoldFlag" v-if="showGh && accountLevel == 4"> <el-form-item label="赠送金卡会员:"
prop="giveGoldFlag"
v-if="showGh && accountLevel == 4">
<el-radio-group v-model="ruleForm.giveGoldFlag"> <el-radio-group v-model="ruleForm.giveGoldFlag">
<el-radio :label="2">赠送</el-radio> <el-radio :label="2">赠送</el-radio>
<el-radio :label="1">不赠送</el-radio> <el-radio :label="1">不赠送</el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<span class="give-tip" v-if="showGh && accountLevel == 4">选择赠送,客户购买该套餐后即开通一年金卡会员权益</span> <span class="give-tip"
<el-form-item size="small" label="套餐售价/元:" prop="packagePrice"> v-if="showGh && accountLevel == 4">选择赠送,客户购买该套餐后即开通一年金卡会员权益</span>
<el-input size="small" v-model="ruleForm.packagePrice" placeholder="请输入套餐售价" @keyup.native="ruleForm.packagePrice = oninput(ruleForm.packagePrice)"> <el-form-item size="small"
label="套餐售价/元:"
prop="packagePrice">
<el-input size="small"
v-model="ruleForm.packagePrice"
placeholder="请输入套餐售价"
@keyup.native="ruleForm.packagePrice = oninput(ruleForm.packagePrice)">
<!-- <span slot="suffix" class="suffix-label">元</span> --> <!-- <span slot="suffix" class="suffix-label">元</span> -->
</el-input> </el-input>
</el-form-item> </el-form-item>
<el-form-item label="限购:" prop="limitPurchaseFlag" v-if="!showGh && accountLevel == 4"> <el-form-item label="限购:"
<el-radio-group v-model="ruleForm.limitPurchaseFlag" class="limit-wrap" @change="changeLimit"> prop="limitPurchaseFlag"
v-if="!showGh && accountLevel == 4">
<el-radio-group v-model="ruleForm.limitPurchaseFlag"
class="limit-wrap"
@change="changeLimit">
<el-radio :label="2"> <el-radio :label="2">
每人限购 每人限购
<el-input-number class="limit-number" size="mini" controls-position="right" :disabled="ruleForm.limitPurchaseFlag == 1" v-model="ruleForm.limitPurchaseNumber" :max="100"></el-input-number> <el-input-number class="limit-number"
size="mini"
controls-position="right"
:disabled="ruleForm.limitPurchaseFlag == 1"
v-model="ruleForm.limitPurchaseNumber"
:max="100"></el-input-number>
次 次
</el-radio> </el-radio>
<el-radio :label="1">不限购</el-radio> <el-radio :label="1">不限购</el-radio>
...@@ -83,28 +132,55 @@ ...@@ -83,28 +132,55 @@
<span class="price">{{ totalShopPrice }}元</span> <span class="price">{{ totalShopPrice }}元</span>
</div> </div>
</template> --> </template> -->
<el-form-item size="small" label="说明:" prop="notes"> <el-form-item size="small"
<el-input size="small" :rows="6" type="textarea" v-model="ruleForm.notes" placeholder="请输入" maxlength="200" show-word-limit></el-input> label="说明:"
prop="notes">
<el-input size="small"
:rows="6"
type="textarea"
v-model="ruleForm.notes"
placeholder="请输入"
maxlength="200"
show-word-limit></el-input>
</el-form-item> </el-form-item>
<template v-if="showGh && accountLevel == 4"> <template v-if="showGh && accountLevel == 4">
<el-form-item size="small" label="套餐详情图片:"> <el-form-item size="small"
<preview :picOptions="picOptions" :imageUrlArr="packageImgArr" @change="changeqrCode"></preview> label="套餐详情图片:">
<preview :picOptions="picOptions"
:imageUrlArr="packageImgArr"
@change="changeqrCode"></preview>
</el-form-item> </el-form-item>
<span class="give-tip">可在套餐详情页顶部展示</span> <span class="give-tip">可在套餐详情页顶部展示</span>
</template> </template>
<template v-if="showGh && accountLevel == 4"> <template v-if="showGh && accountLevel == 4">
<el-form-item size="small" label="分享图片:"> <el-form-item size="small"
<preview :picOptions="sharePosterOptions" :imageUrlArr="sharePosterImgArr" @change="changeqrCode"></preview> label="分享图片:">
<preview :picOptions="sharePosterOptions"
:imageUrlArr="sharePosterImgArr"
@change="changeqrCode"></preview>
</el-form-item> </el-form-item>
</template> </template>
</el-form> </el-form>
</div> </div>
<GLFooter> <GLFooter>
<el-button @click="goBack" size="medium">取消</el-button> <el-button @click="goBack"
<el-button type="primary" @click="submitForm()" size="medium" :loading="sloading">提交</el-button> size="medium">取消</el-button>
<el-button type="primary"
@click="submitForm()"
size="medium"
:loading="sloading">提交</el-button>
</GLFooter> </GLFooter>
<GLDialog mode="small" type="warning" @onOk="handleTipConfirm" content="当前有内容信息未保存,是否继续返回?" @onCancel="handleTipClose" :visible.sync="isTipDialogVisible"></GLDialog> <GLDialog mode="small"
<select-gift-dialog v-if="isSelectGiftVisible" :isSelectGiftVisible="isSelectGiftVisible" :selectedGiftList="selectedMealList" @handleGiftConfirm="handleGiftConfirm" @handleGiftClose="handleGiftClose"></select-gift-dialog> type="warning"
@onOk="handleTipConfirm"
content="当前有内容信息未保存,是否继续返回?"
@onCancel="handleTipClose"
:visible.sync="isTipDialogVisible"></GLDialog>
<select-gift-dialog v-if="isSelectGiftVisible"
:isSelectGiftVisible="isSelectGiftVisible"
:selectedGiftList="selectedMealList"
@handleGiftConfirm="handleGiftConfirm"
@handleGiftClose="handleGiftClose"></select-gift-dialog>
</div> </div>
</template> </template>
<script> <script>
...@@ -266,6 +342,8 @@ export default { ...@@ -266,6 +342,8 @@ export default {
} }
// 判断是否是海马刀 // 判断是否是海马刀
this.isHmd = this.merchantId == this.$hmdMerchantId this.isHmd = this.merchantId == this.$hmdMerchantId
console.log('this.merchantId', this.merchantId);
console.log('this.$hmdMerchantId', this.$hmdMerchantId);
this.showGh = window.location.host.indexOf('cgacar') != -1 this.showGh = window.location.host.indexOf('cgacar') != -1
if (this.showGh) { if (this.showGh) {
this.getCardContentFun() this.getCardContentFun()
...@@ -277,15 +355,15 @@ export default { ...@@ -277,15 +355,15 @@ export default {
} }
// this.getSetmealServiceFun() //获取服务套餐,执行完了之后去获取编辑详情 // this.getSetmealServiceFun() //获取服务套餐,执行完了之后去获取编辑详情
}, },
mounted() {}, mounted() { },
methods: { methods: {
changeLimit(e) { changeLimit(e) {
if(e == 2){ if (e == 2) {
this.ruleForm.limitPurchaseNumber = 1 this.ruleForm.limitPurchaseNumber = 1
return return
} }
this.ruleForm.limitPurchaseNumber = 0 this.ruleForm.limitPurchaseNumber = 0
}, },
changeqrCode(val) { changeqrCode(val) {
this.ruleForm[val.key] = val.arr[0] this.ruleForm[val.key] = val.arr[0]
...@@ -845,7 +923,7 @@ export default { ...@@ -845,7 +923,7 @@ export default {
margin: 0 4px; margin: 0 4px;
} }
.el-input--mini .el-input__inner { .el-input--mini .el-input__inner {
border: 1px solid #E5E5E5; border: 1px solid #e5e5e5;
} }
.el-input-number--mini .el-input-number__decrease, .el-input-number--mini .el-input-number__decrease,
.el-input-number--mini .el-input-number__increase { .el-input-number--mini .el-input-number__increase {
......
订单管理
<template>
<div class="marketing order-manage">
<template v-if="showTable">
<div class="list-tips m-b-10">
<img class="tips-img" src="@/assets/icon-info.png" />
<span class="table-tips">
已生成有效订单
<span class="txt-blue">&nbsp;{{ statisticsInfo.orderCount || 0 }}&nbsp;</span>
项 累计订单总额:
<span class="txt-blue">{{ statisticsInfo.payPriceTotal || 0 }}&nbsp;</span>
元 累计退款总额:
<span class="txt-blue">{{ statisticsInfo.refundTotal || 0 }}&nbsp;</span>
元
</span>
</div>
<div class="container">
<div class="sticky">
<GLCombiForm ref="showSearch" :rowNumber="1" :formObj="searchForm" :formData="searchFormData"
@handleOk="handleSearch" @handleRest="handleReset"></GLCombiForm>
<div class="flex">
<div class="flex-default tabs">
<el-tabs v-model="searchForm.requestSource" @tab-click="handleTabClick">
<el-tab-pane label="全部订单" name="0"></el-tab-pane>
<el-tab-pane label="已付款" name="1"></el-tab-pane>
<el-tab-pane label="未付款" name="2"></el-tab-pane>
<el-tab-pane label="已退款" name="3"></el-tab-pane>
<el-tab-pane label="售后订单" name="4"></el-tab-pane>
</el-tabs>
</div>
<el-button v-if="configShow" class="default-blue-btn" :size="size" type="default" @click="handleExport">
导出
</el-button>
</div>
</div>
<!-- 表格区域 - 全部订单/售后订单 - 开始 -->
<div class="order-manage-table">
<GLTable ref="allOrderRef" :getListApi="getListApi" :noDataImg="url" :searchForm="tableSearchForm"
:tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn"
@setTableFinishFun="setTableFinishFun">
<div slot="giveEquityCard" slot-scope="scope" v-if="showGh && scope.scope.giveEquityCard == 1">
<div class="gold-sign">送会员</div>
</div>
<div slot="weChatName" class="flex-align" slot-scope="scope">
<img v-if="scope.scope.weChatImageUrl" class="img-36 pointer img-circle"
:src="scope.scope.weChatImageUrl" />
<span class="m-l-10">{{ scope.scope.weChatName }}</span>
<span v-if="!scope.scope.shareAvatar && !scope.scope.weChatName">-</span>
</div>
<template slot="vinNo" slot-scope="scope">
{{ Array.isArray(scope.scope.vinNo) ? scope.scope.vinNo[0] : scope.scope.vinNo }}
<el-popover popper-class="order-table-popover" placement="right-start" trigger="click">
<p v-for="(item, index) in scope.scope.vinNo" :key="index">{{ item }}</p>
<span class="car-no" slot="reference" v-show="Array.isArray(scope.scope.vinNo)">...({{
scope.scope.vinNo.length - 1 }})</span>
</el-popover>
</template>
<div slot="orderStatus" slot-scope="scope">
<span
:class="['table-circle', 'm-r-8', [2, 10, 22].includes(scope.scope.orderStatus) ? 'back-green' : [9].includes(scope.scope.orderStatus) ? 'back-blue' : [1, 21, 6].includes(scope.scope.orderStatus) ? 'back-orange' : 'back-grey']"></span>
<span>{{
baseData.orderStatusList.map(item => item.confId).includes(scope.scope.orderStatus + '') ?
baseData.orderStatusList.find(item => item.confId == scope.scope.orderStatus).confName : '-'
}}</span>
</div>
<div slot="shareStaffName" class="table-image" slot-scope="scope">
<div>
<img v-if="scope.scope.shareStaffImageUrl" class="img-36 pointer img-circle"
style="vertical-align: middle" slot="reference" :src="scope.scope.shareStaffImageUrl" />
<span class="m-l-10">
<span>{{ scope.scope.shareStaffName }}</span>
<span class="txt-green" v-if="scope.scope.shareStaffSource == 1">@微信</span>
<span class="txt-orange" v-if="scope.scope.shareStaffSource == 2">@企微</span>
<span class="txt-blue" v-if="scope.scope.shareStaffSource == 3">@员工</span>
</span>
</div>
<span v-if="!scope.scope.shareStaffImageUrl && !scope.scope.shareStaffName">-</span>
</div>
<div slot="assignName" slot-scope="scope">
<div>
<template v-if="scope.scope.assignStaffName">
<img class="img-36 pointer img-circle" v-if="scope.scope.assignStaffImageUrl"
:src="scope.scope.assignStaffImageUrl" />
<span class="m-l-10">
<span>{{ scope.scope.assignStaffName }}</span>
</span>
</template>
<template v-else-if="scope.scope.shareStaffName">
<img class="img-36 pointer img-circle" v-if="scope.scope.shareStaffImageUrl"
:src="scope.scope.shareStaffImageUrl" />
<span class="m-l-10">
<span>{{ scope.scope.shareStaffName }}</span>
</span>
</template>
<template v-else>
<span>{{ scope.scope.assignStaffName || scope.scope.shareStaffName || '-' }}</span>
</template>
<!-- <span @click="handlerAssign(scope.scope)"
class="assignLabel">指派</span> -->
</div>
</div>
<div slot="marketingStatus" slot-scope="scope">
<template v-if="scope.scope.marketingStatus">
<span
:class="['table-circle', 'm-r-8', [1, 2].includes(scope.scope.marketingStatus) ? 'back-green' : 'back-grey']"></span>
</template>
<span>
{{
scope.scope.marketingStatus
? {
1: '已完结',
2: '已完结',
3: '未完结',
4: '已取消'
}[scope.scope.marketingStatus]
: '-'
}}
</span>
</div>
<div class="table-btns" slot="auth-button" slot-scope="scope">
<GLTableButton :buttonList="tableButtonList" :buttonItem="scope.scope" :buttonNum="3"></GLTableButton>
</div>
</GLTable>
</div>
<!-- 表格区域 - 全部订单/售后订单 - end -->
</div>
</template>
<!-- 快递信息 -->
<GLDialog v-if="isExpressVisible" title="输入快递信息" mode="mid" okText="确定" cancelText="取消"
:visible.sync="isExpressVisible" @onOk="handleExpressConfirm" @onCancel="handleExpressClose">
<glsx-combi-form class="small-content m-t-20" ref="expressRef" :isBlock="true" defaultWidth="284px" :isEdit="isEdit"
:formRef="editChildRef" :formObj="expressForm" :formData="expressFormData"
:formRules="expressRules"></glsx-combi-form>
</GLDialog>
<!-- 订单核销 -->
<GLDialog v-if="isWriteOffVisible" title="订单核销(请确保用户到店后核销,避免引起不必要问题)" mode="mid" okText="确定" cancelText="取消"
:visible.sync="isWriteOffVisible" @onOk="handleWriteOffConfirm" @onCancel="handleWriteOffClose">
<glsx-combi-form class="small-content m-t-20" ref="writeOffRef" :isBlock="true" defaultWidth="284px"
:formRef="editChildRef" :formObj="writeOffForm" :formData="writeOffFormData"
:formRules="writeOffRules"></glsx-combi-form>
</GLDialog>
<!-- 退款审核 -->
<GLDialog v-if="isExamineVisible" bigTitle="退款审核" mode="big" :visible.sync="isExamineVisible"
@onOk="handleExamineConfirm" @onCancel="handleExamineClose">
<el-form label-width="144px">
<el-form-item label="售后类型">
<span>{{ orderInfo.refundTypeName }}</span>
</el-form-item>
<el-form-item label="申请金额">
<span>{{ orderInfo.refundPrice }}</span>
</el-form-item>
<el-form-item label="申请时间">
<span>{{ orderInfo.createdDateStr }}</span>
</el-form-item>
<el-form-item label="申请描述">
<span>{{ orderInfo.remark || '-' }}</span>
</el-form-item>
<el-form-item v-if="orderInfo.imgUrls">
<span v-for="(item, index) in orderInfo.imgUrls" :key="index">
<el-image class="img-60" :src="item" :preview-src-list="[item]"></el-image>
</span>
</el-form-item>
<el-form-item label="审核是否通过">
<el-radio-group v-model="examineForm.isAllowed">
<el-radio label="1">审核通过</el-radio>
<el-radio label="2">审核不通过</el-radio>
</el-radio-group>
</el-form-item>
<template v-if="orderInfo.refundType == 1 && examineForm.isAllowed == '1'">
<glsx-combi-form ref="examineRef" :isEdit="isEdit" defaultWidth="284px" :isBlock="true" :formRef="editChildRef"
:formObj="examineForm" :formData="examineFormData" :formRules="examineRules"></glsx-combi-form>
</template>
</el-form>
</GLDialog>
<!-- 确认收货 -->
<GLDialog v-if="isReceivingVisible" bigTitle="确认收货" mode="big" :visible.sync="isReceivingVisible"
@onOk="handleReceivingConfirm" @onCancel="handleReceivingClose">
<el-form label-width="140px">
<el-form-item label="售后类型">
<span>{{ orderInfo.refundTypeName }}</span>
</el-form-item>
<el-form-item label="申请金额">
<span>{{ orderInfo.refundPrice }}</span>
</el-form-item>
<el-form-item label="申请时间">
<span>{{ orderInfo.createdDateStr }}</span>
</el-form-item>
<el-form-item label="申请描述">
<span>{{ orderInfo.remark || '-' }}</span>
</el-form-item>
<el-form-item label="快递公司">
<span>{{ orderInfo.deliveryCompany }}</span>
</el-form-item>
<el-form-item label="快递单号">
<span>{{ orderInfo.deliveryNumber }}</span>
</el-form-item>
</el-form>
</GLDialog>
<!-- 退款类型 -->
<GLDialog mode="mid" class="refund-dialog" title="退款" :visible.sync="refundVisible"
@onCancel="refundVisible = !refundVisible" @onOk="refundFun">
<div class="gl-form-page gl-form-min">
<el-form ref="form" label-width="154px">
<el-form-item label="退款类型:">
<el-radio-group v-model="refundParams.afterSaleType">
<div class="refund-item">
<el-radio v-model="radio" label="2">退定金</el-radio>
<div class="refund-tips">选择此项不会扣减实际订单数</div>
</div>
<div class="refund-item">
<el-radio v-model="radio" label="1">退订单</el-radio>
<div class="refund-tips">选择此项会扣减实际订单数</div>
</div>
</el-radio-group>
</el-form-item>
</el-form>
</div>
</GLDialog>
</div>
</template>
<script>
import * as dayjs from 'dayjs'
import url from '@/assets/empty.png'
import { utils } from 'glsx-common'
import {
businessType,
orderManageStatusList,
afterSaleStatusList,
orderSourceList,
deliveryTypeList,
exportFn
} from '@/common/constant'
export default {
name: 'orderManage',
data() {
return {
isHmd: true,
showGh: false,
size: 'small',
url: url,
isEdit: true,
orderCode: '',
oldVal: {
orderStatuses: [],
afterSaleStatuses: []
},
refundVisible: false,
refundParams: {},
searchForm: {
orderCode: '',
orderStatuses: [],
afterSaleStatuses: [],
merchantName: '',
customerName: '',
createDate: [],
orderSource: '',
deliveryType: '',
vin: '',
shareStaffName: '',
shareStaffSource: '',
activityName: '',
goodsName: '',
requestSource: '0'
},
tableSearchForm: {},
statisticsInfo: {
orderCount: '',
payPriceTotal: '',
refundTotal: ''
},
// 搜索
searchFormData: [],
// 快递信息
isExpressVisible: false,
editChildRef: 'editChildRef',
expressForm: {
deliveryCompany: '',
deliveryNumber: ''
},
expressRules: {
deliveryCompany: [{ required: true, message: '快递公司是必填项', trigger: 'change' }],
deliveryNumber: [{ required: true, message: '快递单号是必填项', trigger: 'change' }]
},
expressFormData: [
{
label: '快递公司',
name: 'deliveryCompany',
type: 'input',
maxlength: 20
},
{
label: '快递单号',
name: 'deliveryNumber',
type: 'input',
maxlength: 20
}
],
// 订单核销
isWriteOffVisible: false,
writeOffForm: {
verificationCode: ''
},
writeOffRules: {
verificationCode: [{ required: true, message: '核销码是必填项', trigger: 'change' }]
},
writeOffFormData: [
{
label: '核销码',
name: 'verificationCode',
type: 'input',
maxlength: 32
}
],
// 退款审核
isExamineVisible: false,
orderInfo: {},
examineForm: {
isAllowed: '1',
contactAddress: '',
contactName: '',
contactPhone: ''
},
examineRules: {
contactAddress: [{ required: true, message: '退货地址是必填项', trigger: 'change' }],
contactName: [{ required: true, message: '联系人是必填项', trigger: 'change' }],
contactPhone: [
{ required: true, message: '手机号是必填项', trigger: 'change' },
{
validator: (rule, value, callback) => {
let phoneReg = /^(13[0-9]|15[0-9]|16[0-9]|17[0-9]|18[0-9]|19[0-9]|14[0-9])[0-9]{8}$/
return phoneReg.test(value) ? callback() : callback(new Error('请输入正确的联系号码'))
},
trigger: 'blur'
}
]
},
examineFormData: [
{
label: '退货地址',
name: 'contactAddress',
type: 'input',
maxlength: 50
},
{
label: '联系人',
name: 'contactName',
type: 'input',
maxlength: 10
},
{
label: '手机号',
name: 'contactPhone',
type: 'input',
maxlength: 11
}
],
// 确认收获
isReceivingVisible: false,
// 表格按钮
tableButtonList: [
{
type: 'GLButton',
name: '查看订单',
attrs: {
type: 'text',
fn: '查看订单'
},
listeners: {
click: this.handleDetail
}
},
{
type: 'GLButton',
name: '退款',
attrs: {
type: 'text',
fn: '退款'
},
condition: row => {
// return row.orderSource == 4 && [2, 6, 21, 22].includes(+row.orderStatus) && row.isOffline != 0
return row.showRefund == 1 && (row.orderSource !== 6 && row.orderSource !== 7)//是否展示退款按钮 1:是 0:否
},
listeners: {
click: row => {
if (row.paymentModel == 3) {
this.refundVisible = true
this.refundParams = {
orderCode: row.orderCode,
afterSaleType: '2'
}
} else this.secondConfirm('退款', '请确定是否发起退款?', 'orderManage', 'crowdFundRefundApi', {
orderCode: row.orderCode,
afterSaleType: '1'
}, () => {
}, this.searchForm.requestSource != 0)
}
}
},
{
type: 'GLButton',
name: '订单核销',
attrs: {
type: 'text',
fn: '订单核销'
},
condition: row => {
// return row.deliveryType == 1 && row.orderStatus == 21
return row.showVerf == 1 && (row.orderSource !== 6 && row.orderSource !== 7) //是否展示核销按钮 1:是 0:否
},
listeners: {
click: this.handleWriteOff
}
},
{
type: 'GLButton',
// name: '输入快递信息',
name: '商品发货',
attrs: {
type: 'text',
fn: '商品发货'
},
condition: row => {
return row.deliveryType == 2 && row.orderStatus == 6 && (row.orderSource !== 6 && row.orderSource !== 7)
},
listeners: {
click: this.handleExpressInfo
}
},
{
type: 'GLButton',
name: '退款审核',
attrs: {
type: 'text',
fn: '退款审核'
},
condition: row => {
return row.afterSaleStatus == 1 && (row.orderSource !== 6 && row.orderSource !== 7)
},
listeners: {
click: this.handleExamine
}
},
{
type: 'el-button',
name: '确认收货',
attrs: {
type: 'text'
},
condition: row => {
return row.afterSaleStatus == 4 && (row.orderSource !== 6 && row.orderSource !== 7)
},
listeners: {
click: this.handleReceiving
}
},
{
type: 'el-button',
name: '设为已完结',
attrs: {
type: 'text'
},
condition: row => {
return row.marketingStatus && row.marketingStatus == 3 && (row.orderSource !== 6 && row.orderSource !== 7)
},
listeners: {
click: row => {
this.secondConfirm('设为已完结', '请确定将此订单营销状态设为已完结?', 'orderManage', 'finishOrderStatus', { subOrderCode: row.orderCode }, false)
}
}
}
],
// 表格
getListApi: this.$apis.orderManage.getListApi,
tableParams: {
listName: 'list',
tableOption: true,
tableColumns: []
},
pageConf: { pageSize: 'pageSize', pageNum: 'currentPage', totalCount: 'total' },
// 基本数据
baseData: {
searchOrderStatusList: orderManageStatusList.filter(item => ['1', '3', '21', '22', '6', '9'].includes(item.confId)),
searchAfterSaleStatusList: afterSaleStatusList.filter(item => ['1', '6', '7'].includes(item.confId)),
orderStatusList: orderManageStatusList,
afterSaleStatusList: afterSaleStatusList,
orderSourceList: orderSourceList,
deliveryTypeList: deliveryTypeList,
refundTypeList: [
{ confId: '1', confName: '退款退货' },
{ confId: '2', confName: '我要退款(无需退货)' },
{ confId: '3', confName: '众筹订单退款' }
],
shareStaffSourceList: [
{ confId: '1', confName: '个微' },
{ confId: '2', confName: '企微' },
{ confId: '3', confName: '员工' }
],
testSheetTypeList: [
{ confId: '0', confName: '否' },
{ confId: '1', confName: '是' }
],
isOffSheetTypeList: [
{ confId: '0', confName: '是' },
{ confId: '1', confName: '否' }
],
businessTypeList: utils.deepClone(businessType),
marketingStatusList: [
{ confId: '1', confName: '已完结' },
{ confId: '3', confName: '未完结' },
{ confId: '4', confName: '已取消' }
]
},
showTable: false,
configShow: false
}
},
created() {
// this.checkMerchant()
if (window.__POWERED_BY_QIANKUN__) {
this.merchantId = this.$globalState.session.merchantId
this.merchantModel = this.$globalState.session.merchantModel
this.accountLevel = this.$globalState.session.accountLevel
if (this.merchantModel == 2 && this.accountLevel == 4) {
this.initParams()
}
}
// 判断是否是海马刀
this.isHmd = this.merchantId == this.$hmdMerchantId
let href = window.location.host
this.showGh = href.indexOf('cgacar') !== -1
},
mounted() {
this.getCrowdfundingOrderConfig()
// this.getCount()
},
methods: {
async getCrowdfundingOrderConfig() {
const { channelType } = this.$globalState.session
let tableColumns = [
{
label: '客户名称',
prop: 'customerName',
width: 160,
formatter: cellValue => {
return cellValue.customerName || '-'
}
},
{
label: '手机号',
prop: 'customerPhone',
width: 160,
formatter: cellValue => {
return cellValue.customerPhone || '-'
}
},
{
label: '其他',
prop: 'otherInformation',
width: 210
},
{
label: '微信名称',
prop: 'weChatName',
addHtml: 'weChatName',
width: 210
},
{
label: '推荐人',
prop: 'shareStaffName',
width: 210,
addHtml: 'shareStaffName'
},
{
label: '推荐人ID',
name: 'shareStaffId',
prop: 'shareStaffId',
width: 210
},
{
label: '指派人',
prop: 'assignName',
width: 210,
addHtml: 'assignName'
},
{
label: '推荐人手机号',
prop: 'shareStaffPhone',
width: 160,
formatter: cellValue => {
return cellValue.shareStaffPhone || '-'
}
},
{
label: '订单时间',
prop: 'createdDate',
width: '180',
formatter: cellValue => {
return dayjs(cellValue.createdDate).format('YYYY-MM-DD HH:mm:ss')
}
},
{
label: '支付时间',
prop: 'payDate',
width: '180',
formatter: cellValue => {
return cellValue.payDate ? dayjs(cellValue.payDate).format('YYYY-MM-DD HH:mm:ss') : '-'
}
},
{
label: '核销时间',
prop: 'verificationDate',
width: '180',
formatter: cellValue => {
return cellValue.verificationDate ? dayjs(cellValue.verificationDate).format('YYYY-MM-DD HH:mm:ss') : '-'
}
},
{
label: '车架号',
prop: 'vinNo',
width: 130,
addHtml: 'vinNo'
},
{
label: '订单状态',
prop: 'orderStatus',
addHtml: 'orderStatus',
width: 160
},
{
label: '业务场景',
prop: 'businessType',
width: 120,
formatter: cellValue => {
let type = cellValue.businessType
if (type) {
return businessType.find(item => item.optionId == type).optionLabel
} else {
return '-'
}
}
},
{
label: '商品名称',
prop: '',
width: '120',
formatter: cellValue => {
return cellValue.orderGoods&&cellValue.orderGoods.length ? cellValue.orderGoods.map(item => item.goodsName).join(',') : '-'
}
},
{
label: '',
addHtml: 'giveEquityCard',
width: 80
},
{
label: channelType == 2 ? '付款金额/元' : '支付定金/元',
prop: 'payPrice',
width: '120',
formatter: cellValue => {
return cellValue.payPrice || '0'
}
},
{
label: '活动名称',
prop: 'activityName',
width: '120'
},
{
label: '门店信息',
prop: 'merchantName',
line: 1,
width: 280
},
{
label: '赠送积分',
prop: 'giveIntegral',
line: 1,
width: 150
},
{
label: '订单类型',
prop: 'orderSource',
width: '100',
formatter: cellValue => {
return this.baseData.orderSourceList.map(item => item.confId).includes(cellValue.orderSource + '') ? this.baseData.orderSourceList.find(item => item.confId == cellValue.orderSource).confName : '-'
}
},
{
label: '测试单',
prop: 'orderType',
width: '100',
// addHtml: 'orderType'
formatter: cellValue => {
return cellValue.orderType == 1 ? '是' : '否'
}
},
{
label: '退款类型',
prop: 'afterSaleType',
width: 100,
formatter: cellValue => {
return { 1: '退订单', 2: '退定金' }[cellValue.afterSaleType] || '-'
}
},
{
label: '营销状态',
name: 'marketingStatus',
width: 180,
addHtml: 'marketingStatus'
},
{
label: '售后状态',
prop: 'afterSaleStatus',
width: '100',
formatter: cellValue => {
return this.baseData.afterSaleStatusList.map(item => item.confId).includes(cellValue.afterSaleStatus + '') ? this.baseData.afterSaleStatusList.find(item => item.confId == cellValue.afterSaleStatus).confName : '-'
}
},
{
label: '结算方式',
prop: 'deliveryType',
width: '100',
formatter: cellValue => {
return this.baseData.deliveryTypeList.map(item => item.confId).includes(cellValue.deliveryType + '') ? this.baseData.deliveryTypeList.find(item => item.confId == cellValue.deliveryType).confName : '-'
}
},
{
label: '订单编号',
prop: 'orderCode',
width: '180'
},
{
label: '商户订单号',
prop: 'outTradeNo',
width: '160',
formatter: cellValue => {
return cellValue.outTradeNo || '-'
}
}
],
searchFormData = [
{
label: '订单编号',
name: 'orderCode',
type: 'input'
},
{
label: '订单状态',
name: 'orderStatuses',
type: 'select',
multiple: true,
optionList: [],
optionId: 'confId',
optionLabel: 'confName',
optionsName: 'searchOrderStatusList',
changeAttr: (value, targetItem) => {
var isAdd = value.length > this.oldVal.orderStatuses.length
var targetVal = value[value.length - 1]
var formIdx = this.searchFormData.findIndex(item => item.label == '订单状态')
if (!isAdd) {
for (var i = 0; i < this.oldVal.orderStatuses.length; i++) {
if (!value.includes(this.oldVal.orderStatuses[i])) {
targetVal = this.oldVal.orderStatuses[i]
break
}
}
}
!targetVal && (this.searchForm.orderStatuses = isAdd ? this.searchFormData[formIdx].optionList.map(item => item.confId) : [])
if (targetVal) {
var idx = value.findIndex(item => item == '')
if (idx != -1 && this.searchForm.orderStatuses.length < this.searchFormData[formIdx].optionList.length) {
this.searchForm.orderStatuses.splice(idx, 1)
} else if (idx == -1 && this.searchForm.orderStatuses.length == this.searchFormData[formIdx].optionList.length - 1) {
this.searchForm.orderStatuses.push('')
}
}
this.oldVal.orderStatuses = this.$common.utils.deepClone(this.searchForm.orderStatuses)
}
},
{
label: '售后状态',
name: 'afterSaleStatuses',
type: 'select',
labelWidth: 72,
multiple: true,
optionList: [],
optionId: 'confId',
optionLabel: 'confName',
optionsName: 'searchAfterSaleStatusList',
changeAttr: (value, targetItem) => {
var isAdd = value.length > this.oldVal.afterSaleStatuses.length
var targetVal = value[value.length - 1]
var formIdx = this.searchFormData.findIndex(item => item.label == '售后状态')
if (!isAdd) {
for (var i = 0; i < this.oldVal.afterSaleStatuses.length; i++) {
if (!value.includes(this.oldVal.afterSaleStatuses[i])) {
targetVal = this.oldVal.afterSaleStatuses[i]
break
}
}
}
!targetVal && (this.searchForm.afterSaleStatuses = isAdd ? this.searchFormData[formIdx].optionList.map(item => item.confId) : [])
if (targetVal) {
var idx = value.findIndex(item => item == '')
if (idx != -1 && this.searchForm.afterSaleStatuses.length < this.searchFormData[formIdx].optionList.length) {
this.searchForm.afterSaleStatuses.splice(idx, 1)
} else if (idx == -1 && this.searchForm.afterSaleStatuses.length == this.searchFormData[formIdx].optionList.length - 1) {
this.searchForm.afterSaleStatuses.push('')
}
}
this.oldVal.afterSaleStatuses = this.$common.utils.deepClone(this.searchForm.afterSaleStatuses)
}
},
{
label: '门店',
name: 'merchantName',
type: 'input',
labelWidth: 56
},
{
label: '客户姓名',
name: 'customerName',
type: 'input'
},
{
label: '订单日期',
name: 'createDate',
type: 'datePicker',
labelWidth: 72,
isClear: true,
pickerOptions: 'beforeRangePickerOptions'
},
{
label: '订单类型',
name: 'orderSource',
type: 'select',
optionList: [],
optionId: 'confId',
optionLabel: 'confName',
optionsName: 'orderSourceList'
},
{
label: '结算方式',
name: 'deliveryType',
type: 'select',
optionList: [],
optionId: 'confId',
optionLabel: 'confName',
optionsName: 'deliveryTypeList'
},
{
label: '商户订单号',
name: 'outTradeNo',
type: 'input',
maxlength: 50
},
{
label: '车架号',
name: 'vin',
labelWidth: 56,
type: 'input',
maxlength: 50
},
{
label: '推荐人',
name: 'shareStaffName',
labelWidth: 56,
type: 'input',
maxlength: 100
},
{
label: '推荐人类型',
name: 'shareStaffSource',
type: 'select',
optionList: [],
optionId: 'confId',
optionLabel: 'confName',
optionsName: 'shareStaffSourceList'
},
{
label: '活动名称',
name: 'activityName',
labelWidth: 56,
type: 'input',
maxlength: 100
},
{
label: '商品名称',
name: 'goodsName',
labelWidth: 56,
type: 'input',
maxlength: 100
},
{
label: '手机号',
name: 'customerPhone',
labelWidth: 56,
type: 'input',
maxlength: 11
},
{
label: '推荐人手机号',
name: 'shareStaffPhone',
labelWidth: 56,
type: 'input',
maxlength: 11
},
{
label: '测试单',
name: 'orderType',
type: 'select',
optionList: [],
optionId: 'confId',
optionLabel: 'confName',
optionsName: 'testSheetTypeList'
},
{
label: '退款类型',
name: 'afterSaleType',
type: 'select',
optionList: [
{
confId: null,
confName: '全部'
},
{
confId: '2',
confName: '退定金'
},
{
confId: '1',
confName: '退订单'
}
],
optionId: 'confId',
optionLabel: 'confName'
},
{
label: '业务场景',
name: 'businessType',
type: 'select',
optionList: [],
optionId: 'optionId',
optionLabel: 'optionLabel',
optionsName: 'businessTypeList'
},
{
label: '营销状态',
name: 'marketingStatus',
type: 'select',
optionList: [],
optionId: 'confId',
optionLabel: 'confName',
optionsName: 'marketingStatusList'
}
]
try {
const res = await this.$apis.common.getCrowdfundingOrderConfig(),
filterTableList = ['shareStaffName', 'otherInformation', 'assignName', 'shareStaffPhone', 'verificationDate', 'vinNo', 'afterSaleStatus'],
filterFormList = ['afterSaleStatuses', 'shareStaffName', 'vin', 'shareStaffSource', 'shareStaffPhone']
if(!this.isHmd){
filterTableList.push('customerPhone')
filterFormList.push('customerPhone')
}
this.configShow = res != 1||this.isHmd
if (res == 1||this.isHmd) {
for (let i = 0; i < tableColumns.length; i++) {
if (filterTableList.includes(tableColumns[i].prop)) {
tableColumns.splice(i, 1)
i--
}
}
for (let i = 0; i < searchFormData.length; i++) {
if (filterFormList.includes(searchFormData[i].name)) {
searchFormData.splice(i, 1)
i--
}
}
}
} catch (error) {
console.log(error)
}
this.tableParams.tableColumns = tableColumns
this.searchFormData = searchFormData
this.showTable = true
this.getOptionsList('searchFormData')
},
initParams() {
const cell = {
label: '线下订单',
prop: 'isOffline',
width: 120,
formatter: cellValue => {
return cellValue.isOffline == 1 ? '否' : cellValue.isOffline == 0 ? '是' : '-'
}
}
const searchCell = {
label: '线下订单',
name: 'isOffline',
type: 'select',
optionList: [],
optionId: 'confId',
optionLabel: 'confName',
optionsName: 'isOffSheetTypeList'
}
this.tableParams.tableColumns.splice(12, 0, cell)
this.searchFormData.splice(17, 0, searchCell)
},
getParams() {
var params = JSON.parse(JSON.stringify(this.searchForm))
if (this.searchForm.createDate.length) {
params.createdStartDateStr = new Date(this.searchForm.createDate[0]).toLocaleDateString().replace(/\//g, '-') + ' 00:00:00'
params.createdEndDateStr = new Date(this.searchForm.createDate[1]).toLocaleDateString().replace(/\//g, '-') + ' 23:59:59'
}
if(this.searchForm.orderSource ==''){
params.orderSource =0
}
if (params.orderStatuses.includes('3') && params.requestSource == '0') delete params.requestSource
delete params.createDate
return params
},
beforeSearchFn() {
return new Promise(resolve => {
this.tableSearchForm = this.getParams()
delete this.tableSearchForm.createDate
resolve()
})
},
getOptionsList(formName, hasAll = true, refreshSigle) {
if (refreshSigle) {
var item = this[formName].find(k => k.name == refreshSigle)
var index = this[formName].findIndex(k => k.name == refreshSigle)
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)
}
} else {
this[formName].forEach((item, index) => {
if (item.type === 'select' && this.baseData[item.optionsName] && 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)
}
}
})
}
},
showOrHideAttr(formName, label, isHide) {
let idx = this[formName].findIndex(item => item.label == label)
this[formName][idx].isHide = isHide
},
deleteAttr(labelList) {
labelList.forEach(i => {
console.log(i)
let idx = this.tableParams.tableColumns.findIndex(item => item.label == i)
this.tableParams.tableColumns.splice(idx, 1)
})
},
async refundFun() {
let { refundParams } = this
const res = this.$apis.orderManage.crowdFundRefundApi(refundParams)
this.refundVisible = false
this.searchForm.requestSource != 0 ? this.handleSearch() : this.$refs.allOrderRef.refreshTable(false)
},
// checkMerchant () {
// this.$apis.orderManage.checkMerchartApi({}).then(res => {
// this.isSpecialMerchat = res
// var hideList = ['售后状态', '订单类型', '结算方式', '商户订单号', '车架号', '推荐人', '推荐人类型', '手机号', '推荐人手机号']
// if (this.isSpecialMerchat) {
// hideList.forEach(item => {
// this.showOrHideAttr('searchFormData', item, true)
// })
// this.deleteAttr(['手机号', '其他', '微信名称', '推荐人', '推荐人手机号', '车架号', '商户订单号'])
// }
// })
// },
secondConfirm(title, txt, apiModule, apiName, apiParams, fn, isResetPage = true) {
this.$confirm(txt, title, {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
callback: action => {
if (action == 'confirm') {
this.$apis[apiModule][apiName](apiParams).then(res => {
this.$message({
message: res.code == '0' ? '操作成功' : res.message,
type: res.code == '0' ? 'success' : 'error'
})
if (res.code == '0') {
fn && fn()
isResetPage ? this.handleSearch() : this.$refs.allOrderRef.refreshTable(false)
}
})
}
}
})
},
getCount() {
var params = this.getParams()
delete params.createDate
// if(params.orderStatuses.includes('3')) return
this.$apis.orderManage.getCountApi(params).then(res => {
this.statisticsInfo = res || { orderCount: '', payPriceTotal: '', refundTotal: '' }
})
},
handleDetail(row) {
this.$router.push({
path: '/orderManage/orderDetail',
query: {
orderCode: row.orderCode
}
})
},
// 输入快递信息 - start
handleExpressClose() {
this.isExpressVisible = !this.isExpressVisible
this.orderCode = ''
this.expressForm = {
deliveryCompany: '',
deliveryNumber: ''
}
},
handleExpressConfirm() {
this.$refs.expressRef.$refs[this.editChildRef].validate(valid => {
if (valid) {
var params = this.$common.utils.deepClone(this.expressForm)
params.orderCode = this.orderCode
this.$apis.orderManage.addDeliveryApi(params).then(res => {
this.$message({
message: res.code == '0' ? '操作成功' : '操作失败',
type: res.code == '0' ? 'success' : 'error',
customClass: 'message-Z-zinde'
})
if (res.code == '0') {
this.handleExpressClose()
this.handleSearch()
}
})
}
})
},
handleExpressInfo(row) {
this.isExpressVisible = !this.isExpressVisible
this.orderCode = row.orderCode
},
// 输入快递信息 - end
// 订单核销 - start
handleWriteOffClose() {
this.isWriteOffVisible = !this.isWriteOffVisible
this.orderCode = ''
this.writeOffForm = {
verificationCode: ''
}
},
handleWriteOffConfirm() {
this.$refs.writeOffRef.$refs[this.editChildRef].validate(valid => {
if (valid) {
var params = this.$common.utils.deepClone(this.writeOffForm)
params.orderCode = this.orderCode
this.$apis.orderManage.writeOffApi(params).then(res => {
this.$message({
message: res.code == '0' ? '操作成功' : '操作失败',
type: res.code == '0' ? 'success' : 'error',
customClass: 'message-Z-zinde'
})
if (res.code == '0') {
this.handleWriteOffClose()
this.searchForm.requestSource == 0 ? this.$refs.allOrderRef.refreshTable(false) : this.handleSearch()
}
})
}
})
},
handleWriteOff(row) {
if (row.orderSource == 4) {
this.secondConfirm('订单核销', '请确定是否核销此订单?', 'orderManage', 'crowdFundWriteOffApi', { orderCode: row.orderCode }, () => {
}, this.searchForm.requestSource != 0)
return true
}
this.isWriteOffVisible = !this.isWriteOffVisible
this.orderCode = row.orderCode
},
// 订单核销 - end
// 退款审核 - start
handleExamineClose() {
this.isExamineVisible = !this.isExamineVisible
this.orderCode = ''
this.orderInfo = {}
this.examineForm = {
isAllowed: '1',
contactAddress: '',
contactName: '',
contactPhone: ''
}
},
submitExamine(params) {
this.$apis.orderManage.examineAllowApi(params).then(res => {
this.$message({
message: res.code == '0' ? '操作成功' : res.message,
type: res.code == '0' ? 'success' : 'error',
customClass: 'message-Z-zinde'
})
if (res.code == '0') {
this.handleExamineClose()
this.searchForm.requestSource == 0 ? this.$refs.allOrderRef.refreshTable(false) : this.handleSearch()
}
})
},
handleExamineConfirm() {
var params = {
id: this.orderInfo.id
}
if (this.orderInfo.refundType == 1 && this.examineForm.isAllowed == '1') {
this.$refs.examineRef.$refs[this.editChildRef].validate(valid => {
if (valid) {
params = this.$common.utils.deepClone(this.examineForm)
params.id = this.orderInfo.id
params.isAllowed = true
this.submitExamine(params)
}
})
} else {
params.isAllowed = this.examineForm.isAllowed == '1'
this.submitExamine(params)
}
},
handleExamine(row) {
this.orderCode = row.orderCode
this.$apis.orderManage.examineDetailApi({ orderCode: row.orderCode }).then(res => {
this.orderInfo = res || {}
this.orderInfo.refundTypeName = [1, 2, 3].includes(this.orderInfo.refundType) ? this.baseData.refundTypeList.find(item => item.confId == this.orderInfo.refundType + '').confName : '-'
this.orderInfo.createdDateStr = this.orderInfo.createdDate ? dayjs(this.orderInfo.createdDate).format('YYYY-MM-DD HH:mm:ss') : '-'
this.isExamineVisible = !this.isExamineVisible
})
},
// 退款审核 - end
// 确认收货 - start
handleReceivingClose() {
this.isReceivingVisible = !this.isReceivingVisible
this.orderCode = ''
this.orderInfo = {}
},
handleReceivingConfirm() {
var params = {
id: this.orderInfo.id
}
this.$apis.orderManage.confirmReceiptGoodsApi(params).then(res => {
this.$message({
message: res.code == '0' ? '操作成功' : '操作失败',
type: res.code == '0' ? 'success' : 'error',
customClass: 'message-Z-zinde'
})
if (res.code == '0') {
this.handleReceivingClose()
this.handleSearch()
}
})
},
handleReceiving(row) {
this.$apis.orderManage.examineDetailApi({ orderCode: row.orderCode }).then(res => {
this.orderInfo = res || {}
this.orderInfo.refundTypeName = [1, 2, 3].includes(this.orderInfo.refundType) ? this.baseData.refundTypeList.find(item => item.confId == this.orderInfo.refundType + '').confName : '-'
this.orderInfo.createdDateStr = this.orderInfo.createdDate ? dayjs(this.orderInfo.createdDate).format('YYYY-MM-DD HH:mm:ss') : '-'
this.isReceivingVisible = !this.isReceivingVisible
})
},
// 确认收货 - end
setTableFinishFun() {
this.$refs.allOrderRef.data.forEach(item => {
item.vinNo = item.vin ? (item.vin.split(',').length > 1 ? item.vin.split(',') : item.vin) : '-'
})
//接收到的数据为空
this.$refs.allOrderRef.data.length ? (this.$refs.allOrderRef.tableHeightValues = '') : this.$refs.allOrderRef.setTableHeightFun()
this.getCount()
},
handleSearch() {
this.$refs.allOrderRef.refreshTable()
},
handleTabClick() {
// if (this.isSpecialMerchat) {
// return true
// }
this.handleSearch()
},
handleExport(row) {
var params = this.getParams()
this.$apis.orderManage.orderExportApi(params).then(res => {
exportFn(res)
})
},
handleReset() {
this.searchForm = this.$options.data.call(this).searchForm
this.handleSearch()
}
}
}
</script>
<style lang="scss">
.order-table-popover {
min-width: 80px !important;
padding: 8px 12px !important;
}
.refund-dialog {
.refund-item {
padding-top: 14px;
}
.refund-tips {
font-size: 14px;
margin: 8px 0 6px 0;
color: #999999;
}
.refund-dialog-tips-close {
margin-left: auto;
cursor: pointer;
}
.tips-img {
margin: 0 8px 0 0 !important;
}
}
.order-manage {
.container {
padding: 20px 14px;
}
.table-tips {
font-size: 14px;
color: rgba(0, 0, 0, 0.65);
}
.car-no {
cursor: pointer;
font-size: 12px;
border-radius: 4px;
border: 1px solid #e8e8ea;
padding: 2px 4px;
line-height: 25px;
}
.txt-blue {
color: #5850ff;
}
.list-tips {
background: #e4e3ff;
border-radius: 4px;
border: none;
}
.order-manage-table {
padding: 20px;
border: 1px solid #e5e5e5;
border-radius: 0 4px 4px 4px;
}
.flex-default.tabs {
border-bottom: 1px solid #e5e5e5;
border-bottom: 0;
.el-tabs__item {
background: #fafafa;
border: 1px solid #e5e5e5 !important;
border-radius: 4px 4px 0 0;
border-bottom: 0;
}
.is-active {
border-bottom: 1px solid #fff !important;
font-weight: 500;
}
}
}
.gold-sign {
width: 48px;
height: 20px;
background: #fee9cc;
border-radius: 2px;
white-space: nowrap;
font-size: 12px;
color: #fdb757;
text-align: center;
line-height: 20px;
}</style>
<!-- 订单详情 -->
<template>
<div class="order-detail marketing">
<div class="edit-box">
<div class="container m-b-20">
<p class="edit-title">订单信息</p>
<el-form
label-width="100px"
:inline="true"
>
<el-row
v-for="(item, index) in detailFormDataRow"
:key="index"
>
<el-form-item
v-for="(subItem, subIndex) in item.rowList"
:key="subIndex"
:label="subItem.label"
class="row-item"
>
<span
class="detail-txt ellipsis-1"
:title="detailForm[subItem.name]"
>{{ detailForm[subItem.name] ? detailForm[subItem.name] + (subItem.suffix || '') : '-' }}</span>
</el-form-item>
</el-row>
<template v-if="detailForm.formDescribe">
<el-form-item label="其他信息">{{ detailForm.formDescribe }}</el-form-item>
</template>
</el-form>
</div>
<div :class="['container', orderRefund ? 'm-b-20' : 'edit-container']" v-if="isHmd">
<p class="edit-title">收货信息</p>
<el-form label-width="100px" :inline="true">
<el-row v-for="(item, index) in receiveInfoDataRow" :key="index">
<el-form-item v-for="(subItem, subIndex) in item.rowList" :key="subIndex" :label="subItem.label">
<span v-if ="subItem.name == 'shipAddress'" style="width: 600px;" class="detail-txt ellipsis-1" :title="detailForm[subItem.name]">{{ detailForm[subItem.name] || '-'
}}</span>
<span v-else class="detail-txt ellipsis-1" :title="detailForm[subItem.name]">{{ detailForm[subItem.name] || '-'
}}</span>
</el-form-item>
</el-row>
</el-form>
</div>
<div :class="['container', orderRefund ? 'm-b-20' : 'edit-container']">
<p class="edit-title">发货信息</p>
<el-form
label-width="100px"
:inline="true"
>
<el-form-item label="物流信息">
<span>{{ detailForm.deliveryCompany }}&nbsp;&nbsp;&nbsp;{{ detailForm.deliveryNumber }}</span>
</el-form-item>
</el-form>
<div
v-if="orderGoods.length"
class="p-l-40"
>
<table class="show-table">
<tbody>
<tr
v-for="(item, index) in orderGoods"
:key="index"
style="height: 70px;"
>
<td><img
:src="item.goodsImage"
class="img-60"
/></td>
<td>{{ item.goodsName }}</td>
<td>{{ item.specificationData }}</td>
<td>{{ item.activityPrice ? item.activityPrice : item.retailPrice }}元 * {{ item.goodsNumber }}</td>
</tr>
<tr
v-if="detailForm.subOrderCoupon"
style="height: 40px;"
>
<td
style="text-align: left;"
colspan="3"
>优惠券
</td>
<td>{{ detailForm.subOrderCoupon.discountAmount }}元</td>
</tr>
</tbody>
</table>
</div>
</div>
<div
class="container edit-container"
v-if="orderRefund"
>
<p class="edit-title">售后信息</p>
<el-form
label-width="100px"
:inline="true"
>
<el-row
v-for="(item, index) in afterInfoDataRow"
:key="index"
>
<el-form-item
v-for="(subItem, subIndex) in item.rowList"
:key="subIndex"
:label="subItem.label"
>
<span
class="detail-txt ellipsis-1"
:title="orderRefund[subItem.name]"
>{{ orderRefund[subItem.name] || '-' }}</span>
</el-form-item>
</el-row>
</el-form>
<div class="form-img">
<el-form
label-width="100px"
:inline="true"
>
<el-form-item label="售后凭证">
<div class="flex">
<span
v-for="(item, index) in orderRefund.imgUrls"
:key="index"
>
<el-image
class="img-60 comment-img"
:src="item"
:preview-src-list="[item]"
></el-image>
</span>
</div>
</el-form-item>
</el-form>
</div>
</div>
</div>
<GLFooter>
<el-button
@click="handleCancel"
size="medium"
>取消
</el-button>
</GLFooter>
</div>
</template>
<script>
import * as dayjs from 'dayjs'
import {orderManageStatusList, orderSourceList, deliveryTypeList} from '@/common/constant'
export default {
name: 'orderDetail',
data() {
return {
isHmd:true,
size: 'small',
title: '查看订单',
editChildRef: 'editChildRef',
routeInfo: {
orderCode: ''
},
detailForm: {},
orderRefund: null,
orderGoods: [],
// 订单信息
detailFormDataRow: [],
detailFormData: [],
// 售后信息
afterInfoDataRow: [],
afterInfoData: [
{
label: '售后类型',
name: 'refundTypeName'
},
{
label: '申请金额',
name: 'refundPrice'
},
{
label: '申请时间',
name: 'createdDateStr'
},
{
label: '申请描述',
name: 'remark'
},
{
label: '快递公司',
name: 'deliveryCompany'
},
{
label: '快递单号',
name: 'deliveryNumber'
}
// {
// label: '售后凭证',
// name: ''
// }
],
receiveInfoDataRow:[],
receiveInfoData: [
{
label: '收货人',
name: 'contactName'
},
{
label: '收货人电话',
name: 'contactPhone'
},
{
label: '收货地址',
name: 'shipAddress',
},
],
// 基本数据
baseData: {
orderStatusList: orderManageStatusList,
orderSourceList: orderSourceList,
deliveryTypeList: deliveryTypeList,
refundTypeList: [
{confId: '1', confName: '退款退货'},
{confId: '2', confName: '退款不退货'},
{confId: '3', confName: '众筹订单退款'}
],
shareStaffTypeList: [
{confId: '1', confName: '个微'},
{confId: '2', confName: '企微'}
]
},
configShow: false
}
},
created() {
if (window.__POWERED_BY_QIANKUN__) {
//运行在qiankun容器中
this.merchantId = this.$globalState.session.merchantId
}
this.isHmd = this.merchantId == this.$hmdMerchantId
},
mounted() {
this.getCrowdfundingOrderConfig()
},
methods: {
async getCrowdfundingOrderConfig() {
let detailFormData = [
{
label: '订单编号',
name: 'orderCode'
},
{
label: '商户订单号',
name: 'outTradeNo'
},
{
label: '订单时间',
name: 'createdDateStr'
},
{
label: '手机号码',
name: 'customerPhone'
},
{
label: '推荐人',
name: 'shareStaffName'
},
{
label: '推荐人ID',
name: 'shareStaffId'
},
{
label: '推荐人类型',
name: 'shareStaffTypeName'
},
{
label: '车架号',
name: 'vin'
},
{
label: '门店信息',
name: 'merchantName'
},
{
label: '客户名称',
name: 'customerName'
},
{
label: '分润比例',
name: 'takeFee',
suffix: '%'
},
{
label: '订单类型',
name: 'orderSourceName'
},
{
label: '订单状态',
name: 'orderStatusName'
},
{
label: '支付定金',
name: 'payPrice'
},
{
label: '尾款',
name: 'crowdFundingPrice'
},
{
label: '发货地址',
name: 'shipAddress'
},
{
label: '微信名称',
name: 'weChatName'
},
{
label: '活动名称',
name: 'activityName'
},
{
label: '商品名称',
name: 'goodsName'
}
]
const res = await this.$apis.common.getCrowdfundingOrderConfig()
let configShow = res != 1
if (!configShow) {
const filterFormList = ['shareStaffName', 'shareStaffTypeName', 'vin', 'shipAddress']
for (let i = 0; i < detailFormData.length; i++) {
if (filterFormList.includes(detailFormData[i].name)) {
detailFormData.splice(i, 1)
i--
}
}
}
this.configShow = configShow
this.detailFormData = detailFormData
this.setMinHeight('.edit-box')
this.routeInfo = this.$route.query
this.getInfo()
this.formToRow('afterInfoData')
this.formToRow('receiveInfoData')
},
formToRow(formName, numOfRow = 3) {
var rowNum = Math.ceil(this[formName].length / numOfRow)
for (var i = 0; i < rowNum; i++) {
for (var j = 0; j < numOfRow; j++) {
if (j == 0) {
this[formName + 'Row'][i] = {
rowList: []
}
}
if (i * numOfRow + j < this[formName].length) {
this[formName + 'Row'][i].rowList.push(this[formName][i * numOfRow + j])
}
}
}
},
getInfo() {
this.$apis.orderManage.getOrderDetailApi({orderCode: this.routeInfo.orderCode}).then(res => {
this.detailForm = res
this.orderRefund = res.orderRefund || null
if (res.orderSource == 6 || res.orderSource == 7) {
this.detailFormData.find(item => {
if (item.label == '支付定金') {
item.name = 'orderPrice'
}
if (item.label == '尾款') {
item.name = 'finalPaymentAmount'
}
})
}
this.detailForm.createdDateStr = dayjs(this.detailForm.createdDate).format('YYYY-MM-DD HH:mm:ss')
if (this.orderRefund) {
this.orderRefund.refundTypeName = this.baseData.refundTypeList.map(item => item.confId).includes(res.orderRefund.refundType + '') ? this.baseData.refundTypeList.find(item => item.confId == res.orderRefund.refundType).confName : '-'
this.orderRefund.createdDateStr = dayjs(this.orderRefund.createdDate).format('YYYY-MM-DD HH:mm:ss')
this.orderRefund.refundPrice = this.orderRefund.refundPrice + '元'
}
if (this.detailForm.shareStaffType) {
this.detailForm.shareStaffTypeName = this.baseData.shareStaffTypeList.map(item => item.confId).includes(this.detailForm.shareStaffType + '') ? this.baseData.shareStaffTypeList.find(item => item.confId == this.detailForm.shareStaffType).confName : '-'
}
if (this.detailForm.subOrderCoupon) {
this.detailForm.subOrderCoupon.discountAmount = (this.detailForm.subOrderCoupon.discountAmount / 100).toFixed(2)
}
this.orderGoods = res.orderGoods || []
if ((res.crowdFundingPrice || res.crowdFundingPrice == 0) && (res.payPrice || res.payPrice == 0)) {
this.detailForm.crowdFundingPrice = (res.crowdFundingPrice - res.payPrice).toFixed(2) + '元'
}
this.detailForm.payPrice = res.payPrice ? res.payPrice + '元' : '0元'
// 尾款转化为元
if ((res.finalPaymentAmount || res.finalPaymentAmount == 0) && (res.orderPrice || res.orderPrice == 0)) {
this.detailForm.finalPaymentAmount = (res.finalPaymentAmount / 100).toFixed(2) + '元'
}
this.detailForm.orderPrice = res.orderPrice ? res.orderPrice + '元' : '0元'
this.detailForm.orderSourceName = this.baseData.orderSourceList.map(item => item.confId).includes(res.orderSource + '') ? this.baseData.orderSourceList.find(item => item.confId == res.orderSource).confName : '-'
this.detailForm.orderStatusName = this.baseData.orderStatusList.map(item => item.confId).includes(res.orderStatus + '') ? this.baseData.orderStatusList.find(item => item.confId == res.orderStatus).confName : '-'
if (!this.detailForm.takeFee) {
var takeFeeIdx = this.detailFormData.findIndex(item => item.name == 'takeFee')
this.detailFormData.splice(takeFeeIdx, 1)
}
if (res.orderSource == 4) {
let idx = this.detailFormData.findIndex(item => item.name == 'shipAddress')
this.detailFormData.splice(idx, 1)
}
// 其他信息
if (this.configShow) {
var formDescribeObj = {
label: '其他信息',
name: 'formDescribe',
contentName: 'formContent',
attrList: ['First', 'Second']
}
this.detailForm[formDescribeObj.name] = ''
this.detailForm[formDescribeObj.name] = this.detailForm.plateNo ? '车牌号:' + this.detailForm.plateNo + ' ' : ''
this.detailForm[formDescribeObj.name] += this.detailForm.vehicleType ? '品牌车型:' + this.detailForm.vehicleType + ' ' : ''
formDescribeObj.attrList.forEach(item => {
let label = this.detailForm[formDescribeObj.name + item]
let value = this.detailForm[formDescribeObj.contentName + item]
if (label) {
this.detailForm[formDescribeObj.name] += label + ':' + value + ' '
}
})
}
// 商品名称
this.detailForm.goodsName = this.detailForm.orderGoods.length ? this.detailForm.orderGoods.map(item => item.goodsName).join(',') : '-'
this.formToRow('detailFormData')
})
},
handleCancel() {
this.$router.push({
path: '/orderManage/index'
})
}
}
}
</script>
<style>
.marketing.order-detail .el-form--inline .el-form-item {
margin: 0;
}
.marketing.order-detail .el-form--inline .el-form-item__content {
height: 30px;
}
.marketing.order-detail .form-img .el-form--inline .el-form-item__content {
height: auto !important;
}
.marketing.order-detail .flex {
justify-content: flex-start;
}
.marketing.order-detail .row-item {
width: 33%;
}
.detail-txt {
display: inline-block;
width: 220px;
}
.marketing.order-detail .show-table > tbody > tr > td {
text-align: center;
vertical-align: middle;
}
.marketing.order-detail .show-table td {
padding-right: 20px;
}
.order-detail .comment-img {
margin-top: 10px;
margin-right: 20px;
}
</style>
...@@ -10,114 +10,84 @@ ...@@ -10,114 +10,84 @@
fn="新增众筹" fn="新增众筹"
mode="el-button" mode="el-button"
>新建众筹</GLButton> --> >新建众筹</GLButton> -->
<el-button <el-button :size="size"
:size="size" type="default"
type="default" class="default-blue-btn"
class="default-blue-btn" @click="handleJump">订单管理</el-button>
@click="handleJump"
>订单管理</el-button>
</div> </div>
<div class="container"> <div class="container">
<GLCombiForm <GLCombiForm ref="showSearch"
ref="showSearch" :rowNumber="1"
:rowNumber="1" :formObj="searchForm"
:formObj="searchForm" :formData="searchFormData"
:formData="searchFormData" @handleOk="handleSearch"
@handleOk="handleSearch" @handleRest="handleReset"></GLCombiForm>
@handleRest="handleReset"
></GLCombiForm>
<div class="flex m-b-10 w-100-percent"> <div class="flex m-b-10 w-100-percent">
<span class="table-title"></span> <span class="table-title"></span>
<el-button <el-button v-if="configShow"
v-if="configShow" :size="size"
:size="size" class="default-blue-btn"
class="default-blue-btn" type="default"
type="default" @click="handleExport">导出</el-button>
@click="handleExport"
>导出</el-button>
</div> </div>
<!-- 表格区域 开始 --> <!-- 表格区域 开始 -->
<single-gltable <single-gltable ref="activity"
ref="activity" :getListApi="getListApi"
:getListApi="getListApi" :noDataImg="url"
:noDataImg="url" :searchForm="tableSearchForm"
:searchForm="tableSearchForm" :tableParams="tableParams"
:tableParams="tableParams" :pageConf="pageConf"
:pageConf="pageConf" :beforeSearchFn="beforeSearchFn"
:beforeSearchFn="beforeSearchFn" @setTableFinishFun="setTableFinishFun">
@setTableFinishFun="setTableFinishFun" <div slot="activityImg"
> class="table-image"
<div slot-scope="scope">
slot="activityImg" <el-popover placement="top"
class="table-image" width="160"
slot-scope="scope" trigger="hover"
> popper-class="table-popover-block">
<el-popover <img class="table-popover-img"
placement="top" :src="scope.scope.activityImg" />
width="160" <img class="img-60 pointer"
trigger="hover" slot="reference"
popper-class="table-popover-block" :src="scope.scope.activityImg" />
>
<img
class="table-popover-img"
:src="scope.scope.activityImg"
/>
<img
class="img-60 pointer"
slot="reference"
:src="scope.scope.activityImg"
/>
</el-popover> </el-popover>
</div> </div>
<div <div slot="linkText"
slot="linkText" slot-scope="scope">
slot-scope="scope"
>
<template v-if="scope.scope.incrementFlag == 'Y' || !configShow"> <template v-if="scope.scope.incrementFlag == 'Y' || !configShow">
{{scope.scope[scope.prop] || 0 }} {{scope.scope[scope.prop] || 0 }}
</template> </template>
<template v-else> <template v-else>
<p <p class="cursor-pointer"
class="cursor-pointer" @click="handleDetail(scope)">{{ scope.scope[scope.prop] || 0 }}</p>
@click="handleDetail(scope)"
>{{ scope.scope[scope.prop] || 0 }}</p>
</template> </template>
</div> </div>
<div <div slot="joinText"
slot="joinText" slot-scope="scope">
slot-scope="scope" <el-tooltip effect="dark"
> :content="formatterNumber(scope.scope,scope.prop)"
<el-tooltip placement="top">
effect="dark"
:content="formatterNumber(scope.scope,scope.prop)"
placement="top"
>
<div class="line-ellipsis">{{formatterNumber(scope.scope,scope.prop)}}</div> <div class="line-ellipsis">{{formatterNumber(scope.scope,scope.prop)}}</div>
</el-tooltip> </el-tooltip>
</div> </div>
<div <div class="table-btns"
class="table-btns" slot="auth-button"
slot="auth-button" slot-scope="scope">
slot-scope="scope" <GLTableButton :buttonList="tableButtonList"
> :buttonItem="scope.scope"
<GLTableButton :buttonNum="3"></GLTableButton>
:buttonList="tableButtonList"
:buttonItem="scope.scope"
:buttonNum="3"
></GLTableButton>
</div> </div>
</single-gltable> </single-gltable>
<!-- 表格区域 end --> <!-- 表格区域 end -->
</div> </div>
<!-- 众筹分享 --> <!-- 众筹分享 -->
<crowdFundingShare <crowdFundingShare :isShareVisible="isShareVisible"
:isShareVisible="isShareVisible" :shareForm="shareForm"
:shareForm="shareForm" @handleShareClose="handleShareClose"
@handleShareClose="handleShareClose" :hideStatus="!configShow"></crowdFundingShare>
:hideStatus="!configShow"
></crowdFundingShare>
</div> </div>
</template> </template>
...@@ -129,7 +99,7 @@ import url from '@/assets/empty.png' ...@@ -129,7 +99,7 @@ import url from '@/assets/empty.png'
import { exportFn } from '@/common/constant' import { exportFn } from '@/common/constant'
export default { export default {
name: 'crowdFundList', name: 'crowdFundList',
data () { data() {
return { return {
size: 'small', size: 'small',
url: url, url: url,
...@@ -280,7 +250,7 @@ export default { ...@@ -280,7 +250,7 @@ export default {
fn: '数据看板' fn: '数据看板'
}, },
condition: row => { condition: row => {
return this.configShow return this.configShow
}, },
listeners: { listeners: {
click: row => { click: row => {
...@@ -327,13 +297,13 @@ export default { ...@@ -327,13 +297,13 @@ export default {
singleGltable: GLTable singleGltable: GLTable
}, },
mounted () { mounted() {
this.getCrowdfundingOrderConfig() this.getCrowdfundingOrderConfig()
this.getOptionsList('searchFormData') this.getOptionsList('searchFormData')
}, },
methods: { methods: {
async getCrowdfundingOrderConfig () { async getCrowdfundingOrderConfig() {
let tableColumns = [ let tableColumns = [
// { // {
// label: '序号', // label: '序号',
...@@ -475,11 +445,11 @@ export default { ...@@ -475,11 +445,11 @@ export default {
this.channelType = channelType this.channelType = channelType
this.tableParams.tableColumns = tableColumns this.tableParams.tableColumns = tableColumns
}, },
getParams () { getParams() {
var params = JSON.parse(JSON.stringify(this.searchForm)) var params = JSON.parse(JSON.stringify(this.searchForm))
return params return params
}, },
beforeSearchFn () { beforeSearchFn() {
return new Promise(resolve => { return new Promise(resolve => {
this.tableSearchForm = this.getParams() this.tableSearchForm = this.getParams()
// delete this.tableSearchForm.createDate // delete this.tableSearchForm.createDate
...@@ -487,13 +457,15 @@ export default { ...@@ -487,13 +457,15 @@ export default {
}) })
}, },
handleJump (path, row = {}) { handleJump(path, row = {}) {
console.log('111');
this.$router.push({ this.$router.push({
path: '/orderManage/index' path: '/orderManage/index'
}) })
}, },
secondConfirm (title, txt, apiModule, apiName, apiParams, fn) { secondConfirm(title, txt, apiModule, apiName, apiParams, fn) {
this.$confirm(txt, title, { this.$confirm(txt, title, {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
...@@ -519,16 +491,16 @@ export default { ...@@ -519,16 +491,16 @@ export default {
}, },
//开始 //开始
start (item) { start(item) {
this.startOrEndConfirm('开始', item) this.startOrEndConfirm('开始', item)
}, },
//结束 //结束
end (item) { end(item) {
this.startOrEndConfirm('结束', item) this.startOrEndConfirm('结束', item)
}, },
startOrEndConfirm (txt, row) { startOrEndConfirm(txt, row) {
var title = txt var title = txt
var params = {} var params = {}
params.id = row.id params.id = row.id
...@@ -541,26 +513,26 @@ export default { ...@@ -541,26 +513,26 @@ export default {
}, },
//置顶 //置顶
topping (row) { topping(row) {
var params = {} var params = {}
params.id = row.id params.id = row.id
this.secondConfirm('删除', '确定置顶此活动?', 'seckillActivity', 'topActivityApi', params) this.secondConfirm('删除', '确定置顶此活动?', 'seckillActivity', 'topActivityApi', params)
}, },
//删除 //删除
del (row) { del(row) {
var params = {} var params = {}
params.id = row.id params.id = row.id
this.secondConfirm('删除', '确定删除此活动?', 'seckillActivity', 'deleteActivityApi', params) this.secondConfirm('删除', '确定删除此活动?', 'seckillActivity', 'deleteActivityApi', params)
}, },
// 1-新增;2-编辑 // 1-新增;2-编辑
handleEdit (addOrEdit, row) { handleEdit(addOrEdit, row) {
var txtObj = { var txtObj = {
add: '新建', add: '新建',
edit: '编辑', edit: '编辑',
copy: '复制', copy: '复制',
detail: '编辑' detail: '查看'
}[addOrEdit] }[addOrEdit]
var params = { var params = {
addOrEdit: addOrEdit, addOrEdit: addOrEdit,
...@@ -579,7 +551,7 @@ export default { ...@@ -579,7 +551,7 @@ export default {
// console.log(JSON.parse(JSON.stringify(option))) // console.log(JSON.parse(JSON.stringify(option)))
// }, // },
// 明细 // 明细
handleDetail ({ prop, scope }) { handleDetail({ prop, scope }) {
let data = { let data = {
viewAmount: { viewAmount: {
type: 1, type: 1,
...@@ -605,25 +577,25 @@ export default { ...@@ -605,25 +577,25 @@ export default {
}) })
}, },
handleExport () { handleExport() {
var params = this.getParams() var params = this.getParams()
this.$apis.seckillActivity.exportCrowdfundApi(params).then(res => { this.$apis.seckillActivity.exportCrowdfundApi(params).then(res => {
exportFn(res) exportFn(res)
}) })
}, },
handleShare (row) { handleShare(row) {
this.$apis.seckillActivity.getCrowdSharedApi({ id: row.id }).then(res => { this.$apis.seckillActivity.getCrowdSharedApi({ id: row.id }).then(res => {
this.shareForm = res this.shareForm = res
this.handleShareClose() this.handleShareClose()
}) })
}, },
handleShareClose () { handleShareClose() {
this.isShareVisible = !this.isShareVisible this.isShareVisible = !this.isShareVisible
}, },
getOptionsList (formName, hasAll = true, refreshSigle) { getOptionsList(formName, hasAll = true, refreshSigle) {
if (refreshSigle) { if (refreshSigle) {
var item = this[formName].find(k => k.name == refreshSigle) var item = this[formName].find(k => k.name == refreshSigle)
var index = this[formName].findIndex(k => k.name == refreshSigle) var index = this[formName].findIndex(k => k.name == refreshSigle)
...@@ -649,11 +621,11 @@ export default { ...@@ -649,11 +621,11 @@ export default {
} }
}, },
handleSearch () { handleSearch() {
this.$refs.activity.refreshTable() this.$refs.activity.refreshTable()
}, },
handleReset () { handleReset() {
this.searchForm = { this.searchForm = {
activityName: '', activityName: '',
activityStatus: '' activityStatus: ''
...@@ -661,12 +633,12 @@ export default { ...@@ -661,12 +633,12 @@ export default {
this.handleSearch() this.handleSearch()
}, },
setTableFinishFun () { setTableFinishFun() {
//接收到的数据为空 //接收到的数据为空
this.$refs.activity.data.length ? (this.$refs.activity.tableHeightValues = '') : this.$refs.activity.setTableHeightFun() this.$refs.activity.data.length ? (this.$refs.activity.tableHeightValues = '') : this.$refs.activity.setTableHeightFun()
}, },
formatterNumber (cell, key) { formatterNumber(cell, key) {
const str = [] const str = []
cell?.goodsList?.map(e => { cell?.goodsList?.map(e => {
str.push(key != 'activityGoodsStock' ? (e[key] / 100).toFixed(2) : e[key]) str.push(key != 'activityGoodsStock' ? (e[key] / 100).toFixed(2) : e[key])
......
...@@ -3,32 +3,70 @@ ...@@ -3,32 +3,70 @@
<div class="edit-share marketing edit-box edit-activity"> <div class="edit-share marketing edit-box edit-activity">
<div class="container edit-container"> <div class="container edit-container">
<p class="edit-title">{{ title }}秒杀活动</p> <p class="edit-title">{{ title }}秒杀活动</p>
<glsx-combi-form class="edit-form-container" ref="editFormRef" :isEdit="true" :isBlock="true" :formRef="editChildRef" :formObj="editForm" :formData="editFormData" :formRules="editRule"> <glsx-combi-form class="edit-form-container"
<div slot="activityImg" class="edit-tips m-t-8">展示在首页的活动详情页</div> ref="editFormRef"
<template slot="activityTimeHtml" slot-scope="scope"> :isEdit="true"
<el-date-picker v-model="editForm.activityTime" type="datetimerange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" value-format="yyyy-MM-dd HH:mm:ss" :picker-options="pickerOptions" :default-time="['00:00:00', '23:59:59']" :disabled="isDisabled" @change="e => handleTimeChange(e, scope.scope)"></el-date-picker> :isBlock="true"
:formRef="editChildRef"
:formObj="editForm"
:formData="editFormData"
:formRules="editRule">
<div slot="activityImg"
class="edit-tips m-t-8">展示在首页的活动详情页</div>
<template slot="activityTimeHtml"
slot-scope="scope">
<el-date-picker v-model="editForm.activityTime"
type="datetimerange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
value-format="yyyy-MM-dd HH:mm:ss"
:picker-options="pickerOptions"
:default-time="['00:00:00', '23:59:59']"
:disabled="isDisabled"
@change="e => handleTimeChange(e, scope.scope)"></el-date-picker>
</template> </template>
<div slot="goodsHtml"> <div slot="goodsHtml">
<el-button type="default" class="default-blue-btn el-icon-plus" v-if="!isDisabled" :disabled="apear == 'see'" @click="handleRelateProClose">选择商品</el-button> <el-button type="default"
<div v-if="selectedProInfo.id && !specificationDetailList.length" style="margin-top: 10px"> class="default-blue-btn el-icon-plus"
v-if="!isDisabled"
:disabled="apear == 'see'"
@click="handleRelateProClose">选择商品</el-button>
<div v-if="selectedProInfo.id && !specificationDetailList.length"
style="margin-top: 10px">
<p> <p>
<img class="img-60" :src="selectedProInfo.goodsImage" /> <img class="img-60"
&nbsp;&nbsp;&nbsp; 零售价 {{ (selectedProInfo.retailPrice / 100).toFixed(2) }}元 &nbsp;&nbsp;&nbsp; 商品库存 {{ selectedProInfo.goodsStock }}件 :src="selectedProInfo.goodsImage" />
&nbsp;&nbsp;&nbsp; 零售价 {{ (selectedProInfo.retailPrice / 100).toFixed(2) }}元
&nbsp;&nbsp;&nbsp; 商品库存 {{ selectedProInfo.goodsStock }}件
</p> </p>
<el-form-item label="设置秒杀价/元:" prop="activityPrice"> <el-form-item label="设置秒杀价/元:"
<el-input v-model="editForm.activityPrice" style="width: 150px" :disabled="isDisabled"></el-input> prop="activityPrice">
<el-input v-model="editForm.activityPrice"
style="width: 150px"
:disabled="isDisabled"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="活动库存/件:" prop="goodsStock"> <el-form-item label="活动库存/件:"
<el-input v-model="editForm.goodsStock" style="width: 150px" :disabled="isDisabled"></el-input> prop="goodsStock">
<el-input v-model="editForm.goodsStock"
style="width: 150px"
:disabled="isDisabled"></el-input>
</el-form-item> </el-form-item>
</div> </div>
</div> </div>
<div slot="specificationsHtml" v-if="specificationDetailList.length" class="flex" style="min-width: 600px" id="specificationDetailList"> <div slot="specificationsHtml"
v-if="specificationDetailList.length"
class="flex"
style="min-width: 600px"
id="specificationDetailList">
<div style="width: calc(100%)"> <div style="width: calc(100%)">
<table class="table-spesc" style="width: calc(100%)"> <table class="table-spesc"
style="width: calc(100%)">
<tbody> <tbody>
<tr> <tr>
<td :style="{ width: specsWidth }" v-for="(subItem, subIndex) in specificationDetailList" :key="subIndex">{{ subItem.specificationName }}</td> <td :style="{ width: specsWidth }"
v-for="(subItem, subIndex) in specificationDetailList"
:key="subIndex">{{ subItem.specificationName }}</td>
<td :style="{ width: specsWidth }">零售价(元)</td> <td :style="{ width: specsWidth }">零售价(元)</td>
<td :style="{ width: specsWidth }">库存</td> <td :style="{ width: specsWidth }">库存</td>
<td :style="{ width: specsWidth }">设置秒杀价</td> <td :style="{ width: specsWidth }">设置秒杀价</td>
...@@ -36,31 +74,56 @@ ...@@ -36,31 +74,56 @@
</tr> </tr>
</tbody> </tbody>
</table> </table>
<table class="table-spesc" style="max-height: 400px"> <table class="table-spesc"
style="max-height: 400px">
<tbody> <tbody>
<tr style="border-bottom: 1px solid rgb(235, 235, 235)" v-for="(item, index) in nameToValSpecsList" :key="index"> <tr style="border-bottom: 1px solid rgb(235, 235, 235)"
<td :style="{ width: specsWidth }" v-for="(n, idx) in item.specsValueList" :key="idx">{{ n }}</td> v-for="(item, index) in nameToValSpecsList"
:key="index">
<td :style="{ width: specsWidth }"
v-for="(n, idx) in item.specsValueList"
:key="idx">{{ n }}</td>
<td :style="{ width: specsWidth }">{{ item.retailPrice }}元</td> <td :style="{ width: specsWidth }">{{ item.retailPrice }}元</td>
<td :style="{ width: specsWidth }">{{ item.stock }}件</td> <td :style="{ width: specsWidth }">{{ item.stock }}件</td>
<td :style="{ width: specsWidth }"> <td :style="{ width: specsWidth }">
<el-input :disabled="isDisabled" placeholder="秒杀价" style="width: 90%" v-model="item.activityPrice" @input="item.activityPrice = activityPrice_input($event, item.retailPrice)"></el-input> <el-input :disabled="isDisabled"
placeholder="秒杀价"
style="width: 90%"
v-model="item.activityPrice"
@input="item.activityPrice = activityPrice_input($event, item.retailPrice)">
</el-input>
</td> </td>
<td :style="{ width: specsWidth }"> <td :style="{ width: specsWidth }">
<el-input :disabled="isDisabled" placeholder="活动库存" style="width: 90%" v-model="item.goodsStock" @input="item.goodsStock = goodsStock_input($event, item.stock)"></el-input> <el-input :disabled="isDisabled"
placeholder="活动库存"
style="width: 90%"
v-model="item.goodsStock"
@input="item.goodsStock = goodsStock_input($event, item.stock)">
</el-input>
</td> </td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
</div> </div>
</div> </div>
<template slot="limitPurchaseFlag" slot-scope="scope"> <template slot="limitPurchaseFlag"
<el-radio-group v-model="editForm[scope.scope.name]" @change="handleIsLimit"> slot-scope="scope">
<el-radio v-for="(item, index) in scope.scope.optionList" :key="index" :label="item[scope.scope.optionId]" :disabled="isDisabled">{{ item[scope.scope.optionLabel] }}</el-radio> <el-radio-group v-model="editForm[scope.scope.name]"
@change="handleIsLimit">
<el-radio v-for="(item, index) in scope.scope.optionList"
:key="index"
:label="item[scope.scope.optionId]"
:disabled="isDisabled">{{ item[scope.scope.optionLabel] }}</el-radio>
</el-radio-group> </el-radio-group>
<p v-if="editForm[scope.scope.name] == 2" id="limitPurchaseNumber" style="color: #333333;"> <p v-if="editForm[scope.scope.name] == 2"
id="limitPurchaseNumber"
style="color: #333333;">
每人限购 每人限购
<el-form-item prop="limitPurchaseNumber"> <el-form-item prop="limitPurchaseNumber">
<el-input style="width: 150px;" v-model="editForm.limitPurchaseNumber" placeholder="请输入限购次数" :disabled="isDisabled"></el-input> <el-input style="width: 150px;"
v-model="editForm.limitPurchaseNumber"
placeholder="请输入限购次数"
:disabled="isDisabled"></el-input>
</el-form-item> </el-form-item>
件 件
</p> </p>
...@@ -68,19 +131,34 @@ ...@@ -68,19 +131,34 @@
</glsx-combi-form> </glsx-combi-form>
</div> </div>
<div class="wechat-box"> <div class="wechat-box">
<img class="w-100-percent" src="@/assets/wechat-activity.png" /> <img class="w-100-percent"
<img class="wechat-nav" src="@/assets/wechat-nav.png" /> src="@/assets/wechat-activity.png" />
<div v-show="selectedProInfo.goodsImage" class="wechant-banner-img"> <img class="wechat-nav"
<img class="w-100-percent" :src="selectedProInfo.goodsImage" /> src="@/assets/wechat-nav.png" />
<div v-show="selectedProInfo.goodsImage"
class="wechant-banner-img">
<img class="w-100-percent"
:src="selectedProInfo.goodsImage" />
</div> </div>
<p class="wechat-name one-line-ellipsis">{{ editForm.activityName }}</p> <p class="wechat-name one-line-ellipsis">{{ editForm.activityName }}</p>
<p v-show="editForm.limitPurchaseNumber" class="wechat-limit-num one-line-ellipsis">{{ editForm.limitPurchaseNumber }}</p> <p v-show="editForm.limitPurchaseNumber"
class="wechat-limit-num one-line-ellipsis">{{ editForm.limitPurchaseNumber }}</p>
</div> </div>
<GLFooter> <GLFooter>
<el-button @click="handleCancel" size="medium">{{ apear != 'see' ? '取消' : '返回' }}</el-button> <el-button @click="handleCancel"
<el-button v-if="apear != 'see'" type="primary" @click="handleConfirm" size="medium" :loading="loading">提交</el-button> size="medium">{{ apear != 'see' ? '取消' : '返回' }}</el-button>
<el-button v-if="apear != 'see'"
type="primary"
@click="handleConfirm"
size="medium"
:loading="loading">提交</el-button>
</GLFooter> </GLFooter>
<select-single-pro-dialog v-if="isSingleSelectVisible" :isSingleSelectVisible="isSingleSelectVisible" :selectedProInfo="selectedProInfo" @handleSingleSelectConfirm="handleSingleSelectConfirm" @handleSingleSelectClose="handleSingleSelectClose(true)"></select-single-pro-dialog> <select-single-pro-dialog v-if="isSingleSelectVisible"
:isSingleSelectVisible="isSingleSelectVisible"
:selectedProInfo="selectedProInfo"
@handleSingleSelectConfirm="handleSingleSelectConfirm"
@handleSingleSelectClose="handleSingleSelectClose(true)">
</select-single-pro-dialog>
</div> </div>
</template> </template>
......
...@@ -2,27 +2,58 @@ ...@@ -2,27 +2,58 @@
<template> <template>
<div class="marketing"> <div class="marketing">
<div class="m-b-20"> <div class="m-b-20">
<GLButton :size="size" class="el-icon-plus" type="primary" @click="addActivity()" fn="新增秒杀活动" mode="el-button">新增秒杀活动</GLButton> <GLButton :size="size"
class="el-icon-plus"
type="primary"
@click="addActivity()"
fn="新增秒杀活动"
mode="el-button">新增秒杀活动</GLButton>
</div> </div>
<div class="container"> <div class="container">
<GLCombiForm ref="showSearch" :rowNumber="1" :formObj="searchForm" :formData="searchFormData" @handleOk="handleSearch" @handleRest="handleReset"></GLCombiForm> <GLCombiForm ref="showSearch"
:rowNumber="1"
:formObj="searchForm"
:formData="searchFormData"
@handleOk="handleSearch"
@handleRest="handleReset"></GLCombiForm>
<!-- 表格区域 开始 --> <!-- 表格区域 开始 -->
<GLTable ref="activity" :getListApi="getListApi" :noDataImg="url" :searchForm="tableSearchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn" @setTableFinishFun="setTableFinishFun"> <GLTable ref="activity"
<div slot="activityImg" class="table-image" slot-scope="scope"> :getListApi="getListApi"
<el-popover placement="top" width="160" trigger="hover" popper-class="table-popover-block"> :noDataImg="url"
<img class="table-popover-img" :src="scope.scope.activityImg" /> :searchForm="tableSearchForm"
<img class="img-60 pointer" slot="reference" :src="scope.scope.activityImg" /> :tableParams="tableParams"
:pageConf="pageConf"
:beforeSearchFn="beforeSearchFn"
@setTableFinishFun="setTableFinishFun">
<div slot="activityImg"
class="table-image"
slot-scope="scope">
<el-popover placement="top"
width="160"
trigger="hover"
popper-class="table-popover-block">
<img class="table-popover-img"
:src="scope.scope.activityImg" />
<img class="img-60 pointer"
slot="reference"
:src="scope.scope.activityImg" />
</el-popover> </el-popover>
</div> </div>
<div class="table-btns" slot="auth-button" slot-scope="scope"> <div class="table-btns"
<GLTableButton :buttonList="tableButtonList" :buttonItem="scope.scope" :buttonNum="3"></GLTableButton> slot="auth-button"
slot-scope="scope">
<GLTableButton :buttonList="tableButtonList"
:buttonItem="scope.scope"
:buttonNum="3"></GLTableButton>
</div> </div>
</GLTable> </GLTable>
<!-- 表格区域 end --> <!-- 表格区域 end -->
</div> </div>
<!-- 分享 --> <!-- 分享 -->
<share-dialog :isShareVisible="isShareVisible" :shareForm="shareForm" @handleShareClose="handleShareClose"></share-dialog> <share-dialog :isShareVisible="isShareVisible"
:shareForm="shareForm"
@handleShareClose="handleShareClose"></share-dialog>
</div> </div>
</template> </template>
......
<!-- 编辑sop --> <!-- 编辑sop -->
<template> <template>
<div class="marketing edit-box" v-loading="marketingSOPLoading"> <div class="marketing edit-box"
v-loading="marketingSOPLoading">
<div class="sop-base-info"> <div class="sop-base-info">
<div class="container m-b-20"> <div class="container m-b-20">
<p class="edit-title">{{ title }}</p> <p class="edit-title">{{ title }}</p>
<div> <div>
<glsx-combi-form class="edit-form-container m-r-20" ref="editFormRef" :isEdit="isEdit" <glsx-combi-form class="edit-form-container m-r-20"
:labelWidth="labelWidth" :isBlock="true" :formRef="editChildRef" :formObj="editForm" ref="editFormRef"
:formData="editFormData" :formRules="editRule"> :isEdit="isEdit"
:labelWidth="labelWidth"
:isBlock="true"
:formRef="editChildRef"
:formObj="editForm"
:formData="editFormData"
:formRules="editRule">
<div slot="startDate"> <div slot="startDate">
<el-input class="w432" <el-input class="w432"
:placeholder="!editForm.eventList.length ? '设置营销事件后自动补充' : editForm.startDate + (editForm.endDate ? ' - ' + editForm.endDate : '')" :placeholder="!editForm.eventList.length ? '设置营销事件后自动补充' : editForm.startDate + (editForm.endDate ? ' - ' + editForm.endDate : '')"
disabled></el-input> disabled></el-input>
</div> </div>
<!-- <div v-if="editForm.sopType =='1'">--> <!-- <div v-if="editForm.sopType =='1'">-->
<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-group v-model="editForm[scope.scope.name]"
<el-radio v-for="(item, index) in handleTypeSelect(scope.scope.customerRadioList)" :key="index" @change="handleCustTypeChange">
<el-radio v-for="(item, index) in handleTypeSelect(scope.scope.customerRadioList)"
:key="index"
:label="item.confId"> :label="item.confId">
{{ item.confName }} {{ item.confName }}
</el-radio> </el-radio>
</el-radio-group> </el-radio-group>
</div> </div>
<div v-for="(item, pIdx) in customerDataList" :key="pIdx"> <div v-for="(item, pIdx) in customerDataList"
:key="pIdx">
<div v-show="item.confId == editForm[scope.scope.name]"> <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" <el-button v-show="item.list.length == 0"
class="default-blue-btn el-icon-plus"
:size="size"
@click="handleSelectCustomer(pIdx)">去选择 @click="handleSelectCustomer(pIdx)">去选择
</el-button> </el-button>
<!-- <div v-show="editForm.customerInfoList.length != 0" class="customer-box m-t-10"> --> <!-- <div v-show="editForm.customerInfoList.length != 0" class="customer-box m-t-10"> -->
<div v-show="item.list.length != 0"> <div v-show="item.list.length != 0">
<div class="customer-box m-t-10"> <div class="customer-box m-t-10">
<div class="customer-title" v-if="editForm.sopType==1">{{ item.confName }}客户 <div class="customer-title"
v-if="editForm.sopType==1">{{ item.confName }}客户
:预估{{ item.customerCount }}人 :预估{{ item.customerCount }}人
</div> </div>
<div class="customer-title" v-if="editForm.sopType==2">标签群聊 :预估{{ <div class="customer-title"
v-if="editForm.sopType==2">标签群聊 :预估{{
item.customerCount item.customerCount
}}个 }}个
</div> </div>
<div :key="key" class="el-input-tag input-tag-wrapper"> <div :key="key"
class="el-input-tag input-tag-wrapper">
<template v-if="item.confName == '标签' || item.confName == '群标签'"> <template v-if="item.confName == '标签' || item.confName == '群标签'">
<div v-for="(subItem, subIdx) in item.list" :key="subIdx"> <div v-for="(subItem, subIdx) in item.list"
<el-tag v-for="(k, n) in subItem.labelList" :key="n" class="customer-tag" :size="size" :key="subIdx">
type="info" :closable="!scope.scope.isDisabled" :disable-transitions="false" <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)"> @close="handleDeleteCustomer(n, subIdx, item.confName)">
<span>{{ subItem.labelGroup.name }}:{{ k.name }}</span> <span>{{ subItem.labelGroup.name }}:{{ k.name }}</span>
</el-tag> </el-tag>
</div> </div>
</template> </template>
<template v-else> <template v-else>
<el-tag v-for="(subItem, subIdx) in item.list" :key="subIdx" class="customer-tag" :size="size" <el-tag v-for="(subItem, subIdx) in item.list"
type="info" :closable="!scope.scope.isDisabled" :disable-transitions="false" :key="subIdx"
class="customer-tag"
:size="size"
type="info"
:closable="!scope.scope.isDisabled"
:disable-transitions="false"
@close="handleDeleteCustomer(subIdx)"> @close="handleDeleteCustomer(subIdx)">
<!-- <i class="el-icon-user-solid"></i> --> <!-- <i class="el-icon-user-solid"></i> -->
<span>{{ subItem[item.listConf.confName] || subItem[item.listConf.otherConfName] }}</span> <span>{{ subItem[item.listConf.confName] || subItem[item.listConf.otherConfName] }}</span>
...@@ -60,8 +87,12 @@ ...@@ -60,8 +87,12 @@
</template> </template>
</div> </div>
</div> </div>
<el-button v-if="!editDisabled" type="text" @click="handleSelectCustomer(pIdx)">编辑</el-button> <el-button v-if="!editDisabled"
<el-button v-if="!editDisabled" type="text" @click="handleResetCustomer(pIdx)">重置</el-button> 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>
...@@ -71,67 +102,92 @@ ...@@ -71,67 +102,92 @@
</div> </div>
</div> </div>
<!-- 营销事件设置--> <!-- 营销事件设置-->
<div class="container edit-container" v-loading="marketingEventLoading"> <div class="container edit-container"
<div class="edit-title flex" style="align-items: center"> v-loading="marketingEventLoading">
<div class="edit-title flex"
style="align-items: center">
<p>营销事件设置</p> <p>营销事件设置</p>
<el-tooltip <el-tooltip :disabled="!(!(editForm.customerInfoList && editForm.customerInfoList.length) || !editForm.sopName)"
:disabled="!(!(editForm.customerInfoList && editForm.customerInfoList.length) || !editForm.sopName)" effect="dark"
effect="dark" content="请先完善sop名称和营销对象"
content="请先完善sop名称和营销对象" placement="top"> placement="top">
<div> <div>
<el-button class="m-r-20" <el-button class="m-r-20"
:disabled="!(editForm.customerInfoList && editForm.customerInfoList.length) || !editForm.sopName" :disabled="!(editForm.customerInfoList && editForm.customerInfoList.length) || !editForm.sopName"
:size="size" :size="size"
type="primary" @click="handleEventEdit('add')">添加事件 type="primary"
@click="handleEventEdit('add')">添加事件
</el-button> </el-button>
</div> </div>
</el-tooltip> </el-tooltip>
</div> </div>
<div v-show="!editForm.eventList.length" class="event-empty"> <div v-show="!editForm.eventList.length"
<img class="empty-img" :src="url"/> class="event-empty">
<img class="empty-img"
:src="url" />
<p class="empty-txt">暂无营销事件</p> <p class="empty-txt">暂无营销事件</p>
</div> </div>
<div v-show="editForm.eventList.length" class="event-box"> <div v-show="editForm.eventList.length"
<div class="event-item" v-for="(item, index) in editForm.eventList" :key="index"> class="event-box">
<div class="event-item"
v-for="(item, index) in editForm.eventList"
:key="index">
<div class="flex-default event-title"> <div class="flex-default event-title">
<p :class="{ 'm-r-10': true, editFlag: !item.eventStartDate }"> <p :class="{ 'm-r-10': true, editFlag: !item.eventStartDate }">
{{ item.eventStartDate ? item.eventStartDate : '请点击“编辑”完善事件的营销时间' }} {{ item.eventStartDate ? item.eventStartDate : '请点击“编辑”完善事件的营销时间' }}
</p> </p>
<p class="m-r-20">{{ item.eventTime }}</p> <p class="m-r-20">{{ item.eventTime }}</p>
<p class="m-r-20" v-show="item.repeatFlag == 'Y' && item.repeatMode == 1">每天重复循环至</p> <p class="m-r-20"
<p class="m-r-20" v-show="item.repeatFlag == 'Y' && item.repeatMode == 2">每周{{ v-show="item.repeatFlag == 'Y' && item.repeatMode == 1">每天重复循环至</p>
<p class="m-r-20"
v-show="item.repeatFlag == 'Y' && item.repeatMode == 2">每周{{
item.repeatTime item.repeatTime
}}重复循环至</p> }}重复循环至</p>
<p class="m-r-20" v-show="item.repeatFlag == 'Y' && item.repeatMode == 3">每月{{ <p class="m-r-20"
v-show="item.repeatFlag == 'Y' && item.repeatMode == 3">每月{{
item.repeatTime item.repeatTime
}}重复循环至</p> }}重复循环至</p>
<p class="m-r-20" v-show="item.repeatFlag == 'Y'">{{ item.eventEndDate }}</p> <p class="m-r-20"
<p class="m-r-20 txt-blue" v-if='editForm.sopType== 1'> v-show="item.repeatFlag == 'Y'">{{ item.eventEndDate }}</p>
<p class="m-r-20 txt-blue"
v-if='editForm.sopType== 1'>
{{ baseData.channelTypeList.find(k => k.confId == item.pushChannelType).confName }} {{ baseData.channelTypeList.find(k => k.confId == item.pushChannelType).confName }}
</p> </p>
<p class="m-r-20 txt-blue" v-if='editForm.sopType== 2'> <p class="m-r-20 txt-blue"
v-if='editForm.sopType== 2'>
企微群推送 企微群推送
</p> </p>
</div> </div>
<div> <div>
<div v-for="(obj, index) in backupContentJson(item.backupContent)" :key="index"> <div v-for="(obj, index) in backupContentJson(item.backupContent)"
<div class="textHidden" :title="obj.attContent" v-if="obj.attType == 1" :key="index">
<div class="textHidden"
:title="obj.attContent"
v-if="obj.attType == 1"
v-html="tramWord(obj.attContent)"></div> v-html="tramWord(obj.attContent)"></div>
</div> </div>
<div class="event-inline" v-for="(obj, index) in backupContentJson(item.backupContent)" :key="index"> <div class="event-inline"
v-for="(obj, index) in backupContentJson(item.backupContent)"
:key="index">
<div> <div>
<div v-if="obj.attType == 2"> <div v-if="obj.attType == 2">
<img class="model-item-img" :src="obj.attContent" alt/> <img class="model-item-img"
:src="obj.attContent"
alt />
</div> </div>
<div v-if="obj.attType == 3"> <div v-if="obj.attType == 3">
<video class="model-item-img" :src="obj.attContent" controls="controls"/> <video class="model-item-img"
:src="obj.attContent"
controls="controls" />
</div> </div>
<div v-if="obj.attType == 6"> <div v-if="obj.attType == 6">
<div class="welcome-activity-panel"> <div class="welcome-activity-panel">
<div class="welcome-activity-box"> <div class="welcome-activity-box">
<img src="@/assets/welcomeWord/material-icon.png" alt=""/> <img src="@/assets/welcomeWord/material-icon.png"
alt="" />
<div class="welcome-activity-desc"> <div class="welcome-activity-desc">
<div class="model-item-title">{{ backupContentJson(obj.attContent).fileName }}</div> <div class="model-item-title">
{{ backupContentJson(obj.attContent).fileName }}</div>
</div> </div>
</div> </div>
</div> </div>
...@@ -140,31 +196,37 @@ ...@@ -140,31 +196,37 @@
<div v-if="obj.attType == 7 || obj.attType == 4"> <div v-if="obj.attType == 7 || obj.attType == 4">
<div class="welcome-activity-panel"> <div class="welcome-activity-panel">
<div class="welcome-activity-box"> <div class="welcome-activity-box">
<img src="@/assets/welcomeWord/activity-icon.png" alt=""/> <img src="@/assets/welcomeWord/activity-icon.png"
alt="" />
<div class="welcome-activity-desc"> <div class="welcome-activity-desc">
<template v-if="marketingContentJSON(obj).selectType == 'card'"> <template v-if="marketingContentJSON(obj).selectType == 'card'">
<div class="model-item-title" :title="marketingContentJSON(obj).equityName"> <div class="model-item-title"
:title="marketingContentJSON(obj).equityName">
{{ marketingContentJSON(obj).equityName }} {{ marketingContentJSON(obj).equityName }}
</div> </div>
</template> </template>
<template v-else-if="marketingContentJSON(obj).selectType == 'package'"> <template v-else-if="marketingContentJSON(obj).selectType == 'package'">
<div class="model-item-title" :title="marketingContentJSON(obj).packageName"> <div class="model-item-title"
:title="marketingContentJSON(obj).packageName">
{{ marketingContentJSON(obj).packageName }} {{ marketingContentJSON(obj).packageName }}
</div> </div>
</template> </template>
<template v-else-if="marketingContentJSON(obj).selectType == 'coupon'"> <template v-else-if="marketingContentJSON(obj).selectType == 'coupon'">
<div class="model-item-title" :title="marketingContentJSON(obj).couponName"> <div class="model-item-title"
:title="marketingContentJSON(obj).couponName">
{{ marketingContentJSON(obj).couponName }} {{ marketingContentJSON(obj).couponName }}
</div> </div>
</template> </template>
<template <template
v-else-if="marketingContentJSON(obj).selectType == 'activity'|| marketingContentJSON(obj).selectType == 'crowdfunding'"> v-else-if="marketingContentJSON(obj).selectType == 'activity'|| marketingContentJSON(obj).selectType == 'crowdfunding'">
<div class="model-item-title" :title="marketingContentJSON(obj).activityName"> <div class="model-item-title"
:title="marketingContentJSON(obj).activityName">
{{ marketingContentJSON(obj).activityName }} {{ marketingContentJSON(obj).activityName }}
</div> </div>
</template> </template>
<template v-else> <template v-else>
<div class="model-item-title" :title="marketingContentJSON(obj.attContent).couponName"> <div class="model-item-title"
:title="marketingContentJSON(obj.attContent).couponName">
{{ marketingContentJSON(obj).equityName }} {{ marketingContentJSON(obj).equityName }}
</div> </div>
</template> </template>
...@@ -271,19 +333,21 @@ ...@@ -271,19 +333,21 @@
</div> </div>
</div> </div>
<div class="event-btns"> <div class="event-btns">
<el-button <el-button v-if="new Date(item.eventStartDate) <= new Date() && routeInfo.addOrEdit !== 'copy' && routeInfo.addOrEdit !== 'add'"
v-if="new Date(item.eventStartDate) <= new Date() && routeInfo.addOrEdit !== 'copy' && routeInfo.addOrEdit !== 'add'" type="primary"
type="primary" size="small" size="small"
@click="handleEventView(item)">查看 @click="handleEventView(item)">查看
</el-button> </el-button>
<el-button v-if="new Date(item.eventStartDate) > new Date() || routeInfo.addOrEdit == 'copy'" <el-button v-if="new Date(item.eventStartDate) > new Date() || routeInfo.addOrEdit == 'copy'"
class="default newBtnSty" :size="size" @click="handleEventDelete(index)">删除 class="default newBtnSty"
:size="size"
@click="handleEventDelete(index)">删除
</el-button> </el-button>
<el-tooltip <el-tooltip :disabled="!(!(editForm.customerInfoList && editForm.customerInfoList.length) || !editForm.sopName)"
:disabled="!(!(editForm.customerInfoList && editForm.customerInfoList.length) || !editForm.sopName)" effect="dark"
effect="dark" content="请先完善sop名称和营销对象"
content="请先完善sop名称和营销对象" placement="top"> placement="top">
<div> <div>
<el-button class="default-blue-btn newBtnSty" <el-button class="default-blue-btn newBtnSty"
v-if="new Date(item.eventStartDate) > new Date() || !item.eventStartDate" v-if="new Date(item.eventStartDate) > new Date() || !item.eventStartDate"
...@@ -296,20 +360,29 @@ ...@@ -296,20 +360,29 @@
</div> </div>
</div> </div>
</div> </div>
<div v-show="!editForm.eventList.length && submit" class="red-txt">请创建营销事件</div> <div v-show="!editForm.eventList.length && submit"
class="red-txt">请创建营销事件</div>
</div> </div>
</div> </div>
<GLFooter> <GLFooter>
<el-button @click="handleCancel" size="medium">取消</el-button> <el-button @click="handleCancel"
<el-button type="primary" @click="handleConfirm" size="medium" :loading="loading">提交</el-button> size="medium">取消</el-button>
<el-button type="primary"
@click="handleConfirm"
size="medium"
:loading="loading">提交</el-button>
</GLFooter> </GLFooter>
<select-Crowd v-if="isCrowdCustVisible" :dialogVisible="isCrowdCustVisible" <select-Crowd v-if="isCrowdCustVisible"
:dialogVisible="isCrowdCustVisible"
:selectedCrowdList="JSON.parse(JSON.stringify(customerDataList[0].list))" :selectedCrowdList="JSON.parse(JSON.stringify(customerDataList[0].list))"
@handleCrowdCustClose="handleCrowdCustClose" @handleCrowdCustClose="handleCrowdCustClose"
@handleCrowdCustConfirm="handleDialogConfirm"></select-Crowd> @handleCrowdCustConfirm="handleDialogConfirm"></select-Crowd>
<select-tag ref="selectTagForm" :isGroupTag="isGroupTag" @tagSelected="handleDialogConfirm" <select-tag ref="selectTagForm"
:isGroupTag="isGroupTag"
@tagSelected="handleDialogConfirm"
:dialogVisible="isTagVisible"></select-tag> :dialogVisible="isTagVisible"></select-tag>
<select-customer v-if="isAppointCustVisible" :dialogVisible="isAppointCustVisible" <select-customer v-if="isAppointCustVisible"
:dialogVisible="isAppointCustVisible"
:parentSelectedCustomerList="customerDataList[2].list" :parentSelectedCustomerList="customerDataList[2].list"
@handleAppointCustClose="handleAppointCustClose" @handleAppointCustClose="handleAppointCustClose"
@handleAppointCustConfirm="handleDialogConfirm"></select-customer> @handleAppointCustConfirm="handleDialogConfirm"></select-customer>
...@@ -415,11 +488,11 @@ export default { ...@@ -415,11 +488,11 @@ export default {
eventList: [] eventList: []
}, },
editRule: { editRule: {
sopName: [{required: true, message: '请输入SOP名称', trigger: 'change'}], sopName: [{ required: true, message: '请输入SOP名称', trigger: 'change' }],
customerOptUpdate: [{required: true, message: '请选择更新人群', trigger: 'change'}], customerOptUpdate: [{ required: true, message: '请选择更新人群', trigger: 'change' }],
customerOptType: [{required: true, message: '请选择有效对象', trigger: 'change'}], customerOptType: [{ required: true, message: '请选择有效对象', trigger: 'change' }],
customerInfoList: [{required: true, message: '请选择营销对象', trigger: 'change'}], customerInfoList: [{ required: true, message: '请选择营销对象', trigger: 'change' }],
sopType: [{required: true, message: '请选择类型', trigger: 'change'}] sopType: [{ required: true, message: '请选择类型', trigger: 'change' }]
}, },
isEdit: true, isEdit: true,
editFormData: [ editFormData: [
...@@ -461,7 +534,7 @@ export default { ...@@ -461,7 +534,7 @@ export default {
callback: action => { callback: action => {
if (action == 'confirm') { if (action == 'confirm') {
this.editForm.customerOptType = val == 1 ? '' : 4 this.editForm.customerOptType = val == 1 ? '' : 4
if (hasList){ if (hasList) {
this.customerDataList[this.currentCustomerIdx].list = [] this.customerDataList[this.currentCustomerIdx].list = []
this.changeCustomer() this.changeCustomer()
} }
...@@ -609,13 +682,13 @@ export default { ...@@ -609,13 +682,13 @@ export default {
async getTheMaterialActivityCollection() { async getTheMaterialActivityCollection() {
await this.$apis.welcomeword await this.$apis.welcomeword
.getMaterialListApi({ .getMaterialListApi({
pageNum: 1, pageNum: 1,
pageSize: 100000, pageSize: 100000,
merchant: this.$globalState.session.merchantId, merchant: this.$globalState.session.merchantId,
status: 0 status: 0
}) })
.then(res => (this.materialGroupSet = res.data)) .then(res => (this.materialGroupSet = res.data))
}, },
async getEachActivity(interfaceName) { async getEachActivity(interfaceName) {
...@@ -678,7 +751,7 @@ export default { ...@@ -678,7 +751,7 @@ export default {
} }
}, },
judgeDisable() { judgeDisable() {
var list = ['sopName', 'customerOptType', 'customerOptUpdate','sopType'] var list = ['sopName', 'customerOptType', 'customerOptUpdate', 'sopType']
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
...@@ -788,27 +861,27 @@ export default { ...@@ -788,27 +861,27 @@ export default {
this.marketingEventLoading = true this.marketingEventLoading = true
let backUpContent = [] let backUpContent = []
// 文本 // 文本
backUpContent.push({attType: 1, attContent: item.eventContent}) backUpContent.push({ attType: 1, attContent: item.eventContent })
// 图片 // 图片
if (item.additionalType == 5 && item.objectType == 11) { if (item.additionalType == 5 && item.objectType == 11) {
let imgResourceList = item.object && item.object.result.map(img => img.content) let imgResourceList = item.object && item.object.result.map(img => img.content)
imgResourceList.forEach(resource => { imgResourceList.forEach(resource => {
backUpContent.push({attType: 2, attContent: resource}) backUpContent.push({ attType: 2, attContent: resource })
}) })
} }
// 视频 // 视频
if (item.additionalType == 5 && item.objectType == 12) { if (item.additionalType == 5 && item.objectType == 12) {
let videoResourceList = item.object && item.object.result.map(img => img.content) let videoResourceList = item.object && item.object.result.map(img => img.content)
backUpContent.push({attType: 3, attContent: videoResourceList}) backUpContent.push({ attType: 3, attContent: videoResourceList })
} }
// 活动-权益卡试用 // 活动-权益卡试用
if (item.additionalType == 2 && item.objectType == 6) { if (item.additionalType == 2 && item.objectType == 6) {
await this.getEachActivity('merchant') await this.getEachActivity('merchant')
let activity = this.equityCardCollection && this.equityCardCollection.filter(it => it.equityClassId == item.objectId) let activity = this.equityCardCollection && this.equityCardCollection.filter(it => it.equityClassId == item.objectId)
let {effectivedDay, equityClassId, effectiveType, equityName, freeDay} = activity[0] let { effectivedDay, equityClassId, effectiveType, equityName, freeDay } = activity[0]
backUpContent.push({ backUpContent.push({
attType: 7, attType: 7,
attContent: { attContent: {
...@@ -830,7 +903,7 @@ export default { ...@@ -830,7 +903,7 @@ export default {
if (item.additionalType == 2 && item.objectType == 7) { if (item.additionalType == 2 && item.objectType == 7) {
await this.getEachActivity('getPackage') await this.getEachActivity('getPackage')
let getPackage = this.equityPackageCollection && this.equityPackageCollection.filter(it => it.id == item.objectId) let getPackage = this.equityPackageCollection && this.equityPackageCollection.filter(it => it.id == item.objectId)
let {id, packagePrice, packageName} = getPackage[0] let { id, packagePrice, packageName } = getPackage[0]
backUpContent.push({ backUpContent.push({
attType: 7, attType: 7,
attContent: { attContent: {
...@@ -850,7 +923,7 @@ export default { ...@@ -850,7 +923,7 @@ export default {
if (item.additionalType == 3 && item.objectType == 5) { if (item.additionalType == 3 && item.objectType == 5) {
await this.getEachActivity('getMerchant') await this.getEachActivity('getMerchant')
let coupon = this.mallCouponCollection && this.mallCouponCollection.filter(it => it.id == item.objectId) let coupon = this.mallCouponCollection && this.mallCouponCollection.filter(it => it.id == item.objectId)
let {id, couponName, effectiveType, residueAmount} = coupon[0] let { id, couponName, effectiveType, residueAmount } = coupon[0]
backUpContent.push({ backUpContent.push({
attType: 7, attType: 7,
attContent: { attContent: {
...@@ -871,7 +944,7 @@ export default { ...@@ -871,7 +944,7 @@ export default {
if (item.additionalType == 2 && item.objectType == 8) { if (item.additionalType == 2 && item.objectType == 8) {
await this.getEachActivity('getActivity') await this.getEachActivity('getActivity')
let activity = this.seckillActivitySet && this.seckillActivitySet.filter(it => it.id == item.objectId) let activity = this.seckillActivitySet && this.seckillActivitySet.filter(it => it.id == item.objectId)
let {id, activityName, startTime, endTime} = activity[0] let { id, activityName, startTime, endTime } = activity[0]
backUpContent.push({ backUpContent.push({
attType: 7, attType: 7,
attContent: { attContent: {
...@@ -891,7 +964,7 @@ export default { ...@@ -891,7 +964,7 @@ export default {
// 素材 // 素材
if (item.additionalType == 1 && item.objectType == 10) { if (item.additionalType == 1 && item.objectType == 10) {
let material = this.materialGroupSet && this.materialGroupSet.filter(it => it.id == item.objectId) let material = this.materialGroupSet && this.materialGroupSet.filter(it => it.id == item.objectId)
let {id, materialContentRpcResponse} = material[0] let { id, materialContentRpcResponse } = material[0]
let detail = { let detail = {
fileName: materialContentRpcResponse.materialName, fileName: materialContentRpcResponse.materialName,
objectId: id, objectId: id,
...@@ -911,15 +984,15 @@ export default { ...@@ -911,15 +984,15 @@ export default {
getInfo() { getInfo() {
this.marketingSOPLoading = true this.marketingSOPLoading = true
this.$apis.sop.getSopInfoDetailApi({sopId: this.routeInfo.id}).then(async res => { this.$apis.sop.getSopInfoDetailApi({ sopId: this.routeInfo.id }).then(async res => {
this.marketingSOPLoading = false this.marketingSOPLoading = false
if (this.routeInfo.addOrEdit == 'copy') { if (this.routeInfo.addOrEdit == 'copy') {
this.editForm.sopType = res.sopType this.editForm.sopType = res.sopType
res.eventList && res.eventList &&
res.eventList.map(item => { res.eventList.map(item => {
item.eventStartDate = '' item.eventStartDate = ''
item.eventTime = '' item.eventTime = ''
}) })
// 判断有没有旧数据 // 判断有没有旧数据
await this.processOldSOPData(res).then(res => { await this.processOldSOPData(res).then(res => {
this.marketingEventLoading = false this.marketingEventLoading = false
...@@ -960,18 +1033,18 @@ export default { ...@@ -960,18 +1033,18 @@ export default {
delFlag: 0 delFlag: 0
} }
this.customerDataList[this.currentCustomerIdx].list && this.customerDataList[this.currentCustomerIdx].list &&
this.customerDataList[this.currentCustomerIdx].list.forEach(item => { this.customerDataList[this.currentCustomerIdx].list.forEach(item => {
item.labelList.length && item.labelList.length &&
item.labelList.forEach(subItem => { item.labelList.forEach(subItem => {
params.tagLists.push({ params.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.$apis.sop.getCustomerByGroupTagListApi(params).then(res => { this.$apis.sop.getCustomerByGroupTagListApi(params).then(res => {
this.customerDataList[this.currentCustomerIdx].customerCount = res.count this.customerDataList[this.currentCustomerIdx].customerCount = res.count
}) })
...@@ -985,18 +1058,18 @@ export default { ...@@ -985,18 +1058,18 @@ export default {
tagLists: [] tagLists: []
} }
this.customerDataList[this.currentCustomerIdx].list && this.customerDataList[this.currentCustomerIdx].list &&
this.customerDataList[this.currentCustomerIdx].list.forEach(item => { this.customerDataList[this.currentCustomerIdx].list.forEach(item => {
item.labelList.length && item.labelList.length &&
item.labelList.forEach(subItem => { item.labelList.forEach(subItem => {
params.tagLists.push({ params.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.$apis.sop.getCustomerByTagListApi(params).then(res => { this.$apis.sop.getCustomerByTagListApi(params).then(res => {
this.customerDataList[this.currentCustomerIdx].customerCount = res.count this.customerDataList[this.currentCustomerIdx].customerCount = res.count
}) })
...@@ -1025,9 +1098,9 @@ export default { ...@@ -1025,9 +1098,9 @@ export default {
} }
this.$nextTick(() => { this.$nextTick(() => {
this.$set(this.editForm, 'customerInfoList', JSON.parse(JSON.stringify(this.customerDataList[this.currentCustomerIdx].list))) this.$set(this.editForm, 'customerInfoList', JSON.parse(JSON.stringify(this.customerDataList[this.currentCustomerIdx].list)))
this.$refs.editFormRef && this.$refs.editFormRef.$refs[this.editChildRef].validateField('customerInfoList') this.$refs.editFormRef && this.$refs.editFormRef.$refs[this.editChildRef].validateField('customerInfoList')
} }
) )
...@@ -1176,7 +1249,7 @@ export default { ...@@ -1176,7 +1249,7 @@ export default {
}, },
handleEventView(item) { handleEventView(item) {
this.$router.push({path: '/sop/viewEvent', query: {info: item, sopType: this.editForm.sopType}}); this.$router.push({ path: '/sop/viewEvent', query: { info: item, sopType: this.editForm.sopType } });
}, },
handleEventEdit(addOrEdit, row, idx) { handleEventEdit(addOrEdit, row, idx) {
let currentCustObj = JSON.parse(JSON.stringify(this.customerDataList[this.currentCustomerIdx])) let currentCustObj = JSON.parse(JSON.stringify(this.customerDataList[this.currentCustomerIdx]))
...@@ -1197,7 +1270,7 @@ export default { ...@@ -1197,7 +1270,7 @@ export default {
addOrEdit: addOrEdit, addOrEdit: addOrEdit,
eventIndex: addOrEdit == 'add' ? '-1' : idx, eventIndex: addOrEdit == 'add' ? '-1' : idx,
parentCustomerObj: this.parentCustomerObj, parentCustomerObj: this.parentCustomerObj,
info: {...row, sopName: this.editForm.sopName, sopType: this.editForm.sopType} info: { ...row, sopName: this.editForm.sopName, sopType: this.editForm.sopType }
}) })
}, },
...@@ -1400,7 +1473,7 @@ export default { ...@@ -1400,7 +1473,7 @@ export default {
params.eventList[index].eventEndDate = item.eventEndDate params.eventList[index].eventEndDate = item.eventEndDate
} }
let backupContent = typeof item.backupContent == 'string' ? JSON.parse(item.backupContent) : item.backupContent let backupContent = typeof item.backupContent == 'string' ? JSON.parse(item.backupContent) : item.backupContent
params.eventList[index] = {...params.eventList[index], ...this.handleMarketingContentTypes(backupContent)} params.eventList[index] = { ...params.eventList[index], ...this.handleMarketingContentTypes(backupContent) }
idx = idx + 1 idx = idx + 1
} else { } else {
params.eventList.push(item) params.eventList.push(item)
...@@ -1425,7 +1498,7 @@ export default { ...@@ -1425,7 +1498,7 @@ export default {
this.editForm.eventList.forEach((item, index) => { this.editForm.eventList.forEach((item, index) => {
// params.eventList.push(JSON.parse(JSON.stringify(item))) // params.eventList.push(JSON.parse(JSON.stringify(item)))
// params.eventList[index].resourceList = [] // params.eventList[index].resourceList = []
params.eventList[index] = {...item, ...this.handleMarketingContentTypes(item.object)} params.eventList[index] = { ...item, ...this.handleMarketingContentTypes(item.object) }
params.eventList[index].backupContent = item.object params.eventList[index].backupContent = item.object
delete params.eventList[index].object delete params.eventList[index].object
}) })
...@@ -1455,7 +1528,7 @@ export default { ...@@ -1455,7 +1528,7 @@ export default {
message: res.code == '0' ? '操作成功' : res.message, message: res.code == '0' ? '操作成功' : res.message,
type: res.code == '0' ? 'success' : 'error' type: res.code == '0' ? 'success' : 'error'
}) })
this.$tracker.track(Object.assign({}, {pageName: '营销SOP', name: '编辑sop事件', params})) this.$tracker.track(Object.assign({}, { pageName: '营销SOP', name: '编辑sop事件', params }))
if (res.code == '0') { if (res.code == '0') {
this.cancelJump() this.cancelJump()
} }
...@@ -1468,7 +1541,7 @@ export default { ...@@ -1468,7 +1541,7 @@ export default {
message: res.code == '0' ? '操作成功' : res.message, message: res.code == '0' ? '操作成功' : res.message,
type: res.code == '0' ? 'success' : 'error' type: res.code == '0' ? 'success' : 'error'
}) })
this.$tracker.track(Object.assign({}, {pageName: '营销SOP', name: '创建sop事件', params})) this.$tracker.track(Object.assign({}, { pageName: '营销SOP', name: '创建sop事件', params }))
if (res.code == '0') { if (res.code == '0') {
this.cancelJump() this.cancelJump()
} }
...@@ -1492,11 +1565,11 @@ export default { ...@@ -1492,11 +1565,11 @@ export default {
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}) })
.then(() => { .then(() => {
this.cancelJump() this.cancelJump()
}) })
.catch(() => { .catch(() => {
}) })
} else { } else {
this.cancelJump() this.cancelJump()
} }
......
...@@ -26,9 +26,12 @@ ...@@ -26,9 +26,12 @@
editForm.customerOptType == '1' ? '选择指定客户' : editForm.customerOptType == '2' ? '按人群选择客户' : editForm.customerOptType == '3' ? '按标签选择客户' : editForm.customerOptType == '4' ? '按群标签选择客户' : '' editForm.customerOptType == '1' ? '选择指定客户' : editForm.customerOptType == '2' ? '按人群选择客户' : editForm.customerOptType == '3' ? '按标签选择客户' : editForm.customerOptType == '4' ? '按群标签选择客户' : ''
}}</span> }}</span>
<div class="base-info-obj"> <div class="base-info-obj">
<el-tag v-for="(item,index) in marketingObj" :key="index" class="customer-tag" :size="size" <el-tag v-for="(item,index) in marketingObj"
type="info" :disable-transitions="false" :key="index"
> class="customer-tag"
:size="size"
type="info"
:disable-transitions="false">
<span v-if="editForm.customerOptType == '1'">{{ item.customerName }}</span> <span v-if="editForm.customerOptType == '1'">{{ item.customerName }}</span>
<span v-if="editForm.customerOptType == '2'">{{ item.crowdName }}</span> <span v-if="editForm.customerOptType == '2'">{{ item.crowdName }}</span>
<span v-if="editForm.customerOptType == '3' || editForm.customerOptType == '4'">{{ <span v-if="editForm.customerOptType == '3' || editForm.customerOptType == '4'">{{
...@@ -41,49 +44,71 @@ ...@@ -41,49 +44,71 @@
</div> </div>
<!-- 营销事件设置--> <!-- 营销事件设置-->
<div class="container edit-container" v-loading="marketingEventLoading"> <div class="container edit-container"
<div class="edit-title flex" style="align-items: center"> v-loading="marketingEventLoading">
<div class="edit-title flex"
style="align-items: center">
<p>营销事件设置</p> <p>营销事件设置</p>
</div> </div>
<div v-show="!editForm.eventList.length" class="event-empty"> <div v-show="!editForm.eventList.length"
<img class="empty-img" :src="url"/> class="event-empty">
<img class="empty-img"
:src="url" />
<p class="empty-txt">暂无营销事件</p> <p class="empty-txt">暂无营销事件</p>
</div> </div>
<div v-show="editForm.eventList.length" class="event-box"> <div v-show="editForm.eventList.length"
<div class="event-item" v-for="(item, index) in editForm.eventList" :key="index"> class="event-box">
<div class="event-item"
v-for="(item, index) in editForm.eventList"
:key="index">
<div class="flex-default event-title"> <div class="flex-default event-title">
<p class="m-r-20">{{item.firstPushDate}} {{ item.eventTime }}</p> <p class="m-r-20">{{item.firstPushDate}} {{ item.eventTime }}</p>
<p class="m-r-20" v-show="item.repeatFlag == 'Y' && item.repeatMode == 1">每天重复循环至</p> <p class="m-r-20"
<p class="m-r-20" v-show="item.repeatFlag == 'Y' && item.repeatMode == 2">每周{{ v-show="item.repeatFlag == 'Y' && item.repeatMode == 1">每天重复循环至</p>
<p class="m-r-20"
v-show="item.repeatFlag == 'Y' && item.repeatMode == 2">每周{{
item.repeatTime item.repeatTime
}}重复循环至</p> }}重复循环至</p>
<p class="m-r-20" v-show="item.repeatFlag == 'Y' && item.repeatMode == 3">每月{{ <p class="m-r-20"
v-show="item.repeatFlag == 'Y' && item.repeatMode == 3">每月{{
item.repeatTime item.repeatTime
}}重复循环至</p> }}重复循环至</p>
<p class="m-r-20" v-show="item.repeatFlag == 'Y'">{{ item.eventEndDate }}</p> <p class="m-r-20"
v-show="item.repeatFlag == 'Y'">{{ item.eventEndDate }}</p>
<p class="m-r-20 txt-blue"> <p class="m-r-20 txt-blue">
{{ baseData.channelTypeList.find(k => k.confId == item.pushChannelType).confName }}</p> {{ baseData.channelTypeList.find(k => k.confId == item.pushChannelType).confName }}
</p>
</div> </div>
<div> <div>
<div v-for="(obj,index) in backupContentJson(item.backupContent)" :key="index"> <div v-for="(obj,index) in backupContentJson(item.backupContent)"
<div class="textHidden" :title="obj.attContent" v-if="obj.attType == 1" :key="index">
<div class="textHidden"
:title="obj.attContent"
v-if="obj.attType == 1"
v-html="tramWord(obj.attContent)"></div> v-html="tramWord(obj.attContent)"></div>
</div> </div>
<div class="event-inline" v-for="(obj,index) in backupContentJson(item.backupContent)" :key="index"> <div class="event-inline"
v-for="(obj,index) in backupContentJson(item.backupContent)"
:key="index">
<div> <div>
<div v-if="obj.attType == 2"> <div v-if="obj.attType == 2">
<img class="model-item-img" <img class="model-item-img"
:src="obj.attContent" alt/> :src="obj.attContent"
alt />
</div> </div>
<div v-if="obj.attType == 3"> <div v-if="obj.attType == 3">
<video class="model-item-img" :src="obj.attContent" controls="controls"/> <video class="model-item-img"
:src="obj.attContent"
controls="controls" />
</div> </div>
<div v-if="obj.attType == 6"> <div v-if="obj.attType == 6">
<div class="welcome-activity-panel"> <div class="welcome-activity-panel">
<div class="welcome-activity-box"> <div class="welcome-activity-box">
<img src="@/assets/welcomeWord/material-icon.png" alt=""/> <img src="@/assets/welcomeWord/material-icon.png"
alt="" />
<div class="welcome-activity-desc"> <div class="welcome-activity-desc">
<div class="model-item-title">{{ backupContentJson(obj.attContent).fileName }}</div> <div class="model-item-title">
{{ backupContentJson(obj.attContent).fileName }}</div>
</div> </div>
</div> </div>
</div> </div>
...@@ -92,31 +117,37 @@ ...@@ -92,31 +117,37 @@
<div v-if="obj.attType == 7 || obj.attType == 4"> <div v-if="obj.attType == 7 || obj.attType == 4">
<div class="welcome-activity-panel"> <div class="welcome-activity-panel">
<div class="welcome-activity-box"> <div class="welcome-activity-box">
<img src="@/assets/welcomeWord/activity-icon.png" alt=""/> <img src="@/assets/welcomeWord/activity-icon.png"
alt="" />
<div class="welcome-activity-desc"> <div class="welcome-activity-desc">
<template v-if="marketingContentJSON(obj).selectType == 'card'"> <template v-if="marketingContentJSON(obj).selectType == 'card'">
<div class="model-item-title" :title="marketingContentJSON(obj).equityName"> <div class="model-item-title"
:title="marketingContentJSON(obj).equityName">
{{ marketingContentJSON(obj).equityName }} {{ marketingContentJSON(obj).equityName }}
</div> </div>
</template> </template>
<template v-else-if="marketingContentJSON(obj).selectType == 'package'"> <template v-else-if="marketingContentJSON(obj).selectType == 'package'">
<div class="model-item-title" :title="marketingContentJSON(obj).packageName"> <div class="model-item-title"
:title="marketingContentJSON(obj).packageName">
{{ marketingContentJSON(obj).packageName }} {{ marketingContentJSON(obj).packageName }}
</div> </div>
</template> </template>
<template v-else-if="marketingContentJSON(obj).selectType == 'coupon'"> <template v-else-if="marketingContentJSON(obj).selectType == 'coupon'">
<div class="model-item-title" :title="marketingContentJSON(obj).couponName"> <div class="model-item-title"
:title="marketingContentJSON(obj).couponName">
{{ marketingContentJSON(obj).couponName }} {{ marketingContentJSON(obj).couponName }}
</div> </div>
</template> </template>
<template <template
v-else-if="marketingContentJSON(obj).selectType == 'activity'|| marketingContentJSON(obj).selectType == 'crowdfunding'"> v-else-if="marketingContentJSON(obj).selectType == 'activity'|| marketingContentJSON(obj).selectType == 'crowdfunding'">
<div class="model-item-title" :title="marketingContentJSON(obj).activityName"> <div class="model-item-title"
:title="marketingContentJSON(obj).activityName">
{{ marketingContentJSON(obj).activityName }} {{ marketingContentJSON(obj).activityName }}
</div> </div>
</template> </template>
<template v-else> <template v-else>
<div class="model-item-title" :title="marketingContentJSON(obj.attContent).couponName"> <div class="model-item-title"
:title="marketingContentJSON(obj.attContent).couponName">
{{ marketingContentJSON(obj).equityName }} {{ marketingContentJSON(obj).equityName }}
</div> </div>
</template> </template>
...@@ -129,7 +160,9 @@ ...@@ -129,7 +160,9 @@
</div> </div>
<div class="event-btns"> <div class="event-btns">
<el-button type="primary" size="small" @click="handleEventView">查看</el-button> <el-button type="primary"
size="small"
@click="handleEventView">查看</el-button>
</div> </div>
</div> </div>
</div> </div>
...@@ -200,24 +233,24 @@ export default { ...@@ -200,24 +233,24 @@ export default {
methods: { methods: {
handleEventView() { handleEventView() {
let info = this.editForm.eventList && this.editForm.eventList[0] let info = this.editForm.eventList && this.editForm.eventList[0]
this.$router.push({path: '/sop/viewEvent', query: {info,sopType:this.editForm.sopType}}); this.$router.push({ path: '/sop/viewEvent', query: { info, sopType: this.editForm.sopType } });
}, },
tramWord(val) { tramWord(val) {
let htm = val.replace( let htm = val.replace(
/\[([\u4E00-\u9FA56]{1,4}|OK|NO|666)]/gi, /\[([\u4E00-\u9FA56]{1,4}|OK|NO|666)]/gi,
function (res) { function (res) {
let word = res.replace(/\[|\]/gi, '') let word = res.replace(/\[|\]/gi, '')
const list = emoji.flat(Infinity) const list = emoji.flat(Infinity)
let index = parseInt(list.indexOf(word)) + 1 let index = parseInt(list.indexOf(word)) + 1
if (index < 10) { if (index < 10) {
index = '00' + index index = '00' + index
} else if (index >= 10 && index < 100) { } else if (index >= 10 && index < 100) {
index = '0' + index index = '0' + index
}
return `<img style='width:25px;height:25px' src="https://img01.glsx.com.cn/weapp/resource/saas/scrm/emoji/${index}.png">`
} }
return `<img style='width:25px;height:25px' src="https://img01.glsx.com.cn/weapp/resource/saas/scrm/emoji/${index}.png">`
}
) )
return htm return htm
}, },
...@@ -239,10 +272,10 @@ export default { ...@@ -239,10 +272,10 @@ export default {
}, },
getInfo() { getInfo() {
this.$apis.sop.getSopInfoDetailApi({sopId: this.$route.query.id}).then(async res => { this.$apis.sop.getSopInfoDetailApi({ sopId: this.$route.query.id }).then(async res => {
this.editForm = res this.editForm = res
this.marketingObj = res.customerOptType == '1' ? res.customerList : res.customerOptType == '2' ? res.crowdList : res.customerOptType == '3' || res.customerOptType == '4' ? res.labelList : '' this.marketingObj = res.customerOptType == '1' ? res.customerList : res.customerOptType == '2' ? res.crowdList : res.customerOptType == '3' || res.customerOptType == '4' ? res.labelList : ''
} }
) )
}, },
...@@ -371,7 +404,6 @@ export default { ...@@ -371,7 +404,6 @@ export default {
} }
} }
.welcome-activity-panel { .welcome-activity-panel {
display: flex; display: flex;
margin-right: 10px; margin-right: 10px;
...@@ -486,10 +518,9 @@ export default { ...@@ -486,10 +518,9 @@ export default {
.event-inline { .event-inline {
margin-top: 8px; margin-top: 8px;
display: inline-block display: inline-block;
} }
.base-info-list { .base-info-list {
padding: 32px 84px; padding: 32px 84px;
display: grid; display: grid;
...@@ -502,13 +533,13 @@ export default { ...@@ -502,13 +533,13 @@ export default {
font-size: 14px; font-size: 14px;
.base-info-obj { .base-info-obj {
background: #F9F9F9; background: #f9f9f9;
margin: 10px 0 0 64px; margin: 10px 0 0 64px;
padding: 8px; padding: 8px;
} }
} }
} }
.red-icon{ .red-icon {
color: #f56c6c; color: #f56c6c;
margin-right: 4px; margin-right: 4px;
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!