Commit f656aadf by 前端

新建任务接口联调

1 parent 09d3748f
...@@ -49,5 +49,26 @@ const taskApi = { ...@@ -49,5 +49,26 @@ const taskApi = {
data.method = 'merchants.api.mission.staticMission' data.method = 'merchants.api.mission.staticMission'
return request(data, 'post') return request(data, 'post')
}, },
// 获取机器人列表
getlistDepartmentTree(data) {
data.method = 'entmicro.api.department.listDepartmentTreeNoSession'
return request(
data,
'entmicro.api.department.listDepartmentTreeNoSession',
[],
Vue.prototype.entmicroURL
)
},
// 获取群聊列表
getGroupList(data) {
data.method =
'entmicro.api.wechatcloudcontrol.batchmessaging.group.list.nosession'
return request(
data,
'entmicro.api.wechatcloudcontrol.batchmessaging.group.list.nosession',
[],
Vue.prototype.entmicroURL
)
},
} }
export { taskApi } export { taskApi }
import Vue from 'vue' import Vue from 'vue'
export const Util = { export const Util = {
getExplorer: function() { getExplorer: function () {
var ua = navigator.userAgent.toLocaleLowerCase() var ua = navigator.userAgent.toLocaleLowerCase()
var browserType = null var browserType = null
if (ua.match(/msie/) != null || ua.match(/trident/) != null) { if (ua.match(/msie/) != null || ua.match(/trident/) != null) {
...@@ -29,7 +29,7 @@ export const Util = { ...@@ -29,7 +29,7 @@ export const Util = {
return browserType return browserType
}, },
exportFn: function(url) { exportFn: function (url) {
console.log(url) console.log(url)
let browserType = getExplorer() let browserType = getExplorer()
if (browserType == 'QQ') { if (browserType == 'QQ') {
...@@ -42,8 +42,48 @@ export const Util = { ...@@ -42,8 +42,48 @@ export const Util = {
iframe.src = url iframe.src = url
document.body.appendChild(iframe) document.body.appendChild(iframe)
console.log(document.body) console.log(document.body)
} },
deepClone: function (obj) {
// Handle the 3 simple types, and null or undefined or function
if (obj == null || typeof obj !== 'object') return obj
// Handle Date
if (obj instanceof Date) {
const copy = new Date()
copy.setTime(obj.getTime())
return copy
}
// Handle Array or Object
if ((obj instanceof Array) | (obj instanceof Object)) {
const copy = obj instanceof Array ? [] : {}
for (var attr in obj) {
if (obj.hasOwnProperty(attr)) {
copy[attr] = Util.deepClone(obj[attr])
}
}
return copy
}
throw new Error("Unable to clone obj! Its type isn't supported.")
},
timeTransfer: function (time) {
const date = new Date(time)
const y = date.getFullYear()
let m = date.getMonth() + 1
m = m < 10 ? '0' + m : m
let d = date.getDate()
d = d < 10 ? '0' + d : d
let h = date.getHours()
h = h < 10 ? '0' + h : h
let minute = date.getMinutes()
minute = minute < 10 ? '0' + minute : minute
let s = date.getSeconds()
s = s < 10 ? '0' + s : s
return y + '-' + m + '-' + d + ' ' + h + ':' + minute + ':' + s
},
} }
export const getExplorer = Util.getExplorer export const getExplorer = Util.getExplorer
export const exportFn = Util.exportFn export const exportFn = Util.exportFn
export const deepClone = Util.deepClone
export const timeTransfer = Util.timeTransfer
...@@ -438,6 +438,7 @@ export default { ...@@ -438,6 +438,7 @@ export default {
watch: { watch: {
previewList: { previewList: {
handler(val) { handler(val) {
console.log(val)
this.$emit('shareMatrial', val) this.$emit('shareMatrial', val)
this.$emit('getEditor') this.$emit('getEditor')
}, },
......
...@@ -7,6 +7,7 @@ base.getConfig().then((data) => { ...@@ -7,6 +7,7 @@ base.getConfig().then((data) => {
Vue.prototype.otherUrl = config.axios.otherURL Vue.prototype.otherUrl = config.axios.otherURL
Vue.prototype.fileUploadURL = config.axios.fileUploadURL Vue.prototype.fileUploadURL = config.axios.fileUploadURL
Vue.prototype.businessURL = config.axios.businessURL Vue.prototype.businessURL = config.axios.businessURL
Vue.prototype.entmicroURL = config.axios.entmicroURL
vue.use(GlsxVueCommon, config) vue.use(GlsxVueCommon, config)
base.render(App) base.render(App)
}) })
<!--
* @Author: your name
* @Date: 2022-03-07 14:32:50
* @LastEditTime: 2022-04-21 18:43:21
* @LastEditors: huyue
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: \scrm-micro-settings\src\views\baseInfo\editInfo.vue
-->
<template>
<div v-loading="loading">
<div class="select-input-box" @click="switchBrand">
<div>
<template v-for="(item, idx) in treeArr">
<el-tag
effect="plain"
type="info"
:key="idx"
closable
:disable-transitions="false"
@close="removeItem(item, idx)"
v-if="idx < 3"
>
{{ item.staffName }}
</el-tag>
</template>
<el-popover
placement="top"
width="600"
trigger="hover"
class="select-popover"
>
<div class="select-popover-box">
<el-tag
effect="plain"
class="popover-item"
v-for="(item, idx) in getCheckedArr"
type="info"
:key="idx"
closable
:disable-transitions="false"
@close="removeItem(item, idx)"
>
{{ item.staffName }}
</el-tag>
</div>
<el-tag
effect="plain"
slot="reference"
type="info"
v-show="getCheckedArr.length > 3"
>+ {{ getCheckedArr.length - 3 }}</el-tag
>
</el-popover>
</div>
<div>
<i
v-show="!brandTree"
class="el-icon-arrow-up"
style="color: #909399"
></i>
<i
v-show="brandTree"
class="el-icon-arrow-down"
style="color: #909399"
></i>
</div>
</div>
<div class="tree-box" v-show="brandTree">
<el-input
class="tree-input"
prefix-icon="el-icon-search"
placeholder="输入关键字进行过滤"
v-model="filterText"
></el-input>
<el-tree
class="filter-tree"
@check="handleCheck"
:data="robotListTree"
:props="defaultProps"
node-key="id"
show-checkbox
default-expand-all
:default-expanded-keys="expandedKeys"
:filter-node-method="filterNode"
:ref="memberRef"
></el-tree>
<div class="tree-footer">
<!-- <div class="tree-footer-checkbox">
<el-checkbox
:indeterminate="isIndeterminate"
v-model="checkedAll"
@change="selectAll"
>全部</el-checkbox
>
</div> -->
<div class="tree-footer-reset" @click="selectClear">重置</div>
</div>
</div>
</div>
</template>
<script>
export default {
name: 'selectBrand',
data() {
return {
loading: false,
checkedAll: false,
filterText: '',
isIndeterminate: false,
treeArr: [],
getCheckedArr: [],
expandedKeys: [],
defaultProps: {
children: 'children',
label: 'label',
},
brandTree: false,
ids: [],
robotListTree: this.brandListTree,
currentCheckData: {},
selectItem: this.selectRobot,
}
},
props: {
brandListTree: {
type: Array,
default: () => [],
},
memberRef: {
type: String,
},
selectRobot: {
type: Array,
},
},
watch: {
filterText(val) {
this.$refs[this.memberRef].filter(val)
},
treeArr: {
handler() {
this.$emit('getSelectRobot', this.treeArr)
this.$emit('getMenbers')
const getCheckedNodes = this.$refs[this.memberRef].getCheckedNodes()
this.getCheckedArr = getCheckedNodes.reduce((prev, cur) => {
if (
Object.keys(cur).includes('children') &&
cur.children &&
cur.children.length > 0
) {
return prev
}
return prev.concat(cur)
}, [])
},
deep: true,
},
robotListTree: {
handler(val) {
console.log(val)
console.log(this.selectItem)
if (this.selectItem) {
this.$nextTick(() => {
this.$refs[this.memberRef].setCheckedKeys(this.selectItem)
this.treeArr = this.$refs[this.memberRef]
.getCheckedNodes()
.filter((item) => item.children && item.children.length == 0)
})
}
},
deep: true,
},
selectItem(val) {
console.log(val)
this.$refs[this.memberRef].setCheckedKeys(val)
this.getCheckedArr = this.robotListTree.find((item) => item.id == val[0])
},
},
mounted() {
console.log(this.robotListTree)
if (this.robotListTree.length) {
console.log(111)
this.initData(this.robotListTree)
}
},
methods: {
initData(data) {
data.forEach((item, index) => {
this.$set(
item,
'label',
item.staffName ? item.staffName : item.departmentName
)
let entmicroStaffResponses =
this.$Utils.deepClone(item.entmicroStaffResponses) || []
entmicroStaffResponses = entmicroStaffResponses.filter((staff, idx) => {
if (staff.staffName) {
this.$set(staff, 'label', staff.staffName)
} else {
this.$set(staff, 'label', staff.departmentName)
}
if (staff.staffId && !this.ids.includes(staff.staffId)) {
this.ids.push(staff.staffId)
return true
} else if (staff.staffId && this.ids.includes(staff.staffId)) {
return false
}
})
let child = this.$Utils.deepClone(item.children) || []
child = child.filter((staff, idx) => {
if (staff.staffName) {
this.$set(staff, 'label', staff.staffName)
} else {
this.$set(staff, 'label', staff.departmentName)
}
if (staff.staffId && !this.ids.includes(staff.staffId)) {
this.ids.push(staff.staffId)
return true
} else if (staff.staffId && this.ids.includes(staff.staffId)) {
return false
} else if (staff.entmicroStaffResponses) {
staff.staffId = staff.id
return true
}
})
const children = [...child, ...entmicroStaffResponses]
item.children = children
//清除没有员工的部门
if (!item.staffName && item.entmicroStaffResponses === null) {
data.splice(index, 1)
}
children.length && this.initData(children)
})
},
getMerchantBrandList() {
let getCheckedNodes = this.$refs[this.memberRef].getCheckedNodes()
const getCheckedKeys = this.$refs[this.memberRef].getCheckedKeys()
const getHalfCheckedNodes =
this.$refs[this.memberRef].getHalfCheckedNodes()
let merchantBrandList = getHalfCheckedNodes.map((car) => {
let merchantBrandId = []
car.children.forEach((item) => {
if (getCheckedKeys.includes(item.id)) {
merchantBrandId.push(item.id)
}
})
return {
cars: car.id,
merchantBrandId,
}
})
let checkNodes = getCheckedNodes.filter((item) => item.children)
let noCheckNodes = getCheckedNodes
.filter((item) => item.children === null)
.map((i) => {
return {
cars: i.id,
}
})
let merchantBrandList2 = checkNodes.map((car) => {
let merchantBrandId = []
car.children.forEach((item) => {
if (getCheckedKeys.includes(item.id)) {
merchantBrandId.push(item.id)
}
})
return {
cars: car.id,
merchantBrandId,
}
})
return merchantBrandList.concat(merchantBrandList2).concat(noCheckNodes)
},
//勾选
handleCheck(val) {
// this.treeArr = this.getTreeArray()
console.log(val)
// this.currentCheckData = this.$refs[this.memberRef]
// .getCheckedNodes()
// .filter((item) => item.children && item.children.length == 0)
this.currentCheckData = val
this.$refs[this.memberRef].setCheckedKeys([val.id])
console.log(this.currentCheckData.staffId)
// console.log(this.treeArr[0].staffId)
if (!this.treeArr.length) {
this.treeArr = [this.currentCheckData]
}
if (
this.treeArr.length &&
this.currentCheckData.staffId != this.treeArr[0].staffId
) {
this.treeArr = [this.currentCheckData]
}
this.currentCheckData = []
this.isIndeterminate =
this.treeArr.length > 0 && this.treeArr.length < this.ids.length
this.checkedAll = this.treeArr.length === this.ids.length
},
getCheckList(checkArr = []) {
checkArr.forEach((item) => (item = parseInt(item)))
this.$refs[this.memberRef].setCheckedKeys(checkArr)
this.$nextTick(() => {
this.handleCheck()
})
},
//获取选择项
getTreeArray() {
let tree_arr = []
this.robotListTree.forEach((k) => {
let child = k.children
if (child && child.length > 0) {
child.forEach((j) => {
tree_arr.push(j.id)
})
} else {
tree_arr.push(k.id)
}
})
return tree_arr
},
//全选
selectAll() {
this.loading = true
this.treeArr = this.getTreeArray()
if (this.getCheckedArr.length == this.treeArr.length) {
this.checkedAll = false
this.$refs[this.memberRef].setCheckedKeys([])
} else {
this.checkedAll = true
this.$refs[this.memberRef].setCheckedKeys(this.treeArr)
}
setTimeout(() => {
this.loading = false
}, 1000)
},
//重置
selectClear() {
this.treeArr = []
this.$refs[this.memberRef].setCheckedKeys([])
this.handleCheck()
},
//删除
removeItem(checkItem, index) {
this.treeArr.splice(index, 1)
let ids = this.treeArr.map((item) => item.staffId)
this.$refs[this.memberRef].setCheckedKeys(ids)
this.checkedAll = ids.length < this.ids.length
},
//过滤
filterNode(value, data) {
if (!value) return true
return data.label.indexOf(value) !== -1
},
// 显示隐藏
switchBrand() {
this.brandTree = !this.brandTree
this.$emit('clickBrand', this.brandTree)
},
},
}
</script>
<style lang="scss" scoped>
.select-input-box {
width: 100%;
height: 38px;
background: #ffffff;
border-radius: 4px;
border: 1px solid #e5e5e5;
box-sizing: border-box;
padding: 8px;
display: flex;
justify-content: space-between;
align-items: center;
/deep/ .el-tag {
margin-right: 5px;
height: 26px;
line-height: 26px;
box-sizing: border-box;
}
}
.select-popover {
&-box {
display: flex;
flex-wrap: wrap;
max-height: 500px;
overflow-y: auto;
.popover-item {
margin-right: 5px;
margin-bottom: 5px;
height: 26px;
line-height: 26px;
box-sizing: border-box;
}
}
}
.tree-box {
margin-top: 10px;
padding: 15px 15px 0px;
background: #ffffff;
// box-shadow: 0px 6px 20px 0px rgba(122, 122, 122, 0.2);
border-radius: 4px;
.tree-input {
margin-bottom: 10px;
}
.filter-tree {
height: 300px;
overflow-y: auto;
}
.tree-footer {
border-top: 1px solid #e5e5e5;
height: 48px;
padding: 0px 15px;
display: flex;
justify-content: space-between;
align-items: center;
}
}
.tree-footer-reset {
cursor: pointer;
}
</style>
...@@ -19,8 +19,11 @@ ...@@ -19,8 +19,11 @@
size="small" size="small"
:disabled="isEditor" :disabled="isEditor"
> >
<!-- <el-option label="车损升级" :value="0"></el-option>
<el-option label="精品升级" :value="1"></el-option> -->
<el-option label="1.2膨胀金活动" :value="2"></el-option> <el-option label="1.2膨胀金活动" :value="2"></el-option>
<el-option label="1.3众筹活动" :value="3"></el-option> <el-option label="1.3众筹活动" :value="3"></el-option>
<el-option label="5.2私域用户代运营" :value="4"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="商户:" prop="merchantId"> <el-form-item label="商户:" prop="merchantId">
...@@ -45,7 +48,11 @@ ...@@ -45,7 +48,11 @@
></el-option> ></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="活动/产品:" prop="activityId"> <el-form-item
label="活动/产品:"
prop="activityId"
v-if="basicForm.businessScene && basicForm.businessScene != 4"
>
<el-input <el-input
v-model="basicForm.activityName" v-model="basicForm.activityName"
placeholder="请选择活动/产品" placeholder="请选择活动/产品"
...@@ -55,7 +62,11 @@ ...@@ -55,7 +62,11 @@
readonly readonly
></el-input> ></el-input>
</el-form-item> </el-form-item>
<el-form-item label="任务指定人群:" prop="crowd"> <el-form-item
label="任务指定人群:"
prop="crowd"
v-if="basicForm.businessScene && basicForm.businessScene != 4"
>
<el-select <el-select
v-model="basicForm.crowd" v-model="basicForm.crowd"
multiple multiple
...@@ -101,7 +112,7 @@ ...@@ -101,7 +112,7 @@
></Preview> ></Preview>
</div> </div>
</div> </div>
<template v-if="basicForm.activityName || isClone || isEditor"> <template v-if="basicForm.activityName || isClone || isEditor || isShow">
<div class="title-box"> <div class="title-box">
<span class="task-title">任务计划</span> <span class="task-title">任务计划</span>
<span <span
...@@ -161,14 +172,64 @@ ...@@ -161,14 +172,64 @@
:disabled="isEditor && activityStatus == 2" :disabled="isEditor && activityStatus == 2"
> >
<el-option label="注册认证" :value="1"></el-option> <el-option label="注册认证" :value="1"></el-option>
<el-option label="分享指标" :value="2"></el-option>
<el-option label="浏览指标" :value="3"></el-option>
<el-option label="访客指标" :value="4"></el-option>
<el-option <el-option
v-if="item.activityTime == -1" label="分享指标"
:value="2"
v-show="
basicForm.businessScene &&
basicForm.businessScene != 4
"
></el-option>
<el-option
label="浏览指标"
:value="3"
v-show="
basicForm.businessScene &&
basicForm.businessScene != 4
"
></el-option>
<el-option
label="访客指标"
:value="4"
v-show="
basicForm.businessScene &&
basicForm.businessScene != 4
"
></el-option>
<el-option
v-show="
item.activityTime == -1 &&
basicForm.businessScene &&
basicForm.businessScene != 4
"
label="成单指标" label="成单指标"
:value="5" :value="5"
></el-option> ></el-option>
<el-option
label="添加福利官"
:value="7"
v-show="
basicForm.businessScene &&
basicForm.businessScene == 4
"
></el-option>
<el-option
label="组建客户福利群"
:value="8"
v-show="
basicForm.businessScene &&
basicForm.businessScene == 4
"
></el-option>
<el-option
label="二次跟进指标"
:value="6"
v-show="
basicForm.businessScene &&
basicForm.businessScene == 2 &&
item.activityTime == -1
"
></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item <el-form-item
...@@ -197,9 +258,125 @@ ...@@ -197,9 +258,125 @@
></el-input> ></el-input>
</el-form-item> </el-form-item>
<el-form-item <el-form-item
label="自动提醒:"
:prop="'missionList.' + index1 + '.autoReminderFlag'"
:rules="taskFormRules.autoReminderFlag"
v-if="itm.missonType"
>
<el-radio-group
v-model="itm.autoReminderFlag"
@change="remindTypeChange(itm)"
:disabled="
itm.autoReminderFlag == 1 && activityStatus == 2
"
><el-radio :label="1">无提醒</el-radio>
<el-radio :label="2">自动提醒</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item
label="提醒时间:"
:prop="'missionList.' + index1 + '.autoReminderTime'"
:rules="taskFormRules.autoReminderTime"
v-if="itm.autoReminderFlag && itm.autoReminderFlag == 2"
>
<el-date-picker
v-if="
item.activityTime != -1 ||
basicForm.businessScene == 4
"
v-model="itm.autoReminderTime"
:picker-options="pickerOptions"
type="datetime"
placeholder="选择日期时间"
size="small"
value-format="yyyy/MM/dd HH:mm:ss"
:disabled="activityStatus == 2"
>
</el-date-picker>
<el-time-picker
v-else
v-model="itm.autoReminderTime"
placeholder="任意时间点"
size="small"
format="HH:mm:ss"
value-format="HH:mm:ss"
:disabled="activityStatus == 2"
>
</el-time-picker>
</el-form-item>
<el-form-item
label="所属企业:"
:prop="'missionList.' + index1 + '.bussiness'"
:rules="taskFormRules.bussiness"
v-if="itm.autoReminderFlag == 2"
>
<el-radio-group v-model="itm.bussiness"
><el-radio :label="1">广联赛讯</el-radio>
<el-radio :label="2">滴加智慧云</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item
label="企微机器人:"
:prop="'missionList.' + index1 + '.enterMicroRobot'"
:rules="taskFormRules.enterMicroRobot"
v-if="itm.autoReminderFlag && itm.autoReminderFlag == 2"
>
<SelectMembers
:id="
'missionList' + (itm.taskid || itm.id) + 'welcome'
"
:key="
'missionList' + (itm.taskid || itm.id) + 'welcome'
"
:ref="
'missionList' + (itm.taskid || itm.id) + 'welcome'
"
:brandListTree="brandListTree"
:selectRobot="isEditor ? itm.enterMicroRobot : []"
:memberRef="
'missionList' + (itm.taskid || itm.id) + 'welcome'
"
@click="getTree"
@getMenbers="getMenbers(item, index, itm, index1)"
@getSelectRobot="getSelectRobot"
></SelectMembers>
</el-form-item>
<el-form-item
label="目标群聊:"
:prop="'missionList.' + index1 + '.groupChat'"
:rules="taskFormRules.groupChat"
v-if="itm.autoReminderFlag && itm.autoReminderFlag == 2"
>
<el-select
@focus="getGroupList(item, index, itm, index1)"
@change="
(val) => {
changeGroup(val, item, index, itm, index1)
}
"
v-model="itm.groupChat"
placeholder="请选择目标群聊"
size="small"
filterable
>
<el-option
v-for="(item, index) in groupListData"
:key="index"
:label="item.roomName || '默认群聊'"
:value="item.roomChatId"
></el-option>
</el-select>
</el-form-item>
<el-form-item
:prop="'missionList.' + index1 + '.missionMaterialList'" :prop="'missionList.' + index1 + '.missionMaterialList'"
:rules="taskFormRules.attachmentList" :rules="taskFormRules.attachmentList"
v-if="itm.missonType && itm.missonType != 1" v-if="
itm.missonType &&
itm.missonType != 1 &&
itm.missonType != 6 &&
itm.missonType != 7 &&
itm.missonType != 8
"
> >
<label slot="label" class="required">分享素材:</label> <label slot="label" class="required">分享素材:</label>
<GLEditor <GLEditor
...@@ -226,7 +403,7 @@ ...@@ -226,7 +403,7 @@
<el-form-item <el-form-item
label="页面风格:" label="页面风格:"
:rules="taskFormRules.textType" :rules="taskFormRules.textType"
v-show="itm.showArticle" v-if="itm.showArticle"
> >
<el-radio-group <el-radio-group
v-model="itm.textType" v-model="itm.textType"
...@@ -239,7 +416,7 @@ ...@@ -239,7 +416,7 @@
<el-form-item <el-form-item
label="文章素材:" label="文章素材:"
:prop="'missionList.' + index1 + '.textContent'" :prop="'missionList.' + index1 + '.textContent'"
v-show=" v-if="
itm.showArticle && itm.textType && itm.textType == 1 itm.showArticle && itm.textType && itm.textType == 1
" "
> >
...@@ -274,7 +451,7 @@ ...@@ -274,7 +451,7 @@
label="奖励模式:" label="奖励模式:"
:prop="'missionList.' + index1 + '.rewardType'" :prop="'missionList.' + index1 + '.rewardType'"
:rules="taskFormRules.rewardType" :rules="taskFormRules.rewardType"
v-show="itm.missonType" v-if="itm.missonType"
> >
<el-radio-group <el-radio-group
v-model="itm.rewardType" v-model="itm.rewardType"
...@@ -283,17 +460,30 @@ ...@@ -283,17 +460,30 @@
><el-radio :label="3">无奖励</el-radio> ><el-radio :label="3">无奖励</el-radio>
<el-radio <el-radio
:label="1" :label="1"
v-show="itm.missonType && itm.missonType != 1" v-show="
itm.missonType &&
itm.missonType != 1 &&
itm.missonType != 7
"
>累计奖励</el-radio >累计奖励</el-radio
> >
<el-radio <el-radio
:label="2" :label="2"
v-show="itm.missonType && itm.missonType != 1" v-show="
itm.missonType &&
itm.missonType != 1 &&
itm.missonType != 7 &&
itm.missonType != 8 &&
itm.missonType != 6
"
>排名奖励</el-radio >排名奖励</el-radio
> >
<el-radio <el-radio
:label="4" :label="4"
v-show="itm.missonType && itm.missonType == 1" v-show="
itm.missonType &&
(itm.missonType == 1 || itm.missonType == 7)
"
>有奖励</el-radio >有奖励</el-radio
> >
</el-radio-group> </el-radio-group>
...@@ -484,6 +674,7 @@ import { commonApi } from '../../../api/commonApi' ...@@ -484,6 +674,7 @@ import { commonApi } from '../../../api/commonApi'
import { taskApi } from '../../../api/task' import { taskApi } from '../../../api/task'
import ActivityDia from './components/activityDia.vue' import ActivityDia from './components/activityDia.vue'
import ActivityDate from './components/activityDate.vue' import ActivityDate from './components/activityDate.vue'
import SelectMembers from './components/selectMembers.vue'
import Preview from './components/preView.vue' import Preview from './components/preView.vue'
import { utils } from 'glsx-common' import { utils } from 'glsx-common'
export default { export default {
...@@ -491,6 +682,7 @@ export default { ...@@ -491,6 +682,7 @@ export default {
ActivityDia, ActivityDia,
ActivityDate, ActivityDate,
Preview, Preview,
SelectMembers,
}, },
data() { data() {
// 奖励积分校验规则 // 奖励积分校验规则
...@@ -516,7 +708,7 @@ export default { ...@@ -516,7 +708,7 @@ export default {
merchantName: '', merchantName: '',
activityId: '', activityId: '',
activityName: '', activityName: '',
crowd: ['3'], crowd: [],
withdrawalFlag: 1, withdrawalFlag: 1,
channel: 1, channel: 1,
remark: '', remark: '',
...@@ -588,6 +780,10 @@ export default { ...@@ -588,6 +780,10 @@ export default {
textIds: [], textIds: [],
// 判断复制任务选择活动是否小于复制前任务天数 // 判断复制任务选择活动是否小于复制前任务天数
dateLess: false, dateLess: false,
// 目标群聊
groupListData: [],
// 树结构
brandListTree: [],
// 公共任务类型 // 公共任务类型
basicObj: { basicObj: {
taskid: '', taskid: '',
...@@ -595,7 +791,14 @@ export default { ...@@ -595,7 +791,14 @@ export default {
missionName: '', missionName: '',
missonDesc: '', missonDesc: '',
rewardScore: '', rewardScore: '',
rewardType: 3, rewardType: '',
autoReminderFlag: '',
autoReminderTime: '',
groupChat: '',
groupChatName: '',
enterMicroRobot: [],
enterMicroRobotName: '',
bussiness: 1,
}, },
// 分享指标任务类型 // 分享指标任务类型
shareObj: { shareObj: {
...@@ -607,6 +810,10 @@ export default { ...@@ -607,6 +810,10 @@ export default {
textType: 1, textType: 1,
textContent: '', textContent: '',
showArticle: true, showArticle: true,
// autoReminderFlag: '',
// autoReminderTime: '',
// groupChat: '',
// enterMicroRobot: '',
}, },
// 浏览指标任务类型 // 浏览指标任务类型
browseObj: { browseObj: {
...@@ -619,6 +826,10 @@ export default { ...@@ -619,6 +826,10 @@ export default {
textType: 1, textType: 1,
textContent: '', textContent: '',
showArticle: true, showArticle: true,
// autoReminderFlag: '',
// autoReminderTime: '',
// groupChat: '',
// enterMicroRobot: '',
}, },
// 访客指标任务类型 // 访客指标任务类型
visitorObj: { visitorObj: {
...@@ -629,6 +840,10 @@ export default { ...@@ -629,6 +840,10 @@ export default {
textType: 1, textType: 1,
textContent: '', textContent: '',
showArticle: true, showArticle: true,
// autoReminderFlag: '',
// autoReminderTime: '',
// groupChat: '',
// enterMicroRobot: '',
}, },
// 成单指标任务类型 // 成单指标任务类型
orderObj: { orderObj: {
...@@ -639,9 +854,45 @@ export default { ...@@ -639,9 +854,45 @@ export default {
textType: 1, textType: 1,
textContent: '', textContent: '',
showArticle: true, showArticle: true,
// autoReminderFlag: '',
// autoReminderTime: '',
// groupChat: '',
// enterMicroRobot: '',
},
// 添加福利官任务类型
walefaleObj: {
// autoReminderFlag: '',
// autoReminderTime: '',
// groupChat: '',
// enterMicroRobot: '',
},
// 添加一客一群任务类型
customerObj: {
// autoReminderFlag: '',
// autoReminderTime: '',
// groupChat: '',
// enterMicroRobot: '',
rewardCount: '',
triggerValue: '',
},
// 二次跟进指标任务类型
secondObj: {
rewardCount: '',
repeatCount: '',
triggerValue: '',
}, },
// 编辑任务计划数据 // 编辑任务计划数据
taskEditList: {}, taskEditList: {},
// 是否展示任务tab
isShow: false,
// ids: [],
selectRobot: [],
pickerOptions: {
disabledDate(time) {
return time.getTime() < Date.now()
},
},
// 基础信息表单验证 // 基础信息表单验证
basicRules: { basicRules: {
businessScene: [ businessScene: [
...@@ -702,6 +953,23 @@ export default { ...@@ -702,6 +953,23 @@ export default {
textType: [ textType: [
{ required: true, message: '请选择页面风格', trigger: 'change' }, { required: true, message: '请选择页面风格', trigger: 'change' },
], ],
autoReminderFlag: [
{ required: true, message: '请选择自动提醒方式', trigger: 'change' },
],
autoReminderTime: [
{
type: 'string',
required: true,
message: '请选择提醒时间',
trigger: 'change',
},
],
enterMicroRobot: [
{ required: true, message: '请选择企微机器人', trigger: 'change' },
],
groupChat: [
{ required: true, message: '请选择目标群聊', trigger: 'change' },
],
}, },
} }
}, },
...@@ -847,6 +1115,11 @@ export default { ...@@ -847,6 +1115,11 @@ export default {
this.basicForm.merchantName = '' this.basicForm.merchantName = ''
this.basicForm.activityId = '' this.basicForm.activityId = ''
this.basicForm.activityName = '' this.basicForm.activityName = ''
this.isShow = false
if (this.basicForm.businessScene == 4) {
this.setHouseRatesColumn()
this.isShow = true
}
}, },
// 商户改变获取商户名 // 商户改变获取商户名
changeMerchant(val) { changeMerchant(val) {
...@@ -856,8 +1129,125 @@ export default { ...@@ -856,8 +1129,125 @@ export default {
// 清空活动 // 清空活动
this.basicForm.activityId = '' this.basicForm.activityId = ''
this.basicForm.activityName = '' this.basicForm.activityName = ''
this.getlistDepartmentTree(val)
// this.taskList = [] // this.taskList = []
}, },
getTree() {
console.log(111)
},
// 根据商户获取机器人列表
getlistDepartmentTree(merchantId) {
return new Promise((resolve) => {
let params = { addChildrensFlag: true, queryMerchantId: merchantId }
taskApi.getlistDepartmentTree(params).then((res) => {
console.log(res)
if (res) {
this.brandListTree = res.data.data
resolve()
// this.initData(this.brandListTree)
// console.log(this.brandListTree, '=======22')
}
})
})
},
// initData(data) {
// data.forEach((item, index) => {
// this.$set(
// item,
// 'label',
// item.staffName ? item.staffName : item.departmentName
// )
// let entmicroStaffResponses =
// this.$Utils.deepClone(item.entmicroStaffResponses) || []
// entmicroStaffResponses = entmicroStaffResponses.filter((staff, idx) => {
// if (staff.staffName) {
// this.$set(staff, 'label', staff.staffName)
// } else {
// this.$set(staff, 'label', staff.departmentName)
// }
// if (staff.staffId && !this.ids.includes(staff.staffId)) {
// this.ids.push(staff.staffId)
// return true
// } else if (staff.staffId && this.ids.includes(staff.staffId)) {
// return false
// }
// })
// let child = this.$Utils.deepClone(item.children) || []
// child = child.filter((staff, idx) => {
// if (staff.staffName) {
// this.$set(staff, 'label', staff.staffName)
// } else {
// this.$set(staff, 'label', staff.departmentName)
// }
// if (staff.staffId && !this.ids.includes(staff.staffId)) {
// this.ids.push(staff.staffId)
// return true
// } else if (staff.staffId && this.ids.includes(staff.staffId)) {
// return false
// } else if (staff.entmicroStaffResponses) {
// staff.staffId = staff.id
// return true
// }
// })
// const children = [...child, ...entmicroStaffResponses]
// item.children = children
// //清除没有员工的部门
// if (!item.staffName && item.entmicroStaffResponses === null) {
// data.splice(index, 1)
// }
// children.length && this.initData(children)
// })
// },
// 获取选中机器人
getSelectRobot(treeArr) {
this.selectRobot = treeArr.map((item) => item.staffId)
this.selectRobotName = treeArr.map((item) => item.staffName)
console.log(this.selectRobot)
},
getMenbers(dateTask, dateTaskIndex, task, taskIndex) {
this.$set(
this.taskList[dateTaskIndex].missionList[taskIndex],
'enterMicroRobot',
this.selectRobot
)
this.$set(
this.taskList[dateTaskIndex].missionList[taskIndex],
'enterMicroRobotName',
this.selectRobotName[0]
)
this.$refs['taskForm'][dateTaskIndex].clearValidate()
console.log(this.taskList[dateTaskIndex].missionList[taskIndex], '000')
},
// 获取群聊数据
getGroupList(item, index, itm, index1) {
console.log(itm)
if (!itm.enterMicroRobot) {
this.$message({
message: '请先选择企微机器人',
type: 'error',
})
return
}
let membersIds = itm.enterMicroRobot.join(',')
taskApi.getGroupList({ msgStaffIdList: membersIds }).then((res) => {
console.log(res, 'list')
if (res.data.code == 0) {
this.groupListData = res.data.data
}
})
},
// 选择群聊数据
changeGroup(val, item, index, itm, index1) {
console.log(val)
console.log(item, index, itm, index1)
let groupList = this.groupListData.find((item) => item.roomChatId == val)
this.$set(this.taskList[index].missionList[index1], 'groupChat', val)
this.$set(
this.taskList[index].missionList[index1],
'groupChatName',
groupList.roomName
)
},
// 根据商户名搜索商户 // 根据商户名搜索商户
filterMethod: utils.debounce(function (val) { filterMethod: utils.debounce(function (val) {
this.searchValue = val this.searchValue = val
...@@ -1026,6 +1416,9 @@ export default { ...@@ -1026,6 +1416,9 @@ export default {
activityTime: '-1', activityTime: '-1',
missionList: [], missionList: [],
}) })
// 如果没有传时间值,直接返回
console.log(this.taskList)
if (!startTime) return this.taskList
// 如果是编辑/复制页面,任务计划回显 // 如果是编辑/复制页面,任务计划回显
if (this.isEditor || (this.isClone && !this.basicForm.activityName)) if (this.isEditor || (this.isClone && !this.basicForm.activityName))
this.dealEcho() this.dealEcho()
...@@ -1143,9 +1536,11 @@ export default { ...@@ -1143,9 +1536,11 @@ export default {
? this.taskList[index].missionList.length - 1 ? this.taskList[index].missionList.length - 1
: 0 : 0
this.taskList[index].missionList[listLength].taskid = this.getUuid() this.taskList[index].missionList[listLength].taskid = this.getUuid()
console.log(this.taskList)
}, },
// 任务选择类型切换 // 任务选择类型切换
selectTaskType(dateTask, dateTaskIndex, task, taskIndex) { selectTaskType(dateTask, dateTaskIndex, task, taskIndex) {
console.log(this.taskList)
// dateTask -- 具体哪一天的任务对象 // dateTask -- 具体哪一天的任务对象
// dateTaskIndex -- 具体哪一天的任务对象索引 // dateTaskIndex -- 具体哪一天的任务对象索引
// task -- 具体哪个任务 // task -- 具体哪个任务
...@@ -1170,9 +1565,11 @@ export default { ...@@ -1170,9 +1565,11 @@ export default {
} }
// 判断任务类型,将任务类型参数push进taskList // 判断任务类型,将任务类型参数push进taskList
let taskItem let taskItem
console.log(task.missonType)
switch (task.missonType) { switch (task.missonType) {
case 1: case 1:
taskItem = Object.assign({}, this.basicObj) taskItem = Object.assign({}, this.basicObj)
console.log(taskItem)
break break
case 2: case 2:
taskItem = Object.assign({}, this.basicObj, this.shareObj) taskItem = Object.assign({}, this.basicObj, this.shareObj)
...@@ -1186,6 +1583,15 @@ export default { ...@@ -1186,6 +1583,15 @@ export default {
case 5: case 5:
taskItem = Object.assign({}, this.basicObj, this.orderObj) taskItem = Object.assign({}, this.basicObj, this.orderObj)
break break
case 6:
taskItem = Object.assign({}, this.basicObj, this.secondObj)
break
case 7:
taskItem = Object.assign({}, this.basicObj, this.walefaleObj)
break
case 8:
taskItem = Object.assign({}, this.basicObj, this.customerObj)
break
default: default:
taskItem = { ...this.basicObj } taskItem = { ...this.basicObj }
} }
...@@ -1193,12 +1599,22 @@ export default { ...@@ -1193,12 +1599,22 @@ export default {
taskItem.missonType = task.missonType taskItem.missonType = task.missonType
taskItem.taskid = task.taskid || task.id taskItem.taskid = task.taskid || task.id
// 任务类型=浏览、访客、成单时,默认添加活动专属链接 // 任务类型=浏览、访客、成单时,默认添加活动专属链接
if (taskItem.missonType != 1 && taskItem.missonType != 2) { if (
taskItem.missonType == 3 ||
taskItem.missonType == 4 ||
taskItem.missonType == 5
) {
taskItem.linkStatus = true taskItem.linkStatus = true
} else { } else {
taskItem.linkStatus = false taskItem.linkStatus = false
} }
this.$set(this.taskList[dateTaskIndex].missionList, taskIndex, taskItem) this.$set(this.taskList[dateTaskIndex].missionList, taskIndex, taskItem)
if (
this.basicForm.businessScene == 4 ||
taskItem.missonType == 1 ||
taskItem.missonType == 6
)
return
this.$nextTick(() => { this.$nextTick(() => {
// this.$set(this.taskList[dateTaskIndex].missionList, taskIndex, taskItem) // this.$set(this.taskList[dateTaskIndex].missionList, taskIndex, taskItem)
var box = document.getElementById( var box = document.getElementById(
...@@ -1211,9 +1627,11 @@ export default { ...@@ -1211,9 +1627,11 @@ export default {
let textId = task.taskid || task.id let textId = task.taskid || task.id
this.getTextBox(textId, dateTaskIndex, taskIndex) this.getTextBox(textId, dateTaskIndex, taskIndex)
}) })
console.log(this.taskList, '===')
}, },
// 获取分享素材内容 // 获取分享素材内容
getEditor(dateTask, dateTaskIndex, task, taskIndex) { getEditor(dateTask, dateTaskIndex, task, taskIndex) {
console.log(111)
// dateTask -- 具体哪一天的任务对象 // dateTask -- 具体哪一天的任务对象
// dateTaskIndex -- 具体哪一天的任务对象索引 // dateTaskIndex -- 具体哪一天的任务对象索引
// task -- 具体哪个任务 // task -- 具体哪个任务
...@@ -1337,11 +1755,21 @@ export default { ...@@ -1337,11 +1755,21 @@ export default {
this.getTextBox(textId, index, index1) this.getTextBox(textId, index, index1)
} }
}, },
// 选择日期时间
selectRemindTime(dateTask, dateTaskIndex, task, taskIndex) {
let date = task.autoReminderTime
const remindTime = this.$Utils.timeTransfer(date)
this.$set(
this.taskList[dateTaskIndex].missionList[taskIndex],
'autoReminderTime',
remindTime
)
},
// 获取任务信息详情 // 获取任务信息详情
findMissionDeail(taskId) { findMissionDeail(taskId) {
var params = { id: taskId } var params = { id: taskId } /* */
taskApi.findMissionDeail(params).then( taskApi.findMissionDeail(params).then(
(res) => { async (res) => {
if (res && res.code == 0) { if (res && res.code == 0) {
const { const {
activityId, activityId,
...@@ -1375,6 +1803,8 @@ export default { ...@@ -1375,6 +1803,8 @@ export default {
// 处理空素材数据 // 处理空素材数据
this.taskEditList.missionDateList.map((item) => { this.taskEditList.missionDateList.map((item) => {
item.missionList.map((itm) => { item.missionList.map((itm) => {
// 默认所属企业为广联赛讯
itm.bussiness = 1
if ( if (
itm.missonType && itm.missonType &&
itm.missonType != 1 && itm.missonType != 1 &&
...@@ -1414,10 +1844,22 @@ export default { ...@@ -1414,10 +1844,22 @@ export default {
if (itm.missonType == 1 && !itm.rewardType) { if (itm.missonType == 1 && !itm.rewardType) {
itm.rewardType = 4 itm.rewardType = 4
} }
// 处理企微机器人
if (itm.enterMicroRobot) {
itm.enterMicroRobot = itm.enterMicroRobot.split(',')
}
}) })
}) })
this.setHouseRatesColumn(startTime, endTime) // 获取其为机器人列表
if (this.isClone) { await this.getlistDepartmentTree(merchantId)
// 判断场景(代运营只有完整周期)
if (businessScene == 4) {
this.taskList = this.taskEditList.missionDateList
console.log(this.taskList)
} else {
this.setHouseRatesColumn(startTime, endTime)
}
if (businessScene != 4 && this.isClone) {
this.taskDateNum = this.getDateByDays(startTime, endTime) this.taskDateNum = this.getDateByDays(startTime, endTime)
} }
} }
...@@ -1470,6 +1912,12 @@ export default { ...@@ -1470,6 +1912,12 @@ export default {
}) })
} }
}, },
// 自动提醒切换
remindTypeChange(itm) {
this.$set(itm, 'remindTime', '')
this.$set(itm, 'enterMicroRobot', '')
this.$set(itm, 'groupChat', '')
},
// 基础信息表单验证 // 基础信息表单验证
basicFormValidate() { basicFormValidate() {
this.$refs['basicForm'].validate((valid) => { this.$refs['basicForm'].validate((valid) => {
...@@ -1535,6 +1983,10 @@ export default { ...@@ -1535,6 +1983,10 @@ export default {
} catch (err) { } catch (err) {
if (err) { if (err) {
// this.taskList = JSON.parse(JSON.stringify(this.cloneList)) // this.taskList = JSON.parse(JSON.stringify(this.cloneList))
this.$message({
message: '基本信息未填写完成',
type: 'error',
})
return return
} }
} }
...@@ -1590,6 +2042,15 @@ export default { ...@@ -1590,6 +2042,15 @@ export default {
'$2 style="width: 18px;height: 18px" $3' '$2 style="width: 18px;height: 18px" $3'
) )
} }
// 处理企微机器人
if (itm.enterMicroRobot) {
itm.enterMicroRobot = itm.enterMicroRobot.join(',')
}
// 处理完整周期时间
// if (item.activityTime == -1 && itm.autoReminderTime) {
// console.log(111)
// itm.autoReminderTime = '0000-00-00 ' + itm.autoReminderTime
// }
}) })
}) })
let params = JSON.parse(JSON.stringify(this.basicForm)) let params = JSON.parse(JSON.stringify(this.basicForm))
......
...@@ -37,6 +37,18 @@ ...@@ -37,6 +37,18 @@
</template> </template>
<div class="taskAward"> <div class="taskAward">
<div class="showInfoForm"> <div class="showInfoForm">
<span
>自动提醒:{{
item.autoReminderFlag == 1 ? '无提醒' : '自动提醒'
}}</span
>
<span v-if="item.autoReminderFlag != 1"
>提醒时间:{{ item.autoReminderTime }}</span
><span v-if="item.autoReminderFlag != 1"
>企微机器人:{{ item.enterMicroRobotName }}</span
><span v-if="item.autoReminderFlag != 1"
>目标群聊:{{ item.groupChatName }}</span
>
<span v-if="item.rewardTypeName" <span v-if="item.rewardTypeName"
>奖励模式:{{ item.rewardTypeName }}</span >奖励模式:{{ item.rewardTypeName }}</span
> >
......
...@@ -48,6 +48,18 @@ ...@@ -48,6 +48,18 @@
</div> </div>
</template> </template>
<div class="showInfoForm"> <div class="showInfoForm">
<span
>自动提醒:{{
displayList.autoReminderFlag == 1 ? '无提醒' : '自动提醒'
}}</span
>
<span v-if="displayList.autoReminderFlag != 1"
>提醒时间:{{ displayList.autoReminderTime }}</span
><span v-if="displayList.autoReminderFlag != 1"
>企微机器人:{{ displayList.enterMicroRobotName }}</span
><span v-if="displayList.autoReminderFlag != 1"
>目标群聊:{{ displayList.groupChatName }}</span
>
<span v-if="displayList.rewardTypeName" <span v-if="displayList.rewardTypeName"
>奖励模式:{{ displayList.rewardTypeName }}</span >奖励模式:{{ displayList.rewardTypeName }}</span
> >
......
...@@ -81,6 +81,7 @@ ...@@ -81,6 +81,7 @@
<span v-if="scope.scope.businessScene == 1">1.1精品升级</span> <span v-if="scope.scope.businessScene == 1">1.1精品升级</span>
<span v-if="scope.scope.businessScene == 2">1.2膨胀金活动</span> <span v-if="scope.scope.businessScene == 2">1.2膨胀金活动</span>
<span v-if="scope.scope.businessScene == 3">1.3众筹活动</span> <span v-if="scope.scope.businessScene == 3">1.3众筹活动</span>
<span v-if="scope.scope.businessScene == 4">5.2私域用户代运营</span>
</div> </div>
<div slot="activityStatus" slot-scope="scope"> <div slot="activityStatus" slot-scope="scope">
<span v-if="scope.scope.activityStatus == statusNum.UNPUBLISH" <span v-if="scope.scope.activityStatus == statusNum.UNPUBLISH"
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!