血透系统pad前端

NormalAdviceTable.vue 15KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523
  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 }}</span
  150. >
  151. <span v-if="advice.single_dose">
  152. 单次用量 {{ advice.single_dose
  153. }}{{ advice.single_dose_unit }}</span
  154. >
  155. <span>{{ advice.delivery_way }}</span>
  156. <span>{{ advice.execution_frequency }}</span>
  157. </td>
  158. <td>
  159. {{
  160. advice.parent_id == 0
  161. ? parseTime(advice.execution_time, "{m}-{d} {h}:{i}")
  162. : ""
  163. }}
  164. </td>
  165. <td>
  166. {{
  167. advice.parent_id == 0 ? getName(advice.execution_staff) : ""
  168. }}
  169. </td>
  170. <td>
  171. {{ advice.parent_id == 0 ? getName(advice.checker) : "" }}
  172. </td>
  173. <td>
  174. {{
  175. advice.parent_id == 0
  176. ? parseTime(advice.check_time, "{m}-{d} {h}:{i}")
  177. : ""
  178. }}
  179. </td>
  180. <td>
  181. {{ advice.parent_id == 0 ? getName(advice.advice_doctor) : "" }}
  182. </td>
  183. <td>
  184. {{
  185. advice.parent_id == 0
  186. ? parseTime(advice.created_time, "{m}-{d} {h}:{i}")
  187. : ""
  188. }}
  189. </td>
  190. </tr>
  191. </template>
  192. </template>
  193. </table>
  194. <div class="NoData" v-show="zones.length <= 1">
  195. <img
  196. style="margin-top: 50px; margin-bottom: 50px"
  197. src="@/assets/login/data.jpg"
  198. alt=""
  199. />
  200. </div>
  201. </div>
  202. <!--<div class="NoData" v-show="zones.length <= 1"><img src="@/assets/login/data.jpg" alt=""></div>-->
  203. <mt-datetime-picker
  204. v-model="selected_date"
  205. type="date"
  206. ref="picker"
  207. year-format="{value} "
  208. month-format="{value} "
  209. date-format="{value} "
  210. @confirm="requestSchedualDoctors"
  211. >
  212. </mt-datetime-picker>
  213. </div>
  214. </template>
  215. <script>
  216. import SideBar from "@/pages/layout/SideBar";
  217. import { parseTime } from "@/utils";
  218. import { getSchedualDoctors } from "@/api/advice";
  219. export default {
  220. name: "DialysisAdviceTable",
  221. components: {
  222. SideBar
  223. },
  224. data() {
  225. return {
  226. selected_date: new Date(),
  227. admin_user: [],
  228. show_sch_type_selector: false,
  229. schedule_type_selected: 0,
  230. schedule_types: [
  231. { value: 0, text: "全部班次" },
  232. { value: 1, text: "上午" },
  233. { value: 2, text: "下午" },
  234. { value: 3, text: "晚上" }
  235. ],
  236. show_zone_selector: false,
  237. zone_selected: 0,
  238. show_patient_type_selector: false,
  239. zones: [{ value: 0, text: "全部分区", select: true }],
  240. show_advice_type_selector: false,
  241. advice_type_selected: 0,
  242. advice_types: [
  243. { value: 0, text: "全部医嘱" },
  244. { value: 1, text: "长期医嘱" },
  245. { value: 3, text: "临时医嘱" }
  246. ],
  247. patient_types: [
  248. { value: 0, text: "全部病人" },
  249. { value: 1, text: "我的病人" },
  250. { value: 2, text: "未执行病人" }
  251. ],
  252. patient_selected: 0,
  253. scheduleMap: {}
  254. };
  255. },
  256. computed: {
  257. selected_date_str: function() {
  258. return parseTime(this.selected_date, "{y}-{m}-{d}");
  259. },
  260. filtedScheduals: function() {
  261. var scheduleMap = new Object();
  262. if (this.zone_selected == 0) {
  263. for (const key in this.scheduleMap) {
  264. scheduleMap[key] = this.scheduleMap[key];
  265. }
  266. } else {
  267. var zone_name = this.zones[this.zone_selected].text;
  268. scheduleMap[zone_name] = this.scheduleMap[zone_name];
  269. }
  270. if (this.schedule_type_selected != 0) {
  271. var _scheduleMap = {};
  272. for (const key in scheduleMap) {
  273. var origin_schedules = scheduleMap[key];
  274. var schedules = [];
  275. for (let index = 0; index < origin_schedules.length; index++) {
  276. const schedule = origin_schedules[index];
  277. if (schedule.schedule_type == this.schedule_type_selected) {
  278. schedules.push(schedule);
  279. }
  280. }
  281. if (schedules.length > 0) {
  282. _scheduleMap[key] = schedules;
  283. }
  284. }
  285. scheduleMap = _scheduleMap;
  286. }
  287. return scheduleMap;
  288. }
  289. },
  290. created() {
  291. this.requestSchedualDoctors();
  292. },
  293. methods: {
  294. getNumber: function(advice) {
  295. if (
  296. advice.parent_id == 0 &&
  297. advice.dialysis_order &&
  298. advice.dialysis_order.device_number &&
  299. advice.dialysis_order.device_number.number.length > 0
  300. ) {
  301. console.log("111111");
  302. } else {
  303. console.log("222222");
  304. }
  305. },
  306. clickfunction: function(val) {
  307. // console.log(val);
  308. this.$router.push({
  309. path: "/details",
  310. query: {
  311. patient_id: val.patient.id,
  312. date: this.selected_date.getTime() / 1000,
  313. patient_name: val.patient.name
  314. }
  315. });
  316. },
  317. handlePaitentType: function(index) {
  318. this.patient_selected = index;
  319. this.show_patient_type_selector = false;
  320. this.requestSchedualDoctors();
  321. },
  322. openPicker() {
  323. this.$refs.picker.open();
  324. },
  325. getAdaviceType(type, parent_id) {
  326. if (parent_id == 0) {
  327. if (type == 1) {
  328. return "长嘱";
  329. } else if (type == 2) {
  330. return "临嘱";
  331. } else if (type == 3) {
  332. return "临嘱";
  333. }
  334. }
  335. },
  336. getName(val) {
  337. for (let i = 0; i < this.admin_user.length; i++) {
  338. if (this.admin_user[i].id == val) {
  339. return this.admin_user[i].name;
  340. }
  341. }
  342. },
  343. handletimeType: function(index) {
  344. this.schedule_type_selected = index;
  345. this.show_sch_type_selector = false;
  346. },
  347. handleAdviceType: function(index) {
  348. this.advice_type_selected = index;
  349. this.show_advice_type_selector = false;
  350. this.requestSchedualDoctors();
  351. },
  352. handleZoneChange: function(index) {
  353. this.zone_selected = index;
  354. this.show_zone_selector = false;
  355. },
  356. parseTime: function(time, layout) {
  357. if (time == 0) {
  358. return "";
  359. }
  360. return parseTime(time, layout);
  361. },
  362. requestSchedualDoctors() {
  363. getSchedualDoctors({
  364. date: this.selected_date_str,
  365. patient_type: this.patient_selected,
  366. advice_type: this.advice_type_selected
  367. }).then(rs => {
  368. var resp = rs.data;
  369. if (resp.state == 1) {
  370. this.admin_user = resp.data.adminUser;
  371. var schedules = resp.data.scheduals;
  372. var zoneMap = {};
  373. var scheduleMap = {};
  374. for (let index = 0; index < schedules.length; index++) {
  375. const schedule = schedules[index];
  376. if (schedule.doctor_advice.length == 0) {
  377. continue;
  378. }
  379. if (scheduleMap[schedule.device_number.zone.name] == null) {
  380. scheduleMap[schedule.device_number.zone.name] = [];
  381. }
  382. scheduleMap[schedule.device_number.zone.name].push(schedule);
  383. if (zoneMap[schedule.device_number.zone.name] == null) {
  384. zoneMap[schedule.device_number.zone.name] =
  385. schedule.device_number.zone;
  386. }
  387. }
  388. var zones = [];
  389. zones.push({ value: 0, text: "全部分区" });
  390. for (var zoneName in zoneMap) {
  391. zones.push({ value: zoneMap[zoneName].id, text: zoneName });
  392. }
  393. zones = zones.sort(function(a, b) {
  394. return a.value > b.value;
  395. });
  396. this.zones = zones;
  397. this.scheduleMap = scheduleMap;
  398. } else {
  399. this.$toast({
  400. message: resp.msg
  401. });
  402. }
  403. });
  404. },
  405. adviceDesc(advice) {}
  406. }
  407. };
  408. </script>
  409. <style style="stylesheet/scss" lang="scss" scoped>
  410. .top {
  411. .hospital {
  412. width: 2rem;
  413. }
  414. .TopTitle {
  415. font-size: 0.36rem;
  416. color: $title-color;
  417. font-weight: normal;
  418. }
  419. padding: 0.3rem 0.3rem;
  420. @include display-flex;
  421. @include align-items-center;
  422. @include text-align;
  423. @include justify-content-between;
  424. border-bottom: 1px #e5e5e5 solid;
  425. .title {
  426. font-size: 0.3rem;
  427. font-weight: bold;
  428. color: $pgh-color;
  429. }
  430. .iconfont {
  431. font-size: 0.4rem;
  432. color: #a8b3ba;
  433. }
  434. }
  435. .search {
  436. background: #ebf1f7;
  437. border-radius: 30px;
  438. padding: 0 0.3rem;
  439. height: 0.6rem;
  440. line-height: 0.6rem;
  441. color: #a8b3ba;
  442. .iconfont {
  443. color: #a8b3ba;
  444. font-size: 0.28rem;
  445. }
  446. .searchInput {
  447. font-size: 0.28rem;
  448. border: none;
  449. outline: none;
  450. background: #ebf1f7;
  451. }
  452. }
  453. .choice {
  454. border-bottom: 1px #e5e5e5 solid;
  455. position: fixed;
  456. top: 63px;
  457. right: 0;
  458. z-index: 66;
  459. left: 1.58rem;
  460. background: #fff;
  461. @media only screen and (max-width: 812px) {
  462. top: 43px !important;
  463. }
  464. ul {
  465. @include display-flex;
  466. @include align-items-center;
  467. @include text-align;
  468. @include justify-content-between;
  469. width: 70%;
  470. margin: 0 auto;
  471. font-size: 0.32rem;
  472. color: $pgh-color;
  473. li {
  474. @include display-flex;
  475. @include align-items-center;
  476. @include text-align;
  477. @include justify-content-between;
  478. padding: 0.3rem 0;
  479. font-size: 0.32rem;
  480. .iconfont {
  481. margin: 0 0.1rem;
  482. }
  483. .line {
  484. background: #a8b3ba;
  485. width: 0.2rem;
  486. height: 1px;
  487. margin: 0 0.2rem;
  488. display: inline-block;
  489. }
  490. }
  491. }
  492. }
  493. .table {
  494. }
  495. .NormalAdvice {
  496. padding-top: 115px;
  497. background: #fff;
  498. min-height: calc(100vh - 2px);
  499. @media only screen and (max-width: 812px) {
  500. padding-top: 80px !important;
  501. }
  502. }
  503. </style>