血透系统pad前端

DialysisAdviceTable.vue 12KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399
  1. <template>
  2. <div class="mainBox">
  3. <div class="choice">
  4. <ul>
  5. <el-popover placement="bottom" trigger="click" v-model="show_patient_type_selector">
  6. <li slot="reference">{{patient_types[patient_selected].text}}<span class="iconfont">&#xe74a;</span></li>
  7. <div class="popover-demo-content">
  8. <ul>
  9. <li v-for="type in patient_types" :key="type.value" @click="handlePaitentType(type.value)" :class="advice_type_selected == type.value ? 'tick' : ''" >{{type.text}}</li>
  10. </ul>
  11. </div>
  12. </el-popover>
  13. <el-popover placement="bottom" trigger="click" v-model="show_zone_selector">
  14. <li slot="reference">{{zones[zone_selected].text}}<span class="iconfont">&#xe74a;</span></li>
  15. <div class="popover-demo-content">
  16. <ul>
  17. <li v-for="(zone, index) in zones" :key="zone.value" @click="handleZoneChange(index)" :class="zone_selected == index ? 'tick' : ''">{{zone.text}}</li>
  18. </ul>
  19. </div>
  20. </el-popover>
  21. <el-popover placement="bottom" trigger="click" v-model="show_sch_type_selector">
  22. <li slot="reference">{{schedule_types[schedule_type_selected].text}}<span class="iconfont">&#xe74a;</span></li>
  23. <div class="popover-demo-content">
  24. <ul>
  25. <li v-for="scheduleType in schedule_types" :key="scheduleType.value" @click="handletimeType(scheduleType.value)" :class="schedule_type_selected == scheduleType.value ? 'tick' : ''" >{{scheduleType.text}}</li>
  26. </ul>
  27. </div>
  28. </el-popover>
  29. <!--<el-popover placement="bottom" trigger="click" v-model="show_advice_type_selector">-->
  30. <!--<li slot="reference">{{advice_types[advice_type_selected].text}}<span class="iconfont">&#xe74a;</span></li>-->
  31. <!--<div class="popover-demo-content">-->
  32. <!--<ul>-->
  33. <!--<li v-for="type in advice_types" :key="type.value" @click="handleAdviceType(type.value)" :class="advice_type_selected == type.value ? 'tick' : ''" >{{type.text}}</li>-->
  34. <!--</ul>-->
  35. <!--</div>-->
  36. <!--</el-popover>-->
  37. <li @click="openPicker()">
  38. {{ selected_date_str }}
  39. <span class="iconfont">&#xe74a;</span>
  40. </li>
  41. </ul>
  42. </div>
  43. <div class="blueBorder"></div>
  44. <div style="width:100%;overflow:hildden;overflow-x:auto;">
  45. <table class="table">
  46. <tr>
  47. <th width="50px">机号</th>
  48. <th width="50px">姓名</th>
  49. <th width="50px">透析号</th>
  50. <th width="50px">期效</th>
  51. <th width="100px">开始时间</th>
  52. <th width="200px">医嘱内容</th>
  53. <th width="50px">执行时间</th>
  54. <th width="50px">执行护士</th>
  55. <th width="50px">校对护士</th>
  56. <th width="100px">校对时间</th>
  57. <th width="50px">开嘱医生</th>
  58. <th width="100px">开嘱时间</th>
  59. </tr>
  60. <template v-for="(schedules, zone_name, index) in filtedScheduals">
  61. <tr :key="index">
  62. <td>{{ zone_name }}</td>
  63. <td></td>
  64. <td></td>
  65. <td></td>
  66. <td></td>
  67. <td></td>
  68. <td></td>
  69. <td></td>
  70. <td></td>
  71. <td></td>
  72. <td></td>
  73. <td></td>
  74. </tr>
  75. <template v-for="(schedule) in schedules">
  76. <tr v-for="(advice, advice_index) in schedule.doctor_advice" :key="advice_index + '_' + index" @click="clickfunction(schedule)">
  77. <td>{{ advice.parent_id == 0 ? schedule.device_number.number : "" }}</td>
  78. <td>{{ advice.parent_id == 0 ? schedule.patient.name : "" }}</td>
  79. <td>{{ advice.parent_id == 0 ? schedule.patient.dialysis_no : "" }}</td>
  80. <td>{{ getAdaviceType(advice.advice_type)}}</td>
  81. <td>{{ advice.parent_id == 0 ? parseTime(advice.start_time, "{m}-{d} {h}:{i}") : "" }}</td>
  82. <td>
  83. <span >{{advice.advice_name }}</span>
  84. <span >{{advice.advice_desc}}</span>
  85. <span>{{advice.prescribing_number}}{{advice.prescribing_number_unit}}</span>
  86. <span> 单次用量 {{advice.single_dose}}{{advice.single_dose_unit}}</span>
  87. <span >{{advice.delivery_way}}</span>
  88. <span >{{advice.execution_frequency}}</span>
  89. </td>
  90. <td>{{ advice.parent_id == 0 ? parseTime(advice.execution_time, "{m}-{d} {h}:{i}") : "" }}</td>
  91. <td>{{ advice.parent_id == 0 ? getName(advice.execution_staff) : "" }}</td>
  92. <td>{{ advice.parent_id == 0 ? getName(advice.checker) : "" }}</td>
  93. <td>{{ advice.parent_id == 0 ? parseTime(advice.check_time, "{m}-{d} {h}:{i}") : "" }}</td>
  94. <td>{{ advice.parent_id == 0 ? getName(advice.advice_doctor) : "" }}</td>
  95. <td>{{ advice.parent_id == 0 ? parseTime(advice.created_time, "{m}-{d} {h}:{i}") : "" }}</td>
  96. </tr>
  97. </template>
  98. </template>
  99. </table>
  100. </div>
  101. <!--<div class="NoData" v-show="zones.length <= 1"><img src="@/assets/login/data.jpg" alt=""></div>-->
  102. <div class="NoData" v-show="zones.length <= 1"><img style="margin-top: 50px; margin-bottom: 50px" src="@/assets/login/data.jpg" alt=""></div>
  103. <mt-datetime-picker
  104. v-model="selected_date"
  105. type="date"
  106. ref="picker"
  107. year-format="{value} "
  108. month-format="{value} "
  109. date-format="{value} "
  110. @confirm="requestSchedualDoctors">
  111. </mt-datetime-picker>
  112. </div>
  113. </template>
  114. <script>
  115. import SideBar from "@/pages/layout/SideBar";
  116. import { parseTime } from "@/utils";
  117. import { getSchedualDoctors } from "@/api/advice";
  118. export default {
  119. name: "DialysisAdviceTable",
  120. components: {
  121. SideBar
  122. },
  123. data() {
  124. return {
  125. selected_date: new Date(),
  126. admin_user: [],
  127. show_sch_type_selector: false,
  128. schedule_type_selected: 0,
  129. schedule_types: [
  130. { value: 0, text: "全部班次" },
  131. { value: 1, text: "上午" },
  132. { value: 2, text: "下午" },
  133. { value: 3, text: "晚上" }
  134. ],
  135. show_zone_selector: false,
  136. zone_selected: 0,
  137. show_patient_type_selector: false,
  138. zones: [{ value: 0, text: "全部分区", select: true }],
  139. show_advice_type_selector: false,
  140. advice_type_selected: 0,
  141. advice_types: [
  142. { value: 0, text: "全部医嘱" },
  143. { value: 1, text: "长期医嘱" },
  144. { value: 3, text: "临时医嘱" }
  145. ],
  146. patient_types: [
  147. { value: 0, text: "全部病人" },
  148. { value: 1, text: "我的病人" },
  149. { value: 2, text: "未执行病人" }
  150. ],
  151. patient_selected: 0,
  152. scheduleMap: {}
  153. };
  154. },
  155. computed: {
  156. selected_date_str: function() {
  157. return parseTime(this.selected_date, "{y}-{m}-{d}");
  158. },
  159. filtedScheduals: function() {
  160. var scheduleMap = new Object();
  161. if (this.zone_selected == 0) {
  162. for (const key in this.scheduleMap) {
  163. scheduleMap[key] = this.scheduleMap[key];
  164. }
  165. } else {
  166. var zone_name = this.zones[this.zone_selected].text;
  167. scheduleMap[zone_name] = this.scheduleMap[zone_name];
  168. }
  169. if (this.schedule_type_selected != 0) {
  170. var _scheduleMap = {};
  171. for (const key in scheduleMap) {
  172. var origin_schedules = scheduleMap[key];
  173. var schedules = [];
  174. for (let index = 0; index < origin_schedules.length; index++) {
  175. const schedule = origin_schedules[index];
  176. if (schedule.schedule_type == this.schedule_type_selected) {
  177. schedules.push(schedule);
  178. }
  179. }
  180. if (schedules.length > 0) {
  181. _scheduleMap[key] = schedules;
  182. }
  183. }
  184. scheduleMap = _scheduleMap;
  185. }
  186. return scheduleMap;
  187. }
  188. },
  189. created() {
  190. this.requestSchedualDoctors();
  191. },
  192. methods: {
  193. clickfunction: function(val) {
  194. console.log(val);
  195. this.$router.push({
  196. path: "/details",
  197. query: {
  198. patient_id: val.patient.id,
  199. date: this.selected_date.getTime() / 1000,
  200. patient_name: val.patient.name
  201. }
  202. });
  203. },
  204. handlePaitentType: function(index) {
  205. this.patient_selected = index;
  206. this.show_patient_type_selector = false;
  207. this.requestSchedualDoctors();
  208. },
  209. openPicker() {
  210. this.$refs.picker.open();
  211. },
  212. getAdaviceType(type) {
  213. if (type == 1) {
  214. return "长嘱";
  215. } else if (type == 2) {
  216. return "临嘱";
  217. } else if (type == 3) {
  218. return "临嘱";
  219. }
  220. },
  221. getName(val) {
  222. for (let i = 0; i < this.admin_user.length; i++) {
  223. if ((this.admin_user[i].id = val)) {
  224. return this.admin_user[i].name;
  225. }
  226. }
  227. },
  228. handletimeType: function(index) {
  229. this.schedule_type_selected = index;
  230. this.show_sch_type_selector = false;
  231. },
  232. handleAdviceType: function(index) {
  233. this.advice_type_selected = index;
  234. this.show_advice_type_selector = false;
  235. this.requestSchedualDoctors();
  236. },
  237. handleZoneChange: function(index) {
  238. this.zone_selected = index;
  239. this.show_zone_selector = false;
  240. },
  241. parseTime: function(time, layout) {
  242. console.log(time);
  243. if (time == 0) {
  244. return "";
  245. }
  246. return parseTime(time, layout);
  247. },
  248. requestSchedualDoctors() {
  249. getSchedualDoctors({
  250. date: this.selected_date_str,
  251. patient_type: this.patient_selected,
  252. advice_type: 2
  253. }).then(rs => {
  254. var resp = rs.data;
  255. if (resp.state == 1) {
  256. this.admin_user = resp.data.adminUser;
  257. var schedules = resp.data.scheduals;
  258. var zoneMap = {};
  259. var scheduleMap = {};
  260. for (let index = 0; index < schedules.length; index++) {
  261. const schedule = schedules[index];
  262. if (schedule.doctor_advice.length == 0) {
  263. continue;
  264. }
  265. if (scheduleMap[schedule.device_zone.name] == null) {
  266. scheduleMap[schedule.device_zone.name] = [];
  267. }
  268. scheduleMap[schedule.device_zone.name].push(schedule);
  269. if (zoneMap[schedule.device_zone.name] == null) {
  270. zoneMap[schedule.device_zone.name] = schedule.device_zone;
  271. }
  272. }
  273. var zones = [];
  274. zones.push({ value: 0, text: "全部分区" });
  275. for (var zoneName in zoneMap) {
  276. zones.push({ value: zoneMap[zoneName].id, text: zoneName });
  277. }
  278. zones = zones.sort(function(a, b) {
  279. return a.value > b.value;
  280. });
  281. this.zones = zones;
  282. this.scheduleMap = scheduleMap;
  283. } else {
  284. this.$toast({
  285. message: resp.msg
  286. });
  287. }
  288. });
  289. },
  290. adviceDesc(advice) {}
  291. }
  292. };
  293. </script>
  294. <style style="stylesheet/scss" lang="scss" scoped>
  295. .top {
  296. .hospital {
  297. width: 2rem;
  298. }
  299. .TopTitle {
  300. font-size: 0.36rem;
  301. color: $title-color;
  302. font-weight: normal;
  303. }
  304. padding: 0.3rem 0.3rem;
  305. @include display-flex;
  306. @include align-items-center;
  307. @include text-align;
  308. @include justify-content-between;
  309. border-bottom: 1px #e5e5e5 solid;
  310. .title {
  311. font-size: 0.3rem;
  312. font-weight: bold;
  313. color: $pgh-color;
  314. }
  315. .iconfont {
  316. font-size: 0.4rem;
  317. color: #a8b3ba;
  318. }
  319. }
  320. .search {
  321. background: #ebf1f7;
  322. border-radius: 30px;
  323. padding: 0 0.3rem;
  324. height: 0.6rem;
  325. line-height: 0.6rem;
  326. color: #a8b3ba;
  327. .iconfont {
  328. color: #a8b3ba;
  329. font-size: 0.28rem;
  330. }
  331. .searchInput {
  332. font-size: 0.28rem;
  333. border: none;
  334. outline: none;
  335. background: #ebf1f7;
  336. }
  337. }
  338. .choice {
  339. border-bottom: 1px #e5e5e5 solid;
  340. ul {
  341. @include display-flex;
  342. @include align-items-center;
  343. @include text-align;
  344. @include justify-content-between;
  345. width: 70%;
  346. margin: 0 auto;
  347. font-size: 0.32rem;
  348. color: $pgh-color;
  349. li {
  350. @include display-flex;
  351. @include align-items-center;
  352. @include text-align;
  353. @include justify-content-between;
  354. padding: 0.3rem 0;
  355. font-size: 0.32rem;
  356. .iconfont {
  357. margin: 0 0.1rem;
  358. }
  359. .line {
  360. background: #a8b3ba;
  361. width: 0.2rem;
  362. height: 1px;
  363. margin: 0 0.2rem;
  364. display: inline-block;
  365. }
  366. }
  367. }
  368. }
  369. </style>