|
@@ -288,6 +288,9 @@
|
288
|
288
|
}, [])
|
289
|
289
|
|
290
|
290
|
|
|
291
|
+
|
|
292
|
+
|
|
293
|
+
|
291
|
294
|
this.manufacturer.splice(0, 0, { id: 0, manufacturer_name: '全部' })
|
292
|
295
|
this.dealer.splice(0, 0, { id: 0, dealer_name: '全部' })
|
293
|
296
|
this.form.manufacturer =0
|
|
@@ -339,69 +342,191 @@
|
339
|
342
|
}, showDialog(index, row) {
|
340
|
343
|
this.currentIndex = index
|
341
|
344
|
this.propForm.goodType = []
|
|
345
|
+ this.propForm.goods = []
|
342
|
346
|
|
343
|
|
-
|
344
|
|
- if (this.form.manufacturer == 0 && this.form.dealer == 0) {
|
|
347
|
+ if (this.form.manufacturer == -1 && this.form.dealer == -1) {
|
345
|
348
|
for (let i = 0; i < this.warehouseOutInfoList.length; i++) {
|
346
|
|
- this.propForm.goodType.push(this.warehouseOutInfoList[i].info.type)
|
|
349
|
+ if (this.warehouseOutInfoList[i].info.dealers.id == 0 && this.warehouseOutInfoList[i].info.manufacturers.id == 0) {
|
|
350
|
+ this.propForm.goodType.push(this.warehouseOutInfoList[i].info.type)
|
|
351
|
+ this.propForm.goodInfo.push(this.warehouseOutInfoList[i].info)
|
|
352
|
+ }
|
347
|
353
|
}
|
348
|
|
- const obj3 = {}
|
349
|
|
- this.propForm.goodType = this.propForm.goodType.reduce((cur, next) => {
|
350
|
|
- obj3[next.id] ? '' : obj3[next.id] = true && cur.push(next)
|
351
|
|
- return cur
|
352
|
|
- }, [])
|
|
354
|
+ }
|
353
|
355
|
|
354
|
|
- } else {
|
355
|
|
- if(this.form.manufacturer == 0 && this.form.dealer != 0){
|
356
|
|
- for (let i = 0; i < this.warehouseOutInfoList.length; i++) {
|
357
|
|
- if(this.warehouseOutInfoList[i].info.dealers.id == this.form.dealer){
|
358
|
|
- this.propForm.goodType.push(this.warehouseOutInfoList[i].info.type)
|
359
|
|
- }
|
|
356
|
+ if (this.form.manufacturer == -1 && this.form.dealer == 0) {
|
|
357
|
+ for (let i = 0; i < this.warehouseOutInfoList.length; i++) {
|
|
358
|
+ if (this.warehouseOutInfoList[i].info.manufacturers.id == 0) {
|
|
359
|
+ this.propForm.goodType.push(this.warehouseOutInfoList[i].info.type)
|
|
360
|
+ this.propForm.goodInfo.push(this.warehouseOutInfoList[i].info)
|
360
|
361
|
}
|
361
|
362
|
}
|
362
|
|
- if(this.form.manufacturer != 0 && this.form.dealer == 0){
|
363
|
|
- for (let i = 0; i < this.warehouseOutInfoList.length; i++) {
|
364
|
|
- if(this.warehouseOutInfoList[i].info.manufacturers.id == this.form.manufacturer){
|
365
|
|
- this.propForm.goodType.push(this.warehouseOutInfoList[i].info.type)
|
366
|
|
- }
|
|
363
|
+ }
|
|
364
|
+
|
|
365
|
+ if (this.form.manufacturer == -1 && this.form.dealer != 0) {
|
|
366
|
+ for (let i = 0; i < this.warehouseInfoList.length; i++) {
|
|
367
|
+ if (this.warehouseOutInfoList[i].info.manufacturers.id == 0 && this.warehouseOutInfoList[i].info.dealers.id == this.form.dealer) {
|
|
368
|
+ this.propForm.goodType.push(this.warehouseOutInfoList[i].info.type)
|
|
369
|
+ this.propForm.goodInfo.push(this.warehouseOutInfoList[i].info)
|
|
370
|
+
|
367
|
371
|
}
|
368
|
372
|
}
|
369
|
|
- if(this.form.manufacturer != 0 && this.form.dealer != 0){
|
370
|
|
- for (let i = 0; i < this.warehouseOutInfoList.length; i++) {
|
371
|
|
- if(this.warehouseOutInfoList[i].info.dealers.id == this.form.dealer && this.warehouseOutInfoList[i].info.manufacturers.id == this.form.manufacturer){
|
372
|
|
- this.propForm.goodType.push(this.warehouseOutInfoList[i].info.type)
|
373
|
|
- }
|
374
|
|
- }
|
|
373
|
+ }
|
|
374
|
+
|
|
375
|
+ if (this.form.manufacturer == 0 && this.form.dealer == 0) {
|
|
376
|
+ for (let i = 0; i < this.warehouseOutInfoList.length; i++) {
|
|
377
|
+ this.propForm.goodType.push(this.warehouseOutInfoList[i].info.type)
|
|
378
|
+ this.propForm.goodInfo.push(this.warehouseOutInfoList[i].info)
|
|
379
|
+
|
375
|
380
|
}
|
376
|
|
- const obj3 = {}
|
377
|
|
- this.propForm.goodType = this.propForm.goodType.reduce((cur, next) => {
|
378
|
|
- obj3[next.id] ? '' : obj3[next.id] = true && cur.push(next)
|
379
|
|
- return cur
|
380
|
|
- }, [])
|
381
|
381
|
}
|
382
|
382
|
|
|
383
|
+ if (this.form.manufacturer == 0 && this.form.dealer == -1) {
|
|
384
|
+ for (let i = 0; i < this.warehouseOutInfoList.length; i++) {
|
|
385
|
+ if (this.warehouseOutInfoList[i].info.dealers.id == 0) {
|
|
386
|
+ this.propForm.goodType.push(this.warehouseOutInfoList[i].info.type)
|
|
387
|
+ this.propForm.goodInfo.push(this.warehouseOutInfoList[i].info)
|
|
388
|
+
|
|
389
|
+ }
|
|
390
|
+ }
|
|
391
|
+ }
|
383
|
392
|
|
|
393
|
+ if (this.form.manufacturer != 0 && this.form.dealer == -1) {
|
|
394
|
+ for (let i = 0; i < this.warehouseOutInfoList.length; i++) {
|
|
395
|
+ if (this.warehouseOutInfoList[i].info.dealers.id == 0 && this.warehouseOutInfoList[i].info.manufacturers.id == this.form.manufacturer) {
|
|
396
|
+ this.propForm.goodType.push(this.warehouseOutInfoList[i].info.type)
|
|
397
|
+ this.propForm.goodInfo.push(this.warehouseOutInfoList[i].info)
|
384
|
398
|
|
385
|
|
- this.$refs.dialog.show()
|
|
399
|
+ }
|
|
400
|
+ }
|
|
401
|
+ }
|
386
|
402
|
|
|
403
|
+ if (this.form.manufacturer != 0 && this.form.dealer != 0) {
|
|
404
|
+ for (let i = 0; i < this.warehouseOutInfoList.length; i++) {
|
|
405
|
+ if (this.warehouseOutInfoList[i].info.manufacturers.id == this.form.manufacturer && this.warehouseOutInfoList[i].info.dealers.id == this.form.dealer) {
|
|
406
|
+ this.propForm.goodType.push(this.warehouseOutInfoList[i].info.type)
|
|
407
|
+ this.propForm.goodInfo.push(this.warehouseOutInfoList[i].info)
|
387
|
408
|
|
388
|
|
- this.currentIndex = index
|
389
|
|
- if (this.form.manufacturer == '' || this.form.manufacturer == 0) {
|
|
409
|
+ }
|
|
410
|
+ }
|
|
411
|
+ }
|
390
|
412
|
|
391
|
|
- } else {
|
392
|
|
- this.$refs.dialog.show()
|
|
413
|
+ if (this.form.manufacturer == 0 && this.form.dealer != 0) {
|
|
414
|
+ for (let i = 0; i < this.warehouseOutInfoList.length; i++) {
|
|
415
|
+ if (this.warehouseOutInfoList[i].info.dealers.id == this.form.dealer) {
|
|
416
|
+ this.propForm.goodType.push(this.warehouseOutInfoList[i].info.type)
|
|
417
|
+ this.propForm.goodInfo.push(this.warehouseOutInfoList[i].info)
|
393
|
418
|
|
|
419
|
+ }
|
|
420
|
+ }
|
|
421
|
+ }
|
|
422
|
+ if (this.form.manufacturer != 0 && this.form.dealer == 0) {
|
394
|
423
|
for (let i = 0; i < this.warehouseOutInfoList.length; i++) {
|
395
|
|
- if (this.warehouseOutInfoList[i].manufacturer == this.form.manufacturer) {
|
396
|
|
- this.propForm.goodType.push(this.warehouseOutInfoList[i].GoodInfo.GoodsType)
|
|
424
|
+ if (this.warehouseOutInfoList[i].info.manufacturers.id == this.form.manufacturer) {
|
|
425
|
+ this.propForm.goodType.push(this.warehouseOutInfoList[i].info.type)
|
|
426
|
+ this.propForm.goodInfo.push(this.warehouseOutInfoList[i].info)
|
|
427
|
+ }
|
|
428
|
+ }
|
|
429
|
+ }
|
|
430
|
+
|
|
431
|
+ // if (this.form.manufacturer == 0 && this.form.dealer == 0) {
|
|
432
|
+ // for (let i = 0; i < this.warehouseOutInfoList.length; i++) {
|
|
433
|
+ // this.propForm.goodType.push(this.warehouseOutInfoList[i].info.type)
|
|
434
|
+ // }
|
|
435
|
+ // const obj3 = {}
|
|
436
|
+ // this.propForm.goodType = this.propForm.goodType.reduce((cur, next) => {
|
|
437
|
+ // obj3[next.id] ? '' : obj3[next.id] = true && cur.push(next)
|
|
438
|
+ // return cur
|
|
439
|
+ // }, [])
|
|
440
|
+ //
|
|
441
|
+ // } else {
|
|
442
|
+ // if(this.form.manufacturer == 0 && this.form.dealer != 0){
|
|
443
|
+ // for (let i = 0; i < this.warehouseOutInfoList.length; i++) {
|
|
444
|
+ // if(this.warehouseOutInfoList[i].info.dealers.id == this.form.dealer){
|
|
445
|
+ // this.propForm.goodType.push(this.warehouseOutInfoList[i].info.type)
|
|
446
|
+ // }
|
|
447
|
+ // }
|
|
448
|
+ // }
|
|
449
|
+ // if(this.form.manufacturer != 0 && this.form.dealer == 0){
|
|
450
|
+ // for (let i = 0; i < this.warehouseOutInfoList.length; i++) {
|
|
451
|
+ // if(this.warehouseOutInfoList[i].info.manufacturers.id == this.form.manufacturer){
|
|
452
|
+ // this.propForm.goodType.push(this.warehouseOutInfoList[i].info.type)
|
|
453
|
+ // }
|
|
454
|
+ // }
|
|
455
|
+ // }
|
|
456
|
+ // if(this.form.manufacturer != 0 && this.form.dealer != 0){
|
|
457
|
+ // for (let i = 0; i < this.warehouseOutInfoList.length; i++) {
|
|
458
|
+ // if(this.warehouseOutInfoList[i].info.dealers.id == this.form.dealer && this.warehouseOutInfoList[i].info.manufacturers.id == this.form.manufacturer){
|
|
459
|
+ // this.propForm.goodType.push(this.warehouseOutInfoList[i].info.type)
|
|
460
|
+ // }
|
|
461
|
+ // }
|
|
462
|
+ // }
|
|
463
|
+ // const obj3 = {}
|
|
464
|
+ // this.propForm.goodType = this.propForm.goodType.reduce((cur, next) => {
|
|
465
|
+ // obj3[next.id] ? '' : obj3[next.id] = true && cur.push(next)
|
|
466
|
+ // return cur
|
|
467
|
+ // }, [])
|
|
468
|
+ // }
|
|
469
|
+
|
|
470
|
+ const obj3 = {}
|
|
471
|
+ this.propForm.goodType = this.propForm.goodType.reduce((cur, next) => {
|
|
472
|
+ obj3[next.id] ? '' : obj3[next.id] = true && cur.push(next)
|
|
473
|
+ return cur
|
|
474
|
+ }, [])
|
|
475
|
+ const obj4 = {}
|
|
476
|
+ this.propForm.goodInfo = this.propForm.goodInfo.reduce((cur, next) => {
|
|
477
|
+ obj4[next.id] ? '' : obj4[next.id] = true && cur.push(next)
|
|
478
|
+ return cur
|
|
479
|
+ }, [])
|
|
480
|
+
|
|
481
|
+ for (let i = 0; i < this.propForm.goodType.length; i++) {
|
|
482
|
+ let goodInfo = []
|
|
483
|
+ let goodObj = {}
|
|
484
|
+
|
|
485
|
+ for (let a = 0; a < this.propForm.goodInfo.length; a++) {
|
|
486
|
+ var respObj = this.propForm.goodInfo[a]
|
|
487
|
+ respObj['isSelected'] = false
|
|
488
|
+ if (respObj.type.id == this.propForm.goodType[i].id && respObj.id != 0) {
|
|
489
|
+ console.log(respObj.id)
|
|
490
|
+ goodInfo.push(respObj)
|
397
|
491
|
}
|
398
|
492
|
}
|
399
|
|
- const obj3 = {}
|
400
|
|
- this.propForm.goodType = this.propForm.goodType.reduce((cur, next) => {
|
401
|
|
- obj3[next.id] ? '' : obj3[next.id] = true && cur.push(next)
|
|
493
|
+ const obj = {}
|
|
494
|
+ goodInfo = goodInfo.reduce((cur, next) => {
|
|
495
|
+ obj[next.id] ? '' : obj[next.id] = true && cur.push(next)
|
402
|
496
|
return cur
|
403
|
|
- }, [])
|
|
497
|
+ }, []) // 设置cur默认类型为数组,并且初始值为空的数组
|
|
498
|
+
|
|
499
|
+ if(goodInfo.length != 0) {
|
|
500
|
+ this.$set(goodObj, this.propForm.goodType[i].id, goodInfo)
|
|
501
|
+ this.propForm.goods.push(goodObj)
|
|
502
|
+
|
|
503
|
+ }
|
404
|
504
|
}
|
|
505
|
+ console.log(this.propForm.goods)
|
|
506
|
+
|
|
507
|
+
|
|
508
|
+
|
|
509
|
+ this.$refs.dialog.show()
|
|
510
|
+ // }
|
|
511
|
+
|
|
512
|
+
|
|
513
|
+ // this.currentIndex = index
|
|
514
|
+ // if (this.form.manufacturer == '' || this.form.manufacturer == 0) {
|
|
515
|
+ //
|
|
516
|
+ // } else {
|
|
517
|
+ // this.$refs.dialog.show()
|
|
518
|
+ //
|
|
519
|
+ // for (let i = 0; i < this.warehouseOutInfoList.length; i++) {
|
|
520
|
+ // if (this.warehouseOutInfoList[i].manufacturer == this.form.manufacturer) {
|
|
521
|
+ // this.propForm.goodType.push(this.warehouseOutInfoList[i].GoodInfo.GoodsType)
|
|
522
|
+ // }
|
|
523
|
+ // }
|
|
524
|
+ // const obj3 = {}
|
|
525
|
+ // this.propForm.goodType = this.propForm.goodType.reduce((cur, next) => {
|
|
526
|
+ // obj3[next.id] ? '' : obj3[next.id] = true && cur.push(next)
|
|
527
|
+ // return cur
|
|
528
|
+ // }, [])
|
|
529
|
+ // }
|
405
|
530
|
}, back() {
|
406
|
531
|
this.$router.go(-1)
|
407
|
532
|
}, submit() {
|