血透系统pad前端

NormalAdviceTable.vue 14KB

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