提交 656e519a authored 作者: matian's avatar matian

update:前两步代码提交

上级 2ed2496d
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
{{ '0' + (index + 1) }} {{ '0' + (index + 1) }}
</div> </div>
</div> </div>
<div class="item_bottom" :class="activeStep === index ? 'item_bottom_active' : 'item_bottom_inactive'"> <div class="item_bottom" :class="activeStep === index ? 'item_bottom_active' : ' '">
{{ item.stepName }} {{ item.stepName }}
</div> </div>
</li> </li>
......
<template> <template>
<div class="home"> <div class="home">
<div class="top"> <div class="top">
<el-button style="margin-left:10px;" type="primary" size="medium" plain round @click="handleLogout">退出系统</el-button> <el-button style="margin-left: 10px" type="primary" size="medium" plain round @click="handleLogout"
>退出系统</el-button
>
<!-- <el-button type="primary" size="medium" plain round @click="roleVisible = true">切换角色</el-button> --> <!-- <el-button type="primary" size="medium" plain round @click="roleVisible = true">切换角色</el-button> -->
<el-button type="primary" size="medium" plain round @click="visible = true">切换案例</el-button> <el-button type="primary" size="medium" plain round @click="visible = true">切换案例</el-button>
</div> </div>
...@@ -10,7 +12,13 @@ ...@@ -10,7 +12,13 @@
<div class="logo">金融</div> <div class="logo">金融</div>
<app-menu /> <app-menu />
</div> </div>
<btn v-for="(item, index) in btnList" :key="index" :attrs="{ title: item.label, left: item.left, top: item.top }" @click.native="handleClick(item)" :disabled="item.disabled.includes(role)"/> <btn
v-for="(item, index) in btnList"
:key="index"
:attrs="{ title: item.label, left: item.left, top: item.top }"
@click.native="handleClick(item)"
:disabled="item.disabled.includes(role)"
/>
</div> </div>
<role-select :visible="roleVisible" @roleSelect="fetchSelectRole" /> <role-select :visible="roleVisible" @roleSelect="fetchSelectRole" />
<case-select v-model="visible" :show-close="!!_case.id"></case-select> <case-select v-model="visible" :show-close="!!_case.id"></case-select>
...@@ -83,14 +91,16 @@ export default { ...@@ -83,14 +91,16 @@ export default {
// } // }
// }, // },
fetchWorkStatus() { fetchWorkStatus() {
return new Promise((resolve) => { return new Promise(resolve => {
getWorkStatus().then(res => { getWorkStatus()
.then(res => {
if (res.code === 0 && res.data && res.data.case_status) { if (res.code === 0 && res.data && res.data.case_status) {
resolve(true) resolve(true)
} else { } else {
resolve(false) resolve(false)
} }
}).catch(() => resolve(false)) })
.catch(() => resolve(false))
}) })
}, },
menuSelect(item) { menuSelect(item) {
...@@ -102,7 +112,8 @@ export default { ...@@ -102,7 +112,8 @@ export default {
}) })
}, },
fetchSelectRole(role) { fetchSelectRole(role) {
selectRole({ role }).then(res => { selectRole({ role })
.then(res => {
if (res.code === 0 && res.data && res.data.status) { if (res.code === 0 && res.data && res.data.status) {
// this.$message.success('选择角色成功!') // this.$message.success('选择角色成功!')
this.$store.commit('setRole', role) this.$store.commit('setRole', role)
...@@ -110,7 +121,8 @@ export default { ...@@ -110,7 +121,8 @@ export default {
} else { } else {
// this.$message.error(res.message) // this.$message.error(res.message)
} }
}).catch(err => { })
.catch(err => {
console.log(err) console.log(err)
}) })
} }
...@@ -119,49 +131,49 @@ export default { ...@@ -119,49 +131,49 @@ export default {
</script> </script>
<style scoped> <style scoped>
.top{ .top {
height:80px; height: 80px;
padding:20px 50px 0 0; padding: 20px 50px 0 0;
} }
.top .el-button{ .top .el-button {
float:right; float: right;
} }
.inner{ .inner {
background:url('@/assets/images/home.png') no-repeat left center; background: url('@/assets/images/home.png') no-repeat left center;
width:1398px; width: 1398px;
height:552px; height: 552px;
margin:0 auto 30px; margin: 0 auto 30px;
border-radius:6px; border-radius: 6px;
position:relative; position: relative;
} }
.header{ .header {
margin:0 6.9%; margin: 0 6.9%;
height:100px; height: 100px;
padding-top:33px; padding-top: 33px;
display:flex; display: flex;
} }
.logo{ .logo {
font-size: 40px; font-size: 40px;
font-family: Source Han Sans CN; font-family: Source Han Sans CN;
font-weight: bold; font-weight: bold;
color: #60A797; color: #60a797;
text-align:center; text-align: center;
width:280px; width: 280px;
} }
.menu{ .menu {
width: 780px; width: 780px;
height:56px; height: 56px;
border-radius:28px; border-radius: 28px;
display:flex; display: flex;
font-size:18px; font-size: 18px;
line-height:56px; line-height: 56px;
color:#fff; color: #fff;
} }
.menu li{ .menu li {
padding:0 40px; padding: 0 40px;
cursor: pointer; cursor: pointer;
} }
.menu li.active{ .menu li.active {
font-weight: bold; font-weight: bold;
} }
</style> </style>
<template>
<div class="main_con">
<div class="main_con_add" @click="handleAdd">
<img src="https://webapp-pub.ezijing.com/x-training-new/bg_add.png" alt="" />
添加
</div>
<div class="main_con_optionList">
<div class="optionList_left">
<div v-for="item in list.length - 1" :key="item">
<div class="optionList_left_line"></div>
<div class="optionList_left_text"></div>
</div>
</div>
<div class="optionList_right">
<el-form :inline="true" :model="form[0].form">
<div v-for="(item, indexB) in list" :key="indexB">
<el-form-item>
<span class="optionList_right_text">当用户做过</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<el-select v-model="item.startValue">
<el-option
v-for="it in item.personalMap"
:key="it.value"
:label="it.label"
:value="it.value"
:disabled="it.disabled"
>
</el-option>
</el-select>
&nbsp;&nbsp;&nbsp;&nbsp;
<template v-if="item.personalMap.find(i => item.startValue === 'trigger')">
<el-select v-model="item.triggerValue">
<el-option
v-for="it in item.personalMap.find(i => item.startValue === i.value).children"
:key="it.value"
:label="it.label"
:value="it.value"
:disabled="it.disabled"
>
</el-option>
</el-select>
</template>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<span class="optionList_right_text">出现弹窗</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</el-form-item>
<el-form-item>
<img
src="https://webapp-pub.ezijing.com/x-training-new/btn_del.png"
@click="handleDelete(item, indexB)"
/>
</el-form-item>
</div>
</el-form>
</div>
</div>
</div>
</template>
<script>
export default {
props: {
form: {
type: Array,
default: () => {}
}
},
data() {
return {}
},
mounted() {},
computed: {
list() {
console.log(this.form[0].form.triggerList, 'oooo')
return this.form[0].form.triggerList.map(item => {
item.personalMap = item.personalMap.map(i => {
i.disabled = !!this.form[0].form.triggerList.find(item => item.startValue === i.value)
return i
})
return item
})
}
},
methods: {
handleAdd() {
if (this.form[0].form.triggerList.length < this.form[0].form.triggerList[0].personalMap.length) {
const item = Object.assign({}, this.form[0].form.triggerList[0])
item.startValue = ''
item.triggerValue = ''
// eslint-disable-next-line vue/no-mutating-props
this.form[0].form.triggerList.push(item)
} else {
this.$message.warning('添加项不能超过下拉选项个数')
}
},
handleDelete(item, indexB) {
if (this.form[0].form.triggerList.length > 1) {
// eslint-disable-next-line vue/no-mutating-props
this.form[0].form.triggerList.splice(indexB, 1)
} else {
this.$message.warning('默认至少有一条数据')
}
}
}
}
</script>
<style lang="scss" scoped>
.main_con {
display: flex;
flex-direction: column;
.main_con_add {
align-self: flex-end;
padding: 0 130px 30px 0;
}
.main_con_optionList {
display: flex;
.optionList_left {
position: relative;
display: flex;
flex-direction: column;
.optionList_left_line {
width: 0px;
height: 85px;
border: 1px solid #c5c5c5;
opacity: 1;
}
.optionList_left_text {
border-radius: 50%;
width: 25px;
height: 25px;
background: #fff;
border: 1px solid #c5c5c5;
text-align: center;
font-size: 14px;
font-weight: 400;
line-height: 25px;
color: #49bba2;
margin-left: -12px;
margin-top: -60px;
}
}
.optionList_right {
margin-left: 16px;
.el-form-item {
padding-top: 0;
.optionList_right_text {
font-size: 16px;
font-weight: 400;
color: #333333;
}
.optionList_right_del {
width: 12px;
height: 12px;
opacity: 1;
}
}
}
}
}
</style>
...@@ -30,7 +30,6 @@ export default { ...@@ -30,7 +30,6 @@ export default {
let flag = true let flag = true
this.stepOneList.forEach(item => this.stepOneList.forEach(item =>
item.form.personAttribute.forEach(it => { item.form.personAttribute.forEach(it => {
console.log(it, '333')
if (it.equal === '' || it.personal === '' || it.range === '') { if (it.equal === '' || it.personal === '' || it.range === '') {
flag = false flag = false
} }
......
...@@ -5,16 +5,10 @@ ...@@ -5,16 +5,10 @@
<template #trigger_title>触发事件</template> <template #trigger_title>触发事件</template>
<template #trigger_con> <template #trigger_con>
<div v-if="showIndex === 0"> <div v-if="showIndex === 0">
&nbsp;&nbsp; <AppStartUp :form="stepTwoList" />
<el-date-picker v-model="times" type="datetime" placeholder="选择日期" value-format="yyyy-MM-dd">
</el-date-picker>
&nbsp;&nbsp;
<el-time-picker v-model="times2" arrow-control placeholder="选择时间" size="mini" value-format="HH:mm:ss">
</el-time-picker>
&nbsp;&nbsp;对目标用户进行触达
</div> </div>
<div v-if="showIndex === 1"> <div v-if="showIndex === 1">
<AppTodoList :form="stepTwoList" /> <AppTodoList :form="stepTwoList2" />
</div> </div>
</template> </template>
</StepTab> </StepTab>
...@@ -24,9 +18,13 @@ ...@@ -24,9 +18,13 @@
<script> <script>
import StepTab from '@/components/base/StepTab.vue' import StepTab from '@/components/base/StepTab.vue'
import AppTodoList from './AppTodoList.vue' import AppTodoList from './AppTodoList.vue'
import AppStartUp from './AppStartUp.vue'
export default { export default {
components: { StepTab, AppTodoList }, components: { StepTab, AppTodoList, AppStartUp },
props: { props: {
stepTwoList2: {
type: Array
},
stepTwoList: { stepTwoList: {
type: Array type: Array
}, },
...@@ -40,8 +38,6 @@ export default { ...@@ -40,8 +38,6 @@ export default {
data() { data() {
return { return {
times: '',
times2: '',
caseId: '', caseId: '',
showIndex: 0, showIndex: 0,
// tab切换列表 // tab切换列表
...@@ -59,12 +55,6 @@ export default { ...@@ -59,12 +55,6 @@ export default {
] ]
} }
}, },
mounted() {
// console.log(this.time, 'time')
this.times = this.time
this.times2 = this.time2
// console.log(this.stepTwoList, '9999')
},
methods: { methods: {
handleTab(index) { handleTab(index) {
...@@ -74,12 +64,9 @@ export default { ...@@ -74,12 +64,9 @@ export default {
this.$parent.$parent.handlePrev() this.$parent.$parent.handlePrev()
}, },
handleStepTwo() { handleStepTwo() {
console.log(this.times)
this.$emit('getTime', this.times, this.times2)
// this.$emit('getTime', this.times)
let flag = true let flag = true
this.stepTwoList[0].form.triggerList.forEach(item => { this.stepTwoList[0].form.triggerList.forEach(item => {
if (item.triggerValue === '' || this.times === '' || this.times2 === '') { if (item.triggerValue === '') {
flag = false flag = false
} }
}) })
......
...@@ -54,7 +54,6 @@ export default { ...@@ -54,7 +54,6 @@ export default {
return {} return {}
}, },
mounted() { mounted() {
console.log(this.form, '----')
}, },
computed: { computed: {
list() { list() {
...@@ -69,7 +68,6 @@ export default { ...@@ -69,7 +68,6 @@ export default {
}, },
methods: { methods: {
handleAdd() { handleAdd() {
console.log('000')
if (this.form[0].form.triggerList.length < this.form[0].form.triggerList[0].list.length) { if (this.form[0].form.triggerList.length < this.form[0].form.triggerList[0].list.length) {
const item = Object.assign({}, this.form[0].form.triggerList[0]) const item = Object.assign({}, this.form[0].form.triggerList[0])
item.triggerValue = '' item.triggerValue = ''
......
...@@ -30,7 +30,6 @@ export default { ...@@ -30,7 +30,6 @@ export default {
let flag = true let flag = true
this.stepOneList.forEach(item => this.stepOneList.forEach(item =>
item.form.personAttribute.forEach(it => { item.form.personAttribute.forEach(it => {
console.log(it, '333')
if (it.equal === '' || it.personal === '' || it.range === '') { if (it.equal === '' || it.personal === '' || it.range === '') {
flag = false flag = false
} }
......
...@@ -63,10 +63,8 @@ export default { ...@@ -63,10 +63,8 @@ export default {
} }
}, },
mounted() { mounted() {
// console.log(this.time, 'time')
this.times = this.time this.times = this.time
this.times2 = this.time2 this.times2 = this.time2
// console.log(this.stepTwoList, '9999')
}, },
methods: { methods: {
...@@ -77,9 +75,7 @@ export default { ...@@ -77,9 +75,7 @@ export default {
this.$parent.$parent.handlePrev() this.$parent.$parent.handlePrev()
}, },
handleStepTwo() { handleStepTwo() {
console.log(this.times)
this.$emit('getTime', this.times, this.times2) this.$emit('getTime', this.times, this.times2)
// this.$emit('getTime', this.times)
let flag = true let flag = true
this.stepTwoList[0].form.triggerList.forEach(item => { this.stepTwoList[0].form.triggerList.forEach(item => {
if (item.triggerValue === '' || this.times === '' || this.times2 === '') { if (item.triggerValue === '' || this.times === '' || this.times2 === '') {
......
...@@ -54,7 +54,6 @@ export default { ...@@ -54,7 +54,6 @@ export default {
return {} return {}
}, },
mounted() { mounted() {
console.log(this.form, '----')
}, },
computed: { computed: {
list() { list() {
...@@ -69,7 +68,6 @@ export default { ...@@ -69,7 +68,6 @@ export default {
}, },
methods: { methods: {
handleAdd() { handleAdd() {
console.log('000')
if (this.form[0].form.triggerList.length < this.form[0].form.triggerList[0].list.length) { if (this.form[0].form.triggerList.length < this.form[0].form.triggerList[0].list.length) {
const item = Object.assign({}, this.form[0].form.triggerList[0]) const item = Object.assign({}, this.form[0].form.triggerList[0])
item.triggerValue = '' item.triggerValue = ''
......
...@@ -30,7 +30,6 @@ export default { ...@@ -30,7 +30,6 @@ export default {
let flag = true let flag = true
this.stepOneList.forEach(item => this.stepOneList.forEach(item =>
item.form.personAttribute.forEach(it => { item.form.personAttribute.forEach(it => {
console.log(it, '333')
if (it.equal === '' || it.personal === '' || it.range === '') { if (it.equal === '' || it.personal === '' || it.range === '') {
flag = false flag = false
} }
......
...@@ -6,45 +6,134 @@ ...@@ -6,45 +6,134 @@
<template #trigger_con> <template #trigger_con>
<div v-if="showIndex === 0"> <div v-if="showIndex === 0">
&nbsp;&nbsp; &nbsp;&nbsp;
<el-date-picker v-model="times" type="datetime" placeholder="选择日期" value-format="yyyy-MM-dd"> <el-date-picker v-model="triggerDate" type="datetime" placeholder="选择日期" value-format="yyyy-MM-dd">
</el-date-picker> </el-date-picker>
&nbsp;&nbsp; &nbsp;&nbsp;
<el-time-picker v-model="times2" arrow-control placeholder="选择时间" size="mini" value-format="HH:mm:ss"> <el-time-picker
v-model="triggerTime"
arrow-control
placeholder="选择时间"
size="mini"
value-format="HH:mm:ss"
>
</el-time-picker> </el-time-picker>
&nbsp;&nbsp;对目标用户进行触达 &nbsp;&nbsp;对目标用户进行触达
</div> </div>
<div v-if="showIndex === 1"> <div v-if="showIndex === 1">
<SmsTodoList :form="stepTwoList" /> &nbsp;&nbsp;
<el-date-picker
v-model="time_range"
type="daterange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
>
</el-date-picker>
&nbsp;&nbsp;时间范围内
<br />
<br />
&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;
<el-select v-model="times_every">
<el-option v-for="it in timesList" :key="it.value" :label="it.label" :value="it.value"> </el-option>
</el-select>
&nbsp;&nbsp;&nbsp;
<el-time-picker v-model="times_hour" arrow-control placeholder="选择时间" size="mini" value-format="HH:mm:ss">
</el-time-picker>
发送
</div>
<div v-if="showIndex === 2">
<!-- 节气 -->
<div class="solarTerms">
<div class="solarTerms_left">
<div class="solarTerms_left_top">节气</div>
<div
:class="checkAllSolar ? 'solarTerms_left_top_selectActive' : 'solarTerms_left_top_select'"
@click="handleSelectAllSolar"
>
全选
</div>
</div>
<div class="solarTerms_right">
<div
v-for="(item, index) in solarTermsList"
:key="index"
:class="item.isActive ? 'solarTerms_right_itemActive' : 'solarTerms_right_item'"
@click="handleItemSolarActive(item)"
>
{{ item.name }}
</div>
</div>
</div>
<!-- 节日 -->
<div class="festival">
<div class="festival_left">
<div class="festival_left_top">节日</div>
<div
:class="checkAllFest ? 'festival_left_top_selectActive' : 'festival_left_top_select'"
class="festival_left_top_select"
@click="handleSelectAllFes"
>
全选
</div>
</div>
<div class="festival_right">
<div v-for="(item, index) in festivalList" :key="index">
<div
:class="item.isActive ? 'festival_right_itemActive' : 'festival_right_item'"
@click="handleItemFesActive(item)"
>
{{ item.name }}
</div>
</div>
</div>
</div>
<div class="sendMessage">
在如上日期
<el-time-picker
v-model="times_send"
arrow-control
placeholder="选择时间"
size="mini"
value-format="HH:mm:ss"
>
</el-time-picker>
发送
</div>
</div> </div>
</template> </template>
</StepTab> </StepTab>
<div class="main_content_btn">
<!-- <div class="step_prev step_btn" @click="handlePrev">上一步</div>
<div class="step_next step_btn" @click="handleNext">下一步</div> -->
</div>
</div> </div>
</template> </template>
<script> <script>
import StepTab from '@/components/base/StepTab.vue' import StepTab from '@/components/base/StepTab.vue'
import SmsTodoList from './SmsTodoList.vue'
export default { export default {
components: { StepTab, SmsTodoList }, components: { StepTab },
props: { props: {
stepTwoList: { stepTwoData: {}
type: Array
},
time: {
type: String
},
time2: {
type: String
}
}, },
data() { data() {
return { return {
times: '', timesList: [
times2: '', {
value: '0',
label: '每日'
},
{
value: '1',
label: '每周'
},
{
value: '2',
label: '每月'
}
],
triggerDate: '', // 单次触发 触发日期
triggerTime: '', // 单次触发 触发时间
time_range: [], // 周期触发 触发时间范围
times_every: '', // 周期触发 触发周期
times_hour: '', // 周期触发 触发时间
times_send: '', // 节日触发 触发时间
caseId: '', caseId: '',
showIndex: 0, showIndex: 0,
// tab切换列表 // tab切换列表
...@@ -57,39 +146,141 @@ export default { ...@@ -57,39 +146,141 @@ export default {
{ {
icon: 'https://webapp-pub.ezijing.com/x-training-new/tab_icon21.png', icon: 'https://webapp-pub.ezijing.com/x-training-new/tab_icon21.png',
iconActive: 'https://webapp-pub.ezijing.com/x-training-new/tab_icon22.png', iconActive: 'https://webapp-pub.ezijing.com/x-training-new/tab_icon22.png',
tabName: '条件触发' tabName: '周期触发'
},
{
icon: 'https://webapp-pub.ezijing.com/x-training-new/tab_icon21.png',
iconActive: 'https://webapp-pub.ezijing.com/x-training-new/tab_icon22.png',
tabName: '节日触发'
} }
],
festivalList: [
{ id: '0', name: '元旦', isActive: false },
{ id: '1', name: '情人节', isActive: false },
{ id: '2', name: '愚人节', isActive: false },
{ id: '3', name: '复活节', isActive: false },
{ id: '4', name: '母亲节', isActive: false },
{ id: '5', name: '父亲节', isActive: false },
{ id: '6', name: '感恩节', isActive: false },
{ id: '7', name: '万圣节', isActive: false },
{ id: '8', name: '元旦节', isActive: false },
{ id: '9', name: '小满', isActive: false }
],
solarTermsList: [
{ id: '0', name: '小寒', isActive: false },
{ id: '1', name: '大寒', isActive: false },
{ id: '2', name: '立春', isActive: false },
{ id: '3', name: '雨水', isActive: false },
{ id: '4', name: '惊蛰', isActive: false },
{ id: '5', name: '春分', isActive: false },
{ id: '6', name: '清明', isActive: false },
{ id: '7', name: '谷雨', isActive: false },
{ id: '8', name: '立夏', isActive: false },
{ id: '9', name: '小满', isActive: false },
{ id: '10', name: '芒种', isActive: false },
{ id: '11', name: '夏至', isActive: false },
{ id: '12', name: '小暑', isActive: false },
{ id: '13', name: '大暑', isActive: false },
{ id: '14', name: '立秋', isActive: false },
{ id: '15', name: '处暑', isActive: false },
{ id: '16', name: '白露', isActive: false },
{ id: '17', name: '秋分', isActive: false },
{ id: '18', name: '寒露', isActive: false },
{ id: '19', name: '霜降', isActive: false },
{ id: '20', name: '立冬', isActive: false },
{ id: '21', name: '小雪', isActive: false },
{ id: '22', name: '大雪', isActive: false },
{ id: '23', name: '冬至', isActive: false }
] ]
} }
}, },
computed: {
// 全选节气
checkAllSolar() {
return this.solarTermsList.filter(item => item.isActive === true).length === this.solarTermsList.length
},
// 全选节日
checkAllFest() {
return this.festivalList.filter(item => item.isActive === true).length === this.festivalList.length
}
},
mounted() { mounted() {
// console.log(this.time, 'time') this.festivalList = this.stepTwoData.festivalList.length ? this.stepTwoData.festivalList : this.festivalList
this.times = this.time this.solarTermsList = this.stepTwoData.solarTermsList.length ? this.stepTwoData.solarTermsList : this.solarTermsList
this.times2 = this.time2 this.triggerDate = this.stepTwoData.triggerDate
// console.log(this.stepTwoList, '9999') this.triggerTime = this.stepTwoData.triggerTime
this.time_range = this.stepTwoData.time_range
this.times_every = this.stepTwoData.times_every
this.times_hour = this.stepTwoData.times_hour
this.times_send = this.stepTwoData.times_send
}, },
methods: { methods: {
// 全选节气
handleSelectAllSolar() {
if (this.checkAllSolar) {
this.solarTermsList.forEach(item => {
item.isActive = !item.isActive
})
} else {
this.solarTermsList.forEach(item => {
item.isActive = true
})
}
},
// 全选节日
handleSelectAllFes() {
if (this.checkAllFest) {
this.festivalList.forEach(item => {
item.isActive = !item.isActive
})
} else {
this.festivalList.forEach(item => {
item.isActive = true
})
}
},
// 是否选择节气
handleItemSolarActive(item) {
item.isActive = !item.isActive
},
// 是否选择节日
handleItemFesActive(item) {
item.isActive = !item.isActive
},
// tab切换
handleTab(index) { handleTab(index) {
this.showIndex = index this.showIndex = index
}, },
handlePrev() { // 进去下一步之前的判断
this.$parent.$parent.handlePrev()
},
handleStepTwo() { handleStepTwo() {
console.log(this.times) const stepTwoData = {
this.$emit('getTime', this.times, this.times2) triggerDate: this.triggerDate,
// this.$emit('getTime', this.times) triggerTime: this.triggerTime,
let flag = true time_range: this.time_range,
this.stepTwoList[0].form.triggerList.forEach(item => { times_every: this.times_every,
if (item.triggerValue === '' || this.times === '' || this.times2 === '') { times_hour: this.times_hour,
flag = false times_send: this.times_send,
solarTermsList: this.solarTermsList,
festivalList: this.festivalList
} }
})
if (!flag) { this.$emit('getTime', stepTwoData)
if (
this.triggerDate === '' ||
this.triggerTime === '' ||
this.time_range[0] === '' ||
this.time_range[1] === '' ||
this.times_every === '' ||
this.times_hour === '' ||
this.times_send === '' ||
this.festivalList.filter(item => item.isActive === false).length === this.festivalList.length ||
this.solarTermsList.filter(item => item.isActive === false).length === this.solarTermsList.length
) {
this.$message.warning('请完善改步骤后才能进入下一步') this.$message.warning('请完善改步骤后才能进入下一步')
return false
} }
return flag return true
} }
} }
} }
...@@ -121,4 +312,148 @@ export default { ...@@ -121,4 +312,148 @@ export default {
background: #49bba2; background: #49bba2;
} }
} }
.solarTerms {
display: flex;
.solarTerms_left {
width: 102px;
.solarTerms_left_top {
font-size: 16px;
font-weight: 500;
color: #333333;
padding-left: 19px;
}
.solarTerms_left_top_selectActive {
width: 70px;
height: 32px;
background: rgba(73, 187, 162, 0.39);
border-radius: 20px;
text-align: center;
font-size: 14px;
line-height: 32px;
color: #ffffff;
margin-top: 16px;
cursor: pointer;
}
.solarTerms_left_top_select {
width: 70px;
height: 32px;
border: 1px solid #cacaca;
border-radius: 20px;
font-size: 14px;
line-height: 32px;
color: #999999;
text-align: center;
margin-top: 16px;
cursor: pointer;
}
}
.solarTerms_right {
display: flex;
flex-wrap: wrap;
max-width: 465px;
.solarTerms_right_itemActive {
width: 60px;
height: 26px;
background: rgba(237, 245, 243, 0.39);
border: 1px solid #80d6c4;
border-radius: 20px;
text-align: center;
font-size: 12px;
line-height: 26px;
color: #49bba2;
margin-right: 11px;
margin-bottom: 11px;
}
.solarTerms_right_item {
width: 60px;
height: 26px;
background: rgba(255, 255, 255, 0.39);
border: 1px solid #e6e6e6;
border-radius: 20px;
font-size: 12px;
line-height: 26px;
text-align: center;
color: #999999;
margin-right: 11px;
margin-bottom: 11px;
}
}
}
.festival {
display: flex;
margin-top: 36px;
.festival_left {
width: 102px;
.festival_left_top {
font-size: 16px;
font-weight: 500;
color: #333333;
padding-left: 19px;
}
.festival_left_top_select {
cursor: pointer;
width: 70px;
height: 32px;
border: 1px solid #cacaca;
border-radius: 20px;
font-size: 14px;
line-height: 32px;
color: #999999;
text-align: center;
margin-top: 16px;
}
.festival_left_top_selectActive {
width: 70px;
height: 32px;
background: rgba(73, 187, 162, 0.39);
border-radius: 20px;
text-align: center;
font-size: 14px;
line-height: 32px;
color: #ffffff;
margin-top: 16px;
cursor: pointer;
}
}
.festival_right {
display: flex;
flex-wrap: wrap;
max-width: 465px;
.festival_right_itemActive {
width: 60px;
height: 26px;
background: rgba(237, 245, 243, 0.39);
border: 1px solid #80d6c4;
border-radius: 20px;
text-align: center;
font-size: 12px;
line-height: 26px;
color: #49bba2;
margin-right: 11px;
margin-bottom: 11px;
}
.festival_right_item {
width: 60px;
height: 26px;
background: rgba(255, 255, 255, 0.39);
border: 1px solid #e6e6e6;
border-radius: 20px;
font-size: 12px;
line-height: 26px;
text-align: center;
color: #999999;
margin-right: 11px;
margin-bottom: 11px;
}
}
}
.sendMessage {
margin-left: 146px;
margin-top: 39px;
}
</style> </style>
...@@ -53,9 +53,7 @@ export default { ...@@ -53,9 +53,7 @@ export default {
data() { data() {
return {} return {}
}, },
mounted() { mounted() {},
console.log(this.form, '----')
},
computed: { computed: {
list() { list() {
return this.form[0].form.triggerList.map(item => { return this.form[0].form.triggerList.map(item => {
...@@ -69,7 +67,6 @@ export default { ...@@ -69,7 +67,6 @@ export default {
}, },
methods: { methods: {
handleAdd() { handleAdd() {
console.log('000')
if (this.form[0].form.triggerList.length < this.form[0].form.triggerList[0].list.length) { if (this.form[0].form.triggerList.length < this.form[0].form.triggerList[0].list.length) {
const item = Object.assign({}, this.form[0].form.triggerList[0]) const item = Object.assign({}, this.form[0].form.triggerList[0])
item.triggerValue = '' item.triggerValue = ''
......
...@@ -29,7 +29,6 @@ export default { ...@@ -29,7 +29,6 @@ export default {
let flag = true let flag = true
this.stepOneList.forEach(item => this.stepOneList.forEach(item =>
item.form.personAttribute.forEach(it => { item.form.personAttribute.forEach(it => {
console.log(it, '333')
if (it.equal === '' || it.personal === '' || it.range === '') { if (it.equal === '' || it.personal === '' || it.range === '') {
flag = false flag = false
} }
......
...@@ -18,8 +18,6 @@ export default { ...@@ -18,8 +18,6 @@ export default {
data() { data() {
return { return {
times: '',
times2: '',
caseId: '', caseId: '',
showIndex: 0, showIndex: 0,
// tab切换列表 // tab切换列表
......
...@@ -14,8 +14,7 @@ ...@@ -14,8 +14,7 @@
v-if="activeStep === 1" v-if="activeStep === 1"
class="pt-50" class="pt-50"
:stepTwoList="stepTwoList" :stepTwoList="stepTwoList"
:time="time" :stepTwoList2="stepTwoList2"
:time2="time2"
@getTime="getTime" @getTime="getTime"
ref="mailStepTwo" ref="mailStepTwo"
/> />
...@@ -32,6 +31,7 @@ ...@@ -32,6 +31,7 @@
<script> <script>
import stepOne from '@/utils/stepOne' import stepOne from '@/utils/stepOne'
import appStepTwo from '@/utils/appStepTwo'
import stepTwo from '@/utils/stepTwo' import stepTwo from '@/utils/stepTwo'
import { cacheReport, getReportDetail, checkRecord } from '../api' import { cacheReport, getReportDetail, checkRecord } from '../api'
import ToolCard from '@/components/base/ToolCard.vue' import ToolCard from '@/components/base/ToolCard.vue'
...@@ -50,25 +50,15 @@ export default { ...@@ -50,25 +50,15 @@ export default {
activeStep: 0, activeStep: 0,
stepOneList: [], stepOneList: [],
stepTwoList: [], stepTwoList: [],
time: '', stepTwoList2: [],
caseId: '', caseId: ''
times: '',
times2: '',
time2: ''
} }
}, },
methods: { methods: {
// 获取第二步时间
getTime(val, val2) {
this.time = val
this.time2 = val2
},
// 上一步 // 上一步
handlePrev() { handlePrev() {
if (this.$refs.mailStepTwo.handleStepTwo()) {
this.handleStep(2) this.handleStep(2)
}
}, },
// 下一步 // 下一步
handleNext() { handleNext() {
...@@ -87,11 +77,7 @@ export default { ...@@ -87,11 +77,7 @@ export default {
const reports = { const reports = {
activeStep: parseInt(val), activeStep: parseInt(val),
type: 3, type: 3,
commit_report: [ commit_report: [{ stepOneList: this.stepOneList }, { form: this.stepTwoList, form1: this.stepTwoList2 }]
{ stepOneList: this.stepOneList },
{ form: this.stepTwoList },
{ time: this.times, time2: this.times2 }
]
} }
cacheReport(this.$store.state.case.id, { reports: JSON.stringify(reports) }).then(res => { cacheReport(this.$store.state.case.id, { reports: JSON.stringify(reports) }).then(res => {
this.caseId = res.data.id this.caseId = res.data.id
...@@ -113,23 +99,21 @@ export default { ...@@ -113,23 +99,21 @@ export default {
if (res.data.detail.answer.type === 3) { if (res.data.detail.answer.type === 3) {
this.activeStep = res.data.detail.answer.activeStep this.activeStep = res.data.detail.answer.activeStep
this.stepOneList = res.data.detail.answer.commit_report[0].stepOneList this.stepOneList = res.data.detail.answer.commit_report[0].stepOneList
this.time = res.data.detail.answer.commit_report[2].time || ''
this.time2 = res.data.detail.answer.commit_report[2].time2 || ''
this.stepTwoList = res.data.detail.answer.commit_report[1].form this.stepTwoList = res.data.detail.answer.commit_report[1].form
this.stepTwoList2 = res.data.detail.answer.commit_report[1].form1
} }
}) })
}, },
// 验证是否有未完成的答题记录 // 验证是否有未完成的答题记录
checkRecord() { checkRecord() {
checkRecord(this.$store.state.case.id, 2).then(res => { checkRecord(this.$store.state.case.id, 2).then(res => {
console.log(res, 'res000')
if (res.data.status === true) { if (res.data.status === true) {
const answerList = res.data.items.filter(item => item.type === 3) const answerList = res.data.items.filter(item => item.type === 3)
if (res.data.items.length && answerList.length) { if (res.data.items.length && answerList.length) {
this.activeStep = answerList[0].answer.activeStep this.activeStep = answerList[0].answer.activeStep
this.stepOneList = answerList[0].answer.commit_report[0].stepOneList this.stepOneList = answerList[0].answer.commit_report[0].stepOneList
this.stepTwoList = answerList[0].answer.commit_report[1].form this.stepTwoList = answerList[0].answer.commit_report[1].form
this.stepTwoList2 = answerList[0].answer.commit_report[1].form1
this.time = answerList[0].answer.commit_report[2].time || '' this.time = answerList[0].answer.commit_report[2].time || ''
this.time2 = answerList[0].answer.commit_report[2].time2 || '' this.time2 = answerList[0].answer.commit_report[2].time2 || ''
} else { } else {
...@@ -144,13 +128,11 @@ export default { ...@@ -144,13 +128,11 @@ export default {
initStepList() { initStepList() {
this.stepOneList = stepOne this.stepOneList = stepOne
this.stepTwoList = stepTwo this.stepTwoList = appStepTwo
this.time = this.times this.stepTwoList2 = stepTwo
this.time2 = this.times2
} }
}, },
mounted() { mounted() {
console.log(stepOne, 'stepOne2222')
if (this.$route.query.type) { if (this.$route.query.type) {
this.getReportDetail(this.$route.query.id) this.getReportDetail(this.$route.query.id)
} else { } else {
......
...@@ -69,9 +69,7 @@ export default { ...@@ -69,9 +69,7 @@ export default {
}, },
// 上一步 // 上一步
handlePrev() { handlePrev() {
if (this.$refs.mailStepTwo.handleStepTwo()) {
this.handleStep(2) this.handleStep(2)
}
}, },
// 下一步 // 下一步
handleNext() { handleNext() {
...@@ -121,23 +119,20 @@ export default { ...@@ -121,23 +119,20 @@ export default {
this.time = res.data.detail.answer.commit_report[2].time || '' this.time = res.data.detail.answer.commit_report[2].time || ''
this.time2 = res.data.detail.answer.commit_report[2].time2 || '' this.time2 = res.data.detail.answer.commit_report[2].time2 || ''
this.stepTwoList = res.data.detail.answer.commit_report[1].form this.stepTwoList = res.data.detail.answer.commit_report[1].form
console.log(this.times, '222')
console.log(this.activeStep, 'activeStep', this.stepOneList, '---', '123')
} }
}) })
}, },
// 验证是否有未完成的答题记录 // 验证是否有未完成的答题记录
checkRecord() { checkRecord() {
checkRecord(this.$store.state.case.id, 2).then(res => { checkRecord(this.$store.state.case.id, 2).then(res => {
console.log(res, 'res000')
if (res.data.status === true) { if (res.data.status === true) {
const answerList = res.data.items.filter(item => item.type === 2) const answerList = res.data.items.filter(item => item.type === 2)
if (res.data.items.length && answerList.length) { if (res.data.items.length && answerList.length) {
this.activeStep = answerList[0].answer.activeStep this.activeStep = answerList[0].answer.activeStep
this.stepOneList = answerList[0].answer.commit_report[0].stepOneList this.stepOneList = answerList[0].answer.commit_report[0].stepOneList || stepOne
this.stepTwoList = answerList[0].answer.commit_report[1].form this.stepTwoList = answerList[0].answer.commit_report[1].form || stepTwo
this.time = answerList[0].answer.commit_report[2].time || '' this.time = answerList[0].answer.commit_report[2].time || this.times
this.time2 = answerList[0].answer.commit_report[2].time2 || '' this.time2 = answerList[0].answer.commit_report[2].time2 || this.times2
} else { } else {
this.initStepList() this.initStepList()
} }
...@@ -159,7 +154,7 @@ export default { ...@@ -159,7 +154,7 @@ export default {
if (this.$route.query.type) { if (this.$route.query.type) {
this.getReportDetail(this.$route.query.id) this.getReportDetail(this.$route.query.id)
} else { } else {
this.initStepList() // this.initStepList()
this.checkRecord() this.checkRecord()
} }
} }
......
...@@ -13,11 +13,9 @@ ...@@ -13,11 +13,9 @@
<SmsStepTwo <SmsStepTwo
v-if="activeStep === 1" v-if="activeStep === 1"
class="pt-50" class="pt-50"
:stepTwoList="stepTwoList"
:time="time"
:time2="time2"
@getTime="getTime"
ref="mailStepTwo" ref="mailStepTwo"
@getTime="getTime"
:stepTwoData="stepTwoData"
/> />
<div class="main_content_btn"> <div class="main_content_btn">
<div class="step_prev step_btn" @click="handlePrev" v-if="activeStep > 0">上一步</div> <div class="step_prev step_btn" @click="handlePrev" v-if="activeStep > 0">上一步</div>
...@@ -32,7 +30,6 @@ ...@@ -32,7 +30,6 @@
<script> <script>
import stepOne from '@/utils/stepOne' import stepOne from '@/utils/stepOne'
import stepTwo from '@/utils/stepTwo'
import { cacheReport, getReportDetail, checkRecord } from '../api' import { cacheReport, getReportDetail, checkRecord } from '../api'
import ToolCard from '@/components/base/ToolCard.vue' import ToolCard from '@/components/base/ToolCard.vue'
import SmsStepOne from '../components/mobileSms/SmsStepOne.vue' import SmsStepOne from '../components/mobileSms/SmsStepOne.vue'
...@@ -47,28 +44,33 @@ export default { ...@@ -47,28 +44,33 @@ export default {
}, },
data() { data() {
return { return {
// times: '',
activeStep: 0, activeStep: 0,
stepOneList: [], stepOneList: [],
stepTwoList: [],
time: '',
caseId: '', caseId: '',
times: '', stepTwoData: {
times2: '', triggerDate: '',
time2: '' triggerTime: '',
time_range: '',
times_every: '',
times_hour: '',
times_send: '',
solarTermsList: [],
festivalList: []
}
} }
}, },
methods: { methods: {
// 获取第二步时间 // 获取第二步时间
getTime(val, val2) { getTime(val) {
this.time = val this.stepTwoData = val
this.time2 = val2
}, },
// 上一步 // 上一步
handlePrev() { handlePrev() {
if (this.$refs.mailStepTwo.handleStepTwo()) { // if (this.$refs.mailStepTwo.handleStepTwo()) {
this.handleStep(2) this.handleStep(2)
} // }
}, },
// 下一步 // 下一步
handleNext() { handleNext() {
...@@ -88,11 +90,7 @@ export default { ...@@ -88,11 +90,7 @@ export default {
const reports = { const reports = {
activeStep: parseInt(val), activeStep: parseInt(val),
type: 4, type: 4,
commit_report: [ commit_report: [{ stepOneList: this.stepOneList }, { stepTwoData: this.stepTwoData }]
{ stepOneList: this.stepOneList },
{ form: this.stepTwoList },
{ time: this.times, time2: this.times2 }
]
} }
cacheReport(this.$store.state.case.id, { reports: JSON.stringify(reports) }).then(res => { cacheReport(this.$store.state.case.id, { reports: JSON.stringify(reports) }).then(res => {
this.caseId = res.data.id this.caseId = res.data.id
...@@ -111,31 +109,23 @@ export default { ...@@ -111,31 +109,23 @@ export default {
// 获取步骤信息回显 // 获取步骤信息回显
getReportDetail(id) { getReportDetail(id) {
getReportDetail(id).then(res => { getReportDetail(id).then(res => {
console.log(res, 'res')
if (res.data.detail.answer.type === 4) { if (res.data.detail.answer.type === 4) {
this.activeStep = res.data.detail.answer.activeStep this.activeStep = res.data.detail.answer.activeStep
this.stepOneList = res.data.detail.answer.commit_report[0].stepOneList this.stepOneList = res.data.detail.answer.commit_report[0].stepOneList
this.time = res.data.detail.answer.commit_report[2].time || '' this.stepTwoData = res.data.detail.answer.commit_report[1].stepTwoData
this.time2 = res.data.detail.answer.commit_report[2].time2 || ''
this.stepTwoList = res.data.detail.answer.commit_report[1].form
console.log(this.times, '222')
console.log(this.activeStep, 'activeStep', this.stepOneList, '---', '123')
} }
}) })
}, },
// 验证是否有未完成的答题记录 // 验证是否有未完成的答题记录
checkRecord() { checkRecord() {
checkRecord(this.$store.state.case.id, 2).then(res => { checkRecord(this.$store.state.case.id, 2).then(res => {
console.log(res, 'res000')
if (res.data.status === true) { if (res.data.status === true) {
const answerList = res.data.items.filter(item => item.type === 4) const answerList = res.data.items.filter(item => item.type === 4)
console.log(answerList, 'answerList')
if (res.data.items.length && answerList.length) { if (res.data.items.length && answerList.length) {
this.activeStep = answerList[0].answer.activeStep this.activeStep = answerList[0].answer.activeStep
this.stepOneList = answerList[0].answer.commit_report[0].stepOneList this.stepOneList = answerList[0].answer.commit_report[0].stepOneList
this.stepTwoList = answerList[0].answer.commit_report[1].form this.stepTwoData = answerList[0].answer.commit_report[1].stepTwoData
this.time = answerList[0].answer.commit_report[2].time || ''
this.time2 = answerList[0].answer.commit_report[2].time2 || ''
} else { } else {
this.initStepList() this.initStepList()
} }
...@@ -147,12 +137,10 @@ export default { ...@@ -147,12 +137,10 @@ export default {
// 初始化步骤列表 // 初始化步骤列表
initStepList() { initStepList() {
this.stepOneList = stepOne this.stepOneList = stepOne
this.stepTwoList = stepTwo
this.time = this.times
this.time2 = this.times2
} }
}, },
mounted() { mounted() {
console.log(this.$route.query.type)
if (this.$route.query.type) { if (this.$route.query.type) {
this.getReportDetail(this.$route.query.id) this.getReportDetail(this.$route.query.id)
} else { } else {
......
...@@ -50,11 +50,7 @@ export default { ...@@ -50,11 +50,7 @@ export default {
const reports = { const reports = {
activeStep: this.activeStep, activeStep: this.activeStep,
type: 5, type: 5,
commit_report: [ commit_report: [{ stepOneList: this.stepOneList }, { form: this.stepTwoList }]
{ stepOneList: this.stepOneList },
{ form: this.stepTwoList },
{ time: this.time, time2: this.time2 }
]
} }
cacheReport(this.$store.state.case.id, { reports: JSON.stringify(reports) }).then(res => { cacheReport(this.$store.state.case.id, { reports: JSON.stringify(reports) }).then(res => {
this.caseId = res.data.id this.caseId = res.data.id
......
...@@ -210,6 +210,7 @@ export default { ...@@ -210,6 +210,7 @@ export default {
}) })
}, },
handleNav(val) { handleNav(val) {
console.log(val, '9999')
switch (this.tabActive) { switch (this.tabActive) {
case '1': case '1':
let path = '/product-analysis/report' let path = '/product-analysis/report'
...@@ -225,7 +226,17 @@ export default { ...@@ -225,7 +226,17 @@ export default {
case '3': case '3':
const _type = val.is_complete === 1 ? '1' : '0' const _type = val.is_complete === 1 ? '1' : '0'
console.log('111') console.log('111')
if (val.type === 1) {
this.$router.push({ path: '/market-tools/douYin', query: { id: val.id, type: _type } })
} else if (val.type === 2) {
this.$router.push({ path: '/market-tools/mail', query: { id: val.id, type: _type } }) this.$router.push({ path: '/market-tools/mail', query: { id: val.id, type: _type } })
} else if (val.type === 3) {
this.$router.push({ path: '/market-tools/app', query: { id: val.id, type: _type } })
} else if (val.type === 4) {
this.$router.push({ path: '/market-tools/sms', query: { id: val.id, type: _type } })
} else if (val.type === 5) {
this.$router.push({ path: '/market-tools/weChat', query: { id: val.id, type: _type } })
}
break break
} }
} }
......
const triggerList = [
{
form: {
triggerList: [
{
triggerValue: '',
startValue: '',
personalMap: [
{
value: 'start',
label: '启动App后',
disabled: false,
children: []
},
{
value: 'trigger',
label: '指定App页面',
disabled: false,
children: [
{ value: '0', label: '首页' },
{ value: '1', label: '消息页' },
{ value: '2', label: '理财产品页' },
{ value: '3', label: '基金产品页' },
{ value: '4', label: '保险产品页' }
]
}
]
}
]
}
}
]
export default triggerList
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论