csx 5 years ago
parent
commit
a0283f6bed

+ 1 - 1
build/cdn.json View File

@@ -1,3 +1,3 @@
1 1
 {
2
-  "version": "1.0.58"
2
+  "version": "1.0.60"
3 3
 }

+ 1 - 1
config/prod.env.js View File

@@ -3,7 +3,7 @@ module.exports = {
3 3
   NODE_ENV: '"production"',
4 4
   BASE_API: '"https://api.xt.kuyicloud.com"'
5 5
 
6
-  // BASE_API: '"https://api.xt.kuyicloud.com"'
6
+  // BASE_API: '"http://api.xt.test.sgjyun.com"'
7 7
   // http://api.xt.test.sgjyun.com
8 8
   // '"http://api.xt.kuyicloud.com"', //'"http://api.xt.kuyicloud.com"','"http://api.xt.test.sgjyun.com"'
9 9
 }

+ 112 - 109
src/pages/main/dialog/PrescriptionDialog.vue View File

@@ -746,26 +746,9 @@ import MsgTip from './subMenu/MsgTip'
746 746
     },
747 747
 
748 748
     menuComfirmThree: function (targetAdvices) {
749
-        if (targetAdvices.length > 0) {
750
-          let params = {
751
-            advices: targetAdvices,
752
-            advice_date: parseTime(this.$route.query.date, '{y}-{m}-{d}'),
753
-            advice_doctor: targetAdvices[0].advice_doctor,
754
-            advice_type: targetAdvices[0].advice_type,
755
-            parent_id: this.patient_id,
756
-            start_time: parseTime(this.$route.query.date, '{y}-{m}-{d}'),
757
-            remark: '',
758
-          }
759
-          CreateGroupAdvice(this.$route.query.patient_id, 0, params).then(rs => {
760
-            var resp = rs.data
761
-            if (resp.state == 1) {
762
-              this.doctorAdvices = resp.data.advices
763
-
764
-            } else {
765 749
 
766
-            }
767
-          })
768 750
 
751
+        if (targetAdvices.length > 0) {
769 752
           if (this.is_pre == 1) {
770 753
             Toast.loading({forbidClick: true, duration: 0})
771 754
             let ParamsQuery = this.dialysisPrescription
@@ -776,10 +759,29 @@ import MsgTip from './subMenu/MsgTip'
776 759
                 Toast.fail(response.data.msg)
777 760
                 return false
778 761
               } else {
779
-                Toast.success('提交成功')
762
+                let params = {
763
+                  advices: targetAdvices,
764
+                  advice_date: parseTime(this.$route.query.date, '{y}-{m}-{d}'),
765
+                  advice_doctor: targetAdvices[0].advice_doctor,
766
+                  advice_type: targetAdvices[0].advice_type,
767
+                  parent_id: this.patient_id,
768
+                  start_time: parseTime(this.$route.query.date, '{y}-{m}-{d}'),
769
+                  remark: '',
770
+                }
771
+                CreateGroupAdvice(this.$route.query.patient_id, 0, params).then(rs => {
772
+                  var resp = rs.data
773
+                  if (resp.state == 1) {
774
+                    this.doctorAdvices = resp.data.advices
775
+                    Toast.success('提交成功')
776
+
777
+                    this.$emit('prescription', response.data.data.prescription,this.doctorAdvices)
778
+                    this.finish()
779
+
780
+                  } else {
781
+
782
+                  }
783
+                })
780 784
 
781
-                this.$emit('prescription', response.data.data.prescription,this.doctorAdvices)
782
-                this.finish()
783 785
               }
784 786
             })
785 787
 
@@ -976,8 +978,8 @@ import MsgTip from './subMenu/MsgTip'
976 978
       },
977 979
       commitInfo: function () {
978 980
         this.is_pre = 1
979
-        if (this.prescription_prop.id == '') {
980 981
 
982
+        if (this.prescription_prop.id == '') {
981 983
           if (this.is_open == 0) {
982 984
             Toast.loading({forbidClick: true, duration: 0})
983 985
             let ParamsQuery = this.dialysisPrescription
@@ -1007,8 +1009,7 @@ import MsgTip from './subMenu/MsgTip'
1007 1009
                   this.advicePropForm.result.push(this.advicePropForm.list[i].id)
1008 1010
                 }
1009 1011
               }
1010
-            }
1011
-            else {
1012
+            } else {
1012 1013
               Toast.loading({forbidClick: true, duration: 0})
1013 1014
               let ParamsQuery = this.dialysisPrescription
1014 1015
               ParamsQuery['patient'] = this.$route.query.patient_id
@@ -1029,25 +1030,7 @@ import MsgTip from './subMenu/MsgTip'
1029 1030
 
1030 1031
           } else if (this.is_open == 2) {
1031 1032
             if (this.waitUploadAdvices.length > 0) {
1032
-              this.advice_visibility = false
1033
-              let params = {
1034
-                advices: this.waitUploadAdvices,
1035
-                advice_date: parseTime(this.$route.query.date, '{y}-{m}-{d}'),
1036
-                advice_doctor: this.waitUploadAdvices[0].advice_doctor,
1037
-                advice_type: this.waitUploadAdvices[0].advice_type,
1038
-                parent_id: this.patient_id,
1039
-                start_time: parseTime(this.$route.query.date, '{y}-{m}-{d}'),
1040
-                remark: '',
1041
-              }
1042
-              CreateGroupAdvice(this.$route.query.patient_id, 0, params).then(rs => {
1043
-                var resp = rs.data
1044
-                if (resp.state == 1) {
1045
-                  this.doctorAdvices = resp.data.advices
1046 1033
 
1047
-                } else {
1048
-
1049
-                }
1050
-              })
1051 1034
               Toast.loading({forbidClick: true, duration: 0})
1052 1035
               let ParamsQuery = this.dialysisPrescription
1053 1036
               ParamsQuery['patient'] = this.$route.query.patient_id
@@ -1073,10 +1056,29 @@ import MsgTip from './subMenu/MsgTip'
1073 1056
                   Toast.fail(response.data.msg)
1074 1057
                   return false
1075 1058
                 } else {
1076
-                  Toast.success('提交成功')
1059
+                  this.advice_visibility = false
1060
+                  let params = {
1061
+                    advices: this.waitUploadAdvices,
1062
+                    advice_date: parseTime(this.$route.query.date, '{y}-{m}-{d}'),
1063
+                    advice_doctor: this.waitUploadAdvices[0].advice_doctor,
1064
+                    advice_type: this.waitUploadAdvices[0].advice_type,
1065
+                    parent_id: this.patient_id,
1066
+                    start_time: parseTime(this.$route.query.date, '{y}-{m}-{d}'),
1067
+                    remark: '',
1068
+                  }
1069
+                  CreateGroupAdvice(this.$route.query.patient_id, 0, params).then(rs => {
1070
+                    var resp = rs.data
1071
+                    if (resp.state == 1) {
1072
+                      this.doctorAdvices = resp.data.advices
1073
+                      Toast.success('提交成功')
1074
+                      this.$emit('prescription', response.data.data.prescription,this.doctorAdvices)
1075
+                      this.finish()
1076
+                    } else {
1077
+
1078
+                    }
1079
+                  })
1080
+
1077 1081
 
1078
-                  this.$emit('prescription', response.data.data.prescription,this.doctorAdvices)
1079
-                  this.finish()
1080 1082
                 }
1081 1083
               })
1082 1084
             }
@@ -1141,25 +1143,7 @@ import MsgTip from './subMenu/MsgTip'
1141 1143
             } else if (this.is_open == 2) {
1142 1144
               if (this.waitUploadAdvices.length > 0) {
1143 1145
 
1144
-                this.advice_visibility = false
1145
-                let params = {
1146
-                  advices: this.waitUploadAdvices,
1147
-                  advice_date: parseTime(this.$route.query.date, '{y}-{m}-{d}'),
1148
-                  advice_doctor: this.waitUploadAdvices[0].advice_doctor,
1149
-                  advice_type: this.waitUploadAdvices[0].advice_type,
1150
-                  parent_id: this.patient_id,
1151
-                  start_time: parseTime(this.$route.query.date, '{y}-{m}-{d}'),
1152
-                  remark: '',
1153
-                }
1154
-                CreateGroupAdvice(this.$route.query.patient_id, 0, params).then(rs => {
1155
-                  var resp = rs.data
1156
-                  if (resp.state == 1) {
1157
-                    this.doctorAdvices = resp.data.advices
1158
-
1159
-                  } else {
1160 1146
 
1161
-                  }
1162
-                })
1163 1147
                 Toast.loading({forbidClick: true, duration: 0})
1164 1148
                 let ParamsQuery = this.dialysisPrescription
1165 1149
                 ParamsQuery['patient'] = this.$route.query.patient_id
@@ -1186,9 +1170,28 @@ import MsgTip from './subMenu/MsgTip'
1186 1170
                     Toast.fail(response.data.msg)
1187 1171
                     return false
1188 1172
                   } else {
1189
-                    Toast.success('提交成功')
1190
-                    this.$emit('prescription', response.data.data.prescription,this.doctorAdvices)
1191
-                    this.finish()
1173
+                    this.advice_visibility = false
1174
+                    let params = {
1175
+                      advices: this.waitUploadAdvices,
1176
+                      advice_date: parseTime(this.$route.query.date, '{y}-{m}-{d}'),
1177
+                      advice_doctor: this.waitUploadAdvices[0].advice_doctor,
1178
+                      advice_type: this.waitUploadAdvices[0].advice_type,
1179
+                      parent_id: this.patient_id,
1180
+                      start_time: parseTime(this.$route.query.date, '{y}-{m}-{d}'),
1181
+                      remark: '',
1182
+                    }
1183
+                    CreateGroupAdvice(this.$route.query.patient_id, 0, params).then(rs => {
1184
+                      var resp = rs.data
1185
+                      if (resp.state == 1) {
1186
+                        this.doctorAdvices = resp.data.advices
1187
+                        Toast.success('提交成功')
1188
+                        this.$emit('prescription', response.data.data.prescription,this.doctorAdvices)
1189
+                        this.finish()
1190
+
1191
+                      } else {
1192
+
1193
+                      }
1194
+                    })
1192 1195
 
1193 1196
                   }
1194 1197
                 })
@@ -1279,26 +1282,7 @@ import MsgTip from './subMenu/MsgTip'
1279 1282
 
1280 1283
           } else if (this.is_open == 2) {
1281 1284
             if (this.waitUploadAdvices.length > 0) {
1282
-              this.advice_visibility = false
1283
-              let params = {
1284
-                advices: this.waitUploadAdvices,
1285
-                advice_date: parseTime(this.$route.query.date, '{y}-{m}-{d}'),
1286
-                advice_doctor: this.waitUploadAdvices[0].advice_doctor,
1287
-                advice_type: this.waitUploadAdvices[0].advice_type,
1288
-                parent_id: this.patient_id,
1289
-                start_time: parseTime(this.$route.query.date, '{y}-{m}-{d}'),
1290
-                remark: '',
1291
-              }
1292
-              CreateGroupAdvice(this.$route.query.patient_id, 0, params).then(rs => {
1293
-                var resp = rs.data
1294
-                if (resp.state == 1) {
1295
-                  this.doctorAdvices = resp.data.advices
1296
-
1297 1285
 
1298
-                } else {
1299
-
1300
-                }
1301
-              })
1302 1286
               Toast.loading({forbidClick: true, duration: 0})
1303 1287
               let ParamsQuery = this.dialysisPrescription
1304 1288
               ParamsQuery['patient'] = this.$route.query.patient_id
@@ -1327,6 +1311,26 @@ import MsgTip from './subMenu/MsgTip'
1327 1311
                   Toast.fail(response.data.msg)
1328 1312
                   return false
1329 1313
                 } else {
1314
+                  this.advice_visibility = false
1315
+                  let params = {
1316
+                    advices: this.waitUploadAdvices,
1317
+                    advice_date: parseTime(this.$route.query.date, '{y}-{m}-{d}'),
1318
+                    advice_doctor: this.waitUploadAdvices[0].advice_doctor,
1319
+                    advice_type: this.waitUploadAdvices[0].advice_type,
1320
+                    parent_id: this.patient_id,
1321
+                    start_time: parseTime(this.$route.query.date, '{y}-{m}-{d}'),
1322
+                    remark: '',
1323
+                  }
1324
+                  CreateGroupAdvice(this.$route.query.patient_id, 0, params).then(rs => {
1325
+                    var resp = rs.data
1326
+                    if (resp.state == 1) {
1327
+                      this.doctorAdvices = resp.data.advices
1328
+
1329
+
1330
+                    } else {
1331
+
1332
+                    }
1333
+                  })
1330 1334
                   Toast.success('提交成功')
1331 1335
 
1332 1336
                   this.$emit('advice')
@@ -1401,26 +1405,7 @@ import MsgTip from './subMenu/MsgTip'
1401 1405
 
1402 1406
             } else if (this.is_open == 2) {
1403 1407
               if (this.waitUploadAdvices.length > 0) {
1404
-                this.advice_visibility = false
1405
-                let params = {
1406
-                  advices: this.waitUploadAdvices,
1407
-                  advice_date: parseTime(this.$route.query.date, '{y}-{m}-{d}'),
1408
-                  advice_doctor: this.waitUploadAdvices[0].advice_doctor,
1409
-                  advice_type: this.waitUploadAdvices[0].advice_type,
1410
-                  parent_id: this.patient_id,
1411
-                  start_time: parseTime(this.$route.query.date, '{y}-{m}-{d}'),
1412
-                  remark: '',
1413
-                }
1414
-                CreateGroupAdvice(this.$route.query.patient_id, 0, params).then(rs => {
1415
-                  var resp = rs.data
1416
-                  if (resp.state == 1) {
1417
-                    this.doctorAdvices = resp.data.advices
1418
-
1419
-
1420
-                  } else {
1421 1408
 
1422
-                  }
1423
-                })
1424 1409
                 Toast.loading({forbidClick: true, duration: 0})
1425 1410
                 let ParamsQuery = this.dialysisPrescription
1426 1411
                 ParamsQuery['patient'] = this.$route.query.patient_id
@@ -1430,12 +1415,30 @@ import MsgTip from './subMenu/MsgTip'
1430 1415
                     Toast.fail(response.data.msg)
1431 1416
                     return false
1432 1417
                   } else {
1433
-                    Toast.success('提交成功')
1418
+                    this.advice_visibility = false
1419
+                    let params = {
1420
+                      advices: this.waitUploadAdvices,
1421
+                      advice_date: parseTime(this.$route.query.date, '{y}-{m}-{d}'),
1422
+                      advice_doctor: this.waitUploadAdvices[0].advice_doctor,
1423
+                      advice_type: this.waitUploadAdvices[0].advice_type,
1424
+                      parent_id: this.patient_id,
1425
+                      start_time: parseTime(this.$route.query.date, '{y}-{m}-{d}'),
1426
+                      remark: '',
1427
+                    }
1428
+                    CreateGroupAdvice(this.$route.query.patient_id, 0, params).then(rs => {
1429
+                      var resp = rs.data
1430
+                      if (resp.state == 1) {
1431
+                        this.doctorAdvices = resp.data.advices
1432
+                        Toast.success('提交成功')
1433
+                        this.$emit('advice')
1434
+                        this.$emit('longSolution', response.data.data.solution)
1435
+                        this.$emit('prescription', response.data.data.prescription)
1436
+                        this.finish()
1437
+                      } else {
1438
+
1439
+                      }
1440
+                    })
1434 1441
 
1435
-                    this.$emit('advice')
1436
-                    this.$emit('longSolution', response.data.data.solution)
1437
-                    this.$emit('prescription', response.data.data.prescription)
1438
-                    this.finish()
1439 1442
 
1440 1443
                   }
1441 1444
                 })

+ 1 - 0
src/pages/main/index.vue View File

@@ -62,6 +62,7 @@
62 62
               return [item.groupno]
63 63
             })
64 64
 
65
+
65 66
             this.unReadWaitNum = sorted.length
66 67
 
67 68
           } else {

+ 126 - 123
src/pages/main/today/TodayTab.vue View File

@@ -1029,135 +1029,138 @@
1029 1029
       },
1030 1030
       prescriptionFunc: function (val,advices) {
1031 1031
         this.prescription = val
1032
-        if (advices.length > 0){
1033
-
1034
-          if (advices.length > 0) {
1035
-            var group = this.newAdviceGroupObject()
1036
-            var initGroupBlock = function (group, advice) {
1037
-              group.group_no = advice.groupno
1038
-              // group.start_time = advice.start_time
1039
-              // group.advice_doctor = advice.advice_doctor
1040
-              // group.exec_staff = advice.execution_staff
1041
-              // group.exec_time = advice.execution_time
1042
-              // group.checker = advice.checker
1043
-            }
1044
-            for (let index = 0; index < advices.length; index++) {
1045
-              const advice = advices[index]
1046
-              if (advice.groupno == 0) {
1047
-                // 老版本的医嘱没有分组的概念,所以这一个 if 是解决这个问题的,将每个无分组的医嘱各自归为一组
1048
-                if (advice.parent_id > 0) {
1049
-                  if (this.advice_groups.length > 0) {
1050
-                    var parent_group = this.advice_groups[
1051
-                    this.advice_groups.length - 1
1052
-                      ]
1053
-                    if (parent_group.advices.length > 0) {
1054
-                      if (parent_group.advices[0].id == advice.parent_id) {
1055
-                        parent_group.advices.push(advice)
1056
-                      }
1057
-                    }
1058
-                  }
1059
-                  continue
1060
-                } else {
1061
-                  if (group.group_no > 0) {
1062
-                    this.advice_groups.push(group)
1063
-                    group = this.newAdviceGroupObject()
1064
-                  }
1065
-
1066
-                  initGroupBlock(group, advice)
1067
-                  group.advices.push(advice)
1068
-                  this.advice_groups.push(group)
1069
-                  group = this.newAdviceGroupObject()
1070
-                  continue
1071
-                }
1072
-              }
1073
-
1074
-              if (group.group_no > 0 && group.group_no != advice.groupno) {
1075
-                this.advice_groups.push(group)
1076
-                group = this.newAdviceGroupObject()
1077
-              }
1078
-              if (group.group_no == 0) {
1079
-                initGroupBlock(group, advice)
1080
-              }
1081
-              if (group.group_no == advice.groupno) {
1082
-                group.advices.push(advice)
1083
-              }
1084
-            }
1085
-            if (group.group_no > 0) {
1086
-              // 上述的算法会导致最后一组没有加到advice_groups,这里要手动加上
1087
-              this.advice_groups.push(group)
1088
-            }
1089
-
1090
-          }
1091
-
1092
-
1093
-        }
1032
+        this.requestDialysisRecord()
1033
+        // if (advices.length > 0){
1034
+        //
1035
+        //   // if (advices.length > 0) {
1036
+        //   //   var group = this.newAdviceGroupObject()
1037
+        //   //   var initGroupBlock = function (group, advice) {
1038
+        //   //     group.group_no = advice.groupno
1039
+        //   //     // group.start_time = advice.start_time
1040
+        //   //     // group.advice_doctor = advice.advice_doctor
1041
+        //   //     // group.exec_staff = advice.execution_staff
1042
+        //   //     // group.exec_time = advice.execution_time
1043
+        //   //     // group.checker = advice.checker
1044
+        //   //   }
1045
+        //   //   for (let index = 0; index < advices.length; index++) {
1046
+        //   //     const advice = advices[index]
1047
+        //   //     if (advice.groupno == 0) {
1048
+        //   //       // 老版本的医嘱没有分组的概念,所以这一个 if 是解决这个问题的,将每个无分组的医嘱各自归为一组
1049
+        //   //       if (advice.parent_id > 0) {
1050
+        //   //         if (this.advice_groups.length > 0) {
1051
+        //   //           var parent_group = this.advice_groups[
1052
+        //   //           this.advice_groups.length - 1
1053
+        //   //             ]
1054
+        //   //           if (parent_group.advices.length > 0) {
1055
+        //   //             if (parent_group.advices[0].id == advice.parent_id) {
1056
+        //   //               parent_group.advices.push(advice)
1057
+        //   //             }
1058
+        //   //           }
1059
+        //   //         }
1060
+        //   //         continue
1061
+        //   //       } else {
1062
+        //   //         if (group.group_no > 0) {
1063
+        //   //           this.advice_groups.push(group)
1064
+        //   //           group = this.newAdviceGroupObject()
1065
+        //   //         }
1066
+        //   //
1067
+        //   //         initGroupBlock(group, advice)
1068
+        //   //         group.advices.push(advice)
1069
+        //   //         this.advice_groups.push(group)
1070
+        //   //         group = this.newAdviceGroupObject()
1071
+        //   //         continue
1072
+        //   //       }
1073
+        //   //     }
1074
+        //   //
1075
+        //   //     if (group.group_no > 0 && group.group_no != advice.groupno) {
1076
+        //   //       this.advice_groups.push(group)
1077
+        //   //       group = this.newAdviceGroupObject()
1078
+        //   //     }
1079
+        //   //     if (group.group_no == 0) {
1080
+        //   //       initGroupBlock(group, advice)
1081
+        //   //     }
1082
+        //   //     if (group.group_no == advice.groupno) {
1083
+        //   //       group.advices.push(advice)
1084
+        //   //     }
1085
+        //   //   }
1086
+        //   //   if (group.group_no > 0) {
1087
+        //   //     // 上述的算法会导致最后一组没有加到advice_groups,这里要手动加上
1088
+        //   //     this.advice_groups.push(group)
1089
+        //   //   }
1090
+        //   //
1091
+        //   // }
1092
+        //
1093
+        //
1094
+        // }
1094 1095
 
1095 1096
       }
1096 1097
       ,
1097 1098
       longSolutionFunc: function (val) {
1098 1099
         this.solution = val
1099
-        if (advices.length > 0){
1100
-
1101
-          if (advices.length > 0) {
1102
-            var group = this.newAdviceGroupObject()
1103
-            var initGroupBlock = function (group, advice) {
1104
-              group.group_no = advice.groupno
1105
-              // group.start_time = advice.start_time
1106
-              // group.advice_doctor = advice.advice_doctor
1107
-              // group.exec_staff = advice.execution_staff
1108
-              // group.exec_time = advice.execution_time
1109
-              // group.checker = advice.checker
1110
-            }
1111
-            for (let index = 0; index < advices.length; index++) {
1112
-              const advice = advices[index]
1113
-              if (advice.groupno == 0) {
1114
-                // 老版本的医嘱没有分组的概念,所以这一个 if 是解决这个问题的,将每个无分组的医嘱各自归为一组
1115
-                if (advice.parent_id > 0) {
1116
-                  if (this.advice_groups.length > 0) {
1117
-                    var parent_group = this.advice_groups[
1118
-                    this.advice_groups.length - 1
1119
-                      ]
1120
-                    if (parent_group.advices.length > 0) {
1121
-                      if (parent_group.advices[0].id == advice.parent_id) {
1122
-                        parent_group.advices.push(advice)
1123
-                      }
1124
-                    }
1125
-                  }
1126
-                  continue
1127
-                } else {
1128
-                  if (group.group_no > 0) {
1129
-                    this.advice_groups.push(group)
1130
-                    group = this.newAdviceGroupObject()
1131
-                  }
1132
-
1133
-                  initGroupBlock(group, advice)
1134
-                  group.advices.push(advice)
1135
-                  this.advice_groups.push(group)
1136
-                  group = this.newAdviceGroupObject()
1137
-                  continue
1138
-                }
1139
-              }
1140
-
1141
-              if (group.group_no > 0 && group.group_no != advice.groupno) {
1142
-                this.advice_groups.push(group)
1143
-                group = this.newAdviceGroupObject()
1144
-              }
1145
-              if (group.group_no == 0) {
1146
-                initGroupBlock(group, advice)
1147
-              }
1148
-              if (group.group_no == advice.groupno) {
1149
-                group.advices.push(advice)
1150
-              }
1151
-            }
1152
-            if (group.group_no > 0) {
1153
-              // 上述的算法会导致最后一组没有加到advice_groups,这里要手动加上
1154
-              this.advice_groups.push(group)
1155
-            }
1156
-
1157
-          }
1100
+        this.requestDialysisRecord()
1158 1101
 
1159
-
1160
-        }
1102
+        // if (advices.length > 0){
1103
+        //
1104
+        //   if (advices.length > 0) {
1105
+        //     var group = this.newAdviceGroupObject()
1106
+        //     var initGroupBlock = function (group, advice) {
1107
+        //       group.group_no = advice.groupno
1108
+        //       // group.start_time = advice.start_time
1109
+        //       // group.advice_doctor = advice.advice_doctor
1110
+        //       // group.exec_staff = advice.execution_staff
1111
+        //       // group.exec_time = advice.execution_time
1112
+        //       // group.checker = advice.checker
1113
+        //     }
1114
+        //     for (let index = 0; index < advices.length; index++) {
1115
+        //       const advice = advices[index]
1116
+        //       if (advice.groupno == 0) {
1117
+        //         // 老版本的医嘱没有分组的概念,所以这一个 if 是解决这个问题的,将每个无分组的医嘱各自归为一组
1118
+        //         if (advice.parent_id > 0) {
1119
+        //           if (this.advice_groups.length > 0) {
1120
+        //             var parent_group = this.advice_groups[
1121
+        //             this.advice_groups.length - 1
1122
+        //               ]
1123
+        //             if (parent_group.advices.length > 0) {
1124
+        //               if (parent_group.advices[0].id == advice.parent_id) {
1125
+        //                 parent_group.advices.push(advice)
1126
+        //               }
1127
+        //             }
1128
+        //           }
1129
+        //           continue
1130
+        //         } else {
1131
+        //           if (group.group_no > 0) {
1132
+        //             this.advice_groups.push(group)
1133
+        //             group = this.newAdviceGroupObject()
1134
+        //           }
1135
+        //
1136
+        //           initGroupBlock(group, advice)
1137
+        //           group.advices.push(advice)
1138
+        //           this.advice_groups.push(group)
1139
+        //           group = this.newAdviceGroupObject()
1140
+        //           continue
1141
+        //         }
1142
+        //       }
1143
+        //
1144
+        //       if (group.group_no > 0 && group.group_no != advice.groupno) {
1145
+        //         this.advice_groups.push(group)
1146
+        //         group = this.newAdviceGroupObject()
1147
+        //       }
1148
+        //       if (group.group_no == 0) {
1149
+        //         initGroupBlock(group, advice)
1150
+        //       }
1151
+        //       if (group.group_no == advice.groupno) {
1152
+        //         group.advices.push(advice)
1153
+        //       }
1154
+        //     }
1155
+        //     if (group.group_no > 0) {
1156
+        //       // 上述的算法会导致最后一组没有加到advice_groups,这里要手动加上
1157
+        //       this.advice_groups.push(group)
1158
+        //     }
1159
+        //
1160
+        //   }
1161
+        //
1162
+        //
1163
+        // }
1161 1164
 
1162 1165
       }
1163 1166
       ,