血透系统pad前端

NormalAdviceTable.vue 15KB

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