41c84754
杨鑫
'最新'
|
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
|
import {
quGetAll,
quGetOne,
quAdd,
quEdit,
quDel
} from '@/api/account.js'
import {
cereGet,
cereAdd,
cereEdit,
cereDel
} from '../../api/activityBz'
import upimg from "@/components/ImageUpload/index"
export default {
components: {
upimg
},
data() {
return {
currentPage: 1,
total: 100,
flag: false,
pageSize: 10,
ggXin: false,
index: 1,
pageNum: 1, // 当前页
fenlei: [],
fenleiInex: 0,
formInline: {
channelClassification: '', //分类
channelName: '', //渠道名称
channelType: '', //渠道类型
createDate: '', //创建时间
accountNumber: '', //账号
appKey: '', //appkey
notes: '', //备注
},
planName: '',
channelName: '', //查询
fenrules: {
classificationName: [{
required: true,
message: '请输入分类名称',
trigger: 'blur'
},
],
},
rules: {
channelClassification: [{
required: true,
message: '请选择分类',
trigger: 'change'
}],
channelName: [{
required: true,
message: '请输入渠道名称',
trigger: 'blur'
}],
channelType: [{
required: true,
message: '请选择类型',
trigger: 'change'
}],
accountNumber: [{
required: true,
message: '请输入账号',
trigger: 'blur'
}],
appKey: [{
required: true,
message: '请输入appkey',
trigger: 'blur'
}],
},
tableData: [],
pageindex: {
pageNumber: 1,
pageSize: 10
},
xinlei: false, //分类管理框
fentcont: true, //分类管理控制
xinADD: {
classificationName: '',
classificationCode: '',
parentId: '',
classificationType: '2'
},
fenleiDelId: '',
cascaderList: [],
submenuId: '',
defaultProps: {
children: 'children',
label: 'classificationName'
},
xianFenlei: [],
editFen: 0,
title:'',
touShow:false,
peiShow:false,
peiForm:{
auditReminderTime:''
},
ziduan:'',
editFen:0,
}
},
computed: {},
mounted() {
this.getAll()
},
methods: {
changimg(e, type) {
this.formInline[type] = e
},
async getAll() {
const res = await quGetAll(this.pageindex)
this.tableData = res.data.content
this.total = res.data.content.length
let page = {
pageNumber: 1,
pageSize: 10,
classificationType: '2'
}
const fenleis = await cereGet(page)
this.fenlei = fenleis.data
this.cascaderList = this.transformData(fenleis.data)
this.xianFenlei = this.trsData(fenleis.data)
},
transformData(data) {
return data.map(item => ({
value: item.cereClassification.id,
label: item.cereClassification.classificationName,
children: item.childClassifications.map(child => ({
value: child.id,
label: child.classificationName,
})),
}));
},
trsData(data) {
return data.map(item => ({
...item.cereClassification,
children: item.childClassifications || []
}));
},
async getFenAll() {
this.pageindex = {
pageNumber: 1,
pageSize: 10
}
const res = await quGetAll(this.pageindex)
this.tableData = res.data.content
this.total = res.data.content.length
},
async handleNodeClick(data) {
this.pageindex.channelClassification = data.id
const res = await quGetAll(this.pageindex)
this.tableData = res.data.content
this.total = res.data.content.length
},
//获取当前时间
updateCurrentTime() {
const now = new Date();
const year = now.getFullYear();
const month = (now.getMonth() + 1).toString().padStart(2, '0');
const day = now.getDate().toString().padStart(2, '0');
const hours = now.getHours().toString().padStart(2, '0');
const minutes = now.getMinutes().toString().padStart(2, '0');
const seconds = now.getSeconds().toString().padStart(2, '0');
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
},
addbuss(val, item) {
if (val == 1) {
this.formInline = {
channelClassification: '', //分类
channelName: '', //渠道名称
channelType: '', //渠道类型
createDate: '', //创建时间
accountNumber: '', //账号
appKey: '', //appkey
notes: '', //备注
}
} else if (val === 2 || val === 3) {
this.formInline.id = item.id
this.formInline = item
this.formInline.channelClassification = Number(item.channelClassification)
}
this.index = val
this.ggXin = true
},
bianji() {
this.index = 3
},
// 确定
addCheck(index) {
this.$refs.jibenFrom.validate((valid) => {
console.log(valid)
if (valid) {
if (index == 1) {
this.formInline.createDate = this.updateCurrentTime()
quAdd(this.formInline).then(res => {
this.getAll()
this.ggXin = false
})
} else {
quEdit(this.formInline).then(res => {
this.getAll()
this.ggXin = false
})
}
} else {
this.$message({
message: '请填写数据',
type: 'error',
offset: 100
})
return false;
}
}
)
},
async onSubmit() {
let num = this.fenleiInex
this.pageindex.channelName = this.channelName
// this.pageindex.channelClassification = this.fenlei[num]
let res = await quGetAll(this.pageindex)
this.tableData = res.data.content
this.total = res.data.content.length
},
handleSizeChange() {
},
handleCurrentChange() {
},
closeFn() {
this.ggXin = false
this.index = 1
},
handleDelete(item) {
const h = this.$createElement;
this.$msgbox({
title: '消息',
message: h('p', null, [
h('span', null, '是否删除 '),
]),
showCancelButton: true,
showClose: false,
confirmButtonText: '确定',
cancelButtonText: '取消',
customClass: 'oe-dialog-btn',
beforeClose: (action, instance, done) => {
if (action === 'confirm') {
quDel({
id: item.id
}).then(res => {
this.$message({
message: '删除成功',
type: 'success'
})
this.getAll()
done();
})
} else {
done();
}
}
})
},
chong() {
this.pageindex = {
pageNumber: 1,
pageSize: 10
}
this.channelName = ''
this.getAll()
},
handleClick(tab, event) {
this.fenleiInex = Number(tab.index)
this.pageindex = {
pageNumber: 1,
pageSize: 10
}
if (tab.index == '0') {
this.getAll()
} else {
let num = Number(tab.index)
this.pageindex.channelClassification = this.fenlei[num - 1]
this.getAll()
}
},
xinFenlei(node, data) {
this.editFen = 0
if (data) {
this.xinADD.parentId = data.id
}
this.xinlei = true
},
editFenlei(node, data) {
this.editFen = 1
if (data) {
this.xinADD.parentId = data.id
this.xinADD.classificationName = data.classificationName
}
this.xinlei = true
},
fenqing() {
this.xinADD = {
classificationName: '',
classificationCode: '',
parentId: '',
classificationType: '2'
}
this.xinlei = false
},
async sevLei() {
this.$refs.fenFrom.validate((valid) => {
if (valid) {
if (this.editFen == 0) {
this.xinADD.classificationCode = this.xinADD.classificationName
cereAdd(this.xinADD)
} else {
cereEdit({
id: this.xinADD.parentId,
classificationName: this.xinADD.classificationName
})
}
this.xinlei = false
this.xinADD = {
classificationName: '',
classificationCode: '',
parentId: '',
classificationType: '2'
}
this.getAll()
}else{
this.$message({
message: '请填写数据',
type: 'error',
offset: 100
})
return false;
}
})
},
fenleiChange(value) {
this.xinADD.parentId = value[value.length - 1]
},
ADDChange(value) {
this.formInline.channelClassification = value[value.length - 1]
},
fenDelete(node, data) {
const h = this.$createElement;
this.$msgbox({
title: '消息',
message: h('p', null, [
h('span', null, '是否当前分类和子分类删除 '),
]),
showCancelButton: true,
showClose: false,
confirmButtonText: '确定',
cancelButtonText: '取消',
customClass: 'oe-dialog-btn',
beforeClose: (action, instance, done) => {
if (action === 'confirm') {
cereDel({
id: data.id
}).then(res => {
this.xinlei = false
this.getAll()
done();
})
} else {
done();
}
}
})
},
fenleiMenu(item) {
console.log(item)
if (item.cereClassification) {
this.pageindex.channelClassification = item.cereClassification.classificationName
} else {
this.pageindex.channelClassification = item.classificationName
}
this.getAll()
},
toufang(title){
this.title = title
this.touShow = true
},
peicao(ziduan,item){
this.peiId= item.id
this.ziduan = ziduan
this.peiForm.auditReminderTime = ''
this.peiShow = true
},
async peiCheck(){
if(this.ziduan == 'releaseCycle'){
await quEdit({id:this.peiId,releaseCycle:this.peiForm.auditReminderTime})
}else if(this.ziduan == 'deliveryCost'){
await quEdit({id:this.peiId,deliveryCost:this.peiForm.auditReminderTime})
}else{
await quEdit({id:this.peiId,deliveryEffect:this.peiForm.auditReminderTime})
}
this.peiShow =false
this.getAll()
},
}
}
|