Commit f1ae8a5e by 前端

Merge branch 'master' of http://192.168.3.233:8090/saas/scrm-micro-marketing into xuyl_dev_sop

2 parents 9947cccc 5a6604a8
Showing 55 changed files with 2118 additions and 555 deletions
This diff could not be displayed because it is too large.
......@@ -14,6 +14,7 @@
"element-ui": "^2.4.5",
"glsx-common": "^1.4.6",
"glsx-components": "^1.5.3",
"glsx-components_beta": "^1.0.4",
"lodash": "^4.17.21",
"node-sass": "^4.0.0",
"vod-js-sdk-v6": "^1.5.0",
......@@ -21,7 +22,8 @@
"vue-router": "^3.1.3",
"vuedraggable": "^2.24.3",
"vuex": "^3.1.2",
"wangeditor": "^4.7.12"
"wangeditor": "^4.7.12",
"word-edit": "^1.0.5"
},
"devDependencies": {
"@vue/cli-plugin-babel": "^4.1.0",
......
......@@ -53,6 +53,15 @@ export default {
}
},
created() {
document.onkeydown = function() {
var evt = window.event || arguments[0]
if (evt && evt.keyCode == 13) {
if (typeof evt.cancelBubble != 'undefined') evt.cancelBubble = true
if (typeof evt.stopPropagation == 'function') evt.stopPropagation()
return false
}
return true
}
this.myMsg = this.msg
this.myMessage = this.message
}
......
......@@ -182,6 +182,17 @@ const getPayListApi = params => {
})
}
/**支付商户管理-下拉列表 */
const getPayMerchatListApi = params => {
params.method = 'entmicro.api.payment.pageListPayment'
return http({
url: 'rop-scrm-entmicro/router',
method: 'GET',
data: params,
sign: true
})
}
/**数据看板员工排名 */
const getRankListApi = params => {
params.method = 'scrm.api.shopmall.activity.ranking.page'
......@@ -267,4 +278,4 @@ const liveroomOverview = params => {
sign: true
})
}
export default { exportDailyOrderQuantityStatistics, liveroomDetailexport, liveroomDetailpage, getDailyOrderQuantityStatistics, liveroomOverview, getActivityPageApi, getCrowdfundListApi, exportCrowdfundApi, getBrowseListApi, exportBrowseApi, toggleStatusApi, deleteActivityApi, topActivityApi, getSharedApi, addOrUpdateActivityApi, getActivityDetailApi, getCrowdSharedApi, getLiveListApi, getPayListApi, getRankListApi, exportRankListApi, getDataBoardApi, getVisitorListApi, getSharedListApi }
export default { exportDailyOrderQuantityStatistics, liveroomDetailexport, liveroomDetailpage, getDailyOrderQuantityStatistics, liveroomOverview, getActivityPageApi, getCrowdfundListApi, exportCrowdfundApi, getBrowseListApi, exportBrowseApi, toggleStatusApi, deleteActivityApi, topActivityApi, getSharedApi, addOrUpdateActivityApi, getActivityDetailApi, getCrowdSharedApi, getLiveListApi, getPayListApi, getPayMerchatListApi, getRankListApi, exportRankListApi, getDataBoardApi, getVisitorListApi, getSharedListApi }
......@@ -10,12 +10,13 @@ import { message, messageBox } from '@/plugins/element.js'
import { fetchConfig } from '@/config'
import ElementUI from 'element-ui'
import { GLButton, GLTable, GLFooter, GLCombiForm, GLTableButton, GLDialog } from 'glsx-components' //权限按钮 (根据权限动态创建)
import GLEditor from 'glsx-components/src/packages/Editor'
import {GLEditor} from 'word-edit'
import { getRoutes } from '@/router'
import '@/assets/css/public.scss'
import render from './render'
// import 'glsx-components/src/theme/theme.scss'
import 'glsx-components/dist/glsx-components.css'
import 'word-edit/dist/glsx-components.css'
let routes = []
let router = null
let instance = null
......
......@@ -398,7 +398,6 @@ export default {
},
// 预览回显事件
previewForm(val) {
console.log(val)
const value = this.$common.utils.deepClone(val)
if (value[0] && !value[0].attContent) value.splice(0, 1)
this.previewVal = value
......@@ -552,9 +551,10 @@ export default {
},
handleSelect(val) {
this.isUpdate = true
this.tagging = val
this.tagging = val || []
let arr = []
this.tagging.forEach(item => {
item.labelList = item.labelList || []
item.labelList.forEach(tag => {
arr.push({
groupId: item.labelGroup.id,
......@@ -579,6 +579,7 @@ export default {
}
let arr = []
this.tagging.forEach(item => {
item.labelList = item.labelList || []
item.labelList.forEach(tag => {
arr.push({
groupId: item.labelGroup.id,
......
......@@ -358,10 +358,10 @@ export default {
if (res.code == '0') {
if (type == 1) {
this.time = res.data.createdTime
this.$refs.customer.refreshTable()
this.$refs.customer && this.$refs.customer.refreshTable()
} else if (type == 2) {
this.times = res.data.createdTime
this.$refs.customerGroup.refreshTable()
this.$refs.customerGroup && this.$refs.customerGroup.refreshTable()
}
}
})
......@@ -412,9 +412,9 @@ export default {
message: '操作成功!'
})
if (type == 1) {
this.$refs.customer.refreshTable()
this.$refs.customer && this.$refs.customer.refreshTable()
} else {
this.$refs.customerGroup.refreshTable()
this.$refs.customerGroup && this.$refs.customerGroup.refreshTable()
}
})
// } else {
......
......@@ -146,6 +146,7 @@ export default {
togetherItem: [ATT_TYPE.TEXT], //只允许文本和图片
limitSize: 10, //限制图片大小
limitNum: 9, //限制图片数量
limitPx: 1555200,
// limitWidth: 10000, //限制单张图片宽度
// limitHeight: 10000,//限制单张图片高度
Isdraggable: true, //图片拖拽
......
......@@ -80,7 +80,7 @@
<div class="avatar-uploader-desc-word">上传照片</div>
<input :class="{disableUpload:notDisplayProperties}"
:disabled="notDisplayProperties" type="file" style="opacity: 0" accept=".jpg, .jpeg, .png"
@change="e => handleImgChange(e,'imageUrlList')"/>
@change="e => handleImgChange(e,'imageUrlList')"/>
</div>
<!-- <div @click="phoneVisible = !phoneVisible" class="view-phone">查看效果></div> -->
</div>
......@@ -89,7 +89,7 @@
<div class="img-div">
<div class="put-img" v-if="materialAddForm.videoUrl">
<video :src="materialAddForm.videoUrl" id="video" width="100%" height="100%" preload loop muted>
<!-- <source :src="materialAddForm.videoUrl" type="video/mp4"/>-->
<!-- <source :src="materialAddForm.videoUrl" type="video/mp4"/>-->
</video>
<div class="mask">
<h3>
......@@ -271,7 +271,6 @@
</el-dialog>
</div>
</template>
<script>
import textBox from '@/views/material/components/textBox'
import SelectLabel from '@/views/material/components/selectLable'
......@@ -430,7 +429,7 @@ export default {
if (!imgHtml && !videoHtml) params.materialType = 5
if (imgHtml && imgHtml.length && !videoHtml && !html.length) params.materialType = 6
if (this.materialAddForm.vedioUrl && !this.materialAddForm.imageUrlList.length) params.materialType = 4
if (this.materialAddForm.imageUrlList.length) params.materialType = 3
if (this.materialAddForm.imageUrlList && this.materialAddForm.imageUrlList.length) params.materialType = 3
this.textBoxContent = encodeURIComponent(this.textBoxContent)
params.materialUrl = this.textBoxContent
}
......@@ -749,7 +748,6 @@ export default {
}
}
</script>
<style lang="scss" scoped>
.materialType{
/deep/.el-form-item__content{
......@@ -760,7 +758,6 @@ export default {
cursor: not-allowed;
cursor: no-drop;
}
.input-tag-wrapper {
max-height: 75px;
overflow: auto;
......@@ -775,21 +772,18 @@ export default {
align-items: center;
margin-top: 6px;
font-size: 14px;
i {
color: #75acff;
margin-right: 3px;
font-size: 14px;
}
}
.el-tag {
margin-right: 4px;
height: 26px;
line-height: 24px;
margin-bottom: 5px;
}
.tag-input {
background: transparent;
border: none !important;
......@@ -799,21 +793,17 @@ export default {
padding-left: 0;
width: 100px;
}
.creat-material,
.track,
.share,
.material-bottom {
background-color: #fff;
}
.creat-material,
.track {
margin-bottom: -10px;
.dis-in-block {
margin-left: -154px;
.activity-img {
width: 104px;
height: 104px;
......@@ -822,7 +812,6 @@ export default {
border-radius: 4px;
cursor: pointer;
position: relative;
input {
cursor: pointer;
font-size: 0;
......@@ -832,30 +821,25 @@ export default {
width: 100%;
height: 100%;
}
.add-border {
text-align: center;
color: rgba(0, 0, 0, 0.45);
.add-icon {
margin-top: 20px;
height: 20px;
font-size: 17px;
}
.add-text {
height: 30px;
font-size: 12px;
}
}
}
.img-btns,
img {
width: 100%;
height: 100%;
}
.video-panel {
width: 100%;
height: 100%;
......@@ -863,19 +847,16 @@ export default {
align-items: center;
justify-content: center;
position: relative;
video {
position: absolute;
object-fit: fill;
}
.el-icon-video-play {
z-index: 10;
font-size: 20px;
color: #fff;
cursor: pointer;
}
.el-icon-close {
position: absolute;
top: 0px;
......@@ -886,7 +867,6 @@ export default {
}
}
}
.container {
h4,
.share-container {
......@@ -894,45 +874,36 @@ export default {
font-weight: 600;
color: rgba(0, 0, 0, 0.85);
margin: 17px 0 17px 20px;
&:first-child {
padding-top: 17px;
margin-top: 0;
}
}
}
.photoWrap {
margin-top: 20px;
margin-left: -154px;
}
.space {
margin-bottom: 32px;
}
.track {
&-tips {
font-size: 14px;
color: #999999;
}
&-info {
margin-left: 8px;
}
&-behavior {
color: #606266;
}
}
.share {
margin-bottom: 20px;
&-container {
display: flex;
justify-content: space-between;
.share-unfold {
span {
font-size: 12px;
......@@ -941,65 +912,54 @@ export default {
}
}
}
&-tips {
color: #999999;
font-size: 14px;
margin-left: 16px;
}
}
.material-bottom {
height: 78px;
position: relative;
.el-form-item {
position: absolute;
top: 25%;
left: 40%;
.el-form-item__content {
margin-left: 0;
}
}
}
.el-input--small,
.el-select,
.el-select--small {
width: 432px;
}
.btn-cancle {
border-color: #5850ff;
color: #5850ff;
}
.put-img,
.avatar-uploader-desc,
.view-phone {
float: left;
margin-right: 8px;
.task {
width: 104px;
height: 104px;
border-radius: 10px;
}
}
.put-img {
width: 104px;
height: 104px;
border-radius: 10px;
display: inline-block;
position: relative;
img {
width: 104px;
height: 104px;
}
.mask {
position: absolute;
background: rgba(101, 101, 101, 0.6);
......@@ -1010,42 +970,34 @@ export default {
width: 100%;
height: 100%;
border-radius: 10px;
h3 {
text-align: center;
margin-top: 40%;
img {
width: 16px;
height: 16px;
}
.del-img {
padding-left: 12px;
}
}
}
}
.tag-show {
margin-right: 8px;
margin-top: 20px;
.el-button {
display: inline-flex;
color: #5850ff;
}
}
.put-img:hover .mask {
opacity: 1;
}
.pdf-show {
display: inline-flex;
position: relative;
height: 32px;
input {
position: absolute;
top: 0;
......@@ -1054,14 +1006,12 @@ export default {
height: 100%;
}
}
.avatar-uploader-desc {
width: 104px;
height: 104px;
border-radius: 4px;
border: 1px dashed rgba(0, 0, 0, 0.15);
position: relative;
&-icon {
width: 16px;
height: 16px;
......@@ -1069,14 +1019,12 @@ export default {
top: 28px;
left: 44px;
}
&-word {
position: absolute;
top: 58px;
left: 24px;
color: #666666;
}
input {
position: absolute;
top: 0;
......@@ -1085,34 +1033,28 @@ export default {
height: 100%;
}
}
.view-phone {
margin-top: 85px;
color: #5850ff;
}
.avatar {
width: 178px;
height: 178px;
display: block;
}
.share-desc {
padding-bottom: 30px;
display: flex;
justify-content: space-between;
&-right-box {
margin-right: 50px;
width: 290px;
height: 566px;
position: relative;
&-phone {
width: 290px;
height: 566px;
}
.content-show {
background-color: #fff;
width: 160px;
......@@ -1124,17 +1066,14 @@ export default {
left: 71px;
display: flex;
justify-content: space-between;
&-img {
width: 30px;
height: 30px;
img {
width: 30px;
height: 30px;
}
}
.content-title {
color: #333333;
max-width: 100px;
......@@ -1144,7 +1083,6 @@ export default {
font-size: 13px;
margin-bottom: 4px;
}
.content-word {
color: #999999;
line-height: 14px;
......@@ -1160,63 +1098,49 @@ export default {
}
}
}
.img-plus {
width: 200px;
height: 200px;
}
.gl-footer {
z-index: 999;
}
.form-item-container {
margin-top: 32px !important;
}
.el-form-item {
margin-bottom: 20px !important;
}
/deep/ .el-form-item__label {
line-height: 25px;
}
/deep/ .el-form-item__content {
line-height: 25px;
}
.label-word {
display: inline-block;
img {
vertical-align: middle;
}
}
ul {
margin-top: 5px;
.pdf-show {
// width: 200px;
list-style: none;
align-items: center;
position: relative;
padding: 0 8px;
.pdf-name {
margin-right: 20px;
&:hover {
color: #5850ff;
}
}
&:hover {
cursor: pointer;
background-color: rgba(88, 80, 255, 0.2) !important;
}
i {
position: absolute;
right: 5px;
......@@ -1224,7 +1148,6 @@ ul {
}
}
}
.video-dsialog {
z-index: 2001;
position: fixed;
......@@ -1234,7 +1157,6 @@ ul {
left: 0;
overflow: auto;
background: rgba($color: #000000, $alpha: 0.5);
&-panel {
background: #000000;
position: absolute;
......@@ -1246,12 +1168,10 @@ ul {
box-sizing: border-box;
padding: 10px 20px 20px;
overflow: hidden;
.video-close {
display: flex;
justify-content: flex-end;
height: 40px;
i {
cursor: pointer;
font-size: 25px;
......
......@@ -42,7 +42,6 @@
</ul>
</div>
</template>
<script>
import * as dayjs from 'dayjs'
......@@ -184,7 +183,6 @@ export default {
}
}
</script>
<style lang="scss" scoped>
.status-words {
margin-left: 5px;
......
......@@ -3,7 +3,6 @@
<div id="div-demo"></div>
</div>
</template>
<script>
import E from 'wangeditor'
export default {
......@@ -113,7 +112,6 @@ export default {
}
}
</script>
<style lang="scss" scoped>
#div-demo {
// margin: 16px 300px 0 0;
......
......@@ -106,7 +106,6 @@
<VideoShowDia ref="VideoShowDia" :dialogVisible="dialogVisibleImg"></VideoShowDia>
</div>
</template>
<script>
const materialStatus = {
'0': 'normal',
......@@ -446,14 +445,12 @@ export default {
window.sessionStorage.setItem('firstLogin', 'true')
}
},
videoOpen(scope) {
console.log(scope)
this.dialogVisibleImg = true
let dialogSrc = scope.materialContentRpcResponse.materialUrl
this.$refs.VideoShowDia.init(dialogSrc)
},
// 重置
handleReset() {
this.searchForm = {
......@@ -461,7 +458,8 @@ export default {
materialType: '',
businessType: '',
status: '',
materialName: ''
materialName: '',
createdType:'2'
}
this.getListApi()
this.$refs.materialGroup.currentIndex = null
......@@ -559,13 +557,13 @@ export default {
let videoHtml = html.match(/<video.*?(?:>|\/>)/g)
if (imgHtml) {
let imgSrc = imgHtml[0].match('<img[^<>]*? src="([^<>]*?)"')
item.materialContentRpcResponse.materialUrl = imgSrc[1]
item.materialContentRpcResponse.materialUrl = imgSrc? imgSrc[1] :''
item.urlType = 'img'
item.imgCount = imgHtml.length
}
if (videoHtml) {
let videoSrc = videoHtml[0].match('<video[^<>]*? src="([^<>]*?)"')
item.materialContentRpcResponse.materialUrl = videoSrc[1]
item.materialContentRpcResponse.materialUrl = videoSrc ? videoSrc[1] :''
item.urlType = 'video'
}
}
......@@ -626,7 +624,6 @@ export default {
}
}
</script>
<style lang="scss" scoped>
.videoMask {
position: absolute;
......
......@@ -38,22 +38,18 @@
name="0"
></el-tab-pane>
<el-tab-pane
v-if="!isSpecialMerchat"
label="已付款"
name="1"
></el-tab-pane>
<el-tab-pane
v-if="!isSpecialMerchat"
label="未付款"
name="2"
></el-tab-pane>
<el-tab-pane
v-if="!isSpecialMerchat"
label="已退款"
name="3"
></el-tab-pane>
<el-tab-pane
v-if="!isSpecialMerchat"
label="售后订单"
name="4"
></el-tab-pane>
......@@ -340,7 +336,6 @@ export default {
data () {
return {
size: 'small',
isSpecialMerchat: true,
url: url,
isEdit: true,
orderCode: '',
......@@ -487,29 +482,29 @@ export default {
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: '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',
......@@ -524,20 +519,20 @@ export default {
type: 'input',
maxlength: 100
},
{
label: '手机号',
name: 'customerPhone',
labelWidth: 56,
type: 'input',
maxlength: 11
},
{
label: '推荐人手机号',
name: 'shareStaffPhone',
labelWidth: 56,
type: 'input',
maxlength: 11
},
// {
// label: '手机号',
// name: 'customerPhone',
// labelWidth: 56,
// type: 'input',
// maxlength: 11
// },
// {
// label: '推荐人手机号',
// name: 'shareStaffPhone',
// labelWidth: 56,
// type: 'input',
// maxlength: 11
// },
{
label: '测试单',
name: 'orderType',
......@@ -548,14 +543,6 @@ export default {
optionsName: 'testSheetTypeList'
},
{
label: '退款类型',
prop: 'afterSaleType',
width: 100,
formatter: cellValue => {
return { 1: '退订单', 2: '退定金' }[cellValue.afterSaleType] || '-'
}
},
{
label: '业务场景',
name: 'businessType',
type: 'select',
......@@ -703,7 +690,7 @@ export default {
fn: '商品发货'
},
condition: row => {
return !this.isSpecialMerchat && row.deliveryType == 2 && row.orderStatus == 6
return row.deliveryType == 2 && row.orderStatus == 6
},
listeners: {
click: this.handleExpressInfo
......@@ -730,7 +717,7 @@ export default {
type: 'text'
},
condition: row => {
return !this.isSpecialMerchat && row.afterSaleStatus == 4
return row.afterSaleStatus == 4
},
listeners: {
click: this.handleReceiving
......@@ -751,45 +738,45 @@ export default {
return cellValue.customerName || '-'
}
},
{
label: '手机号',
prop: 'customerPhone',
width: 160,
formatter: cellValue => {
return cellValue.customerPhone || '-'
}
},
{
label: '其他',
prop: 'otherInformation',
width: 210
},
// {
// 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: '指派人',
prop: 'assignName',
width: 210,
addHtml: 'assignName'
},
{
label: '推荐人手机号',
prop: 'shareStaffPhone',
width: 160,
formatter: cellValue => {
return cellValue.shareStaffPhone || '-'
}
},
// {
// label: '推荐人',
// prop: 'shareStaffName',
// width: 210,
// addHtml: 'shareStaffName'
// },
// {
// label: '指派人',
// prop: 'assignName',
// width: 210,
// addHtml: 'assignName'
// },
// {
// label: '推荐人手机号',
// prop: 'shareStaffPhone',
// width: 160,
// formatter: cellValue => {
// return cellValue.shareStaffPhone || '-'
// }
// },
{
label: '订单时间',
prop: 'createdDate',
......@@ -806,20 +793,20 @@ export default {
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: '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',
......@@ -885,6 +872,14 @@ export default {
}
},
{
label: '退款类型',
prop: 'afterSaleType',
width: 100,
formatter: cellValue => {
return { 1: '退订单', 2: '退定金' }[cellValue.afterSaleType] || '-'
}
},
{
label: '售后状态',
prop: 'afterSaleStatus',
width: '100',
......@@ -947,7 +942,7 @@ export default {
}
},
created () {
this.checkMerchant()
// this.checkMerchant()
if (window.__POWERED_BY_QIANKUN__) {
this.merchantModel = this.$globalState.session.merchantModel
this.accountLevel = this.$globalState.session.accountLevel
......@@ -1042,18 +1037,18 @@ export default {
})
},
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(['手机号', '其他', '微信名称', '推荐人', '推荐人手机号', '车架号', '商户订单号'])
}
})
},
// 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, {
......@@ -1275,9 +1270,9 @@ export default {
},
handleTabClick () {
if (this.isSpecialMerchat) {
return true
}
// if (this.isSpecialMerchat) {
// return true
// }
this.handleSearch()
},
......
......@@ -16,7 +16,7 @@
:title="detailForm[subItem.name]">{{ detailForm[subItem.name] ? detailForm[subItem.name] + (subItem.suffix || '') : '-' }}</span>
</el-form-item>
</el-row>
<el-form-item label="其他信息">{{ detailForm.formDescribe }}</el-form-item>
<!-- <el-form-item label="其他信息">{{ detailForm.formDescribe }}</el-form-item> -->
</el-form>
</div>
<div :class="['container', orderRefund ? 'm-b-20' : 'edit-container']">
......@@ -121,22 +121,22 @@ export default {
label: '订单时间',
name: 'createdDateStr'
},
{
label: '手机号码',
name: 'customerPhone'
},
{
label: '推荐人',
name: 'shareStaffName'
},
{
label: '推荐人类型',
name: 'shareStaffTypeName'
},
{
label: '车架号',
name: 'vin'
},
// {
// label: '手机号码',
// name: 'customerPhone'
// },
// {
// label: '推荐人',
// name: 'shareStaffName'
// },
// {
// label: '推荐人类型',
// name: 'shareStaffTypeName'
// },
// {
// label: '车架号',
// name: 'vin'
// },
{
label: '门店信息',
name: 'merchantName'
......@@ -166,10 +166,10 @@ export default {
label: '尾款',
name: 'crowdFundingPrice'
},
{
label: '发货地址',
name: 'shipAddress'
},
// {
// label: '发货地址',
// name: 'shipAddress'
// },
{
label: '微信名称',
name: 'weChatName'
......@@ -288,22 +288,22 @@ export default {
this.detailFormData.splice(idx, 1)
}
// 其他信息
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 + ' '
}
})
// 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')
......
......@@ -252,8 +252,27 @@ export default {
{
label: '活动名称',
prop: 'activityName',
width: 220,
fixed: 'left'
width: 220
},
{
label: '浏览量(次)',
prop: 'viewAmount',
addHtml: 'linkText',
width: 140
},
{
label: '访客',
prop: 'fansAmount',
addHtml: 'linkText'
},
{
label: '分享',
prop: 'shareAmount',
addHtml: 'linkText'
},
{
label: '销量',
prop: 'saleAmount'
},
{
label: '门店',
......@@ -281,12 +300,6 @@ export default {
}
},
{
label: '浏览量(次)',
prop: 'viewAmount',
addHtml: 'linkText',
width: 140
},
{
label: '进账',
prop: 'income',
formatter: cellValue => {
......@@ -308,20 +321,6 @@ export default {
}
},
{
label: '访客',
prop: 'fansAmount',
addHtml: 'linkText'
},
{
label: '分享',
prop: 'shareAmount',
addHtml: 'linkText'
},
{
label: '销量',
prop: 'saleAmount'
},
{
label: '秒杀价(元)',
name: 'activityPrice',
width: 140,
......
......@@ -468,7 +468,9 @@ export default {
reservationInstallContactsName: '',
reservationInstallContactsPhone: '',
targetStock: '',
paymentAccountSource: '1',
paymentAccountId: '',
payMannerId: '',
// 战报内容配置
activityActionReport: {
produceReportSummary: '',
......@@ -1100,6 +1102,28 @@ export default {
addHtml: 'live'
},
{
label: '账户类型',
name: 'paymentAccountSource',
type: 'radio',
optionId: 'confId',
optionLabel: 'confName',
optionList: [
{
confId: '1',
confName: '广联'
},
{
confId: '2',
confName: '服务商'
}
],
isDisabled: false,
handleRadioChange: (value, targetItem) => {
this.editForm.paymentAccountId = ''
this.configEditFormData.find(item => item.name == 'paymentAccountId').optionList = value == '1' ? this.baseData.payList : this.baseData.payMerchatList
}
},
{
label: '定金收款账户',
name: 'paymentAccountId',
type: 'select',
......@@ -1218,7 +1242,11 @@ export default {
COVER_LIVE: 'https://img02.glsx.com.cn/weapp/resource/scrm-mobile/crowdfunding/COVER_LIVE.gif',
COVER_REPLAY: 'https://img02.glsx.com.cn/weapp/resource/scrm-mobile/crowdfunding/COVER_REPLAY.gif'
}),
defaultFloatingMaskDiagram: 'https://wx.glsx.com.cn/upload/biz/ba63349f-8e9e-4e80-be3b-45cc38dcf13f.gif'
defaultFloatingMaskDiagram: 'https://wx.glsx.com.cn/upload/biz/ba63349f-8e9e-4e80-be3b-45cc38dcf13f.gif',
baseData: {
payList: [],
payMerchatList: []
}
}
},
......@@ -1256,7 +1284,7 @@ export default {
true
)
})
this.changeFormAttr('configEditFormData', 'isDisabled', ['定金收款账户'], true)
this.changeFormAttr('configEditFormData', 'isDisabled', ['账户类型', '定金收款账户'], true)
}
}
},
......@@ -1807,6 +1835,8 @@ export default {
this.handleMusicChange(this.musicList.length - 1)
}
}
// 定金收款账户
this.editForm.paymentAccountSource = this.editForm.paymentAccountSource ? this.editForm.paymentAccountSource + '' : '1'
// 表单设置
this.editForm.formDescribeCheck = []
this.editForm.selectCarNumberFlag = this.editForm.selectCarNumberFlag || 1
......@@ -2191,15 +2221,27 @@ export default {
this.liveEditFormData.find(item => item.name == 'liveBroadcastRoomId').optionList = staff
})
},
// 定金收款账户
getPayList() {
this.$apis.seckillActivity.getPayListApi({}).then(res => {
this.configEditFormData.find(item => item.name == 'paymentAccountId').optionList = res
this.editForm.paymentAccountId = this.editForm.paymentAccountId || res.find(item => item.isDefault == 'Y').id
getPayMerchatList() {
this.$apis.seckillActivity.getPayMerchatListApi({ pageNum: 1, pageSize: 9999 }).then(res => {
res.list.forEach(item => {
item.id = item.payMannerId
item.accountName = item.mchName
})
this.baseData.payMerchatList = res.list
this.configEditFormData.find(item => item.name == 'paymentAccountId').optionList = this.editForm.paymentAccountSource == 1 ? this.baseData.payList : this.baseData.payMerchatList
this.$nextTick(() => {
this.editStatus = false
})
})
},
// 定金收款账户
getPayList() {
this.$apis.seckillActivity.getPayListApi({}).then(res => {
this.baseData.payList = res
this.editForm.paymentAccountSource = this.editForm.paymentAccountSource || '1'
this.editForm.paymentAccountId = this.editForm.paymentAccountId || this.editForm.payMannerId || res.find(item => item.isDefault == 'Y')?.id
this.getPayMerchatList()
})
}
}
}
......
......@@ -57,6 +57,7 @@ export default {
this.activeName = obj.activeName
},
handleInfoConfirm(info) {
this.eventObj.addOrEdit == 'add' ? this.$refs.baseInfoRef.editForm.eventList.push(info.baseInfo) : this.$set(this.$refs.baseInfoRef.editForm.eventList, this.eventIndex, info.baseInfo)
this.$refs.baseInfoRef.parentCustomerObj.phone = info.predictCountObj.phone
this.$refs.baseInfoRef.parentCustomerObj.qiwei = info.predictCountObj.qiwei
......
......@@ -4,60 +4,63 @@
<div class="sop-base-info">
<div class="container m-b-20">
<p class="edit-title">{{ title }}</p>
<glsx-combi-form class="edit-form-container m-r-20" ref="editFormRef" :isEdit="isEdit" :labelWidth="labelWidth"
:isBlock="true" :formRef="editChildRef" :formObj="editForm" :formData="editFormData"
:formRules="editRule">
<div slot="startDate">
<el-input class="w432"
:placeholder="!editForm.eventList.length ? '设置营销事件后自动补充' : editForm.startDate + (editForm.endDate ? ' - ' + editForm.endDate : '')"
disabled></el-input>
</div>
<div slot="customerInfoList" slot-scope="scope">
<div v-if="!scope.scope.isDisabled">
<!-- <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-radio-group v-model="editForm[scope.scope.name]" @change="handleCustTypeChange">
<el-radio v-for="(item, index) in scope.scope.customerRadioList" :key="index" :label="item.confId">
{{ item.confName }}
</el-radio>
</el-radio-group>
<div>
<glsx-combi-form class="edit-form-container m-r-20" ref="editFormRef" :isEdit="isEdit"
:labelWidth="labelWidth"
:isBlock="true" :formRef="editChildRef" :formObj="editForm" :formData="editFormData"
:formRules="editRule">
<div slot="startDate">
<el-input class="w432"
:placeholder="!editForm.eventList.length ? '设置营销事件后自动补充' : editForm.startDate + (editForm.endDate ? ' - ' + editForm.endDate : '')"
disabled></el-input>
</div>
<div v-for="(item, pIdx) in customerDataList" :key="pIdx">
<div v-show="item.confId == editForm[scope.scope.name]">
<el-button v-show="item.list.length == 0" class="default-blue-btn el-icon-plus" :size="size"
@click="handleSelectCustomer(pIdx)">去选择
</el-button>
<!-- <div v-show="editForm.customerInfoList.length != 0" class="customer-box m-t-10"> -->
<div v-show="item.list.length != 0">
<div class="customer-box m-t-10">
<div class="customer-title">{{ item.confName }}客户:预估{{ item.customerCount }}人</div>
<div :key="key" class="el-input-tag input-tag-wrapper">
<template v-if="item.confName == '标签'">
<div v-for="(subItem, subIdx) in item.list" :key="subIdx">
<el-tag v-for="(k, n) in subItem.labelList" :key="n" class="customer-tag" :size="size"
<div slot="customerInfoList" slot-scope="scope">
<div v-if="!scope.scope.isDisabled">
<!-- <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-radio-group v-model="editForm[scope.scope.name]" @change="handleCustTypeChange">
<el-radio v-for="(item, index) in scope.scope.customerRadioList" :key="index" :label="item.confId">
{{ item.confName }}
</el-radio>
</el-radio-group>
</div>
<div v-for="(item, pIdx) in customerDataList" :key="pIdx">
<div v-show="item.confId == editForm[scope.scope.name]">
<el-button v-show="item.list.length == 0" class="default-blue-btn el-icon-plus" :size="size"
@click="handleSelectCustomer(pIdx)">去选择
</el-button>
<!-- <div v-show="editForm.customerInfoList.length != 0" class="customer-box m-t-10"> -->
<div v-show="item.list.length != 0">
<div class="customer-box m-t-10">
<div class="customer-title">{{ item.confName }}客户:预估{{ item.customerCount }}人</div>
<div :key="key" class="el-input-tag input-tag-wrapper">
<template v-if="item.confName == '标签'">
<div v-for="(subItem, subIdx) in item.list" :key="subIdx">
<el-tag v-for="(k, n) in subItem.labelList" :key="n" class="customer-tag" :size="size"
type="info" :closable="!scope.scope.isDisabled" :disable-transitions="false"
@close="handleDeleteCustomer(n, subIdx, item.confName)">
<span>{{ subItem.labelGroup.name }}:{{ k.name }}</span>
</el-tag>
</div>
</template>
<template v-else>
<el-tag v-for="(subItem, subIdx) in item.list" :key="subIdx" class="customer-tag" :size="size"
type="info" :closable="!scope.scope.isDisabled" :disable-transitions="false"
@close="handleDeleteCustomer(n, subIdx, item.confName)">
<span>{{ subItem.labelGroup.name }}:{{ k.name }}</span>
@close="handleDeleteCustomer(subIdx)">
<!-- <i class="el-icon-user-solid"></i> -->
<span>{{ subItem[item.listConf.confName] || subItem[item.listConf.otherConfName] }}</span>
</el-tag>
</div>
</template>
<template v-else>
<el-tag v-for="(subItem, subIdx) in item.list" :key="subIdx" class="customer-tag" :size="size"
type="info" :closable="!scope.scope.isDisabled" :disable-transitions="false"
@close="handleDeleteCustomer(subIdx)">
<!-- <i class="el-icon-user-solid"></i> -->
<span>{{ subItem[item.listConf.confName] || subItem[item.listConf.otherConfName] }}</span>
</el-tag>
</template>
</template>
</div>
</div>
<el-button v-if="!editDisabled" type="text" @click="handleSelectCustomer(pIdx)">编辑</el-button>
<el-button v-if="!editDisabled" type="text" @click="handleResetCustomer(pIdx)">重置</el-button>
</div>
<el-button v-if="!editDisabled" type="text" @click="handleSelectCustomer(pIdx)">编辑</el-button>
<el-button v-if="!editDisabled" type="text" @click="handleResetCustomer(pIdx)">重置</el-button>
</div>
</div>
</div>
</div>
</glsx-combi-form>
</glsx-combi-form>
</div>
</div>
<div class="container edit-container">
<div class="edit-title flex" style="align-items: center">
......@@ -66,7 +69,7 @@
content="请先完善sop名称和营销对象" placement="top">
<div>
<el-button class="m-r-20" :disabled="!editForm.customerInfoList.length || !editForm.sopName" :size="size"
type="primary" @click="handleEventEdit('add')">添加事件
type="primary" v-if="this.routeInfo.addOrEdit !=='look'" @click="handleEventEdit('add')">添加事件
</el-button>
</div>
</el-tooltip>
......@@ -91,29 +94,116 @@
<p class="m-r-20 txt-blue">
{{ baseData.channelTypeList.find(k => k.confId == item.pushChannelType).confName }}</p>
</div>
<div class="event-content">{{ item.eventContent }}</div>
<div class="event-link" v-if="item.object">
<img class="m-r-10" v-if="item.object.additionalType && item.object.additionalType != 4"
:src="require(`@/assets/sop/icon-${imgIcon[item.object.additionalType]}.png`)" alt/>
<div v-if="item.object.additionalType == 4">
<div v-if="item.object.showVideoContent.length">
<video class="model-item-img" :src="item.object.showVideoContent[0].attContent" controls="controls"/>
</div>
<div v-if="!item.object.showVideoContent.length && item.object.showImgContent.length">
<img class="model-item-img" :src="item.object.showImgContent[0].attContent"/>
<div>
<div v-for="(obj,index) in backupContentJson(item.backupContent)" :key="index">
<div class="textHidden" :title="obj.attContent" v-if="obj.attType == 1"
v-html="tramWord(obj.attContent)"></div>
</div>
<div class="event-inline" v-for="(obj,index) in backupContentJson(item.backupContent)" :key="index">
<div>
<div v-if="obj.attType == 2">
<img class="model-item-img"
:src="obj.attContent" alt/>
</div>
<div v-if="obj.attType == 3">
<video class="model-item-img" :src="obj.attContent" controls="controls"/>
</div>
<div v-if="obj.attType == 6">
<div class="welcome-activity-panel">
<div class="welcome-activity-box">
<div class="welcome-activity-icon">
<img src="@/assets/welcomeWord/pdf_r.png" v-if="obj.attContent && !JSON.parse(obj.attContent).isFile"/>
<img src="@/assets/welcomeWord/text.png" v-if="obj.attContent && JSON.parse(obj.attContent).isFile"/>
</div>
<div class="welcome-activity-desc">
<div class="model-item-title">{{ JSON.parse(obj.attContent).fileName }}</div>
</div>
</div>
</div>
</div>
<div v-if="obj.attType == 7">
<div class="welcome-activity-panel">
<div class="welcome-activity-box">
<div class="welcome-activity-icon">
<img src="@/assets/welcomeWord/coupon.png" alt=""
v-if="marketingContentJSON(obj).selectType == 'coupon'"/>
<img src="@/assets/welcomeWord/gift.png" alt="" v-else/>
</div>
<div class="welcome-activity-desc">
<template v-if="marketingContentJSON(obj).selectType == 'card'">
<div class="model-item-title" :title="marketingContentJSON(obj).equityName">
{{ marketingContentJSON(obj).equityName }}
</div>
<div class="model-item-content model-item-contents">
试用天数:
<span>{{ marketingContentJSON(obj).freeDay }}天</span>
</div>
</template>
<template v-else-if="marketingContentJSON(obj).selectType == 'package'">
<div class="model-item-title" :title="marketingContentJSON(obj).packageName">
{{ marketingContentJSON(obj).packageName }}
</div>
<div class="model-item-content model-item-contents">
销售价格:
<span>{{ marketingContentJSON(obj).packagePrice }}元</span>
</div>
</template>
<template v-else-if="marketingContentJSON(obj).selectType == 'coupon'">
<div class="model-item-title" :title="marketingContentJSON(obj).couponName">
{{ marketingContentJSON(obj).couponName }}
</div>
<div class="model-item-content model-item-contents">
数量:
<span>{{ marketingContentJSON(obj).residueAmount }}</span>
</div>
</template>
<template v-else-if="marketingContentJSON(obj).selectType == 'activity'">
<div class="model-item-title" :title="marketingContentJSON(obj).activityName">
{{ marketingContentJSON(obj).activityName }}
</div>
<div class="model-item-content"></div>
<div class="model-item-content">
开始时间:
{{ marketingContentJSON(obj).startTime }}
</div>
<div class="model-item-content">
结束时间:
{{ marketingContentJSON(obj).endTime }}
</div>
</template>
<template v-else>
<div class="model-item-title" :title="marketingContentJSON(obj.attContent).couponName">
{{ marketingContentJSON(obj).equityName }}
</div>
<div class="model-item-content model-item-weight">
赠送天数:
<span>{{
marketingContentJSON(obj).effectiveType == 2 ? marketingContentJSON(obj).effectivedDay + '天' : '永久有效'
}}</span>
</div>
</template>
</div>
</div>
</div>
</div>
</div>
</div>
<span v-else>{{ item.object.objectName }}</span>
</div>
<div v-if="new Date(item.eventStartDate) > new Date() || routeInfo.addOrEdit =='copy'" class="event-btns">
<el-button class="default newBtnSty" :size="size" @click="handleEventDelete(index)">删除</el-button>
<div class="event-btns">
<el-button v-if="new Date(item.eventStartDate) > new Date() || routeInfo.addOrEdit =='copy'"
class="default newBtnSty" :size="size" @click="handleEventDelete(index)">删除
</el-button>
<el-tooltip :disabled="!(!editForm.customerInfoList.length || !editForm.sopName)" effect="dark"
content="请先完善sop名称和营销对象" placement="top">
<div>
<el-button class="default-blue-btn" :disabled="!editForm.customerInfoList.length || !editForm.sopName" :size="size" @click="handleEventEdit('edit', item, index)">编辑
<el-button class="default-blue-btn newBtnSty"
v-if="new Date(item.eventStartDate) > new Date()"
:disabled="!editForm.customerInfoList.length || !editForm.sopName"
:size="size" @click="handleEventEdit('edit', item, index)">编辑
</el-button>
</div>
</el-tooltip>
</div>
</div>
</div>
......@@ -138,6 +228,7 @@
<script>
import url from '@/assets/empty.png'
import emoji from '@/utils/emo'
import selectCustomer from './components/selectCustomer'
import selectCrowd from './components/selectCrowd'
......@@ -326,13 +417,14 @@ export default {
this.editStatus = true
},
deep: true
}
},
},
mounted() {
this.setMinHeight('.sop-base-info')
// this.routeInfo.addOrEdit == 'edit'
if (['edit', 'copy'].includes(this.routeInfo.addOrEdit)) {
if (['edit', 'copy', 'look'].includes(this.routeInfo.addOrEdit)) {
this.getInfo()
} else if (this.routeInfo.info) {
this.setCustomer()
......@@ -340,6 +432,37 @@ export default {
},
methods: {
tramWord(val) {
let htm = val.replace(
/\[([\u4E00-\u9FA56]{1,4}|OK|NO|666)]/gi,
function (res) {
let word = res.replace(/\[|\]/gi, '')
const list = emoji.flat(Infinity)
let index = parseInt(list.indexOf(word)) + 1
if (index < 10) {
index = '00' + index
} else if (index >= 10 && index < 100) {
index = '0' + index
}
return `<img style='width:25px;height:25px' src="https://img01.glsx.com.cn/weapp/resource/saas/scrm/emoji/${index}.png">`
}
)
return htm
},
backupContentJson(val) {
if (typeof (val) == 'string') {
return JSON.parse(val)
} else {
return val
}
},
marketingContentJSON(val) {
if (typeof (val.attContent) == 'string') {
return JSON.parse(val.attContent).marketingContent
} else {
return val.attContent.marketingContent
}
},
judgeDisable() {
var list = ['sopName', 'customerOptType', 'customerOptUpdate']
list.forEach(item => {
......@@ -411,7 +534,7 @@ export default {
customerSex: sexToObj[item.customerSex],
isJoin: item.customerWxAdd == 'Y' ? 1 : 0,
addTime: item.customerTimeAdd,
oneId: item.externalUserId
oneId: item.externalUserId,
})
})
this.customerDataList[this.currentCustomerIdx].list = JSON.parse(JSON.stringify(list))
......@@ -454,21 +577,20 @@ export default {
item.object.objectName = item.objectName
item.object.additionalType = item.additionalType
}
if (item.additionalType == 4) {
// attType (1文本,2图片,3视频,4链接,5小程序,6附件,7活动)
// attContent 附件内容
// 文字
let txtObj = item.object.attachmentList.find(k => k.attType == 1)
item.object.showTxtContent = txtObj ? txtObj.attContent : ''
// 图片
let imgList = item.object.attachmentList.filter(k => k.attType == 2)
item.object.showImgContent = imgList || []
// 视频
let videoList = item.object.attachmentList.filter(k => k.attType == 3)
item.object.showVideoContent = videoList || []
}
// if (item.additionalType == 4) {
// // attType (1文本,2图片,3视频,4链接,5小程序,6附件,7活动)
// // attContent 附件内容
// // 文字
// let txtObj = item.object.attachmentList.find(k => k.attType == 1)
// item.object.showTxtContent = txtObj ? txtObj.attContent : ''
// // 图片
// let imgList = item.object.attachmentList.filter(k => k.attType == 2)
// item.object.showImgContent = imgList || []
// // 视频
// let videoList = item.object.attachmentList.filter(k => k.attType == 3)
// item.object.showVideoContent = videoList || []
// }
})
console.log(this.copyForm.eventList)
this.editForm.eventList = this.copyForm.eventList
this.$nextTick(() => {
this.editStatus = false
......@@ -478,33 +600,29 @@ export default {
this.currentCustomerIdx = this.customerDataList.findIndex(item => item.confId == this.editForm.customerOptType)
this.recoverCustomerList()
this.editForm.customerOptUpdate = this.editForm.customerOptUpdate + ''
// this.editForm.customerInfoList = this.editForm.customerInfoList || []
// this.editForm.customerInfoList.forEach(item => {
// item.id = item.customerId
//
// this.editForm.eventList.forEach(item => {
// console.log(item.object)
// if (item.object) {
// item.object.objectId = item.objectId
// item.object.objectType = item.objectType
// item.object.objectName = item.objectName
// item.object.additionalType = item.additionalType
// }
// if (item.additionalType == 4) {
// // attType (1文本,2图片,3视频,4链接,5小程序,6附件,7活动)
// // attContent 附件内容
// // 文字
// let txtObj = item.object.attachmentList.find(k => k.attType == 1)
// item.object.showTxtContent = txtObj ? txtObj.attContent : ''
// // // 图片
// let imgList = item.object.attachmentList.filter(k => k.attType == 2)
// item.object.showImgContent = imgList || []
// // // 视频
// let videoList = item.object.attachmentList.filter(k => k.attType == 3)
// item.object.showVideoContent = videoList || []
// }
// })
// this.editForm.customerInfoList.length && this.recoveryCondLimit()
this.editForm.eventList.forEach(item => {
if (item.object) {
item.object.objectId = item.objectId
item.object.objectType = item.objectType
// item.object.objectName = item.object.packageName
item.object.objectName = item.objectName
item.object.additionalType = item.additionalType
}
if (item.additionalType == 4) {
// attType (1文本,2图片,3视频,4链接,5小程序,6附件,7活动)
// attContent 附件内容
// 文字
let txtObj = item.object.attachmentList.find(k => k.attType == 1)
item.object.showTxtContent = txtObj ? txtObj.attContent : ''
// 图片
let imgList = item.object.attachmentList.filter(k => k.attType == 2)
item.object.showImgContent = imgList || []
// 视频
let videoList = item.object.attachmentList.filter(k => k.attType == 3)
item.object.showVideoContent = videoList || []
}
})
this.editDisabled = new Date(this.editForm.startDate) < new Date()
this.editDisabled && this.judgeDisable()
this.$nextTick(() => {
......@@ -564,7 +682,7 @@ export default {
break
}
this.editForm.customerInfoList = JSON.parse(JSON.stringify(this.customerDataList[this.currentCustomerIdx].list))
this.$refs.editFormRef.$refs[this.editChildRef].validateField('customerInfoList')
this.$refs.editFormRef && this.$refs.editFormRef.$refs[this.editChildRef].validateField('customerInfoList')
// this.key = new Date()
},
......@@ -753,6 +871,7 @@ export default {
2: 'W'
}
this.customerDataList[this.currentCustomerIdx].list.forEach(item => {
list.push({
customerId: item.id,
customerName: item.customerName,
......@@ -760,6 +879,7 @@ export default {
customerSex: item.customerSex ? sexToObj[item.customerSex] : 'U',
customerWxAdd: item.isJoin ? 'Y' : 'N',
customerTimeAdd: item.addTime,
customerNickName: item.customerNickName,
externalUserId: item.oneid
})
})
......@@ -785,6 +905,7 @@ export default {
return true
}
var params = this.$common.utils.deepClone(this.editForm)
let videoImageStorage = []
// params.customerIds = this.editForm.customerInfoList.map(item => item.id).join(',')
params[this.customerDataList[this.currentCustomerIdx].reqListName] = JSON.stringify(this.reqCustAttrs())
params.customerCount = this.customerDataList[this.currentCustomerIdx].customerCount
......@@ -797,61 +918,244 @@ export default {
if (this.routeInfo.addOrEdit == 'edit') {
params.id = this.routeInfo.id
params.eventList = []
params.backupList = []
var idx = 0
this.editForm.eventList.forEach((item, index) => {
if (new Date(item.eventStartDate) > new Date()) {
params.eventList.push({
eventContent: item.eventContent,
// eventCount: item.eventCount,
eventStartDate: item.eventStartDate,
eventTime: item.eventTime,
pushChannelType: item.pushChannelType,
repeatFlag: item.repeatFlag,
repeatMode: item.repeatMode,
predictCount: item.predictCount,
// sopName: item.sopName,
// sopId: this.routeInfo.id,
followerTypeId: item.followerTypeId,
followerTypeName: item.followerTypeName,
reachesType: item.reachesType,
reachesTypeSet: item.reachesTypeSet
})
params.eventList.push(
{
backupContent: item.backupContent,
eventStartDate: item.eventStartDate,
eventTime: item.eventTime,
pushChannelType: item.pushChannelType,
repeatFlag: item.repeatFlag,
repeatMode: item.repeatMode,
predictCount: item.predictCount,
// sopName: item.sopName,
// sopId: this.routeInfo.id,
followerTypeId: item.followerTypeId,
followerTypeName: item.followerTypeName,
reachesType: item.reachesType,
reachesTypeSet: item.reachesTypeSet,
resourceList: []
})
if (item.id) {
params.eventList[idx].id = item.id
params.eventList[index].id = item.id
}
if (item.repeatFlag == 'Y') {
params.eventList[idx].repeatTime = item.repeatTime
params.eventList[idx].eventEndDate = item.eventEndDate
}
if (item.object) {
params.eventList[idx].objectId = item.object.objectId
params.eventList[idx].additionalType = item.object.additionalType
params.eventList[idx].objectType = item.object.objectType
delete params.eventList[idx].object
let backupContent = typeof (item.backupContent) == 'string' ? JSON.parse(item.backupContent) : item.backupContent
if (backupContent && backupContent.length <= 2) {
backupContent.forEach(obj => {
if (obj && obj.attType == 1) {
params.eventList[index].eventContent = obj.attContent
}
if (obj && obj.attType == 2) {
params.eventList[index].additionalType = 5
params.eventList[index].objectType = 11
videoImageStorage.push(obj.attContent)
params.eventList[index].resourceList = videoImageStorage
videoImageStorage = []
}
if (obj && obj.attType == 3) {
params.eventList[index].additionalType = 5
params.eventList[index].objectType = 12
videoImageStorage.push(obj.attContent)
params.eventList[index].resourceList = videoImageStorage
videoImageStorage = []
}
// 活动
if (obj && obj.attType == 7) {
params.eventList[index].additionalType = 2
let attContentCopy = JSON.parse(obj.attContent)
if (attContentCopy.marketingContent.selectType == 'coupon') {
params.eventList[index].additionalType = 3
params.eventList[index].objectType = 5
params.eventList[index].objectId = attContentCopy.marketingId
}
if (attContentCopy.marketingContent.selectType == 'card') {
params.eventList[index].objectType = 6
params.eventList[index].objectId = attContentCopy.marketingId
}
if (attContentCopy.marketingContent.selectType == 'package') {
params.eventList[index].objectType = 7
params.eventList[index].objectId = attContentCopy.marketingId
}
// 还差一个秒杀活动
if (attContentCopy.marketingContent.selectType == 'activity') {
params.eventList[index].objectType = 8
params.eventList[index].objectId = attContentCopy.marketingId
}
}
// 素材
if (obj && obj.attType == 6) {
params.eventList[index].additionalType = 1
params.eventList[index].objectType = 10
let backupattContent = typeof (obj.attContent) == 'string' ? JSON.parse(obj.attContent) : obj.attContent
params.eventList[index].objectId = backupattContent.objectId
}
})
} else {
backupContent.forEach(obj => {
if (obj && obj.attType == 1) {
params.eventList[index].eventContent = obj.attContent
}
if (obj && obj.attType == 2) {
params.eventList[index].additionalType = 5
params.eventList[index].objectType = 11
params.eventList[index].resourceList.push(obj.attContent)
}
if (obj && obj.attType == 6) {
params.eventList[index].additionalType = 6
let backupattContent = typeof (obj.attContent) == 'string' ? JSON.parse(obj.attContent) : obj.attContent
params.eventList[index].objectId = backupattContent.objectId
}
if (obj && obj.attType == 7) {
let attContentCopy = JSON.parse(obj.attContent)
if (attContentCopy.marketingContent.selectType == 'coupon') {
params.eventList[index].objectType = 16
params.eventList[index].objectCombId = attContentCopy.marketingId
}
if (attContentCopy.marketingContent.selectType == 'card') {
params.eventList[index].objectType = 14
params.eventList[index].objectCombId = attContentCopy.marketingId
}
if (attContentCopy.marketingContent.selectType == 'package') {
params.eventList[index].objectType = 15
params.eventList[index].objectCombId = attContentCopy.marketingId
}
if (attContentCopy.marketingContent.selectType == 'activity') {
params.eventList[index].objectType = 13
params.eventList[index].objectCombId = attContentCopy.marketingId
}
}
})
}
idx = idx + 1
} else {
params.eventList.push(item)
params.eventList[index].isDelete = true
}
})
} else {
console.log('1111111')
// 这边走的是新增
params.eventList = []
this.editForm.eventList.forEach((item, index) => {
params.eventList.push(JSON.parse(JSON.stringify(item)))
if (item.object) {
params.eventList[index].objectId = item.object.objectId
params.eventList[index].additionalType = item.object.additionalType
params.eventList[index].objectType = item.object.objectType
params.eventList[index].resourceList = []
if (item.object && item.object.length <= 2) {
item.object.forEach(obj => {
if (obj && obj.attType == 1) {
params.eventList[index].eventContent = obj.attContent
}
if (obj && obj.attType == 2) {
params.eventList[index].additionalType = 5
params.eventList[index].objectType = 11
videoImageStorage.push(obj.attContent)
params.eventList[index].resourceList = videoImageStorage
videoImageStorage = []
}
if (obj && obj.attType == 3) {
params.eventList[index].additionalType = 5
params.eventList[index].objectType = 12
videoImageStorage.push(obj.attContent)
params.eventList[index].resourceList = videoImageStorage
videoImageStorage = []
}
if (obj && obj.attType == 6) {
params.eventList[index].additionalType = 1
params.eventList[index].objectType = 10
let backupattContent = typeof (obj.attContent) == 'string' ? JSON.parse(obj.attContent) : obj.attContent
params.eventList[index].objectId = backupattContent.objectId
}
if (obj && obj.attType == 7) {
params.eventList[index].additionalType = 2
let attContentCopy = JSON.parse(obj.attContent)
if (attContentCopy.marketingContent.selectType == 'coupon') {
params.eventList[index].additionalType = 3
params.eventList[index].objectType = 5
params.eventList[index].objectId = attContentCopy.marketingId
}
if (attContentCopy.marketingContent.selectType == 'card') {
params.eventList[index].objectType = 6
params.eventList[index].objectId = attContentCopy.marketingId
}
if (attContentCopy.marketingContent.selectType == 'package') {
params.eventList[index].objectType = 7
params.eventList[index].objectId = attContentCopy.marketingId
}
if (attContentCopy.marketingContent.selectType == 'activity') {
params.eventList[index].objectType = 8
params.eventList[index].objectId = attContentCopy.marketingId
}
}
})
params.eventList[index].backupContent = item.object
delete params.eventList[index].object
} else {
item.object.forEach(obj => {
if (obj && obj.attType == 1) {
params.eventList[index].eventContent = obj.attContent
}
if (obj && obj.attType == 2) {
params.eventList[index].additionalType = 5
params.eventList[index].objectType = 11
params.eventList[index].resourceList.push(obj.attContent)
}
if (obj && obj.attType == 6) {
params.eventList[index].additionalType = 6
let backupattContent = typeof (obj.attContent) == 'string' ? JSON.parse(obj.attContent) : obj.attContent
params.eventList[index].objectId = backupattContent.objectId
}
if (obj && obj.attType == 7) {
let attContentCopy = JSON.parse(obj.attContent)
if (attContentCopy.marketingContent.selectType == 'coupon') {
params.eventList[index].objectType = 16
params.eventList[index].objectCombId = attContentCopy.marketingId
}
if (attContentCopy.marketingContent.selectType == 'card') {
params.eventList[index].objectType = 14
params.eventList[index].objectCombId = attContentCopy.marketingId
}
if (attContentCopy.marketingContent.selectType == 'package') {
params.eventList[index].objectType = 15
params.eventList[index].objectCombId = attContentCopy.marketingId
}
if (attContentCopy.marketingContent.selectType == 'activity') {
params.eventList[index].objectType = 13
params.eventList[index].objectCombId = attContentCopy.marketingId
}
}
})
params.eventList[index].backupContent = item.object
delete params.eventList[index].object
}
})
}
// console.log(params)
if (this.editDisabled) {
var batchEditParams = {
sopId: params.id,
deleteIdList: this.deleteIdList,
editList: params.eventList
}
batchEditParams.editList.forEach((item, indx) => {
if (item.backupContent instanceof Array) {
item.backupContent = JSON.stringify(item.backupContent)
}
if (item.isDelete) {
delete batchEditParams.editList[indx]
}
delete item.isDelete
})
batchEditParams.editList = batchEditParams.editList.filter(current => {
return current !== undefined
})
// 事件进行时,批量编辑sop事件
this.$apis.sop.batchEditSopEventApi(batchEditParams).then(res => {
this.$message({
......@@ -1002,12 +1306,17 @@ export default {
line-height: 24px;
}
.event-flex {
display: flex;
}
.event-btns {
position: absolute;
top: 16px;
right: 16px;
display: flex;
.newBtnSty{
.newBtnSty {
margin-right: 8px;
}
}
......@@ -1018,4 +1327,124 @@ export default {
}
}
}
.welcome-activity-panel {
display: flex;
margin-right: 10px;
.welcome-activity-box {
cursor: pointer;
position: relative;
min-width: 180px;
background: #fafbfe;
border-radius: 2px;
border: 1px solid #e8e8ea;
padding: 8px;
box-sizing: border-box;
display: flex;
&:hover {
.delete-solid {
opacity: 1;
}
}
.welcome-activity-icon {
width: 36px;
height: 36px;
margin-right: 8px;
position: relative;
background-size: 100% 100%;
img {
width: 100%;
height: 100%;
}
video {
object-fit: fill;
}
.el-icon-video-play {
position: absolute;
top: 7px;
left: 7px;
font-size: 22px;
color: rgba(255, 255, 255, 0.8);
}
.img-filter-box {
position: absolute;
top: 0px;
left: 0px;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.5);
color: rgba(255, 255, 255, 0.8);
display: flex;
font-size: 13px;
align-items: center;
justify-content: center;
}
}
.delete-solid {
transition: all 0.5s;
opacity: 0;
position: absolute;
top: 0px;
right: 0px;
width: 14px;
height: 14px;
background: rgba(0, 0, 0, 0.5);
display: flex;
font-size: 12px;
align-items: center;
justify-content: center;
}
.el-icon-delete-solid {
color: rgba(255, 255, 255, 0.5);
}
.model-item-title {
font-size: 14px;
font-weight: 600;
color: #333333;
line-height: 20px;
max-width: 150px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.model-item-content {
font-size: 12px;
font-weight: 400;
color: #999999;
line-height: 17px;
max-width: 150px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
span {
color: #5850ff;
}
}
}
}
.textHidden {
max-width: 1000px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.event-inline {
margin-top: 8px;
display: inline-block
}
</style>
<template>
<div class="img-bg">
<div class="preview-content">
<div class="preview-time">{{ currentTime }}</div>
<div :class="{'preview-info':true,'isMargin':previewList && previewList[2] && previewList[2].attType == 6 && item.attType ==6}" v-for="item in previewList" :key="item.id">
<img class="avatar" src="@/assets/guestCustom/default-customer.png" v-if="!(hasSixType && hasSevenType) || item.attType !== 7" alt/>
<template v-if="item.attType == 1">
<div class="preview-text text" v-html="item.attContent"></div>
</template>
<template v-else-if="hasSixType || hasSevenType">
<temlate v-if="hasSixType && hasSevenType">
<template v-if="item.attType == 6">
<div class="preview-pdf">
<div class="pdf-title">{{ item.attContent.fileName }}</div>
<div class="preview-link">
<img src="@/assets/guestCustom/preview-link.png" alt=""/>
</div>
</div>
</template>
</temlate>
<template v-else>
<template v-if="item.attType == 6">
<div class="preview-pdf">
<div class="pdf-title">{{ item.attContent.fileName }}</div>
<div class="preview-link">
<img src="@/assets/guestCustom/preview-link.png" alt=""/>
</div>
</div>
</template>
<template v-if="item.attType == 7">
<div class="preview-activity">
<div class="activity-name">{{ item.attContent.marketingName }}</div>
<img
v-if="item.attContent.marketingType != 5 && item.attContent.marketingType != 6 && item.attContent.marketingType != 7"
class="activity-logo" src="@/assets/guestCustom/activity-logo.png" alt/>
<img v-if="item.attContent.marketingType == 5" class="activity-logo"
src="@/assets/guestCustom/activity-spike.png" alt/>
<img v-if="item.attContent.marketingType == 6" class="activity-logo"
src="@/assets/guestCustom/activity-service.png" alt/>
<img v-if="item.attContent.marketingType == 7" class="link-logo" src="@/assets/guestCustom/link.png"
alt/>
<div class="activity-footer" v-if="item.attContent.marketingType != 7">
<img src="@/assets/guestCustom/applet-footer.png" alt/>
</div>
</div>
</template>
</template>
</template>
<template v-else-if="item.attType == 4">
<div class="preview-activity">
<div class="activity-name">{{ item.attContent.title }}</div>
<img class="link-logo" src="@/assets/guestCustom/link.png" alt/>
</div>
</template>
<template v-else-if="item.attType == 2">
<el-image style="width: 100px" :src="item.attContent" fit="contain"></el-image>
</template>
<template v-else-if="item.attType == 3">
<div class="video-panel" :key="itm">
<video id="video" width="95">
<source :src="item.attContent" type="video/mp4"/>
</video>
<i class="el-icon-video-play"></i>
</div>
</template>
<template v-else-if="item.attType == 5">
<div class="preview-text text preview-applet">
<div class="preview-applet-title">
<img :src="item.attContent.picUrl" alt/>
<span>{{ item.attContent.title }}</span>
</div>
{{ item.attContent.page }}
</div>
</template>
<!-- <template v-else-if="item.attType == 6">-->
<!-- <div class="preview-pdf">-->
<!-- <div class="pdf-title">{{ item.attContent.fileName }}</div>-->
<!-- <div class="preview-link">-->
<!-- <img src="@/assets/guestCustom/preview-link.png" alt="" />-->
<!-- </div>-->
<!-- </div>-->
<!-- </template>-->
</div>
</div>
</div>
</template>
<script>
import {utils} from 'glsx-common'
import emoji from '@/utils/emo'
export default {
name: 'Preview',
props: {eventBus: Object, previewVal: Array},
data() {
return {
previewList: [],
currentTime: '',
hasSixType: false,
hasSevenType: false
}
},
watch: {
previewList(val) {
if (val.length) {
this.hasSixType = val.some(item => item.attType == 6)
this.hasSevenType = val.some(item => item.attType == 7)
val.forEach(item => {
if (item.attType == 1) {
const attContent = item.attContent
const htm = attContent.replace(/\[[\u4E00-\u9FA56]{1,4}]/gi, function (res) {
let word = res.replace(/\[|\]/gi, '')
const list = emoji.flat(Infinity)
let index = parseInt(list.indexOf(word)) + 1
if (index < 10) {
index = '00' + index
} else if (index >= 10 && index < 100) {
index = '0' + index
}
return `<img style="width: 16px;height: 16px;vertical-align: middle;" src="https://img01.glsx.com.cn/weapp/resource/saas/scrm/emoji/${index}.png">`
})
item.attContent = htm
} else if (item.attType != 2 && item.attType != 3 && item.attType != 7) {
// console.log(item.attContent, JSON.parse(item.attContent).fileName)
item.attContent = JSON.parse(item.attContent)
}
})
}
},
previewVal: {
handler(val) {
console.log(val)
this.previewList = utils.deepClone(val).filter(item => item.attContent)
},
deep: true
}
},
created() {
if (this.eventBus) {
this.eventBus.$on('update', val => {
this.previewList = val
})
}
},
mounted() {
const date = new Date()
let hours = date.getHours()
hours = hours < 10 ? `0${hours}` : hours
let minutes = date.getMinutes()
minutes = minutes < 10 ? `0${minutes}` : minutes
this.currentTime = `${date.getFullYear()}年${date.getMonth() + 1}月${date.getDate()}日 ${hours}:${minutes}`
},
}
</script>
<style lang="scss" scoped>
.isMargin{
margin-top: -20px;
}
.img-bg {
position: relative;
width: 290px;
height: 566px;
background-image: url(../../../../../assets/guestCustom/iphone-bg.png);
background-size: 100%;
.preview-content {
position: absolute;
width: 250px;
height: 350px;
overflow-y: auto;
top: 115px;
left: 20px;
// background-color: cornflowerblue;
.preview-time {
font-size: 10px;
color: #999;
text-align: center;
margin-bottom: 15px;
}
.preview-info {
display: flex;
padding: 0 44px 20px 9px;
.avatar {
width: 26px;
height: 26px;
margin-right: 8px;
}
.preview-text {
position: relative;
max-width: 169px;
color: #333;
background-color: #fff;
border-radius: 4px;
word-break: break-all;
display: flex;
// img {
// width: 16px;
// height: 16px;
// vertical-align: middle;
// }
}
.text {
display: inline-block;
font-size: 12px;
padding: 8px 11px;
line-height: 16px;
white-space: pre-wrap;
}
.preview-link {
display: flex;
justify-content: flex-end;
img {
width: 30px;
height: 30px;
}
}
.preview-text::before {
content: '';
position: absolute;
left: -10px;
top: 20%;
border-width: 5px;
border-style: dashed solid dashed dashed;
border-color: transparent #fff transparent transparent;
// background-color: cornflowerblue;
}
.preview-applet {
img {
width: 20px;
height: 20px;
margin-right: 4px;
}
&-title {
display: flex;
align-self: center;
color: #999;
margin-bottom: 5px;
}
}
.preview-activity {
width: 160px;
// height: 184px;
background-color: #fff;
border-radius: 4px;
border: 1px solid #dce1e5;
padding: 7px 7px 0;
.activity-name {
font-size: 12px;
color: #333;
margin: 7px 0 4px;
width: 160px;
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
}
.applet-logo {
width: 95px;
height: 24px;
}
.activity-footer {
margin-top: 4px;
border-top: 1px solid #edeff3;
}
}
.preview-pdf {
width: 158px;
height: 62px;
background-color: #fff;
padding: 5px 13px;
box-sizing: border-box;
.pdf-title {
font-size: 12px;
color: #333;
line-height: 16px;
max-width: 90px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
}
.video-panel {
position: relative;
.el-icon-video-play {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
z-index: 10;
font-size: 20px;
color: #fff;
// cursor: pointer;
}
}
}
}
}
.link-logo {
width: 30px;
height: 30px;
margin-left: 131px;
margin-bottom: 5px;
}
</style>
<template>
<div class="img-bg">
<div class="preview-content">
<div class="preview-info" v-show="previewListFilter.length">
<img class="avatar" src="@/assets/guestCustom/default-customer.png" alt />
<template v-if="previewListFilter && previewListFilter.length <= 3">
<div class="preview-box" v-for="item in previewListFilter" :key="item.id">
<div class="preview-box-desc">
<template v-if="item.attType == 1">
<div class="preview-text text" v-html="item.attContent"></div>
</template>
<template v-else-if="item.attType == 7">
<div class="preview-text preview-link">
<img src="@/assets/guestCustom/preview-link.png" alt />
<div>{{item.attContent.marketingName }}</div>
</div>
</template>
<template v-else-if="item.attType == 6">
<div class="preview-text preview-link">
<img src="@/assets/guestCustom/preview-link.png" alt />
<div>{{JSON.parse(item.attContent).fileName}}</div>
</div>
</template>
<template v-else-if="item.attType == 2" v-for="(imgItem, index) in item.attContent">
<el-image style="width: 52px; height: 52px" class="img-list" :src="imgItem" fit="fit" :key="index" :preview-src-list="item.attContent"></el-image>
</template>
<template v-else-if="item.attType == 3">
<!-- <el-image style="width: 100px" :src="item.attContent" fit="contain"></el-image> -->
<div class="video-panel">
<video id="video" width="100%" height="100%" preload loop muted>
<source :src="item.attContent" type="video/mp4" />
</video>
<i
class="el-icon-video-play"
@click="
videoShow = true
videoUrl = item.attContent
"
></i>
</div>
</template>
</div>
</div>
</template>
<template v-else>
<div class="preview-box" v-for="item in previewListFilter" :key="item.id">
<div class="preview-box-desc">
<template v-if="item.attType == 1">
<div class="preview-text text" v-html="item.attContent"></div>
</template>
<!-- <template v-else-if="item.attType == 7">-->
<!-- <div class="preview-text preview-link">-->
<!-- <img src="@/assets/guestCustom/preview-link.png" alt />-->
<!-- <div>{{item.attContent.marketingName }}</div>-->
<!-- </div>-->
<!-- </template>-->
<template v-else-if="item.attType == 6">
<div class="preview-text preview-link">
<img src="@/assets/guestCustom/preview-link.png" alt />
<div>{{JSON.parse(item.attContent).fileName}}</div>
</div>
</template>
<template v-else-if="item.attType == 2" v-for="(imgItem, index) in item.attContent">
<el-image style="width: 52px; height: 52px" class="img-list" :src="imgItem" fit="fit" :key="index" :preview-src-list="item.attContent"></el-image>
</template>
<template v-else-if="item.attType == 3">
<!-- <el-image style="width: 100px" :src="item.attContent" fit="contain"></el-image> -->
<div class="video-panel">
<video id="video" width="100%" height="100%" preload loop muted>
<source :src="item.attContent" type="video/mp4" />
</video>
<i
class="el-icon-video-play"
@click="
videoShow = true
videoUrl = item.attContent
"
></i>
</div>
</template>
</div>
</div>
</template>
<div class="preview-operation">赞 | 评论</div>
</div>
</div>
<div class="video-dialog" v-if="videoShow">
<div class="video-dialog-panel">
<div class="video-close"><i class="el-icon-close" @click="videoShow = false"></i></div>
<video height="100%" autoplay controls :src="this.videoUrl"></video>
</div>
</div>
</div>
</template>
<script>
const ATT_TYPE = {
TEXT: 1,
IMAGE: 2,
VEDIO: 3,
URL: 4,
MINIPROGRAM: 5,
FILE: 6,
ACTIVITY: 7
}
import emoji from '@/utils/emo'
export default {
name: 'Preview',
props: { previewView: Array },
data() {
return {
videoShow: false,
previewList: [],
previewListFilter: [],
videoUrl: ''
}
},
watch: {
previewView: {
handler(val) {
const previewVal = this.$common.utils.deepClone(val).filter(item => item)
console.log(previewVal)
this.previewListFilter = []
for (let i in previewVal) {
if (previewVal[i].attType == 1) {
const attContent = previewVal[i].attContent
const htm = attContent.replace(/\[[\u4E00-\u9FA56]{1,4}]/gi, function(res) {
let word = res.replace(/\[|\]/gi, '')
const list = emoji.flat(Infinity)
let index = parseInt(list.indexOf(word)) + 1
if (index < 10) {
index = '00' + index
} else if (index >= 10 && index < 100) {
index = '0' + index
}
return `<img src="https://img01.glsx.com.cn/weapp/resource/saas/scrm/emoji/${index}.png">`
})
this.previewListFilter.push({
attType: 1,
attContent: htm
})
} else if (previewVal[i].attType == 2) {
const pindex = this.previewListFilter.findIndex(item => item.attType == 2)
if (pindex == -1) {
this.previewListFilter.push({
attType: 2,
attContent: [previewVal[i].attContent]
})
} else {
this.previewListFilter[pindex].attContent.push(previewVal[i].attContent)
}
} else {
this.previewListFilter.push({
attType: previewVal[i].attType,
attContent: previewVal[i].attContent
})
}
}
this.$nextTick(() => {
this.previewListFilter = this.previewListFilter.filter(item => item)
})
},
deep: true
}
}
}
</script>
<style lang="scss" scoped>
.img-list {
margin-right: 3px;
}
.img-bg {
position: relative;
width: 290px;
height: 566px;
background-image: url(../../../../../assets/guestCustom/friend-bg.png);
background-size: 100%;
.preview-content {
position: absolute;
width: 250px;
height: 350px;
overflow-y: auto;
top: 90px;
left: 20px;
// background-color: cornflowerblue;
.preview-time {
font-size: 10px;
color: #999;
text-align: center;
margin-bottom: 15px;
}
.preview-info {
padding: 0 0px 20px 9px;
position: relative;
.avatar {
position: absolute;
top: 0px;
left: 5px;
width: 26px;
height: 26px;
margin-right: 8px;
}
.preview-box {
margin-left: 30px;
width: 180px;
}
.preview-operation {
float: right;
margin-right: 30px;
margin-top: 15px;
text-align: center;
width: 64px;
height: 22px;
line-height: 22px;
background: #f7f7f7;
font-size: 10px;
font-weight: 400;
color: #556993;
}
.video-panel {
width: 100%;
height: 102px;
display: flex;
align-items: center;
justify-content: center;
position: relative;
video {
position: absolute;
}
i {
z-index: 10;
font-size: 20px;
color: #fff;
cursor: pointer;
}
}
.preview-text {
font-size: 14px;
position: relative;
color: #333;
background-color: #fff;
border-radius: 4px;
word-wrap: break-word;
word-break: break-all;
line-height: 20px;
/deep/ img {
width: 20px;
height: 20px;
vertical-align: middle;
}
}
.text {
width: 100%;
font-size: 12px;
padding: 0px;
margin-bottom: 6px;
}
.preview-link {
padding: 6px 0px;
font-size: 12px;
background: #f7f7f7;
display: flex;
align-items: center;
img {
margin: 0px 12px 0px 5px;
width: 24px;
height: 24px;
}
div {
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
line-clamp: 2;
-webkit-box-orient: vertical;
}
}
.preview-text::before {
content: '';
position: absolute;
left: -10px;
top: 20%;
border-width: 5px;
border-style: dashed solid dashed dashed;
border-color: transparent #fff transparent transparent;
// background-color: cornflowerblue;
}
.preview-applet {
img {
width: 20px;
height: 20px;
margin-right: 4px;
}
&-title {
display: flex;
align-self: center;
color: #999;
margin-bottom: 5px;
}
}
.preview-activity {
width: 160px;
// height: 184px;
background-color: #fff;
border-radius: 4px;
border: 1px solid #dce1e5;
padding: 7px 7px 0;
.activity-name {
font-size: 12px;
color: #333;
margin: 7px 0 4px;
width: 160px;
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
}
.applet-logo {
width: 95px;
height: 24px;
}
.activity-footer {
margin-top: 4px;
border-top: 1px solid #edeff3;
}
}
}
}
}
.video-dialog {
z-index: 2001;
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
overflow: auto;
background: rgba($color: #000000, $alpha: 0.5);
&-panel {
background: #000000;
position: absolute;
top: 100px;
left: 50%;
transform: translateX(-50%);
height: calc(100% - 200px);
width: auto;
box-sizing: border-box;
padding: 10px 20px 20px;
overflow: hidden;
.video-close {
display: flex;
justify-content: flex-end;
height: 40px;
i {
cursor: pointer;
font-size: 25px;
color: #5850ff;
}
}
}
}
</style>
<template>
<div class="form-image">
<img src="@/images/phone.png" />
<div class="preview-content">
<div class="preview-info">
<!-- <div class="preview-text text" v-if="addForm.messageContext">【短信签名】{{ addForm.messageContext }}</div>-->
<div class="preview-box" v-for="item in previewListFilter" :key="item.id">
<div class="preview-box-desc">
<template v-if="item.attType == 1">
<div class="preview-text text" v-html="item.attContent"></div>
</template>
<!-- <template v-if="item.attType == 7">-->
<!-- <div class="preview-text preview-link">-->
<!-- <img src="@/assets/guestCustom/preview-link.png" alt />-->
<!-- <div>{{ item.attContent[0].marketingName }}</div>-->
<!-- </div>-->
<!-- </template>-->
<!-- <template v-else-if="item.attType == 2" v-for="(imgItem, index) in item.attContent">-->
<!-- <el-image style="width: 52px; height: 52px" class="img-list" :src="imgItem" fit="fit" :key="index" :preview-src-list="item.attContent"></el-image>-->
<!-- </template>-->
<!-- <template v-else-if="item.attType == 3">-->
<!-- &lt;!&ndash; <el-image style="width: 100px" :src="item.attContent" fit="contain"></el-image> &ndash;&gt;-->
<!-- <div class="video-panel">-->
<!-- <video id="video" width="100%" height="100%" preload loop muted>-->
<!-- <source :src="item.attContent" type="video/mp4" />-->
<!-- </video>-->
<!-- <i-->
<!-- class="el-icon-video-play"-->
<!-- @click="-->
<!-- videoShow = true-->
<!-- videoUrl = item.attContent-->
<!-- "-->
<!-- ></i>-->
<!-- </div>-->
<!-- </template>-->
</div>
</div>
</div>
</div>
</div>
</template>
<script>
import emoji from "@/utils/emo";
export default {
name: 'MessagePreview',
props: { previewView: Array },
data() {
return {
previewListFilter:[]
}
},
watch: {
previewView: {
handler(val) {
const previewVal = this.$common.utils.deepClone(val).filter(item => item)
console.log(previewVal)
this.previewListFilter = []
for (let i in previewVal) {
if (previewVal[i].attType == 1) {
const attContent = previewVal[i].attContent
const htm = attContent.replace(/\[[\u4E00-\u9FA56]{1,4}]/gi, function(res) {
let word = res.replace(/\[|\]/gi, '')
const list = emoji.flat(Infinity)
let index = parseInt(list.indexOf(word)) + 1
if (index < 10) {
index = '00' + index
} else if (index >= 10 && index < 100) {
index = '0' + index
}
return `<img style="width: 18px;
height: 18px;" src="https://img01.glsx.com.cn/weapp/resource/saas/scrm/emoji/${index}.png">`
})
this.previewListFilter.push({
attType: 1,
attContent: htm
})
} else if (previewVal[i].attType == 2) {
const pindex = this.previewListFilter.findIndex(item => item.attType == 2)
if (pindex == -1) {
this.previewListFilter.push({
attType: 2,
attContent: [previewVal[i].attContent]
})
} else {
this.previewListFilter[pindex].attContent.push(previewVal[i].attContent)
}
} else {
this.previewListFilter.push({
attType: previewVal[i].attType,
attContent: previewVal[i].attContent
})
}
}
this.$nextTick(() => {
this.previewListFilter = this.previewListFilter.filter(item => item)
})
},
deep: true
}
},
methods: {
}
}
</script>
<style lang="scss" scoped>
.form-image {
width: 280px;
height: 546px;
margin: 20px 80px 20px 0;
position: relative;
.preview-content {
position: absolute;
width: 250px;
height: 320px;
overflow-y: auto;
top: 125px;
left: 50px;
.preview-text {
padding: 10px;
position: relative;
width: 160px;
color: #333;
background-color: #f4f4f4;
border-radius: 4px;
word-wrap: break-word;
margin-bottom: 10px;
line-height: 15px;
}
}
img {
width: 100%;
height: auto;
}
}
</style>
......@@ -57,6 +57,12 @@ export default {
type: 'input',
isClear: true,
maxlength: 11
},
{
label: '企微名称',
name: 'nickName',
type: 'input',
isClear: true,
}
],
// 表格
......@@ -80,6 +86,14 @@ export default {
}
},
{
label: '企微名称',
prop: 'nickNameList',
width: '130px',
formatter: cellValue => {
return cellValue.nickNameList[0] && cellValue.nickNameList[0].nickName || '-'
}
},
{
label: '客户手机号',
prop: 'customerPhone',
width: '130px',
......@@ -197,16 +211,20 @@ export default {
var selectIds = currentList.map(item => item.id)
var selectedIds = val.map(item => item.id)
var tempList = []
val.forEach(item => {
val.forEach((item,index) => {
if (!selectIds.includes(item.id) && tableIds.includes(item.id) && this.selectedCustomerList.length < this.maxCustNum) {
this.selectedCustomerList.push(item)
}
if (item.nickNameList.length){
this.selectedCustomerList[index].customerNickName = item.nickNameList[0].nickName || ''
}
})
this.selectedCustomerList.forEach(item => {
if (selectedIds.includes(item.id) || !tableIds.includes(item.id)) {
tempList.push(item)
}
})
this.selectedCustomerList = tempList
this.recoverySelected()
},
......
......@@ -4,90 +4,103 @@
<!-- 营销时间 -->
<div class="container m-b-20">
<p class="edit-title">营销时间</p>
<glsx-combi-form class="edit-form-container m-r-20" :isEdit="isEdit" :labelWidth="labelWidth" defaultWidth="320px" :isBlock="true" :formRef="editChildRef" :formObj="editForm" :formData="sopNameFormData" :formRules="editRule"></glsx-combi-form>
<glsx-combi-form ref="editFormRefDate" :isEdit="isEdit" :labelWidth="labelWidth" defaultWidth="320px" :formRef="editChildRef" :formObj="editForm" :formData="editFormDataDate" :formRules="editRule">
<glsx-combi-form class="edit-form-container m-r-20" :isEdit="isEdit" :labelWidth="labelWidth" defaultWidth="320px"
:isBlock="true" :formRef="editChildRef" :formObj="editForm" :formData="sopNameFormData"
:formRules="editRule"></glsx-combi-form>
<glsx-combi-form ref="editFormRefDate" :isEdit="isEdit" :labelWidth="labelWidth" defaultWidth="320px"
:formRef="editChildRef" :formObj="editForm" :formData="editFormDataDate" :formRules="editRule">
<div slot="eventStartDate" slot-scope="scope">
<el-date-picker class="m-r-20" v-model="editForm[scope.scope.name]" :placeholder="scope.scope.placeholder" :value-format="scope.scope.valueFormat" :clearable="scope.scope.isClear" :picker-options="scope.scope.customPickerOptions" @change="scope.scope.change"></el-date-picker>
<el-date-picker class="m-r-20"
v-model="editForm[scope.scope.name]"
:placeholder="scope.scope.placeholder"
:value-format="scope.scope.valueFormat"
:clearable="scope.scope.isClear"
:picker-options="scope.scope.customPickerOptions"
@change="scope.scope.change"></el-date-picker>
</div>
<div slot="eventTime" slot-scope="scope">
<el-time-picker v-model="editForm[scope.scope.name]" value-format="HH:mm" format="HH:mm" :placeholder="scope.scope.placeholder"></el-time-picker>
<el-time-picker v-model="editForm[scope.scope.name]" value-format="HH:mm" format="HH:mm"
:placeholder="scope.scope.placeholder"></el-time-picker>
</div>
</glsx-combi-form>
<glsx-combi-form ref="editFormRefRepeat" :isEdit="isEdit" :labelWidth="labelWidth" defaultWidth="320px" :isBlock="true" :formRef="editChildRef" :formObj="editForm" :formData="editFormDataRepeat" :formRules="editRule"></glsx-combi-form>
<glsx-combi-form ref="editFormRefTime" :isEdit="isEdit" :labelWidth="labelWidth" defaultWidth="320px" :formRef="editChildRef" :formObj="editForm" :formData="editFormDataTime" :formRules="editRule">
<glsx-combi-form ref="editFormRefRepeat" :isEdit="isEdit" :labelWidth="labelWidth" defaultWidth="320px"
:isBlock="true" :formRef="editChildRef" :formObj="editForm" :formData="editFormDataRepeat"
:formRules="editRule"></glsx-combi-form>
<glsx-combi-form ref="editFormRefTime" :isEdit="isEdit" :labelWidth="labelWidth" defaultWidth="320px"
:formRef="editChildRef" :formObj="editForm" :formData="editFormDataTime" :formRules="editRule">
<div class="flex-default m-r-20" slot="repeatTime" slot-scope="scope">
<div class="flex-default m-r-20" v-if="editForm.repeatMode == 2">
<p style="width: 50px">每周</p>
<el-select :size="size" v-model="editForm[scope.scope.name]" placeholder="请选择每周指定日期" @change="handleResetMaxSet">
<el-option v-for="item in baseData.weekList" :key="item.confId" :label="item.confName" :value="item.confId"></el-option>
<el-select :size="size" v-model="editForm[scope.scope.name]" placeholder="请选择每周指定日期"
@change="handleResetMaxSet">
<el-option v-for="item in baseData.weekList" :key="item.confId" :label="item.confName"
:value="item.confId"></el-option>
</el-select>
</div>
<div class="flex-default m-r-20" v-if="editForm.repeatMode == 3">
<p style="width: 50px">每月</p>
<el-select :size="size" v-model="editForm[scope.scope.name]" placeholder="请选择每月指定日期" @change="handleResetMaxSet">
<el-option v-for="item in baseData.monthList" :key="item.confId" :label="item.confName" :value="item.confId"></el-option>
<el-select :size="size" v-model="editForm[scope.scope.name]" placeholder="请选择每月指定日期"
@change="handleResetMaxSet">
<el-option v-for="item in baseData.monthList" :key="item.confId" :label="item.confName"
:value="item.confId"></el-option>
</el-select>
</div>
<div>重复循环至</div>
</div>
<div slot="eventEndDate" slot-scope="scope">
<el-date-picker v-model="editForm[scope.scope.name]" :disabled="!editForm.eventStartDate" :placeholder="scope.scope.placeholder" :value-format="scope.scope.valueFormat" :clearable="scope.scope.isClear" :picker-options="scope.scope.customPickerOptions" @change="handleResetMaxSet"></el-date-picker>
<el-date-picker v-model="editForm[scope.scope.name]" :disabled="!editForm.eventStartDate"
:placeholder="scope.scope.placeholder" :value-format="scope.scope.valueFormat"
:clearable="scope.scope.isClear" :picker-options="scope.scope.customPickerOptions"
@change="handleResetMaxSet"></el-date-picker>
</div>
</glsx-combi-form>
</div>
<!-- 营销内容 -->
<div class="container m-b-20">
<p class="edit-title">营销内容</p>
<glsx-combi-form class="edit-form-container m-r-20" ref="editFormRefContent" :isEdit="isEdit" :labelWidth="labelWidth" defaultWidth="320px" :isBlock="true" :formRef="editChildRef" :formObj="editForm" :formData="editFormDataContent" :formRules="editRule">
<div slot="eventContent" class="content">
<div class="content-bg">
<el-input type="textarea" :disabled="editForm.object ? editForm.object.additionalType == '4' : false" :rows="9" maxlength="280" show-word-limit v-model="editForm.eventContent" @input="textInput" style="-webkit-user-modify: read-write-plaintext-only !important; width: 656px" placeholder="请输入营销文案"></el-input>
<div v-for="(itm, index) in previewList" :key="itm.id">
<!-- additionalType 附加对象类型(1素材,2活动,3优惠券,4朋友券模板) -->
<div v-if="itm.additionalType" class="welcome-file">
<template>
<img class="event-icon" v-if="itm.additionalType != 4" :src="require(`@/assets/sop/icon-${btnList.find(k => k.id == itm.additionalType).type}.png`)" alt />
<div v-if="itm.additionalType == 4">
<div v-if="itm.attContent.showVideoContent.length">
<video class="model-item-img" :src="itm.attContent.showVideoContent[0].attContent" controls="controls" />
<!-- <video v-for="(subItem, subIndex) in itm.attContent.showVideoContent" class="model-item-img" :key="subIndex" :src="subItem.attContent" controls="controls" /> -->
</div>
<div v-if="!itm.attContent.showVideoContent.length && itm.attContent.showImgContent.length">
<img class="model-item-img" :src="itm.attContent.showImgContent[0].attContent" />
<!-- <el-image v-for="(subItem, subIndex) in itm.attContent.showImgContent" class="model-item-img" :key="subIndex" :src="subItem.attContent" :preview-src-list="[subItem.attContent]"></el-image> -->
</div>
</div>
<span v-else :title="itm.attContent.objectName">{{ itm.attContent.objectName }}</span>
</template>
<i class="el-icon-circle-close" @click="close(index)"></i>
</div>
</div>
<div class="btn-group">
<div class="add-btn" v-for="item in btnList" :key="item.id">
<img class="event-icon" :src="require(`@/assets/sop/add-${item.type}.png`)" alt />
<span>{{ item.name }}</span>
<el-link style="opacity: 0" @click="handleFun(item.funName)">{{ item.name }}</el-link>
</div>
</div>
</div>
<div class="marketingContent">
<div class="group-content">
<el-form :model="editForm" :rules="editRule" ref="groupForm" label-width="154px">
<el-form-item class="attachment-panel">
<label slot="label" class="required"><span style="color:red;margin-right: 3px">*</span>营销内容:</label>
<GLEditor ref="welcome" :form="'object'" style="line-height: 12px;width:650px" :btnList="btnList"
@previewWord="previewForm"></GLEditor>
<div v-show="hasEventContentDisplaySpecial" class="el-form-item__error">请输入营销内容</div>
</el-form-item>
</el-form>
</div>
</glsx-combi-form>
<div class="preview">
<Preview :previewVal="previewList" v-if="editForm.pushChannelType == 1"></Preview>
<!-- <MessagePreview :previewView="previewList" v-if="editForm.pushChannelType == 2"></MessagePreview>-->
<FriendGroupPreview :previewView="previewList" v-if="editForm.pushChannelType == 3"></FriendGroupPreview>
</div>
</div>
</div>
<!-- 营销渠道 -->
<div class="container edit-container">
<p class="edit-title">营销渠道</p>
<glsx-combi-form class="edit-form-container m-r-20" ref="editFormRefChannel" :isEdit="isEdit" :labelWidth="labelWidth" defaultWidth="320px" :isBlock="true" :formRef="editChildRef" :formObj="editForm" :formData="editFormDataChannel" :formRules="editRule">
<div v-show="editForm.pushChannelType" slot="channelSuffix" class="edit-tips m-t-8">预估受众用户总数:{{ editForm.pushChannelType == 2 ? predictCountObj.phone : predictCountObj.qiwei }} / {{ predictCountObj.total }}</div>
<glsx-combi-form class="edit-form-container m-r-20" ref="editFormRefChannel" :isEdit="isEdit"
:labelWidth="labelWidth" defaultWidth="320px" :isBlock="true" :formRef="editChildRef"
:formObj="editForm" :formData="editFormDataChannel" :formRules="editRule">
<div v-show="editForm.pushChannelType" slot="channelSuffix" class="edit-tips m-t-8">
预估受众用户总数:{{ editForm.pushChannelType == 2 ? predictCountObj.phone : predictCountObj.qiwei }} /
{{ predictCountObj.total }}
</div>
<template slot="reachesType" slot-scope="scope">
<el-radio-group v-model="editForm[scope.scope.name]" @change="handleReachesType" :disabled="editForm.repeatFlag == 'N'">
<el-radio v-for="(item, index) in scope.scope.optionList" :key="index" :label="item[scope.scope.optionId]">{{ item[scope.scope.optionLabel] }}</el-radio>
<el-radio-group v-model="editForm[scope.scope.name]" @change="handleReachesType"
:disabled="editForm.repeatFlag == 'N'">
<el-radio v-for="(item, index) in scope.scope.optionList" :key="index" :label="item[scope.scope.optionId]">
{{ item[scope.scope.optionLabel] }}
</el-radio>
</el-radio-group>
<span class="m-l-20" v-if="editForm[scope.scope.name] == 2" id="reachesTypeSet">
同一用户最多参与
<el-form-item prop="reachesTypeSet">
<el-input v-model="editForm.reachesTypeSet"></el-input>
<div v-show="editForm.reachesTypeSet && maxReachesTypeSet">
<span class="txt-red" v-if="+maxReachesTypeSet < editForm.reachesTypeSet">该用户最多能参与{{ maxReachesTypeSet }}次</span>
<span class="txt-red" v-if="+maxReachesTypeSet < editForm.reachesTypeSet">该用户最多能参与{{
maxReachesTypeSet
}}次</span>
<span class="txt-red" v-else-if="editForm.reachesTypeSet < 2">只能输入2及以上的数字</span>
</div>
</el-form-item>
......@@ -101,20 +114,41 @@
<el-button type="primary" @click="handleConfirm" size="medium" :loading="loading">提交</el-button>
</GLFooter>
<ActivityModel ref="activity" @selectActivity="selectActivity"></ActivityModel>
<material-model v-if="isMaterialVisible" :isMaterialVisible.sync="isMaterialVisible" @handleMaterialConfirm="handleMaterialConfirm" @handleMaterialClose="handleMaterialClose"></material-model>
<nickname-model v-if="isNicknameVisible" :isNicknameVisible.sync="isNicknameVisible" @handleNicknameConfirm="handleNicknameConfirm" @handleNicknameClose="handleNicknameClose"></nickname-model>
<material-model v-if="isMaterialVisible" :isMaterialVisible.sync="isMaterialVisible"
@handleMaterialConfirm="handleMaterialConfirm"
@handleMaterialClose="handleMaterialClose"></material-model>
<nickname-model v-if="isNicknameVisible" :isNicknameVisible.sync="isNicknameVisible"
@handleNicknameConfirm="handleNicknameConfirm"
@handleNicknameClose="handleNicknameClose"></nickname-model>
</div>
</template>
<script>
import { limitPrice } from '@/common/constant'
const ATT_TYPE = {
TEXT: 1,
IMAGE: 2,
VEDIO: 3,
URL: 4,
MINIPROGRAM: 5,
FILE: 6,
ACTIVITY: 7
}
import {limitPrice} from '@/common/constant'
import ActivityModel from './components/activityModel'
import materialModel from './components/materialModel'
import nicknameModel from './components/nicknameModel'
// import MessagePreview from './components/MessagePreview/index'
import FriendGroupPreview from './components/FriendGroupPreview/index'
import Preview from './components/EnterprisePreview/index.vue'
import emoji from '@/utils/emo'
import * as moment from 'moment'
export default {
name: 'editGift',
data() {
return {
hasShowWechat: false,
hasEventContentDisplaySpecial: false,
size: 'small',
editChildRef: 'editChildRef',
isMaterialVisible: false,
......@@ -127,6 +161,117 @@ export default {
qiwei: '',
phone: ''
},
btnList: [
{
name: '表情',
funcName: '',
type: 'expression',
limitSize: 10
},
{
name: '图片',
funcName: '',
type: 'img',
togetherItem: [ATT_TYPE.TEXT],
limitNum: 9,
uploadApi: this.$apis.common.pictureUpload
},
{
name: '活动',
type: 'activity',
togetherItem: [ATT_TYPE.TEXT, ATT_TYPE.FILE],
funName: 'activity',
funParams: [
{
itemName: '权益卡试用',
itemValue: 3,
itemType: 'card',
getInterfaceApi: this.$apis.welcomeword.getCard,
params: {
tryAble: 1,
merchantId: this.$globalState.session.merchantId
}
},
{
itemName: '权益套餐',
itemValue: 4,
itemType: 'package',
getInterfaceApi: this.$apis.welcomeword.getPackage,
params: {}
},
{
itemName: '商城券',
itemValue: 2,
itemType: 'coupon',
getInterfaceApi: this.$apis.welcomeword.getMerchant,
params: {
discountTypes: [2, 3, 4],
directionalFlag: 1, // 1所有人可用2定向礼包专用3关联优惠券
validType: 'valid'
}
},
{
itemName: '秒杀活动',
itemValue: 5,
itemType: 'activity',
getInterfaceApi: this.$apis.welcomeword.getActivity,
params: {
activityStatus: 2,
currentPage: 1
}
}
// {
// itemName: '无忧服务',
// itemValue: 6,
// itemType: 'merchant',
// getInterfaceApi: this.$apis.welcomeword.merchant,
// merchantOpen: {
// merchantOpenApi: this.$apis.welcomeword.merchantOpen,
// params: {
// merchantId: this.$globalState.session.merchantId
// }
// },
// params: {
// merchantId: this.$globalState.session.merchantId
// }
// }
// {
// itemName: '众筹活动',
// itemValue: 7,
// itemType: 'crowdfunding',
// getInterfaceApi: this.$apis.welcomeword.crowdfundingActivity,
// params: {
// currentPage: 1,
// activityStatus: 2
// }
// }
]
},
{
name: '素材',
type: 'material',
funName: 'material',
togetherItem: [ATT_TYPE.TEXT, ATT_TYPE.ACTIVITY],
fileType: true,
groupListApi: this.$apis.welcomeword.getGroupListApi,
materialListApi: this.$apis.welcomeword.getMaterialListApi,
params: {
merchant: this.$globalState.session.merchantId
}
},
{
name: '视频',
funcName: '',
type: 'video',
limitSize: 20, //限制视频大小
togetherItem: [ATT_TYPE.TEXT], //只允许文本和图片
isReplace: 1, //限制视频数量
// limitWidth: 1280, //限制视频宽度
// limitHeight: 720, //限制视频高度
limitTime: 30, //限制视频时长
uploadApi: this.$apis.common.pictureUpload
}
],
editForm: {
sopName: '',
eventStartDate: '',
......@@ -150,43 +295,45 @@ export default {
},
// 营销内容
previewList: [],
btnList: [
{
id: 1,
name: '素材',
type: 'material',
funName: 'material'
},
{
id: 2,
name: '活动',
type: 'activity',
funName: 'activity'
},
{
id: 3,
name: '优惠券',
type: 'coupon',
funName: 'coupon'
},
{
id: 4,
name: '朋友圈模板',
type: 'nickname',
funName: 'nickname'
}
],
// btnList: [
// {
// id: 1,
// name: '素材',
// type: 'material',
// funName: 'material'
// },
// {
// id: 2,
// name: '活动',
// type: 'activity',
// funName: 'activity'
// },
// {
// id: 3,
// name: '优惠券',
// type: 'coupon',
// funName: 'coupon'
// },
// {
// id: 4,
// name: '朋友圈模板',
// type: 'nickname',
// funName: 'nickname'
// }
// ],
editRule: {
sopName: [{ required: true, message: '请输入SOP名称', trigger: 'change' }],
eventStartDate: [{ required: true, message: '请选择营销开始日期', trigger: 'change' }],
eventTime: [{ required: true, message: '请选择营销时间', trigger: 'change' }],
eventEndDate: [{ required: true, message: '请选择营销结束日期', trigger: 'change' }],
eventContent: [{ required: true, message: '请输入营销内容', trigger: 'change' }],
repeatFlag: [{ required: true, message: '请选择是否重复', trigger: 'change' }],
pushChannelType: [{ required: true, message: '请选择营销渠道', trigger: 'change' }],
followerTypeId: [{ required: true, message: '请选择跟进员工类型', trigger: 'change' }],
reachesType: [{ required: true, message: '请选择参与次数', trigger: 'change' }],
reachesTypeSet: [{ required: true, message: '请输入参与次数', trigger: 'change' }]
sopName: [{required: true, message: '请输入SOP名称', trigger: 'change'}],
eventStartDate: [{required: true, message: '请选择营销开始日期', trigger: 'change'}],
eventTime: [{required: true, message: '请选择营销时间', trigger: 'change'}],
eventEndDate: [{required: true, message: '请选择营销结束日期', trigger: 'change'}],
// eventContent: [{required: true, message: '', trigger: 'input'}],
repeatFlag: [{required: true, message: '请选择是否重复', trigger: 'change'}],
pushChannelType: [{required: true, message: '请选择营销渠道', trigger: 'change'}],
followerTypeId: [{required: true, message: '请选择跟进员工类型', trigger: 'change'}],
reachesType: [{required: true, message: '请选择参与次数', trigger: 'change'}],
reachesTypeSet: [{required: true, message: '请输入参与次数', trigger: 'change'}]
},
isEdit: true,
sopNameFormData: [
......@@ -390,6 +537,7 @@ export default {
}
}
},
props: {
eventObj: {
type: Object,
......@@ -417,10 +565,14 @@ export default {
}
}
},
components: {
ActivityModel,
materialModel,
nicknameModel
nicknameModel,
Preview,
FriendGroupPreview,
// MessagePreview
},
watch: {
editForm: {
......@@ -437,14 +589,24 @@ export default {
this.editFormDataChannel[idx].optionList[0].isDisabled = val == '4'
this.editFormDataChannel[idx].optionList[1].isDisabled = val == '4'
this.editFormDataChannel[idx].optionList[2].isDisabled = [1, 2, 3].includes(val)
}
},
'editForm.pushChannelType'(newValue) {
setTimeout(() => {
this.previewList = JSON.parse(JSON.stringify(this.previewList))
})
},
},
created() {
this.getDay('weekList', 7)
this.getDay('monthList', 31)
this.predictCountObj = JSON.parse(JSON.stringify(this.parentCustomerObj.parentPredictObj))
// this.limitQwPhone()
},
mounted() {
Object.assign(this.editForm, this.eventObj.info)
this.getStaffTypeList()
......@@ -453,7 +615,21 @@ export default {
})
this.eventObj.addOrEdit != 'add' ? this.getInfo() : ''
},
methods: {
previewForm(val) {
this.previewList = val
val.forEach(item => {
if ([2, 3].includes(item.attType)) {
this.editFormDataChannel[0].optionList[1].isDisabled = true
if (this.editForm.pushChannelType == 2) {
this.editForm.pushChannelType = ''
}
} else {
this.editFormDataChannel[0].optionList[1].isDisabled = false
}
})
},
getOptionsList(formName, hasAll = true, refreshSigle) {
if (refreshSigle) {
var item = this[formName].find(k => k.name == refreshSigle)
......@@ -479,15 +655,18 @@ export default {
})
}
},
handleResetMaxSet() {
this.maxReachesTypeSet = ''
},
getStaffTypeList() {
this.$apis.common.getStaffFollowerListApi({}).then(res => {
this.baseData.staffTypeList = res
this.getOptionsList('editFormDataChannel', false, 'followerTypeId')
})
},
getDay(attrName, day) {
let weekNameList = ['一', '二', '三', '四', '五', '六', '日']
for (var i = 0; i < day; i++) {
......@@ -497,6 +676,7 @@ export default {
})
}
},
recoveryRepeat() {
var idx = this.editFormDataRepeat.findIndex(item => item.name == 'repeatMode')
this.editFormDataRepeat[idx].isHide = this.editForm.repeatFlag == 'N'
......@@ -511,6 +691,7 @@ export default {
this.editForm.reachesTypeSet = 1
}
},
recoveryEndTime() {
var idx = this.editFormDataTime.findIndex(item => item.name == 'eventEndDate')
var startTime = new Date(this.editForm.eventStartDate)
......@@ -524,23 +705,79 @@ export default {
}
}
},
getInfo() {
this.editForm.eventStartDate = moment(this.editForm.eventStartDate).format('YYYY-MM-DD')
this.editForm.eventStartDate = this.editForm.eventStartDate ? moment(this.editForm.eventStartDate).format('YYYY-MM-DD') : ''
this.editForm.eventEndDate = this.editForm.eventEndDate ? moment(this.editForm.eventEndDate).format('YYYY-MM-DD') : ''
this.previewList = this.editForm.object ? [{ attContent: JSON.parse(JSON.stringify(this.editForm.object)), additionalType: this.editForm.object.additionalType }] : []
this.previewList = this.editForm.object ? [{
attContent: JSON.parse(JSON.stringify(this.editForm.object)),
additionalType: this.editForm.object.additionalType
}] : []
this.getWelcomeDetails()
this.recoveryRepeat()
this.recoveryEndTime()
this.getCustomerNum()
},
getWelcomeDetails() {
let backupContent = typeof (this.editForm.backupContent) == 'string' ? JSON.parse(this.editForm.backupContent) : this.editForm.backupContent
if (backupContent) {
const previewList = backupContent.map(item => {
if (item.attType == 7) item.attContent = JSON.parse(item.attContent)
return item
})
this.$refs.welcome.updateList(previewList)
} else if (this.editForm.object && this.editForm.object.length != 0) {
const previewList = JSON.parse(this.editForm.backupContent).map(item => {
if (item.attType == 7) item.attContent = JSON.parse(item.attContent)
return item
})
this.$refs.welcome.updateList(previewList)
}
this.$nextTick(() => {
this.editStatus = false
this.previewList = this.$common.utils.deepClone(this.$refs.welcome.previewList)
})
},
handleReachesType(val) {
this.editForm.reachesTypeSet = val == 1 ? 1 : ''
},
handleMarketingContent() {
let params = {}
const previewList = this.$common ? this.$common.utils.deepClone(this.$refs.welcome.previewList) : this.$refs.welcome.previewList
if ((previewList[0] && previewList[0].attType == 1 && previewList[0].attContent == '') || !previewList.length ||(previewList[0] && previewList[0].attType !== 1)) {
this.hasEventContentDisplaySpecial = true
} else {
this.hasEventContentDisplaySpecial = false
}
const contentList = previewList.map(item => {
if (item.attType == 1) {
const list = emoji.flat(Infinity)
const cutImg = item.attContent.replaceAll('<img src="https://img01.glsx.com.cn/weapp/resource/saas/scrm/emoji/', '')
const replaceImg = cutImg.replace(/(\d){3}.png">/g, function (str) {
let s = list[parseInt(str.split('.')[0]) - 1]
return `[${s}]`
})
item.attContent = replaceImg.substring(0, 600)
} else if (item.attType == 7) {
if (item.attContent.title) {
item.attType = 4
params.crowdFunding = true
}
item.attContent = JSON.stringify(item.attContent)
}
return item
})
this.editForm.object = contentList
this.editForm.backupContent = contentList
},
// 素材
handleMaterialConfirm(val) {
// additionalType 附加对象类型(1素材,2活动,3优惠券,4朋友券模板)
// objectType 对象类型(1朋友圈模板-单图文,2朋友圈模板-多图文,3朋友圈模板-文字+视频,4朋友圈模板-文字,5优惠券-商城券,6活动-权益卡使用,7活动-权益套餐,8活动-秒杀活动,10-素材)
this.editForm.object = JSON.parse(JSON.stringify(val))
this.editForm.backupContent = JSON.parse(JSON.stringify(val))
this.editRule.eventContent[0].required = true
this.editForm.pushChannelType = ''
this.previewList = [
{
......@@ -550,9 +787,11 @@ export default {
]
this.handleMaterialClose()
},
handleMaterialClose() {
this.isMaterialVisible = !this.isMaterialVisible
},
// 朋友圈模板
handleNicknameConfirm(val) {
// additionalType 附加对象类型(1素材,2活动,3优惠券,4朋友券模板)
......@@ -571,9 +810,11 @@ export default {
]
this.handleNicknameClose()
},
handleNicknameClose() {
this.isNicknameVisible = !this.isNicknameVisible
},
// 营销内容
handleFun(name) {
if (name == 'material') {
......@@ -586,6 +827,7 @@ export default {
this.handleNicknameClose()
}
},
close(index) {
this.previewList.splice(index, 1)
if (this.editForm.object.additionalType == 4) {
......@@ -594,6 +836,7 @@ export default {
}
this.editForm.object = {}
},
selectActivity(val) {
this.editForm.object = JSON.parse(JSON.stringify(val))
this.editRule.eventContent[0].required = true
......@@ -606,6 +849,7 @@ export default {
]
},
// 营销内容
getCustomerNum() {
switch (this.parentCustomerObj.currentCustomerTypeName) {
case '人群':
......@@ -618,6 +862,7 @@ export default {
break
}
},
getCustomerByCrowdList() {
var params = {
pageSize: 1,
......@@ -630,6 +875,7 @@ export default {
this.predictCountObj[this.editForm.pushChannelType == 2 ? 'phone' : 'qiwei'] = res.count
})
},
getCustomerByTagList() {
var params = {
combineType: 2,
......@@ -660,14 +906,19 @@ export default {
whereToGo(id) {
document.getElementById(id).scrollIntoView()
},
handleConfirm() {
var countParams = {
this.handleMarketingContent()
if (this.hasEventContentDisplaySpecial) {
return
}
let countParams = {
eventStartDate: this.editForm.eventStartDate,
eventEndDate: this.editForm.eventEndDate,
eventTime: this.editForm.eventTime,
repeatFlag: this.editForm.repeatFlag,
repeatMode: this.editForm.repeatMode,
repeatTime: this.editForm.repeatTime
repeatTime: this.editForm.repeatTime,
}
if (this.submit) {
return true
......@@ -691,10 +942,9 @@ export default {
return true
}
// 跟进员工类型followerTypeId
this.editForm.followerTypeName = this.baseData.staffTypeList.find(item => item.id).businessName
this.editForm.followerTypeName = this.baseData.staffTypeList && this.baseData.staffTypeList.find(item => item.id).businessName
// 预估可触达人数
this.editForm.predictCount = this.predictCountObj[this.editForm.pushChannelType == 2 ? 'phone' : 'qiwei']
// console.log(this.editForm)
if (this.editForm.repeatFlag == 'Y') {
this.$apis.sop.parseEventCountApi(countParams).then(res => {
// this.editForm.eventCount = res.eventStatistics.eventCount
......@@ -704,15 +954,15 @@ export default {
this.submit = false
return true
}
this.$emit('handleInfoConfirm', { baseInfo: this.editForm, predictCountObj: this.predictCountObj })
this.$emit('handleInfoConfirm', {baseInfo: this.editForm, predictCountObj: this.predictCountObj})
})
} else {
// this.editForm.eventCount = 1
this.$emit('handleInfoConfirm', { baseInfo: this.editForm, predictCountObj: this.predictCountObj })
this.$emit('handleInfoConfirm', {baseInfo: this.editForm, predictCountObj: this.predictCountObj})
}
},
cancelJump() {
this.$emit('handleTabChange', { activeName: 'baseInfo' })
this.$emit('handleTabChange', {activeName: 'baseInfo'})
},
handleCancel() {
if (this.editStatus) {
......@@ -724,7 +974,8 @@ export default {
.then(() => {
this.cancelJump()
})
.catch(() => { })
.catch(() => {
})
} else {
this.cancelJump()
}
......@@ -737,6 +988,7 @@ export default {
.content-bg {
background-color: #f7f7f7;
}
.content {
display: inline-block;
vertical-align: text-top;
......@@ -752,16 +1004,19 @@ export default {
margin-bottom: 10px;
border-left: 1px solid #dcdfe6;
border-right: 1px solid #dcdfe6;
.event-icon {
width: 20px;
height: 20px;
margin-right: 5px;
}
.model-item-img {
width: 90px !important;
height: 78px !important;
margin-right: 5px;
}
span {
display: inline-block;
margin-right: 20px;
......@@ -771,52 +1026,56 @@ export default {
text-overflow: ellipsis;
font-size: 14px;
}
i {
font-size: 16px;
cursor: pointer;
}
.el-icon-loading {
font-size: 24px;
}
&:last-child {
margin-bottom: 0;
}
}
.btn-group {
padding: 6px 0 6px 20px;
border: 1px solid #dcdfe6;
border-top: 0;
.add-btn {
display: inline-flex;
position: relative;
align-items: center;
padding-right: 25px;
font-size: 16px;
color: #666;
cursor: pointer;
span {
font-size: 14px;
margin-left: 5px;
cursor: pointer;
}
input {
position: absolute;
width: 100%;
cursor: pointer;
font-size: 0;
height: 40px;
}
img {
width: 16px;
height: 16px;
cursor: pointer;
}
.el-link {
position: absolute;
width: 100%;
}
}
}
//.btn-group {
// padding: 6px 0 6px 20px;
// border: 1px solid #dcdfe6;
// border-top: 0;
// .add-btn {
// display: inline-flex;
// position: relative;
// align-items: center;
// padding-right: 25px;
// font-size: 16px;
// color: #666;
// cursor: pointer;
// span {
// font-size: 14px;
// margin-left: 5px;
// cursor: pointer;
// }
// input {
// position: absolute;
// width: 100%;
// cursor: pointer;
// font-size: 0;
// height: 40px;
// }
// img {
// width: 16px;
// height: 16px;
// cursor: pointer;
// }
// .el-link {
// position: absolute;
// width: 100%;
// }
// }
//}
.date-picker {
margin-top: 10px;
font-size: 14px;
......@@ -824,4 +1083,22 @@ export default {
}
}
}
.group-content {
background: #fff;
//max-width: 800px;
padding: 20px;
margin-left: 70px;
.w-textarea {
background: #fff;
}
}
.marketingContent {
display: flex;
justify-content: space-between;
margin-right: 10%;
}
</style>
......@@ -7,6 +7,7 @@
</div>
<div class="container">
<GLCombiForm ref="showSearch" :rowNumber="1" :formObj="searchForm" :formData="searchFormData" @handleOk="handleSearch" @handleRest="handleReset"></GLCombiForm>
<!-- 表格区域 开始 -->
<GLTable ref="sopListRef" :getListApi="getListApi" :noDataImg="url" :searchForm="searchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn" @setTableFinishFun="setTableFinishFun">
<div class="table-btns" slot="auth-button" slot-scope="scope">
......@@ -17,6 +18,7 @@
</div>
</div>
</template>
<script>
import * as dayjs from 'dayjs'
import url from '@/assets/empty.png'
......@@ -77,6 +79,29 @@ export default {
click: this.handleEnd
}
},
// {
// type: 'el-button',
// name: '查看',
// attrs: {
// type: 'text'
// },
// condition: row => {
// return row.sopStatus == 3
// },
// listeners: {
// click: row => this.handleEdit('look', row)
// }
// },
// {
// type: 'el-button',
// name: '复制',
// attrs: {
// type: 'text'
// },
// listeners: {
// click: row => this.handleEdit('copy', row)
// }
// },
{
type: 'el-button',
name: '编辑',
......@@ -113,7 +138,7 @@ export default {
{
label: 'SOP名称',
prop: 'sopName',
width: 260,
width: 240,
line: 1
},
{
......@@ -171,9 +196,11 @@ export default {
}
}
},
mounted() {
this.getOptionsList('searchFormData')
},
methods: {
handleJump(path, row = {}) {
this.$router.push({
......@@ -181,6 +208,7 @@ export default {
query: row ? { id: row.id, fromPage: '/marketing/sop/sopList' } : ''
})
},
secondConfirm(title, txt, apiModule, apiName, apiParams, fn) {
this.$confirm(txt, title, {
confirmButtonText: '确定',
......@@ -215,13 +243,16 @@ export default {
query: params
})
},
// 结束
handleEnd(row) {
this.secondConfirm('结束', '结束SOP后,将不再进行营销任务自动推送,且不可恢复。是否确定结束?', 'sop', 'endSopEventApi', { sopId: row.id })
},
handleDelete(row) {
this.secondConfirm('删除', 'SOP删除后,不可恢复。是否确定删除?', 'sop', 'deleteSopEventApi', { sopId: row.id })
},
getOptionsList(formName, hasAll = true, refreshSigle) {
if (refreshSigle) {
var item = this[formName].find(k => k.name == refreshSigle)
......@@ -247,18 +278,22 @@ export default {
})
}
},
setTableFinishFun() {
//接收到的数据为空
this.$refs.sopListRef.data.length ? (this.$refs.sopListRef.tableHeightValues = '') : this.$refs.sopListRef.setTableHeightFun()
},
handleBack() {
this.$router.push({
path: '/sop/index'
})
},
handleSearch() {
this.$refs.sopListRef.refreshTable()
},
handleReset() {
this.searchForm = {
sopName: '',
......@@ -269,6 +304,7 @@ export default {
}
}
</script>
<style scoped>
.sop-list .sop-back-btn {
position: absolute;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!