|
@@ -1,82 +1,72 @@
|
1
|
1
|
<template>
|
2
|
2
|
<div class="subPage">
|
3
|
|
- <div class="content">
|
4
|
|
- <div class="input-div">
|
5
|
|
- <div style="float: left; font-size: 20px;">
|
6
|
|
- 活动名称:
|
7
|
|
- </div>
|
8
|
|
- <div style="float: left; margin-left: 30px;">
|
9
|
|
- <template>
|
10
|
|
- <el-input v-model="activityName" placeholder="请输入内容" style="width: 300px;"></el-input>
|
11
|
|
- </template>
|
12
|
|
- </div>
|
13
|
|
- </div>
|
14
|
|
- <div class="input-div">
|
15
|
|
- <div style="float: left; font-size: 20px;">
|
16
|
|
- 活动类型:
|
17
|
|
- </div>
|
18
|
|
- <div style="float: left; margin-left: 30px;">
|
19
|
|
- <template>
|
20
|
|
- <el-select v-model="regValue" placeholder="请选择" style="width: 300px;">
|
21
|
|
- <el-option
|
22
|
|
- v-for="item in regOptions"
|
23
|
|
- :key="item.regValue"
|
24
|
|
- :label="item.label"
|
25
|
|
- :value="item.regValue">
|
26
|
|
- </el-option>
|
27
|
|
- </el-select>
|
28
|
|
- </template>
|
29
|
|
- </div>
|
30
|
|
- </div>
|
31
|
|
- <div class="input-div">
|
32
|
|
- <div style="float: left; font-size: 20px;">
|
33
|
|
- 赠券卡券:
|
34
|
|
- </div>
|
35
|
|
- <div style="float: left; margin-left: 30px;">
|
36
|
|
- <template>
|
37
|
|
- <el-select v-model="giftValue" placeholder="请选择" style="width: 300px;">
|
38
|
|
- <el-option
|
39
|
|
- v-for="item in giftOptions"
|
40
|
|
- :key="item.giftValue"
|
41
|
|
- :label="item.label"
|
42
|
|
- :value="item.giftValue">
|
43
|
|
- </el-option>
|
44
|
|
- </el-select>
|
45
|
|
- </template>
|
46
|
|
- </div>
|
47
|
|
- </div>
|
48
|
|
- <div class="input-div">
|
49
|
|
- <div style="float: left; font-size: 20px;">
|
50
|
|
- 赠券数量:
|
51
|
|
- </div>
|
52
|
|
- <div style="float: left; margin-left: 30px;">
|
53
|
|
- <template>
|
54
|
|
- <el-input v-model="giftNum" placeholder="请输入内容" style="width: 300px;"></el-input>
|
55
|
|
- </template>
|
56
|
|
- </div>
|
57
|
|
- </div>
|
58
|
|
- <div class="input-div">
|
59
|
|
- <div style="float: left; font-size: 20px;">
|
60
|
|
- 活动描述:
|
61
|
|
- </div>
|
62
|
|
- <div style="float: left; margin-left: 30px;">
|
63
|
|
- <template>
|
64
|
|
- <el-input
|
65
|
|
- type="textarea"
|
66
|
|
- :rows="10"
|
67
|
|
- placeholder="请输入内容"
|
68
|
|
- v-model="desc" style="width: 300px; height: 200px;">
|
69
|
|
- </el-input>
|
70
|
|
- </template>
|
71
|
|
- </div>
|
72
|
|
- </div>
|
73
|
|
- <div class="input-div">
|
74
|
|
- <el-row>
|
75
|
|
- <el-button type="warning" style="float: right;" @click="redirection('activitiesList')">返回</el-button>
|
76
|
|
- <el-button type="primary" style="float: right; margin-right: 10px;" @click="submitData">提交</el-button>
|
77
|
|
- </el-row>
|
78
|
|
- </div>
|
79
|
|
- </div>
|
|
3
|
+ <form class="mainForm">
|
|
4
|
+ <ul>
|
|
5
|
+ <li class="flex-h">
|
|
6
|
+ <span>活动名称:</span>
|
|
7
|
+ <div class="flex-item">
|
|
8
|
+ <div style="width:50%">
|
|
9
|
+ <el-input v-model="activityName" placeholder="请输入内容"></el-input>
|
|
10
|
+ </div>
|
|
11
|
+ </div>
|
|
12
|
+ </li>
|
|
13
|
+ <li class="flex-h">
|
|
14
|
+ <span>活动类型:</span>
|
|
15
|
+ <div class="flex-item">
|
|
16
|
+ <div>
|
|
17
|
+ <el-select v-model="regValue" placeholder="请选择">
|
|
18
|
+ <el-option
|
|
19
|
+ v-for="item in regOptions"
|
|
20
|
+ :key="item.regValue"
|
|
21
|
+ :label="item.label"
|
|
22
|
+ :value="item.regValue">
|
|
23
|
+ </el-option>
|
|
24
|
+ </el-select>
|
|
25
|
+ </div>
|
|
26
|
+ </div>
|
|
27
|
+ </li>
|
|
28
|
+ <li class="flex-h">
|
|
29
|
+ <span>赠券卡券:</span>
|
|
30
|
+ <div class="flex-item">
|
|
31
|
+ <div>
|
|
32
|
+ <el-select v-model="giftValue" placeholder="请选择">
|
|
33
|
+ <el-option
|
|
34
|
+ v-for="item in giftOptions"
|
|
35
|
+ :key="item.giftValue"
|
|
36
|
+ :label="item.label"
|
|
37
|
+ :value="item.giftValue">
|
|
38
|
+ </el-option>
|
|
39
|
+ </el-select>
|
|
40
|
+ </div>
|
|
41
|
+ </div>
|
|
42
|
+ </li>
|
|
43
|
+ <li class="flex-h">
|
|
44
|
+ <span>赠券数量:</span>
|
|
45
|
+ <div class="flex-item">
|
|
46
|
+ <div style="width:50%">
|
|
47
|
+ <el-input v-model="giftNum" placeholder="请输入内容"></el-input>
|
|
48
|
+ </div>
|
|
49
|
+ </div>
|
|
50
|
+ </li>
|
|
51
|
+ <li class="flex-h">
|
|
52
|
+ <span>活动描述:</span>
|
|
53
|
+ <div class="flex-item">
|
|
54
|
+ <div>
|
|
55
|
+ <el-input
|
|
56
|
+ type="textarea"
|
|
57
|
+ :rows="10"
|
|
58
|
+ placeholder="请输入内容"
|
|
59
|
+ v-model="desc">
|
|
60
|
+ </el-input>
|
|
61
|
+ </div>
|
|
62
|
+ </div>
|
|
63
|
+ </li>
|
|
64
|
+ <li style="text-align:center">
|
|
65
|
+ <el-button type="warning" size="mini" @click="redirection('activitiesList')">返回</el-button>
|
|
66
|
+ <el-button type="primary" size="mini" @click="submitData">提交</el-button>
|
|
67
|
+ </li>
|
|
68
|
+ </ul>
|
|
69
|
+ </form>
|
80
|
70
|
</div>
|
81
|
71
|
</template>
|
82
|
72
|
<script>
|
|
@@ -120,16 +110,13 @@ export default {
|
120
|
110
|
giftData: {
|
121
|
111
|
get () {
|
122
|
112
|
let jsonData = this.$data.giftList
|
123
|
|
- console.log('请求到的:' + this.$data.giftList)
|
124
|
113
|
let data = []
|
125
|
114
|
for (let i = 0; i < jsonData.length; i++) {
|
126
|
115
|
let tempData = []
|
127
|
116
|
tempData.giftValue = jsonData[i].CouponId
|
128
|
117
|
tempData.label = jsonData[i].CouponName
|
129
|
|
- console.log('卡券编号:' + tempData.giftValue + ' ' + tempData.label)
|
130
|
118
|
data.push(tempData)
|
131
|
119
|
}
|
132
|
|
- console.log('giftData 数据:')
|
133
|
120
|
return data
|
134
|
121
|
}
|
135
|
122
|
}
|
|
@@ -141,22 +128,6 @@ export default {
|
141
|
128
|
submitData () { // 提交数据
|
142
|
129
|
// 判断是否提交成功
|
143
|
130
|
// 提交成功,跳转页面
|
144
|
|
- // let subData = []
|
145
|
|
- // subData.activityName = this.$data.activityName
|
146
|
|
- // subData.activityType = this.$data.regValue
|
147
|
|
- // let obj = []
|
148
|
|
- // obj.giftValue = this.$data.giftValue
|
149
|
|
- // obj.giftNum = this.$data.giftNum
|
150
|
|
- // obj.desc = this.$data.desc
|
151
|
|
- // subData.resourceDesc = obj
|
152
|
|
-
|
153
|
|
- // console.log(subData)
|
154
|
|
-
|
155
|
|
- // let obj = []
|
156
|
|
- // obj.giftValue = this.$data.giftValue
|
157
|
|
- // obj.giftNum = this.$data.giftNum
|
158
|
|
- // obj.desc = this.$data.desc
|
159
|
|
-
|
160
|
131
|
let tempGiftOptions = this.$data.giftOptions
|
161
|
132
|
let tempGiftValue = this.$data.giftValue
|
162
|
133
|
for (let i = 0; i < tempGiftOptions.length; i++) {
|
|
@@ -166,7 +137,6 @@ export default {
|
166
|
137
|
}
|
167
|
138
|
}
|
168
|
139
|
let jsonString = '{"giftValue":"' + this.$data.giftValue + '","giftLabel":"' + this.$data.giftLabel + '","giftNum":"' + this.$data.giftNum + '","desc":"' + this.$data.desc + '"}'
|
169
|
|
-
|
170
|
140
|
this.$ajax(this.$api.marketingActivities.addMarketing.url, {
|
171
|
141
|
method: this.$api.marketingActivities.addMarketing.method,
|
172
|
142
|
queryData: {activityName: this.$data.activityName, activityType: this.$data.regValue, resourceDesc: jsonString, CaseId: this.defaultCaseId}
|