血透系统pad前端

statOrder.vue 6.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260
  1. <template>
  2. <div class="plate-box">
  3. <h2 class="title border">
  4. <span class="line"></span>
  5. <p>{{ title }}</p>
  6. <span class="line"></span>
  7. </h2>
  8. <div class="newDiv">
  9. <table class="table">
  10. <tr>
  11. <th width="8%">开嘱医生</th>
  12. <th width="8%">开始时间</th>
  13. <th width="20%">医嘱内容</th>
  14. <th width="8%">执行时间</th>
  15. <th width="8%">执行护士</th>
  16. <th v-if="template_id != 6" width="9.4%">核对护士</th>
  17. </tr>
  18. <template v-for="group in advice_groups">
  19. <tr v-for="(advice, i) in group.advices" :key="advice.id">
  20. <td v-if="i == 0" :rowspan="group.advices.length">
  21. {{
  22. doctor_map[advice.advice_doctor] != undefined
  23. ? doctor_map[advice.advice_doctor].name
  24. : ""
  25. }}
  26. </td>
  27. <td v-if="i == 0" :rowspan="group.advices.length">
  28. {{ parseTime(advice.start_time, "{m}-{d} {h}:{i}") }}
  29. </td>
  30. <td
  31. :class="
  32. advice.parent_id == 0 ? 'advice_content' : 'subadvice_content'
  33. "
  34. >
  35. <span>{{ advice.advice_name }}</span>
  36. <span
  37. >{{ advice.drug_spec }}{{ advice.drug_spec_unit }} *
  38. {{ advice.prescribing_number
  39. }}{{ advice.prescribing_number_unit }}</span
  40. >
  41. <span v-if="advice.advice_desc"
  42. >{{ advice.advice_desc }}{{ advice.drug_spec_unit }}</span
  43. >
  44. <span v-if="advice.prescribing_number"
  45. >{{ advice.prescribing_number
  46. }}{{ advice.prescribing_number_unit }}</span
  47. >
  48. <span v-if="advice.single_dose"
  49. >单次用量{{ advice.single_dose
  50. }}{{ advice.single_dose_unit }}</span
  51. >
  52. <span v-if="advice.parent_id == 0">{{
  53. advice.delivery_way
  54. }}</span>
  55. <span v-if="advice.parent_id == 0">{{
  56. advice.execution_frequency
  57. }}</span>
  58. <span v-if="advice.parent_id == 0 && advice.remark.length > 0"
  59. >({{ advice.remark }})</span
  60. >
  61. </td>
  62. <td>{{ parseTime(advice.execution_time, "{m}-{d} {h}:{i}") }}</td>
  63. <td>
  64. {{
  65. advice.execution_staff != 0
  66. ? doctor_map[advice.execution_staff] != undefined
  67. ? doctor_map[advice.execution_staff].name
  68. : ""
  69. : ""
  70. }}
  71. </td>
  72. <td v-if="template_id != 6">
  73. {{
  74. advice.checker != 0
  75. ? doctor_map[advice.checker] != undefined
  76. ? doctor_map[advice.checker].name
  77. : ""
  78. : ""
  79. }}
  80. </td>
  81. </tr>
  82. </template>
  83. </table>
  84. <div class="NoData" v-show="advice_groups.length == 0">
  85. <img
  86. style="margin-top: 50px; margin-bottom: 50px"
  87. src="@/assets/login/data.jpg"
  88. alt
  89. />
  90. </div>
  91. </div>
  92. </div>
  93. </template>
  94. <script>
  95. import { parseTime } from "@/utils";
  96. export default {
  97. name: "statOrder",
  98. data() {
  99. return {
  100. title: "临时医嘱 ",
  101. template_id: 0,
  102. tableDate: []
  103. };
  104. },
  105. props: {
  106. doctor_map: {
  107. type: Object
  108. },
  109. advice_groups: {
  110. type: Array,
  111. default: () => {
  112. return [];
  113. }
  114. }
  115. },
  116. created() {
  117. this.template_id = this.$store.getters.user.template_info.template_id;
  118. console.log(".");
  119. },
  120. methods: {
  121. setAdvices(advices) {
  122. if (advices == null) {
  123. advices = [];
  124. }
  125. this.tableDate.splice(0, this.tableDate.length);
  126. this.tableDate.push(...advices);
  127. },
  128. parseTime(time, layout) {
  129. if (time == 0) {
  130. return "";
  131. }
  132. return parseTime(time, layout);
  133. },
  134. createMedicalOrder(row) {
  135. if (row.parent_id > 0) {
  136. var spliceIndex = -1;
  137. for (let index = this.tableDate.length - 1; ; index--) {
  138. if (this.tableDate[index].parent_id === row.parent_id) {
  139. spliceIndex = index;
  140. break;
  141. } else if (this.tableDate[index].id === row.parent_id) {
  142. spliceIndex = index;
  143. break;
  144. }
  145. }
  146. if (spliceIndex > -1) {
  147. spliceIndex += 1;
  148. if (spliceIndex === this.tableDate.length) {
  149. this.tableDate.push(row);
  150. } else {
  151. var swapData = this.tableDate.splice(spliceIndex);
  152. this.tableDate.push(row);
  153. this.tableDate = this.tableDate.concat(swapData);
  154. }
  155. }
  156. } else {
  157. this.tableDate.unshift(row);
  158. }
  159. },
  160. delMedicalOrder(row) {
  161. if (row.parent_id > 0) {
  162. var rslen = this.tableDate.length;
  163. for (let i = 0; i < rslen; i++) {
  164. if (this.tableDate[i].id == row.id) {
  165. this.tableDate.splice(i, 1);
  166. break;
  167. }
  168. }
  169. } else {
  170. var resetTableData = this.tableDate;
  171. this.tableDate = [];
  172. var that = this;
  173. var rslen = resetTableData.length;
  174. for (let i = 0; i < rslen; i++) {
  175. if (
  176. resetTableData[i].id != row.id &&
  177. resetTableData[i].parent_id != row.id
  178. ) {
  179. that.tableDate.push(resetTableData[i]);
  180. }
  181. }
  182. }
  183. },
  184. executionMedicalOrder(row) {
  185. var alen = this.tableDate.length;
  186. for (let index = 0; index < alen; index++) {
  187. if (this.tableDate[index].id == row.id) {
  188. this.tableDate[index].execution_state = 1;
  189. this.tableDate[index].execution_staff = row.execution_staff;
  190. this.tableDate[index].execution_time = row.execution_time;
  191. this.tableDate[index].checker = row.checker;
  192. break;
  193. }
  194. }
  195. }
  196. }
  197. };
  198. </script>
  199. <style rel="stylesheet/scss" lang="scss" scoped>
  200. .table {
  201. width: 1000px;
  202. overflow: hidden;
  203. font-size: 0.45rem;
  204. text-align: center;
  205. border: $border-color;
  206. tr {
  207. padding: 0;
  208. margin: 0;
  209. padding: 0.1rem 0;
  210. th {
  211. background: $main-color;
  212. border: none;
  213. color: #fff;
  214. padding: 0;
  215. margin: 0;
  216. height: 1.2rem;
  217. line-height: 1.2rem;
  218. font-weight: normal;
  219. }
  220. .advice_content {
  221. text-align: left;
  222. padding-left: 5px;
  223. padding-right: 5px;
  224. // background: #eff6fc;
  225. }
  226. .subadvice_content {
  227. text-align: left;
  228. padding-left: 25px;
  229. padding-right: 5px;
  230. // background: #fafcfe;
  231. }
  232. }
  233. }
  234. .newDiv {
  235. width: 100%;
  236. overflow-x: auto;
  237. }
  238. </style>
  239. <style lang="scss">
  240. .el-table td {
  241. padding: 0;
  242. }
  243. .el-table th {
  244. padding: 6px 0;
  245. }
  246. </style>