Ver código fonte

Merge branch 'master' of http://git.shengws.com/csx/Vue_New

XMLWAN 4 anos atrás
pai
commit
2a6f81a2c7

+ 7 - 0
src/api/patient.js Ver arquivo

356
 
356
 
357
 
357
 
358
 
358
 
359
+export function getMaxDialysisNo() {
360
+  return request({
361
+    url: '/api/patients/dialysis_no',
362
+    method: 'Get',
363
+  })
364
+}
365
+
359
 
366
 
360
 
367
 
361
 
368
 

+ 423 - 231
src/xt_pages/user/patients.vue Ver arquivo

14
     </el-dialog>
14
     </el-dialog>
15
 
15
 
16
 
16
 
17
+    <el-dialog
18
+      title="提示"
19
+      :visible.sync="dialysisVisible"
20
+      width="40%"
21
+    >
22
+      <span>您提交的文档中存在不同病人存在相同的透析号,请检查修改后在提交 </span>
23
+      <span slot="footer" class="dialog-footer">
24
+    <el-button @click="dialysisVisible = false">取 消</el-button>
25
+    <el-button type="primary" @click="dialysisVisible = false">确 定</el-button>
26
+  </span>
27
+    </el-dialog>
28
+
29
+
30
+    <el-dialog
31
+      title="提示"
32
+      :visible.sync="phoneVisible"
33
+      width="40%"
34
+    >
35
+      <span>您提交的文档中存在不同病人存在相同的手机号,请检查修改后在提交 </span>
36
+      <span slot="footer" class="dialog-footer">
37
+    <el-button @click="phoneVisible = false">取 消</el-button>
38
+    <el-button type="primary" @click="phoneVisible = false">确 定</el-button>
39
+  </span>
40
+    </el-dialog>
41
+
42
+
43
+    <el-dialog
44
+      title="提示"
45
+      :visible.sync="idCardNoVisible"
46
+      width="40%"
47
+    >
48
+      <span>您提交的文档中存在不同病人存在相同的身份证,请检查修改后在提交 </span>
49
+      <span slot="footer" class="dialog-footer">
50
+    <el-button @click="idCardNoVisible = false">取 消</el-button>
51
+    <el-button type="primary" @click="idCardNoVisible = false">确 定</el-button>
52
+  </span>
53
+    </el-dialog>
54
+
55
+
17
     <el-dialog
56
     <el-dialog
18
       title="提示"
57
       title="提示"
19
       :visible.sync="exportLogVisible"
58
       :visible.sync="exportLogVisible"
25
         <br/>
64
         <br/>
26
         <br/>
65
         <br/>
27
         <span>{{getContent(item)}}</span>
66
         <span>{{getContent(item)}}</span>
28
-        <span style="color:blue"  @click="generateTxt(item)">点击</span>
67
+        <span style="color:blue" @click="generateTxt(item)">点击</span>
29
         <span>查看详情</span>
68
         <span>查看详情</span>
30
         <br/>
69
         <br/>
31
         <br/>
70
         <br/>
499
 </template>
538
 </template>
500
 
539
 
501
 <script>
540
 <script>
502
-  import { code, EditLapseto, fetchList, OpenView, postExportPatients } from '@/api/patient'
541
+  import { code, EditLapseto, fetchList, getMaxDialysisNo, OpenView, postExportPatients } from '@/api/patient'
503
   import { generateLog } from '@/api/config'
542
   import { generateLog } from '@/api/config'
504
 
543
 
505
   import QRCode from 'qrcodejs2'
544
   import QRCode from 'qrcodejs2'
535
         isIndeterminate: true,
574
         isIndeterminate: true,
536
         dialogVisible: false,
575
         dialogVisible: false,
537
         exportLogVisible: false,
576
         exportLogVisible: false,
577
+        phoneVisible:false,
578
+        idCardNoVisible:false,
538
         wechatbindimg: '',
579
         wechatbindimg: '',
539
         active: true,
580
         active: true,
540
         schedulType: 0,
581
         schedulType: 0,
601
         // value2: '',
642
         // value2: '',
602
         total: 0,
643
         total: 0,
603
         pageTotal: 0,
644
         pageTotal: 0,
645
+        dialysisVisible:false,
604
         pageSelect: 0,
646
         pageSelect: 0,
647
+        max_dialysis_no: '',
605
         listQuery: {
648
         listQuery: {
606
           page: 1,
649
           page: 1,
607
           limit: 10,
650
           limit: 10,
648
     },
691
     },
649
 
692
 
650
     methods: {
693
     methods: {
651
-      generateTxt:function(log) {
694
+      generateTxt: function(log) {
652
         var content = ''
695
         var content = ''
653
-       var errlog =  log.err_logs
654
-        for (let i = 0; i< errlog.length; i++){
696
+        var errlog = log.err_logs
697
+        content = this.getContent(log)
698
+        for (let i = 0; i < errlog.length; i++) {
655
           if (content.length == 0) {
699
           if (content.length == 0) {
656
             content = errlog[i].err_msg
700
             content = errlog[i].err_msg
657
-          }else{
658
-            content = content +"\n"+errlog[i].err_msg
701
+          } else {
702
+            content = content + '\n' + errlog[i].err_msg
659
           }
703
           }
660
         }
704
         }
661
 
705
 
662
-
663
         var url = new Blob(['\ufeff' + content], { type: 'text/txt,charset=UTF-8' })
706
         var url = new Blob(['\ufeff' + content], { type: 'text/txt,charset=UTF-8' })
664
         if (typeof url === 'object' && url instanceof Blob) {
707
         if (typeof url === 'object' && url instanceof Blob) {
665
           url = URL.createObjectURL(url) // 创建blob地址
708
           url = URL.createObjectURL(url) // 创建blob地址
666
         }
709
         }
667
         const aLink = document.createElement('a')
710
         const aLink = document.createElement('a')
668
         aLink.href = url
711
         aLink.href = url
669
-        aLink.download = this.timestampToTime(log.export_time)+'错误日志'+".txt"
712
+        aLink.download = this.timestampToTime(log.export_time) + '错误日志' + '.txt'
670
         aLink.click()
713
         aLink.click()
671
 
714
 
672
       },
715
       },
680
         var D = (date.getDate() < 10 ? '0' + (date.getDate()) : date.getDate()) + '日 '
723
         var D = (date.getDate() < 10 ? '0' + (date.getDate()) : date.getDate()) + '日 '
681
         var h = (date.getHours() < 10 ? '0' + (date.getHours()) : date.getHours()) + '时'
724
         var h = (date.getHours() < 10 ? '0' + (date.getHours()) : date.getHours()) + '时'
682
         var m = (date.getMinutes() < 10 ? '0' + (date.getMinutes()) : date.getMinutes()) + '分'
725
         var m = (date.getMinutes() < 10 ? '0' + (date.getMinutes()) : date.getMinutes()) + '分'
683
-        var s = (date.getSeconds() < 10 ? '0' + (date.getSeconds()) : date.getSeconds())+'秒'
726
+        var s = (date.getSeconds() < 10 ? '0' + (date.getSeconds()) : date.getSeconds()) + '秒'
684
         return Y + M + D + h + m + s
727
         return Y + M + D + h + m + s
685
       },
728
       },
686
       generateLog() {
729
       generateLog() {
700
 
743
 
701
       },
744
       },
702
       handleSuccess({ results, header }) {
745
       handleSuccess({ results, header }) {
703
-
746
+        console.log(results)
747
+        console.log(header)
704
 
748
 
705
         if (header != undefined && header.length > 0) {
749
         if (header != undefined && header.length > 0) {
706
           var isHasName = header.includes('*姓名')
750
           var isHasName = header.includes('*姓名')
712
           var isHasLapseto = header.includes('*治疗状态')
756
           var isHasLapseto = header.includes('*治疗状态')
713
           var isHasInfectious = header.includes('*传染病')
757
           var isHasInfectious = header.includes('*传染病')
714
           var isHasDiagnose = header.includes('诊断')
758
           var isHasDiagnose = header.includes('诊断')
715
-          if (!(isHasName && isHasGender && isHasPhone && isHasIdCard && isHasDate && isHasSource && isHasLapseto && isHasInfectious && isHasDiagnose)) {
759
+          var isHasDialysisNo = header.includes('透析号')
760
+
761
+          var isHasDryWeight = header.includes('干体重(kg)')
762
+          var isHasHeight = header.includes('身高(cm)')
763
+          var isHasHomeAddress = header.includes('家庭住址')
764
+
765
+          if (!(isHasName && isHasGender && isHasPhone && isHasIdCard && isHasDate && isHasSource && isHasLapseto && isHasInfectious && isHasDiagnose && isHasDialysisNo && isHasDryWeight && isHasHeight && isHasHomeAddress)) {
716
             this.dialogVisible = true
766
             this.dialogVisible = true
717
             return
767
             return
718
           }
768
           }
719
-        }else{
769
+        } else {
720
           this.dialogVisible = true
770
           this.dialogVisible = true
721
           return
771
           return
722
         }
772
         }
723
-        this.export_date = []
724
-        for (let i = 1; i < results.length; i++) {
725
-          let obj = {}
726
-          for (var key in results[i]) {
727
-            if (results[i]['*姓名'] === undefined) {
728
-              obj['name'] = ''
729
-            } else {
730
-              if (key == '*姓名') {
731
-                obj['name'] = results[i][key]
773
+        getMaxDialysisNo().then(
774
+          response => {
775
+            if (response.data.state === 1) {
776
+              this.max_dialysis_no = response.data.data.dialysis_no
777
+              if (this.max_dialysis_no == 0) {
778
+                this.max_dialysis_no = 1
779
+              } else {
780
+                this.max_dialysis_no++
732
               }
781
               }
733
-            }
734
 
782
 
735
-            if (results[i]['*性别'] === undefined) {
736
-              obj['gender'] = '0'
737
-            } else {
738
-              if (key == '*性别') {
739
-                if (results[i][key] == '男') {
740
-                  obj['gender'] = '1'
741
-                } else if (results[i][key] == '女') {
742
-                  obj['gender'] = '2'
743
-                } else {
744
-                  obj['gender'] = '0'
783
+
784
+              this.export_date = []
785
+              for (let i = 1; i < results.length; i++) {
786
+                let obj = {}
787
+                for (var key in results[i]) {
788
+                  if (results[i]['*姓名'] === undefined) {
789
+                    obj['name'] = ''
790
+                  } else {
791
+                    if (key == '*姓名') {
792
+                      obj['name'] = results[i][key].replace(/\s/g,"")
793
+
794
+                    }
795
+                  }
796
+
797
+                  if (results[i]['*性别'] === undefined) {
798
+                    obj['gender'] = '0'
799
+                  } else {
800
+                    if (key == '*性别') {
801
+                      if (results[i][key] == '男') {
802
+                        obj['gender'] = '1'
803
+                      } else if (results[i][key] == '女') {
804
+                        obj['gender'] = '2'
805
+                      } else {
806
+                        obj['gender'] = '0'
807
+                      }
808
+                    }
809
+                  }
810
+
811
+                  if (results[i]['*手机号'] === undefined) {
812
+                    obj['phone'] = ''
813
+                  } else {
814
+                    if (key == '*手机号') {
815
+                      obj['phone'] = results[i][key].replace(/\s/g,"")
816
+                    }
817
+                  }
818
+
819
+                  if (results[i]['*身份证号'] === undefined) {
820
+                    obj['id_card_no'] = ''
821
+
822
+                  } else {
823
+                    if (key == '*身份证号') {
824
+                      obj['id_card_no'] = results[i][key].replace(/\s/g,"")
825
+                    }
826
+                  }
827
+
828
+                  if (results[i]['*首次肾脏治疗时间'] === undefined) {
829
+                    obj['first_treatment_date'] = ''
830
+
831
+                  } else {
832
+                    if (key == '*首次肾脏治疗时间') {
833
+                      var month = parseInt(results[i][key].replace(/\s/g,"").split('/')[0])
834
+                      var day = parseInt(results[i][key].replace(/\s/g,"").split('/')[1])
835
+                      var year = parseInt(results[i][key].replace(/\s/g,"").split('/')[2])
836
+
837
+                      if (day < 10) {
838
+                        day = '0' + day
839
+                      }
840
+                      if (month < 10) {
841
+                        month = '0' + month
842
+                      }
843
+                      obj['first_treatment_date'] = '20' + year + '/' + month + '/' + day
844
+                    }
845
+                  }
846
+
847
+                  if (results[i]['*患者来源'] === undefined) {
848
+                    obj['source'] = '0'
849
+
850
+                  } else {
851
+                    if (key == '*患者来源') {
852
+                      if (results[i][key] == '门诊') {
853
+                        obj['source'] = '1'
854
+                      } else if (results[i][key] == '住院') {
855
+                        obj['source'] = '2'
856
+                      } else {
857
+                        obj['source'] = '0'
858
+                      }
859
+                    }
860
+                  }
861
+
862
+                  if (results[i]['*治疗状态'] === undefined) {
863
+                    obj['lapseto'] = '0'
864
+
865
+                  } else {
866
+                    if (key == '*治疗状态') {
867
+                      if (results[i][key] == '留治') {
868
+                        obj['lapseto'] = '1'
869
+                      } else if (results[i][key] == '转归') {
870
+                        obj['lapseto'] = '2'
871
+                      } else {
872
+                        obj['lapseto'] = '0'
873
+                      }
874
+                    }
875
+                  }
876
+
877
+                  if (results[i]['*传染病'] === undefined) {
878
+                    let contagions = []
879
+                    obj['is_infectious'] = '0'
880
+                    obj['contagions'] = contagions
881
+
882
+                  } else {
883
+                    if (key == '*传染病') {
884
+                      if (results[i][key] == '无') {
885
+                        let contagions = []
886
+                        obj['is_infectious'] = '1'
887
+                        obj['contagions'] = contagions
888
+
889
+                      } else if (results[i][key] == '乙肝') {
890
+                        let contagions = []
891
+                        contagions.push(2)
892
+                        obj['is_infectious'] = '2'
893
+                        obj['contagions'] = contagions
894
+                      } else if (results[i][key] == '丙肝') {
895
+                        let contagions = []
896
+                        contagions.push(3)
897
+                        obj['is_infectious'] = '2'
898
+                        obj['contagions'] = contagions
899
+
900
+                      } else if (results[i][key] == '艾滋病') {
901
+                        let contagions = []
902
+                        contagions.push(4)
903
+                        obj['is_infectious'] = '2'
904
+                        obj['contagions'] = contagions
905
+
906
+                      } else if (results[i][key] == '肺结核') {
907
+                        let contagions = []
908
+                        contagions.push(5)
909
+                        obj['is_infectious'] = '2'
910
+                        obj['contagions'] = contagions
911
+
912
+                      } else if (results[i][key] == '梅毒') {
913
+                        let contagions = []
914
+                        contagions.push(6)
915
+                        obj['is_infectious'] = '2'
916
+                        obj['contagions'] = contagions
917
+                      } else {
918
+                        let contagions = []
919
+                        obj['is_infectious'] = '0'
920
+                        obj['contagions'] = contagions
921
+                      }
922
+                    }
923
+                  }
924
+
925
+                  if (results[i]['诊断'] === undefined) {
926
+                    obj['diagnose'] = ''
927
+                  } else {
928
+                    if (key == '诊断') {
929
+                      obj['diagnose'] = results[i][key]
930
+                    }
931
+                  }
932
+                  console.log(obj)
933
+
934
+                  if (results[i]['透析号'] === undefined) {
935
+                    obj['dialysis_no'] = ''
936
+                  } else {
937
+                    if (key == '透析号') {
938
+                      obj['dialysis_no'] = results[i][key].replace(/\s/g,"")
939
+                    }
940
+                  }
941
+
942
+                  console.log(obj)
943
+
944
+                  if (results[i]['干体重(kg)'] === undefined) {
945
+                    obj['dry_weight'] = ''
946
+                  } else {
947
+                    if (key == '干体重(kg)') {
948
+                      obj['dry_weight'] = results[i][key].replace(/\s/g,"")
949
+                    }
950
+                  }
951
+
952
+                  console.log(obj)
953
+
954
+                  if (results[i]['身高(cm)'] === undefined) {
955
+                    obj['height'] = ''
956
+                  } else {
957
+                    if (key == '身高(cm)') {
958
+                      obj['height'] = results[i][key].replace(/\s/g,"")
959
+                    }
960
+                  }
961
+
962
+                  console.log(obj)
963
+
964
+                  if (results[i]['家庭住址'] === undefined) {
965
+                    obj['home_address'] = ''
966
+                  } else {
967
+                    if (key == '家庭住址') {
968
+                      obj['home_address'] = results[i][key]
969
+                    }
970
+                  }
745
                 }
971
                 }
972
+
973
+                this.export_date.push(obj)
746
               }
974
               }
747
-            }
748
 
975
 
749
-            if (results[i]['*手机号'] === undefined) {
750
-              obj['phone'] = ''
751
-            } else {
752
-              if (key == '*手机号') {
753
-                obj['phone'] = results[i][key].trim()
976
+              let index = 0
977
+
978
+              for (let i = 0; i < this.export_date.length; i++) {
979
+                if (this.export_date[i].dialysis_no == '') {
980
+                  let new_dialysis_no = this.max_dialysis_no + index
981
+                  console.log(new_dialysis_no)
982
+                  index++
983
+                  let no = new_dialysis_no.toString()
984
+                  console.log(no)
985
+                  let rep = 3 - no.length
986
+                  console.log(rep)
987
+                  let tempNo = ""
988
+                  if (rep == 1){
989
+                    tempNo = "0"
990
+                  }
991
+
992
+                  if (rep == 2){
993
+                    tempNo = "00"
994
+                  }
995
+
996
+
997
+                  console.log(tempNo)
998
+                  if (rep > 0) {
999
+                    no = tempNo + no
1000
+                  }
1001
+                  this.export_date[i].dialysis_no = no
1002
+                }
754
               }
1003
               }
755
-            }
756
 
1004
 
757
-            if (results[i]['*身份证号'] === undefined) {
758
-              obj['id_card_no'] = ''
759
 
1005
 
760
-            } else {
761
-              if (key == '*身份证号') {
762
-                obj['id_card_no'] = results[i][key].trim()
763
-              }
764
-            }
1006
+              console.log(this.export_date)
765
 
1007
 
766
-            if (results[i]['*首次肾脏治疗时间'] === undefined) {
767
-              obj['first_treatment_date'] = ''
1008
+              var tempExportDate = this.export_date
1009
+              var tempExportDateOne = this.export_date
1010
+              var tempExportDateTwo = this.export_date
768
 
1011
 
769
-            } else {
770
-              if (key == '*首次肾脏治疗时间') {
771
-                var month = parseInt(results[i][key].trim().split('/')[0])
772
-                var day = parseInt(results[i][key].trim().split('/')[1])
773
-                var year = parseInt(results[i][key].trim().split('/')[2])
774
 
1012
 
775
-                if (day < 10) {
776
-                  day = '0' + day
777
-                }
778
-                if (month < 10) {
779
-                  month = '0' + month
780
-                }
781
-                obj['first_treatment_date'] = '20' + year + '/' + month + '/' + day
782
-              }
783
-            }
784
 
1013
 
785
-            if (results[i]['*患者来源'] === undefined) {
786
-              obj['source'] = '0'
1014
+              const obj2 = {}
1015
+              tempExportDate = tempExportDate.reduce((cur, next) => {
1016
+                obj2[next.dialysis_no] ? '' : obj2[next.dialysis_no] = true && cur.push(next)
1017
+                return cur
1018
+              }, []) // 设置cur默认类型为数组,并且初始值为空的数组
787
 
1019
 
788
-            } else {
789
-              if (key == '*患者来源') {
790
-                if (results[i][key] == '门诊') {
791
-                  obj['source'] = '1'
792
-                } else if (results[i][key] == '住院') {
793
-                  obj['source'] = '2'
794
-                } else {
795
-                  obj['source'] = '0'
796
-                }
797
-              }
798
-            }
799
 
1020
 
800
-            if (results[i]['*治疗状态'] === undefined) {
801
-              obj['lapseto'] = '0'
802
 
1021
 
803
-            } else {
804
-              if (key == '*治疗状态') {
805
-                if (results[i][key] == '留治') {
806
-                  obj['lapseto'] = '1'
807
-                } else if (results[i][key] == '转归') {
808
-                  obj['lapseto'] = '2'
809
-                } else {
810
-                  obj['lapseto'] = '0'
811
-                }
1022
+              if (tempExportDate.length < this.export_date.length){
1023
+                this.dialysisVisible = true
1024
+                return
812
               }
1025
               }
813
-            }
814
 
1026
 
815
-            if (results[i]['*传染病'] === undefined) {
816
-              let contagions = []
817
-              obj['is_infectious'] = '0'
818
-              obj['contagions'] = contagions
819
 
1027
 
820
-            } else {
821
-              if (key == '*传染病') {
822
-                if (results[i][key] == '无') {
823
-                  let contagions = []
824
-                  obj['is_infectious'] = '1'
825
-                  obj['contagions'] = contagions
826
-
827
-                } else if (results[i][key] == '乙肝') {
828
-                  let contagions = []
829
-                  contagions.push(2)
830
-                  obj['is_infectious'] = '2'
831
-                  obj['contagions'] = contagions
832
-                } else if (results[i][key] == '丙肝') {
833
-                  let contagions = []
834
-                  contagions.push(3)
835
-                  obj['is_infectious'] = '2'
836
-                  obj['contagions'] = contagions
837
-
838
-                } else if (results[i][key] == '艾滋病') {
839
-                  let contagions = []
840
-                  contagions.push(4)
841
-                  obj['is_infectious'] = '2'
842
-                  obj['contagions'] = contagions
843
-
844
-                } else if (results[i][key] == '肺结核') {
845
-                  let contagions = []
846
-                  contagions.push(5)
847
-                  obj['is_infectious'] = '2'
848
-                  obj['contagions'] = contagions
849
-
850
-                } else if (results[i][key] == '梅毒') {
851
-                  let contagions = []
852
-                  contagions.push(6)
853
-                  obj['is_infectious'] = '2'
854
-                  obj['contagions'] = contagions
855
-                } else {
856
-                  let contagions = []
857
-                  obj['is_infectious'] = '0'
858
-                  obj['contagions'] = contagions
859
-                }
1028
+
1029
+              const obj3 = {}
1030
+              tempExportDateOne = tempExportDateOne.reduce((cur, next) => {
1031
+                obj3[next.phone] ? '' : obj3[next.phone] = true && cur.push(next)
1032
+                return cur
1033
+              }, []) // 设置cur默认类型为数组,并且初始值为空的数组
1034
+
1035
+
1036
+
1037
+              if (tempExportDateOne.length < this.export_date.length){
1038
+                this.phoneVisible = true
1039
+                return
860
               }
1040
               }
861
-            }
862
 
1041
 
863
-            if (results[i]['诊断'] === undefined) {
864
-              obj['diagnose'] = ''
865
-            } else {
866
-              if (key == '诊断') {
867
-                obj['diagnose'] = results[i][key]
1042
+
1043
+
1044
+
1045
+              const obj4 = {}
1046
+              tempExportDateTwo = tempExportDateTwo.reduce((cur, next) => {
1047
+                obj4[next.id_card_no] ? '' : obj4[next.id_card_no] = true && cur.push(next)
1048
+                return cur
1049
+              }, []) // 设置cur默认类型为数组,并且初始值为空的数组
1050
+
1051
+
1052
+
1053
+              if (tempExportDateTwo.length < this.export_date.length){
1054
+                this.idCardNoVisible = true
1055
+                return
868
               }
1056
               }
869
-            }
870
-          }
871
-          this.export_date.push(obj)
872
-        }
873
 
1057
 
874
-        let params = {
875
-          'patients': this.export_date
876
-        }
877
-        postExportPatients(params).then(
878
-          response => {
879
-            if (response.data.state === 1) {
880
-              this.getList()
881
-            } else {
882
-              this.$message.error(response.data.msg)
1058
+
1059
+
1060
+
1061
+              // let params = {
1062
+              //   'patients': this.export_date
1063
+              // }
1064
+              // postExportPatients(params).then(
1065
+              //   response => {
1066
+              //     if (response.data.state === 1) {
1067
+              //       this.getList()
1068
+              //     } else {
1069
+              //       this.$message.error(response.data.msg)
1070
+              //     }
1071
+              //   }
1072
+              // )
1073
+
883
             }
1074
             }
884
           }
1075
           }
885
         )
1076
         )
1077
+
886
       },
1078
       },
887
       getCount(row) {
1079
       getCount(row) {
888
         console.log(row)
1080
         console.log(row)
946
         this.pageSelect = this.multipleSelection.length
1138
         this.pageSelect = this.multipleSelection.length
947
       },
1139
       },
948
 
1140
 
949
-    handleCheckedCitiesChange(value) {
950
-      const checkedCount = value.length;
951
-      this.checkAll = checkedCount === this.cities.length;
952
-      this.isIndeterminate =
953
-        checkedCount > 0 && checkedCount < this.cities.length;
954
-    },
955
-    handleSizeChange(val) {
956
-      this.listQuery.limit = val;
957
-      this.getList();
958
-    },
959
-    handleCurrentChange(val) {
960
-      this.listQuery.page = val;
961
-      this.getList();
962
-    },
963
-    changeCategoryId(categoryId) {
964
-      this.categoryId = categoryId;
965
-    },
966
-    selectSchedulType(scheduleType) {
967
-      // alert(scheduleType);/
968
-      this.schedulType = scheduleType;
969
-      this.listQuery.schedul_type = scheduleType;
970
-      this.getList();
971
-    },
972
-    selectSystemType(systemType) {
973
-      this.systemType = systemType;
974
-      this.listQuery.binding_state = systemType;
975
-      this.getList();
976
-    },
977
-    selectLapseTo(lapseto) {
978
-      this.lapsetoType = lapseto;
979
-      this.listQuery.lapseto = lapseto;
980
-      this.getList();
981
-    },
982
-    selectSource(source) {
983
-      this.sourceType = source;
984
-      this.listQuery.source = source;
985
-      this.getList();
986
-    },
987
-    changeTimeOne(val) {
988
-      var time = this.getTimestamp(val) - this.end_time;
989
-      if (time > 0) {
990
-        this.$message.error("结束时间不能小于开始时间");
991
-        this.listQuery.start_time = "";
992
-      } else {
993
-        this.getList();
994
-        this.startTime = this.getTimestamp(val);
995
-      }
996
-    },
997
-    changeTime(val) {
998
-      var time = this.getTimestamp(val) - this.startTime;
999
-      if (time < 0) {
1000
-        this.$message.error("结束时间不能小于开始时间");
1001
-        this.listQuery.end_time = "";
1002
-      } else {
1003
-        this.getList();
1004
-        this.end_time = this.getTimestamp(val);
1005
-      }
1006
-    },
1007
-    getTimestamp(time) {
1008
-      // 把时间日期转成时间戳
1009
-      return new Date(time).getTime() / 1000;
1010
-    },
1011
-    search() {
1012
-      this.listQuery.keywords = this.searchKey;
1013
-      this.getList();
1014
-    },
1015
-    changeOtherSearch() {
1016
-      this.getList();
1017
-    },
1018
-    getList() {
1019
-      fetchList(this.listQuery).then(response => {
1020
-        if (response.data.state === 0) {
1021
-          this.$message.error(response.data.msg);
1022
-          return false;
1141
+      handleCheckedCitiesChange(value) {
1142
+        const checkedCount = value.length
1143
+        this.checkAll = checkedCount === this.cities.length
1144
+        this.isIndeterminate =
1145
+          checkedCount > 0 && checkedCount < this.cities.length
1146
+      },
1147
+      handleSizeChange(val) {
1148
+        this.listQuery.limit = val
1149
+        this.getList()
1150
+      },
1151
+      handleCurrentChange(val) {
1152
+        this.listQuery.page = val
1153
+        this.getList()
1154
+      },
1155
+      changeCategoryId(categoryId) {
1156
+        this.categoryId = categoryId
1157
+      },
1158
+      selectSchedulType(scheduleType) {
1159
+        // alert(scheduleType);/
1160
+        this.schedulType = scheduleType
1161
+        this.listQuery.schedul_type = scheduleType
1162
+        this.getList()
1163
+      },
1164
+      selectSystemType(systemType) {
1165
+        this.systemType = systemType
1166
+        this.listQuery.binding_state = systemType
1167
+        this.getList()
1168
+      },
1169
+      selectLapseTo(lapseto) {
1170
+        this.lapsetoType = lapseto
1171
+        this.listQuery.lapseto = lapseto
1172
+        this.getList()
1173
+      },
1174
+      selectSource(source) {
1175
+        this.sourceType = source
1176
+        this.listQuery.source = source
1177
+        this.getList()
1178
+      },
1179
+      changeTimeOne(val) {
1180
+        var time = this.getTimestamp(val) - this.end_time
1181
+        if (time > 0) {
1182
+          this.$message.error('结束时间不能小于开始时间')
1183
+          this.listQuery.start_time = ''
1023
         } else {
1184
         } else {
1024
-          this.tableData = response.data.data.patients;
1025
-          // console.log('病人是', this.tableData)
1026
-          this.pageTotal = this.tableData.length;
1027
-          this.total = response.data.data.total;
1185
+          this.getList()
1186
+          this.startTime = this.getTimestamp(val)
1028
         }
1187
         }
1029
-      });
1030
-    },
1188
+      },
1189
+      changeTime(val) {
1190
+        var time = this.getTimestamp(val) - this.startTime
1191
+        if (time < 0) {
1192
+          this.$message.error('结束时间不能小于开始时间')
1193
+          this.listQuery.end_time = ''
1194
+        } else {
1195
+          this.getList()
1196
+          this.end_time = this.getTimestamp(val)
1197
+        }
1198
+      },
1199
+      getTimestamp(time) {
1200
+        // 把时间日期转成时间戳
1201
+        return new Date(time).getTime() / 1000
1202
+      },
1203
+      search() {
1204
+        this.listQuery.keywords = this.searchKey
1205
+        this.getList()
1206
+      },
1207
+      changeOtherSearch() {
1208
+        this.getList()
1209
+      },
1210
+      getList() {
1211
+        fetchList(this.listQuery).then(response => {
1212
+          if (response.data.state === 0) {
1213
+            this.$message.error(response.data.msg)
1214
+            return false
1215
+          } else {
1216
+            this.tableData = response.data.data.patients
1217
+            // console.log('病人是', this.tableData)
1218
+            this.pageTotal = this.tableData.length
1219
+            this.total = response.data.data.total
1220
+          }
1221
+        })
1222
+      },
1031
 
1223
 
1032
       OpenView(name, number, id) {
1224
       OpenView(name, number, id) {
1033
         this.name = name
1225
         this.name = name

+ 42 - 103
src/xt_pages/workforce/appointment.vue Ver arquivo

11
         <br/>
11
         <br/>
12
         <br/>
12
         <br/>
13
         <span>{{getContent(item)}}</span>
13
         <span>{{getContent(item)}}</span>
14
-        <span style="color:blue"  @click="generateTxt(item)">点击</span>
14
+        <span style="color:blue" @click="generateTxt(item)">点击</span>
15
         <span>查看详情</span>
15
         <span>查看详情</span>
16
         <br/>
16
         <br/>
17
         <br/>
17
         <br/>
54
         <div>
54
         <div>
55
           <schedule-upload-excel style="float:left;margin-right: -500px" :on-success='handleSuccess'
55
           <schedule-upload-excel style="float:left;margin-right: -500px" :on-success='handleSuccess'
56
                                  :before-upload="beforeUpload"></schedule-upload-excel>
56
                                  :before-upload="beforeUpload"></schedule-upload-excel>
57
-        <el-button v-if="isShow()" type="primary" size="small" @click="export_file()"
58
-                   :loading="downloadLoading"
59
-        >
60
-          导出模版
61
-        </el-button>
62
-
63
-        <el-button
64
-          @click="generateLog()"
65
-          class="filter-item"
66
-          type="primary"
67
-          size="small"
68
-        >下载错误日志
69
-        </el-button>
70
-
71
-        <el-button type="primary" size="small" icon="el-icon-printer" @click="printScheduleAction">打印</el-button>
72
-        <el-button type="primary" size="small" icon="el-icon-setting" @click="setScheduleTemplateAction">排班模板
73
-        </el-button>
57
+          <el-button v-if="isShow()" type="primary" size="small" @click="export_file()"
58
+                     :loading="downloadLoading"
59
+          >
60
+            导出模版
61
+          </el-button>
62
+
63
+          <el-button
64
+            @click="generateLog()"
65
+            class="filter-item"
66
+            type="primary"
67
+            size="small"
68
+          >下载错误日志
69
+          </el-button>
70
+
71
+          <el-button type="primary" size="small" icon="el-icon-printer" @click="printScheduleAction">打印</el-button>
72
+          <el-button type="primary" size="small" icon="el-icon-setting" @click="setScheduleTemplateAction">排班模板
73
+          </el-button>
74
         </div>
74
         </div>
75
       </el-col>
75
       </el-col>
76
     </div>
76
     </div>
103
 <script>
103
 <script>
104
   import { parseTime } from '@/utils'
104
   import { parseTime } from '@/utils'
105
   import tableData from './components/tableData'
105
   import tableData from './components/tableData'
106
-  import { exportSchedule, getWeekPanels,initDate } from '@/api/schedule'
106
+  import { exportSchedule, getWeekPanels, initDate } from '@/api/schedule'
107
   import BreadCrumb from '@/xt_pages/components/bread-crumb'
107
   import BreadCrumb from '@/xt_pages/components/bread-crumb'
108
   import UploadExcel from '@/xt_pages/components/UploadExcel'
108
   import UploadExcel from '@/xt_pages/components/UploadExcel'
109
   import ScheduleUploadExcel from './components/scheduleUploadExcel/index'
109
   import ScheduleUploadExcel from './components/scheduleUploadExcel/index'
121
         tabPosition: 'top',
121
         tabPosition: 'top',
122
         partitions: {},
122
         partitions: {},
123
         scheduleZone: [],
123
         scheduleZone: [],
124
-        days:[],
125
-        logs:[],
124
+        days: [],
125
+        logs: [],
126
         scheduleZoneRow: [],
126
         scheduleZoneRow: [],
127
         downloadLoading: false,
127
         downloadLoading: false,
128
         msgTipVisible: false,
128
         msgTipVisible: false,
129
         dialogVisible: false,
129
         dialogVisible: false,
130
         isExistRepeatVisible: false,
130
         isExistRepeatVisible: false,
131
-        exportLogVisible:false,
131
+        exportLogVisible: false,
132
         theWeek: {
132
         theWeek: {
133
           lastWeek: 0,
133
           lastWeek: 0,
134
           thisWeek: 0,
134
           thisWeek: 0,
144
       UploadExcel
144
       UploadExcel
145
     },
145
     },
146
     methods: {
146
     methods: {
147
-      generateTxt:function(log) {
147
+      generateTxt: function(log) {
148
         var content = ''
148
         var content = ''
149
-        var errlog =  log.err_logs
150
-        for (let i = 0; i< errlog.length; i++){
149
+        var errlog = log.err_logs
150
+        content = this.getContent(log)
151
+
152
+        for (let i = 0; i < errlog.length; i++) {
151
           if (content.length == 0) {
153
           if (content.length == 0) {
152
             content = errlog[i].err_msg
154
             content = errlog[i].err_msg
153
-          }else{
154
-            content = content +"\n"+errlog[i].err_msg
155
+          } else {
156
+            content = content + '\n' + errlog[i].err_msg
155
           }
157
           }
156
         }
158
         }
157
 
159
 
158
-
159
         var url = new Blob(['\ufeff' + content], { type: 'text/txt,charset=UTF-8' })
160
         var url = new Blob(['\ufeff' + content], { type: 'text/txt,charset=UTF-8' })
160
         if (typeof url === 'object' && url instanceof Blob) {
161
         if (typeof url === 'object' && url instanceof Blob) {
161
           url = URL.createObjectURL(url) // 创建blob地址
162
           url = URL.createObjectURL(url) // 创建blob地址
162
         }
163
         }
163
         const aLink = document.createElement('a')
164
         const aLink = document.createElement('a')
164
         aLink.href = url
165
         aLink.href = url
165
-        aLink.download = this.timestampToTime(log.export_time)+'错误日志.txt'
166
+        aLink.download = this.timestampToTime(log.export_time) + '错误日志.txt'
166
         aLink.click()
167
         aLink.click()
167
 
168
 
168
       },
169
       },
173
         var D = (date.getDate() < 10 ? '0' + (date.getDate()) : date.getDate()) + '日 '
174
         var D = (date.getDate() < 10 ? '0' + (date.getDate()) : date.getDate()) + '日 '
174
         var h = (date.getHours() < 10 ? '0' + (date.getHours()) : date.getHours()) + '时'
175
         var h = (date.getHours() < 10 ? '0' + (date.getHours()) : date.getHours()) + '时'
175
         var m = (date.getMinutes() < 10 ? '0' + (date.getMinutes()) : date.getMinutes()) + '分'
176
         var m = (date.getMinutes() < 10 ? '0' + (date.getMinutes()) : date.getMinutes()) + '分'
176
-        var s = (date.getSeconds() < 10 ? '0' + (date.getSeconds()) : date.getSeconds())+'秒'
177
+        var s = (date.getSeconds() < 10 ? '0' + (date.getSeconds()) : date.getSeconds()) + '秒'
177
         return Y + M + D + h + m + s
178
         return Y + M + D + h + m + s
178
       },
179
       },
179
       getContent(log) {
180
       getContent(log) {
420
           }
421
           }
421
           console.log(list)
422
           console.log(list)
422
           const data = this.formatJson(filterVal, list)
423
           const data = this.formatJson(filterVal, list)
423
-          const filename = "排班模版"
424
+          const filename = '排班模版'
424
           excel.export_json_to_excel({
425
           excel.export_json_to_excel({
425
             multiHeader,
426
             multiHeader,
426
             header,
427
             header,
427
             merges,
428
             merges,
428
             data,
429
             data,
429
-            filename,
430
+            filename
430
           })
431
           })
431
           this.downloadLoading = false
432
           this.downloadLoading = false
432
         })
433
         })
477
         return isShow
478
         return isShow
478
       }, handleSuccess({ results, header }) {
479
       }, handleSuccess({ results, header }) {
479
 
480
 
480
-
481
-
482
-        if(results.length > 0) {
481
+        if (results.length > 0) {
483
           let headers = []
482
           let headers = []
484
           for (let key in results[0]) {
483
           for (let key in results[0]) {
485
             headers.push(key)
484
             headers.push(key)
612
             this.dialogVisible = true
611
             this.dialogVisible = true
613
             return
612
             return
614
           }
613
           }
615
-        }else{
614
+        } else {
616
           this.dialogVisible = true
615
           this.dialogVisible = true
617
           return
616
           return
618
         }
617
         }
619
 
618
 
620
-
621
-
622
         let is_system_zone = true
619
         let is_system_zone = true
623
         let is_device_number = true
620
         let is_device_number = true
624
         let zones = []
621
         let zones = []
678
         }
675
         }
679
 
676
 
680
 
677
 
681
-        console.log("111111111")
682
-        console.log(is_system_zone)
683
-        console.log(is_device_number)
684
-        console.log("22222222222")
685
-
686
-
687
 
678
 
688
-        //
689
 
679
 
690
         let tempObj = null
680
         let tempObj = null
691
         if (results.length > 0) {
681
         if (results.length > 0) {
699
 
689
 
700
             if (key != '区号' && key != '机号') {
690
             if (key != '区号' && key != '机号') {
701
               let obj = {}
691
               let obj = {}
702
-              obj['name'] = results[i + 1][key].trim()
692
+              obj['name'] = results[i + 1][key].replace(/\s/g, '')
703
               if (tempObj[key] == '上午') {
693
               if (tempObj[key] == '上午') {
704
                 obj['schedule_type'] = 1
694
                 obj['schedule_type'] = 1
705
               } else if (tempObj[key] == '下午') {
695
               } else if (tempObj[key] == '下午') {
731
 
721
 
732
               var current_date_two = new Date(m_year + '-' + m_month + '-' + m_date)
722
               var current_date_two = new Date(m_year + '-' + m_month + '-' + m_date)
733
 
723
 
734
-              if(new Date(tempObjTwo['schedule_date']).getTime() >=  new Date(current_date_two).getTime()) {
724
+              if (new Date(tempObjTwo['schedule_date']).getTime() >= new Date(current_date_two).getTime()) {
735
                 datas.push(tempObjTwo)
725
                 datas.push(tempObjTwo)
736
               }
726
               }
737
             }
727
             }
739
 
729
 
740
         }
730
         }
741
 
731
 
742
-        console.log("333333333")
743
-        console.log(datas)
744
-        console.log("44444444444")
745
 
732
 
746
         let date_arr = []
733
         let date_arr = []
747
         //校验文档是否规范
734
         //校验文档是否规范
777
           }
764
           }
778
         }
765
         }
779
 
766
 
780
-        console.log("333333333")
781
-        console.log(is_system_zone)
782
-        console.log(is_device_number)
783
-        console.log("44444444444")
767
+
784
 
768
 
785
         //校验文档中同一天同个人是否存在多个排班
769
         //校验文档中同一天同个人是否存在多个排班
786
         let is_exist_repeat = false
770
         let is_exist_repeat = false
820
           }
804
           }
821
         }
805
         }
822
 
806
 
823
-        console.log(header.length )
824
-        console.log(is_system_zone )
807
+        console.log(header.length)
808
+        console.log(is_system_zone)
825
         console.log(is_device_number)
809
         console.log(is_device_number)
826
 
810
 
827
-
828
         if (header.length > 65 || !is_system_zone || !is_device_number) {
811
         if (header.length > 65 || !is_system_zone || !is_device_number) {
829
           this.dialogVisible = true
812
           this.dialogVisible = true
830
           return
813
           return
844
             var day = day2.getDate() < 10 ? '0' + (day2.getDate()).toString() : (day2.getMonth() + 1).toString()
827
             var day = day2.getDate() < 10 ? '0' + (day2.getDate()).toString() : (day2.getMonth() + 1).toString()
845
 
828
 
846
             var date = day2.getFullYear() + '-' + month + '-' + day
829
             var date = day2.getFullYear() + '-' + month + '-' + day
847
-            exportSchedule(params,date).then(response => {
830
+            exportSchedule(params, date).then(response => {
848
               if (response.data.state == 0) {
831
               if (response.data.state == 0) {
849
                 return false
832
                 return false
850
               }
833
               }
851
               this.getWeekPanels()
834
               this.getWeekPanels()
852
 
835
 
853
-
854
-
855
             })
836
             })
856
           }
837
           }
857
 
838
 
858
         }
839
         }
859
 
840
 
860
       },
841
       },
861
-      getInitDate(){
842
+      getInitDate() {
862
         initDate().then(response => {
843
         initDate().then(response => {
863
           if (response.data.state == 0) {
844
           if (response.data.state == 0) {
864
             return false
845
             return false
865
           }
846
           }
866
-
867
           this.days = response.data.data.days
847
           this.days = response.data.data.days
868
-
869
-
870
-
871
         })
848
         })
872
       },
849
       },
873
       getWeekByResultsStr(key) {
850
       getWeekByResultsStr(key) {
1413
           case '周一_1': //下周一
1390
           case '周一_1': //下周一
1414
             return this.days[7]
1391
             return this.days[7]
1415
 
1392
 
1416
-
1417
-
1418
-
1419
             break
1393
             break
1420
 
1394
 
1421
           case '_14': //下周一
1395
           case '_14': //下周一
1422
 
1396
 
1423
             return this.days[7]
1397
             return this.days[7]
1424
 
1398
 
1425
-
1426
             break
1399
             break
1427
 
1400
 
1428
           case   '_15': //下周一
1401
           case   '_15': //下周一
1429
 
1402
 
1430
             return this.days[7]
1403
             return this.days[7]
1431
 
1404
 
1432
-
1433
             break
1405
             break
1434
 
1406
 
1435
           case '周一_2' : //下下周一
1407
           case '周一_2' : //下下周一
1442
 
1414
 
1443
             return this.days[14]
1415
             return this.days[14]
1444
 
1416
 
1445
-
1446
             break
1417
             break
1447
 
1418
 
1448
           case '_29': //下下周一
1419
           case '_29': //下下周一
1449
 
1420
 
1450
             return this.days[14]
1421
             return this.days[14]
1451
 
1422
 
1452
-
1453
             break
1423
             break
1454
 
1424
 
1455
           case '周二' : //本周二
1425
           case '周二' : //本周二
1475
           case  '_16' ://下周二
1445
           case  '_16' ://下周二
1476
             return this.days[8]
1446
             return this.days[8]
1477
 
1447
 
1478
-
1479
             break
1448
             break
1480
 
1449
 
1481
           case  '_17'://下周二
1450
           case  '_17'://下周二
1482
             return this.days[8]
1451
             return this.days[8]
1483
 
1452
 
1484
-
1485
             break
1453
             break
1486
 
1454
 
1487
           case '周二_2' ://下下周二
1455
           case '周二_2' ://下下周二
1488
             return this.days[15]
1456
             return this.days[15]
1489
 
1457
 
1490
-
1491
             break
1458
             break
1492
 
1459
 
1493
           case '_30' ://下下周二
1460
           case '_30' ://下下周二
1508
           case  '_4': //本周三
1475
           case  '_4': //本周三
1509
             return this.days[2]
1476
             return this.days[2]
1510
 
1477
 
1511
-
1512
             break
1478
             break
1513
 
1479
 
1514
           case '_5': //本周三
1480
           case '_5': //本周三
1515
             return this.days[2]
1481
             return this.days[2]
1516
 
1482
 
1517
-
1518
             break
1483
             break
1519
 
1484
 
1520
           case '周三_1': //下周三
1485
           case '周三_1': //下周三
1521
             return this.days[9]
1486
             return this.days[9]
1522
 
1487
 
1523
-
1524
             break
1488
             break
1525
 
1489
 
1526
           case  '_18' : //下周三
1490
           case  '_18' : //下周三
1527
             return this.days[9]
1491
             return this.days[9]
1528
 
1492
 
1529
-
1530
             break
1493
             break
1531
 
1494
 
1532
           case '_19': //下周三
1495
           case '_19': //下周三
1533
             return this.days[9]
1496
             return this.days[9]
1534
 
1497
 
1535
-
1536
             break
1498
             break
1537
 
1499
 
1538
           case '周三_2' : //下下周三
1500
           case '周三_2' : //下下周三
1539
             return this.days[16]
1501
             return this.days[16]
1540
 
1502
 
1541
-
1542
             break
1503
             break
1543
 
1504
 
1544
           case '_32' : //下下周三
1505
           case '_32' : //下下周三
1545
             return this.days[16]
1506
             return this.days[16]
1546
 
1507
 
1547
-
1548
             break
1508
             break
1549
 
1509
 
1550
           case  '_33': //下下周三
1510
           case  '_33': //下下周三
1560
           case '_6' :
1520
           case '_6' :
1561
             return this.days[4]
1521
             return this.days[4]
1562
 
1522
 
1563
-
1564
             break
1523
             break
1565
 
1524
 
1566
           case  '_7':
1525
           case  '_7':
1567
             return this.days[4]
1526
             return this.days[4]
1568
 
1527
 
1569
-
1570
             break
1528
             break
1571
 
1529
 
1572
           case '周四_1':
1530
           case '周四_1':
1573
 
1531
 
1574
             return this.days[10]
1532
             return this.days[10]
1575
 
1533
 
1576
-
1577
             break
1534
             break
1578
 
1535
 
1579
           case '_20' :
1536
           case '_20' :
1592
 
1549
 
1593
             return this.days[17]
1550
             return this.days[17]
1594
 
1551
 
1595
-
1596
             break
1552
             break
1597
 
1553
 
1598
           case '_34':
1554
           case '_34':
1609
           case '周五':
1565
           case '周五':
1610
             return this.days[4]
1566
             return this.days[4]
1611
 
1567
 
1612
-
1613
             break
1568
             break
1614
 
1569
 
1615
           case  '_8':
1570
           case  '_8':
1616
             return this.days[4]
1571
             return this.days[4]
1617
 
1572
 
1618
-
1619
             break
1573
             break
1620
 
1574
 
1621
           case  '_9':
1575
           case  '_9':
1622
             return this.days[4]
1576
             return this.days[4]
1623
 
1577
 
1624
-
1625
             break
1578
             break
1626
           case '周五_1' :
1579
           case '周五_1' :
1627
             return this.days[11]
1580
             return this.days[11]
1628
 
1581
 
1629
-
1630
             break
1582
             break
1631
 
1583
 
1632
           case '_22' :
1584
           case '_22' :
1637
           case  '_23':
1589
           case  '_23':
1638
             return this.days[11]
1590
             return this.days[11]
1639
 
1591
 
1640
-
1641
             break
1592
             break
1642
           case '周五_2' :
1593
           case '周五_2' :
1643
             return this.days[18]
1594
             return this.days[18]
1644
 
1595
 
1645
-
1646
             break
1596
             break
1647
 
1597
 
1648
           case '_36':
1598
           case '_36':
1649
             return this.days[18]
1599
             return this.days[18]
1650
 
1600
 
1651
-
1652
             break
1601
             break
1653
 
1602
 
1654
           case  '_37':
1603
           case  '_37':
1659
           case '周六' :
1608
           case '周六' :
1660
             return this.days[5]
1609
             return this.days[5]
1661
 
1610
 
1662
-
1663
             break
1611
             break
1664
 
1612
 
1665
           case  '_10' :
1613
           case  '_10' :
1670
           case '_11':
1618
           case '_11':
1671
             return this.days[5]
1619
             return this.days[5]
1672
 
1620
 
1673
-
1674
             break
1621
             break
1675
           case '周六_1' :
1622
           case '周六_1' :
1676
             return this.days[12]
1623
             return this.days[12]
1677
 
1624
 
1678
-
1679
             break
1625
             break
1680
 
1626
 
1681
           case  '_24' :
1627
           case  '_24' :
1682
             return this.days[12]
1628
             return this.days[12]
1683
 
1629
 
1684
-
1685
             break
1630
             break
1686
 
1631
 
1687
           case  '_25':
1632
           case  '_25':
1692
           case '周六_2' :
1637
           case '周六_2' :
1693
             return this.days[19]
1638
             return this.days[19]
1694
 
1639
 
1695
-
1696
             break
1640
             break
1697
 
1641
 
1698
           case '_38' :
1642
           case '_38' :
1699
             return this.days[19]
1643
             return this.days[19]
1700
 
1644
 
1701
-
1702
             break
1645
             break
1703
 
1646
 
1704
           case '_39':
1647
           case '_39':
1705
             return this.days[19]
1648
             return this.days[19]
1706
 
1649
 
1707
-
1708
             break
1650
             break
1709
           case '周日' :
1651
           case '周日' :
1710
             return this.days[6]
1652
             return this.days[6]
1711
 
1653
 
1712
-
1713
             break
1654
             break
1714
 
1655
 
1715
           case  '_12' :
1656
           case  '_12' :
1723
           case '周日_1' :
1664
           case '周日_1' :
1724
             return this.days[13]
1665
             return this.days[13]
1725
 
1666
 
1726
-
1727
             break
1667
             break
1728
 
1668
 
1729
           case  '_26' :
1669
           case  '_26' :
1730
             return this.days[13]
1670
             return this.days[13]
1731
 
1671
 
1732
-
1733
             break
1672
             break
1734
 
1673
 
1735
           case  '_27':
1674
           case  '_27':

+ 2 - 1
src/xt_pages/workforce/template.vue Ver arquivo

221
       generateTxt:function(log) {
221
       generateTxt:function(log) {
222
         var content = ''
222
         var content = ''
223
         var errlog =  log.err_logs
223
         var errlog =  log.err_logs
224
+        content = this.getContent(log)
224
         for (let i = 0; i< errlog.length; i++){
225
         for (let i = 0; i< errlog.length; i++){
225
           if (content.length == 0) {
226
           if (content.length == 0) {
226
             content = errlog[i].err_msg
227
             content = errlog[i].err_msg
564
 
565
 
565
             if (key != '区号' && key != '机号') {
566
             if (key != '区号' && key != '机号') {
566
               let obj = {}
567
               let obj = {}
567
-              obj['name'] = results[i + 1][key].trim()
568
+              obj['name'] = results[i + 1][key].replace(/\s/g,"")
568
               if (tempObj[key] == '上午') {
569
               if (tempObj[key] == '上午') {
569
                 obj['schedule_type'] = 1
570
                 obj['schedule_type'] = 1
570
               } else if (tempObj[key] == '下午') {
571
               } else if (tempObj[key] == '下午') {

+ 13 - 13
src/xt_permission.js Ver arquivo

12
 
12
 
13
 router.beforeEach((to, from, next) => {
13
 router.beforeEach((to, from, next) => {
14
   // 线上注释
14
   // 线上注释
15
-  // if (!store.getters.configlist || store.getters.configlist === undefined || store.getters.configlist.length <= 0) {
16
-  //  store.dispatch('VerifyConfigList', []).then(() => {
17
-  //    next()
18
-  // })
19
-  // }
20
-  // if (store.getters.permission_routers === undefined) {
21
-  //  store.dispatch('xt_GenerateRoutes', []).then(() => {
22
-  //    next()
23
-  //  })
24
-  // } else {
25
-  //   next()
26
-  // }
27
-  // return
15
+  //   if (!store.getters.configlist || store.getters.configlist === undefined || store.getters.configlist.length <= 0) {
16
+  //    store.dispatch('VerifyConfigList', []).then(() => {
17
+  //      next()
18
+  //   })
19
+  //   }
20
+  //   if (store.getters.permission_routers === undefined) {
21
+  //    store.dispatch('xt_GenerateRoutes', []).then(() => {
22
+  //      next()
23
+  //    })
24
+  //   } else {
25
+  //     next()
26
+  //   }
27
+  //   return
28
   // 线上注释
28
   // 线上注释
29
 
29
 
30
   NProgress.start();
30
   NProgress.start();