|
@@ -610,47 +610,10 @@ export default {
|
610
|
610
|
if (this.type == 1) {
|
611
|
611
|
//新增时
|
612
|
612
|
row.createDate = getDateTimeNow()
|
613
|
|
- console.log(row.createDate, "createDate")
|
|
613
|
+
|
614
|
614
|
// console.log(this.checkItems, "是否被选中")
|
615
|
615
|
var num = 0
|
616
|
|
-
|
617
|
|
- if (row.isCheck == 0) {
|
618
|
|
- // 有一项点击否,结果就是1(黄)
|
619
|
|
- this.data1.equipFacilities.checkResult = 1
|
620
|
|
- this.checkResult = 1
|
621
|
|
- } /* else{
|
622
|
|
- // 有一项点击是,结果就是0(绿)
|
623
|
|
- this.data1.equipFacilities.checkResult = 0
|
624
|
|
- this.checkResult = 0
|
625
|
|
- } */
|
626
|
|
- this.checkItems.forEach((item, index) => {
|
627
|
|
- Object.assign(
|
628
|
|
- item,
|
629
|
|
- { operationTime: item.createDate },
|
630
|
|
- { checkEnumId: item.enumId }
|
631
|
|
- )
|
632
|
|
-
|
633
|
|
-
|
634
|
|
- if (item.isCheck == 1 || item.isCheck == 0) {
|
635
|
|
- num += 1
|
636
|
|
- // console.log(this.checkItems[i], num, "该项被选中了")
|
637
|
|
- }
|
638
|
|
-
|
639
|
|
- console.log(this.checkItems, "this.checkItems111")
|
640
|
|
- console.log(
|
641
|
|
- this.data1.equipFacilities.checkResult,
|
642
|
|
- "this.data1.equipFacilities.checkResult"
|
643
|
|
- )
|
644
|
|
- if (num == this.checkItems.length) {
|
645
|
|
- this.data1.equipFacilities.checkState = 1
|
646
|
|
- this.flag = true
|
647
|
|
- // console.log("此时暂存变保存,切状态改为已完成")
|
648
|
|
- } else {
|
649
|
|
- this.data1.equipFacilities.checkState = 0
|
650
|
|
- // console.log("此时暂存还是暂存,切状态改为 进行中")
|
651
|
|
- }
|
652
|
|
- })
|
653
|
|
- /* for (let i = 0; i < this.checkItems.length; i++) {
|
|
616
|
+ for (let i = 0; i < this.checkItems.length; i++) {
|
654
|
617
|
// console.log(this.checkItems[i].enumId, "this.checkItems[i].enumId")
|
655
|
618
|
// var num =0;
|
656
|
619
|
this.checkItems[i].checkEnumId = this.checkItems[i].enumId
|
|
@@ -679,51 +642,26 @@ export default {
|
679
|
642
|
this.data1.equipFacilities.checkState = 0
|
680
|
643
|
// console.log("此时暂存还是暂存,切状态改为 进行中")
|
681
|
644
|
}
|
682
|
|
- } */
|
|
645
|
+ }
|
|
646
|
+
|
683
|
647
|
} else if (this.type == 3) {
|
684
|
648
|
//修改时
|
685
|
|
- // row.operationTime = getNowFormatDateone()
|
686
|
649
|
row.operationTime = getDateTimeNow()
|
687
|
|
- // row.operationTime = getNowFormatDateone()
|
688
|
650
|
var num = 0
|
689
|
651
|
|
690
|
|
- if (row.isCheck == 0) {
|
691
|
|
- // 有一项点击否,结果就是1(黄)
|
692
|
|
- this.data1.equipFacilities.checkResult = 1
|
693
|
|
- this.checkResult = 1
|
694
|
|
- } else{
|
695
|
|
- // 有一项点击是,结果就是0(绿)
|
696
|
|
- this.data1.equipFacilities.checkResult = 0
|
697
|
|
- this.checkResult = 0
|
698
|
|
- }
|
699
|
|
- this.checkItems.forEach((item, index) => {
|
700
|
|
- Object.assign(item, { checkEnumId: item.enumId })
|
701
|
|
- if (item.isCheck == 1 || item.isCheck == 0) {
|
702
|
|
- num += 1
|
703
|
|
- // console.log(this.checkItems[i], num, "该项被选中了")
|
704
|
|
- }
|
705
|
|
- console.log(this.checkItems, "this.checkItems111")
|
706
|
|
- console.log(this.checkItems.length, "this.checkItems222")
|
707
|
|
- if (num == this.checkItems.length) {
|
708
|
|
- this.data1.equipFacilities.checkState = 1
|
709
|
|
- this.flag = true
|
710
|
|
- // console.log("此时暂存变保存,切状态改为已完成")
|
711
|
|
- } else {
|
712
|
|
- this.data1.equipFacilities.checkState = 0
|
713
|
|
- // console.log("此时暂存还是暂存,切状态改为 进行中")
|
714
|
|
- }
|
715
|
|
- })
|
716
|
|
- /* for (let i = 0; i < this.checkItems.length; i++) {
|
|
652
|
+
|
|
653
|
+ for (var i = 0; i < this.checkItems.length; i++) {
|
717
|
654
|
// console.log(this.checkItems[i].enumId, "this.checkItems[i].enumId")
|
718
|
655
|
// var num =0;
|
719
|
|
- this.checkItems[i].checkEnumId = this.checkItems[i].enumId
|
720
|
|
- this.checkItems[i].operationTime = this.checkItems[i].createDate
|
|
656
|
+ Object.assign(this.checkItems[i], { checkEnumId: this.checkItems[i].enumId })
|
721
|
657
|
if (this.checkItems[i].isCheck === 0) {
|
722
|
658
|
// 有一项点击否,结果就是1(黄)
|
723
|
659
|
this.data1.equipFacilities.checkResult = 1
|
|
660
|
+ console.log(this.data1.equipFacilities.checkResult,'this.data1.equipFacilities.checkResult')
|
724
|
661
|
} else {
|
725
|
662
|
// 有一项点击否,结果就是0(绿)
|
726
|
663
|
this.data1.equipFacilities.checkResult = 0
|
|
664
|
+ console.log(this.data1.equipFacilities.checkResult,'this.data1.equipFacilities.checkResult')
|
727
|
665
|
}
|
728
|
666
|
|
729
|
667
|
if (
|
|
@@ -731,23 +669,34 @@ export default {
|
731
|
669
|
this.checkItems[i].isCheck === 0
|
732
|
670
|
) {
|
733
|
671
|
num += 1
|
734
|
|
- // console.log(this.checkItems[i], num, "该项被选中了")
|
|
672
|
+ console.log(this.checkItems[i], num, "该项被选中了")
|
735
|
673
|
}
|
736
|
674
|
|
737
|
675
|
if (num == this.checkItems.length) {
|
738
|
676
|
this.data1.equipFacilities.checkState = 1
|
739
|
677
|
this.flag = true
|
740
|
|
- // console.log("此时暂存变保存,切状态改为已完成")
|
|
678
|
+ console.log("此时暂存变保存,切状态改为已完成")
|
741
|
679
|
} else {
|
742
|
680
|
this.data1.equipFacilities.checkState = 0
|
743
|
|
- // console.log("此时暂存还是暂存,切状态改为 进行中")
|
|
681
|
+ console.log("此时暂存还是暂存,切状态改为 进行中")
|
744
|
682
|
}
|
745
|
|
- } */
|
|
683
|
+ }
|
746
|
684
|
}
|
747
|
685
|
},
|
748
|
686
|
// 保存
|
749
|
687
|
btnSave() {
|
750
|
688
|
this.loading = true
|
|
689
|
+ for(var i =0;i<this.checkItems.length;i++){
|
|
690
|
+ if (this.checkItems[i].isCheck === 0) {
|
|
691
|
+ // 有一项点击否,结果就是1(黄)
|
|
692
|
+ this.data1.equipFacilities.checkResult = 1
|
|
693
|
+ console.log(this.data1.equipFacilities.checkResult,'this.data1.equipFacilities.checkResult')
|
|
694
|
+ } /* else if(this.checkItems[i].isCheck === 1){
|
|
695
|
+ // 有一项点击否,结果就是0(绿)
|
|
696
|
+ this.data1.equipFacilities.checkResult = 0
|
|
697
|
+ console.log(this.data1.equipFacilities.checkResult,'this.data1.equipFacilities.checkResult')
|
|
698
|
+ } */
|
|
699
|
+ }
|
751
|
700
|
this.data1.equipFacilities.hname = this.houseDic[
|
752
|
701
|
this.data1.equipFacilities.hid
|
753
|
702
|
]
|