血透系统pad前端

statOrder.vue 6.0KB

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