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

update:前两步代码提交

上级 2ed2496d
......@@ -8,7 +8,7 @@
{{ '0' + (index + 1) }}
</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 }}
</div>
</li>
......
<template>
<div class="home">
<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="visible = true">切换案例</el-button>
</div>
......@@ -10,7 +12,13 @@
<div class="logo">金融</div>
<app-menu />
</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>
<role-select :visible="roleVisible" @roleSelect="fetchSelectRole" />
<case-select v-model="visible" :show-close="!!_case.id"></case-select>
......@@ -83,14 +91,16 @@ export default {
// }
// },
fetchWorkStatus() {
return new Promise((resolve) => {
getWorkStatus().then(res => {
if (res.code === 0 && res.data && res.data.case_status) {
resolve(true)
} else {
resolve(false)
}
}).catch(() => resolve(false))
return new Promise(resolve => {
getWorkStatus()
.then(res => {
if (res.code === 0 && res.data && res.data.case_status) {
resolve(true)
} else {
resolve(false)
}
})
.catch(() => resolve(false))
})
},
menuSelect(item) {
......@@ -102,66 +112,68 @@ export default {
})
},
fetchSelectRole(role) {
selectRole({ role }).then(res => {
if (res.code === 0 && res.data && res.data.status) {
// this.$message.success('选择角色成功!')
this.$store.commit('setRole', role)
// this.visible = false
} else {
// this.$message.error(res.message)
}
}).catch(err => {
console.log(err)
})
selectRole({ role })
.then(res => {
if (res.code === 0 && res.data && res.data.status) {
// this.$message.success('选择角色成功!')
this.$store.commit('setRole', role)
// this.visible = false
} else {
// this.$message.error(res.message)
}
})
.catch(err => {
console.log(err)
})
}
}
}
</script>
<style scoped>
.top{
height:80px;
padding:20px 50px 0 0;
.top {
height: 80px;
padding: 20px 50px 0 0;
}
.top .el-button{
float:right;
.top .el-button {
float: right;
}
.inner{
background:url('@/assets/images/home.png') no-repeat left center;
width:1398px;
height:552px;
margin:0 auto 30px;
border-radius:6px;
position:relative;
.inner {
background: url('@/assets/images/home.png') no-repeat left center;
width: 1398px;
height: 552px;
margin: 0 auto 30px;
border-radius: 6px;
position: relative;
}
.header{
margin:0 6.9%;
height:100px;
padding-top:33px;
display:flex;
.header {
margin: 0 6.9%;
height: 100px;
padding-top: 33px;
display: flex;
}
.logo{
.logo {
font-size: 40px;
font-family: Source Han Sans CN;
font-weight: bold;
color: #60A797;
text-align:center;
width:280px;
color: #60a797;
text-align: center;
width: 280px;
}
.menu{
.menu {
width: 780px;
height:56px;
border-radius:28px;
display:flex;
font-size:18px;
line-height:56px;
color:#fff;
height: 56px;
border-radius: 28px;
display: flex;
font-size: 18px;
line-height: 56px;
color: #fff;
}
.menu li{
padding:0 40px;
.menu li {
padding: 0 40px;
cursor: pointer;
}
.menu li.active{
.menu li.active {
font-weight: bold;
}
</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 {
let flag = true
this.stepOneList.forEach(item =>
item.form.personAttribute.forEach(it => {
console.log(it, '333')
if (it.equal === '' || it.personal === '' || it.range === '') {
flag = false
}
......
......@@ -5,16 +5,10 @@
<template #trigger_title>触发事件</template>
<template #trigger_con>
<div v-if="showIndex === 0">
&nbsp;&nbsp;
<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;对目标用户进行触达
<AppStartUp :form="stepTwoList" />
</div>
<div v-if="showIndex === 1">
<AppTodoList :form="stepTwoList" />
<AppTodoList :form="stepTwoList2" />
</div>
</template>
</StepTab>
......@@ -24,9 +18,13 @@
<script>
import StepTab from '@/components/base/StepTab.vue'
import AppTodoList from './AppTodoList.vue'
import AppStartUp from './AppStartUp.vue'
export default {
components: { StepTab, AppTodoList },
components: { StepTab, AppTodoList, AppStartUp },
props: {
stepTwoList2: {
type: Array
},
stepTwoList: {
type: Array
},
......@@ -40,8 +38,6 @@ export default {
data() {
return {
times: '',
times2: '',
caseId: '',
showIndex: 0,
// tab切换列表
......@@ -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: {
handleTab(index) {
......@@ -74,12 +64,9 @@ export default {
this.$parent.$parent.handlePrev()
},
handleStepTwo() {
console.log(this.times)
this.$emit('getTime', this.times, this.times2)
// this.$emit('getTime', this.times)
let flag = true
this.stepTwoList[0].form.triggerList.forEach(item => {
if (item.triggerValue === '' || this.times === '' || this.times2 === '') {
if (item.triggerValue === '') {
flag = false
}
})
......
......@@ -54,7 +54,6 @@ export default {
return {}
},
mounted() {
console.log(this.form, '----')
},
computed: {
list() {
......@@ -69,7 +68,6 @@ export default {
},
methods: {
handleAdd() {
console.log('000')
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])
item.triggerValue = ''
......
......@@ -30,7 +30,6 @@ export default {
let flag = true
this.stepOneList.forEach(item =>
item.form.personAttribute.forEach(it => {
console.log(it, '333')
if (it.equal === '' || it.personal === '' || it.range === '') {
flag = false
}
......
......@@ -63,10 +63,8 @@ export default {
}
},
mounted() {
// console.log(this.time, 'time')
this.times = this.time
this.times2 = this.time2
// console.log(this.stepTwoList, '9999')
},
methods: {
......@@ -77,9 +75,7 @@ export default {
this.$parent.$parent.handlePrev()
},
handleStepTwo() {
console.log(this.times)
this.$emit('getTime', this.times, this.times2)
// this.$emit('getTime', this.times)
let flag = true
this.stepTwoList[0].form.triggerList.forEach(item => {
if (item.triggerValue === '' || this.times === '' || this.times2 === '') {
......
......@@ -54,7 +54,6 @@ export default {
return {}
},
mounted() {
console.log(this.form, '----')
},
computed: {
list() {
......@@ -69,7 +68,6 @@ export default {
},
methods: {
handleAdd() {
console.log('000')
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])
item.triggerValue = ''
......
......@@ -30,7 +30,6 @@ export default {
let flag = true
this.stepOneList.forEach(item =>
item.form.personAttribute.forEach(it => {
console.log(it, '333')
if (it.equal === '' || it.personal === '' || it.range === '') {
flag = false
}
......
......@@ -6,45 +6,134 @@
<template #trigger_con>
<div v-if="showIndex === 0">
&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>
&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>
&nbsp;&nbsp;对目标用户进行触达
</div>
<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>
</template>
</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>
</template>
<script>
import StepTab from '@/components/base/StepTab.vue'
import SmsTodoList from './SmsTodoList.vue'
export default {
components: { StepTab, SmsTodoList },
components: { StepTab },
props: {
stepTwoList: {
type: Array
},
time: {
type: String
},
time2: {
type: String
}
stepTwoData: {}
},
data() {
return {
times: '',
times2: '',
timesList: [
{
value: '0',
label: '每日'
},
{
value: '1',
label: '每周'
},
{
value: '2',
label: '每月'
}
],
triggerDate: '', // 单次触发 触发日期
triggerTime: '', // 单次触发 触发时间
time_range: [], // 周期触发 触发时间范围
times_every: '', // 周期触发 触发周期
times_hour: '', // 周期触发 触发时间
times_send: '', // 节日触发 触发时间
caseId: '',
showIndex: 0,
// tab切换列表
......@@ -57,39 +146,141 @@ export default {
{
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: '条件触发'
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() {
// console.log(this.time, 'time')
this.times = this.time
this.times2 = this.time2
// console.log(this.stepTwoList, '9999')
this.festivalList = this.stepTwoData.festivalList.length ? this.stepTwoData.festivalList : this.festivalList
this.solarTermsList = this.stepTwoData.solarTermsList.length ? this.stepTwoData.solarTermsList : this.solarTermsList
this.triggerDate = this.stepTwoData.triggerDate
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: {
// 全选节气
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) {
this.showIndex = index
},
handlePrev() {
this.$parent.$parent.handlePrev()
},
// 进去下一步之前的判断
handleStepTwo() {
console.log(this.times)
this.$emit('getTime', this.times, this.times2)
// this.$emit('getTime', this.times)
let flag = true
this.stepTwoList[0].form.triggerList.forEach(item => {
if (item.triggerValue === '' || this.times === '' || this.times2 === '') {
flag = false
}
})
if (!flag) {
const stepTwoData = {
triggerDate: this.triggerDate,
triggerTime: this.triggerTime,
time_range: this.time_range,
times_every: this.times_every,
times_hour: this.times_hour,
times_send: this.times_send,
solarTermsList: this.solarTermsList,
festivalList: this.festivalList
}
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('请完善改步骤后才能进入下一步')
return false
}
return flag
return true
}
}
}
......@@ -121,4 +312,148 @@ export default {
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>
......@@ -53,9 +53,7 @@ export default {
data() {
return {}
},
mounted() {
console.log(this.form, '----')
},
mounted() {},
computed: {
list() {
return this.form[0].form.triggerList.map(item => {
......@@ -69,7 +67,6 @@ export default {
},
methods: {
handleAdd() {
console.log('000')
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])
item.triggerValue = ''
......
......@@ -29,7 +29,6 @@ export default {
let flag = true
this.stepOneList.forEach(item =>
item.form.personAttribute.forEach(it => {
console.log(it, '333')
if (it.equal === '' || it.personal === '' || it.range === '') {
flag = false
}
......
......@@ -18,8 +18,6 @@ export default {
data() {
return {
times: '',
times2: '',
caseId: '',
showIndex: 0,
// tab切换列表
......
......@@ -14,8 +14,7 @@
v-if="activeStep === 1"
class="pt-50"
:stepTwoList="stepTwoList"
:time="time"
:time2="time2"
:stepTwoList2="stepTwoList2"
@getTime="getTime"
ref="mailStepTwo"
/>
......@@ -32,6 +31,7 @@
<script>
import stepOne from '@/utils/stepOne'
import appStepTwo from '@/utils/appStepTwo'
import stepTwo from '@/utils/stepTwo'
import { cacheReport, getReportDetail, checkRecord } from '../api'
import ToolCard from '@/components/base/ToolCard.vue'
......@@ -50,25 +50,15 @@ export default {
activeStep: 0,
stepOneList: [],
stepTwoList: [],
time: '',
caseId: '',
times: '',
times2: '',
time2: ''
stepTwoList2: [],
caseId: ''
}
},
methods: {
// 获取第二步时间
getTime(val, val2) {
this.time = val
this.time2 = val2
},
// 上一步
handlePrev() {
if (this.$refs.mailStepTwo.handleStepTwo()) {
this.handleStep(2)
}
this.handleStep(2)
},
// 下一步
handleNext() {
......@@ -87,11 +77,7 @@ export default {
const reports = {
activeStep: parseInt(val),
type: 3,
commit_report: [
{ stepOneList: this.stepOneList },
{ form: this.stepTwoList },
{ time: this.times, time2: this.times2 }
]
commit_report: [{ stepOneList: this.stepOneList }, { form: this.stepTwoList, form1: this.stepTwoList2 }]
}
cacheReport(this.$store.state.case.id, { reports: JSON.stringify(reports) }).then(res => {
this.caseId = res.data.id
......@@ -113,23 +99,21 @@ export default {
if (res.data.detail.answer.type === 3) {
this.activeStep = res.data.detail.answer.activeStep
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.stepTwoList2 = res.data.detail.answer.commit_report[1].form1
}
})
},
// 验证是否有未完成的答题记录
checkRecord() {
checkRecord(this.$store.state.case.id, 2).then(res => {
console.log(res, 'res000')
if (res.data.status === true) {
const answerList = res.data.items.filter(item => item.type === 3)
if (res.data.items.length && answerList.length) {
this.activeStep = answerList[0].answer.activeStep
this.stepOneList = answerList[0].answer.commit_report[0].stepOneList
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.time2 = answerList[0].answer.commit_report[2].time2 || ''
} else {
......@@ -144,13 +128,11 @@ export default {
initStepList() {
this.stepOneList = stepOne
this.stepTwoList = stepTwo
this.time = this.times
this.time2 = this.times2
this.stepTwoList = appStepTwo
this.stepTwoList2 = stepTwo
}
},
mounted() {
console.log(stepOne, 'stepOne2222')
if (this.$route.query.type) {
this.getReportDetail(this.$route.query.id)
} else {
......
......@@ -69,9 +69,7 @@ export default {
},
// 上一步
handlePrev() {
if (this.$refs.mailStepTwo.handleStepTwo()) {
this.handleStep(2)
}
this.handleStep(2)
},
// 下一步
handleNext() {
......@@ -121,23 +119,20 @@ export default {
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
console.log(this.times, '222')
console.log(this.activeStep, 'activeStep', this.stepOneList, '---', '123')
}
})
},
// 验证是否有未完成的答题记录
checkRecord() {
checkRecord(this.$store.state.case.id, 2).then(res => {
console.log(res, 'res000')
if (res.data.status === true) {
const answerList = res.data.items.filter(item => item.type === 2)
if (res.data.items.length && answerList.length) {
this.activeStep = answerList[0].answer.activeStep
this.stepOneList = answerList[0].answer.commit_report[0].stepOneList
this.stepTwoList = answerList[0].answer.commit_report[1].form
this.time = answerList[0].answer.commit_report[2].time || ''
this.time2 = answerList[0].answer.commit_report[2].time2 || ''
this.stepOneList = answerList[0].answer.commit_report[0].stepOneList || stepOne
this.stepTwoList = answerList[0].answer.commit_report[1].form || stepTwo
this.time = answerList[0].answer.commit_report[2].time || this.times
this.time2 = answerList[0].answer.commit_report[2].time2 || this.times2
} else {
this.initStepList()
}
......@@ -159,7 +154,7 @@ export default {
if (this.$route.query.type) {
this.getReportDetail(this.$route.query.id)
} else {
this.initStepList()
// this.initStepList()
this.checkRecord()
}
}
......
......@@ -13,11 +13,9 @@
<SmsStepTwo
v-if="activeStep === 1"
class="pt-50"
:stepTwoList="stepTwoList"
:time="time"
:time2="time2"
@getTime="getTime"
ref="mailStepTwo"
@getTime="getTime"
:stepTwoData="stepTwoData"
/>
<div class="main_content_btn">
<div class="step_prev step_btn" @click="handlePrev" v-if="activeStep > 0">上一步</div>
......@@ -32,7 +30,6 @@
<script>
import stepOne from '@/utils/stepOne'
import stepTwo from '@/utils/stepTwo'
import { cacheReport, getReportDetail, checkRecord } from '../api'
import ToolCard from '@/components/base/ToolCard.vue'
import SmsStepOne from '../components/mobileSms/SmsStepOne.vue'
......@@ -47,28 +44,33 @@ export default {
},
data() {
return {
// times: '',
activeStep: 0,
stepOneList: [],
stepTwoList: [],
time: '',
caseId: '',
times: '',
times2: '',
time2: ''
stepTwoData: {
triggerDate: '',
triggerTime: '',
time_range: '',
times_every: '',
times_hour: '',
times_send: '',
solarTermsList: [],
festivalList: []
}
}
},
methods: {
// 获取第二步时间
getTime(val, val2) {
this.time = val
this.time2 = val2
getTime(val) {
this.stepTwoData = val
},
// 上一步
handlePrev() {
if (this.$refs.mailStepTwo.handleStepTwo()) {
this.handleStep(2)
}
// if (this.$refs.mailStepTwo.handleStepTwo()) {
this.handleStep(2)
// }
},
// 下一步
handleNext() {
......@@ -88,11 +90,7 @@ export default {
const reports = {
activeStep: parseInt(val),
type: 4,
commit_report: [
{ stepOneList: this.stepOneList },
{ form: this.stepTwoList },
{ time: this.times, time2: this.times2 }
]
commit_report: [{ stepOneList: this.stepOneList }, { stepTwoData: this.stepTwoData }]
}
cacheReport(this.$store.state.case.id, { reports: JSON.stringify(reports) }).then(res => {
this.caseId = res.data.id
......@@ -111,31 +109,23 @@ export default {
// 获取步骤信息回显
getReportDetail(id) {
getReportDetail(id).then(res => {
console.log(res, 'res')
if (res.data.detail.answer.type === 4) {
this.activeStep = res.data.detail.answer.activeStep
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
console.log(this.times, '222')
console.log(this.activeStep, 'activeStep', this.stepOneList, '---', '123')
this.stepTwoData = res.data.detail.answer.commit_report[1].stepTwoData
}
})
},
// 验证是否有未完成的答题记录
checkRecord() {
checkRecord(this.$store.state.case.id, 2).then(res => {
console.log(res, 'res000')
if (res.data.status === true) {
const answerList = res.data.items.filter(item => item.type === 4)
console.log(answerList, 'answerList')
if (res.data.items.length && answerList.length) {
this.activeStep = answerList[0].answer.activeStep
this.stepOneList = answerList[0].answer.commit_report[0].stepOneList
this.stepTwoList = answerList[0].answer.commit_report[1].form
this.time = answerList[0].answer.commit_report[2].time || ''
this.time2 = answerList[0].answer.commit_report[2].time2 || ''
this.stepTwoData = answerList[0].answer.commit_report[1].stepTwoData
} else {
this.initStepList()
}
......@@ -147,12 +137,10 @@ export default {
// 初始化步骤列表
initStepList() {
this.stepOneList = stepOne
this.stepTwoList = stepTwo
this.time = this.times
this.time2 = this.times2
}
},
mounted() {
console.log(this.$route.query.type)
if (this.$route.query.type) {
this.getReportDetail(this.$route.query.id)
} else {
......
......@@ -50,11 +50,7 @@ export default {
const reports = {
activeStep: this.activeStep,
type: 5,
commit_report: [
{ stepOneList: this.stepOneList },
{ form: this.stepTwoList },
{ time: this.time, time2: this.time2 }
]
commit_report: [{ stepOneList: this.stepOneList }, { form: this.stepTwoList }]
}
cacheReport(this.$store.state.case.id, { reports: JSON.stringify(reports) }).then(res => {
this.caseId = res.data.id
......
......@@ -210,6 +210,7 @@ export default {
})
},
handleNav(val) {
console.log(val, '9999')
switch (this.tabActive) {
case '1':
let path = '/product-analysis/report'
......@@ -225,7 +226,17 @@ export default {
case '3':
const _type = val.is_complete === 1 ? '1' : '0'
console.log('111')
this.$router.push({ path: '/market-tools/mail', query: { id: val.id, type: _type } })
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 } })
} 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
}
}
......
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 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论