|
|
@@ -6,33 +6,54 @@
|
|
6
|
6
|
</el-form-item>
|
|
7
|
7
|
<el-form-item label="活动时间" prop="activityTime">
|
|
8
|
8
|
<el-date-picker
|
|
9
|
|
- v-model="ruleForm.activityTime"
|
|
10
|
|
- :picker-options="pickerOptions"
|
|
11
|
|
- class="filter-item"
|
|
12
|
|
- type="daterange"
|
|
13
|
|
- format="yyyy年MM月dd日"
|
|
14
|
|
- value-format="yyyy-MM-dd"
|
|
15
|
|
- align="left"
|
|
16
|
|
- unlink-panels
|
|
17
|
|
- range-separator="至"
|
|
18
|
|
- start-placeholder="开始日期"
|
|
19
|
|
- end-placeholder="结束日期"
|
|
20
|
|
- />
|
|
|
9
|
+ v-model="ruleForm.activityTime"
|
|
|
10
|
+ :picker-options="pickerOptions"
|
|
|
11
|
+ class="filter-item"
|
|
|
12
|
+ type="daterange"
|
|
|
13
|
+ format="yyyy年MM月dd日"
|
|
|
14
|
+ value-format="yyyy-MM-dd"
|
|
|
15
|
+ align="left"
|
|
|
16
|
+ unlink-panels
|
|
|
17
|
+ range-separator="至"
|
|
|
18
|
+ start-placeholder="开始日期"
|
|
|
19
|
+ end-placeholder="结束日期"
|
|
|
20
|
+ />
|
|
21
|
21
|
</el-form-item>
|
|
22
|
22
|
<el-form-item label="促销方式" prop="promotionMethod">
|
|
23
|
|
- <el-select v-model="ruleForm.promotionMethod" clearable placeholder="请选择促销方式">
|
|
|
23
|
+ <el-select v-model="ruleForm.promotionMethod" clearable placeholder="请选择促销方式">
|
|
24
|
24
|
<el-option label="按总件数" value="按总件数"></el-option>
|
|
25
|
25
|
<el-option label="按总金额" value="按总金额"></el-option>
|
|
26
|
26
|
</el-select>
|
|
27
|
27
|
</el-form-item>
|
|
28
|
28
|
<el-form-item label="满减活动" prop="amountRange">
|
|
29
|
|
- <el-button type="primary" @click="addActivity">添加活动</el-button><span class="info">请点击添加活动</span>
|
|
|
29
|
+ <el-button type="primary" @click="addActivity">添加活动</el-button>
|
|
|
30
|
+ <span class="info">请点击添加活动</span>
|
|
30
|
31
|
</el-form-item>
|
|
31
|
32
|
<el-form-item>
|
|
32
|
|
- <span class="money">*</span>消费满<el-input style="width:90px;" onkeyup="value=value.replace(/[^\d.]/g,'')" v-model="ruleForm.amountRange"></el-input>元,减<el-input v-model="ruleForm.reductionAmount" onkeyup="value=value.replace(/[^\d.]/g,'')" style="width:90px;"></el-input>元
|
|
|
33
|
+ <span class="money">*</span>消费满
|
|
|
34
|
+ <el-input
|
|
|
35
|
+ style="width:90px;"
|
|
|
36
|
+ onkeyup="value=value.replace(/[^\d.]/g,'')"
|
|
|
37
|
+ v-model="ruleForm.amountRange"
|
|
|
38
|
+ ></el-input>元,减
|
|
|
39
|
+ <el-input
|
|
|
40
|
+ v-model="ruleForm.reductionAmount"
|
|
|
41
|
+ onkeyup="value=value.replace(/[^\d.]/g,'')"
|
|
|
42
|
+ style="width:90px;"
|
|
|
43
|
+ ></el-input>元
|
|
33
|
44
|
</el-form-item>
|
|
34
|
|
- <el-form-item v-for="(item,index) in addActivityData" :key="index">
|
|
35
|
|
- <span class="money">*</span>消费满<el-input style="width:90px;" onkeyup="value=value.replace(/[^\d.]/g,'')" v-model="item.amountRange"></el-input>元,减<el-input style="width:90px;" onkeyup="value=value.replace(/[^\d.]/g,'')" v-model="item.reductionAmount"></el-input>元
|
|
|
45
|
+ <el-form-item v-for="(item,index) in addActivityData" :key="index">
|
|
|
46
|
+ <span class="money">*</span>消费满
|
|
|
47
|
+ <el-input
|
|
|
48
|
+ style="width:90px;"
|
|
|
49
|
+ onkeyup="value=value.replace(/[^\d.]/g,'')"
|
|
|
50
|
+ v-model="item.amountRange"
|
|
|
51
|
+ ></el-input>元,减
|
|
|
52
|
+ <el-input
|
|
|
53
|
+ style="width:90px;"
|
|
|
54
|
+ onkeyup="value=value.replace(/[^\d.]/g,'')"
|
|
|
55
|
+ v-model="item.reductionAmount"
|
|
|
56
|
+ ></el-input>元
|
|
36
|
57
|
<el-button type="text" @click="removeActivity(item.key)">删除</el-button>
|
|
37
|
58
|
</el-form-item>
|
|
38
|
59
|
<el-form-item label="活动方式" prop="activityMode">
|
|
|
@@ -44,8 +65,8 @@
|
|
44
|
65
|
v-for="item in shopList"
|
|
45
|
66
|
:key="item.F_TagName"
|
|
46
|
67
|
:label="item.F_TagName"
|
|
47
|
|
- :value="item.F_TagName">
|
|
48
|
|
- </el-option>
|
|
|
68
|
+ :value="item.F_TagName"
|
|
|
69
|
+ ></el-option>
|
|
49
|
70
|
</el-select>
|
|
50
|
71
|
</el-form-item>
|
|
51
|
72
|
<el-form-item>
|
|
|
@@ -57,231 +78,258 @@
|
|
57
|
78
|
</template>
|
|
58
|
79
|
|
|
59
|
80
|
<script>
|
|
60
|
|
-import { getProviceCity, getDictionary } from '@/api/commonAPI'
|
|
61
|
|
-import { getFullMarketingDetail, addFullMarketing, editFullMarketing, getMerchandise, getshopping} from '@/api/marketingManagement/fullGiveMarketing'
|
|
62
|
|
-import { validateTel } from '@/utils/validate'
|
|
63
|
|
-import { filterContent,pickerOptions } from '@/utils'
|
|
|
81
|
+import { getProviceCity, getDictionary } from "@/api/commonAPI";
|
|
|
82
|
+import {
|
|
|
83
|
+ getFullMarketingDetail,
|
|
|
84
|
+ addFullMarketing,
|
|
|
85
|
+ editFullMarketing,
|
|
|
86
|
+ getMerchandise,
|
|
|
87
|
+ getshopping,
|
|
|
88
|
+} from "@/api/marketingManagement/fullGiveMarketing";
|
|
|
89
|
+import { validateTel } from "@/utils/validate";
|
|
|
90
|
+import { filterContent, pickerOptions } from "@/utils";
|
|
64
|
91
|
export default {
|
|
65
|
|
- name: 'AddOrEdit',
|
|
|
92
|
+ name: "AddOrEdit",
|
|
66
|
93
|
props: {
|
|
67
|
94
|
rowid: {
|
|
68
|
95
|
type: String,
|
|
69
|
|
- default: ''
|
|
|
96
|
+ default: "",
|
|
70
|
97
|
},
|
|
71
|
98
|
callid: {
|
|
72
|
99
|
type: Number,
|
|
73
|
|
- default: 0
|
|
|
100
|
+ default: 0,
|
|
74
|
101
|
},
|
|
75
|
102
|
layerid: {
|
|
76
|
103
|
type: String,
|
|
77
|
|
- default: ''
|
|
78
|
|
- }
|
|
|
104
|
+ default: "",
|
|
|
105
|
+ },
|
|
79
|
106
|
},
|
|
80
|
107
|
data() {
|
|
81
|
108
|
return {
|
|
82
|
|
- props: { // 自定义省市下拉数据的key值
|
|
83
|
|
- value: 'code',
|
|
84
|
|
- label: 'name',
|
|
85
|
|
- children: 'entityJson'
|
|
|
109
|
+ props: {
|
|
|
110
|
+ // 自定义省市下拉数据的key值
|
|
|
111
|
+ value: "code",
|
|
|
112
|
+ label: "name",
|
|
|
113
|
+ children: "entityJson",
|
|
86
|
114
|
},
|
|
87
|
|
- pickerOptions,//日期数据
|
|
|
115
|
+ pickerOptions, //日期数据
|
|
88
|
116
|
sourceOptions: [], // 工单来源下拉数据
|
|
89
|
|
- shopList:[],//绑定商品数据
|
|
90
|
|
- addActivityData:[],//添加活动的数据
|
|
|
117
|
+ shopList: [], //绑定商品数据
|
|
|
118
|
+ addActivityData: [], //添加活动的数据
|
|
91
|
119
|
ruleForm: {
|
|
92
|
|
- unique_id: '', // 否 string callid
|
|
93
|
|
- ordercode: '',
|
|
94
|
|
- activityName: '', //活动名称
|
|
95
|
|
- activityTime: '', //活动时间
|
|
96
|
|
- promotionMethod: '', //促销方式
|
|
97
|
|
- reductionAmount: '', //满减金额
|
|
98
|
|
- amountRange: '', //金额区间
|
|
99
|
|
- activityMode: '', //活动方式
|
|
100
|
|
- boundGoods: '', //绑定商品
|
|
|
120
|
+ unique_id: "", // 否 string callid
|
|
|
121
|
+ ordercode: "",
|
|
|
122
|
+ activityName: "", //活动名称
|
|
|
123
|
+ activityTime: "", //活动时间
|
|
|
124
|
+ promotionMethod: "", //促销方式
|
|
|
125
|
+ reductionAmount: "", //满减金额
|
|
|
126
|
+ amountRange: "", //金额区间
|
|
|
127
|
+ activityMode: "", //活动方式
|
|
|
128
|
+ boundGoods: "", //绑定商品
|
|
101
|
129
|
},
|
|
102
|
|
- reductionAmount:[],//满减金额
|
|
103
|
|
- amountRange:[],//金额区间
|
|
|
130
|
+ reductionAmount: [], //满减金额
|
|
|
131
|
+ amountRange: [], //金额区间
|
|
104
|
132
|
rules: {
|
|
105
|
|
- activityName: [{
|
|
106
|
|
- required: true,
|
|
107
|
|
- trigger: 'blur',
|
|
108
|
|
- message: '请输入活动名称',
|
|
109
|
|
- }],
|
|
110
|
|
- activityTime: [{
|
|
111
|
|
- required: true,
|
|
112
|
|
- trigger: 'blur',
|
|
113
|
|
- message: '请选择活动时间',
|
|
114
|
|
- }],
|
|
115
|
|
- promotionMethod: [{
|
|
116
|
|
- required: true,
|
|
117
|
|
- trigger: 'blur',
|
|
118
|
|
- message: '请选择促销方式',
|
|
119
|
|
- }],
|
|
120
|
|
- boundGoods: [{
|
|
121
|
|
- required: true,
|
|
122
|
|
- trigger: 'blur',
|
|
123
|
|
- message: '请选择商品标签',
|
|
124
|
|
- }],
|
|
|
133
|
+ activityName: [
|
|
|
134
|
+ {
|
|
|
135
|
+ required: true,
|
|
|
136
|
+ trigger: "blur",
|
|
|
137
|
+ message: "请输入活动名称",
|
|
|
138
|
+ },
|
|
|
139
|
+ ],
|
|
|
140
|
+ activityTime: [
|
|
|
141
|
+ {
|
|
|
142
|
+ required: true,
|
|
|
143
|
+ trigger: "blur",
|
|
|
144
|
+ message: "请选择活动时间",
|
|
|
145
|
+ },
|
|
|
146
|
+ ],
|
|
|
147
|
+ promotionMethod: [
|
|
|
148
|
+ {
|
|
|
149
|
+ required: true,
|
|
|
150
|
+ trigger: "blur",
|
|
|
151
|
+ message: "请选择促销方式",
|
|
|
152
|
+ },
|
|
|
153
|
+ ],
|
|
|
154
|
+ boundGoods: [
|
|
|
155
|
+ {
|
|
|
156
|
+ required: true,
|
|
|
157
|
+ trigger: "blur",
|
|
|
158
|
+ message: "请选择商品标签",
|
|
|
159
|
+ },
|
|
|
160
|
+ ],
|
|
125
|
161
|
},
|
|
126
|
|
- loading: false
|
|
127
|
|
- }
|
|
|
162
|
+ loading: false,
|
|
|
163
|
+ };
|
|
128
|
164
|
},
|
|
129
|
165
|
created() {
|
|
130
|
|
- this.getShopList();//获取绑定商品
|
|
|
166
|
+ this.getShopList(); //获取绑定商品
|
|
131
|
167
|
if (this.callid) {
|
|
132
|
|
- this.ruleForm.unique_id = this.callid
|
|
|
168
|
+ this.ruleForm.unique_id = this.callid;
|
|
133
|
169
|
}
|
|
134
|
|
- Promise.all([])
|
|
135
|
|
- .then(() => {
|
|
136
|
|
- if (this.rowid) {
|
|
137
|
|
- this.ruleForm.ordercode = this.rowid
|
|
138
|
|
- this.getDetail(this.rowid)
|
|
139
|
|
- }
|
|
140
|
|
- })
|
|
|
170
|
+ Promise.all([]).then(() => {
|
|
|
171
|
+ if (this.rowid) {
|
|
|
172
|
+ this.ruleForm.ordercode = this.rowid;
|
|
|
173
|
+ this.getDetail(this.rowid);
|
|
|
174
|
+ }
|
|
|
175
|
+ });
|
|
141
|
176
|
},
|
|
142
|
177
|
methods: {
|
|
143
|
178
|
submitForm() {
|
|
144
|
|
- if(this.addActivityData&&this.addActivityData.length>0){
|
|
145
|
|
- this.addActivityData.map(item=>{
|
|
146
|
|
- this.reductionAmount.push(item.reductionAmount);
|
|
147
|
|
- this.amountRange.push(item.amountRange);
|
|
148
|
|
- })
|
|
149
|
|
- }else{
|
|
150
|
|
- this.$message.error('请输入有效的必填项信息')
|
|
151
|
|
- this.reductionAmount=[];
|
|
152
|
|
- this.amountRange=[];
|
|
153
|
|
- return
|
|
154
|
|
- }
|
|
155
|
|
-
|
|
156
|
179
|
this.$refs.ruleForm.validate((valid) => {
|
|
157
|
180
|
if (valid) {
|
|
158
|
|
- this.ruleForm.content = filterContent.delHtmlTag(this.ruleForm.content)// 保存内容时去掉 html 标签
|
|
159
|
|
- this.loading = true
|
|
160
|
|
- return new Promise(response=>{
|
|
161
|
|
- const params={
|
|
162
|
|
- F_Type:3,
|
|
163
|
|
- F_ID:this.rowid ? this.rowid : '',
|
|
164
|
|
- F_Name:this.ruleForm.activityName,//活动名称
|
|
165
|
|
- F_Describe:this.ruleForm.promotionMethod,//促销方式
|
|
166
|
|
- F_Money:this.reductionAmount.toString(),//满减金额
|
|
167
|
|
- F_AmountRange:this.amountRange.toString(),//金额区间
|
|
168
|
|
- F_StartTime:this.ruleForm.activityTime && this.ruleForm.activityTime[0],//开始时间
|
|
169
|
|
- F_EndTime:this.ruleForm.activityTime && this.ruleForm.activityTime[1],//结束时间
|
|
170
|
|
- F_Commodity:this.ruleForm.boundGoods,//商品ID
|
|
171
|
|
- F_ActivityMode:this.ruleForm.activityMode,//活动金额
|
|
172
|
|
- }
|
|
173
|
|
- // 添加
|
|
|
181
|
+ if (this.addActivityData && this.addActivityData.length > 0) {
|
|
|
182
|
+ this.addActivityData.map((item) => {
|
|
|
183
|
+ this.reductionAmount.push(item.reductionAmount);
|
|
|
184
|
+ this.amountRange.push(item.amountRange);
|
|
|
185
|
+ });
|
|
|
186
|
+ } else {
|
|
|
187
|
+ this.$message.error("请输入满减金额!");
|
|
|
188
|
+ this.reductionAmount = [];
|
|
|
189
|
+ this.amountRange = [];
|
|
|
190
|
+ return;
|
|
|
191
|
+ }
|
|
|
192
|
+ this.ruleForm.content = filterContent.delHtmlTag(
|
|
|
193
|
+ this.ruleForm.content
|
|
|
194
|
+ ); // 保存内容时去掉 html 标签
|
|
|
195
|
+ this.loading = true;
|
|
|
196
|
+ return new Promise((response) => {
|
|
|
197
|
+ const params = {
|
|
|
198
|
+ F_Type: 3,
|
|
|
199
|
+ F_ID: this.rowid ? this.rowid : "",
|
|
|
200
|
+ F_Name: this.ruleForm.activityName, //活动名称
|
|
|
201
|
+ F_Describe: this.ruleForm.promotionMethod, //促销方式
|
|
|
202
|
+ F_Money: this.reductionAmount.toString(), //满减金额
|
|
|
203
|
+ F_AmountRange: this.amountRange.toString(), //金额区间
|
|
|
204
|
+ F_StartTime:
|
|
|
205
|
+ this.ruleForm.activityTime && this.ruleForm.activityTime[0], //开始时间
|
|
|
206
|
+ F_EndTime:
|
|
|
207
|
+ this.ruleForm.activityTime && this.ruleForm.activityTime[1], //结束时间
|
|
|
208
|
+ F_Commodity: this.ruleForm.boundGoods, //商品ID
|
|
|
209
|
+ F_ActivityMode: this.ruleForm.activityMode, //活动金额
|
|
|
210
|
+ };
|
|
|
211
|
+ // 添加
|
|
174
|
212
|
if (!this.rowid) {
|
|
175
|
|
- addFullMarketing(params).then(response => {
|
|
176
|
|
- this.loading = false
|
|
177
|
|
- if (response.state.toLowerCase() === 'success') {
|
|
178
|
|
- this.$parent.$layer.close(this.layerid)
|
|
179
|
|
- if (this.callid) {
|
|
180
|
|
- this.$parent.getOrderRecord() // 重新加载来电弹屏工单记录
|
|
181
|
|
- } else {
|
|
182
|
|
- this.$parent.btn_search() // 重新加载父级数据
|
|
|
213
|
+ addFullMarketing(params)
|
|
|
214
|
+ .then((response) => {
|
|
|
215
|
+ this.loading = false;
|
|
|
216
|
+ if (response.state.toLowerCase() === "success") {
|
|
|
217
|
+ this.$parent.$layer.close(this.layerid);
|
|
|
218
|
+ if (this.callid) {
|
|
|
219
|
+ this.$parent.getOrderRecord(); // 重新加载来电弹屏工单记录
|
|
|
220
|
+ } else {
|
|
|
221
|
+ this.$parent.btn_search(); // 重新加载父级数据
|
|
|
222
|
+ }
|
|
|
223
|
+ this.$message.success("恭喜你,添加成功!");
|
|
183
|
224
|
}
|
|
184
|
|
- this.$message.success('恭喜你,添加成功!')
|
|
185
|
|
- }
|
|
186
|
|
- }).catch(() => {
|
|
187
|
|
- this.loading = false
|
|
188
|
|
- })
|
|
189
|
|
- return
|
|
|
225
|
+ })
|
|
|
226
|
+ .catch(() => {
|
|
|
227
|
+ this.loading = false;
|
|
|
228
|
+ });
|
|
|
229
|
+ return;
|
|
190
|
230
|
}
|
|
191
|
231
|
// 编辑
|
|
192
|
|
- editFullMarketing(params).then(response => {
|
|
193
|
|
- this.loading = false
|
|
194
|
|
- if (response.state.toLowerCase() === 'success') {
|
|
195
|
|
- this.$parent.$layer.close(this.layerid)
|
|
196
|
|
- this.$parent.getList() // 重新加载父级数据
|
|
197
|
|
- this.$message.success('恭喜你,编辑成功!')
|
|
198
|
|
- }
|
|
199
|
|
- }).catch(() => {
|
|
200
|
|
- this.loading = false
|
|
201
|
|
- })
|
|
202
|
|
- })
|
|
203
|
|
-
|
|
|
232
|
+ editFullMarketing(params)
|
|
|
233
|
+ .then((response) => {
|
|
|
234
|
+ this.loading = false;
|
|
|
235
|
+ if (response.state.toLowerCase() === "success") {
|
|
|
236
|
+ this.$parent.$layer.close(this.layerid);
|
|
|
237
|
+ this.$parent.getList(); // 重新加载父级数据
|
|
|
238
|
+ this.$message.success("恭喜你,编辑成功!");
|
|
|
239
|
+ }
|
|
|
240
|
+ })
|
|
|
241
|
+ .catch(() => {
|
|
|
242
|
+ this.loading = false;
|
|
|
243
|
+ });
|
|
|
244
|
+ });
|
|
204
|
245
|
} else {
|
|
205
|
|
- this.$message.error('请输入有效的必填项信息!')
|
|
206
|
|
- this.reductionAmount=[];
|
|
207
|
|
- this.amountRange=[];
|
|
208
|
|
- return false
|
|
|
246
|
+ this.$message.error("请输入有效的必填项信息!");
|
|
|
247
|
+ this.reductionAmount = [];
|
|
|
248
|
+ this.amountRange = [];
|
|
|
249
|
+ return false;
|
|
209
|
250
|
}
|
|
210
|
|
- })
|
|
|
251
|
+ });
|
|
211
|
252
|
},
|
|
212
|
253
|
resetForm() {
|
|
213
|
|
- this.$refs.ruleForm.resetFields()
|
|
214
|
|
- this.ruleForm.activityTime = ''
|
|
215
|
|
- this.addActivityData=[]
|
|
|
254
|
+ this.$refs.ruleForm.resetFields();
|
|
|
255
|
+ this.ruleForm.activityTime = "";
|
|
|
256
|
+ this.addActivityData = [];
|
|
216
|
257
|
},
|
|
217
|
258
|
// 详情
|
|
218
|
259
|
getDetail(rid) {
|
|
219
|
|
- getFullMarketingDetail(rid).then(response => {
|
|
220
|
|
- if (response.state.toLowerCase() === 'success') {
|
|
221
|
|
- const res = response.data
|
|
|
260
|
+ getFullMarketingDetail(rid).then((response) => {
|
|
|
261
|
+ if (response.state.toLowerCase() === "success") {
|
|
|
262
|
+ const res = response.data;
|
|
222
|
263
|
this.ruleForm.activityName = res.F_Name;
|
|
223
|
264
|
this.ruleForm.promotionMethod = res.F_Describe;
|
|
224
|
|
- this.addActivityData = res.F_Money.split(',').map((reductionAmount,i) => ({reductionAmount, amountRange: res.F_AmountRange.split(',')[i]}));
|
|
|
265
|
+ this.addActivityData = res.F_Money.split(
|
|
|
266
|
+ ","
|
|
|
267
|
+ ).map((reductionAmount, i) => ({
|
|
|
268
|
+ reductionAmount,
|
|
|
269
|
+ amountRange: res.F_AmountRange.split(",")[i],
|
|
|
270
|
+ }));
|
|
225
|
271
|
// this.ruleForm.reductionAmount = res.F_Money;
|
|
226
|
272
|
// this.ruleForm.amountRange = res.F_AmountRange;
|
|
227
|
273
|
this.ruleForm.activityMode = res.F_ActivityMode;
|
|
228
|
274
|
this.ruleForm.boundGoods = res.F_Commodity;
|
|
229
|
|
- this.ruleForm.activityTime = [res.F_StartTime,res.F_EndTime];
|
|
|
275
|
+ this.ruleForm.activityTime = [res.F_StartTime, res.F_EndTime];
|
|
230
|
276
|
}
|
|
231
|
|
- })
|
|
|
277
|
+ });
|
|
232
|
278
|
},
|
|
233
|
279
|
//获取绑定商品
|
|
234
|
|
- getShopList(){
|
|
235
|
|
- getshopping({CLass:3}).then(response =>{
|
|
236
|
|
- if(response.state.toLowerCase() == 'success'){
|
|
237
|
|
- this.shopList=response.data
|
|
238
|
|
- }
|
|
239
|
|
- }).catch(result=>{
|
|
240
|
|
- console.log(result)
|
|
241
|
|
- })
|
|
|
280
|
+ getShopList() {
|
|
|
281
|
+ getshopping({ CLass: 3 })
|
|
|
282
|
+ .then((response) => {
|
|
|
283
|
+ if (response.state.toLowerCase() == "success") {
|
|
|
284
|
+ this.shopList = response.data;
|
|
|
285
|
+ }
|
|
|
286
|
+ })
|
|
|
287
|
+ .catch((result) => {
|
|
|
288
|
+ console.log(result);
|
|
|
289
|
+ });
|
|
242
|
290
|
},
|
|
243
|
291
|
//添加活动方法
|
|
244
|
292
|
addActivity() {
|
|
245
|
|
- if(!this.ruleForm.amountRange||!this.ruleForm.reductionAmount){
|
|
246
|
|
- this.$message.error('请填写金额数据')
|
|
247
|
|
- return
|
|
|
293
|
+ if (!this.ruleForm.amountRange || !this.ruleForm.reductionAmount) {
|
|
|
294
|
+ this.$message.error("请填写金额数据");
|
|
|
295
|
+ return;
|
|
248
|
296
|
}
|
|
249
|
297
|
this.addActivityData.push({
|
|
250
|
|
- amountRange:this.ruleForm.amountRange,//满减区间
|
|
251
|
|
- reductionAmount:this.ruleForm.reductionAmount,//满减金额
|
|
252
|
|
- key: Date.now()
|
|
|
298
|
+ amountRange: this.ruleForm.amountRange, //满减区间
|
|
|
299
|
+ reductionAmount: this.ruleForm.reductionAmount, //满减金额
|
|
|
300
|
+ key: Date.now(),
|
|
253
|
301
|
});
|
|
254
|
|
- this.ruleForm.amountRange='';
|
|
255
|
|
- this.ruleForm.reductionAmount='';
|
|
|
302
|
+ this.ruleForm.amountRange = "";
|
|
|
303
|
+ this.ruleForm.reductionAmount = "";
|
|
256
|
304
|
},
|
|
257
|
305
|
//删除活动方法
|
|
258
|
306
|
removeActivity(itemId) {
|
|
259
|
|
- var index = this.addActivityData.findIndex(item=>{
|
|
260
|
|
- return item.key == itemId
|
|
261
|
|
- })
|
|
|
307
|
+ var index = this.addActivityData.findIndex((item) => {
|
|
|
308
|
+ return item.key == itemId;
|
|
|
309
|
+ });
|
|
262
|
310
|
if (index !== -1) {
|
|
263
|
|
- this.addActivityData.splice(index, 1)
|
|
|
311
|
+ this.addActivityData.splice(index, 1);
|
|
264
|
312
|
}
|
|
265
|
313
|
},
|
|
266
|
|
- }
|
|
267
|
|
-}
|
|
|
314
|
+ },
|
|
|
315
|
+};
|
|
268
|
316
|
</script>
|
|
269
|
317
|
|
|
270
|
318
|
<style rel="stylesheet/scss" lang="scss">
|
|
271
|
319
|
.order_form {
|
|
272
|
320
|
.form_select {
|
|
273
|
|
- width: 100%;
|
|
|
321
|
+ width: 100%;
|
|
274
|
322
|
}
|
|
275
|
323
|
.form_date {
|
|
276
|
324
|
width: 100%;
|
|
277
|
325
|
}
|
|
278
|
326
|
}
|
|
279
|
|
-.money{
|
|
280
|
|
- color: #F56C6C;
|
|
|
327
|
+.money {
|
|
|
328
|
+ color: #f56c6c;
|
|
281
|
329
|
margin-left: 4px;
|
|
282
|
330
|
}
|
|
283
|
|
-.info{
|
|
284
|
|
- color: #C0C4CC;
|
|
|
331
|
+.info {
|
|
|
332
|
+ color: #c0c4cc;
|
|
285
|
333
|
font-size: 12px;
|
|
286
|
334
|
margin-left: 5px;
|
|
287
|
335
|
}
|