血透系统pad前端

statOrder.vue 7.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256
  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. <el-table :data="date" border style="width: 100%">
  53. <el-table-column fixed prop="date" label="开嘱医生" width="100"></el-table-column>
  54. <el-table-column prop="name" label="开始时间" width="100"></el-table-column>
  55. <el-table-column prop="province" label="医嘱内容" width="100"></el-table-column>
  56. <el-table-column prop="city" label="执行时间" width="100"></el-table-column>
  57. <el-table-column prop="address" label="执行护士" width="200"></el-table-column>
  58. </el-table>
  59. </div>
  60. </template>
  61. <script>
  62. import { parseTime } from "@/utils";
  63. export default {
  64. name: "statOrder",
  65. data() {
  66. return {
  67. title: "临时医嘱 ",
  68. template_id: 0,
  69. tableDate: [],
  70. date: [
  71. {
  72. date: "2016-05-02",
  73. name: "王小虎",
  74. province: "上海",
  75. city: "普陀区",
  76. address: "上海市普陀区金沙江路 1518 弄",
  77. zip: 200333
  78. },
  79. {
  80. date: "2016-05-04",
  81. name: "王小虎",
  82. province: "上海",
  83. city: "普陀区",
  84. address: "上海市普陀区金沙江路 1517 弄",
  85. zip: 200333
  86. },
  87. {
  88. date: "2016-05-01",
  89. name: "王小虎",
  90. province: "上海",
  91. city: "普陀区",
  92. address: "上海市普陀区金沙江路 1519 弄",
  93. zip: 200333
  94. },
  95. {
  96. date: "2016-05-03",
  97. name: "王小虎",
  98. province: "上海",
  99. city: "普陀区",
  100. address: "上海市普陀区金沙江路 1516 弄",
  101. zip: 200333
  102. }
  103. ]
  104. };
  105. },
  106. props: {
  107. doctor_map: {
  108. type: Object
  109. },
  110. advice_groups: {
  111. type: Array,
  112. default: () => {
  113. return [];
  114. }
  115. }
  116. },
  117. created() {
  118. this.template_id = this.$store.getters.user.template_info.template_id;
  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.34rem;
  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: 0.88rem;
  217. line-height: 0.88rem;
  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>