Commit 5b95b4c4 by 前端

更新

1 parent ee4ce8c8
......@@ -8,7 +8,6 @@ import emoji from '../../utils/emo'
export default {
name: 'ly-emotion',
mounted() {
console.log(123123)
const name = this.$el.innerHTML
const list = emoji.flat(Infinity)
let index = parseInt(list.indexOf(name)) + 1
......
......@@ -347,6 +347,10 @@ export default {
props: {
btnList: Array,
form: String,
previewList: {
type: Array,
default: () => [],
},
boxHeight: {
type: Number,
default: 400,
......@@ -367,7 +371,7 @@ export default {
loading: false,
emotionStatus: false,
guestForm: {},
previewList: [],
// previewList: [],
sendType: '',
sendTime: '',
sendDate: '',
......@@ -377,12 +381,20 @@ export default {
}
},
mounted() {
document.addEventListener('click', (e) => {
console.log(e.target.className)
if (e.target.className != 'emotion-item') {
this.emotionStatus = false
}
})
// document.addEventListener('click', (e) => {
// console.log(e.target.className)
// if (e.target.className != 'emotion-item') {
// this.emotionStatus = false
// }
// })
console.log(this.previewList)
if (this.previewList.length) {
this.previewList.map((item) => {
if (item.materialType == ATT_TYPE.TEXT) {
this.textValue = item.materialContent
}
})
}
},
computed: {
activityList() {
......
......@@ -15,13 +15,15 @@
placeholder="请选择业务场景"
size="small"
>
<el-option label="1.3存量用户众筹" value="4"></el-option>
<el-option label="1.3存量用户众筹" :value="4"></el-option>
</el-select>
</el-form-item>
<el-form-item label="商户:" prop="merchantId">
<el-select
v-model="basicForm.merchantId"
filterable
remote
:remote-method="remoteMethod"
placeholder="请选择商户"
size="small"
@focus="selectMerchant"
......@@ -59,9 +61,9 @@
</el-form-item>
<el-form-item label="发放渠道:" prop="channel">
<el-radio-group v-model="basicForm.channel">
<el-radio label="1">广联</el-radio>
<el-radio label="2">门店</el-radio>
<el-radio label="3">服务商</el-radio>
<el-radio :label="1">广联</el-radio>
<el-radio :label="2">门店</el-radio>
<el-radio :label="3">服务商</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="备注:">
......@@ -121,11 +123,11 @@
@change="selectTaskType(item, index, itm, index1)"
size="small"
>
<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 label="成单指标" value="5"></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 label="成单指标" :value="5"></el-option>
</el-select>
</el-form-item>
<el-form-item
......@@ -164,6 +166,7 @@
:form="'customer'"
style="line-height: 12px"
:btnList="btnList"
:previewList="itm.missionMaterialList"
@getEditor="getEditor(item, index, itm, index1)"
@shareMatrial="shareMatrial"
></GLEditor>
......@@ -300,13 +303,13 @@ export default {
return {
// 基础信息表单
basicForm: {
businessScene: '4',
businessScene: 4,
merchantId: '',
merchantName: '',
activityId: '',
activityName: '',
crowd: ['4'],
channel: '1',
channel: 1,
remark: '',
},
// 商户列表
......@@ -357,6 +360,11 @@ export default {
],
// 任务计划
taskList: [],
// 任务id
taskId: '',
// 活动开始/结束时间
startTime: '',
endTime: '',
// 公共任务类型
basicObj: {
missonType: '',
......@@ -453,6 +461,7 @@ export default {
// this.taskList = params.task.missionDateList
this.findMissionDeail(params.task.id)
this.getEditTaskList()
this.taskId = params.task.id
console.log(this.taskList, '88888')
}
// 判断是否是复制
......@@ -483,7 +492,7 @@ export default {
// this.$refs.activityDia.init(44209390)
},
// 选择商户
selectMerchant() {
selectMerchant(query) {
if (!this.basicForm.businessScene) {
this.$message({
message: '请先选择业务场景',
......@@ -492,7 +501,9 @@ export default {
return
}
let params = {}
params.sceneCode = 'SC00' + this.basicForm.businessScene
// params.sceneCode = 'SC00' + this.basicForm.businessScene
params.sceneCode = 'SC003'
params.merchantName = query
taskApi.findMerchantByScene(params).then((res) => {
console.log(res, 'selectMerchant')
this.merchantList = res.data.data
......@@ -502,6 +513,13 @@ export default {
changeMerchant(val) {
console.log(val)
},
remoteMethod(query) {
if (query !== '') {
this.selectMerchant(query)
} else {
this.merchantList = []
}
},
// 选择活动
selectActivity(selectItem) {
console.log(selectItem)
......@@ -544,6 +562,7 @@ export default {
startTime = new Date(startTime)
endTime = new Date(endTime)
let num = 0
let editList = []
while (endTime.getTime() - startTime.getTime() >= 0) {
const year = startTime.getFullYear()
const month =
......@@ -556,18 +575,10 @@ export default {
: startTime.getDate()
// 判断是否为复制页面
if (!this.isClone) {
if (!this.isEditor) {
this.taskList.push({
activityTime: `${year}-${month}-${day}`,
missionList: [],
})
} else {
let editList = []
editList.push({
activityTime: `${year}-${month}-${day}`,
missionList: [],
})
}
this.taskList.push({
activityTime: `${year}-${month}-${day}`,
missionList: [],
})
} else {
this.$set(this.taskList[num], 'activityTime', `${month}-${day}`)
}
......@@ -583,6 +594,22 @@ export default {
missionList: [],
})
}
// 如果是编辑页面,任务计划回显
if (this.isEditor) {
for (var i = 0; i < this.taskList.length; i++) {
for (var j = 0; j < this.taskEditList.missionDateList.length; j++) {
console.log(this.taskEditList.missionDateList[j], '123123')
if (
this.taskList[i].activityTime ==
this.taskEditList.missionDateList[j].activityTime
) {
this.taskList[i].missionList =
this.taskEditList.missionDateList[j].missionList
}
}
}
}
console.log(this.taskList, 'this.taskList')
return this.taskList
},
// 添加任务
......@@ -698,17 +725,21 @@ export default {
crowd,
remark,
merchantId,
startTime,
endTime,
} = res.data
this.basicForm.activityId = activityId
this.basicForm.activityName = activityName
this.basicForm.businessScene = businessScene
this.basicForm.channel = channel
// this.basicForm.crowd = crowd.split(',')
this.basicForm.crowd = ['4']
this.basicForm.crowd = crowd.split(',')
this.basicForm.remark = remark
this.basicForm.merchantId = merchantId
this.startTime = startTime
this.endTime = endTime
this.taskEditList = res.data
this.taskList = res.data.missionDateList
// this.taskList = res.data.missionDateList
this.setHouseRatesColumn(startTime, endTime)
console.log(this.taskList)
}
})
......@@ -767,19 +798,28 @@ export default {
params.endTime = this.endTime
params.crowd = params.crowd.join(',')
params.missionDateList = this.taskList
params.id = this.taskId
console.log(params)
taskApi.creatMission(params).then((res) => {
console.log(res)
if (res && res.code == 0) {
this.$root.close('*添加任务模板')
this.$root.to([
'任务中心',
'任务平台',
'任务管理',
'任务模板管理',
'任务管理列表',
])
}
// 创建
if (!this.isEditor) {
taskApi.creatMission(params).then((res) => {
console.log(res)
if (res && res.code == 0) {
this.$root.close('*添加任务模板')
this.$root.to([
'任务中心',
'任务平台',
'任务管理',
'任务模板管理',
'任务管理列表',
])
}
})
return
}
// 编辑
taskApi.updateMission(params).then((res) => {
console.log(res, 'update')
})
},
// 取消
......
......@@ -119,24 +119,24 @@
const sceneOption = [
{
label: '全部',
value: ''
value: '',
},
{
label: '1.0新车权益销售',
value: '0'
value: '0',
},
{
label: '1.1次新车精品升级',
value: '1'
value: '1',
},
{
label: '1.2次新车线上转化',
value: '2'
value: '2',
},
{
label: '1.3存量用户众筹',
value: '3'
}
value: '3',
},
]
const statusNum = {
UNPUBLISH: '1',
......@@ -146,20 +146,20 @@ const statusNum = {
const taskStatus = [
{
label: '全部',
value: ''
value: '',
},
{
label: '未发布',
value: statusNum.UNPUBLISH
value: statusNum.UNPUBLISH,
},
{
label: '已发布',
value: statusNum.PUBLISHED
value: statusNum.PUBLISHED,
},
{
label: '已结束',
value: statusNum.FINISHIED
}
value: statusNum.FINISHIED,
},
]
import { taskApi } from '../../../api/task'
......@@ -191,7 +191,7 @@ export default {
{
label: '商户',
prop: 'merchantName',
width: 150
width: 150,
},
{
label: '活动/产品',
......@@ -200,16 +200,16 @@ export default {
},
{
label: '任务数',
prop: 'missionCount'
prop: 'missionCount',
},
{
label: '创建人',
prop: 'createdBy'
prop: 'createdBy',
},
{
label: '创建时间',
prop: 'createdTime',
width: 150
width: 150,
},
{
label: '状态',
......@@ -260,14 +260,6 @@ export default {
{ taskId: scope.id }
)
},
// 编辑
handleEdit(item, type) {
const para = {
task: item,
type,
=======
// 编辑
handleEdit(item, type) {
const para = {
......@@ -318,23 +310,17 @@ export default {
// 跳转查看详情
handleViewDetail(scope) {
console.log(scope)
this.$root.to([
'任务中心',
'任务平台',
'任务管理',
'任务模板管理',
'*查看任务'
], { taskId: scope.id })
this.$root.to(
['任务中心', '任务平台', '任务管理', '任务模板管理', '*查看任务'],
{ taskId: scope.id }
)
},
// 任务分析
handleAnalyze(scope) {
this.$root.to([
'任务中心',
'任务平台',
'任务管理',
'任务模板管理',
'*任务分析'
], { taskId: scope.id })
this.$root.to(
['任务中心', '任务平台', '任务管理', '任务模板管理', '*任务分析'],
{ taskId: scope.id }
)
},
// 二次确认
secondConfirm(title, txt, apiParams, apiId, fn) {
......@@ -348,7 +334,7 @@ export default {
taskApi.updateStatusMission(params).then((res) => {
this.$message({
message: res.code == '0' ? '操作成功' : '操作失败',
type: res.code == '0' ? 'success' : 'error'
type: res.code == '0' ? 'success' : 'error',
})
if (res.code == '0') {
console.log('delere')
......@@ -358,10 +344,10 @@ export default {
}
})
}
}
},
})
}
}
},
},
}
</script>
<style lang="scss" scoped>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!