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

时间修改

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