Elizabeth's proactive approach involves introducing urinal toilet attachment , an ingenious concept that optimizes space and functionality.

newDoctorAdvice.vue 63KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864
  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. </div>
  60. <div class="cell clearfix">
  61. <label class="title">
  62. <span class="name">排序:</span>
  63. </label>
  64. <el-select v-model="sort" placeholder="请选择" @change="selectSortType">
  65. <el-option
  66. v-for="item in options"
  67. :key="item.name"
  68. :label="item.name"
  69. :value="item.id"
  70. >
  71. </el-option>
  72. </el-select>
  73. </div>
  74. <div class="cell clearfix">
  75. <label class="title"> <span class="name">排班班次</span> : </label>
  76. <div class="time">
  77. <ul class>
  78. <li
  79. :class="item.value == schedulType ? 'active' : ''"
  80. @click="selectSchedulType(item.value)"
  81. v-for="item in schedulArr"
  82. :key="item.value"
  83. >
  84. {{ item.label }}
  85. </li>
  86. </ul>
  87. </div>
  88. </div>
  89. <div class="cell clearfix">
  90. <label class="title"> <span class="name">收费状态</span> : </label>
  91. <div class="time">
  92. <ul class>
  93. <li
  94. :class="item.id == costType ? 'active' : ''"
  95. @click="selectCostType(item.id)"
  96. v-for="item in costArr"
  97. :key="item.id"
  98. >
  99. {{ item.name }}
  100. </li>
  101. </ul>
  102. </div>
  103. </div>
  104. <div class="cell clearfix">
  105. <label class="title"> <span class="name">分区</span> : </label>
  106. <div class="time">
  107. <ul class>
  108. <li
  109. :class="item.id == partitionType ? 'active' : ''"
  110. @click="selectPartitionType(item.id)"
  111. v-for="item in partitionArr"
  112. :key="item.id"
  113. >
  114. {{ item.name }}
  115. </li>
  116. </ul>
  117. </div>
  118. </div>
  119. <div class="cell clearfix">
  120. <label class="title"> <span class="name">给药途径</span> : </label>
  121. <div class="time">
  122. <ul class>
  123. <li
  124. :class="item.id == delivery_way ? 'active' : ''"
  125. @click="selectDeliveryWay(item.id)"
  126. v-for="item in deliveryWay"
  127. :key="item.id"
  128. >
  129. {{ item.name }}
  130. </li>
  131. </ul>
  132. </div>
  133. </div>
  134. <div class="cell clearfix">
  135. <label class="title"> <span class="name">执行状态</span> : </label>
  136. <div class="time">
  137. <ul class>
  138. <li
  139. :class="item.id == excution_way ? 'active' : ''"
  140. @click="selectExcutionWay(item.id)"
  141. v-for="item in executionList"
  142. :key="item.id"
  143. >
  144. {{ item.name }}
  145. </li>
  146. </ul>
  147. </div>
  148. </div>
  149. <!-- <div style="margin-top: 10px;margin-left:600px;margin-bottom:10px">
  150. <el-button type="primary" size="small" @click="toExcution">执行医嘱</el-button>
  151. <el-button type="primary" size="small" @click="toCheck">医嘱核对</el-button>
  152. <el-button type="primary" size="small" @click="toSettle">收费</el-button>
  153. </div> -->
  154. <div style="margin-top: 10px;margin-bottom:10px">
  155. <el-button type="primary" size="small" @click="toStatic">统计</el-button>
  156. </div>
  157. <el-table :data="scheduleMap" border :row-style="{ color: '#303133' }" :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}"
  158. @selection-change="handleSelectionChange"
  159. :span-method="objectSpanMethod"
  160. :cell-class-name="adviceNameShow"
  161. :modal-append-to-body="false"
  162. highlight-current-row
  163. @current-change="handleCurrentChangeList"
  164. v-show="show"
  165. @row-click="handleRowClick">
  166. <el-table-column type="selection" width="55" align="center"></el-table-column>
  167. <el-table-column prop="date" label="姓名" align="center" min-width="26px">
  168. <template slot-scope="scope">
  169. <span>{{ scope.row.name }}</span>
  170. <br>
  171. ({{ scope.row.parent_id == 0 ? scope.row.dialysis_no : ""}})
  172. <br>
  173. <span v-if="scope.row.mode_id == 1">(HD)</span>
  174. <span v-if="scope.row.mode_id == 2">(HDF)</span>
  175. <span v-if="scope.row.mode_id == 3">(HD+HP)</span>
  176. <span v-if="scope.row.mode_id == 4">(HP)</span>
  177. <span v-if="scope.row.mode_id == 5">(HF)</span>
  178. <span v-if="scope.row.mode_id == 6">(SCUF)</span>
  179. <span v-if="scope.row.mode_id == 7">(IUF)</span>
  180. <span v-if="scope.row.mode_id == 8">(HFHD)</span>
  181. <span v-if="scope.row.mode_id == 9">(HFHD+HP)</span>
  182. <span v-if="scope.row.mode_id == 10">(PHF)</span>
  183. <span v-if="scope.row.mode_id == 11">(HFR)</span>
  184. <span v-if="scope.row.mode_id == 12">(HDF+HP)</span>
  185. <span v-if="scope.row.mode_id == 13">(CRRT)</span>
  186. <span v-if="scope.row.mode_id == 14">(腹水回输)</span>
  187. <span v-if="scope.row.mode_id == 24">I-HDF</span>
  188. </template>
  189. </el-table-column>
  190. <el-table-column label="分区床位" width="100">
  191. <template slot-scope="scope" >
  192. {{scope.row.zone_name}}/{{scope.row.number}}
  193. </template>
  194. </el-table-column>
  195. <el-table-column prop="date" label="透析器" align="center" min-width="26px">
  196. <template slot-scope="scope">
  197. <span>{{ scope.row.dialyzer_perfusion_apparatus }}</span>
  198. <span v-if="scope.row.dialysis_dialyszers!=''">{{scope.row.dialysis_dialyszers}}</span>
  199. <span v-if="scope.row.dialysis_irrigation!=''">{{scope.row.dialysis_irrigation}}</span>
  200. </template>
  201. </el-table-column>
  202. <el-table-column prop="start_time" label="开始时间" align="center" min-width="35px">
  203. <template slot-scope="scope">
  204. <span>
  205. {{scope.row.start_time | parseTime('{m}-{d} {h}:{i}')}}
  206. </span>
  207. </template>
  208. </el-table-column>
  209. <el-table-column prop="advice_name" min-width="50px" label="医嘱内容" align="center">
  210. <template slot-scope="scope">
  211. <el-dropdown trigger="click" v-if="scope.row.parent_id == 0">
  212. <span class="el-dropdown-link" v-if="scope.row.parent_id == 0">
  213. {{ getAdviceContent(scope.row, 1)}}
  214. </span>
  215. </el-dropdown>
  216. <el-dropdown trigger="click" v-if="scope.row.parent_id > 0">
  217. <span class="el-dropdown-link">
  218. &emsp;{{ getAdviceContent(scope.row, 2)}}
  219. </span>
  220. </el-dropdown>
  221. </template>
  222. </el-table-column>
  223. <el-table-column
  224. prop="start_time"
  225. align="center"
  226. min-width="30px"
  227. label="执行时间"
  228. sortable
  229. >
  230. <template slot-scope="scope">
  231. <span v-if="scope.row.execution_time != 0">
  232. {{scope.row.execution_time | parseTime('{m}-{d} {h}:{i}')}}
  233. </span>
  234. <span v-else></span>
  235. </template>
  236. </el-table-column>
  237. <el-table-column prop="execution_staff" align="center" min-width="30px" label="执行护士">
  238. <template slot-scope="scope">
  239. <span v-if="scope.row.parent_id == 0">
  240. {{getXuserName(scope.row.execution_staff)}}
  241. </span>
  242. <span v-else>{{getXuserName(scope.row.execution_staff)}}</span>
  243. </template>
  244. </el-table-column>
  245. <el-table-column prop="checker" align="center" min-width="30px" label="校对护士">
  246. <template slot-scope="scope">
  247. <span v-if="scope.row.parent_id == 0">
  248. {{getXuserName(scope.row.checker)}}
  249. </span>
  250. <span v-else>{{getXuserName(scope.row.checker)}}</span>
  251. </template>
  252. </el-table-column>
  253. <el-table-column
  254. prop="check_time"
  255. align="center"
  256. min-width="30px"
  257. label="校对时间"
  258. sortable
  259. >
  260. <template slot-scope="scope">
  261. <span v-if="scope.row.check_time != 0">
  262. {{scope.row.check_time | parseTime('{m}-{d} {h}:{i}')}}
  263. </span>
  264. <span v-else>
  265. </span>
  266. </span>
  267. </template>
  268. </el-table-column>
  269. <el-table-column prop="date" label="开嘱医生" align="center" min-width="26px">
  270. <template slot-scope="scope">
  271. <span>{{ getXuserName(scope.row.advice_doctor) }}</span>
  272. </template>
  273. </el-table-column>
  274. <el-table-column
  275. prop="created_time"
  276. align="center"
  277. min-width="30px"
  278. label="校对时间"
  279. sortable
  280. >
  281. <template slot-scope="scope">
  282. <span v-if="scope.row.created_time != 0">
  283. {{scope.row.created_time | parseTime('{m}-{d} {h}:{i}')}}
  284. </span>
  285. <span v-else></span>
  286. </template>
  287. </el-table-column>
  288. <el-table-column
  289. prop="created_time"
  290. align="center"
  291. min-width="30px"
  292. label="收费状态"
  293. sortable
  294. >
  295. <template slot-scope="scope">
  296. <span v-if="scope.row.is_settle == 1">
  297. 已收费
  298. </span>
  299. <span v-if="scope.row.is_settle == 2 || scope.row.is_settle == 0">
  300. 未收费
  301. </span>
  302. <span v-else></span>
  303. </template>
  304. </el-table-column>
  305. </el-table>
  306. <el-table :data="scheduleMap" border :row-style="{ color: '#303133' }" :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}"
  307. @selection-change="handleSelectionChangeOne"
  308. @current-change="handleCurrentChangeList"
  309. :span-method="objectSpanMethod"
  310. :cell-class-name="adviceNameShow"
  311. highlight-current-row
  312. :modal-append-to-body="false"
  313. v-show="showOne">
  314. <el-table-column type="selection" width="55" align="center"></el-table-column>
  315. <el-table-column prop="date" label="姓名" align="center" min-width="26px">
  316. <template slot-scope="scope">
  317. <span>{{ scope.row.name }}</span>
  318. <br>
  319. ({{ scope.row.parent_id == 0 ? scope.row.dialysis_no : ""}})
  320. <br>
  321. <span v-if="scope.row.mode_id == 1">(HD)</span>
  322. <span v-if="scope.row.mode_id == 2">(HDF)</span>
  323. <span v-if="scope.row.mode_id == 3">(HD+HP)</span>
  324. <span v-if="scope.row.mode_id == 4">(HP)</span>
  325. <span v-if="scope.row.mode_id == 5">(HF)</span>
  326. <span v-if="scope.row.mode_id == 6">(SCUF)</span>
  327. <span v-if="scope.row.mode_id == 7">(IUF)</span>
  328. <span v-if="scope.row.mode_id == 8">(HFHD)</span>
  329. <span v-if="scope.row.mode_id == 9">(HFHD+HP)</span>
  330. <span v-if="scope.row.mode_id == 10">(PHF)</span>
  331. <span v-if="scope.row.mode_id == 11">(HFR)</span>
  332. <span v-if="scope.row.mode_id == 12">(HDF+HP)</span>
  333. <span v-if="scope.row.mode_id == 13">(CRRT)</span>
  334. <span v-if="scope.row.mode_id == 14">(腹水回输)</span>
  335. <span v-if="scope.row.mode_id == 24">I-HDF</span>
  336. </template>
  337. </el-table-column>
  338. <el-table-column prop="date" label="透析器" align="center" min-width="26px">
  339. <template slot-scope="scope">
  340. <span>
  341. {{ scope.row.dialyzer_perfusion_apparatus }}
  342. <span v-if="scope.row.dialysis_dialyszers!=''">{{scope.row.dialysis_dialyszers}}</span>
  343. <span v-if="scope.row.dialysis_irrigation!=''">{{scope.row.dialysis_irrigation}}</span>
  344. </span>
  345. </template>
  346. </el-table-column>
  347. <el-table-column prop="start_time" label="开始时间" align="center" min-width="35px">
  348. <template slot-scope="scope">
  349. <span>
  350. {{scope.row.start_time | parseTime('{m}-{d} {h}:{i}')}}
  351. </span>
  352. </template>
  353. </el-table-column>
  354. <el-table-column prop="advice_name" min-width="50px" label="医嘱内容" align="center">
  355. <template slot-scope="scope">
  356. <el-dropdown trigger="click" v-if="scope.row.parent_id == 0">
  357. <span class="el-dropdown-link" v-if="scope.row.parent_id == 0">
  358. {{ getAdviceContent(scope.row, 1)}}
  359. </span>
  360. </el-dropdown>
  361. <el-dropdown trigger="click" v-if="scope.row.parent_id > 0">
  362. <span class="el-dropdown-link">
  363. &emsp;{{ getAdviceContent(scope.row, 2)}}
  364. </span>
  365. </el-dropdown>
  366. </template>
  367. </el-table-column>
  368. <el-table-column
  369. prop="start_time"
  370. align="center"
  371. min-width="30px"
  372. label="执行时间"
  373. sortable
  374. >
  375. <template slot-scope="scope">
  376. <span v-if="scope.row.execution_time != 0">
  377. {{scope.row.start_time | parseTime('{m}-{d} {h}:{i}')}}
  378. </span>
  379. <span v-else></span>
  380. </template>
  381. </el-table-column>
  382. <el-table-column prop="execution_staff" align="center" min-width="30px" label="执行护士">
  383. <template slot-scope="scope">
  384. <span v-if="scope.row.parent_id == 0">
  385. {{getXuserName(scope.row.execution_staff)}}
  386. </span>
  387. <span v-else></span>
  388. </template>
  389. </el-table-column>
  390. <el-table-column prop="checker" align="center" min-width="30px" label="校对护士">
  391. <template slot-scope="scope">
  392. <span v-if="scope.row.parent_id == 0">
  393. {{getXuserName(scope.row.checker)}}
  394. </span>
  395. <span v-else></span>
  396. </template>
  397. </el-table-column>
  398. <el-table-column
  399. prop="check_time"
  400. align="center"
  401. min-width="30px"
  402. label="校对时间"
  403. sortable
  404. >
  405. <template slot-scope="scope">
  406. <span v-if="scope.row.check_time != 0">
  407. {{scope.row.check_time | parseTime('{m}-{d} {h}:{i}')}}
  408. </span>
  409. <span v-else></span>
  410. </template>
  411. </el-table-column>
  412. <el-table-column prop="date" label="开嘱医生" align="center" min-width="26px">
  413. <template slot-scope="scope">
  414. <span>{{ getXuserName(scope.row.advice_doctor) }}</span>
  415. </template>
  416. </el-table-column>
  417. <el-table-column
  418. prop="created_time"
  419. align="center"
  420. min-width="30px"
  421. label="校对时间"
  422. sortable
  423. >
  424. <template slot-scope="scope">
  425. <span v-if="scope.row.created_time != 0">
  426. {{scope.row.created_time | parseTime('{m}-{d} {h}:{i}')}}
  427. </span>
  428. <span v-else></span>
  429. </template>
  430. </el-table-column>
  431. <el-table-column
  432. prop="created_time"
  433. align="center"
  434. min-width="30px"
  435. label="收费状态"
  436. sortable
  437. >
  438. <template slot-scope="scope">
  439. <span v-if="scope.row.is_settle == 1">
  440. 已收费
  441. </span>
  442. <span v-if="scope.row.is_settle == 2 || scope.row.is_settle == 0">
  443. 未收费
  444. </span>
  445. <span v-else></span>
  446. </template>
  447. </el-table-column>
  448. </el-table>
  449. <el-dialog
  450. title="选择执行时间"
  451. :visible.sync="execTimeDialogVisible"
  452. width="400px"
  453. :modal-append-to-body="false"
  454. >
  455. <el-date-picker
  456. v-model="execTime"
  457. format="yyyy-MM-dd HH:mm:00"
  458. value-format="yyyy-MM-dd HH:mm:00"
  459. type="datetime"
  460. placeholder="选择执行时间"
  461. style="width:100%"
  462. ></el-date-picker>
  463. <span slot="footer" class="dialog-footer">
  464. <el-button @click="execTimeDialogVisible = false">取 消</el-button>
  465. <el-button type="primary" @click="excutionDoctorAdvice" :loading="exceLoading">保 存</el-button>
  466. </span>
  467. </el-dialog>
  468. <el-dialog
  469. title="选择执行时间"
  470. :visible.sync="execTimeDialogVisibleOne"
  471. width="400px"
  472. :modal-append-to-body="false"
  473. >
  474. <el-date-picker
  475. v-model="execTime"
  476. format="yyyy-MM-dd HH:mm:00"
  477. value-format="yyyy-MM-dd HH:mm:00"
  478. type="datetime"
  479. placeholder="选择执行时间"
  480. style="width:100%"
  481. ></el-date-picker>
  482. <span slot="footer" class="dialog-footer">
  483. <el-button @click="execTimeDialogVisibleOne = false">取 消</el-button>
  484. <el-button type="primary" @click="excutionDoctorAdviceOne" :loading="exceLoading">保 存</el-button>
  485. </span>
  486. </el-dialog>
  487. <el-dialog
  488. title="药品统计表"
  489. :visible.sync="startdialogVisible"
  490. width="70%">
  491. <span>
  492. <div class="cell clearfix" style="margin-bottom:10px">
  493. <label class="title"> <span class="name">排班班次</span> : </label>
  494. <el-select v-model="schedule_type" placeholder="请选择" @change="changeScheduleType">
  495. <el-option
  496. v-for="item in schedulArr"
  497. :key="item.value"
  498. :label="item.label"
  499. :value="item.value">
  500. </el-option>
  501. </el-select>
  502. <label class="title"> <span class="name">病区选择</span> : </label>
  503. <el-select v-model="partion_type" placeholder="请选择" @change="changePartionType">
  504. <el-option
  505. v-for="item in partitionArr"
  506. :key="item.id"
  507. :label="item.name"
  508. :value="item.id">
  509. </el-option>
  510. </el-select>
  511. <el-button size="small" icon="el-icon-printer" @click="toPrintOne" type="primary">打印</el-button>
  512. <el-button size="small" @click="toExportListOne" type="primary">导出</el-button>
  513. </div>
  514. <el-table
  515. :data="tableList"
  516. border
  517. :row-style="{ color: '#303133' }"
  518. :header-cell-style="{
  519. backgroundColor: 'rgb(245, 247, 250)',
  520. color: '#606266'
  521. }"
  522. >
  523. <el-table-column align="center" label="序号">
  524. <template slot-scope="scope">
  525. {{scope.$index+1}}
  526. </template>
  527. </el-table-column>
  528. <el-table-column align="center" label="药品名称">
  529. <template slot-scope="scope">
  530. {{scope.row.advice_name}}
  531. </template>
  532. </el-table-column>
  533. <el-table-column align="center" label="规格">
  534. <template slot-scope="scope">
  535. {{scope.row.specification_name}}
  536. </template>
  537. </el-table-column>
  538. <el-table-column align="center" label="数量">
  539. <template slot-scope="scope">
  540. <span v-if="config.is_open!=1">{{getCount(scope.row.child)}}</span>
  541. <span v-if="config.is_open ==1">{{getHisCount(scope.row.child,scope.row.max_unit,scope.row.min_unit,scope.row.min_number)}}</span>
  542. </template>
  543. </el-table-column>
  544. </el-table>
  545. </span>
  546. <span slot="footer" class="dialog-footer">
  547. <el-button @click="startdialogVisible = false">取 消</el-button>
  548. <el-button type="primary" @click="startdialogVisible = false">确 定</el-button>
  549. </span>
  550. </el-dialog>
  551. </div>
  552. </div>
  553. </template>
  554. <script>
  555. const moment = require('moment')
  556. import { getSchedualPatient, GetAllZone,getDialysisAdviceToday } from "@/api/dialysis";
  557. import { parseTime } from "@/utils";
  558. import BreadCrumb from "@/xt_pages/components/bread-crumb";
  559. import { getPrintTemplate } from "@/api/data";
  560. import { getNewSchedualDoctors,excutionDoctorAdvice,checkNewDoctorAdvice,settleNewDoctorAdvice,excutionDoctorAdviceById } from '@/api/advice'
  561. import { PostSearch } from '@/api/patient'
  562. export default {
  563. name: "Patient",
  564. data() {
  565. return {
  566. crumbs: [
  567. { path: false, name: "透析管理" },
  568. { path: false, name: "透析监测" }
  569. ],
  570. loading: false,
  571. time: "",
  572. search_mode: 1, // 搜索模式 1.日期搜索 2.病人搜索
  573. patient_search_keyword: "",
  574. SchedualPatientsTableData: [],
  575. active: true,
  576. schedulType: 0,
  577. schedulArr: [
  578. { value: 0, label: "全部" },
  579. { value: 1, label: "上午" },
  580. { value: 2, label: "下午" },
  581. { value: 3, label: "晚上" }
  582. ],
  583. template_id: 0,
  584. partitionType: 0,
  585. costType:0,
  586. total: 0,
  587. listQuery: {
  588. page: 1,
  589. limit: 10,
  590. schedul_type: 0,
  591. partition_type: 0,
  592. schedul_time: "",
  593. keywords: "",
  594. },
  595. selecting_schs: [],
  596. partitionArr: [],
  597. scheduleMap:[],
  598. show:true,
  599. showOne:false,
  600. deliveryWay:[],
  601. executionList:[
  602. {id:0,name:"全部"},
  603. {id:1,name:"已执行"},
  604. {id:2,name:"未执行"},
  605. ],
  606. delivery_way:0,
  607. patient_id:0,
  608. org_id:0,
  609. excution_way:0,
  610. options:[
  611. {id:0,name:"请选择"},
  612. {id:1,name:"按床位排序"},
  613. {id:2,name:"按签到时间排序"},
  614. ],
  615. costArr:[
  616. {id:0,name:"全部"},
  617. {id:1,name:"已收费"},
  618. {id:2,name:"未收费"}
  619. ],
  620. sort:0,
  621. config:{},
  622. execTime: '',
  623. execTimeDialogVisible:false,
  624. exceLoading:false,
  625. is_sort:0,
  626. hoverOrderArr:[],
  627. is_status:0,
  628. execTimeDialogVisibleOne:false,
  629. current_row:{},
  630. tableList:[],
  631. startdialogVisible:false,
  632. schedule_type:0,
  633. partion_type:0,
  634. druglist:[],
  635. config:{},
  636. };
  637. },
  638. created() {
  639. var date = new Date();
  640. this.time = date;
  641. var year = date.getFullYear();
  642. var month = date.getMonth() + 1;
  643. var day = date.getDate();
  644. if (month < 10) {
  645. month = "0" + month;
  646. }
  647. if (day < 10) {
  648. day = "0" + day;
  649. }
  650. var nowDate = year + "-" + month + "-" + day;
  651. var date = new Date(nowDate + " 00:00:00");
  652. this.listQuery.schedul_time = date.getTime();
  653. this.getAllZone();
  654. this.getTemplateInfo();
  655. this.requestSchedualDoctors(this.time)
  656. this.org_id = this.$store.getters.xt_user.template_info.org_id;
  657. },
  658. methods: {
  659. getTemplateInfo() {
  660. getPrintTemplate().then(response => {
  661. if (response.data.state == 0) {
  662. this.$message.error(response.data.msg);
  663. return false;
  664. } else {
  665. var template = response.data.data.template;
  666. this.template_id = template.template_id;
  667. }
  668. });
  669. },
  670. clickCurrent(val) {
  671. console.log(val);
  672. this.$router.push({
  673. path: "/dialysis/details",
  674. query: { patient_id: val.patient_id, date: val.sch_time_int,mode_id:val.mode_id }
  675. });
  676. },
  677. selectSchedulType(scheduleType) {
  678. this.schedulType = scheduleType;
  679. this.listQuery.schedul_type = scheduleType;
  680. this.requestSchedualDoctors(this.time);
  681. },
  682. selectPartitionType(partitionType) {
  683. this.partitionType = partitionType;
  684. this.listQuery.partition_type = partitionType;
  685. this.requestSchedualDoctors(this.time);
  686. },
  687. selectCostType(costType){
  688. this.costType = costType
  689. this.requestSchedualDoctors(this.time);
  690. },
  691. selectDeliveryWay(val){
  692. this.delivery_way = val
  693. this.requestSchedualDoctors(this.time)
  694. },
  695. selectExcutionWay(val){
  696. this.excution_way = val
  697. this.requestSchedualDoctors(this.time)
  698. },
  699. changeTime() {
  700. this.listQuery.schedul_time = this.time;
  701. this.requestSchedualDoctors(this.time)
  702. },
  703. getAllZone: function() {
  704. GetAllZone().then(response => {
  705. if (response.data.state == 0) {
  706. this.$message.error(response.data.msg);
  707. return false;
  708. } else {
  709. this.partitionArr = response.data.data.zone;
  710. this.partitionArr.unshift({ id: 0, name: "全部" });
  711. var dics = response.data.data.dics
  712. var obj = {id:0,name:"全部"}
  713. this.deliveryWay.push(obj)
  714. this.deliveryWay.push(...dics)
  715. }
  716. });
  717. },
  718. requestSchedualDoctors (time) {
  719. var name = ""
  720. for(let i=0;i<this.deliveryWay.length;i++){
  721. if(this.delivery_way == this.deliveryWay[i].id){
  722. name = this.deliveryWay[i].name
  723. }
  724. }
  725. if(name == '全部'){
  726. name = ""
  727. }
  728. let newTime = moment(time).format('YYYY-MM-DD')
  729. var schedule_type = this.listQuery.schedul_type
  730. var partition_type = this.listQuery.partition_type
  731. getNewSchedualDoctors({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,cost_type:this.costType}).then(rs => {
  732. var resp = rs.data
  733. if (resp.state == 1) {
  734. this.admin_users = resp.data.adminUser
  735. var config = resp.data.config
  736. this.config = config
  737. let project_config = resp.data.project_config
  738. if(project_config.is_open == 1){
  739. this.project = resp.data.project
  740. console.log("wode 2o2o3o3o23o32o32o23o32o32o", this.project)
  741. let projectArr = []
  742. if(this.org_id!= 10318 && this.org_id!=10265){
  743. this.project.map(item => {
  744. resp.data.hisAdvices.map(it => {
  745. if(item.patient_id == it.patient_id){
  746. projectArr.push(item)
  747. }
  748. })
  749. })
  750. console.log("projectArr2332323232323232",projectArr)
  751. resp.data.hisAdvices.map((item,index) => {
  752. if(projectArr[index].project && projectArr[index].project.length > 0){
  753. projectArr[index].project.map(it => {
  754. let obj = {
  755. advice_doctor: it.doctor,
  756. start_time:it.start_time,
  757. 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,
  758. execution_time:it.execution_time,
  759. execution_state:it.execution_state,
  760. execution_staff:it.execution_staff,
  761. check_time:it.check_time,
  762. check_state:it.check_state,
  763. checker:it.checker,
  764. created_time:it.ctime,
  765. delivery_way:'',
  766. execution_frequency:'',
  767. remark:'',
  768. id:it.id,
  769. patient_id:it.patient_id,
  770. parent_id:0,
  771. groupno:0,
  772. sort:item.device_number.sort,
  773. assess_time:item.dialysisassesmentbefor&&item.dialysisassesmentbefor?item.dialysisassesmentbefor.created_time:"3753619200"
  774. }
  775. item.doctor_advice.push(obj)
  776. })
  777. }
  778. })
  779. console.log("hh3oo1o3o123o3oo312o132o312o31o132o",resp.data.hisAdvices)
  780. }
  781. }
  782. if(config.is_open == 0 || config.is_open == 2){
  783. var schedules = resp.data.scheduals
  784. var newList = []
  785. if(this.is_sort == 0){
  786. newList = schedules
  787. }
  788. if(this.is_sort == 1){
  789. schedules.map(item => {
  790. item.is_sort = item.device_number.sort
  791. item.assess_time = item.dialysisassesmentbefor&&item.dialysisassesmentbefor?item.dialysisassesmentbefor.created_time:"3753619200"
  792. })
  793. newList = schedules.sort(this.compare('is_sort'))
  794. }
  795. if(this.is_sort == 2){
  796. schedules.map(item => {
  797. item.is_sort = item.device_number.sort
  798. item.assess_time = item.dialysisassesmentbefor?item.dialysisassesmentbefor.created_time:"3753619200"
  799. })
  800. newList = schedules.sort(this.compare('assess_time'))
  801. }
  802. this.show = true
  803. this.showOne = false
  804. let arr = []
  805. let newArr = []
  806. let newSchedules = []
  807. newList.map(item => {
  808. item.doctor_advice.map(it =>{
  809. it.name = item.patient.name
  810. if(item.prescription != null){
  811. it.dialyzer_perfusion_apparatus = item.prescription.dialyzer_perfusion_apparatus
  812. it.dialysis_dialyszers = item.prescription.dialysis_dialyszers
  813. it.dialysis_irrigation = item.prescription.dialysis_irrigation
  814. }
  815. it.schedule_type = item.schedule_type
  816. it.zoneId = item.device_number.zone.id
  817. it.dialysis_no = item.patient.dialysis_no
  818. it.mode_id = item.mode_id
  819. it.number = item.device_number.number
  820. it.zone_name = item.device_number.zone.name
  821. it.sort = item.device_number.sort,
  822. arr.push(it)
  823. })
  824. item.is_sort = item.device_number.sort
  825. item.assess_time = item.dialysisassesmentbefor?item.dialysisassesmentbefor.created_time:"3753619200"
  826. })
  827. console.log("schedules9999999998888888888",schedules)
  828. if(this.schedulType == 0){
  829. newSchedules = arr
  830. }else{
  831. arr.map(item => {
  832. if (item.schedule_type == this.schedulType) {
  833. newSchedules.push(item)
  834. }
  835. })
  836. }
  837. if(this.partitionType == 0){
  838. this.scheduleMap = newSchedules
  839. }else {
  840. let a = []
  841. arr.map(item => {
  842. if(this.partitionType == item.zoneId){
  843. a.push(item)
  844. }
  845. })
  846. this.scheduleMap = a
  847. }
  848. this.scheduleMap.map(ele => {
  849. let firstIndex = this.scheduleMap.findIndex(item => {
  850. return item.patient_id === ele.patient_id // 当category相同的时候,返回第一个相同的Index 赋值给 firstIndex
  851. })
  852. if (this.scheduleMap.findIndex(item => { return item.patient_id === firstIndex}) === -1) {
  853. newArr.push({
  854. length: this.scheduleMap.filter(item => {
  855. return item.patient_id === ele.patient_id //利用数组的filter方法,过滤出相同category的数组的长度。数组长度-即为跨多少行
  856. }).length,
  857. firstIndex: firstIndex // firstIndex 返回的是第一个catergory就满足的第一个Index,即为rowIndex开始于第几行。
  858. })
  859. }
  860. })
  861. this.indexInfoList = newArr
  862. console.log("this.scheduleMap", this.scheduleMap)
  863. }
  864. if(config.is_open == 1){
  865. this.show = false
  866. this.showOne = true
  867. var schedules = resp.data.hisAdvices
  868. let arr = []
  869. let newArr = []
  870. let newSchedules = []
  871. var newList = []
  872. if(this.is_sort == 0){
  873. newList = schedules
  874. }
  875. if(this.is_sort == 1){
  876. schedules.map(item => {
  877. item.is_sort = item.device_number.sort
  878. item.assess_time = item.dialysisassesmentbefor&&item.dialysisassesmentbefor?item.dialysisassesmentbefor.created_time:"3753619200"
  879. })
  880. newList = schedules.sort(this.compare('is_sort'))
  881. }
  882. if(this.is_sort == 2){
  883. schedules.map(item => {
  884. item.is_sort = item.device_number.sort
  885. item.assess_time = item.dialysisassesmentbefor&&item.dialysisassesmentbefor?item.dialysisassesmentbefor.created_time:"3753619200"
  886. })
  887. newList = schedules.sort(this.compare('assess_time'))
  888. }
  889. newList.map(item => {
  890. item.doctor_advice.map(it =>{
  891. it.name = item.patient.name
  892. if(item.prescription != null){
  893. it.dialyzer_perfusion_apparatus = item.prescription.dialyzer_perfusion_apparatus
  894. it.dialysis_dialyszers = item.prescription.dialysis_dialyszers
  895. it.dialysis_irrigation = item.prescription.dialysis_irrigation
  896. }
  897. it.schedule_type = item.schedule_type
  898. it.zoneId = item.device_number.zone.id
  899. it.dialysis_no = item.patient.dialysis_no
  900. it.mode_id = item.mode_id
  901. it.number = item.device_number.number
  902. it.zone_name = item.device_number.zone.name
  903. it.sort = item.device_number.sort,
  904. arr.push(it)
  905. })
  906. item.is_sort = item.device_number.sort
  907. item.assess_time = item.dialysisassesmentbefor&&item.dialysisassesmentbefor?item.dialysisassesmentbefor.created_time:"3753619200"
  908. })
  909. if(this.schedulType == 0){
  910. newSchedules = arr
  911. }else{
  912. arr.map(item => {
  913. if (item.schedule_type == this.schedulType) {
  914. newSchedules.push(item)
  915. }
  916. })
  917. }
  918. if(this.partitionType == 0){
  919. this.scheduleMap = newSchedules
  920. }else {
  921. let a = []
  922. arr.map(item => {
  923. if(this.partitionType == item.zoneId){
  924. a.push(item)
  925. }
  926. })
  927. this.scheduleMap = a
  928. }
  929. this.scheduleMap.map(ele => {
  930. let firstIndex = this.scheduleMap.findIndex(item => {
  931. return item.patient_id === ele.patient_id // 当category相同的时候,返回第一个相同的Index 赋值给 firstIndex
  932. })
  933. if (this.scheduleMap.findIndex(item => { return item.patient_id === firstIndex}) === -1) {
  934. newArr.push({
  935. length: this.scheduleMap.filter(item => {
  936. return item.patient_id === ele.patient_id //利用数组的filter方法,过滤出相同category的数组的长度。数组长度-即为跨多少行
  937. }).length,
  938. firstIndex: firstIndex // firstIndex 返回的是第一个catergory就满足的第一个Index,即为rowIndex开始于第几行。
  939. })
  940. }
  941. })
  942. this.indexInfoList = newArr
  943. }
  944. }
  945. })
  946. },
  947. compare:function (k) {
  948. return function (a, b) {
  949. var M = a[k];
  950. var N = b[k];
  951. return M - N; // 从低向高排
  952. // return N - M; // 从高向低排
  953. }
  954. },
  955. getValue: function(val) {
  956. if (val != undefined) {
  957. return val.value;
  958. } else {
  959. return "";
  960. }
  961. },
  962. handleCurrentChange(val) {
  963. this.listQuery.page = val;
  964. this.getSchedualPatientList();
  965. },
  966. changeSearchMode: function() {
  967. if (this.search_mode == 1) {
  968. this.search_mode = 2;
  969. } else {
  970. this.search_mode = 1;
  971. }
  972. },
  973. searchPatientAction: function() {
  974. this.listQuery.keywords = this.patient_search_keyword;
  975. console.log(this.patient_search_keyword);
  976. if (this.patient_search_keyword.length == 0) {
  977. return;
  978. }
  979. this.getSchedualPatientList();
  980. },
  981. handleSizeChange(val) {
  982. this.listQuery.limit = val;
  983. this.getSchedualPatientList();
  984. },
  985. batchPrintAction: function() {
  986. if (this.selecting_schs.length === 0) {
  987. this.$message.error("请至少选择一条需要打印的内容");
  988. return false;
  989. }
  990. // 模板ID为6
  991. var sch_ids = [];
  992. for (let index = 0; index < this.selecting_schs.length; index++) {
  993. sch_ids.push(this.selecting_schs[index].patient_id);
  994. }
  995. this.$store.dispatch("SetAdviceIDs", sch_ids);
  996. var name = ""
  997. for(let i=0;i<this.deliveryWay.length;i++){
  998. if(this.delivery_way == this.deliveryWay[i].id){
  999. name = this.deliveryWay[i].name
  1000. }
  1001. }
  1002. if(name == '全部'){
  1003. name = ""
  1004. }
  1005. this.$router.push({ path: "/dialysis/doctorAdvicePrint",query:{time: new Date(this.time).getTime(),delivery_way:name} });
  1006. },
  1007. signPrintAction:function(){
  1008. if (this.selecting_schs.length === 0) {
  1009. this.$message.error("请至少选择一条需要打印的内容");
  1010. return false;
  1011. }
  1012. // 模板ID为6
  1013. var sch_ids = [];
  1014. for (let index = 0; index < this.selecting_schs.length; index++) {
  1015. sch_ids.push(this.selecting_schs[index].patient_id);
  1016. }
  1017. this.$store.dispatch("SetAdviceIDs", sch_ids);
  1018. var name = ""
  1019. for(let i=0;i<this.deliveryWay.length;i++){
  1020. if(this.delivery_way == this.deliveryWay[i].id){
  1021. name = this.deliveryWay[i].name
  1022. }
  1023. }
  1024. if(name == '全部'){
  1025. name = ""
  1026. }
  1027. this.$router.push({ path: "/dialysis/signPrint",query:{time: new Date(this.time).getTime(),delivery_way:name} });
  1028. },
  1029. batchPrintActionOne: function() {
  1030. if (this.selecting_schs.length === 0) {
  1031. this.$message.error("请至少选择一条需要打印的内容");
  1032. return false;
  1033. }
  1034. var sch_ids = [];
  1035. for (let index = 0; index < this.selecting_schs.length; index++) {
  1036. sch_ids.push(this.selecting_schs[index].sch_id);
  1037. }
  1038. this.$store.dispatch("SetBatchPrintDialysisRecordIDs", sch_ids);
  1039. if (this.template_id == 2 || this.template_id == 0) {
  1040. this.$router.push({ path: "/dialysis/print/batch/otherone" });
  1041. } else if (this.template_id == 1) {
  1042. this.$router.push({ path: "/dialysis/print/batch" });
  1043. } else if (this.template_id == 5) {
  1044. this.$router.push({ path: "/dialysis/print/batch/fiveone" });
  1045. } else if (this.template_id == 22) {
  1046. this.$router.push({ path: "/dialysis/print/batch/twentyTwo_one" });
  1047. }
  1048. },
  1049. batchPrintActionTwo: function() {
  1050. if (this.selecting_schs.length === 0) {
  1051. this.$message.error("请至少选择一条需要打印的内容");
  1052. return false;
  1053. }
  1054. var sch_ids = [];
  1055. for (let index = 0; index < this.selecting_schs.length; index++) {
  1056. sch_ids.push(this.selecting_schs[index].sch_id);
  1057. }
  1058. this.$store.dispatch("SetBatchPrintDialysisRecordIDs", sch_ids);
  1059. if (this.template_id == 2 || this.template_id == 0) {
  1060. this.$router.push({ path: "/dialysis/print/batch/othertwo" });
  1061. } else if (this.template_id == 1) {
  1062. this.$router.push({ path: "/dialysis/print/batch" });
  1063. } else if (this.template_id == 5) {
  1064. this.$router.push({ path: "/dialysis/print/batch/fivetwo" });
  1065. } else if (this.template_id == 22) {
  1066. this.$router.push({ path: "/dialysis/print/batch/twentyTwo_two" });
  1067. }
  1068. },
  1069. compare (property) {
  1070. return function (a, b) {
  1071. var value1 = a[property]
  1072. var value2 = b[property]
  1073. return value1 - value2
  1074. }
  1075. },
  1076. // tableRowClassName({ row, rowIndex }) {
  1077. // if (row.stop_state == 1 || row.execution_state == 1) {
  1078. // return 'stoped-row';
  1079. // }
  1080. // return 'success-rows'
  1081. // row.index = rowIndex
  1082. // const arr = this.hoverOrderArr
  1083. // for (let i = 0; i < arr.length; i++) {
  1084. // if (rowIndex == arr[i]) {
  1085. // return 'success-row'
  1086. // }
  1087. // }
  1088. // },
  1089. objectSpanMethod({ row, column, rowIndex, columnIndex }) {
  1090. if (columnIndex === 0) {
  1091. let index = this.indexInfoList.findIndex(item => { //遍历数组
  1092. return item.firstIndex === rowIndex
  1093. })
  1094. if (index > -1) {
  1095. return {
  1096. rowspan: this.indexInfoList[index].length,
  1097. colspan: 1
  1098. }
  1099. } else {
  1100. return {
  1101. rowspan: 0,
  1102. colspan: 0
  1103. }
  1104. }
  1105. }
  1106. if (columnIndex === 1) {
  1107. let index = this.indexInfoList.findIndex(item => { //遍历数组
  1108. return item.firstIndex === rowIndex
  1109. })
  1110. if (index > -1) {
  1111. return {
  1112. rowspan: this.indexInfoList[index].length,
  1113. colspan: 1
  1114. }
  1115. } else {
  1116. return {
  1117. rowspan: 0,
  1118. colspan: 0
  1119. }
  1120. }
  1121. }
  1122. if (columnIndex === 2) {
  1123. let index = this.indexInfoList.findIndex(item => { //遍历数组
  1124. return item.firstIndex === rowIndex
  1125. })
  1126. if (index > -1) {
  1127. return {
  1128. rowspan: this.indexInfoList[index].length,
  1129. colspan: 1
  1130. }
  1131. } else {
  1132. return {
  1133. rowspan: 0,
  1134. colspan: 0
  1135. }
  1136. }
  1137. }
  1138. },
  1139. adviceNameShow({ row, column, rowIndex, columnIndex }) {
  1140. if (columnIndex == 2) {
  1141. return 'dialysisadvicenamedisplay'
  1142. } else {
  1143. return ''
  1144. }
  1145. },
  1146. getXuserName(id) {
  1147. if (id <= 0) {
  1148. return ''
  1149. }
  1150. var name = ''
  1151. if (
  1152. this.admin_users == null ||
  1153. typeof this.admin_users.length === 'undefined'
  1154. ) {
  1155. return name
  1156. }
  1157. var leng = this.admin_users.length
  1158. if (leng == 0) {
  1159. return name
  1160. }
  1161. for (let index = 0; index < leng; index++) {
  1162. if (this.admin_users[index].id == id) {
  1163. name = this.admin_users[index].name
  1164. break
  1165. }
  1166. }
  1167. return name
  1168. },
  1169. getAdviceContent(row, isChild) {
  1170. let tempSingleDoseDesc = ''
  1171. let tempDrugSpecDesc = ''
  1172. let tempPrescribingNumberDesc = ''
  1173. if (row.prescribing_number) {
  1174. tempPrescribingNumberDesc =
  1175. row.prescribing_number + '' + row.prescribing_number_unit
  1176. }
  1177. if (row.single_dose) {
  1178. if (this.template_id != 6) {
  1179. tempSingleDoseDesc =
  1180. ' 单次用量 ' + ' ' + row.single_dose + '' + row.single_dose_unit
  1181. } else {
  1182. tempSingleDoseDesc = row.single_dose ? row.single_dose : '' + '' + row.single_dose_unit ? row.single_dose_unit : ''
  1183. }
  1184. }
  1185. if (row.advice_desc) {
  1186. tempDrugSpecDesc = '(' + row.advice_desc + row.drug_spec_unit + ')'
  1187. }
  1188. if (isChild == 1) {
  1189. // 不是子药
  1190. // console.log(tempDrugSpecDesc)
  1191. // console.log(tempPrescribingNumberDesc)
  1192. // console.log(tempSingleDoseDesc)
  1193. // console.log(11,row.delivery_way)
  1194. // console.log(22,row.execution_frequency)
  1195. return (
  1196. row.advice_name +
  1197. tempDrugSpecDesc +
  1198. ' ' +
  1199. tempPrescribingNumberDesc +
  1200. tempSingleDoseDesc +
  1201. ' ' +
  1202. row.delivery_way +
  1203. ' ' +
  1204. row.execution_frequency
  1205. )
  1206. } else {
  1207. // 是子药
  1208. return (
  1209. row.advice_name +
  1210. tempDrugSpecDesc +
  1211. ' ' +
  1212. tempPrescribingNumberDesc +
  1213. tempSingleDoseDesc
  1214. )
  1215. }
  1216. },
  1217. handleSelectionChange(val){
  1218. console.log("val88888888",val)
  1219. this.selecting_schs = val;
  1220. this.is_status = 1
  1221. },
  1222. handleSelectionChangeOne(val){
  1223. this.selecting_schs = val;
  1224. this.is_status = 1
  1225. console.log("val32323323223",val)
  1226. },
  1227. querySearchAsync(keyword, cb) {
  1228. let key = '';
  1229. if (keyword != undefined) {
  1230. key = keyword
  1231. }
  1232. let searchArray = []
  1233. PostSearch(key).then(response => {
  1234. if (response.data.state == 1) {
  1235. searchArray = response.data.data.patient
  1236. console.log('searcharrya', searchArray)
  1237. cb(searchArray)
  1238. }
  1239. })
  1240. return searchArray
  1241. },
  1242. handleSelect(val) {
  1243. this.patient_id = val.id
  1244. this.requestSchedualDoctors(this.time)
  1245. },
  1246. toSeach(){
  1247. this.patient_id = 0
  1248. this.requestSchedualDoctors(this.time)
  1249. },
  1250. toExcution(){
  1251. if(this.selecting_schs.length ==0){
  1252. this.$message.error("请勾选需要执行的医嘱")
  1253. return false
  1254. }
  1255. console.log("hhhahhhahhh",this.is_status)
  1256. if(this.is_status == 1){
  1257. this.execTimeDialogVisible = true
  1258. }
  1259. if(this.is_status == 2){
  1260. this.execTimeDialogVisibleOne = true
  1261. }
  1262. },
  1263. excutionDoctorAdvice(){
  1264. if (this.execTime.length == 0) {
  1265. this.$message.error('请选择执行时间!')
  1266. return false
  1267. }
  1268. var execTime = Math.round(new Date(this.execTime).getTime() / 1000)
  1269. var ids=[]
  1270. if(this.selecting_schs!=null && this.selecting_schs.length >0){
  1271. for(let i=0;i<this.selecting_schs.length;i++){
  1272. ids.push(this.selecting_schs[i].patient_id)
  1273. }
  1274. }
  1275. var str = ids.join(",")
  1276. var params = {
  1277. str:str,
  1278. advice_date: moment(this.time).format('YYYY-MM-DD'),
  1279. is_open:this.config.is_open,
  1280. exec_time:execTime
  1281. }
  1282. console.log("params232322323wo",params)
  1283. this.exceLoading = true
  1284. excutionDoctorAdvice(params).then(response=>{
  1285. if(response.data.state == 1){
  1286. if(response.data.data.msg == 2){
  1287. var drug_name = response.data.data.drug.drug_name
  1288. var dose = response.data.data.drug.dose
  1289. var dose_unit = response.data.data.drug.dose_unit
  1290. var min_number = response.data.data.drug.min_number
  1291. var max_unit = response.data.data.drug.max_unit
  1292. var min_unit = response.data.data.drug.min_unit
  1293. var str = drug_name + " "+dose+dose_unit +"*"+min_number +max_unit +"/"+min_unit
  1294. this.$message.error(str +"库存不足,执行失败!")
  1295. this.exceLoading = false
  1296. this.execTimeDialogVisible = false
  1297. this.requestSchedualDoctors(this.time)
  1298. }
  1299. if(response.data.data.msg == 3){
  1300. this.$message.error("执行人和核对人不能是同一个人,执行失败!")
  1301. }
  1302. }
  1303. })
  1304. },
  1305. toCheck(){
  1306. if(this.selecting_schs.length ==0){
  1307. this.$message.error("请勾选需要执行的医嘱")
  1308. return false
  1309. }
  1310. var ids=[]
  1311. if(this.selecting_schs!=null && this.selecting_schs.length >0){
  1312. for(let i=0;i<this.selecting_schs.length;i++){
  1313. ids.push(this.selecting_schs[i].patient_id)
  1314. }
  1315. }
  1316. var str = ids.join(",")
  1317. var params = {
  1318. str:str,
  1319. advice_date: moment(this.time).format('YYYY-MM-DD'),
  1320. is_open:this.config.is_open,
  1321. }
  1322. checkNewDoctorAdvice(params).then(response=>{
  1323. if(response.data.state == 1){
  1324. if(response.data.data.msg == 2){
  1325. var advice = response.data.data.advice
  1326. this.$message.error(advice.advice_name +"执行人和核对人不能是同一个人,核对失败!")
  1327. this.requestSchedualDoctors(this.time)
  1328. }else{
  1329. this.$message.success("核对成功!")
  1330. this.requestSchedualDoctors(this.time)
  1331. }
  1332. }
  1333. })
  1334. },
  1335. toSettle(){
  1336. if(this.selecting_schs.length ==0){
  1337. this.$message.error("请勾选需要执行的医嘱")
  1338. return false
  1339. }
  1340. var ids=[]
  1341. if(this.selecting_schs!=null && this.selecting_schs.length >0){
  1342. for(let i=0;i<this.selecting_schs.length;i++){
  1343. ids.push(this.selecting_schs[i].patient_id)
  1344. }
  1345. }
  1346. var str = ids.join(",")
  1347. var params = {
  1348. str:str,
  1349. advice_date: moment(this.time).format('YYYY-MM-DD'),
  1350. is_open:this.config.is_open,
  1351. }
  1352. settleNewDoctorAdvice(params).then(response=>{
  1353. if(response.data.state == 1){
  1354. this.$message.success("收费成功!")
  1355. this.requestSchedualDoctors(this.time)
  1356. }
  1357. })
  1358. },
  1359. selectSortType(id){
  1360. this.is_sort = id
  1361. this.requestSchedualDoctors(this.time);
  1362. },
  1363. handleRowClick (row) {
  1364. console.log("row232323232",row)
  1365. },
  1366. tableRowClassName({row, rowIndex}) {
  1367. row.index = rowIndex
  1368. if(row.index = rowIndex){
  1369. return 'success-row'
  1370. }
  1371. },
  1372. handleCurrentChangeList(row){
  1373. console.log("row233232232332",row)
  1374. this.selecting_schs.push(row)
  1375. this.current_row= row
  1376. this.is_status = 2
  1377. },
  1378. excutionDoctorAdviceOne(){
  1379. if(this.current_row.execution_state == 1){
  1380. this.$message.error("所选医嘱已核对,无需再核对!")
  1381. return false
  1382. }
  1383. if (this.execTime.length == 0) {
  1384. this.$message.error('请选择执行时间!')
  1385. return false
  1386. }
  1387. var execTime = Math.round(new Date(this.execTime).getTime() / 1000)
  1388. var params= {
  1389. advice_id:this.current_row.id,
  1390. advice_date: moment(this.time).format('YYYY-MM-DD'),
  1391. exec_time:execTime,
  1392. }
  1393. excutionDoctorAdviceById(params).then(response=>{
  1394. if(response.data.state == 1){
  1395. if(response.data.data.msg == 2){
  1396. var drug_name = response.data.data.drug.drug_name
  1397. var dose = response.data.data.drug.dose
  1398. var dose_unit = response.data.data.drug.dose_unit
  1399. var min_number = response.data.data.drug.min_number
  1400. var max_unit = response.data.data.drug.max_unit
  1401. var min_unit = response.data.data.drug.min_unit
  1402. var str = drug_name + " "+dose+dose_unit +"*"+min_number +max_unit +"/"+min_unit
  1403. this.$message.error(str +"库存不足,执行失败!")
  1404. this.exceLoading = false
  1405. this.execTimeDialogVisibleOne = false
  1406. this.requestSchedualDoctors(this.time)
  1407. }
  1408. if(response.data.data.msg == 1){
  1409. var msg = response.data.data.msg
  1410. this.$message.success("执行成功!")
  1411. this.exceLoading = false
  1412. this.execTimeDialogVisibleOne = false
  1413. this.requestSchedualDoctors(this.time)
  1414. }
  1415. if(response.data.data.msg == 3){
  1416. this.$message.error("执行人与核对人不能是同一个人,执行失败!")
  1417. }
  1418. }
  1419. })
  1420. },
  1421. toStatic() {
  1422. this.tableList = []
  1423. var params = {
  1424. schedule_type:this.schedule_type,
  1425. partion_type:this.partion_type,
  1426. selected_date: moment(this.time).format('YYYY-MM-DD'),
  1427. }
  1428. console.log("params2332232wo",params)
  1429. getDialysisAdviceToday(params).then(response=>{
  1430. if(response.data.state == 1){
  1431. var doctorList = []
  1432. var druglist = response.data.data.drug
  1433. this.druglist = druglist
  1434. this.startdialogVisible = true
  1435. var list = response.data.data.list
  1436. var config = response.data.data.config
  1437. if(list!=null && list.length > 0){
  1438. for(let i=0;i<list.length;i++){
  1439. for(let j=0;j<list[i].xt_doctor_advice.length;j++){
  1440. doctorList.push(list[i].xt_doctor_advice[j])
  1441. }
  1442. }
  1443. }
  1444. if(config.is_open!=1){
  1445. if(doctorList!=null && doctorList.length > 0){
  1446. let dataInfo = {}
  1447. doctorList.forEach((item, index) => {
  1448. let { advice_name } = item
  1449. if (!dataInfo[advice_name]) {
  1450. dataInfo[advice_name] = {
  1451. advice_name:item.advice_name,
  1452. child: [],
  1453. count:0,
  1454. drug_id:item.drug_id,
  1455. specification_name:item.advice_desc +item.drug_spec_unit,
  1456. patient_id:item.patient_id,
  1457. }
  1458. }
  1459. })
  1460. let arr = Object.values(dataInfo)
  1461. // console.log("arr23332323232",arr)
  1462. if(arr.length > 0){
  1463. for(let i=0;i<doctorList.length;i++){
  1464. for(let j=0;j<arr.length;j++){
  1465. if(doctorList[i].advice_name == arr[j].advice_name){
  1466. arr[j].child.push(doctorList[i])
  1467. }
  1468. }
  1469. }
  1470. }
  1471. this.tableList = []
  1472. for(let i=0;i<list.length;i++){
  1473. for(let j=0;j<arr.length;j++){
  1474. if(list[i].patient_id == arr[j].patient_id){
  1475. this.tableList.push(arr[j])
  1476. }
  1477. }
  1478. }
  1479. }
  1480. }
  1481. var his_doctor_advice = []
  1482. for(let i=0;i<list.length;i++){
  1483. for(let j=0;j<list[i].his_doctor_advice.length;j++){
  1484. his_doctor_advice.push(list[i].his_doctor_advice[j])
  1485. }
  1486. }
  1487. console.log("his_doctor_advice",his_doctor_advice)
  1488. var newHisArr = []
  1489. for(let i=0;i<his_doctor_advice.length;i++){
  1490. his_doctor_advice[i].count_one = 0
  1491. if(his_doctor_advice[i].prescribing_number_unit == his_doctor_advice[i].drug.max_unit){
  1492. his_doctor_advice[i].prescribing_number = parseInt(his_doctor_advice[i].prescribing_number) * his_doctor_advice[i].drug.min_number
  1493. his_doctor_advice[i].count_one = parseInt(his_doctor_advice[i].prescribing_number) * his_doctor_advice[i].drug.min_number
  1494. }
  1495. }
  1496. for(let i=0;i<his_doctor_advice.length;i++){
  1497. for(let j=0;j<druglist.length;j++){
  1498. if(his_doctor_advice[i].drug_id == druglist[j].id){
  1499. newHisArr.push(his_doctor_advice[i])
  1500. }
  1501. }
  1502. }
  1503. console.log("下盘子3223323223",newHisArr)
  1504. if(config.is_open == 1){
  1505. if(newHisArr!=null && newHisArr.length > 0){
  1506. let dataInfoOne = {}
  1507. newHisArr.forEach((item, index) => {
  1508. let { advice_name } = item
  1509. if (!dataInfoOne[advice_name]) {
  1510. dataInfoOne[advice_name] = {
  1511. advice_name:item.advice_name,
  1512. child: [],
  1513. count:0,
  1514. specification_name:this.getSpecification(item.drug_id),
  1515. drug_id:item.drug_id,
  1516. patient_id:item.patient_id,
  1517. min_number:item.drug.min_number,
  1518. max_unit:item.drug.max_unit,
  1519. min_unit:item.drug.min_unit
  1520. }
  1521. }
  1522. })
  1523. let hisarr = Object.values(dataInfoOne)
  1524. console.log("hisarr233232233232",hisarr)
  1525. if(hisarr.length > 0){
  1526. for(let i=0;i<newHisArr.length;i++){
  1527. for(let j=0;j<hisarr.length;j++){
  1528. if(newHisArr[i].drug_id == hisarr[j].drug_id){
  1529. hisarr[j].child.push(newHisArr[i])
  1530. }
  1531. }
  1532. }
  1533. }
  1534. console.log("hisarr",hisarr)
  1535. this.tableList = []
  1536. this.tableList = hisarr
  1537. }
  1538. console.log("中国人民解放军",this.tableList)
  1539. }
  1540. }
  1541. })
  1542. },
  1543. getSpecification(id){
  1544. var specification_name = ""
  1545. for(let i=0;i<this.druglist.length;i++){
  1546. if(id == this.druglist[i].id){
  1547. specification_name = this.druglist[i].dose+this.druglist[i].dose_unit +"*"+this.druglist[i].min_number+this.druglist[i].min_unit +"/"+this.druglist[i].max_unit
  1548. }
  1549. }
  1550. return specification_name
  1551. },
  1552. getCount(val){
  1553. var count = 0
  1554. if(val!=null && val.length > 0){
  1555. for(let i=0;i<val.length;i++){
  1556. count += parseInt(val[i].prescribing_number)
  1557. }
  1558. }
  1559. if(count > 0){
  1560. return count
  1561. }else{
  1562. return 0
  1563. }
  1564. },
  1565. getHisCount(val,max_unit,min_unit,min_number){
  1566. var total = 0
  1567. var max_str = "";
  1568. var min_str = "";
  1569. for(let i=0;i<val.length;i++){
  1570. total+=parseInt(val[i].prescribing_number)
  1571. }
  1572. if (total < min_number) {
  1573. min_str = total + min_unit;
  1574. }
  1575. if (total == 0) {
  1576. min_str = "";
  1577. max_str = "";
  1578. }
  1579. if (total >= min_number) {
  1580. if (parseInt(total / min_number) != 0) {
  1581. max_str = parseInt(total / min_number) + max_unit;
  1582. }
  1583. if (total % min_number != 0) {
  1584. min_str = (total % min_number) + min_unit;
  1585. }
  1586. }
  1587. return max_str + min_str;
  1588. },
  1589. toPrintOne(){
  1590. var schedule_date = moment(this.time).format('YYYY-MM-DD')
  1591. this.$router.push({path:"/dialysis/doctorAdviceStaticPrint?schedule_type="+this.schedule_type+"&partion_type="+this.partion_type+"&schedule_date="+schedule_date+"&is_open="+this.config.is_open})
  1592. },
  1593. toExportListOne(){
  1594. import('@/vendor/Export2Excel').then(excel => {
  1595. if(this.tableList!=null && this.tableList.length > 0){
  1596. for(let i=0;i<this.tableList.length;i++){
  1597. this.tableList[i].index = i+1
  1598. if(this.config.is_open == 1){
  1599. this.tableList[i].total_count = this.getHisCount(this.tableList[i].child,this.tableList[i].max_unit,this.tableList[i].min_unit,this.tableList[i].min_number)
  1600. }
  1601. if(this.config.is_open!=1){
  1602. this.tableList[i].total_count = this.getCount(this.tableList[i].child)
  1603. }
  1604. }
  1605. }
  1606. const tHeader = ['序号','药品名称','规格','数量']
  1607. const filterVal = ['index','advice_name','specification_name','total_count']
  1608. const data = this.formatJson(filterVal, this.tableList)
  1609. excel.export_json_to_excel({
  1610. header: tHeader,
  1611. data,
  1612. filename: '药品统计'
  1613. })
  1614. this.downloadLoading = false
  1615. })
  1616. },
  1617. formatJson(filterVal, jsonData) {
  1618. return jsonData.map(v => filterVal.map(j => v[j]));
  1619. },
  1620. changeScheduleType(){
  1621. this.tableList = []
  1622. this.toStatic()
  1623. },
  1624. changePartionType(){
  1625. this.tableList = []
  1626. this.toStatic()
  1627. }
  1628. },
  1629. components: {
  1630. BreadCrumb
  1631. }
  1632. };
  1633. </script>
  1634. <style rel="stylesheet/scss" lang="scss" scoped>
  1635. .app-container {
  1636. // margin: 20px;
  1637. font-size: 15px;
  1638. .filter-container {
  1639. padding-bottom: 5px;
  1640. }
  1641. .cqd-dataTitle {
  1642. color: #303133;
  1643. font-size: 14px;
  1644. border-bottom: 2px #e4e7ed solid;
  1645. height: 36px;
  1646. line-height: 36px;
  1647. margin: 0 0 25px 0;
  1648. position: relative;
  1649. }
  1650. .cqd-dataTitle::before {
  1651. position: absolute;
  1652. left: 0;
  1653. bottom: -2px;
  1654. content: "";
  1655. width: 42px;
  1656. height: 2px;
  1657. background: #409eff;
  1658. }
  1659. .search-component {
  1660. width: 500px;
  1661. .searchBox {
  1662. width: 300px;
  1663. height: 36px;
  1664. line-height: 36px;
  1665. padding-left: 15px;
  1666. border: 1px #dcdfe6 solid;
  1667. border-right: none;
  1668. outline: none;
  1669. float: left;
  1670. border-radius: 6px 0 0 6px;
  1671. font-size: 14px;
  1672. color: #333;
  1673. background: #fff;
  1674. box-shadow: 3px 3px 4px rgba(135, 135, 135, 0.05);
  1675. }
  1676. .searchBtn {
  1677. background-color: #409eff;
  1678. color: #fff;
  1679. font-size: 15px;
  1680. text-align: center;
  1681. height: 36px;
  1682. line-height: 36px;
  1683. float: left;
  1684. outline: none;
  1685. width: 70px;
  1686. border: none;
  1687. border-radius: 0 6px 6px 0;
  1688. font-family: "Microsoft Yahei";
  1689. cursor: pointer;
  1690. }
  1691. }
  1692. .amount {
  1693. font-weight: normal;
  1694. padding: 10px 0 0 0;
  1695. color: #606266;
  1696. font-size: 14px;
  1697. span {
  1698. color: #ef2525;
  1699. font-family: "Arial";
  1700. padding: 0 2px;
  1701. }
  1702. }
  1703. }
  1704. .el-table td,
  1705. .el-table th.is-leaf,
  1706. .el-table--border,
  1707. .el-table--group {
  1708. border-color: #d0d3da;
  1709. }
  1710. .el-table--border::after,
  1711. .el-table--group::after,
  1712. .el-table::before {
  1713. background-color: #d0d3da;
  1714. }
  1715. .el-checkbox__inner::after {
  1716. height: 10px;
  1717. left: 7px;
  1718. }
  1719. .el-checkbox__inner {
  1720. width: 20px;
  1721. height: 20px;
  1722. }
  1723. </style>
  1724. <style lang="scss" scoped>
  1725. .page_consumables {
  1726. .clearfix:after {
  1727. content: none;
  1728. }
  1729. }
  1730. </style>