|
@@ -208,28 +208,28 @@
|
208
|
208
|
</template>
|
209
|
209
|
|
210
|
210
|
<script>
|
211
|
|
-import { getToken } from "@/api/qiniu";
|
|
211
|
+import { getToken } from '@/api/qiniu';
|
212
|
212
|
import {
|
213
|
213
|
GetOrgInfo,
|
214
|
214
|
SaveOrgGallery,
|
215
|
215
|
DeleteOrgGallery,
|
216
|
216
|
EditOrgInfo
|
217
|
|
-} from "@/api/org/orginfo";
|
218
|
|
-import { GetDistrictsByUpid } from "@/api/district";
|
219
|
|
-import { getFileExtension } from "@/utils/tools";
|
220
|
|
-import Neditor from "@/components/Neditor";
|
221
|
|
-import BreadCrumb from "@/scrm_pages/components/bread-crumb";
|
|
217
|
+} from '@/api/org/orginfo';
|
|
218
|
+import { GetDistrictsByUpid } from '@/api/district';
|
|
219
|
+import { getFileExtension } from '@/utils/tools';
|
|
220
|
+import Neditor from '@/components/Neditor';
|
|
221
|
+import BreadCrumb from '@/scrm_pages/components/bread-crumb';
|
222
|
222
|
export default {
|
223
|
|
- name: "orginfo",
|
|
223
|
+ name: 'orginfo',
|
224
|
224
|
data() {
|
225
|
225
|
return {
|
226
|
|
- crumbs: [{ path: false, name: "机构信息" }],
|
227
|
|
- qiniuDomain: "https://images.shengws.com/",
|
|
226
|
+ crumbs: [{ path: false, name: '机构信息' }],
|
|
227
|
+ qiniuDomain: 'https://images.shengws.com/',
|
228
|
228
|
formloading: false,
|
229
|
229
|
uploading: false,
|
230
|
230
|
guploading: false,
|
231
|
231
|
formsubmit: false,
|
232
|
|
- loadingText: "",
|
|
232
|
+ loadingText: '',
|
233
|
233
|
illnessList: [],
|
234
|
234
|
fileList: [],
|
235
|
235
|
provinces: [],
|
|
@@ -238,87 +238,87 @@ export default {
|
238
|
238
|
orgtypes: [],
|
239
|
239
|
orgtypesMap: {},
|
240
|
240
|
childtypes: [],
|
241
|
|
- uploadData: { token: "", key: "" },
|
|
241
|
+ uploadData: { token: '', key: '' },
|
242
|
242
|
operatingStateOptions: [
|
243
|
|
- { value: 1, label: "正常营业" },
|
244
|
|
- { value: 2, label: "暂未营业" }
|
|
243
|
+ { value: 1, label: '正常营业' },
|
|
244
|
+ { value: 2, label: '暂未营业' }
|
245
|
245
|
],
|
246
|
246
|
weekOptions: [
|
247
|
|
- "星期一",
|
248
|
|
- "星期二",
|
249
|
|
- "星期三",
|
250
|
|
- "星期四",
|
251
|
|
- "星期五",
|
252
|
|
- "星期六",
|
253
|
|
- "星期天"
|
|
247
|
+ '星期一',
|
|
248
|
+ '星期二',
|
|
249
|
+ '星期三',
|
|
250
|
+ '星期四',
|
|
251
|
+ '星期五',
|
|
252
|
+ '星期六',
|
|
253
|
+ '星期天'
|
254
|
254
|
],
|
255
|
255
|
shangOptions: [
|
256
|
|
- "1:00",
|
257
|
|
- "2:00",
|
258
|
|
- "3:00",
|
259
|
|
- "4:00",
|
260
|
|
- "5:00",
|
261
|
|
- "6:00",
|
262
|
|
- "7:00",
|
263
|
|
- "8:00",
|
264
|
|
- "9:00",
|
265
|
|
- "10:00",
|
266
|
|
- "11:00",
|
267
|
|
- "12:00"
|
|
256
|
+ '1:00',
|
|
257
|
+ '2:00',
|
|
258
|
+ '3:00',
|
|
259
|
+ '4:00',
|
|
260
|
+ '5:00',
|
|
261
|
+ '6:00',
|
|
262
|
+ '7:00',
|
|
263
|
+ '8:00',
|
|
264
|
+ '9:00',
|
|
265
|
+ '10:00',
|
|
266
|
+ '11:00',
|
|
267
|
+ '12:00'
|
268
|
268
|
],
|
269
|
269
|
xiaOptions: [
|
270
|
|
- "13:00",
|
271
|
|
- "14:00",
|
272
|
|
- "15:00",
|
273
|
|
- "16:00",
|
274
|
|
- "17:00",
|
275
|
|
- "18:00",
|
276
|
|
- "19:00",
|
277
|
|
- "20:00",
|
278
|
|
- "21:00",
|
279
|
|
- "22:00",
|
280
|
|
- "23:00",
|
281
|
|
- "24:00"
|
|
270
|
+ '13:00',
|
|
271
|
+ '14:00',
|
|
272
|
+ '15:00',
|
|
273
|
+ '16:00',
|
|
274
|
+ '17:00',
|
|
275
|
+ '18:00',
|
|
276
|
+ '19:00',
|
|
277
|
+ '20:00',
|
|
278
|
+ '21:00',
|
|
279
|
+ '22:00',
|
|
280
|
+ '23:00',
|
|
281
|
+ '24:00'
|
282
|
282
|
],
|
283
|
283
|
illnessOptions: [],
|
284
|
284
|
form: {
|
285
|
|
- org_name: "",
|
286
|
|
- contact_name: "",
|
287
|
|
- org_introduction: "",
|
288
|
|
- org_logo: "",
|
289
|
|
- province: "",
|
290
|
|
- city: "",
|
291
|
|
- district: "",
|
292
|
|
- address: "",
|
293
|
|
- parent_type: "",
|
294
|
|
- child_type: "",
|
295
|
|
- org_type: "",
|
296
|
|
- telephone: "",
|
297
|
|
- operating_state: "",
|
298
|
|
- business_week: "",
|
|
285
|
+ org_name: '',
|
|
286
|
+ contact_name: '',
|
|
287
|
+ org_introduction: '',
|
|
288
|
+ org_logo: '',
|
|
289
|
+ province: '',
|
|
290
|
+ city: '',
|
|
291
|
+ district: '',
|
|
292
|
+ address: '',
|
|
293
|
+ parent_type: '',
|
|
294
|
+ child_type: '',
|
|
295
|
+ org_type: '',
|
|
296
|
+ telephone: '',
|
|
297
|
+ operating_state: '',
|
|
298
|
+ business_week: '',
|
299
|
299
|
business_week_select: [],
|
300
|
|
- business_time_shange: "",
|
301
|
|
- business_time_xia: "",
|
302
|
|
- business_time: "",
|
303
|
|
- illness: "",
|
|
300
|
+ business_time_shange: '',
|
|
301
|
+ business_time_xia: '',
|
|
302
|
+ business_time: '',
|
|
303
|
+ illness: '',
|
304
|
304
|
illness_list: [],
|
305
|
305
|
org_gallery: []
|
306
|
306
|
},
|
307
|
307
|
myConfig: {
|
308
|
308
|
// 如果需要上传功能,找后端小伙伴要服务器接口地址
|
309
|
|
- serverUrl: "/api/web/upload/ueditor",
|
|
309
|
+ serverUrl: '/api/web/upload/ueditor',
|
310
|
310
|
// 你的UEditor资源存放的路径,相对于打包后的index.html
|
311
|
|
- UEDITOR_HOME_URL: "/NEditor/",
|
|
311
|
+ UEDITOR_HOME_URL: '/NEditor/',
|
312
|
312
|
// 编辑器不自动被内容撑高
|
313
|
313
|
autoHeightEnabled: false,
|
314
|
314
|
// 初始容器高度
|
315
|
315
|
initialFrameHeight: 240,
|
316
|
316
|
// 初始容器宽度
|
317
|
|
- initialFrameWidth: "100%",
|
|
317
|
+ initialFrameWidth: '100%',
|
318
|
318
|
// 关闭自动保存
|
319
|
319
|
enableAutoSave: false
|
320
|
320
|
}
|
321
|
|
- };
|
|
321
|
+ }
|
322
|
322
|
},
|
323
|
323
|
components: {
|
324
|
324
|
Neditor,
|
|
@@ -326,42 +326,42 @@ export default {
|
326
|
326
|
},
|
327
|
327
|
computed: {},
|
328
|
328
|
created() {
|
329
|
|
- this.formloading = true;
|
330
|
|
- this.loadingText = "加载中...";
|
331
|
|
- this.GetOrgInfo();
|
|
329
|
+ this.formloading = true
|
|
330
|
+ this.loadingText = '加载中...';
|
|
331
|
+ this.GetOrgInfo()
|
332
|
332
|
},
|
333
|
333
|
methods: {
|
334
|
334
|
handleChangeIllness(values) {
|
335
|
|
- this.form.illness = values.join(",");
|
|
335
|
+ this.form.illness = values.join(',')
|
336
|
336
|
},
|
337
|
337
|
handleChangeWeek(values) {
|
338
|
|
- var selectweek = [];
|
|
338
|
+ var selectweek = []
|
339
|
339
|
for (const index in values) {
|
340
|
340
|
var item = {
|
341
|
341
|
id: this.weekOptions.indexOf(values[index]),
|
342
|
342
|
name: values[index]
|
343
|
|
- };
|
344
|
|
- selectweek.push(item);
|
|
343
|
+ }
|
|
344
|
+ selectweek.push(item)
|
345
|
345
|
}
|
346
|
346
|
|
347
|
347
|
if (selectweek.length == 0) {
|
348
|
|
- this.form.business_week = "";
|
|
348
|
+ this.form.business_week = '';
|
349
|
349
|
} else if (selectweek.length == 1) {
|
350
|
|
- this.form.business_week = selectweek[0];
|
|
350
|
+ this.form.business_week = selectweek[0]
|
351
|
351
|
} else {
|
352
|
352
|
selectweek = selectweek.sort(function(a, b) {
|
353
|
|
- return a.id - b.id;
|
354
|
|
- });
|
355
|
|
- var blen = selectweek.length;
|
|
353
|
+ return a.id - b.id
|
|
354
|
+ })
|
|
355
|
+ var blen = selectweek.length
|
356
|
356
|
if (blen == selectweek[blen - 1].id - selectweek[0].id + 1) {
|
357
|
357
|
this.form.business_week =
|
358
|
|
- selectweek[0]["name"] + " — " + selectweek[blen - 1]["name"];
|
|
358
|
+ selectweek[0]['name'] + ' — ' + selectweek[blen - 1]['name']
|
359
|
359
|
} else {
|
360
|
|
- var tem = [];
|
|
360
|
+ var tem = []
|
361
|
361
|
for (const index in selectweek) {
|
362
|
|
- tem.push(selectweek[index].name);
|
|
362
|
+ tem.push(selectweek[index].name)
|
363
|
363
|
}
|
364
|
|
- this.form.business_week = tem.join("、");
|
|
364
|
+ this.form.business_week = tem.join('、')
|
365
|
365
|
}
|
366
|
366
|
}
|
367
|
367
|
},
|
|
@@ -371,177 +371,179 @@ export default {
|
371
|
371
|
this.form.business_time_xia.length > 0
|
372
|
372
|
) {
|
373
|
373
|
this.form.business_time =
|
374
|
|
- "上午" +
|
|
374
|
+ '上午' +
|
375
|
375
|
this.form.business_time_shange +
|
376
|
|
- "—下午" +
|
377
|
|
- this.form.business_time_xia;
|
|
376
|
+ '—下午' +
|
|
377
|
+ this.form.business_time_xia
|
378
|
378
|
} else if (this.form.business_time_shange.length > 0) {
|
379
|
|
- this.form.business_time = "上午" + this.form.business_time_shange;
|
|
379
|
+ this.form.business_time = '上午' + this.form.business_time_shange
|
380
|
380
|
} else if (this.form.business_time_xia.length > 0) {
|
381
|
|
- this.form.business_time = "下午" + this.form.business_time_xia;
|
|
381
|
+ this.form.business_time = '下午' + this.form.business_time_xia
|
382
|
382
|
} else {
|
383
|
|
- this.form.business_time = "";
|
|
383
|
+ this.form.business_time = '';
|
384
|
384
|
}
|
385
|
385
|
},
|
386
|
386
|
handleAvatarError(err, file, fileList) {
|
387
|
|
- this.$message.error(err);
|
388
|
|
- this.uploading = false;
|
389
|
|
- return false;
|
|
387
|
+ this.$message.error(err)
|
|
388
|
+ this.uploading = false
|
|
389
|
+ return false
|
390
|
390
|
},
|
391
|
391
|
handleAvatarSuccess(res, file) {
|
392
|
|
- this.form.org_logo = this.qiniuDomain + res.url;
|
393
|
|
- this.uploading = false;
|
|
392
|
+ this.form.org_logo = this.qiniuDomain + res.url
|
|
393
|
+ this.uploading = false
|
394
|
394
|
},
|
395
|
395
|
beforeAvatarUpload(file) {
|
396
|
|
- var fileType = file.type;
|
397
|
|
- const isJPG = fileType.indexOf("image") > -1;
|
398
|
|
- const isLt2M = file.size / 1024 / 1024 < 2;
|
|
396
|
+ var fileType = file.type
|
|
397
|
+ const isJPG = fileType.indexOf('image') > -1
|
|
398
|
+ const isLt2M = file.size / 1024 / 1024 < 2
|
399
|
399
|
|
400
|
400
|
if (!isJPG) {
|
401
|
|
- this.$message.error("只能上传图片");
|
402
|
|
- return false;
|
|
401
|
+ this.$message.error('只能上传图片')
|
|
402
|
+ return false
|
403
|
403
|
}
|
404
|
404
|
if (!isLt2M) {
|
405
|
|
- this.$message.error("上传头像图片大小不能超过 2MB!");
|
406
|
|
- return false;
|
|
405
|
+ this.$message.error('上传头像图片大小不能超过 2MB!')
|
|
406
|
+ return false
|
407
|
407
|
}
|
408
|
408
|
|
409
|
|
- var date = new Date();
|
410
|
|
- var ext = getFileExtension(file.name);
|
|
409
|
+ var date = new Date()
|
|
410
|
+ var ext = getFileExtension(file.name)
|
411
|
411
|
var key =
|
412
|
|
- "" +
|
|
412
|
+ '' +
|
413
|
413
|
date.getFullYear() +
|
414
|
414
|
(date.getMonth() + 1) +
|
415
|
415
|
date.getDate() +
|
416
|
416
|
date.getHours() +
|
417
|
417
|
date.getMinutes() +
|
418
|
418
|
date.getSeconds() +
|
419
|
|
- "_o_" +
|
|
419
|
+ '_o_' +
|
420
|
420
|
file.uid +
|
421
|
|
- "." +
|
422
|
|
- ext;
|
423
|
|
- this.uploading = true;
|
424
|
|
- this.loadingText = "机构头像上传中";
|
|
421
|
+ '.' +
|
|
422
|
+ ext
|
|
423
|
+ this.uploading = true
|
|
424
|
+ this.loadingText = '机构头像上传中';
|
425
|
425
|
|
426
|
|
- const _self = this;
|
|
426
|
+ const _self = this
|
427
|
427
|
return new Promise((resolve, reject) => {
|
428
|
428
|
getToken()
|
429
|
429
|
.then(response => {
|
430
|
|
- const token = response.data.data.uptoken;
|
431
|
|
- _self._data.uploadData.token = token;
|
432
|
|
- _self._data.uploadData.key = key;
|
433
|
|
- resolve(true);
|
|
430
|
+ const token = response.data.data.uptoken
|
|
431
|
+ _self._data.uploadData.token = token
|
|
432
|
+ _self._data.uploadData.key = key
|
|
433
|
+ resolve(true)
|
434
|
434
|
})
|
435
|
435
|
.catch(err => {
|
436
|
|
- reject(false);
|
437
|
|
- this.uploading = false;
|
438
|
|
- });
|
439
|
|
- });
|
|
436
|
+ reject(false)
|
|
437
|
+ this.uploading = false
|
|
438
|
+ })
|
|
439
|
+ })
|
440
|
440
|
},
|
441
|
441
|
handleGalleryError(err, file, fileList) {
|
442
|
|
- this.$message.error(err);
|
443
|
|
- this.guploading = false;
|
444
|
|
- return false;
|
|
442
|
+ this.$message.error(err)
|
|
443
|
+ this.guploading = false
|
|
444
|
+ return false
|
445
|
445
|
},
|
446
|
446
|
handleGallerySuccess(res, file) {
|
447
|
|
- var data = { type: 1, url: this.qiniuDomain + res.url };
|
|
447
|
+ var data = { type: 1, url: this.qiniuDomain + res.url }
|
448
|
448
|
SaveOrgGallery(data)
|
449
|
449
|
.then(response => {
|
450
|
|
- var res = response.data;
|
|
450
|
+ var res = response.data
|
451
|
451
|
if (res.state == 1) {
|
452
|
|
- this.$message.success("上传成功");
|
|
452
|
+ this.$message.success('上传成功')
|
453
|
453
|
} else {
|
454
|
|
- this.$message.error("上传失败");
|
|
454
|
+ this.$message.error('上传失败')
|
455
|
455
|
}
|
456
|
456
|
})
|
457
|
|
- .catch(e => {});
|
458
|
|
- this.guploading = false;
|
|
457
|
+ .catch(e => {})
|
|
458
|
+ this.guploading = false
|
459
|
459
|
},
|
460
|
460
|
beforeGalleryUpload(file) {
|
461
|
|
- var fileType = file.type;
|
462
|
|
- const isJPG = fileType.indexOf("image") > -1;
|
463
|
|
- const isLt100M = file.size / 1024 / 1024 < 100;
|
|
461
|
+ var fileType = file.type
|
|
462
|
+ const isJPG = fileType.indexOf('image') > -1
|
|
463
|
+ const isLt100M = file.size / 1024 / 1024 < 100
|
464
|
464
|
|
465
|
465
|
if (!isJPG) {
|
466
|
|
- this.$message.error("只能上传图片");
|
467
|
|
- return false;
|
|
466
|
+ this.$message.error('只能上传图片')
|
|
467
|
+ return false
|
468
|
468
|
}
|
469
|
469
|
if (!isLt100M) {
|
470
|
|
- this.$message.error("上传图片大小不能超过 100MB!");
|
471
|
|
- return false;
|
|
470
|
+ this.$message.error('上传图片大小不能超过 100MB!')
|
|
471
|
+ return false
|
472
|
472
|
}
|
473
|
473
|
|
474
|
|
- var date = new Date();
|
475
|
|
- var ext = getFileExtension(file.name);
|
|
474
|
+ var date = new Date()
|
|
475
|
+ var ext = getFileExtension(file.name)
|
476
|
476
|
var key =
|
477
|
|
- "" +
|
|
477
|
+ '' +
|
478
|
478
|
date.getFullYear() +
|
479
|
479
|
(date.getMonth() + 1) +
|
480
|
480
|
date.getDate() +
|
481
|
481
|
date.getHours() +
|
482
|
482
|
date.getMinutes() +
|
483
|
483
|
date.getSeconds() +
|
484
|
|
- "_g_" +
|
|
484
|
+ '_g_' +
|
485
|
485
|
file.uid +
|
486
|
|
- "." +
|
487
|
|
- ext;
|
488
|
|
- this.guploading = true;
|
489
|
|
- this.loadingText = "机构图册上传中";
|
|
486
|
+ '.' +
|
|
487
|
+ ext
|
|
488
|
+ this.guploading = true
|
|
489
|
+ this.loadingText = '机构图册上传中';
|
490
|
490
|
|
491
|
|
- const _self = this;
|
|
491
|
+ const _self = this
|
492
|
492
|
return new Promise((resolve, reject) => {
|
493
|
493
|
getToken()
|
494
|
494
|
.then(response => {
|
495
|
|
- const token = response.data.data.uptoken;
|
496
|
|
- _self._data.uploadData.token = token;
|
497
|
|
- _self._data.uploadData.key = key;
|
498
|
|
- resolve(true);
|
|
495
|
+ const token = response.data.data.uptoken
|
|
496
|
+ _self._data.uploadData.token = token
|
|
497
|
+ _self._data.uploadData.key = key
|
|
498
|
+ resolve(true)
|
499
|
499
|
})
|
500
|
500
|
.catch(err => {
|
501
|
|
- reject(false);
|
502
|
|
- this.guploading = false;
|
503
|
|
- });
|
504
|
|
- });
|
|
501
|
+ reject(false)
|
|
502
|
+ this.guploading = false
|
|
503
|
+ })
|
|
504
|
+ })
|
505
|
505
|
},
|
506
|
506
|
|
507
|
507
|
handleRemove(file, fileList) {
|
508
|
508
|
DeleteOrgGallery(file.id)
|
509
|
509
|
.then(response => {
|
510
|
|
- var res = response.data;
|
|
510
|
+ var res = response.data
|
511
|
511
|
if (res.state == 1) {
|
512
|
|
- this.$message.success("删除成功");
|
|
512
|
+ this.$message.success('删除成功')
|
513
|
513
|
} else {
|
514
|
|
- this.$message.error("删除失败");
|
|
514
|
+ this.$message.error('删除失败')
|
515
|
515
|
}
|
516
|
516
|
})
|
517
|
|
- .catch(e => {});
|
518
|
|
- console.log("handleRemove", file, fileList);
|
|
517
|
+ .catch(e => {})
|
|
518
|
+ console.log('handleRemove', file, fileList)
|
519
|
519
|
},
|
520
|
520
|
GetOrgInfo() {
|
521
|
521
|
GetOrgInfo()
|
522
|
522
|
.then(response => {
|
523
|
|
- var res = response.data;
|
|
523
|
+ var res = response.data
|
|
524
|
+ console.log('res是什么', res)
|
524
|
525
|
if (res.state === 1) {
|
525
|
|
- this.form.org_name = res.data.orginfo.org_name;
|
526
|
|
- this.form.contact_name = res.data.orginfo.contact_name;
|
527
|
|
- this.form.org_introduction = res.data.orginfo.org_introduction;
|
528
|
|
- this.form.org_logo = res.data.orginfo.org_logo;
|
529
|
|
- this.form.province = res.data.orginfo.province;
|
530
|
|
- this.form.city = res.data.orginfo.city;
|
531
|
|
- this.form.district = res.data.orginfo.district;
|
532
|
|
- this.form.address = res.data.orginfo.address;
|
533
|
|
- this.form.org_type = res.data.orginfo.org_type;
|
534
|
|
- this.form.telephone = res.data.orginfo.telephone;
|
535
|
|
- this.form.operating_state = res.data.orginfo.operating_state;
|
536
|
|
- this.form.business_week = res.data.orginfo.business_week;
|
537
|
|
- this.form.business_week_select = [];
|
538
|
|
- this.form.business_time = res.data.orginfo.business_time;
|
539
|
|
- this.form.business_time_shange = "";
|
540
|
|
- this.form.business_time_xia = "";
|
541
|
|
- this.form.illness = res.data.orginfo.illness;
|
542
|
|
- this.form.illness_list = [];
|
543
|
|
- this.form.org_gallery = res.data.orginfo.org_gallery;
|
544
|
|
- this.fileList = [];
|
|
526
|
+ this.form.org_name = res.data.orginfo.org_name
|
|
527
|
+ this.form.contact_name = res.data.orginfo.contact_name
|
|
528
|
+ this.form.org_introduction = res.data.orginfo.org_introduction
|
|
529
|
+ this.form.org_logo = res.data.orginfo.org_logo
|
|
530
|
+ this.form.province = res.data.orginfo.province
|
|
531
|
+ this.form.city = res.data.orginfo.city
|
|
532
|
+ this.form.district = res.data.orginfo.district
|
|
533
|
+ this.form.address = res.data.orginfo.address
|
|
534
|
+ this.form.org_type = res.data.orginfo.org_type
|
|
535
|
+ console.log('机构类型', res.data.orginfo.org_type)
|
|
536
|
+ this.form.telephone = res.data.orginfo.telephone
|
|
537
|
+ this.form.operating_state = res.data.orginfo.operating_state
|
|
538
|
+ this.form.business_week = res.data.orginfo.business_week
|
|
539
|
+ this.form.business_week_select = []
|
|
540
|
+ this.form.business_time = res.data.orginfo.business_time
|
|
541
|
+ this.form.business_time_shange = '';
|
|
542
|
+ this.form.business_time_xia = '';
|
|
543
|
+ this.form.illness = res.data.orginfo.illness
|
|
544
|
+ this.form.illness_list = []
|
|
545
|
+ this.form.org_gallery = res.data.orginfo.org_gallery
|
|
546
|
+ this.fileList = []
|
545
|
547
|
for (const index in this.form.org_gallery) {
|
546
|
548
|
var image = {
|
547
|
549
|
id: this.form.org_gallery[index].id,
|
|
@@ -550,180 +552,183 @@ export default {
|
550
|
552
|
this.form.org_gallery[index].type == 1
|
551
|
553
|
? this.form.org_gallery[index].url
|
552
|
554
|
: this.form.org_gallery[index].url +
|
553
|
|
- "?vframe/jpg/offset/0/w/100/h/100"
|
554
|
|
- };
|
555
|
|
- this.fileList.push(image);
|
|
555
|
+ '?vframe/jpg/offset/0/w/100/h/100'
|
|
556
|
+ }
|
|
557
|
+ this.fileList.push(image)
|
556
|
558
|
}
|
557
|
559
|
|
558
|
|
- var illness = res.data.orginfo.illness.split(",");
|
|
560
|
+ var illness = res.data.orginfo.illness.split(',')
|
559
|
561
|
for (const index in illness) {
|
560
|
|
- var iid = parseInt(illness[index]);
|
|
562
|
+ var iid = parseInt(illness[index])
|
561
|
563
|
if (isNaN(iid) || iid <= 0) {
|
562
|
|
- continue;
|
|
564
|
+ continue
|
563
|
565
|
}
|
564
|
|
- this.form.illness_list.push(iid);
|
|
566
|
+ this.form.illness_list.push(iid)
|
565
|
567
|
}
|
566
|
|
- var business_week = this.form.business_week;
|
567
|
|
- var business_week_tem = business_week.split(" — ");
|
|
568
|
+ var business_week = this.form.business_week
|
|
569
|
+ var business_week_tem = business_week.split(' — ')
|
568
|
570
|
if (business_week_tem.length == 2) {
|
569
|
|
- var fromIndex = this.weekOptions.indexOf(business_week_tem[0]);
|
570
|
|
- var toIndex = this.weekOptions.indexOf(business_week_tem[1]);
|
|
571
|
+ var fromIndex = this.weekOptions.indexOf(business_week_tem[0])
|
|
572
|
+ var toIndex = this.weekOptions.indexOf(business_week_tem[1])
|
571
|
573
|
if (fromIndex >= 0 && toIndex >= 0) {
|
572
|
574
|
for (const index in this.weekOptions) {
|
573
|
575
|
if (index >= fromIndex && index <= toIndex) {
|
574
|
576
|
this.form.business_week_select.push(
|
575
|
577
|
this.weekOptions[index]
|
576
|
|
- );
|
|
578
|
+ )
|
577
|
579
|
}
|
578
|
580
|
}
|
579
|
581
|
}
|
580
|
582
|
} else {
|
581
|
|
- business_week_tem = business_week.split("、");
|
|
583
|
+ business_week_tem = business_week.split('、')
|
582
|
584
|
for (const index in business_week_tem) {
|
583
|
585
|
if (business_week_tem[index].length > 0) {
|
584
|
|
- this.form.business_week_select.push(business_week_tem[index]);
|
|
586
|
+ this.form.business_week_select.push(business_week_tem[index])
|
585
|
587
|
}
|
586
|
588
|
}
|
587
|
589
|
}
|
588
|
|
- var business_time = this.form.business_time;
|
589
|
|
- var business_time_tem = business_time.split("—");
|
|
590
|
+ var business_time = this.form.business_time
|
|
591
|
+ var business_time_tem = business_time.split('—')
|
|
592
|
+ // eslint-disable-next-line eqeqeq
|
590
|
593
|
if (business_time_tem.length == 2) {
|
591
|
594
|
this.form.business_time_shange = business_time_tem[0].substring(
|
592
|
595
|
2
|
593
|
|
- );
|
594
|
|
- this.form.business_time_xia = business_time_tem[1].substring(2);
|
|
596
|
+ )
|
|
597
|
+ this.form.business_time_xia = business_time_tem[1].substring(2)
|
595
|
598
|
} else {
|
596
|
|
- var selectTime = business_time_tem[0].substring(2);
|
|
599
|
+ var selectTime = business_time_tem[0].substring(2)
|
597
|
600
|
if (this.shangOptions.indexOf(selectTime) > -1) {
|
598
|
|
- this.form.business_time_shange = selectTime;
|
|
601
|
+ this.form.business_time_shange = selectTime
|
599
|
602
|
} else if (this.xiaOptions.indexOf(selectTime) > -1) {
|
600
|
|
- this.form.business_time_xia = selectTime;
|
|
603
|
+ this.form.business_time_xia = selectTime
|
601
|
604
|
}
|
602
|
605
|
}
|
603
|
606
|
|
604
|
|
- this.provinces = res.data.provinces;
|
605
|
|
- this.citys = res.data.citys ? res.data.citys : [];
|
606
|
|
- this.districts = res.data.districts ? res.data.districts : [];
|
|
607
|
+ this.provinces = res.data.provinces
|
|
608
|
+ console.log('省', res.data.provinces)
|
|
609
|
+ this.citys = res.data.citys ? res.data.citys : []
|
|
610
|
+ this.districts = res.data.districts ? res.data.districts : []
|
607
|
611
|
|
608
|
612
|
this.orgtypes = [];
|
609
|
|
- (this.orgtypesMap = {}), (this.childtypes = []);
|
610
|
|
- var orgtypes = res.data.orgtypes;
|
|
613
|
+ (this.orgtypesMap = {}), (this.childtypes = [])
|
|
614
|
+ var orgtypes = res.data.orgtypes
|
|
615
|
+ console.log('orgtypes', orgtypes)
|
611
|
616
|
for (const index in orgtypes) {
|
612
|
617
|
if (orgtypes[index].pid > 0) {
|
613
|
618
|
if (!(orgtypes[index].pid in this.orgtypesMap)) {
|
614
|
|
- this.orgtypesMap[orgtypes[index].pid] = [];
|
|
619
|
+ this.orgtypesMap[orgtypes[index].pid] = []
|
615
|
620
|
}
|
616
|
|
- this.orgtypesMap[orgtypes[index].pid].push(orgtypes[index]);
|
|
621
|
+ this.orgtypesMap[orgtypes[index].pid].push(orgtypes[index])
|
617
|
622
|
if (orgtypes[index].id == this.form.org_type) {
|
618
|
|
- this.form.child_type = orgtypes[index].id;
|
619
|
|
- this.form.parent_type = orgtypes[index].pid;
|
|
623
|
+ this.form.child_type = orgtypes[index].id
|
|
624
|
+ this.form.parent_type = orgtypes[index].pid
|
620
|
625
|
}
|
621
|
626
|
} else {
|
622
|
|
- this.orgtypes.push(orgtypes[index]);
|
|
627
|
+ this.orgtypes.push(orgtypes[index])
|
623
|
628
|
if (orgtypes[index].id == this.form.org_type) {
|
624
|
|
- this.form.parent_type = orgtypes[index].id;
|
|
629
|
+ this.form.parent_type = orgtypes[index].id
|
625
|
630
|
}
|
626
|
631
|
}
|
627
|
632
|
}
|
628
|
633
|
if (this.form.parent_type in this.orgtypesMap) {
|
629
|
|
- this.childtypes = this.orgtypesMap[this.form.parent_type];
|
|
634
|
+ this.childtypes = this.orgtypesMap[this.form.parent_type]
|
630
|
635
|
} else {
|
631
|
|
- this.childtypes = [];
|
|
636
|
+ this.childtypes = []
|
632
|
637
|
}
|
633
|
|
- this.illnessOptions = res.data.illness ? res.data.illness : [];
|
634
|
|
- this.formloading = false;
|
|
638
|
+ this.illnessOptions = res.data.illness ? res.data.illness : []
|
|
639
|
+ this.formloading = false
|
635
|
640
|
} else {
|
636
|
|
- this.$message.error(resp.msg);
|
|
641
|
+ this.$message.error(resp.msg)
|
637
|
642
|
}
|
638
|
643
|
})
|
639
|
|
- .catch(e => {});
|
|
644
|
+ .catch(e => {})
|
640
|
645
|
},
|
641
|
646
|
myTrim(x) {
|
642
|
|
- return x.replace(/^\s+|\s+$/gm, "");
|
|
647
|
+ return x.replace(/^\s+|\s+$/gm, '')
|
643
|
648
|
},
|
644
|
649
|
changeProvince(id) {
|
645
|
|
- this.citys = [];
|
646
|
|
- this.districts = [];
|
647
|
|
- this.form.city = "";
|
648
|
|
- this.form.district = "";
|
649
|
|
- var upid = parseInt(id);
|
|
650
|
+ this.citys = []
|
|
651
|
+ this.districts = []
|
|
652
|
+ this.form.city = '';
|
|
653
|
+ this.form.district = '';
|
|
654
|
+ var upid = parseInt(id)
|
650
|
655
|
if (isNaN(upid) || upid <= 0) {
|
651
|
|
- return false;
|
|
656
|
+ return false
|
652
|
657
|
}
|
653
|
658
|
GetDistrictsByUpid({ id: upid })
|
654
|
659
|
.then(response => {
|
655
|
|
- var res = response.data;
|
|
660
|
+ var res = response.data
|
656
|
661
|
if (res.state === 1) {
|
657
|
|
- this.citys = res.data.citys ? res.data.citys : [];
|
|
662
|
+ this.citys = res.data.citys ? res.data.citys : []
|
658
|
663
|
}
|
659
|
664
|
})
|
660
|
|
- .catch(e => {});
|
|
665
|
+ .catch(e => {})
|
661
|
666
|
},
|
662
|
667
|
changeCity(id) {
|
663
|
|
- this.districts = [];
|
664
|
|
- this.form.district = "";
|
665
|
|
- var upid = parseInt(id);
|
|
668
|
+ this.districts = []
|
|
669
|
+ this.form.district = '';
|
|
670
|
+ var upid = parseInt(id)
|
666
|
671
|
if (isNaN(upid) || upid <= 0) {
|
667
|
|
- return false;
|
|
672
|
+ return false
|
668
|
673
|
}
|
669
|
674
|
GetDistrictsByUpid({ id: upid })
|
670
|
675
|
.then(response => {
|
671
|
|
- var res = response.data;
|
|
676
|
+ var res = response.data
|
672
|
677
|
if (res.state === 1) {
|
673
|
|
- this.districts = res.data.citys ? res.data.citys : [];
|
|
678
|
+ this.districts = res.data.citys ? res.data.citys : []
|
674
|
679
|
}
|
675
|
680
|
})
|
676
|
|
- .catch(e => {});
|
|
681
|
+ .catch(e => {})
|
677
|
682
|
},
|
678
|
683
|
changeParentType(id) {
|
679
|
|
- id = parseInt(id);
|
680
|
|
- this.childtypes = [];
|
681
|
|
- this.form.child_type = "";
|
682
|
|
- this.form.org_type = 0;
|
|
684
|
+ id = parseInt(id)
|
|
685
|
+ this.childtypes = []
|
|
686
|
+ this.form.child_type = '';
|
|
687
|
+ this.form.org_type = 0
|
683
|
688
|
|
684
|
689
|
if (isNaN(id) || id <= 0) {
|
685
|
|
- return false;
|
|
690
|
+ return false
|
686
|
691
|
}
|
687
|
692
|
if (id in this.orgtypesMap) {
|
688
|
|
- this.childtypes = this.orgtypesMap[id];
|
|
693
|
+ this.childtypes = this.orgtypesMap[id]
|
689
|
694
|
} else {
|
690
|
|
- this.childtypes = [];
|
|
695
|
+ this.childtypes = []
|
691
|
696
|
}
|
692
|
697
|
|
693
|
|
- this.form.org_type = id;
|
|
698
|
+ this.form.org_type = id
|
694
|
699
|
},
|
695
|
700
|
changeChildType(id) {
|
696
|
|
- this.form.org_type = id;
|
|
701
|
+ this.form.org_type = id
|
697
|
702
|
},
|
698
|
703
|
submitForm() {
|
699
|
|
- this.form.org_introduction = this.$refs.neditor.content;
|
700
|
|
- this.formloading = true;
|
701
|
|
- this.formsubmit = true;
|
702
|
|
- this.loadingText = "正在保存...";
|
|
704
|
+ this.form.org_introduction = this.$refs.neditor.content
|
|
705
|
+ this.formloading = true
|
|
706
|
+ this.formsubmit = true
|
|
707
|
+ this.loadingText = '正在保存...';
|
703
|
708
|
EditOrgInfo(this.form)
|
704
|
709
|
.then(response => {
|
705
|
|
- var res = response.data;
|
|
710
|
+ var res = response.data
|
706
|
711
|
if (res.state == 1) {
|
707
|
|
- this.$store.dispatch("ModifyOrgInfo", {
|
|
712
|
+ this.$store.dispatch('ModifyOrgInfo', {
|
708
|
713
|
org_name: this.form.org_name,
|
709
|
714
|
contact_name: this.form.org_name
|
710
|
|
- });
|
|
715
|
+ })
|
711
|
716
|
|
712
|
|
- this.$message.success("修改成功");
|
|
717
|
+ this.$message.success('修改成功')
|
713
|
718
|
} else {
|
714
|
|
- this.$message.error(res.msg);
|
|
719
|
+ this.$message.error(res.msg)
|
715
|
720
|
}
|
716
|
721
|
|
717
|
|
- this.formloading = false;
|
718
|
|
- this.formsubmit = false;
|
|
722
|
+ this.formloading = false
|
|
723
|
+ this.formsubmit = false
|
719
|
724
|
})
|
720
|
725
|
.catch(e => {
|
721
|
|
- this.formloading = false;
|
722
|
|
- this.formsubmit = false;
|
723
|
|
- });
|
|
726
|
+ this.formloading = false
|
|
727
|
+ this.formsubmit = false
|
|
728
|
+ })
|
724
|
729
|
}
|
725
|
730
|
}
|
726
|
|
-};
|
|
731
|
+}
|
727
|
732
|
</script>
|
728
|
733
|
|
729
|
734
|
<style rel="stylesheet/scss" >
|