scheduling.vue 5.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194
  1. <template>
  2. <div class="patient-container">
  3. <patient-sidebar :id="patientID" defaultActive="2-4"></patient-sidebar>
  4. <div class="patient-app-container app-container ">
  5. <!-- <table-title title="排班记录列表"></table-title> -->
  6. <div class="sum">
  7. <!-- <span>治疗频率 : 两周5次 </span> -->
  8. </div>
  9. <el-table
  10. :data="schedules"
  11. border
  12. :header-cell-style="{
  13. backgroundColor: 'rgb(245, 247, 250)',
  14. color: '#606266'
  15. }"
  16. :row-style="{ color: '#303133' }"
  17. style="width: 100%"
  18. >
  19. <el-table-column
  20. prop="schedule_date"
  21. label="日期"
  22. align="center"
  23. min-width="60"
  24. >
  25. <template slot-scope="scope">
  26. {{ scope.row.week }}周 ({{
  27. scope.row.schedule_date | parseTime("{y}-{m}-{d}")
  28. }})
  29. </template>
  30. </el-table-column>
  31. <el-table-column
  32. prop="schedule_type"
  33. label="星期"
  34. align="center"
  35. min-width="60"
  36. >
  37. <template slot-scope="scope">
  38. <span v-if="scope.row.schedule_week == 0">星期日</span>
  39. <span v-if="scope.row.schedule_week == 1">星期一</span>
  40. <span v-if="scope.row.schedule_week == 2">星期二</span>
  41. <span v-if="scope.row.schedule_week == 3">星期三</span>
  42. <span v-if="scope.row.schedule_week == 4">星期四</span>
  43. <span v-if="scope.row.schedule_week == 5">星期五</span>
  44. <span v-if="scope.row.schedule_week == 6">星期六</span>
  45. </template>
  46. </el-table-column>
  47. <el-table-column
  48. prop="schedule_type"
  49. label="班次"
  50. align="center"
  51. min-width="60"
  52. >
  53. <template slot-scope="scope">{{
  54. scheduleType(scope.row.schedule_type)
  55. }}</template>
  56. </el-table-column>
  57. <el-table-column
  58. prop="zone.name"
  59. label="分区"
  60. align="center"
  61. min-width="60"
  62. >
  63. </el-table-column>
  64. <el-table-column
  65. prop="bed.number"
  66. label="机号"
  67. align="center"
  68. min-width="60"
  69. >
  70. </el-table-column>
  71. <el-table-column
  72. prop="mode_id"
  73. label="治疗模式"
  74. align="center"
  75. min-width="80"
  76. >
  77. <template slot-scope="scope">{{
  78. modeName(scope.row.mode_id)
  79. }}</template>
  80. </el-table-column>
  81. <!-- <el-table-column
  82. prop="apply"
  83. label="申请调班日期"
  84. align="center"
  85. min-width="120">
  86. </el-table-column>
  87. <el-table-column
  88. prop="reason"
  89. label="申请理由"
  90. align="center"
  91. min-width="70">
  92. </el-table-column>
  93. <el-table-column
  94. prop="status"
  95. label="申请状态"
  96. align="center"
  97. min-width="70">
  98. </el-table-column>
  99. <el-table-column
  100. prop="operation"
  101. label="操作"
  102. align="center"
  103. min-width="60">
  104. </el-table-column> -->
  105. </el-table>
  106. </div>
  107. </div>
  108. </template>
  109. <script>
  110. import tableTitle from "./components/tableTitle";
  111. import PatientSidebar from "./components/PatientSidebar";
  112. import { GetPatientSchedules } from "@/api/schedule";
  113. export default {
  114. name: "scheduling",
  115. data() {
  116. return {
  117. modeOptions: null,
  118. schedules: [],
  119. patientID: 0
  120. };
  121. },
  122. components: {
  123. tableTitle,
  124. PatientSidebar
  125. },
  126. methods: {
  127. GetPatientSchedules(id) {
  128. GetPatientSchedules(id).then(response => {
  129. if (response.data.state == 1) {
  130. this.schedules = response.data.data.schedules;
  131. }
  132. });
  133. },
  134. scheduleType(scheduleType) {
  135. var typeName = "";
  136. switch (scheduleType) {
  137. case 1:
  138. typeName = "上午";
  139. break;
  140. case 2:
  141. typeName = "下午";
  142. break;
  143. case 3:
  144. typeName = "晚上";
  145. break;
  146. default:
  147. break;
  148. }
  149. return typeName;
  150. },
  151. modeName(mode_id) {
  152. return typeof this.modeOptions[mode_id] != "undefined" &&
  153. typeof this.modeOptions[mode_id].name != "undefined"
  154. ? this.modeOptions[mode_id].name
  155. : "";
  156. }
  157. },
  158. created() {
  159. const id = this.$route.params && this.$route.params.id;
  160. this.patientID = parseInt(id);
  161. if (isNaN(this.patientID) || this.patientID <= 0) {
  162. this.$notify.error({
  163. title: "错误",
  164. message: "无效的id"
  165. });
  166. this.$router.push("/patients/patients");
  167. }
  168. this.modeOptions = this.$store.getters.treatment_mode;
  169. this.GetPatientSchedules(this.patientID);
  170. }
  171. };
  172. </script>
  173. <style rel="stylesheet/css" lang="scss" scoped></style>
  174. <style>
  175. .el-table td,
  176. .el-table th.is-leaf,
  177. .el-table--border,
  178. .el-table--group {
  179. border-color: #d0d3da;
  180. }
  181. .el-table--border::after,
  182. .el-table--group::after,
  183. .el-table::before {
  184. background-color: #d0d3da;
  185. }
  186. </style>