Browse Source

Merge branch 'wzf' of http://git.shengws.com/zhangbj/xt_pad into wzf

See999 5 years ago
parent
commit
e77d259369
1 changed files with 90 additions and 6 deletions
  1. 90 6
      src/pages/main/today/statOrder.vue

+ 90 - 6
src/pages/main/today/statOrder.vue View File

@@ -61,16 +61,16 @@
61 61
 </template>
62 62
 
63 63
 <script>
64
-import { parseTime } from "@/utils";
64
+import { parseTime } from '@/utils';
65 65
 
66 66
 export default {
67
-  name: "statOrder",
68
-  data() {
67
+  name: 'statOrder',
68
+  data () {
69 69
     return {
70
-      title: "临时医嘱 ",
70
+      title: '临时医嘱 ',
71 71
       template_id: 0,
72 72
       tableDate: []
73
-    };
73
+    }
74 74
   },
75 75
   props: {
76 76
     doctor_map: {
@@ -79,10 +79,94 @@ export default {
79 79
     advice_groups: {
80 80
       type: Array,
81 81
       default: () => {
82
-        return [];
82
+        return []
83 83
       }
84 84
     }
85 85
   },
86
+  created () {
87
+    this.template_id = this.$store.getters.user.template_info.template_id
88
+    console.log('a')
89
+  },
90
+  methods: {
91
+    setAdvices (advices) {
92
+      if (advices == null) {
93
+        advices = []
94
+      }
95
+      this.tableDate.splice(0, this.tableDate.length)
96
+      this.tableDate.push(...advices)
97
+    },
98
+    parseTime (time, layout) {
99
+      if (time == 0) {
100
+        return ''
101
+      }
102
+      return parseTime(time, layout)
103
+    },
104
+    createMedicalOrder (row) {
105
+      if (row.parent_id > 0) {
106
+        var spliceIndex = -1
107
+        for (let index = this.tableDate.length - 1; ; index--) {
108
+          if (this.tableDate[index].parent_id === row.parent_id) {
109
+            spliceIndex = index
110
+            break
111
+          } else if (this.tableDate[index].id === row.parent_id) {
112
+            spliceIndex = index
113
+            break
114
+          }
115
+        }
116
+        if (spliceIndex > -1) {
117
+          spliceIndex += 1
118
+          if (spliceIndex === this.tableDate.length) {
119
+            this.tableDate.push(row)
120
+          } else {
121
+            var swapData = this.tableDate.splice(spliceIndex)
122
+            this.tableDate.push(row)
123
+            this.tableDate = this.tableDate.concat(swapData)
124
+          }
125
+        }
126
+      } else {
127
+        this.tableDate.unshift(row)
128
+      }
129
+    },
130
+    delMedicalOrder (row) {
131
+      if (row.parent_id > 0) {
132
+        var rslen = this.tableDate.length
133
+        for (let i = 0; i < rslen; i++) {
134
+          if (this.tableDate[i].id == row.id) {
135
+            this.tableDate.splice(i, 1)
136
+            break
137
+          }
138
+        }
139
+      } else {
140
+        var resetTableData = this.tableDate
141
+        this.tableDate = []
142
+        var that = this
143
+        var rslen = resetTableData.length
144
+        for (let i = 0; i < rslen; i++) {
145
+          if (
146
+            resetTableData[i].id != row.id &&
147
+            resetTableData[i].parent_id != row.id
148
+          ) {
149
+            that.tableDate.push(resetTableData[i])
150
+          }
151
+        }
152
+      }
153
+    },
154
+    executionMedicalOrder (row) {
155
+      var alen = this.tableDate.length
156
+      for (let index = 0; index < alen; index++) {
157
+        if (this.tableDate[index].id == row.id) {
158
+          this.tableDate[index].execution_state = 1
159
+          this.tableDate[index].execution_staff = row.execution_staff
160
+          this.tableDate[index].execution_time = row.execution_time
161
+          this.tableDate[index].checker = row.checker
162
+          break
163
+        }
164
+      }
165
+    }
166
+  }
167
+}
168
+</script>
169
+import { parseTime } from '@/utils'
86 170
 
87 171
   methods: {
88 172
     setAdvices(advices) {