dialysisDoctorAdvice.vue 38KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132
  1. <template>
  2. <div class="main-contain">
  3. <div class="position">
  4. <bread-crumb :crumbs="crumbs"></bread-crumb>
  5. <div>
  6. <el-button
  7. size="small"
  8. icon="el-icon-printer"
  9. :disabled="selecting_schs.length == 0"
  10. @click="signPrintAction"
  11. type="primary"
  12. style="margin-right:10"
  13. >标签打印
  14. </el-button>
  15. <el-button
  16. size="small"
  17. icon="el-icon-printer"
  18. :disabled="selecting_schs.length == 0"
  19. @click="batchPrintAction"
  20. type="primary"
  21. >医嘱打印
  22. </el-button>
  23. </div>
  24. </div>
  25. <div class="app-container">
  26. <div class="filter-container">
  27. <el-autocomplete
  28. class="checkSearch"
  29. popper-class="my-autocomplete"
  30. v-model.trim="listQuery.keyword"
  31. :fetch-suggestions="querySearchAsync"
  32. :trigger-on-focus="false"
  33. placeholder="患者姓名"
  34. @select="handleSelect"
  35. >
  36. <i class="el-icon-search el-input__icon" slot="suffix"></i>
  37. <template slot-scope="{ item }">
  38. <div class="name">{{ item.name }}</div>
  39. </template>
  40. </el-autocomplete>
  41. <el-button type="primary" @click="toSeach">搜索</el-button>
  42. </div>
  43. <div class="cell clearfix">
  44. <label class="title">
  45. <span class="name">日期查询:</span>
  46. </label>
  47. <el-date-picker
  48. v-model="time"
  49. prefix-icon="el-icon-date"
  50. @change="changeTime"
  51. :editable="false"
  52. style="width: 250px;"
  53. type="date"
  54. placeholder="选择日期时间"
  55. align="right"
  56. format="yyyy-MM-dd"
  57. value-format="timestamp"
  58. ></el-date-picker>
  59. <!-- <el-button type="primary" :disabled="selecting_schs.length == 0" @click="batchPrintAction">打印</el-button> -->
  60. </div>
  61. <div class="cell clearfix">
  62. <label class="title"> <span class="name">排班班次</span> : </label>
  63. <div class="time">
  64. <ul class>
  65. <li
  66. :class="item.value == schedulType ? 'active' : ''"
  67. @click="selectSchedulType(item.value)"
  68. v-for="item in schedulArr"
  69. :key="item.value"
  70. >
  71. {{ item.label }}
  72. </li>
  73. </ul>
  74. </div>
  75. </div>
  76. <div class="cell clearfix">
  77. <label class="title"> <span class="name">分区</span> : </label>
  78. <div class="time">
  79. <ul class>
  80. <li
  81. :class="item.id == partitionType ? 'active' : ''"
  82. @click="selectPartitionType(item.id)"
  83. v-for="item in partitionArr"
  84. :key="item.id"
  85. >
  86. {{ item.name }}
  87. </li>
  88. </ul>
  89. </div>
  90. </div>
  91. <div class="cell clearfix">
  92. <label class="title"> <span class="name">给药途径</span> : </label>
  93. <div class="time">
  94. <ul class>
  95. <li
  96. :class="item.id == delivery_way ? 'active' : ''"
  97. @click="selectDeliveryWay(item.id)"
  98. v-for="item in deliveryWay"
  99. :key="item.id"
  100. >
  101. {{ item.name }}
  102. </li>
  103. </ul>
  104. </div>
  105. </div>
  106. <div class="cell clearfix">
  107. <label class="title"> <span class="name">执行状态</span> : </label>
  108. <div class="time">
  109. <ul class>
  110. <li
  111. :class="item.id == excution_way ? 'active' : ''"
  112. @click="selectExcutionWay(item.id)"
  113. v-for="item in executionList"
  114. :key="item.id"
  115. >
  116. {{ item.name }}
  117. </li>
  118. </ul>
  119. </div>
  120. </div>
  121. <el-table :data="scheduleMap" border :row-style="{ color: '#303133' }" :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}"
  122. @selection-change="handleSelectionChange"
  123. :row-class-name="tableRowClassName"
  124. :span-method="objectSpanMethod"
  125. :cell-class-name="adviceNameShow"
  126. :modal-append-to-body="false"
  127. v-show="show">
  128. <el-table-column type="selection" width="55" align="center"></el-table-column>
  129. <el-table-column prop="date" label="姓名" align="center" min-width="26px">
  130. <template slot-scope="scope">
  131. <span>{{ scope.row.name }}</span>
  132. <br>
  133. ({{ scope.row.parent_id == 0 ? scope.row.dialysis_no : ""}})
  134. <br>
  135. <span v-if="scope.row.mode_id == 1">(HD)</span>
  136. <span v-if="scope.row.mode_id == 2">(HDF)</span>
  137. <span v-if="scope.row.mode_id == 3">(HD+HP)</span>
  138. <span v-if="scope.row.mode_id == 4">(HP)</span>
  139. <span v-if="scope.row.mode_id == 5">(HF)</span>
  140. <span v-if="scope.row.mode_id == 6">(SCUF)</span>
  141. <span v-if="scope.row.mode_id == 7">(IUF)</span>
  142. <span v-if="scope.row.mode_id == 8">(HFHD)</span>
  143. <span v-if="scope.row.mode_id == 9">(HFHD+HP)</span>
  144. <span v-if="scope.row.mode_id == 10">(PHF)</span>
  145. <span v-if="scope.row.mode_id == 11">(HFR)</span>
  146. <span v-if="scope.row.mode_id == 12">(HDF+HP)</span>
  147. <span v-if="scope.row.mode_id == 13">(CRRT)</span>
  148. <span v-if="scope.row.mode_id == 14">(腹水回输)</span>
  149. <span v-if="scope.row.mode_id == 24">I-HDF</span>
  150. </template>
  151. </el-table-column>
  152. <el-table-column label="分区床位" width="100">
  153. <template slot-scope="scope" >
  154. {{scope.row.zone_name}}/{{scope.row.number}}
  155. </template>
  156. </el-table-column>
  157. <el-table-column prop="date" label="透析器" align="center" min-width="26px">
  158. <template slot-scope="scope">
  159. <span>{{ scope.row.dialyzer_perfusion_apparatus }}</span>
  160. <span v-if="scope.row.dialysis_dialyszers!=''">{{scope.row.dialysis_dialyszers}}</span>
  161. <span v-if="scope.row.dialysis_irrigation!=''">{{scope.row.dialysis_irrigation}}</span>
  162. </template>
  163. </el-table-column>
  164. <el-table-column prop="start_time" label="开始时间" align="center" min-width="35px">
  165. <template slot-scope="scope">
  166. <span>
  167. {{scope.row.start_time | parseTime('{m}-{d} {h}:{i}')}}
  168. </span>
  169. </template>
  170. </el-table-column>
  171. <el-table-column prop="advice_name" min-width="50px" label="医嘱内容" align="center">
  172. <template slot-scope="scope">
  173. <el-dropdown trigger="click" v-if="scope.row.parent_id == 0">
  174. <span class="el-dropdown-link" v-if="scope.row.parent_id == 0">
  175. {{ getAdviceContent(scope.row, 1)}}
  176. </span>
  177. </el-dropdown>
  178. <el-dropdown trigger="click" v-if="scope.row.parent_id > 0">
  179. <span class="el-dropdown-link">
  180. &emsp;{{ getAdviceContent(scope.row, 2)}}
  181. </span>
  182. </el-dropdown>
  183. </template>
  184. </el-table-column>
  185. <el-table-column
  186. prop="start_time"
  187. align="center"
  188. min-width="30px"
  189. label="执行时间"
  190. sortable
  191. >
  192. <template slot-scope="scope">
  193. <span v-if="scope.row.execution_time != 0">
  194. {{scope.row.execution_time | parseTime('{m}-{d} {h}:{i}')}}
  195. </span>
  196. <span v-else></span>
  197. </template>
  198. </el-table-column>
  199. <el-table-column prop="execution_staff" align="center" min-width="30px" label="执行护士">
  200. <template slot-scope="scope">
  201. <span v-if="scope.row.parent_id == 0">
  202. {{getXuserName(scope.row.execution_staff)}}
  203. </span>
  204. <span v-else></span>
  205. </template>
  206. </el-table-column>
  207. <el-table-column prop="checker" align="center" min-width="30px" label="校对护士">
  208. <template slot-scope="scope">
  209. <span v-if="scope.row.parent_id == 0">
  210. {{getXuserName(scope.row.checker)}}
  211. </span>
  212. <span v-else></span>
  213. </template>
  214. </el-table-column>
  215. <el-table-column
  216. prop="check_time"
  217. align="center"
  218. min-width="30px"
  219. label="校对时间"
  220. sortable
  221. >
  222. <template slot-scope="scope">
  223. <span v-if="scope.row.check_time != 0">
  224. {{scope.row.check_time | parseTime('{m}-{d} {h}:{i}')}}
  225. </span>
  226. <span v-else></span>
  227. </template>
  228. </el-table-column>
  229. <el-table-column prop="date" label="开嘱医生" align="center" min-width="26px">
  230. <template slot-scope="scope">
  231. <span>{{ getXuserName(scope.row.advice_doctor) }}</span>
  232. </template>
  233. </el-table-column>
  234. <el-table-column
  235. prop="created_time"
  236. align="center"
  237. min-width="30px"
  238. label="校对时间"
  239. sortable
  240. >
  241. <template slot-scope="scope">
  242. <span v-if="scope.row.created_time != 0">
  243. {{scope.row.created_time | parseTime('{m}-{d} {h}:{i}')}}
  244. </span>
  245. <span v-else></span>
  246. </template>
  247. </el-table-column>
  248. </el-table>
  249. <el-table :data="scheduleMap" border :row-style="{ color: '#303133' }" :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}"
  250. @selection-change="handleSelectionChange"
  251. :row-class-name="tableRowClassName"
  252. :span-method="objectSpanMethod"
  253. :cell-class-name="adviceNameShow"
  254. :modal-append-to-body="false"
  255. v-show="showOne">
  256. <el-table-column type="selection" width="55" align="center"></el-table-column>
  257. <el-table-column prop="date" label="姓名" align="center" min-width="26px">
  258. <template slot-scope="scope">
  259. <span>{{ scope.row.name }}</span>
  260. <br>
  261. ({{ scope.row.parent_id == 0 ? scope.row.dialysis_no : ""}})
  262. <br>
  263. <span v-if="scope.row.mode_id == 1">(HD)</span>
  264. <span v-if="scope.row.mode_id == 2">(HDF)</span>
  265. <span v-if="scope.row.mode_id == 3">(HD+HP)</span>
  266. <span v-if="scope.row.mode_id == 4">(HP)</span>
  267. <span v-if="scope.row.mode_id == 5">(HF)</span>
  268. <span v-if="scope.row.mode_id == 6">(SCUF)</span>
  269. <span v-if="scope.row.mode_id == 7">(IUF)</span>
  270. <span v-if="scope.row.mode_id == 8">(HFHD)</span>
  271. <span v-if="scope.row.mode_id == 9">(HFHD+HP)</span>
  272. <span v-if="scope.row.mode_id == 10">(PHF)</span>
  273. <span v-if="scope.row.mode_id == 11">(HFR)</span>
  274. <span v-if="scope.row.mode_id == 12">(HDF+HP)</span>
  275. <span v-if="scope.row.mode_id == 13">(CRRT)</span>
  276. <span v-if="scope.row.mode_id == 14">(腹水回输)</span>
  277. <span v-if="scope.row.mode_id == 24">I-HDF</span>
  278. </template>
  279. </el-table-column>
  280. <el-table-column prop="date" label="透析器" align="center" min-width="26px">
  281. <template slot-scope="scope">
  282. <span>
  283. {{ scope.row.dialyzer_perfusion_apparatus }}
  284. <span v-if="scope.row.dialysis_dialyszers!=''">{{scope.row.dialysis_dialyszers}}</span>
  285. <span v-if="scope.row.dialysis_irrigation!=''">{{scope.row.dialysis_irrigation}}</span>
  286. </span>
  287. </template>
  288. </el-table-column>
  289. <el-table-column prop="start_time" label="开始时间" align="center" min-width="35px">
  290. <template slot-scope="scope">
  291. <span>
  292. {{scope.row.start_time | parseTime('{m}-{d} {h}:{i}')}}
  293. </span>
  294. </template>
  295. </el-table-column>
  296. <el-table-column prop="advice_name" min-width="50px" label="医嘱内容" align="center">
  297. <template slot-scope="scope">
  298. <el-dropdown trigger="click" v-if="scope.row.parent_id == 0">
  299. <span class="el-dropdown-link" v-if="scope.row.parent_id == 0">
  300. {{ getAdviceContent(scope.row, 1)}}
  301. </span>
  302. </el-dropdown>
  303. <el-dropdown trigger="click" v-if="scope.row.parent_id > 0">
  304. <span class="el-dropdown-link">
  305. &emsp;{{ getAdviceContent(scope.row, 2)}}
  306. </span>
  307. </el-dropdown>
  308. </template>
  309. </el-table-column>
  310. <el-table-column
  311. prop="start_time"
  312. align="center"
  313. min-width="30px"
  314. label="执行时间"
  315. sortable
  316. >
  317. <template slot-scope="scope">
  318. <span v-if="scope.row.execution_time != 0">
  319. {{scope.row.start_time | parseTime('{m}-{d} {h}:{i}')}}
  320. </span>
  321. <span v-else></span>
  322. </template>
  323. </el-table-column>
  324. <el-table-column prop="execution_staff" align="center" min-width="30px" label="执行护士">
  325. <template slot-scope="scope">
  326. <span v-if="scope.row.parent_id == 0">
  327. {{getXuserName(scope.row.execution_staff)}}
  328. </span>
  329. <span v-else></span>
  330. </template>
  331. </el-table-column>
  332. <el-table-column prop="checker" align="center" min-width="30px" label="校对护士">
  333. <template slot-scope="scope">
  334. <span v-if="scope.row.parent_id == 0">
  335. {{getXuserName(scope.row.checker)}}
  336. </span>
  337. <span v-else></span>
  338. </template>
  339. </el-table-column>
  340. <el-table-column
  341. prop="check_time"
  342. align="center"
  343. min-width="30px"
  344. label="校对时间"
  345. sortable
  346. >
  347. <template slot-scope="scope">
  348. <span v-if="scope.row.check_time != 0">
  349. {{scope.row.check_time | parseTime('{m}-{d} {h}:{i}')}}
  350. </span>
  351. <span v-else></span>
  352. </template>
  353. </el-table-column>
  354. <el-table-column prop="date" label="开嘱医生" align="center" min-width="26px">
  355. <template slot-scope="scope">
  356. <span>{{ getXuserName(scope.row.advice_doctor) }}</span>
  357. </template>
  358. </el-table-column>
  359. <el-table-column
  360. prop="created_time"
  361. align="center"
  362. min-width="30px"
  363. label="校对时间"
  364. sortable
  365. >
  366. <template slot-scope="scope">
  367. <span v-if="scope.row.created_time != 0">
  368. {{scope.row.created_time | parseTime('{m}-{d} {h}:{i}')}}
  369. </span>
  370. <span v-else></span>
  371. </template>
  372. </el-table-column>
  373. </el-table>
  374. </div>
  375. </div>
  376. </template>
  377. <script>
  378. const moment = require('moment')
  379. import { getSchedualPatient, GetAllZone } from "@/api/dialysis";
  380. import { parseTime } from "@/utils";
  381. import BreadCrumb from "@/xt_pages/components/bread-crumb";
  382. import { getPrintTemplate } from "@/api/data";
  383. import { getSchedualDoctors } from '@/api/advice'
  384. import { PostSearch } from '@/api/patient'
  385. export default {
  386. name: "Patient",
  387. data() {
  388. return {
  389. crumbs: [
  390. { path: false, name: "透析管理" },
  391. { path: false, name: "透析监测" }
  392. ],
  393. loading: false,
  394. time: "",
  395. search_mode: 1, // 搜索模式 1.日期搜索 2.病人搜索
  396. patient_search_keyword: "",
  397. SchedualPatientsTableData: [],
  398. active: true,
  399. schedulType: 0,
  400. schedulArr: [
  401. { value: 0, label: "全部" },
  402. { value: 1, label: "上午" },
  403. { value: 2, label: "下午" },
  404. { value: 3, label: "晚上" }
  405. ],
  406. template_id: 0,
  407. partitionType: 0,
  408. total: 0,
  409. listQuery: {
  410. page: 1,
  411. limit: 10,
  412. schedul_type: 0,
  413. partition_type: 0,
  414. schedul_time: "",
  415. keywords: "",
  416. },
  417. selecting_schs: [],
  418. partitionArr: [],
  419. scheduleMap:[],
  420. show:true,
  421. showOne:false,
  422. deliveryWay:[],
  423. executionList:[
  424. {id:0,name:"全部"},
  425. {id:1,name:"已执行"},
  426. {id:2,name:"未执行"},
  427. ],
  428. delivery_way:0,
  429. patient_id:0,
  430. org_id:0,
  431. excution_way:0,
  432. };
  433. },
  434. created() {
  435. var date = new Date();
  436. this.time = date;
  437. var year = date.getFullYear();
  438. var month = date.getMonth() + 1;
  439. var day = date.getDate();
  440. if (month < 10) {
  441. month = "0" + month;
  442. }
  443. if (day < 10) {
  444. day = "0" + day;
  445. }
  446. var nowDate = year + "-" + month + "-" + day;
  447. var date = new Date(nowDate + " 00:00:00");
  448. this.listQuery.schedul_time = date.getTime();
  449. this.getAllZone();
  450. this.getTemplateInfo();
  451. this.requestSchedualDoctors(this.time)
  452. this.org_id = this.$store.getters.xt_user.template_info.org_id;
  453. },
  454. methods: {
  455. getTemplateInfo() {
  456. getPrintTemplate().then(response => {
  457. if (response.data.state == 0) {
  458. this.$message.error(response.data.msg);
  459. return false;
  460. } else {
  461. var template = response.data.data.template;
  462. this.template_id = template.template_id;
  463. }
  464. });
  465. },
  466. clickCurrent(val) {
  467. console.log(val);
  468. this.$router.push({
  469. path: "/dialysis/details",
  470. query: { patient_id: val.patient_id, date: val.sch_time_int,mode_id:val.mode_id }
  471. });
  472. },
  473. handleSelectionChange(val) {
  474. this.selecting_schs = val;
  475. },
  476. selectSchedulType(scheduleType) {
  477. this.schedulType = scheduleType;
  478. this.listQuery.schedul_type = scheduleType;
  479. this.requestSchedualDoctors(this.time);
  480. },
  481. selectPartitionType(partitionType) {
  482. this.partitionType = partitionType;
  483. this.listQuery.partition_type = partitionType;
  484. this.requestSchedualDoctors(this.time);
  485. },
  486. selectDeliveryWay(val){
  487. this.delivery_way = val
  488. this.requestSchedualDoctors(this.time)
  489. },
  490. selectExcutionWay(val){
  491. this.excution_way = val
  492. this.requestSchedualDoctors(this.time)
  493. },
  494. changeTime() {
  495. this.listQuery.schedul_time = this.time;
  496. this.requestSchedualDoctors(this.time)
  497. },
  498. getAllZone: function() {
  499. GetAllZone().then(response => {
  500. if (response.data.state == 0) {
  501. this.$message.error(response.data.msg);
  502. return false;
  503. } else {
  504. this.partitionArr = response.data.data.zone;
  505. this.partitionArr.unshift({ id: 0, name: "全部" });
  506. var dics = response.data.data.dics
  507. var obj = {id:0,name:"全部"}
  508. this.deliveryWay.push(obj)
  509. this.deliveryWay.push(...dics)
  510. }
  511. });
  512. },
  513. requestSchedualDoctors (time) {
  514. var name = ""
  515. for(let i=0;i<this.deliveryWay.length;i++){
  516. if(this.delivery_way == this.deliveryWay[i].id){
  517. name = this.deliveryWay[i].name
  518. }
  519. }
  520. if(name == '全部'){
  521. name = ""
  522. }
  523. let newTime = moment(time).format('YYYY-MM-DD')
  524. var schedule_type = this.listQuery.schedul_type
  525. var partition_type = this.listQuery.partition_type
  526. getSchedualDoctors({date: newTime,patient_type: 0,advice_type: 2,delivery_way:name,schedule_type:schedule_type,partition_type:partition_type,patient_id:this.patient_id,excution_way:this.excution_way}).then(rs => {
  527. var resp = rs.data
  528. if (resp.state == 1) {
  529. this.admin_users = resp.data.adminUser
  530. var config = resp.data.config
  531. let project_config = resp.data.project_config
  532. if(project_config.is_open == 1){
  533. this.project = resp.data.project
  534. console.log("wode 2o2o3o3o23o32o32o23o32o32o", this.project)
  535. let projectArr = []
  536. if(this.org_id!= 10318 && this.org_id!=10265){
  537. this.project.map(item => {
  538. resp.data.hisAdvices.map(it => {
  539. if(item.patient_id == it.patient_id){
  540. projectArr.push(item)
  541. }
  542. })
  543. })
  544. console.log("projectArr2332323232323232",projectArr)
  545. resp.data.hisAdvices.map((item,index) => {
  546. if(projectArr[index].project && projectArr[index].project.length > 0){
  547. projectArr[index].project.map(it => {
  548. let obj = {
  549. advice_doctor: it.doctor,
  550. start_time:it.start_time,
  551. advice_name:it.team_id > 0 && it.is_check_team == 1 ? it.team.project_team : it.type == 2 ? it.project.project_name+' '+it.count + it.project.unit : it.good_info.good_name +' '+it.count+ it.good_info.packing_unit,
  552. execution_time:it.execution_time,
  553. execution_state:it.execution_state,
  554. execution_staff:it.execution_staff,
  555. check_time:it.check_time,
  556. check_state:it.check_state,
  557. checker:it.checker,
  558. created_time:it.ctime,
  559. delivery_way:'',
  560. execution_frequency:'',
  561. remark:'',
  562. id:it.id,
  563. patient_id:it.patient_id,
  564. parent_id:0,
  565. groupno:0
  566. }
  567. item.doctor_advice.push(obj)
  568. })
  569. }
  570. })
  571. console.log("hh3oo1o3o123o3oo312o132o312o31o132o",resp.data.hisAdvices)
  572. }
  573. }
  574. if(config.is_open == 0 || config.is_open == 2){
  575. var schedules = resp.data.scheduals
  576. this.show = true
  577. this.showOne = false
  578. let arr = []
  579. let newArr = []
  580. let newSchedules = []
  581. schedules.map(item => {
  582. item.doctor_advice.map(it =>{
  583. it.name = item.patient.name
  584. if(item.prescription != null){
  585. it.dialyzer_perfusion_apparatus = item.prescription.dialyzer_perfusion_apparatus
  586. it.dialysis_dialyszers = item.prescription.dialysis_dialyszers
  587. it.dialysis_irrigation = item.prescription.dialysis_irrigation
  588. }
  589. it.schedule_type = item.schedule_type
  590. it.zoneId = item.device_number.zone.id
  591. it.dialysis_no = item.patient.dialysis_no
  592. it.mode_id = item.mode_id
  593. it.number = item.device_number.number
  594. it.zone_name = item.device_number.zone.name
  595. arr.push(it)
  596. })
  597. })
  598. if(this.schedulType == 0){
  599. newSchedules = arr
  600. }else{
  601. arr.map(item => {
  602. if (item.schedule_type == this.schedulType) {
  603. newSchedules.push(item)
  604. }
  605. })
  606. }
  607. if(this.partitionType == 0){
  608. this.scheduleMap = newSchedules
  609. }else {
  610. let a = []
  611. arr.map(item => {
  612. if(this.partitionType == item.zoneId){
  613. a.push(item)
  614. }
  615. })
  616. this.scheduleMap = a
  617. }
  618. this.scheduleMap.map(ele => {
  619. let firstIndex = this.scheduleMap.findIndex(item => {
  620. return item.patient_id === ele.patient_id // 当category相同的时候,返回第一个相同的Index 赋值给 firstIndex
  621. })
  622. if (this.scheduleMap.findIndex(item => { return item.patient_id === firstIndex}) === -1) {
  623. newArr.push({
  624. length: this.scheduleMap.filter(item => {
  625. return item.patient_id === ele.patient_id //利用数组的filter方法,过滤出相同category的数组的长度。数组长度-即为跨多少行
  626. }).length,
  627. firstIndex: firstIndex // firstIndex 返回的是第一个catergory就满足的第一个Index,即为rowIndex开始于第几行。
  628. })
  629. }
  630. })
  631. this.indexInfoList = newArr
  632. }
  633. if(config.is_open == 1){
  634. this.show = false
  635. this.showOne = true
  636. var schedules = resp.data.hisAdvices
  637. let arr = []
  638. let newArr = []
  639. let newSchedules = []
  640. schedules.map(item => {
  641. item.doctor_advice.map(it =>{
  642. it.name = item.patient.name
  643. if(item.prescription != null){
  644. it.dialyzer_perfusion_apparatus = item.prescription.dialyzer_perfusion_apparatus
  645. it.dialysis_dialyszers = item.prescription.dialysis_dialyszers
  646. it.dialysis_irrigation = item.prescription.dialysis_irrigation
  647. }
  648. it.schedule_type = item.schedule_type
  649. it.zoneId = item.device_number.zone.id
  650. it.dialysis_no = item.patient.dialysis_no
  651. it.mode_id = item.mode_id
  652. it.number = item.device_number.number
  653. it.zone_name = item.device_number.zone.name
  654. arr.push(it)
  655. })
  656. })
  657. if(this.schedulType == 0){
  658. newSchedules = arr
  659. }else{
  660. arr.map(item => {
  661. if (item.schedule_type == this.schedulType) {
  662. newSchedules.push(item)
  663. }
  664. })
  665. }
  666. if(this.partitionType == 0){
  667. this.scheduleMap = newSchedules
  668. }else {
  669. let a = []
  670. arr.map(item => {
  671. if(this.partitionType == item.zoneId){
  672. a.push(item)
  673. }
  674. })
  675. this.scheduleMap = a
  676. }
  677. this.scheduleMap.map(ele => {
  678. let firstIndex = this.scheduleMap.findIndex(item => {
  679. return item.patient_id === ele.patient_id // 当category相同的时候,返回第一个相同的Index 赋值给 firstIndex
  680. })
  681. if (this.scheduleMap.findIndex(item => { return item.patient_id === firstIndex}) === -1) {
  682. newArr.push({
  683. length: this.scheduleMap.filter(item => {
  684. return item.patient_id === ele.patient_id //利用数组的filter方法,过滤出相同category的数组的长度。数组长度-即为跨多少行
  685. }).length,
  686. firstIndex: firstIndex // firstIndex 返回的是第一个catergory就满足的第一个Index,即为rowIndex开始于第几行。
  687. })
  688. }
  689. })
  690. this.indexInfoList = newArr
  691. }
  692. }
  693. })
  694. },
  695. getValue: function(val) {
  696. if (val != undefined) {
  697. return val.value;
  698. } else {
  699. return "";
  700. }
  701. },
  702. handleCurrentChange(val) {
  703. this.listQuery.page = val;
  704. this.getSchedualPatientList();
  705. },
  706. changeSearchMode: function() {
  707. if (this.search_mode == 1) {
  708. this.search_mode = 2;
  709. } else {
  710. this.search_mode = 1;
  711. }
  712. },
  713. searchPatientAction: function() {
  714. this.listQuery.keywords = this.patient_search_keyword;
  715. console.log(this.patient_search_keyword);
  716. if (this.patient_search_keyword.length == 0) {
  717. return;
  718. }
  719. this.getSchedualPatientList();
  720. },
  721. handleSizeChange(val) {
  722. this.listQuery.limit = val;
  723. this.getSchedualPatientList();
  724. },
  725. batchPrintAction: function() {
  726. if (this.selecting_schs.length === 0) {
  727. this.$message.error("请至少选择一条需要打印的内容");
  728. return false;
  729. }
  730. // 模板ID为6
  731. var sch_ids = [];
  732. for (let index = 0; index < this.selecting_schs.length; index++) {
  733. sch_ids.push(this.selecting_schs[index].patient_id);
  734. }
  735. this.$store.dispatch("SetAdviceIDs", sch_ids);
  736. var name = ""
  737. for(let i=0;i<this.deliveryWay.length;i++){
  738. if(this.delivery_way == this.deliveryWay[i].id){
  739. name = this.deliveryWay[i].name
  740. }
  741. }
  742. if(name == '全部'){
  743. name = ""
  744. }
  745. this.$router.push({ path: "/dialysis/doctorAdvicePrint",query:{time: new Date(this.time).getTime(),delivery_way:name} });
  746. },
  747. signPrintAction:function(){
  748. if (this.selecting_schs.length === 0) {
  749. this.$message.error("请至少选择一条需要打印的内容");
  750. return false;
  751. }
  752. // 模板ID为6
  753. var sch_ids = [];
  754. for (let index = 0; index < this.selecting_schs.length; index++) {
  755. sch_ids.push(this.selecting_schs[index].patient_id);
  756. }
  757. this.$store.dispatch("SetAdviceIDs", sch_ids);
  758. var name = ""
  759. for(let i=0;i<this.deliveryWay.length;i++){
  760. if(this.delivery_way == this.deliveryWay[i].id){
  761. name = this.deliveryWay[i].name
  762. }
  763. }
  764. if(name == '全部'){
  765. name = ""
  766. }
  767. this.$router.push({ path: "/dialysis/signPrint",query:{time: new Date(this.time).getTime(),delivery_way:name} });
  768. },
  769. batchPrintActionOne: function() {
  770. if (this.selecting_schs.length === 0) {
  771. this.$message.error("请至少选择一条需要打印的内容");
  772. return false;
  773. }
  774. var sch_ids = [];
  775. for (let index = 0; index < this.selecting_schs.length; index++) {
  776. sch_ids.push(this.selecting_schs[index].sch_id);
  777. }
  778. this.$store.dispatch("SetBatchPrintDialysisRecordIDs", sch_ids);
  779. if (this.template_id == 2 || this.template_id == 0) {
  780. this.$router.push({ path: "/dialysis/print/batch/otherone" });
  781. } else if (this.template_id == 1) {
  782. this.$router.push({ path: "/dialysis/print/batch" });
  783. } else if (this.template_id == 5) {
  784. this.$router.push({ path: "/dialysis/print/batch/fiveone" });
  785. } else if (this.template_id == 22) {
  786. this.$router.push({ path: "/dialysis/print/batch/twentyTwo_one" });
  787. }
  788. },
  789. batchPrintActionTwo: function() {
  790. if (this.selecting_schs.length === 0) {
  791. this.$message.error("请至少选择一条需要打印的内容");
  792. return false;
  793. }
  794. var sch_ids = [];
  795. for (let index = 0; index < this.selecting_schs.length; index++) {
  796. sch_ids.push(this.selecting_schs[index].sch_id);
  797. }
  798. this.$store.dispatch("SetBatchPrintDialysisRecordIDs", sch_ids);
  799. if (this.template_id == 2 || this.template_id == 0) {
  800. this.$router.push({ path: "/dialysis/print/batch/othertwo" });
  801. } else if (this.template_id == 1) {
  802. this.$router.push({ path: "/dialysis/print/batch" });
  803. } else if (this.template_id == 5) {
  804. this.$router.push({ path: "/dialysis/print/batch/fivetwo" });
  805. } else if (this.template_id == 22) {
  806. this.$router.push({ path: "/dialysis/print/batch/twentyTwo_two" });
  807. }
  808. },
  809. compare (property) {
  810. return function (a, b) {
  811. var value1 = a[property]
  812. var value2 = b[property]
  813. return value1 - value2
  814. }
  815. },
  816. tableRowClassName({ row, rowIndex }) {
  817. // if (row.stop_state == 1 || row.execution_state == 1) {
  818. // return 'stoped-row';
  819. // }
  820. // return 'success-rows'
  821. // row.index = rowIndex
  822. // const arr = this.hoverOrderArr
  823. // for (let i = 0; i < arr.length; i++) {
  824. // if (rowIndex == arr[i]) {
  825. // return 'success-row'
  826. // }
  827. // }
  828. },
  829. objectSpanMethod({ row, column, rowIndex, columnIndex }) {
  830. if (columnIndex === 0) {
  831. let index = this.indexInfoList.findIndex(item => { //遍历数组
  832. return item.firstIndex === rowIndex
  833. })
  834. if (index > -1) {
  835. return {
  836. rowspan: this.indexInfoList[index].length,
  837. colspan: 1
  838. }
  839. } else {
  840. return {
  841. rowspan: 0,
  842. colspan: 0
  843. }
  844. }
  845. }
  846. if (columnIndex === 1) {
  847. let index = this.indexInfoList.findIndex(item => { //遍历数组
  848. return item.firstIndex === rowIndex
  849. })
  850. if (index > -1) {
  851. return {
  852. rowspan: this.indexInfoList[index].length,
  853. colspan: 1
  854. }
  855. } else {
  856. return {
  857. rowspan: 0,
  858. colspan: 0
  859. }
  860. }
  861. }
  862. if (columnIndex === 2) {
  863. let index = this.indexInfoList.findIndex(item => { //遍历数组
  864. return item.firstIndex === rowIndex
  865. })
  866. if (index > -1) {
  867. return {
  868. rowspan: this.indexInfoList[index].length,
  869. colspan: 1
  870. }
  871. } else {
  872. return {
  873. rowspan: 0,
  874. colspan: 0
  875. }
  876. }
  877. }
  878. },
  879. adviceNameShow({ row, column, rowIndex, columnIndex }) {
  880. if (columnIndex == 2) {
  881. return 'dialysisadvicenamedisplay'
  882. } else {
  883. return ''
  884. }
  885. },
  886. getXuserName(id) {
  887. if (id <= 0) {
  888. return ''
  889. }
  890. var name = ''
  891. if (
  892. this.admin_users == null ||
  893. typeof this.admin_users.length === 'undefined'
  894. ) {
  895. return name
  896. }
  897. var leng = this.admin_users.length
  898. if (leng == 0) {
  899. return name
  900. }
  901. for (let index = 0; index < leng; index++) {
  902. if (this.admin_users[index].id == id) {
  903. name = this.admin_users[index].name
  904. break
  905. }
  906. }
  907. return name
  908. },
  909. getAdviceContent(row, isChild) {
  910. let tempSingleDoseDesc = ''
  911. let tempDrugSpecDesc = ''
  912. let tempPrescribingNumberDesc = ''
  913. if (row.prescribing_number) {
  914. tempPrescribingNumberDesc =
  915. row.prescribing_number + '' + row.prescribing_number_unit
  916. }
  917. if (row.single_dose) {
  918. if (this.template_id != 6) {
  919. tempSingleDoseDesc =
  920. ' 单次用量 ' + ' ' + row.single_dose + '' + row.single_dose_unit
  921. } else {
  922. tempSingleDoseDesc = row.single_dose ? row.single_dose : '' + '' + row.single_dose_unit ? row.single_dose_unit : ''
  923. }
  924. }
  925. if (row.advice_desc) {
  926. tempDrugSpecDesc = '(' + row.advice_desc + row.drug_spec_unit + ')'
  927. }
  928. if (isChild == 1) {
  929. // 不是子药
  930. // console.log(tempDrugSpecDesc)
  931. // console.log(tempPrescribingNumberDesc)
  932. // console.log(tempSingleDoseDesc)
  933. // console.log(11,row.delivery_way)
  934. // console.log(22,row.execution_frequency)
  935. return (
  936. row.advice_name +
  937. tempDrugSpecDesc +
  938. ' ' +
  939. tempPrescribingNumberDesc +
  940. tempSingleDoseDesc +
  941. ' ' +
  942. row.delivery_way +
  943. ' ' +
  944. row.execution_frequency
  945. )
  946. } else {
  947. // 是子药
  948. return (
  949. row.advice_name +
  950. tempDrugSpecDesc +
  951. ' ' +
  952. tempPrescribingNumberDesc +
  953. tempSingleDoseDesc
  954. )
  955. }
  956. },
  957. querySearchAsync(keyword, cb) {
  958. let key = '';
  959. if (keyword != undefined) {
  960. key = keyword
  961. }
  962. let searchArray = []
  963. PostSearch(key).then(response => {
  964. if (response.data.state == 1) {
  965. searchArray = response.data.data.patient
  966. console.log('searcharrya', searchArray)
  967. cb(searchArray)
  968. }
  969. })
  970. return searchArray
  971. },
  972. handleSelect(val) {
  973. this.patient_id = val.id
  974. this.requestSchedualDoctors(this.time)
  975. },
  976. toSeach(){
  977. this.patient_id = 0
  978. this.requestSchedualDoctors(this.time)
  979. }
  980. },
  981. components: {
  982. BreadCrumb
  983. }
  984. };
  985. </script>
  986. <style rel="stylesheet/scss" lang="scss" scoped>
  987. .app-container {
  988. // margin: 20px;
  989. font-size: 15px;
  990. .filter-container {
  991. padding-bottom: 5px;
  992. }
  993. .cqd-dataTitle {
  994. color: #303133;
  995. font-size: 14px;
  996. border-bottom: 2px #e4e7ed solid;
  997. height: 36px;
  998. line-height: 36px;
  999. margin: 0 0 25px 0;
  1000. position: relative;
  1001. }
  1002. .cqd-dataTitle::before {
  1003. position: absolute;
  1004. left: 0;
  1005. bottom: -2px;
  1006. content: "";
  1007. width: 42px;
  1008. height: 2px;
  1009. background: #409eff;
  1010. }
  1011. .search-component {
  1012. width: 500px;
  1013. .searchBox {
  1014. width: 300px;
  1015. height: 36px;
  1016. line-height: 36px;
  1017. padding-left: 15px;
  1018. border: 1px #dcdfe6 solid;
  1019. border-right: none;
  1020. outline: none;
  1021. float: left;
  1022. border-radius: 6px 0 0 6px;
  1023. font-size: 14px;
  1024. color: #333;
  1025. background: #fff;
  1026. box-shadow: 3px 3px 4px rgba(135, 135, 135, 0.05);
  1027. }
  1028. .searchBtn {
  1029. background-color: #409eff;
  1030. color: #fff;
  1031. font-size: 15px;
  1032. text-align: center;
  1033. height: 36px;
  1034. line-height: 36px;
  1035. float: left;
  1036. outline: none;
  1037. width: 70px;
  1038. border: none;
  1039. border-radius: 0 6px 6px 0;
  1040. font-family: "Microsoft Yahei";
  1041. cursor: pointer;
  1042. }
  1043. }
  1044. .amount {
  1045. font-weight: normal;
  1046. padding: 10px 0 0 0;
  1047. color: #606266;
  1048. font-size: 14px;
  1049. span {
  1050. color: #ef2525;
  1051. font-family: "Arial";
  1052. padding: 0 2px;
  1053. }
  1054. }
  1055. }
  1056. .el-table td,
  1057. .el-table th.is-leaf,
  1058. .el-table--border,
  1059. .el-table--group {
  1060. border-color: #d0d3da;
  1061. }
  1062. .el-table--border::after,
  1063. .el-table--group::after,
  1064. .el-table::before {
  1065. background-color: #d0d3da;
  1066. }
  1067. .el-checkbox__inner::after {
  1068. height: 10px;
  1069. left: 7px;
  1070. }
  1071. .el-checkbox__inner {
  1072. width: 20px;
  1073. height: 20px;
  1074. }
  1075. </style>