|
|
@@ -14,15 +14,37 @@
|
|
14
|
14
|
<el-form-item label="客户年龄" prop="F_Age">
|
|
15
|
15
|
<el-input v-model="ruleForm.F_Age" placeholder="请输入客户年龄" onkeyup="value=value.replace(/[^\d.]/g,'')"></el-input>
|
|
16
|
16
|
</el-form-item>
|
|
17
|
|
- <el-form-item label="手机号码1" prop="F_Mobile">
|
|
18
|
|
- <el-input v-model="ruleForm.F_Mobile" placeholder="请输入手机号码1"></el-input>
|
|
19
|
|
- </el-form-item>
|
|
20
|
|
- <el-form-item label="手机号码2" prop="F_Mobile1">
|
|
21
|
|
- <el-input v-model="ruleForm.F_Mobile1" placeholder="请输入手机号码2"></el-input>
|
|
22
|
|
- </el-form-item>
|
|
23
|
|
- <el-form-item label="联系方式" prop="F_Phone">
|
|
24
|
|
- <el-input v-model="ruleForm.F_Phone" placeholder="请输入联系方式"></el-input>
|
|
|
17
|
+ <el-form-item label="主号码" prop="F_Phone">
|
|
|
18
|
+ <el-input v-model="ruleForm.F_Phone" placeholder="请输入主号码"></el-input>
|
|
25
|
19
|
</el-form-item>
|
|
|
20
|
+ <el-row>
|
|
|
21
|
+ <el-col :span='16'>
|
|
|
22
|
+ <el-form-item label="备用号码" prop="backupMobile">
|
|
|
23
|
+ <el-input v-model="ruleForm.backupMobile" placeholder="请输入手机号码"></el-input>
|
|
|
24
|
+ </el-form-item>
|
|
|
25
|
+ </el-col>
|
|
|
26
|
+ <el-col :span='8'>
|
|
|
27
|
+ <el-form-item label="">
|
|
|
28
|
+ <el-button type="primary" @click="addMobile">添加号码</el-button>
|
|
|
29
|
+ </el-form-item>
|
|
|
30
|
+ </el-col>
|
|
|
31
|
+ </el-row>
|
|
|
32
|
+ <el-row>
|
|
|
33
|
+ <el-col :span='24'>
|
|
|
34
|
+ <el-form-item label="备用号码">
|
|
|
35
|
+ <el-table :data="mobileTableData" stripe style="width: 100%">
|
|
|
36
|
+ <el-table-column prop="mobileNumber" label="备用号码" align="center" ></el-table-column>
|
|
|
37
|
+ <el-table-column label="操作" align="center">
|
|
|
38
|
+ <template slot-scope="scope">
|
|
|
39
|
+ <el-button type="text" @click="btn_deleteMobile(scope.row.mobileNumber)">删除</el-button>
|
|
|
40
|
+ </template>
|
|
|
41
|
+ </el-table-column>
|
|
|
42
|
+ </el-table>
|
|
|
43
|
+ </el-form-item>
|
|
|
44
|
+ </el-col>
|
|
|
45
|
+ </el-row>
|
|
|
46
|
+ <el-row>
|
|
|
47
|
+ </el-row>
|
|
26
|
48
|
<el-form-item label="会员标签" prop="F_Type">
|
|
27
|
49
|
<el-select v-model="ruleForm.F_Type" clearable placeholder="请选择会员标签" class="form_select">
|
|
28
|
50
|
<el-option
|
|
|
@@ -33,8 +55,8 @@
|
|
33
|
55
|
</el-option>
|
|
34
|
56
|
</el-select>
|
|
35
|
57
|
</el-form-item>
|
|
36
|
|
- <el-form-item label="地区" prop="provinceCity">
|
|
37
|
|
- <el-cascader
|
|
|
58
|
+ <el-form-item label="默认地区" prop="provinceCity">
|
|
|
59
|
+ <el-cascader
|
|
38
|
60
|
v-model="provinceCity"
|
|
39
|
61
|
:options="provinceCityDatas"
|
|
40
|
62
|
:props="props"
|
|
|
@@ -46,12 +68,41 @@
|
|
46
|
68
|
clearable
|
|
47
|
69
|
change-on-select/>
|
|
48
|
70
|
</el-form-item>
|
|
49
|
|
- <el-form-item label="详细地址" prop="F_Address">
|
|
|
71
|
+ <el-form-item label="默认地址" prop="F_Address">
|
|
50
|
72
|
<el-input v-model="ruleForm.F_Address" placeholder="请输入详细地址"></el-input>
|
|
51
|
73
|
</el-form-item>
|
|
52
|
|
- <el-form-item label="备用地址" prop="F_Address1">
|
|
|
74
|
+ <el-form-item label="备用地区1" prop="provinceCity1">
|
|
|
75
|
+ <el-cascader
|
|
|
76
|
+ v-model="provinceCity1"
|
|
|
77
|
+ :options="provinceCityDatas1"
|
|
|
78
|
+ :props="props"
|
|
|
79
|
+ :placeholder="placeholderArea1"
|
|
|
80
|
+ class="form_select"
|
|
|
81
|
+ :class="{'placeholderAreaClass': isPlaceholderAreaClass} "
|
|
|
82
|
+ @change="handleItemChange1"
|
|
|
83
|
+ ref="myCascader1"
|
|
|
84
|
+ clearable
|
|
|
85
|
+ change-on-select/>
|
|
|
86
|
+ </el-form-item>
|
|
|
87
|
+ <el-form-item label="备用地址1" prop="F_Address1">
|
|
53
|
88
|
<el-input v-model="ruleForm.F_Address1" placeholder="请输入备用地址"></el-input>
|
|
54
|
89
|
</el-form-item>
|
|
|
90
|
+ <el-form-item label="备用地区2" prop="provinceCity2">
|
|
|
91
|
+ <el-cascader
|
|
|
92
|
+ v-model="provinceCity2"
|
|
|
93
|
+ :options="provinceCityDatas2"
|
|
|
94
|
+ :props="props"
|
|
|
95
|
+ :placeholder="placeholderArea2"
|
|
|
96
|
+ class="form_select"
|
|
|
97
|
+ :class="{'placeholderAreaClass':isPlaceholderAreaClass} "
|
|
|
98
|
+ @change="handleItemChange2"
|
|
|
99
|
+ ref="myCascader2"
|
|
|
100
|
+ clearable
|
|
|
101
|
+ change-on-select/>
|
|
|
102
|
+ </el-form-item>
|
|
|
103
|
+ <el-form-item label="备用地址2" prop="F_Address2">
|
|
|
104
|
+ <el-input v-model="ruleForm.F_Address2" placeholder="请输入备用地址"></el-input>
|
|
|
105
|
+ </el-form-item>
|
|
55
|
106
|
<el-form-item label="邮编" prop="F_Postcode">
|
|
56
|
107
|
<el-input v-model="ruleForm.F_Postcode" placeholder="请输入邮编"></el-input>
|
|
57
|
108
|
</el-form-item>
|
|
|
@@ -70,9 +121,17 @@
|
|
70
|
121
|
<el-form-item label="会员积分" prop="F_Score">
|
|
71
|
122
|
<el-input v-model="ruleForm.F_Score" placeholder="请输入会员积分" onkeyup="value=value.replace(/[^\d.]/g,'')"></el-input>
|
|
72
|
123
|
</el-form-item>
|
|
73
|
|
- <el-form-item label="推荐人" prop="F_Recommender">
|
|
|
124
|
+ <el-form-item label="推荐人" prop="F_RecommendName" >
|
|
|
125
|
+ <el-select v-model="ruleForm.F_RecommendName" class="form_select" filterable remote reserve-keyword value-key="F_ID" :placeholder="recommendNameRemind" :remote-method="remoteMethodRecommend" :loading="loading" @change="recommendChangeSelect">
|
|
|
126
|
+ <el-option v-for="item in recommendListOptions" :key="item.F_ID" :label="item.F_Name" :value="item"></el-option>
|
|
|
127
|
+ </el-select>
|
|
|
128
|
+ </el-form-item>
|
|
|
129
|
+ <!-- <el-form-item label="推荐人" prop="F_Recommender">
|
|
74
|
130
|
<el-input v-model="ruleForm.F_Recommender" placeholder="请输入推荐人"></el-input>
|
|
75
|
131
|
</el-form-item>
|
|
|
132
|
+ <el-form-item label="推荐人手机号码" prop="F_RecommenderTel">
|
|
|
133
|
+ <el-input v-model="ruleForm.F_RecommenderTel" placeholder="请输入推荐人手机号码"></el-input>
|
|
|
134
|
+ </el-form-item> -->
|
|
76
|
135
|
<el-form-item label="累计消费金额" prop="F_Money">
|
|
77
|
136
|
<el-input v-model="ruleForm.F_Money" placeholder="请输入累计消费金额" onkeyup="value=value.replace(/[^\d.]/g,'')"></el-input>
|
|
78
|
137
|
</el-form-item>
|
|
|
@@ -89,14 +148,10 @@
|
|
89
|
148
|
|
|
90
|
149
|
<script>
|
|
91
|
150
|
import { getProviceCityById } from "@/api/commonAPI";
|
|
92
|
|
-import {
|
|
93
|
|
- getMemberInfo,
|
|
94
|
|
- addOrder,
|
|
95
|
|
- editOrder,
|
|
96
|
|
- getLabelLists
|
|
97
|
|
-} from "@/api/memberManagement/memberList";
|
|
|
151
|
+import { getMemberInfo, addOrder, editOrder, getLabelLists } from "@/api/memberManagement/memberList";
|
|
98
|
152
|
import { validateTel } from "@/utils/validate";
|
|
99
|
153
|
import { filterContent,pickerOptions } from "@/utils";
|
|
|
154
|
+import { getOrderLists } from '@/api/memberManagement/memberList'
|
|
100
|
155
|
|
|
101
|
156
|
export default {
|
|
102
|
157
|
name: "AddOrEdit",
|
|
|
@@ -118,9 +173,19 @@ export default {
|
|
118
|
173
|
return {
|
|
119
|
174
|
sourceOptions: [], // 工单来源下拉数据
|
|
120
|
175
|
memberType: [], // 会员类型下拉数据
|
|
|
176
|
+ recommendList: [], //会员列表数据
|
|
|
177
|
+ recommendListOptions: [], //会员列表数据
|
|
121
|
178
|
provinceCityDatas: [], // 省市下拉数据
|
|
|
179
|
+ provinceCityDatas1: [], // 省市下拉数据
|
|
|
180
|
+ provinceCityDatas2: [], // 省市下拉数据
|
|
122
|
181
|
provinceCity: [], // 省市下拉绑定的值
|
|
|
182
|
+ provinceCity1: [], // 省市下拉绑定的值
|
|
|
183
|
+ provinceCity2: [], // 省市下拉绑定的值
|
|
123
|
184
|
provinceCityText: [], // 省市下拉绑定的文本值
|
|
|
185
|
+ provinceCityText1: [], // 省市下拉绑定的文本值
|
|
|
186
|
+ provinceCityText2: [], // 省市下拉绑定的文本值
|
|
|
187
|
+ mobileTableData: [], //备用号码列表
|
|
|
188
|
+ mobileData: '', //备用号码数据
|
|
124
|
189
|
props: {
|
|
125
|
190
|
// 自定义省市下拉数据的key值
|
|
126
|
191
|
value: "id",
|
|
|
@@ -130,10 +195,13 @@ export default {
|
|
130
|
195
|
addressParams: {
|
|
131
|
196
|
pid: 1
|
|
132
|
197
|
},
|
|
133
|
|
- isPlaceholderAreaClass:true,
|
|
|
198
|
+ isPlaceholderAreaClass: true,
|
|
134
|
199
|
placeholderArea:'',//地区默认值
|
|
|
200
|
+ placeholderArea1:'',//备选地区1默认值
|
|
|
201
|
+ placeholderArea2:'',//备选地区2默认值
|
|
135
|
202
|
level: 0, //城市等级
|
|
136
|
203
|
pickerOptions ,// 日期数据
|
|
|
204
|
+ recommendNameRemind: '请输入手机号码',
|
|
137
|
205
|
ruleForm: {
|
|
138
|
206
|
unique_id: "", // 否 string callid
|
|
139
|
207
|
id: "", //编辑会员信息id
|
|
|
@@ -141,23 +209,27 @@ export default {
|
|
141
|
209
|
F_Name: "", //客户姓名
|
|
142
|
210
|
F_Sex: "男", //客户性别
|
|
143
|
211
|
F_Age: "", //客户年龄
|
|
144
|
|
- F_Mobile: "", //手机号码
|
|
145
|
|
- F_Mobile1: "", //手机号码1
|
|
146
|
|
- F_Phone: "", //固定电话
|
|
|
212
|
+ // F_Mobile: "", //备用号码
|
|
|
213
|
+ backupMobile: "", //备用号码
|
|
|
214
|
+ F_Phone: "", //主号码
|
|
147
|
215
|
F_Type: "", //会员类型
|
|
148
|
216
|
// province: "", //省
|
|
149
|
217
|
// city: "", //市
|
|
150
|
218
|
// county: "", //县/区
|
|
151
|
219
|
// township: "", //乡镇
|
|
152
|
220
|
F_Address: "", //详细地址
|
|
153
|
|
- F_Address1: "", //备用地址
|
|
|
221
|
+ F_Address1: "", //备用地址1
|
|
|
222
|
+ F_Address2: "", //备用地址2
|
|
154
|
223
|
F_Postcode: "", //邮编
|
|
155
|
224
|
F_ShoeSize: "", //鞋码
|
|
156
|
225
|
F_Birthday: "", //会员生日
|
|
157
|
226
|
F_Score: "", //会员积分
|
|
158
|
227
|
F_Recommender: "", //推荐人
|
|
|
228
|
+ F_RecommenderTel: "", //推荐人手机号码
|
|
|
229
|
+ F_RecommenderID: "", //推荐人id
|
|
|
230
|
+ F_RecommendName: "", //推荐人名称
|
|
159
|
231
|
F_Money: "", //累计消费金额
|
|
160
|
|
- F_TotalScore: "" //累计积分
|
|
|
232
|
+ F_TotalScore: "", //累计积分
|
|
161
|
233
|
},
|
|
162
|
234
|
rules: {
|
|
163
|
235
|
F_Name: [
|
|
|
@@ -171,7 +243,7 @@ export default {
|
|
171
|
243
|
{
|
|
172
|
244
|
required: true,
|
|
173
|
245
|
trigger: "blur",
|
|
174
|
|
- message: "请输入联系方式"
|
|
|
246
|
+ message: "请输入主号码"
|
|
175
|
247
|
}
|
|
176
|
248
|
]
|
|
177
|
249
|
},
|
|
|
@@ -180,6 +252,7 @@ export default {
|
|
180
|
252
|
},
|
|
181
|
253
|
created() {
|
|
182
|
254
|
this.getProCity()
|
|
|
255
|
+ this.getRecommendList()
|
|
183
|
256
|
if (this.callid) {
|
|
184
|
257
|
this.ruleForm.unique_id = this.callid;
|
|
185
|
258
|
}
|
|
|
@@ -190,6 +263,8 @@ export default {
|
|
190
|
263
|
this.getDetail(this.rowid);
|
|
191
|
264
|
}else{
|
|
192
|
265
|
this.placeholderArea='请选择地区';
|
|
|
266
|
+ this.placeholderArea1='请选择备用地区1';
|
|
|
267
|
+ this.placeholderArea2='请选备用择地区2';
|
|
193
|
268
|
this.isPlaceholderAreaClass=false
|
|
194
|
269
|
}
|
|
195
|
270
|
});
|
|
|
@@ -203,33 +278,43 @@ export default {
|
|
203
|
278
|
); // 保存内容时去掉 html 标签
|
|
204
|
279
|
this.loading = true;
|
|
205
|
280
|
return new Promise(resolve => {
|
|
|
281
|
+ this.mobileData = ''
|
|
|
282
|
+ for (let i = 0; i < this.mobileTableData.length; i++) {
|
|
|
283
|
+ this.mobileData += this.mobileTableData[i].mobileNumber + ','
|
|
|
284
|
+ }
|
|
206
|
285
|
const params = {
|
|
207
|
286
|
id: this.rowid ? this.rowid : '',
|
|
208
|
287
|
state:'1',
|
|
209
|
288
|
name: this.ruleForm.F_Name, //客户姓名
|
|
210
|
|
- phone: this.ruleForm.F_Phone, //固定电话
|
|
|
289
|
+ phone: this.ruleForm.F_Phone, //主号码
|
|
|
290
|
+ mobile: this.mobileData, //手机号码
|
|
|
291
|
+ F_RecommenderID: this.ruleForm.F_RecommenderID, //推荐人
|
|
211
|
292
|
recommender: this.ruleForm.F_Recommender, //推荐人
|
|
|
293
|
+ recommendertel: this.ruleForm.F_RecommenderTel, //推荐人手机号码
|
|
212
|
294
|
sex: this.ruleForm.F_Sex, //性别
|
|
213
|
295
|
age: this.ruleForm.F_Age, //年龄
|
|
214
|
296
|
label: this.ruleForm.F_Type, //会员类型
|
|
215
|
|
- mobile: this.ruleForm.F_Mobile, //手机号码
|
|
216
|
|
- mobile1: this.ruleForm.F_Mobile1, //手机号码1
|
|
217
|
297
|
address: this.ruleForm.F_Address, //详细地址
|
|
218
|
|
- address1: this.ruleForm.F_Address1, //备用地址
|
|
|
298
|
+ address1: this.ruleForm.F_Address1, //备用地址1
|
|
|
299
|
+ address2: this.ruleForm.F_Address2, //备用地址2
|
|
219
|
300
|
postcode: this.ruleForm.F_Postcode, //邮编
|
|
220
|
301
|
province: this.provinceCityText && this.provinceCityText[0], //省份
|
|
221
|
302
|
city: this.provinceCityText && this.provinceCityText[1], //市
|
|
222
|
303
|
area: this.provinceCityText && this.provinceCityText[2], //县
|
|
223
|
304
|
town: this.provinceCityText && this.provinceCityText[3], //乡
|
|
224
|
|
- province1: this.provinceCity && this.provinceCity[0], //省份
|
|
225
|
|
- city1: this.provinceCity && this.provinceCity[1], //市
|
|
226
|
|
- area1: this.provinceCity && this.provinceCity[2], //县
|
|
227
|
|
- town1: this.provinceCity && this.provinceCity[3], //乡
|
|
|
305
|
+ province1: this.provinceCityText1 && this.provinceCityText1[0], //省份
|
|
|
306
|
+ city1: this.provinceCityText1 && this.provinceCityText1[1], //市
|
|
|
307
|
+ area1: this.provinceCityText1 && this.provinceCityText1[2], //县
|
|
|
308
|
+ town1: this.provinceCityText1 && this.provinceCityText1[3], //乡
|
|
|
309
|
+ province2: this.provinceCityText2 && this.provinceCityText2[0], //省份
|
|
|
310
|
+ city2: this.provinceCityText2 && this.provinceCityText2[1], //市
|
|
|
311
|
+ area2: this.provinceCityText2 && this.provinceCityText2[2], //县
|
|
|
312
|
+ town2: this.provinceCityText2 && this.provinceCityText2[3], //乡
|
|
228
|
313
|
shoesize: this.ruleForm.F_ShoeSize, //鞋码
|
|
229
|
314
|
birthday: this.ruleForm.F_Birthday, //会员生日
|
|
230
|
315
|
score: this.ruleForm.F_Score, //会员积分
|
|
231
|
316
|
money: this.ruleForm.F_Money, //累计消费金额
|
|
232
|
|
- totalscore: this.ruleForm.F_TotalScore //累计积分
|
|
|
317
|
+ totalscore: this.ruleForm.F_TotalScore, //累计积分
|
|
233
|
318
|
};
|
|
234
|
319
|
// 添加
|
|
235
|
320
|
if (!this.rowid) {
|
|
|
@@ -272,40 +357,100 @@ export default {
|
|
272
|
357
|
this.$refs.ruleForm.resetFields();
|
|
273
|
358
|
this.provinceCityText = [];
|
|
274
|
359
|
this.provinceCity = [];
|
|
|
360
|
+ this.provinceCityText1 = [];
|
|
|
361
|
+ this.provinceCity1 = [];
|
|
|
362
|
+ this.provinceCityText2 = [];
|
|
|
363
|
+ this.provinceCity2 = [];
|
|
275
|
364
|
this.placeholderArea='请选择地区';
|
|
276
|
365
|
this.isPlaceholderAreaClass=false
|
|
277
|
366
|
},
|
|
278
|
367
|
// 详情
|
|
279
|
368
|
getDetail(rid) {
|
|
280
|
369
|
getMemberInfo(rid).then(response => {
|
|
281
|
|
- if (response.state.toLowerCase() === "success") {
|
|
282
|
|
- this.ruleForm = response.data;
|
|
283
|
|
- this.ruleForm.F_Type = response.data.F_Label
|
|
284
|
|
- if(response.data.F_Province){
|
|
285
|
|
- if(response.data.F_City){
|
|
286
|
|
- this.placeholderArea = response.data.F_Province+'/'
|
|
287
|
|
- }else{
|
|
288
|
|
- this.placeholderArea = response.data.F_Province
|
|
289
|
|
- }
|
|
290
|
|
- if(response.data.F_City && response.data.F_Area){
|
|
291
|
|
- this.placeholderArea += response.data.F_City+'/'
|
|
292
|
|
- }else{
|
|
293
|
|
- this.placeholderArea += response.data.F_City
|
|
294
|
|
- }
|
|
295
|
|
- if(response.data.F_Area && response.data.F_Town){
|
|
296
|
|
- this.placeholderArea += response.data.F_Area+'/'
|
|
297
|
|
- }else{
|
|
298
|
|
- this.placeholderArea += response.data.F_Area
|
|
299
|
|
- }
|
|
300
|
|
- if(response.data.F_Town){
|
|
301
|
|
- this.placeholderArea += response.data.F_Town
|
|
302
|
|
- }
|
|
303
|
|
- this.provinceCityText=this.placeholderArea.split('/')
|
|
|
370
|
+ const res = response.model
|
|
|
371
|
+ this.ruleForm = response.model;
|
|
|
372
|
+ this.ruleForm.F_Type = res.F_Label
|
|
|
373
|
+ this.ruleForm.F_RecommenderID = res.F_RecommenderID + ''
|
|
|
374
|
+ this.recommendNameRemind = res.F_Recommender
|
|
|
375
|
+ this.ruleForm.F_Recommender = res.F_Recommender
|
|
|
376
|
+ this.ruleForm.F_RecommenderTel = res.F_RecommenderTel
|
|
|
377
|
+ for (let i = 0; i < res.F_Mobile.split(",").length; i++) {
|
|
|
378
|
+ let data = {
|
|
|
379
|
+ mobileNumber: res.F_Mobile.split(",")[i]
|
|
|
380
|
+ }
|
|
|
381
|
+ this.mobileTableData.push(data)
|
|
|
382
|
+ }
|
|
|
383
|
+ if(res.F_Province){
|
|
|
384
|
+ if(res.F_City){
|
|
|
385
|
+ this.placeholderArea = res.F_Province+'/'
|
|
304
|
386
|
}else{
|
|
305
|
|
- this.placeholderArea='请选择地区';
|
|
306
|
|
- this.isPlaceholderAreaClass=false
|
|
|
387
|
+ this.placeholderArea = res.F_Province
|
|
307
|
388
|
}
|
|
308
|
|
-
|
|
|
389
|
+ if(res.F_City && res.F_Area){
|
|
|
390
|
+ this.placeholderArea += res.F_City+'/'
|
|
|
391
|
+ }else{
|
|
|
392
|
+ this.placeholderArea += res.F_City
|
|
|
393
|
+ }
|
|
|
394
|
+ if(res.F_Area && res.F_Town){
|
|
|
395
|
+ this.placeholderArea += res.F_Area+'/'
|
|
|
396
|
+ }else{
|
|
|
397
|
+ this.placeholderArea += res.F_Area
|
|
|
398
|
+ }
|
|
|
399
|
+ if(res.F_Town){
|
|
|
400
|
+ this.placeholderArea += res.F_Town
|
|
|
401
|
+ }
|
|
|
402
|
+ this.provinceCityText = this.placeholderArea.split('/')
|
|
|
403
|
+ } else {
|
|
|
404
|
+ this.placeholderArea = '请选择地区';
|
|
|
405
|
+ this.isPlaceholderAreaClass=false
|
|
|
406
|
+ }
|
|
|
407
|
+ if(res.F_Province1){
|
|
|
408
|
+ if(res.F_City1){
|
|
|
409
|
+ this.placeholderArea1 = res.F_Province1+'/'
|
|
|
410
|
+ }else{
|
|
|
411
|
+ this.placeholderArea1 = res.F_Province1
|
|
|
412
|
+ }
|
|
|
413
|
+ if(res.F_City1 && res.F_Area1){
|
|
|
414
|
+ this.placeholderArea1 += res.F_City1+'/'
|
|
|
415
|
+ }else{
|
|
|
416
|
+ this.placeholderArea1 += res.F_City1
|
|
|
417
|
+ }
|
|
|
418
|
+ if(res.F_Area1 && res.F_Town1){
|
|
|
419
|
+ this.placeholderArea1 += res.F_Area1+'/'
|
|
|
420
|
+ }else{
|
|
|
421
|
+ this.placeholderArea1 += res.F_Area1
|
|
|
422
|
+ }
|
|
|
423
|
+ if(res.F_Town1){
|
|
|
424
|
+ this.placeholderArea1 += res.F_Town1
|
|
|
425
|
+ }
|
|
|
426
|
+ this.provinceCityText1 = this.placeholderArea1.split('/')
|
|
|
427
|
+ } else {
|
|
|
428
|
+ this.placeholderArea1 = '请选择备用地区1';
|
|
|
429
|
+ this.isPlaceholderAreaClass = false
|
|
|
430
|
+ }
|
|
|
431
|
+ if(res.F_Province2){
|
|
|
432
|
+ if(res.F_City2){
|
|
|
433
|
+ this.placeholderArea2 = res.F_Province2+'/'
|
|
|
434
|
+ }else{
|
|
|
435
|
+ this.placeholderArea2 = res.F_Province2
|
|
|
436
|
+ }
|
|
|
437
|
+ if(res.F_City2 && res.F_Area2){
|
|
|
438
|
+ this.placeholderArea2 += res.F_City2+'/'
|
|
|
439
|
+ }else{
|
|
|
440
|
+ this.placeholderArea2 += res.F_City2
|
|
|
441
|
+ }
|
|
|
442
|
+ if(res.F_Area2 && res.F_Town2){
|
|
|
443
|
+ this.placeholderArea2 += res.F_Area2+'/'
|
|
|
444
|
+ }else{
|
|
|
445
|
+ this.placeholderArea2 += res.F_Area2
|
|
|
446
|
+ }
|
|
|
447
|
+ if(res.F_Town2){
|
|
|
448
|
+ this.placeholderArea2 += res.F_Town2
|
|
|
449
|
+ }
|
|
|
450
|
+ this.provinceCityText2 = this.placeholderArea2.split('/')
|
|
|
451
|
+ } else {
|
|
|
452
|
+ this.placeholderArea2 = '请选择备用地区2';
|
|
|
453
|
+ this.isPlaceholderAreaClass=false
|
|
309
|
454
|
}
|
|
310
|
455
|
});
|
|
311
|
456
|
},
|
|
|
@@ -323,11 +468,79 @@ export default {
|
|
323
|
468
|
})
|
|
324
|
469
|
})
|
|
325
|
470
|
},
|
|
|
471
|
+ addMobile() {
|
|
|
472
|
+ if (this.ruleForm.backupMobile.length !== 11){
|
|
|
473
|
+ this.$message({
|
|
|
474
|
+ message: '号码为11位!',
|
|
|
475
|
+ type: 'warning'
|
|
|
476
|
+ })
|
|
|
477
|
+ return
|
|
|
478
|
+ }
|
|
|
479
|
+ let data = {
|
|
|
480
|
+ mobileNumber: this.ruleForm.backupMobile
|
|
|
481
|
+ }
|
|
|
482
|
+ this.mobileTableData.push(data)
|
|
|
483
|
+ },
|
|
|
484
|
+ btn_deleteMobile (val) {
|
|
|
485
|
+ let index = this.mobileTableData.indexOf(val)
|
|
|
486
|
+ this.mobileTableData.splice(index, 1)
|
|
|
487
|
+ },
|
|
|
488
|
+ //获取推荐人列表
|
|
|
489
|
+ getRecommendList() {
|
|
|
490
|
+ this.loading = true
|
|
|
491
|
+ return new Promise(resolve => {
|
|
|
492
|
+ const params = {
|
|
|
493
|
+ pageindex: '', // int 第几页
|
|
|
494
|
+ pagesize: '', // int 每页几条信息
|
|
|
495
|
+ name: '', //客户姓名
|
|
|
496
|
+ phone: '', //手机号码
|
|
|
497
|
+ type: '', //会员类型
|
|
|
498
|
+ province: '', //省份
|
|
|
499
|
+ city: '', //市
|
|
|
500
|
+ area: '', //县区
|
|
|
501
|
+ town: '', //乡镇
|
|
|
502
|
+ address: '', //详细地址
|
|
|
503
|
+ birthday: '', //会员生日
|
|
|
504
|
+ recommender: '', //推荐人
|
|
|
505
|
+ saleperson: '', //销售负责人
|
|
|
506
|
+ contact: '', //联系频次
|
|
|
507
|
+ }
|
|
|
508
|
+ getOrderLists(params).then(response => {
|
|
|
509
|
+ this.loading = false
|
|
|
510
|
+ if (response.state.toLowerCase() === 'success') {
|
|
|
511
|
+ this.recommendList = response.rows.Rows
|
|
|
512
|
+ }
|
|
|
513
|
+ })
|
|
|
514
|
+ resolve()
|
|
|
515
|
+ })
|
|
|
516
|
+ },
|
|
|
517
|
+ //获取推荐人
|
|
|
518
|
+ remoteMethodRecommend(query) {
|
|
|
519
|
+ if (query !== '') {
|
|
|
520
|
+ this.loading = true;
|
|
|
521
|
+ setTimeout(() => {
|
|
|
522
|
+ this.loading = false;
|
|
|
523
|
+ this.recommendListOptions = this.recommendList.filter(item => {
|
|
|
524
|
+ return (item.F_Phone).toLowerCase()
|
|
|
525
|
+ .indexOf(query.toLowerCase()) > -1;
|
|
|
526
|
+ });
|
|
|
527
|
+ }, 200);
|
|
|
528
|
+ } else {
|
|
|
529
|
+ this.recommendListOptions = [];
|
|
|
530
|
+ }
|
|
|
531
|
+ },
|
|
|
532
|
+ recommendChangeSelect(item) {
|
|
|
533
|
+ this.ruleForm.F_RecommenderID = item.F_ID
|
|
|
534
|
+ this.ruleForm.F_Recommender = item.F_Name
|
|
|
535
|
+ this.ruleForm.F_RecommenderTel = item.F_Phone
|
|
|
536
|
+ },
|
|
326
|
537
|
// 获取省市下拉数据
|
|
327
|
538
|
getProCity() {
|
|
328
|
539
|
getProviceCityById(this.addressParams)
|
|
329
|
540
|
.then(res => {
|
|
330
|
541
|
this.provinceCityDatas = this.handleData(res.data);
|
|
|
542
|
+ this.provinceCityDatas1 = this.handleData1(res.data);
|
|
|
543
|
+ this.provinceCityDatas2 = this.handleData2(res.data);
|
|
331
|
544
|
})
|
|
332
|
545
|
.catch(err => {});
|
|
333
|
546
|
},
|
|
|
@@ -341,6 +554,26 @@ export default {
|
|
341
|
554
|
this.level
|
|
342
|
555
|
);
|
|
343
|
556
|
},
|
|
|
557
|
+ handleItemChange1(val) {
|
|
|
558
|
+ this.provinceCityText1=this.$refs['myCascader1'].currentLabels
|
|
|
559
|
+ let pid = val ? val[val.length - 1] : 1; //id值
|
|
|
560
|
+ this.level = val.length + 1; //判断第几级
|
|
|
561
|
+ this.provinceCityDatas1 = this.handleData1(
|
|
|
562
|
+ this.provinceCityDatas1,
|
|
|
563
|
+ pid,
|
|
|
564
|
+ this.level
|
|
|
565
|
+ );
|
|
|
566
|
+ },
|
|
|
567
|
+ handleItemChange2(val) {
|
|
|
568
|
+ this.provinceCityText2=this.$refs['myCascader2'].currentLabels
|
|
|
569
|
+ let pid = val ? val[val.length - 1] : 1; //id值
|
|
|
570
|
+ this.level = val.length + 1; //判断第几级
|
|
|
571
|
+ this.provinceCityDatas2 = this.handleData2(
|
|
|
572
|
+ this.provinceCityDatas2,
|
|
|
573
|
+ pid,
|
|
|
574
|
+ this.level
|
|
|
575
|
+ );
|
|
|
576
|
+ },
|
|
344
|
577
|
handleData(data, val, level) {
|
|
345
|
578
|
for (let i = 0; i < data.length; i++) {
|
|
346
|
579
|
if (!data[i].children) {
|
|
|
@@ -367,7 +600,62 @@ export default {
|
|
367
|
600
|
}
|
|
368
|
601
|
}
|
|
369
|
602
|
}
|
|
370
|
|
-
|
|
|
603
|
+ return data;
|
|
|
604
|
+ },
|
|
|
605
|
+ handleData1(data, val, level) {
|
|
|
606
|
+ for (let i = 0; i < data.length; i++) {
|
|
|
607
|
+ if (!data[i].children) {
|
|
|
608
|
+ this.$set(data[i], "children", []);
|
|
|
609
|
+ }
|
|
|
610
|
+ if (data[i].id === val) {
|
|
|
611
|
+ getProviceCityById({ pid: val })
|
|
|
612
|
+ .then(res => {
|
|
|
613
|
+ if (res.data.length) {
|
|
|
614
|
+ data[i].children = res.data;
|
|
|
615
|
+ if(this.level!==4){
|
|
|
616
|
+ data[i].children.forEach(ele => {
|
|
|
617
|
+ this.$set(ele, "children", []);
|
|
|
618
|
+ });
|
|
|
619
|
+ }
|
|
|
620
|
+ } else {
|
|
|
621
|
+ data[i].children = undefined;
|
|
|
622
|
+ }
|
|
|
623
|
+ })
|
|
|
624
|
+ .catch(err => {});
|
|
|
625
|
+ } else {
|
|
|
626
|
+ if (data[i].children.length) {
|
|
|
627
|
+ this.handleData1(data[i].children, val,level);
|
|
|
628
|
+ }
|
|
|
629
|
+ }
|
|
|
630
|
+ }
|
|
|
631
|
+ return data;
|
|
|
632
|
+ },
|
|
|
633
|
+ handleData2(data, val, level) {
|
|
|
634
|
+ for (let i = 0; i < data.length; i++) {
|
|
|
635
|
+ if (!data[i].children) {
|
|
|
636
|
+ this.$set(data[i], "children", []);
|
|
|
637
|
+ }
|
|
|
638
|
+ if (data[i].id === val) {
|
|
|
639
|
+ getProviceCityById({ pid: val })
|
|
|
640
|
+ .then(res => {
|
|
|
641
|
+ if (res.data.length) {
|
|
|
642
|
+ data[i].children = res.data;
|
|
|
643
|
+ if(this.level!==4){
|
|
|
644
|
+ data[i].children.forEach(ele => {
|
|
|
645
|
+ this.$set(ele, "children", []);
|
|
|
646
|
+ });
|
|
|
647
|
+ }
|
|
|
648
|
+ } else {
|
|
|
649
|
+ data[i].children = undefined;
|
|
|
650
|
+ }
|
|
|
651
|
+ })
|
|
|
652
|
+ .catch(err => {});
|
|
|
653
|
+ } else {
|
|
|
654
|
+ if (data[i].children.length) {
|
|
|
655
|
+ this.handleData2(data[i].children, val,level);
|
|
|
656
|
+ }
|
|
|
657
|
+ }
|
|
|
658
|
+ }
|
|
371
|
659
|
return data;
|
|
372
|
660
|
},
|
|
373
|
661
|
}
|