提交 c846cb73 authored 作者: lihuihui's avatar lihuihui

update

上级 bfa2e4da
<template> <template>
<div class="main_content"> <div class="main_content">
<CardList class="box-card" v-for="(item, index) in data" :key="index" :cardList="item" /> <CardList class="box-card" v-for="(item, index) in data" :key="index" :cardList="item" />
<!-- <div class="step_next step_btn" @click="handleNext">下一步</div> -->
</div> </div>
</template> </template>
<script> <script>
import CardList from '@/components/base/CardList.vue' import CardList from '@/components/base/CardList.vue'
// import stepONeStep from '@/utils/stepOne'
// import { cacheReport } from '../../api'
export default { export default {
components: { components: {
CardList CardList
......
<template>
<div class="four-box">
<div class="card" v-for="(item, index) in data.stepOne" :key="index">
<div class="title">{{ item.cardTitle }}</div>
<div class="ul-list">
<div class="li" v-for="(cItem, cIndex) in item.form.personAttribute" :key="cIndex + 'c'">
<div class="icon"></div>
<div class="text">
{{ getPersonalMap(cItem).label }}&nbsp;&nbsp;{{
cItem.equalMap.find(i => i.value === cItem.equal).label
}}&nbsp;&nbsp;{{ getPersonalMap(cItem).children.find(i => i.value === cItem.range).label }}
</div>
</div>
</div>
</div>
<div class="card">
<div class="title">营销方案</div>
<div class="ul-list">
<div class="li">
<div class="icon"></div>
<div class="text">
计划类型:{{ data.stepTwo.index === 0 ? '单次触发' : data.stepTwo.index === 1 ? '周期触发' : '节日触发' }}
</div>
</div>
<template v-if="data.stepTwo.index === 0">
<div class="li">
<div class="icon"></div>
<div class="text">触发时间:{{ data.stepTwo.triggerDate }}&nbsp;&nbsp;{{ data.stepTwo.triggerTime }}</div>
</div>
</template>
<template v-else-if="data.stepTwo.index === 1">
<div class="li">
<div class="icon"></div>
<div class="text">
触发时间:{{ data.stepTwo.time_range[0] }}{{ data.stepTwo.time_range[1] }}&nbsp;&nbsp;{{
data.stepTwo.times_every
}}&nbsp;&nbsp;{{ data.stepTwo.times_hour }}
</div>
</div>
</template>
<template v-else>
<div class="li">
<div class="icon"></div>
<div class="text">
触发条件:
<span v-for="(item, index) in data.stepTwo.solarTermsList" :key="index">{{ item.name }}{{ index != data.stepTwo.solarTermsList.length - 1 ? ',' : '' }}</span>&nbsp;&nbsp;{{ data.stepTwo.times_send }}触发
</div>
</div>
</template>
</div>
</div>
<div class="card">
<div class="title">展示内容</div>
<div class="content">
<div class="phone-box">
<div class="text">{{ `【${data.stepThree.title}】${data.stepThree.content}` }}</div>
</div>
</div>
</div>
</div>
</template>
<script>
export default {
props: {
data: { type: Object }
},
mounted() {
console.log(this.data, 'data')
},
methods: {
getPersonalMap(item) {
return item.personalMap.find(i => i.value === item.personal)
},
// 获取位置值
getPosition(item) {
if (item.left && item.top) {
return `left: ${item.left}px;top: ${item.top}px;`
} else {
return item.left ? `left: ${item.left}px;` : item.top ? `top: ${item.top}px;` : ''
}
}
}
}
</script>
<style lang="scss" scoped>
.four-box {
margin-bottom: 20px;
.card {
background: rgba(250, 250, 250, 0.39);
border: 1px solid #e8e8e8;
border-radius: 16px;
margin-bottom: 20px;
padding: 20px;
.content {
height: 500px;
position: relative;
.phone-box {
margin: 0 auto;
width: 236px;
height: 474px;
background: url(https://webapp-pub.ezijing.com/x-training-new/phone-sms.png);
background-size: 100% 100%;
position: relative;
.text {
padding: 9px;
box-sizing: border-box;
background: #e9e9eb;
border-radius: 10px;
width: 148px;
position: absolute;
top: 110px;
left: 25px;
font-size: 9px;
color: #333333;
}
}
}
.title {
font-size: 18px;
font-weight: bold;
line-height: 100%;
color: #333333;
}
.ul-list {
padding-top: 20px;
.li {
display: flex;
align-items: center;
margin-bottom: 15px;
.icon {
width: 6px;
min-width: 6px;
height: 6px;
min-height: 6px;
background: rgba(73, 187, 162, 0.39);
border-radius: 50%;
}
.text {
font-size: 16px;
color: #666666;
margin-left: 10px;
}
}
}
}
}
</style>
<template> <template>
<div class="main_content"> <div class="main_content">
<CardList class="box-card" v-for="(item, index) in stepOneList" :key="index" :cardList="item" /> <CardList class="box-card" v-for="(item, index) in data" :key="index" :cardList="item" />
<!-- <div class="step_next step_btn" @click="handleNext">下一步</div> -->
</div> </div>
</template> </template>
<script> <script>
import CardList from '@/components/base/CardList.vue' import CardList from '@/components/base/CardList.vue'
// import stepONeStep from '@/utils/stepOne'
// import { cacheReport } from '../../api'
export default { export default {
components: { components: {
CardList CardList
}, },
props: { props: {
activeStep: { data: {
type: Number,
default: 0
},
stepOneList: {
type: Array type: Array
} }
}, },
...@@ -28,7 +21,7 @@ export default { ...@@ -28,7 +21,7 @@ export default {
// 下一步 // 下一步
handleStepOne() { handleStepOne() {
let flag = true let flag = true
this.stepOneList.forEach(item => this.data.forEach(item =>
item.form.personAttribute.forEach(it => { item.form.personAttribute.forEach(it => {
if (it.equal === '' || it.personal === '' || it.range === '') { if (it.equal === '' || it.personal === '' || it.range === '') {
flag = false flag = false
......
...@@ -3,16 +3,16 @@ ...@@ -3,16 +3,16 @@
<div class="content-left"> <div class="content-left">
<div class="card-textarea"> <div class="card-textarea">
<div class="title">推送标题</div> <div class="title">推送标题</div>
<textarea v-model="form.title" placeholder="请输入"></textarea> <textarea v-model="data.title" placeholder="请输入"></textarea>
</div> </div>
<div class="card-textarea"> <div class="card-textarea">
<div class="title">推送内容</div> <div class="title">推送内容</div>
<textarea v-model="form.content" placeholder="请输入"></textarea> <textarea v-model="data.content" placeholder="请输入"></textarea>
</div> </div>
</div> </div>
<div class="content-right"> <div class="content-right">
<div class="right-box"> <div class="right-box">
<div class="text">{{ `【${form.title}】${form.content}` }}</div> <div class="text">{{ `【${data.title}】${data.content}` }}</div>
</div> </div>
</div> </div>
</div> </div>
...@@ -20,12 +20,21 @@ ...@@ -20,12 +20,21 @@
<script> <script>
export default { export default {
data() { props: {
return { data: {
form: { type: Object
title: '',
content: ''
} }
},
mounted() {
console.log(this.data, '23')
},
methods: {
handleStepThree() {
if (this.data.title === '' || this.data.content === '') {
this.$message.warning('请完善改步骤后才能进入下一步')
return false
}
return true
} }
} }
} }
......
<template> <template>
<div> <div>
<StepTab :tabList="tabList" @tabActive="handleTab"> <StepTab :tabList="tabList" @tabActive="handleTab" :index="data.index">
<template #plan_title>计划类型</template> <template #plan_title>计划类型</template>
<template #trigger_title>触发条件</template> <template #trigger_title>触发条件</template>
<template #trigger_con> <template #trigger_con>
<div v-if="showIndex === 0"> <div v-if="data.index === 0">
&nbsp;&nbsp; &nbsp;&nbsp;
<el-date-picker v-model="triggerDate" type="datetime" placeholder="选择日期" value-format="yyyy-MM-dd"> <el-date-picker v-model="data.triggerDate" type="datetime" placeholder="选择日期" value-format="yyyy-MM-dd">
</el-date-picker> </el-date-picker>
&nbsp;&nbsp; &nbsp;&nbsp;
<el-time-picker <el-time-picker
v-model="triggerTime" v-model="data.triggerTime"
arrow-control arrow-control
placeholder="选择时间" placeholder="选择时间"
size="mini" size="mini"
...@@ -19,29 +19,36 @@ ...@@ -19,29 +19,36 @@
</el-time-picker> </el-time-picker>
&nbsp;&nbsp;对目标用户进行触达 &nbsp;&nbsp;对目标用户进行触达
</div> </div>
<div v-if="showIndex === 1"> <div v-if="data.index === 1">
&nbsp;&nbsp; &nbsp;&nbsp;
<el-date-picker <el-date-picker
v-model="time_range" v-model="data.time_range"
type="daterange" type="daterange"
range-separator="至" range-separator="至"
start-placeholder="开始日期" start-placeholder="开始日期"
end-placeholder="结束日期" end-placeholder="结束日期"
value-format="yyyy-MM-dd"
> >
</el-date-picker> </el-date-picker>
&nbsp;&nbsp;时间范围内 &nbsp;&nbsp;时间范围内
<br /> <br />
<br /> <br />
&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;
<el-select v-model="times_every"> <el-select v-model="data.times_every">
<el-option v-for="it in timesList" :key="it.value" :label="it.label" :value="it.value"> </el-option> <el-option v-for="it in timesList" :key="it.value" :label="it.label" :value="it.value"> </el-option>
</el-select> </el-select>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
<el-time-picker v-model="times_hour" arrow-control placeholder="选择时间" size="mini" value-format="HH:mm:ss"> <el-time-picker
v-model="data.times_hour"
arrow-control
placeholder="选择时间"
size="mini"
value-format="HH:mm:ss"
>
</el-time-picker> </el-time-picker>
发送 发送
</div> </div>
<div v-if="showIndex === 2"> <div v-if="data.index === 2">
<!-- 节气 --> <!-- 节气 -->
<div class="solarTerms"> <div class="solarTerms">
<div class="solarTerms_left"> <div class="solarTerms_left">
...@@ -90,7 +97,7 @@ ...@@ -90,7 +97,7 @@
<div class="sendMessage"> <div class="sendMessage">
在如上日期 在如上日期
<el-time-picker <el-time-picker
v-model="times_send" v-model="data.times_send"
arrow-control arrow-control
placeholder="选择时间" placeholder="选择时间"
size="mini" size="mini"
...@@ -109,34 +116,26 @@ import StepTab from '@/components/base/StepTab.vue' ...@@ -109,34 +116,26 @@ import StepTab from '@/components/base/StepTab.vue'
export default { export default {
components: { StepTab }, components: { StepTab },
props: { props: {
stepTwoData: {} data: { type: Object }
}, },
data() { data() {
return { return {
// 选项
timesList: [ timesList: [
{ {
value: '0', value: '每日',
label: '每日' label: '每日'
}, },
{ {
value: '1', value: '每周',
label: '每周' label: '每周'
}, },
{ {
value: '2', value: '每月',
label: '每月' label: '每月'
} }
], ],
triggerDate: '', // 单次触发 触发日期
triggerTime: '', // 单次触发 触发时间
time_range: [], // 周期触发 触发时间范围
times_every: '', // 周期触发 触发周期
times_hour: '', // 周期触发 触发时间
times_send: '', // 节日触发 触发时间
caseId: '',
showIndex: 0,
showIndexName: '',
// tab切换列表 // tab切换列表
tabList: [ tabList: [
{ {
...@@ -155,17 +154,18 @@ export default { ...@@ -155,17 +154,18 @@ export default {
tabName: '节日触发' tabName: '节日触发'
} }
], ],
// 节气
festivalList: [ festivalList: [
{ id: '0', name: '元旦', isActive: false }, { id: '00', name: '元旦', isActive: false },
{ id: '1', name: '情人节', isActive: false }, { id: '11', name: '情人节', isActive: false },
{ id: '2', name: '愚人节', isActive: false }, { id: '22', name: '愚人节', isActive: false },
{ id: '3', name: '复活节', isActive: false }, { id: '33', name: '复活节', isActive: false },
{ id: '4', name: '母亲节', isActive: false }, { id: '44', name: '母亲节', isActive: false },
{ id: '5', name: '父亲节', isActive: false }, { id: '55', name: '父亲节', isActive: false },
{ id: '6', name: '感恩节', isActive: false }, { id: '66', name: '感恩节', isActive: false },
{ id: '7', name: '万圣节', isActive: false }, { id: '77', name: '万圣节', isActive: false },
{ id: '8', name: '元旦节', isActive: false }, { id: '88', name: '元旦节', isActive: false },
{ id: '9', name: '小满', isActive: false } { id: '99', name: '小满', isActive: false }
], ],
solarTermsList: [ solarTermsList: [
{ id: '0', name: '小寒', isActive: false }, { id: '0', name: '小寒', isActive: false },
...@@ -206,17 +206,25 @@ export default { ...@@ -206,17 +206,25 @@ export default {
} }
}, },
mounted() { mounted() {
this.festivalList = this.stepTwoData.festivalList.length ? this.stepTwoData.festivalList : this.festivalList this.setSolarTerms()
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: { methods: {
setSolarTerms() {
if (this.data.index === 2) {
this.festivalList.map(item => {
if (this.data.solarTermsList.find(i => i.id === item.id)) {
item.isActive = true
}
return item
})
this.solarTermsList.map(item => {
if (this.data.solarTermsList.find(i => i.id === item.id)) {
item.isActive = true
}
return item
})
}
},
// 全选节气 // 全选节气
handleSelectAllSolar() { handleSelectAllSolar() {
if (this.checkAllSolar) { if (this.checkAllSolar) {
...@@ -228,6 +236,7 @@ export default { ...@@ -228,6 +236,7 @@ export default {
item.isActive = true item.isActive = true
}) })
} }
this.solarTermsChange()
}, },
// 全选节日 // 全选节日
handleSelectAllFes() { handleSelectAllFes() {
...@@ -240,48 +249,49 @@ export default { ...@@ -240,48 +249,49 @@ export default {
item.isActive = true item.isActive = true
}) })
} }
this.solarTermsChange()
}, },
// 是否选择节气 // 是否选择节气
handleItemSolarActive(item) { handleItemSolarActive(item) {
item.isActive = !item.isActive item.isActive = !item.isActive
this.solarTermsChange()
}, },
// 是否选择节日 // 是否选择节日
handleItemFesActive(item) { handleItemFesActive(item) {
item.isActive = !item.isActive item.isActive = !item.isActive
this.solarTermsChange()
},
solarTermsChange() {
this.data.solarTermsList = []
this.festivalList.forEach(item => {
item.isActive && this.data.solarTermsList.push(item)
})
this.solarTermsList.forEach(item => {
item.isActive && this.data.solarTermsList.push(item)
})
}, },
// tab切换 // tab切换
handleTab(index) { handleTab(index) {
this.showIndex = index this.data.index = index
this.setSolarTerms()
}, },
// 进去下一步之前的判断 // 进去下一步之前的判断
handleStepTwo() { handleStepTwo() {
this.$emit('getShowIndex', this.showIndex) if (this.data.index === 0 && (this.data.triggerDate === '' || this.data.triggerTime === '')) {
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)
console.log(this.time_range[0], this.time_range[1], this.times_every, '--000', this.times_send, '----')
if (this.showIndex === 0 && (this.triggerDate === '' || this.triggerTime === '')) {
this.$message.warning('请完善改步骤后才能进入下一步') this.$message.warning('请完善改步骤后才能进入下一步')
return false return false
} else if ( } else if (
this.showIndex === 1 && this.data.index === 1 &&
(this.time_range[0] === '' || this.time_range[1] === '' || this.times_every === '' || this.times_hour === '') (this.data.time_range[0] === '' ||
this.data.time_range[1] === '' ||
this.data.times_every === '' ||
this.data.times_hour === '')
) { ) {
this.$message.warning('请完善改步骤后才能进入下一步') this.$message.warning('请完善改步骤后才能进入下一步')
return false return false
} else if ( } else if (
this.showIndex === 2 && this.data.index === 2 &&
(this.times_send === null || (this.data.times_send === null ||
this.festivalList.filter(item => item.isActive === false).length === this.festivalList.length || this.festivalList.filter(item => item.isActive === false).length === this.festivalList.length ||
this.solarTermsList.filter(item => item.isActive === false).length === this.solarTermsList.length) this.solarTermsList.filter(item => item.isActive === false).length === this.solarTermsList.length)
) { ) {
......
...@@ -2,27 +2,15 @@ ...@@ -2,27 +2,15 @@
<div> <div>
<ToolCard class="main_content"> <ToolCard class="main_content">
<Step :activeStep="activeStep" class="pt50-pl60" /> <Step :activeStep="activeStep" class="pt50-pl60" />
<div> <div style="flex: 1">
<SmsStepOne <SmsStepOne v-if="activeStep === 0" class="pt-50" :data="form.stepOne" ref="stepOne" />
v-if="activeStep === 0" <SmsStepTwo v-if="activeStep === 1" class="pt-50" ref="stepTwo" :data="form.stepTwo" />
class="pt-50" <SmsStepThree v-if="activeStep === 2" :data="form.stepThree" ref="stepThree" />
:activeStep="activeStep" <SmsStepFour :data="form" class="step-four" v-if="activeStep === 3" />
:stepOneList="stepOneList"
ref="mailStepOne"
/>
<SmsStepTwo
v-if="activeStep === 1"
class="pt-50"
ref="mailStepTwo"
@getTime="getTime"
@getShowIndex="getShowIndex"
:stepTwoData="stepTwoData"
/>
<SmsStepThree v-if="activeStep === 2" />
<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>
<div class="step_next step_btn" @click="handleNext" v-if="activeStep >= 0 && activeStep < 2">下一步</div> <div class="step_next step_btn" @click="handleNext" v-if="activeStep >= 0 && activeStep < 2">下一步</div>
<div class="step_finished step_btn" @click="handlePreview" v-if="activeStep === 2">点击生成预览</div> <div class="step_finished step_btn" @click="handleNext" v-if="activeStep === 2">点击生成预览</div>
<div class="step_finished step_btn" @click="handlePlan" v-if="activeStep === 3">执行营销计划</div> <div class="step_finished step_btn" @click="handlePlan" v-if="activeStep === 3">执行营销计划</div>
</div> </div>
</div> </div>
...@@ -32,127 +20,130 @@ ...@@ -32,127 +20,130 @@
<script> <script>
import stepOne from '@/utils/stepOne' import stepOne from '@/utils/stepOne'
import { cacheReport, getReportDetail, checkRecord } from '../api' import { cacheReport, getReportDetail, checkRecord, submitReport } 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'
import Step from '@/components/base/Step.vue' import Step from '@/components/base/Step.vue'
import SmsStepTwo from '../components/mobileSms/SmsStepTwo.vue' import SmsStepTwo from '../components/mobileSms/SmsStepTwo.vue'
import SmsStepThree from '../components/mobileSms/SmsStepThree.vue' import SmsStepThree from '../components/mobileSms/SmsStepThree.vue'
import SmsStepFour from '../components/mobileSms/SmsStepFour.vue'
export default { export default {
components: { components: {
ToolCard, ToolCard,
SmsStepOne, SmsStepOne,
Step, Step,
SmsStepTwo, SmsStepTwo,
SmsStepThree SmsStepThree,
SmsStepFour
}, },
data() { data() {
return { return {
// times: '', form: {
activeStep: 2, stepOne: stepOne,
stepOneList: [], stepTwo: {
caseId: '', index: 0, // 触发类型
stepTwoData: { triggerDate: '', // 单次触发 触发日期
triggerDate: '', triggerTime: '', // 单次触发 触发时间
triggerTime: '', time_range: [], // 周期触发 触发时间范围
time_range: '', times_every: '', // 周期触发 触发周期
times_every: '', times_hour: '', // 周期触发 触发时间
times_hour: '', times_send: '', // 节日触发 触发时间
times_send: '', solarTermsList: [] // 选中的节日
solarTermsList: [], },
festivalList: [], stepThree: {
showIndex: '' title: '',
content: ''
} }
},
activeStep: 0,
caseId: ''
} }
}, },
methods: { methods: {
getShowIndex(val) {
this.showIndex = val
},
// 获取第二步时间
getTime(val) {
this.stepTwoData = val
},
// 上一步 // 上一步
handlePrev() { handlePrev() {
// if (this.$refs.mailStepTwo.handleStepTwo()) { this.activeStep--
this.handleStep(2)
// }
}, },
// 下一步
handleNext() { handleNext() {
if (this.activeStep === 0) { // 找到对应步骤,调用组件内部方法检查未填
if (this.$refs.mailStepOne.handleStepOne()) { switch (this.activeStep) {
// 保存步骤信息 case 0:
this.handleStep(0) this.$refs.stepOne.handleStepOne() && this.handleStep()
} break
} else if (this.activeStep === 1) { case 1:
if (this.$refs.mailStepTwo.handleStepTwo()) { this.$refs.stepTwo.handleStepTwo() && this.handleStep()
this.handleStep(1) break
} case 2:
this.$refs.stepThree.handleStepThree() && this.handleStep()
break
} }
}, },
// 保存步骤 // 保存步骤
handleStep(val) { handleStep(val) {
const reports = { const reports = {
activeStep: parseInt(val), activeStep: this.activeStep + 1,
type: 4, type: 4,
commit_report: [{ stepOneList: this.stepOneList }, { stepTwoData: this.stepTwoData }] commit_report: this.form
} }
console.log(reports, 'rep')
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
if (val === 2) {
this.activeStep--
} else {
this.activeStep++ this.activeStep++
}
}) })
}, },
// 预览 // 预览
handlePreview() { handlePreview() {
this.activeStep++ this.activeStep++
}, },
handlePlan() {}, handlePlan() {
const reports = {
id: this.caseId || this.$route.query.id,
reports: JSON.stringify({
type: 4,
commit_report: this.form
})
}
submitReport(reports).then(res => {
if (res.code === 0) {
this.$router.push({
path: '/works-show/history',
query: {
type: 3
}
})
}
})
},
// 获取步骤信息回显 // 获取步骤信息回显
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.form = res.data.detail.answer.commit_report
this.stepTwoData = res.data.detail.answer.commit_report[1].stepTwoData
} }
}) })
}, },
// 验证是否有未完成的答题记录 // 验证是否有未完成的答题记录
checkRecord() { checkRecord() {
checkRecord(this.$store.state.case.id, 2).then(res => { checkRecord(this.$store.state.case.id, 4).then(res => {
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.find(item => item.type === 4)
if (res.data.items.length && answerList.length) { this.activeStep = answerList.answer.activeStep || 0
this.activeStep = answerList[0].answer.activeStep if (Object.keys(answerList).length) {
this.stepOneList = answerList[0].answer.commit_report[0].stepOneList this.form = answerList.answer.commit_report
this.stepTwoData = answerList[0].answer.commit_report[1].stepTwoData console.log(this.form, 'form')
} else {
this.initStepList()
} }
} else {
this.initStepList()
} }
}) })
},
// 初始化步骤列表
initStepList() {
this.stepOneList = stepOne
} }
}, },
mounted() { mounted() {
// 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.checkRecord() this.checkRecord()
// } }
} }
} }
</script> </script>
...@@ -200,4 +191,10 @@ export default { ...@@ -200,4 +191,10 @@ export default {
.pt-50 { .pt-50 {
padding-top: 50px; padding-top: 50px;
} }
.step-four {
padding: 42px 35px;
flex: 1;
border-left: 1px solid #dedede;
border-bottom: 1px solid #dedede;
}
</style> </style>
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论