sopItem.vue
3.87 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
<!--
* @Author: yangming yangming@didihu.com.cn
* @Date: 2023-12-25 14:31:26
* @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2024-01-15 15:19:05
* @FilePath: \scrm-micro-peregrination\src\views\journeyModel\components\sopItem.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AEVid
-->
<template>
<el-drawer title="编辑" :visible.sync="drawerVisible" direction="rtl" :before-close="handleClose" size="720px">
<div class="drawer-body">
<div class="sop-item flex-column-center">
<label>*</label>
<span>请设置营销时间:</span>
<el-input-number v-model="day" :min="1" :max="999" :size="size"></el-input-number>
<span>天后,当日</span>
<el-time-picker :picker-options="rangeStart" v-model="time" :size="size" format="HH:mm" value-format="HH:mm"></el-time-picker>
<span>发送</span>
</div>
<div class="sop-item flex">
<label>*</label>
<span>请选择触达方式:</span>
<div class="select-panel">
<div class="select-item" v-for="item in modelList" :key="item.id">
<div class="select-value">
<el-radio v-model="nodeKey" :label="item.id">{{ item.nodeName }}</el-radio>
</div>
<div class="select-desc">
{{ item.desc }}
</div>
</div>
</div>
</div>
</div>
<div class="demo-drawer__footer">
<el-button @click="handleClose" :size="size">取消</el-button>
<el-button type="primary" @click="saveForm" :size="size">保存</el-button>
</div>
</el-drawer>
</template>
<script>
export default {
props: {
drawerVisible: {
type: Boolean,
default: false
}
},
data() {
return {
rangeStart: {
selectableRange: '09:00:00 - 22:00:00' // 09:00:00 - 22:00:00的时间才可以选择
},
nodeKey: '',
day: 0,
time: '09:00',
list: [],
modelList: []
}
},
inject: ['app'],
watch: {
drawerVisible(val) {
if (val) {
this.time = '09:00'
this.getModelList()
}
}
},
methods: {
getModelList() {
this.$apis.journeyModel.SopTplNodeProtosList({ dataTypeCode: this.app.dataTypeCode, groupCode: 'notify' }).then(res => {
this.modelList = res
})
},
showError(message) {
this.$message({
type: 'error',
message
})
},
saveForm() {
if (!this.day) {
return this.showError('请设置营销时间')
}
if (!this.time) {
return this.showError('请设置营销时间')
}
if (!this.nodeKey) {
return this.showError('请选择触达方式')
}
const model = {
time: this.time,
day: this.day,
nodeProtoId: this.nodeKey
}
this.$emit('closeDrawer', model)
},
setForm(val) {
const { day, time, taskType } = val
this.day = day
this.time = time
this.nodeKey = taskType
},
handleClose() {
this.$emit('closeDrawer')
},
SopTplNodeProtosList() {
this.$apis.journeyModel.SopTplNodeProtosList({}).then(res => {
this.list = res
})
}
}
}
</script>
<style scoped lang="scss">
.drawer-body {
padding: 30px;
height: calc(100vh - 140px);
.sop-item {
font-size: 14px;
color: #333333;
margin-bottom: 20px;
> label {
color: #eb4e4e;
}
.select-item {
margin-bottom: 20px;
.select-value {
font-size: 14px;
color: #333333;
span {
margin-left: -35px;
}
}
.select-desc {
font-size: 12px;
color: #999999;
line-height: 24px;
margin-left: 20px;
}
}
}
}
.demo-drawer__footer {
text-align: right;
padding: 10px;
}
</style>