提交 a2e75801 authored 作者: matian's avatar matian

时间修改

上级 fa88e691
...@@ -5,14 +5,13 @@ ...@@ -5,14 +5,13 @@
<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;<el-date-picker &nbsp;&nbsp;
v-model="times" <el-date-picker v-model="times" type="datetime" placeholder="选择日期" value-format="yyyy-MM-dd">
type="datetime" </el-date-picker>
placeholder="选择日期时间" &nbsp;&nbsp;
default-time="12:00:00" <el-time-picker v-model="times2" arrow-control placeholder="选择时间" size="mini" value-format="HH:mm:ss">
> </el-time-picker>
</el-date-picker &nbsp;&nbsp;对目标用户进行触达
>&nbsp;&nbsp;对目标用户进行触达
</div> </div>
<div v-if="showIndex === 1"> <div v-if="showIndex === 1">
<StepTodoList :form="stepTwoList" /> <StepTodoList :form="stepTwoList" />
...@@ -36,12 +35,16 @@ export default { ...@@ -36,12 +35,16 @@ export default {
}, },
time: { time: {
type: String type: String
},
time2: {
type: String
} }
}, },
data() { data() {
return { return {
times: '', times: '',
times2: '',
caseId: '', caseId: '',
showIndex: 0, showIndex: 0,
// tab切换列表 // tab切换列表
...@@ -60,9 +63,10 @@ export default { ...@@ -60,9 +63,10 @@ export default {
} }
}, },
mounted() { mounted() {
console.log(this.time, 'time') // console.log(this.time, 'time')
this.times = this.time this.times = this.time
console.log(this.stepTwoList, '9999') this.times2 = this.time2
// console.log(this.stepTwoList, '9999')
}, },
methods: { methods: {
...@@ -73,10 +77,12 @@ export default { ...@@ -73,10 +77,12 @@ export default {
this.$parent.$parent.handlePrev() this.$parent.$parent.handlePrev()
}, },
handleStepTwo() { handleStepTwo() {
this.$emit('getTime', this.times) 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 === '') { if (item.triggerValue === '' || this.times === '' || this.times2 === '') {
flag = false flag = false
} }
}) })
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
class="pt-50" class="pt-50"
:stepTwoList="stepTwoList" :stepTwoList="stepTwoList"
:time="time" :time="time"
:time2="time2"
@getTime="getTime" @getTime="getTime"
ref="mailStepTwo" ref="mailStepTwo"
/> />
...@@ -51,14 +52,17 @@ export default { ...@@ -51,14 +52,17 @@ export default {
stepTwoList: [], stepTwoList: [],
time: '', time: '',
caseId: '', caseId: '',
times: '' times: '',
times2: '',
time2: ''
} }
}, },
methods: { methods: {
// 获取第二步时间 // 获取第二步时间
getTime(val) { getTime(val, val2) {
this.times = val this.time = val
this.time2 = val2
}, },
// 上一步 // 上一步
handlePrev() { handlePrev() {
...@@ -66,12 +70,11 @@ export default { ...@@ -66,12 +70,11 @@ export default {
const reports = { const reports = {
activeStep: this.activeStep, activeStep: this.activeStep,
type: 2, type: 2,
commit_report: [{ stepOneList: this.stepOneList }, { form: this.stepTwoList }, { time: this.times }] commit_report: [{ stepOneList: this.stepOneList }, { form: this.stepTwoList }, { time: this.time }]
} }
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
this.activeStep-- this.activeStep--
console.log(this.activeStep, '1111')
}) })
console.log(this.stepOneList, 'this.stepOneList') console.log(this.stepOneList, 'this.stepOneList')
} }
...@@ -81,25 +84,28 @@ export default { ...@@ -81,25 +84,28 @@ export default {
if (this.activeStep === 0) { if (this.activeStep === 0) {
if (this.$refs.mailStepOne.handleStepOne()) { if (this.$refs.mailStepOne.handleStepOne()) {
// 保存步骤信息 // 保存步骤信息
const reports = { activeStep: 0, type: 2, commit_report: [{ stepOneList: this.stepOneList }] } this.handleStep(0)
cacheReport(this.$store.state.case.id, { reports: JSON.stringify(reports) }).then(res => {
this.caseId = res.data.id
this.activeStep++
})
} }
} else if (this.activeStep === 1) { } else if (this.activeStep === 1) {
if (this.$refs.mailStepTwo.handleStepTwo()) { if (this.$refs.mailStepTwo.handleStepTwo()) {
this.handleStep(1)
}
}
},
handleStep(val) {
const reports = { const reports = {
activeStep: 1, activeStep: parseInt(val),
type: 2, type: 2,
commit_report: [{ stepOneList: this.stepOneList }, { form: this.stepTwoList }, { time: this.times }] commit_report: [
{ 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
this.activeStep++ this.activeStep++
}) })
}
}
}, },
// 预览 // 预览
handlePreview() { handlePreview() {
...@@ -111,8 +117,10 @@ export default { ...@@ -111,8 +117,10 @@ export default {
getReportDetail(id).then(res => { getReportDetail(id).then(res => {
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.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
console.log(this.times, '222')
console.log(this.activeStep, 'activeStep', this.stepOneList, '---', '123') console.log(this.activeStep, 'activeStep', this.stepOneList, '---', '123')
}) })
}, },
...@@ -128,6 +136,8 @@ export default { ...@@ -128,6 +136,8 @@ export default {
this.stepOneList = stepOne this.stepOneList = stepOne
this.stepTwoList = stepTwo this.stepTwoList = stepTwo
this.time = this.times this.time = this.times
this.time2 = this.times2
console.log(this.times, '111')
} }
}) })
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论