csx 5 лет назад
Родитель
Сommit
931c214820

+ 1 - 1
build/cdn.json Просмотреть файл

@@ -1,3 +1,3 @@
1 1
 {
2
-  "version": "1.0.52"
2
+  "version": "1.0.55"
3 3
 }

+ 277 - 269
src/pages/main/dialog/PrescriptionDialog.vue Просмотреть файл

@@ -366,13 +366,18 @@
366 366
       },
367 367
       prescription_prop: {
368 368
         type: Object,
369
-      }, status: {
369
+      }, is_open: {
370 370
         type: Number,
371 371
       }, targetAdvices: {
372 372
         type: Array,
373 373
         default: function () {
374 374
           return new Array()
375 375
         }
376
+      }, waitUploadAdvices: {
377
+        type: Array,
378
+        default: function () {
379
+          return new Array()
380
+        }
376 381
       },
377 382
       machines_prop: {
378 383
         type: Array,
@@ -383,6 +388,7 @@
383 388
     },
384 389
     data () {
385 390
       return {
391
+        is_pre:0,
386 392
         loading: false,
387 393
         signUrl: '',
388 394
         isShowDesc: true,
@@ -706,7 +712,7 @@
706 712
           advice_doctor: targetAdvices[0].advice_doctor,
707 713
           advice_type: targetAdvices[0].advice_type,
708 714
           parent_id: this.patient_id,
709
-          start_time: parseTime(this.$route.query.date, '{y}-{m}-{d}') + ' ' + parseTime(targetAdvices[0].start_time, '{y}-{m}-{d}A{h}:{i}').split('A')[1],
715
+          start_time: parseTime(this.$route.query.date, '{y}-{m}-{d}'),
710 716
           remark: '',
711 717
         }
712 718
         CreateGroupAdvice(this.$route.query.patient_id, 0, params).then(rs => {
@@ -717,23 +723,49 @@
717 723
 
718 724
           }
719 725
         })
720
-        Toast.loading({forbidClick: true, duration: 0})
721
-        let ParamsQuery = this.dialysisPrescription
722
-        ParamsQuery['patient'] = this.$route.query.patient_id
723
-        ParamsQuery['record_date'] = this.record_date
724
-        commitDialysisPrescription(ParamsQuery).then(response => {
725
-          if (response.data.state == 0) {
726
-            Toast.fail(response.data.msg)
727
-            return false
728
-          } else {
729
-            Toast.success('提交成功')
730
-            this.$emit('prescription', response.data.data.prescription)
731
-            // for (const key in response.data.data.prescription) {
732
-            //   // this.prescription_prop[key] = response.data.data.prescription[key];
733
-            // }
734
-            this.finish()
735
-          }
736
-        })
726
+
727
+        if (this.is_pre == 1){
728
+          Toast.loading({forbidClick: true, duration: 0})
729
+          let ParamsQuery = this.dialysisPrescription
730
+          ParamsQuery['patient'] = this.$route.query.patient_id
731
+          ParamsQuery['record_date'] = this.record_date
732
+          commitDialysisPrescription(ParamsQuery).then(response => {
733
+            if (response.data.state == 0) {
734
+              Toast.fail(response.data.msg)
735
+              return false
736
+            } else {
737
+              Toast.success('提交成功')
738
+              this.$emit('prescription', response.data.data.prescription)
739
+              // for (const key in response.data.data.prescription) {
740
+              //   // this.prescription_prop[key] = response.data.data.prescription[key];
741
+              // }
742
+              this.finish()
743
+            }
744
+          })
745
+
746
+        }else if(this.is_pre == 2){
747
+          Toast.loading({forbidClick: true, duration: 0})
748
+          let ParamsQuery = this.dialysisPrescription
749
+          ParamsQuery['patient'] = this.$route.query.patient_id
750
+          ParamsQuery['record_date'] = this.record_date
751
+          postSolution(ParamsQuery).then(response => {
752
+            if (response.data.state == 0) {
753
+              Toast.fail(response.data.msg)
754
+              return false
755
+            } else {
756
+              Toast.success('提交成功')
757
+
758
+              this.$emit('advice')
759
+              this.$emit('longSolution', response.data.data.solution)
760
+              this.$emit('prescription', response.data.data.prescription)
761
+              this.finish()
762
+
763
+            }
764
+          })
765
+
766
+        }
767
+
768
+
737 769
       },
738 770
       menuComfirm: function (val) {
739 771
         this.visibility = false
@@ -851,263 +883,238 @@
851 883
         return anticoagulan_name
852 884
       },
853 885
       commitInfo: function () {
886
+        this.is_pre = 1
854 887
 
855
-        Toast.loading({forbidClick: true, duration: 0})
856
-        let ParamsQuery = this.dialysisPrescription
857
-        ParamsQuery['patient'] = this.$route.query.patient_id
858
-        ParamsQuery['record_date'] = this.record_date
859
-        commitDialysisPrescription(ParamsQuery).then(response => {
860
-          if (response.data.state == 0) {
861
-            Toast.fail(response.data.msg)
862
-            return false
863
-          } else {
864
-            Toast.success('提交成功')
865
-            this.$emit('prescription', response.data.data.prescription)
866
-            this.$emit('advice')
867
-            // for (const key in response.data.data.prescription) {
868
-            //   // this.prescription_prop[key] = response.data.data.prescription[key];
869
-            // }
870
-            this.finish()
871 888
 
889
+        if (this.prescription_prop.id == '') {
890
+          console.log(this.is_open)
891
+          if (this.is_open == 1) {
892
+            //弹框推送提醒
893
+            this.advicePropForm.list = this.targetAdvices
894
+            this.advicePropForm.operators = this.admin_users_prop
895
+            this.advice_visibility = true
896
+            this.isShowDialog = false
897
+
898
+            for (let i = 0; i < this.advicePropForm.list.length; i++) {
899
+              if (this.advicePropForm.list[i].parent_id == 0 && this.advicePropForm.list[i].isCheck == 1) {
900
+                this.advicePropForm.result.push(this.advicePropForm.list[i].id)
901
+              }
902
+            }
903
+
904
+          } else if (this.is_open == 2) {
905
+            this.advice_visibility = false
906
+            let params = {
907
+              advices: this.waitUploadAdvices,
908
+              advice_date: parseTime(this.$route.query.date, '{y}-{m}-{d}'),
909
+              advice_doctor: this.waitUploadAdvices[0].advice_doctor,
910
+              advice_type: this.waitUploadAdvices[0].advice_type,
911
+              parent_id: this.patient_id,
912
+              start_time: parseTime(this.$route.query.date, '{y}-{m}-{d}'),
913
+              remark: '',
914
+            }
915
+            CreateGroupAdvice(this.$route.query.patient_id, 0, params).then(rs => {
916
+              var resp = rs.data
917
+              if (resp.state == 1) {
918
+
919
+              } else {
920
+
921
+              }
922
+            })
923
+
924
+            Toast.loading({forbidClick: true, duration: 0})
925
+            let ParamsQuery = this.dialysisPrescription
926
+            ParamsQuery['patient'] = this.$route.query.patient_id
927
+            ParamsQuery['record_date'] = this.record_date
928
+            commitDialysisPrescription(ParamsQuery).then(response => {
929
+              if (response.data.state == 0) {
930
+                Toast.fail(response.data.msg)
931
+                return false
932
+              } else {
933
+                Toast.success('提交成功')
934
+
935
+                this.$emit('prescription', response.data.data.prescription)
936
+                this.finish()
937
+
938
+              }
939
+            })
872 940
           }
873
-        })
874
-        // if (this.targetAdvices.length > 0) {
875
-        //
876
-        //   if (this.prescription_prop.id == '') {
877
-        //     if (this.status == 2) {
878
-        //       //弹框推送提醒
879
-        //       this.advicePropForm.list = this.targetAdvices
880
-        //       this.advicePropForm.operators = this.admin_users_prop
881
-        //       this.advice_visibility = true
882
-        //       this.isShowDialog = false
883
-        //
884
-        //       for (let i = 0; i < this.advicePropForm.list.length; i++) {
885
-        //         if (this.advicePropForm.list[i].parent_id == 0 && this.advicePropForm.list[i].isCheck == 1) {
886
-        //           this.advicePropForm.result.push(this.advicePropForm.list[i].id)
887
-        //         }
888
-        //       }
889
-        //
890
-        //     } else if (this.status == 3) {
891
-        //       this.advice_visibility = false
892
-        //       let params = {
893
-        //         advices: this.targetAdvices,
894
-        //         advice_date: parseTime(this.$route.query.date, '{y}-{m}-{d}'),
895
-        //         advice_doctor: this.targetAdvices[0].advice_doctor,
896
-        //         advice_type: this.targetAdvices[0].advice_type,
897
-        //         parent_id: this.patient_id,
898
-        //         start_time: parseTime(this.$route.query.date, '{y}-{m}-{d}') + ' ' + parseTime(this.targetAdvices[0].start_time, '{y}-{m}-{d}A{h}:{i}').split('A')[1],
899
-        //         remark: '',
900
-        //       }
901
-        //       CreateGroupAdvice(this.$route.query.patient_id, 0, params).then(rs => {
902
-        //         var resp = rs.data
903
-        //         if (resp.state == 1) {
904
-        //
905
-        //         } else {
906
-        //
907
-        //         }
908
-        //       })
909
-        //
910
-        //
911
-        //     }
912
-        //
913
-        //   } else {
914
-        //     if (this.dialysisPrescription.creater == 0) {
915
-        //       if (this.status == 2) {
916
-        //         //弹框推送提醒
917
-        //         this.advicePropForm.list = this.targetAdvices
918
-        //         this.advicePropForm.operators = this.admin_users_prop
919
-        //         this.advice_visibility = true
920
-        //         this.isShowDialog = false
921
-        //         for (let i = 0; i < this.advicePropForm.list.length; i++) {
922
-        //           if (this.advicePropForm.list[i].parent_id == 0 && this.advicePropForm.list[i].isCheck == 1) {
923
-        //             this.advicePropForm.result.push(this.advicePropForm.list[i].id)
924
-        //           }
925
-        //         }
926
-        //       } else if (this.status == 3) {
927
-        //         this.advice_visibility = false
928
-        //         let params = {
929
-        //           advices: this.targetAdvices,
930
-        //           advice_date: parseTime(this.$route.query.date, '{y}-{m}-{d}'),
931
-        //           advice_doctor: this.targetAdvices[0].advice_doctor,
932
-        //           advice_type: this.targetAdvices[0].advice_type,
933
-        //           parent_id: this.patient_id,
934
-        //           start_time: parseTime(this.$route.query.date, '{y}-{m}-{d}') + ' ' + parseTime(this.targetAdvices[0].start_time, '{y}-{m}-{d}A{h}:{i}').split('A')[1],
935
-        //           remark: '',
936
-        //         }
937
-        //         CreateGroupAdvice(this.$route.query.patient_id, 0, params).then(rs => {
938
-        //           var resp = rs.data
939
-        //           if (resp.state == 1) {
940
-        //           } else {
941
-        //           }
942
-        //         })
943
-        //       }
944
-        //     }
945
-        //
946
-        //     Toast.loading({forbidClick: true, duration: 0})
947
-        //     let ParamsQuery = this.dialysisPrescription
948
-        //     ParamsQuery['patient'] = this.$route.query.patient_id
949
-        //     ParamsQuery['record_date'] = this.record_date
950
-        //     commitDialysisPrescription(ParamsQuery).then(response => {
951
-        //       if (response.data.state == 0) {
952
-        //         Toast.fail(response.data.msg)
953
-        //         return false
954
-        //       } else {
955
-        //         Toast.success('提交成功')
956
-        //
957
-        //         this.$emit('prescription', response.data.data.prescription)
958
-        //         this.finish()
959
-        //
960
-        //       }
961
-        //     })
962
-        //   }
963
-        // }
941
+
942
+        } else {
943
+          if (this.dialysisPrescription.creater == 0) {
944
+            if (this.is_open == 1) {
945
+              //弹框推送提醒
946
+              this.advicePropForm.list = this.targetAdvices
947
+              this.advicePropForm.operators = this.admin_users_prop
948
+              this.advice_visibility = true
949
+              this.isShowDialog = false
950
+
951
+              for (let i = 0; i < this.advicePropForm.list.length; i++) {
952
+                if (this.advicePropForm.list[i].parent_id == 0 && this.advicePropForm.list[i].isCheck == 1) {
953
+                  this.advicePropForm.result.push(this.advicePropForm.list[i].id)
954
+                }
955
+              }
956
+
957
+            } else if (this.is_open == 2) {
958
+              this.advice_visibility = false
959
+              let params = {
960
+                advices: this.waitUploadAdvices,
961
+                advice_date: parseTime(this.$route.query.date, '{y}-{m}-{d}'),
962
+                advice_doctor: this.waitUploadAdvices[0].advice_doctor,
963
+                advice_type: this.waitUploadAdvices[0].advice_type,
964
+                parent_id: this.patient_id,
965
+                start_time: parseTime(this.$route.query.date, '{y}-{m}-{d}'),
966
+                remark: '',
967
+              }
968
+              CreateGroupAdvice(this.$route.query.patient_id, 0, params).then(rs => {
969
+                var resp = rs.data
970
+                if (resp.state == 1) {
971
+
972
+                } else {
973
+
974
+                }
975
+              })
976
+
977
+            }
978
+          }
979
+
980
+          Toast.loading({forbidClick: true, duration: 0})
981
+          let ParamsQuery = this.dialysisPrescription
982
+          ParamsQuery['patient'] = this.$route.query.patient_id
983
+          ParamsQuery['record_date'] = this.record_date
984
+          commitDialysisPrescription(ParamsQuery).then(response => {
985
+            if (response.data.state == 0) {
986
+              Toast.fail(response.data.msg)
987
+              return false
988
+            } else {
989
+              Toast.success('提交成功')
990
+
991
+              this.$emit('prescription', response.data.data.prescription)
992
+              this.finish()
993
+
994
+            }
995
+          })
996
+        }
964 997
       }, commitSolutionInfo: function () {
998
+        this.is_pre = 2
999
+
1000
+        if (this.prescription_prop.id == '') {
1001
+          if (this.is_open == 1) {
1002
+            //弹框推送提醒
1003
+            this.advicePropForm.list = this.targetAdvices
1004
+            this.advicePropForm.operators = this.admin_users_prop
1005
+            this.advice_visibility = true
1006
+            this.isShowDialog = false
965 1007
 
966
-        Toast.loading({forbidClick: true, duration: 0})
967
-        let ParamsQuery = this.dialysisPrescription
968
-        ParamsQuery['patient'] = this.$route.query.patient_id
969
-        ParamsQuery['record_date'] = this.record_date
970
-        postSolution(ParamsQuery).then(response => {
971
-          if (response.data.state == 0) {
972
-            Toast.fail(response.data.msg)
973
-            return false
974
-          } else {
975
-            Toast.success('提交成功')
976
-            // for (const key in response.data.data.solution) {
977
-            //   this.solution_prop[key] = response.data.data.solution[key];
978
-            // }
979
-            // for (const key in response.data.data.prescription) {
980
-            //   this.prescription_prop[key] = response.data.data.prescription[key];
981
-            // }
982
-            // console.log(response.data.data.prescription)
983
-
984
-            // this.$emit('advice')
985
-            this.$emit('longSolution', response.data.data.solution)
986
-            this.$emit('prescription', response.data.data.prescription)
987
-            this.finish()
1008
+            for (let i = 0; i < this.advicePropForm.list.length; i++) {
1009
+              if (this.advicePropForm.list[i].parent_id == 0 && this.advicePropForm.list[i].isCheck == 1) {
1010
+                this.advicePropForm.result.push(this.advicePropForm.list[i].id)
1011
+              }
1012
+            }
1013
+
1014
+          } else if (this.is_open == 2) {
1015
+            this.advice_visibility = false
1016
+            let params = {
1017
+              advices: this.waitUploadAdvices,
1018
+              advice_date: parseTime(this.$route.query.date, '{y}-{m}-{d}'),
1019
+              advice_doctor: this.waitUploadAdvices[0].advice_doctor,
1020
+              advice_type: this.waitUploadAdvices[0].advice_type,
1021
+              parent_id: this.patient_id,
1022
+              start_time: parseTime(this.$route.query.date, '{y}-{m}-{d}'),
1023
+              remark: '',
1024
+            }
1025
+            CreateGroupAdvice(this.$route.query.patient_id, 0, params).then(rs => {
1026
+              var resp = rs.data
1027
+              if (resp.state == 1) {
1028
+
1029
+              } else {
1030
+
1031
+              }
1032
+            })
1033
+
1034
+            Toast.loading({forbidClick: true, duration: 0})
1035
+            let ParamsQuery = this.dialysisPrescription
1036
+            ParamsQuery['patient'] = this.$route.query.patient_id
1037
+            ParamsQuery['record_date'] = this.record_date
1038
+            postSolution(ParamsQuery).then(response => {
1039
+              if (response.data.state == 0) {
1040
+                Toast.fail(response.data.msg)
1041
+                return false
1042
+              } else {
1043
+                Toast.success('提交成功')
1044
+
1045
+                this.$emit('advice')
1046
+                this.$emit('longSolution', response.data.data.solution)
1047
+                this.$emit('prescription', response.data.data.prescription)
1048
+                this.finish()
1049
+
1050
+              }
1051
+            })
988 1052
 
989 1053
           }
990
-        })
991 1054
 
992
-        // if (this.targetAdvices.length > 0) {
993
-        //
994
-        //   if (this.prescription_prop.id == '') {
995
-        //     if (this.status == 2) {
996
-        //       //弹框推送提醒
997
-        //       this.advicePropForm.list = this.targetAdvices
998
-        //       this.advicePropForm.operators = this.admin_users_prop
999
-        //       this.advice_visibility = true
1000
-        //       this.isShowDialog = false
1001
-        //
1002
-        //       for (let i = 0; i < this.advicePropForm.list.length; i++) {
1003
-        //         if (this.advicePropForm.list[i].parent_id == 0) {
1004
-        //           this.advicePropForm.result.push(this.advicePropForm.list[i].id)
1005
-        //         }
1006
-        //       }
1007
-        //
1008
-        //     } else if (this.status == 3) {
1009
-        //       let params = {
1010
-        //         advices: this.targetAdvices,
1011
-        //         advice_date: parseTime(this.$route.query.date, '{y}-{m}-{d}'),
1012
-        //         advice_doctor: this.targetAdvices[0].advice_doctor,
1013
-        //         advice_type: this.targetAdvices[0].advice_type,
1014
-        //         parent_id: this.patient_id,
1015
-        //         start_time: parseTime(this.$route.query.date, '{y}-{m}-{d}') + ' ' + parseTime(this.targetAdvices[0].start_time, '{y}-{m}-{d}A{h}:{i}').split('A')[1],
1016
-        //         remark: '',
1017
-        //       }
1018
-        //       CreateGroupAdvice(this.$route.query.patient_id, 0, params).then(rs => {
1019
-        //         var resp = rs.data
1020
-        //         if (resp.state == 1) {
1021
-        //
1022
-        //         } else {
1023
-        //
1024
-        //         }
1025
-        //       })
1026
-        //
1027
-        //       Toast.loading({forbidClick: true, duration: 0})
1028
-        //       let ParamsQuery = this.dialysisPrescription
1029
-        //       ParamsQuery['patient'] = this.$route.query.patient_id
1030
-        //       ParamsQuery['record_date'] = this.record_date
1031
-        //       postSolution(ParamsQuery).then(response => {
1032
-        //         if (response.data.state == 0) {
1033
-        //           Toast.fail(response.data.msg)
1034
-        //           return false
1035
-        //         } else {
1036
-        //           Toast.success('提交成功')
1037
-        //           // for (const key in response.data.data.solution) {
1038
-        //           //   this.solution_prop[key] = response.data.data.solution[key];
1039
-        //           // }
1040
-        //           // for (const key in response.data.data.prescription) {
1041
-        //           //   this.prescription_prop[key] = response.data.data.prescription[key];
1042
-        //           // }
1043
-        //           // console.log(response.data.data.prescription)
1044
-        //
1045
-        //           this.$emit('advice')
1046
-        //           this.$emit('longSolution', response.data.data.solution)
1047
-        //           this.$emit('prescription', response.data.data.prescription)
1048
-        //           this.finish()
1049
-        //
1050
-        //         }
1051
-        //       })
1052
-        //
1053
-        //     } else {
1054
-        //
1055
-        //       Toast.loading({forbidClick: true, duration: 0})
1056
-        //       let ParamsQuery = this.dialysisPrescription
1057
-        //       ParamsQuery['patient'] = this.$route.query.patient_id
1058
-        //       ParamsQuery['record_date'] = this.record_date
1059
-        //       postSolution(ParamsQuery).then(response => {
1060
-        //         if (response.data.state == 0) {
1061
-        //           Toast.fail(response.data.msg)
1062
-        //           return false
1063
-        //         } else {
1064
-        //           Toast.success('提交成功')
1065
-        //           // for (const key in response.data.data.solution) {
1066
-        //           //   this.solution_prop[key] = response.data.data.solution[key];
1067
-        //           // }
1068
-        //           // for (const key in response.data.data.prescription) {
1069
-        //           //   this.prescription_prop[key] = response.data.data.prescription[key];
1070
-        //           // }
1071
-        //           // console.log(response.data.data.prescription)
1072
-        //
1073
-        //           this.$emit('longSolution', response.data.data.solution)
1074
-        //           this.$emit('prescription', response.data.data.prescription)
1075
-        //           this.finish()
1076
-        //
1077
-        //         }
1078
-        //       })
1079
-        //     }
1080
-        //   } else {
1081
-        //
1082
-        //     Toast.loading({forbidClick: true, duration: 0})
1083
-        //     let ParamsQuery = this.dialysisPrescription
1084
-        //     ParamsQuery['patient'] = this.$route.query.patient_id
1085
-        //     ParamsQuery['record_date'] = this.record_date
1086
-        //     postSolution(ParamsQuery).then(response => {
1087
-        //       if (response.data.state == 0) {
1088
-        //         Toast.fail(response.data.msg)
1089
-        //         return false
1090
-        //       } else {
1091
-        //         Toast.success('提交成功')
1092
-        //         // for (const key in response.data.data.solution) {
1093
-        //         //   this.solution_prop[key] = response.data.data.solution[key];
1094
-        //         // }
1095
-        //         // for (const key in response.data.data.prescription) {
1096
-        //         //   this.prescription_prop[key] = response.data.data.prescription[key];
1097
-        //         // }
1098
-        //         // console.log(response.data.data.prescription)
1099
-        //         this.$emit('advice')
1100
-        //
1101
-        //         this.$emit('longSolution', response.data.data.solution)
1102
-        //         this.$emit('prescription', response.data.data.prescription)
1103
-        //         this.finish()
1104
-        //
1105
-        //       }
1106
-        //     })
1107
-        //
1108
-        //   }
1109
-        //
1110
-        // }
1055
+        } else {
1056
+          if (this.dialysisPrescription.creater == 0) {
1057
+            if (this.is_open == 1) {
1058
+              //弹框推送提醒
1059
+              this.advicePropForm.list = this.targetAdvices
1060
+              this.advicePropForm.operators = this.admin_users_prop
1061
+              this.advice_visibility = true
1062
+              this.isShowDialog = false
1063
+
1064
+              for (let i = 0; i < this.advicePropForm.list.length; i++) {
1065
+                if (this.advicePropForm.list[i].parent_id == 0 && this.advicePropForm.list[i].isCheck == 1) {
1066
+                  this.advicePropForm.result.push(this.advicePropForm.list[i].id)
1067
+                }
1068
+              }
1069
+
1070
+            } else if (this.is_open == 2) {
1071
+              this.advice_visibility = false
1072
+              let params = {
1073
+                advices: this.waitUploadAdvices,
1074
+                advice_date: parseTime(this.$route.query.date, '{y}-{m}-{d}'),
1075
+                advice_doctor: this.waitUploadAdvices[0].advice_doctor,
1076
+                advice_type: this.waitUploadAdvices[0].advice_type,
1077
+                parent_id: this.patient_id,
1078
+                start_time: parseTime(this.$route.query.date, '{y}-{m}-{d}'),
1079
+                remark: '',
1080
+              }
1081
+              CreateGroupAdvice(this.$route.query.patient_id, 0, params).then(rs => {
1082
+                var resp = rs.data
1083
+                if (resp.state == 1) {
1084
+
1085
+                } else {
1086
+
1087
+                }
1088
+              })
1089
+
1090
+            }
1091
+          }
1092
+
1093
+          Toast.loading({forbidClick: true, duration: 0})
1094
+          let ParamsQuery = this.dialysisPrescription
1095
+          ParamsQuery['patient'] = this.$route.query.patient_id
1096
+          ParamsQuery['record_date'] = this.record_date
1097
+          postSolution(ParamsQuery).then(response => {
1098
+            if (response.data.state == 0) {
1099
+              Toast.fail(response.data.msg)
1100
+              return false
1101
+            } else {
1102
+              Toast.success('提交成功')
1103
+              // for (const key in response.data.data.solution) {
1104
+              //   this.solution_prop[key] = response.data.data.solution[key];
1105
+              // }
1106
+              // for (const key in response.data.data.prescription) {
1107
+              //   this.prescription_prop[key] = response.data.data.prescription[key];
1108
+              // }
1109
+              // console.log(response.data.data.prescription)
1110
+
1111
+              this.$emit('longSolution', response.data.data.solution)
1112
+              this.$emit('prescription', response.data.data.prescription)
1113
+              this.finish()
1114
+
1115
+            }
1116
+          })
1117
+        }
1111 1118
 
1112 1119
       }, finish: function () {
1113 1120
         this.$emit('finish')
@@ -1350,7 +1357,8 @@
1350 1357
       MultipleSubMenu,
1351 1358
       // MultipleSubMenu,
1352 1359
       CheckBoxSubMenu
1353
-    }, watch: {
1360
+    },
1361
+    watch: {
1354 1362
       isShowDialog (val) {
1355 1363
         if (val) {
1356 1364
           this.advice_visibility = false

+ 9 - 3
src/pages/main/dialog/subMenu/LongAdviceSubMenu.vue Просмотреть файл

@@ -68,12 +68,19 @@
68 68
       }, getContent (val) {
69 69
         let prescribing_number = ''
70 70
         let single_dose = ''
71
+        let advice_name = ''
72
+
71 73
         if (val.prescribing_number > 0) {
72 74
           prescribing_number = val.prescribing_number + val.prescribing_number_unit
73 75
         }
74 76
         if (val.single_dose > 0) {
75 77
           single_dose = ' 单次用量 ' + val.single_dose + val.single_dose_unit
76 78
         }
79
+
80
+        if (val.advice_name > 0) {
81
+          advice_name = val.advice_name + val.drug_spec_unit
82
+        }
83
+
77 84
         let name = ""
78 85
         if (val.child.length > 0){
79 86
           for (let i = 0 ; i < val.child.length; i++){
@@ -89,7 +96,7 @@
89 96
               val.child[i]['single'] = ''
90 97
             }
91 98
             name = name+"▲"+val.child[i].advice_name+""
92
-              + val.child[i].drug_spec
99
+              + val.child[i].advice_desc
93 100
               + val.child[i].drug_spec_unit
94 101
               + val.child[i].presc
95 102
               + val.child[i].single
@@ -100,8 +107,7 @@
100 107
             + " "+single_dose+" "+ " "+val.delivery_way+" "+ val.execution_frequency + val.remark +name
101 108
 
102 109
         } else {
103
-          return val.advice_name +"  "+ val.drug_spec+" "
104
-            + val.drug_spec_unit
110
+          return advice_name +"  "
105 111
             + prescribing_number
106 112
             + " "+single_dose+" "+ " "+val.delivery_way+" "+ val.execution_frequency + val.remark
107 113
         }

+ 43 - 114
src/pages/main/today/TodayTab.vue Просмотреть файл

@@ -109,8 +109,10 @@
109 109
     <van-popup title="透析处方" v-model="menuList[1].showPopup" :overlay="true" :close-on-click-overlay="false">
110 110
       <prescription-dialog :patient_prop="patient" :solution_prop="solution" :machines_prop="devices" :config="config"
111 111
                            :prescription_prop="prescription" @finish="closePrescriptionDialog" :operators="operators"
112
-                           :types="goodTypes" :info="goodInfos" :status="status" :targetAdvices="targetAdvices"
113
-                           @close="closePrescriptionDialog" @prescription="prescriptionFunc"  :admin_users_prop="admin_users" @advice="adviceFunc"
112
+                           :types="goodTypes" :info="goodInfos" :status="status" :targetAdvices="longAdvices"
113
+                           :waitUploadAdvices="waitUploadAdvices" :is_open="is_open"
114
+                           @close="closePrescriptionDialog" @prescription="prescriptionFunc"
115
+                           :admin_users_prop="admin_users" @advice="adviceFunc"
114 116
                            @longSolution="longSolutionFunc" ref="prescription_dialog"></prescription-dialog>
115 117
     </van-popup>
116 118
 
@@ -217,7 +219,7 @@
217 219
   import MonitDialog from '../dialog/MonitDialog'
218 220
   import ComputerDialog from '../dialog/ComputerDialog'
219 221
 
220
-  import {dialysisGlobalConfig, getDialysisRecord,CreateGroupAdvice} from '@/api/dialysis'
222
+  import {CreateGroupAdvice, dialysisGlobalConfig, getDialysisRecord} from '@/api/dialysis'
221 223
   import {GetRemindLongAdvice} from '@/api/advice'
222 224
 
223 225
   import {parseTime} from '@/utils'
@@ -304,8 +306,10 @@
304 306
         goodInfos: [],
305 307
 
306 308
         longAdvices: [],
307
-        targetAdvices:[],
308
-        status:'',
309
+        waitUploadAdvices: [],
310
+        is_open: 0,
311
+        targetAdvices: [],
312
+        status: '',
309 313
       }
310 314
     },
311 315
     computed: {
@@ -379,7 +383,7 @@
379 383
       this.patient_id = patient_id
380 384
       this.date = date
381 385
       this.requestDialysisRecord()
382
-      // this.requestLongAdvice()
386
+      this.requestLongAdvice()
383 387
 
384 388
     },
385 389
     mounted () {
@@ -941,118 +945,44 @@
941 945
 
942 946
             switch (status) {
943 947
               case 2:
944
-                this.longAdvices = resp.data.advices
945
-
948
+                var totalAdvice = resp.data.advices
946 949
                 var longAdvicesTwo = resp.data.advices_two
950
+                var waitUploadAdvices = []
951
+                for (let i = 0; i < totalAdvice.length; i++) {
952
+                  totalAdvice[i]['isCheck'] = 1
947 953
 
948
-                for (let i = 0; i < this.longAdvices.length; i++) {
949
-                  this.longAdvices[i]['isCheck'] = 0
950
-                  switch (this.longAdvices[i].frequency_type) {
951
-                    case 1: //每日推送
952
-                      this.longAdvices[i]['isCheck'] = 1
953
-                      break
954
-                    case 2: //用今天的日期与推送类型为2的医嘱进行比较如果相差天数等于设定的天数,则设置为选中状态
955
-                      for (let i = 0;i < this.longAdvices.length;i++){
956
-                        for (let a = 0; a < longAdvicesTwo.length;a++){
957
-                          if(this.longAdvices[i].advice_name == longAdvicesTwo[a].advice_name && this.longAdvices[i].advice_desc == longAdvicesTwo[a].advice_desc){
958
-                            this.longAdvices[i]['isCheck'] = 1
959
-                          }
960
-                        }
961
-                      }
962
-                      break
963
-                    case 3://用今天的属于周几与推送类型为3的医嘱进行比较如果包含某个字符串,则设置为选中状态
964
-                      let day = new Date().getDay()
965
-                      console.log(day)
966
-                      let name =""
967
-                      switch (day) {
968
-                        case 1:
969
-                          name="周一"
970
-                          break
971
-                        case 2:
972
-                          name="周二"
973
-
974
-                          break
975
-                        case 3:
976
-                          name="周三"
977
-
978
-                          break
979
-                        case 4:
980
-                          name="周四"
981
-                          break
982
-                        case 5:
983
-                          name="周五"
984
-                          break
985
-                        case 6:
986
-                          name="周六"
987
-                          break
988
-                        case 0:
989
-                          name="周日"
990
-                          break
991
-                      }
992
-
954
+                }
993 955
 
994
-                      if (this.longAdvices[i].week_day.indexOf(name) != -1){
995
-                        console.log("11111")
996
-                        this.longAdvices[i]['isCheck'] = 1
997
-                      }
998
-                      break
956
+                for (let i = 0; i < totalAdvice.length; i++) {
957
+                  for (let a = 0; a < longAdvicesTwo.length; a++) {
958
+                    if (totalAdvice[i].template_id == longAdvicesTwo[a].template_id) {
959
+                      totalAdvice[i]['isCheck'] = 0
960
+                    }
999 961
                   }
1000 962
                 }
1001 963
 
1002
-                console.log( this.longAdvices)
1003
-                this.targetAdvices = this.longAdvices
1004 964
 
1005
-                break
1006
-              case 3:
1007
-                this.longAdvices = resp.data.advices
1008
-
1009
-                var advices_two = resp.data.advices_two
1010
-                let dayAdvices = []
1011
-                for (let i = 0; i < this.longAdvices.length; i++) {
1012
-                  switch (this.longAdvices[i].frequency_type) {
1013
-                    case 1: //每日推送,则加入到待上传数组里面
1014
-                      dayAdvices.push(this.longAdvices[i])
1015
-                      break
1016
-                    case 3://用今天的属于周几与推送类型为3的医嘱进行比较如果包含某个字符串,则加入到待上传数组里面
1017
-                      let day = new Date().getDay()
1018
-                      let name =""
1019
-
1020
-                      switch (day) {
1021
-                        case 1:
1022
-                          name="周一"
1023
-                          break
1024
-                        case 2:
1025
-                          name="周二"
1026
-                          break
1027
-                        case 3:
1028
-                          name="周三"
1029
-                          break
1030
-                        case 4:
1031
-                          name="周四"
1032
-                          break
1033
-                        case 5:
1034
-                          name="周五"
1035
-                          break
1036
-                        case 6:
1037
-                          name="周六"
1038
-                          break
1039
-                        case 0:
1040
-                          name="周日"
1041
-                          break
1042
-                      }
1043
-                      if (this.longAdvices[i].week_day.indexOf(name) != -1){
1044
-                        dayAdvices.push(this.longAdvices[i])
1045
-                      }
1046
-                      break
1047
-                  }
965
+                for (let i = 0; i < totalAdvice.length; i++) {
966
+                    if( totalAdvice[i].isCheck == 1){
967
+                      waitUploadAdvices.push(totalAdvice[i])
968
+                    }
1048 969
                 }
1049
-                this.targetAdvices = dayAdvices.concat(advices_two)
970
+
971
+
972
+                this.is_open = resp.data.is_open_remind
973
+                this.longAdvices = totalAdvice
974
+                this.waitUploadAdvices = waitUploadAdvices
975
+                console.log(this.longAdvices)
976
+                console.log(this.waitUploadAdvices)
977
+
1050 978
                 break
979
+
1051 980
             }
1052 981
           } else {
1053 982
 
1054 983
           }
1055 984
         })
985
+
1056 986
       }, getNowFormatDate () {
1057 987
         var date = new Date()
1058 988
         var seperator1 = '-'
@@ -1082,18 +1012,17 @@
1082 1012
           }
1083 1013
         )
1084 1014
       }
1085
-      ,adviceFunc:function(){
1086
-
1015
+      , adviceFunc: function () {
1087 1016
 
1088 1017
       },
1089 1018
       prescriptionFunc: function (val) {
1090
-        if (this.status == 2){
1091
-          if(val.creater > 0 && val.modifier == 0){
1019
+        if (this.status == 2) {
1020
+          if (val.creater > 0 && val.modifier == 0) {
1092 1021
             this.requestDialysisRecord()
1093 1022
           }
1094 1023
 
1095
-        }else if(this.status == 3){
1096
-          if(val.creater > 0 && val.modifier == 0){
1024
+        } else if (this.status == 3) {
1025
+          if (val.creater > 0 && val.modifier == 0) {
1097 1026
             this.requestDialysisRecord()
1098 1027
           }
1099 1028
         }
@@ -1104,13 +1033,13 @@
1104 1033
       ,
1105 1034
       longSolutionFunc: function (val) {
1106 1035
         this.solution = val
1107
-        if (this.status == 2){
1108
-          if(val.creater > 0 && val.modifier == 0){
1036
+        if (this.status == 2) {
1037
+          if (val.creater > 0 && val.modifier == 0) {
1109 1038
             this.requestDialysisRecord()
1110 1039
           }
1111 1040
 
1112
-        }else if(this.status == 3){
1113
-          if(val.creater > 0 && val.modifier == 0){
1041
+        } else if (this.status == 3) {
1042
+          if (val.creater > 0 && val.modifier == 0) {
1114 1043
             this.requestDialysisRecord()
1115 1044
           }
1116 1045
         }