newDoctorAdvice.vue 80KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429
  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" v-if="org_id!=9671 && org_id!=0 && org_id!=10340 ">统计</el-button>
  156. <el-button type="primary" size="small" @click="toStaticOne" v-if="org_id == 9671 || org_id == 0 || org_id==10340">统计</el-button>
  157. </div>
  158. <el-table :data="scheduleMap" border :row-style="{ color: '#303133' }" :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}"
  159. @selection-change="handleSelectionChange"
  160. :span-method="objectSpanMethod"
  161. :cell-class-name="adviceNameShow"
  162. :modal-append-to-body="false"
  163. highlight-current-row
  164. @current-change="handleCurrentChangeList"
  165. v-show="show"
  166. @row-click="handleRowClick">
  167. <el-table-column type="selection" width="55" align="center"></el-table-column>
  168. <el-table-column prop="date" label="姓名" align="center" min-width="26px">
  169. <template slot-scope="scope">
  170. <span>{{ scope.row.name }}</span>
  171. <br>
  172. ({{ scope.row.parent_id == 0 ? scope.row.dialysis_no : ""}})
  173. <br>
  174. <span v-if="scope.row.mode_id == 1">(HD)</span>
  175. <span v-if="scope.row.mode_id == 2">(HDF)</span>
  176. <span v-if="scope.row.mode_id == 3">(HD+HP)</span>
  177. <span v-if="scope.row.mode_id == 4">(HP)</span>
  178. <span v-if="scope.row.mode_id == 5">(HF)</span>
  179. <span v-if="scope.row.mode_id == 6">(SCUF)</span>
  180. <span v-if="scope.row.mode_id == 7">(IUF)</span>
  181. <span v-if="scope.row.mode_id == 8">(HFHD)</span>
  182. <span v-if="scope.row.mode_id == 9">(HFHD+HP)</span>
  183. <span v-if="scope.row.mode_id == 10">(PHF)</span>
  184. <span v-if="scope.row.mode_id == 11">(HFR)</span>
  185. <span v-if="scope.row.mode_id == 12">(HDF+HP)</span>
  186. <span v-if="scope.row.mode_id == 13">(CRRT)</span>
  187. <span v-if="scope.row.mode_id == 14">(腹水回输)</span>
  188. <span v-if="scope.row.mode_id == 24">I-HDF</span>
  189. </template>
  190. </el-table-column>
  191. <el-table-column label="分区床位" width="100">
  192. <template slot-scope="scope" >
  193. {{scope.row.zone_name}}/{{scope.row.number}}
  194. </template>
  195. </el-table-column>
  196. <el-table-column prop="date" label="透析器" align="center" min-width="26px">
  197. <template slot-scope="scope">
  198. <span>{{ scope.row.dialyzer_perfusion_apparatus }}</span>
  199. <span v-if="scope.row.dialysis_dialyszers!=''">{{scope.row.dialysis_dialyszers}}</span>
  200. <span v-if="scope.row.dialysis_irrigation!=''">{{scope.row.dialysis_irrigation}}</span>
  201. </template>
  202. </el-table-column>
  203. <el-table-column prop="start_time" label="开始时间" align="center" min-width="35px">
  204. <template slot-scope="scope">
  205. <span>
  206. {{scope.row.start_time | parseTime('{m}-{d} {h}:{i}')}}
  207. </span>
  208. </template>
  209. </el-table-column>
  210. <el-table-column prop="advice_name" min-width="50px" label="医嘱内容" align="center">
  211. <template slot-scope="scope">
  212. <el-dropdown trigger="click" v-if="scope.row.parent_id == 0">
  213. <span class="el-dropdown-link" v-if="scope.row.parent_id == 0">
  214. {{ getAdviceContent(scope.row, 1)}}
  215. </span>
  216. </el-dropdown>
  217. <el-dropdown trigger="click" v-if="scope.row.parent_id > 0">
  218. <span class="el-dropdown-link">
  219. &emsp;{{ getAdviceContent(scope.row, 2)}}
  220. </span>
  221. </el-dropdown>
  222. </template>
  223. </el-table-column>
  224. <el-table-column
  225. prop="start_time"
  226. align="center"
  227. min-width="30px"
  228. label="执行时间"
  229. sortable
  230. >
  231. <template slot-scope="scope">
  232. <span v-if="scope.row.execution_time != 0">
  233. {{scope.row.execution_time | parseTime('{m}-{d} {h}:{i}')}}
  234. </span>
  235. <span v-else></span>
  236. </template>
  237. </el-table-column>
  238. <el-table-column prop="execution_staff" align="center" min-width="30px" label="执行护士">
  239. <template slot-scope="scope">
  240. <span v-if="scope.row.parent_id == 0">
  241. {{getXuserName(scope.row.execution_staff)}}
  242. </span>
  243. <span v-else>{{getXuserName(scope.row.execution_staff)}}</span>
  244. </template>
  245. </el-table-column>
  246. <el-table-column prop="checker" align="center" min-width="30px" label="校对护士">
  247. <template slot-scope="scope">
  248. <span v-if="scope.row.parent_id == 0">
  249. {{getXuserName(scope.row.checker)}}
  250. </span>
  251. <span v-else>{{getXuserName(scope.row.checker)}}</span>
  252. </template>
  253. </el-table-column>
  254. <el-table-column
  255. prop="check_time"
  256. align="center"
  257. min-width="30px"
  258. label="校对时间"
  259. sortable
  260. >
  261. <template slot-scope="scope">
  262. <span v-if="scope.row.check_time != 0">
  263. {{scope.row.check_time | parseTime('{m}-{d} {h}:{i}')}}
  264. </span>
  265. <span v-else>
  266. </span>
  267. </span>
  268. </template>
  269. </el-table-column>
  270. <el-table-column prop="date" label="开嘱医生" align="center" min-width="26px">
  271. <template slot-scope="scope">
  272. <span>{{ getXuserName(scope.row.advice_doctor) }}</span>
  273. </template>
  274. </el-table-column>
  275. <el-table-column
  276. prop="created_time"
  277. align="center"
  278. min-width="30px"
  279. label="校对时间"
  280. sortable
  281. >
  282. <template slot-scope="scope">
  283. <span v-if="scope.row.created_time != 0">
  284. {{scope.row.created_time | parseTime('{m}-{d} {h}:{i}')}}
  285. </span>
  286. <span v-else></span>
  287. </template>
  288. </el-table-column>
  289. <el-table-column
  290. prop="created_time"
  291. align="center"
  292. min-width="30px"
  293. label="收费状态"
  294. sortable
  295. >
  296. <template slot-scope="scope">
  297. <span v-if="scope.row.is_settle == 1">
  298. 已收费
  299. </span>
  300. <span v-if="scope.row.is_settle == 2 || scope.row.is_settle == 0">
  301. 未收费
  302. </span>
  303. <span v-else></span>
  304. </template>
  305. </el-table-column>
  306. </el-table>
  307. <el-table :data="scheduleMap" border :row-style="{ color: '#303133' }" :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}"
  308. @selection-change="handleSelectionChangeOne"
  309. @current-change="handleCurrentChangeList"
  310. :span-method="objectSpanMethod"
  311. :cell-class-name="adviceNameShow"
  312. highlight-current-row
  313. :modal-append-to-body="false"
  314. v-show="showOne">
  315. <el-table-column type="selection" width="55" align="center"></el-table-column>
  316. <el-table-column prop="date" label="姓名" align="center" min-width="26px">
  317. <template slot-scope="scope">
  318. <span>{{ scope.row.name }}</span>
  319. <br>
  320. ({{ scope.row.parent_id == 0 ? scope.row.dialysis_no : ""}})
  321. <br>
  322. <span v-if="scope.row.mode_id == 1">(HD)</span>
  323. <span v-if="scope.row.mode_id == 2">(HDF)</span>
  324. <span v-if="scope.row.mode_id == 3">(HD+HP)</span>
  325. <span v-if="scope.row.mode_id == 4">(HP)</span>
  326. <span v-if="scope.row.mode_id == 5">(HF)</span>
  327. <span v-if="scope.row.mode_id == 6">(SCUF)</span>
  328. <span v-if="scope.row.mode_id == 7">(IUF)</span>
  329. <span v-if="scope.row.mode_id == 8">(HFHD)</span>
  330. <span v-if="scope.row.mode_id == 9">(HFHD+HP)</span>
  331. <span v-if="scope.row.mode_id == 10">(PHF)</span>
  332. <span v-if="scope.row.mode_id == 11">(HFR)</span>
  333. <span v-if="scope.row.mode_id == 12">(HDF+HP)</span>
  334. <span v-if="scope.row.mode_id == 13">(CRRT)</span>
  335. <span v-if="scope.row.mode_id == 14">(腹水回输)</span>
  336. <span v-if="scope.row.mode_id == 24">I-HDF</span>
  337. </template>
  338. </el-table-column>
  339. <el-table-column prop="date" label="透析器" align="center" min-width="26px">
  340. <template slot-scope="scope">
  341. <span>
  342. {{ scope.row.dialyzer_perfusion_apparatus }}
  343. <span v-if="scope.row.dialysis_dialyszers!=''">{{scope.row.dialysis_dialyszers}}</span>
  344. <span v-if="scope.row.dialysis_irrigation!=''">{{scope.row.dialysis_irrigation}}</span>
  345. </span>
  346. </template>
  347. </el-table-column>
  348. <el-table-column prop="start_time" label="开始时间" align="center" min-width="35px">
  349. <template slot-scope="scope">
  350. <span>
  351. {{scope.row.start_time | parseTime('{m}-{d} {h}:{i}')}}
  352. </span>
  353. </template>
  354. </el-table-column>
  355. <el-table-column prop="advice_name" min-width="50px" label="医嘱内容" align="center">
  356. <template slot-scope="scope">
  357. <el-dropdown trigger="click" v-if="scope.row.parent_id == 0">
  358. <span class="el-dropdown-link" v-if="scope.row.parent_id == 0">
  359. {{ getAdviceContent(scope.row, 1)}}
  360. </span>
  361. </el-dropdown>
  362. <el-dropdown trigger="click" v-if="scope.row.parent_id > 0">
  363. <span class="el-dropdown-link">
  364. &emsp;{{ getAdviceContent(scope.row, 2)}}
  365. </span>
  366. </el-dropdown>
  367. </template>
  368. </el-table-column>
  369. <el-table-column
  370. prop="start_time"
  371. align="center"
  372. min-width="30px"
  373. label="执行时间"
  374. sortable
  375. >
  376. <template slot-scope="scope">
  377. <span v-if="scope.row.execution_time != 0">
  378. {{scope.row.start_time | parseTime('{m}-{d} {h}:{i}')}}
  379. </span>
  380. <span v-else></span>
  381. </template>
  382. </el-table-column>
  383. <el-table-column prop="execution_staff" align="center" min-width="30px" label="执行护士">
  384. <template slot-scope="scope">
  385. <span v-if="scope.row.parent_id == 0">
  386. {{getXuserName(scope.row.execution_staff)}}
  387. </span>
  388. <span v-else></span>
  389. </template>
  390. </el-table-column>
  391. <el-table-column prop="checker" align="center" min-width="30px" label="校对护士">
  392. <template slot-scope="scope">
  393. <span v-if="scope.row.parent_id == 0">
  394. {{getXuserName(scope.row.checker)}}
  395. </span>
  396. <span v-else></span>
  397. </template>
  398. </el-table-column>
  399. <el-table-column
  400. prop="check_time"
  401. align="center"
  402. min-width="30px"
  403. label="校对时间"
  404. sortable
  405. >
  406. <template slot-scope="scope">
  407. <span v-if="scope.row.check_time != 0">
  408. {{scope.row.check_time | parseTime('{m}-{d} {h}:{i}')}}
  409. </span>
  410. <span v-else></span>
  411. </template>
  412. </el-table-column>
  413. <el-table-column prop="date" label="开嘱医生" align="center" min-width="26px">
  414. <template slot-scope="scope">
  415. <span>{{ getXuserName(scope.row.advice_doctor) }}</span>
  416. </template>
  417. </el-table-column>
  418. <el-table-column
  419. prop="created_time"
  420. align="center"
  421. min-width="30px"
  422. label="校对时间"
  423. sortable
  424. >
  425. <template slot-scope="scope">
  426. <span v-if="scope.row.created_time != 0">
  427. {{scope.row.created_time | parseTime('{m}-{d} {h}:{i}')}}
  428. </span>
  429. <span v-else></span>
  430. </template>
  431. </el-table-column>
  432. <el-table-column
  433. prop="created_time"
  434. align="center"
  435. min-width="30px"
  436. label="收费状态"
  437. sortable
  438. >
  439. <template slot-scope="scope">
  440. <span v-if="scope.row.is_settle == 1">
  441. 已收费
  442. </span>
  443. <span v-if="scope.row.is_settle == 2 || scope.row.is_settle == 0">
  444. 未收费
  445. </span>
  446. <span v-else></span>
  447. </template>
  448. </el-table-column>
  449. </el-table>
  450. <el-dialog
  451. title="选择执行时间"
  452. :visible.sync="execTimeDialogVisible"
  453. width="400px"
  454. :modal-append-to-body="false"
  455. >
  456. <el-date-picker
  457. v-model="execTime"
  458. format="yyyy-MM-dd HH:mm:00"
  459. value-format="yyyy-MM-dd HH:mm:00"
  460. type="datetime"
  461. placeholder="选择执行时间"
  462. style="width:100%"
  463. ></el-date-picker>
  464. <span slot="footer" class="dialog-footer">
  465. <el-button @click="execTimeDialogVisible = false">取 消</el-button>
  466. <el-button type="primary" @click="excutionDoctorAdvice" :loading="exceLoading">保 存</el-button>
  467. </span>
  468. </el-dialog>
  469. <el-dialog
  470. title="选择执行时间"
  471. :visible.sync="execTimeDialogVisibleOne"
  472. width="400px"
  473. :modal-append-to-body="false"
  474. >
  475. <el-date-picker
  476. v-model="execTime"
  477. format="yyyy-MM-dd HH:mm:00"
  478. value-format="yyyy-MM-dd HH:mm:00"
  479. type="datetime"
  480. placeholder="选择执行时间"
  481. style="width:100%"
  482. ></el-date-picker>
  483. <span slot="footer" class="dialog-footer">
  484. <el-button @click="execTimeDialogVisibleOne = false">取 消</el-button>
  485. <el-button type="primary" @click="excutionDoctorAdviceOne" :loading="exceLoading">保 存</el-button>
  486. </span>
  487. </el-dialog>
  488. <el-dialog
  489. title="药品统计表"
  490. :visible.sync="startdialogVisible"
  491. width="60%">
  492. <span>
  493. <div class="cell clearfix" style="margin-bottom:10px">
  494. <label class="title"> <span class="name">排班班次</span> : </label>
  495. <el-select v-model="schedule_type" placeholder="请选择" @change="changeScheduleType" >
  496. <el-option
  497. v-for="item in schedulArr"
  498. :key="item.value"
  499. :label="item.label"
  500. :value="item.value">
  501. </el-option>
  502. </el-select>
  503. <label class="title"> <span class="name">病区选择</span> : </label>
  504. <el-select v-model="partion_type" placeholder="请选择" @change="changePartionType">
  505. <el-option
  506. v-for="item in partitionArr"
  507. :key="item.id"
  508. :label="item.name"
  509. :value="item.id">
  510. </el-option>
  511. </el-select>
  512. <el-button size="small" icon="el-icon-printer" @click="toPrintOne" type="primary">打印</el-button>
  513. <el-button size="small" @click="toExportListOne" type="primary">导出</el-button>
  514. </div>
  515. <el-table
  516. :data="tableList"
  517. border
  518. :row-style="{ color: '#303133' }"
  519. :header-cell-style="{
  520. backgroundColor: 'rgb(245, 247, 250)',
  521. color: '#606266'
  522. }"
  523. >
  524. <el-table-column align="center" label="序号">
  525. <template slot-scope="scope">
  526. {{scope.$index+1}}
  527. </template>
  528. </el-table-column>
  529. <el-table-column align="center" label="药品名称">
  530. <template slot-scope="scope">
  531. {{scope.row.advice_name}}
  532. </template>
  533. </el-table-column>
  534. <el-table-column align="center" label="规格">
  535. <template slot-scope="scope">
  536. {{scope.row.specification_name}}
  537. </template>
  538. </el-table-column>
  539. <el-table-column align="center" label="数量">
  540. <template slot-scope="scope">
  541. <span v-if="config.is_open!=1">{{getCount(scope.row.child)}}</span>
  542. <span v-if="config.is_open ==1">{{getHisCount(scope.row.child,scope.row.max_unit,scope.row.min_unit,scope.row.min_number)}}</span>
  543. </template>
  544. </el-table-column>
  545. </el-table>
  546. </span>
  547. <span slot="footer" class="dialog-footer">
  548. <el-button @click="startdialogVisible = false">取 消</el-button>
  549. <el-button type="primary" @click="startdialogVisible = false">确 定</el-button>
  550. </span>
  551. </el-dialog>
  552. <!-- 长沙南雅 -->
  553. <el-dialog
  554. title="药品统计表"
  555. :visible.sync="startdialogVisibleOne"
  556. width="70%">
  557. <span>
  558. <div class="cell clearfix" style="margin-bottom:10px">
  559. <label class="title"> <span class="name">排班班次</span> : </label>
  560. <el-select v-model="schedule_type" placeholder="请选择" @change="changeScheduleTypeOne" >
  561. <el-option
  562. v-for="item in schedulArr"
  563. :key="item.value"
  564. :label="item.label"
  565. :value="item.value">
  566. </el-option>
  567. </el-select>
  568. <label class="title"> <span class="name">病区选择</span> : </label>
  569. <el-select v-model="partion_type" placeholder="请选择" @change="changePartionTypeOne">
  570. <el-option
  571. v-for="item in partitionArr"
  572. :key="item.id"
  573. :label="item.name"
  574. :value="item.id">
  575. </el-option>
  576. </el-select>
  577. <el-button size="small" icon="el-icon-printer" @click="toPrintTwo" type="primary">打印</el-button>
  578. <!-- <el-button size="small" @click="toExportListOne" type="primary">导出</el-button> -->
  579. <!-- <el-button @click="toJiao()">脚本</el-button> -->
  580. </div>
  581. <el-table
  582. :data="tableDataList"
  583. border
  584. :row-style="{ color: '#303133' }"
  585. :header-cell-style="{
  586. backgroundColor: 'rgb(245, 247, 250)',
  587. color: '#606266'
  588. }"
  589. >
  590. <el-table-column
  591. align="center"
  592. prop="name"
  593. label="序号"
  594. width="100"
  595. >
  596. <template slot-scope="scope" >
  597. <span v-if="scope.row.is_total == 1">{{scope.$index+1}}</span>
  598. <span v-if="scope.row.is_total == 0">总计</span>
  599. </template>
  600. </el-table-column>
  601. <el-table-column
  602. align="center"
  603. prop="name"
  604. label="区域"
  605. width="100"
  606. >
  607. <template slot-scope="scope" >
  608. <span v-if="scope.row.is_total ==1">{{getZoneName(scope.row.child)}}</span>
  609. </template>
  610. </el-table-column>
  611. <el-table-column
  612. align="center"
  613. prop="name"
  614. label="责护"
  615. width="100"
  616. >
  617. <template slot-scope="scope">
  618. <span v-if="scope.row.is_total ==1">
  619. {{getAdminUserName(scope.row.execution_staff)}}
  620. </span>
  621. </template>
  622. </el-table-column>
  623. <el-table-column
  624. align="center"
  625. prop="name"
  626. label="透析模式"
  627. width="150"
  628. >
  629. <template slot-scope="scope">
  630. <span v-if="scope.row.is_total == 1">
  631. {{getModeId(scope.row.child)}}
  632. </span>
  633. </template>
  634. </el-table-column>
  635. <el-table-column
  636. align="center"
  637. prop="name"
  638. v-for="(item,index) in tabHead"
  639. :key="index"
  640. :label="item.advice_name"
  641. >
  642. <template slot-scope="scope">
  643. <span v-if="scope.row.is_total ==1">
  644. <span v-if="scope.row.child[index]!=null">{{getDrugCount(scope.row.child,item.advice_name)}}</span>
  645. </span>
  646. <span v-if="scope.row.is_total == 0">
  647. {{getAllSumCount(item.advice_name)}}
  648. </span>
  649. </template>
  650. </el-table-column>
  651. </el-table>
  652. </span>
  653. <span slot="footer" class="dialog-footer">
  654. <el-button @click="startdialogVisibleOne = false">取 消</el-button>
  655. <el-button type="primary" @click="startdialogVisibleOne = false">确 定</el-button>
  656. </span>
  657. </el-dialog>
  658. </div>
  659. </div>
  660. </template>
  661. <script>
  662. const moment = require('moment')
  663. import { getSchedualPatient, GetAllZone,getDialysisAdviceToday } from "@/api/dialysis";
  664. import { parseTime } from "@/utils";
  665. import { uParseTime } from '@/utils/tools'
  666. import BreadCrumb from "@/xt_pages/components/bread-crumb";
  667. import { getPrintTemplate } from "@/api/data";
  668. import { getNewSchedualDoctors,excutionDoctorAdvice,checkNewDoctorAdvice,settleNewDoctorAdvice,excutionDoctorAdviceById,GetMobileScheduleList } from '@/api/advice'
  669. import { PostSearch } from '@/api/patient'
  670. export default {
  671. name: "Patient",
  672. data() {
  673. return {
  674. crumbs: [
  675. { path: false, name: "透析管理" },
  676. { path: false, name: "透析监测" }
  677. ],
  678. loading: false,
  679. time: "",
  680. search_mode: 1, // 搜索模式 1.日期搜索 2.病人搜索
  681. patient_search_keyword: "",
  682. SchedualPatientsTableData: [],
  683. active: true,
  684. schedulType: 0,
  685. schedulArr: [
  686. { value: 0, label: "全部" },
  687. { value: 1, label: "上午" },
  688. { value: 2, label: "下午" },
  689. { value: 3, label: "晚上" }
  690. ],
  691. template_id: 0,
  692. partitionType: 0,
  693. costType:0,
  694. total: 0,
  695. listQuery: {
  696. page: 1,
  697. limit: 10,
  698. schedul_type: 0,
  699. partition_type: 0,
  700. schedul_time: "",
  701. keywords: "",
  702. },
  703. selecting_schs: [],
  704. partitionArr: [],
  705. scheduleMap:[],
  706. show:true,
  707. showOne:false,
  708. deliveryWay:[],
  709. executionList:[
  710. {id:0,name:"全部"},
  711. {id:1,name:"已执行"},
  712. {id:2,name:"未执行"},
  713. ],
  714. delivery_way:0,
  715. patient_id:0,
  716. org_id:0,
  717. excution_way:0,
  718. options:[
  719. {id:0,name:"请选择"},
  720. {id:1,name:"按床位排序"},
  721. {id:2,name:"按签到时间排序"},
  722. ],
  723. costArr:[
  724. {id:0,name:"全部"},
  725. {id:1,name:"已收费"},
  726. {id:2,name:"未收费"}
  727. ],
  728. sort:0,
  729. config:{},
  730. execTime: '',
  731. execTimeDialogVisible:false,
  732. exceLoading:false,
  733. is_sort:0,
  734. hoverOrderArr:[],
  735. is_status:0,
  736. execTimeDialogVisibleOne:false,
  737. current_row:{},
  738. tableList:[],
  739. startdialogVisible:false,
  740. startdialogVisibleOne:false,
  741. schedule_type:0,
  742. partion_type:0,
  743. druglist:[],
  744. config:{},
  745. tabHead:[],
  746. tableDataList:[],
  747. adminUserList:[],
  748. };
  749. },
  750. created() {
  751. var date = new Date();
  752. this.time = date;
  753. var year = date.getFullYear();
  754. var month = date.getMonth() + 1;
  755. var day = date.getDate();
  756. if (month < 10) {
  757. month = "0" + month;
  758. }
  759. if (day < 10) {
  760. day = "0" + day;
  761. }
  762. var nowDate = year + "-" + month + "-" + day;
  763. var date = new Date(nowDate + " 00:00:00");
  764. this.listQuery.schedul_time = date.getTime();
  765. this.getAllZone();
  766. this.getTemplateInfo();
  767. this.requestSchedualDoctors(this.time)
  768. this.org_id = this.$store.getters.xt_user.template_info.org_id;
  769. },
  770. methods: {
  771. getTemplateInfo() {
  772. getPrintTemplate().then(response => {
  773. if (response.data.state == 0) {
  774. this.$message.error(response.data.msg);
  775. return false;
  776. } else {
  777. var template = response.data.data.template;
  778. this.template_id = template.template_id;
  779. }
  780. });
  781. },
  782. clickCurrent(val) {
  783. // console.log(val);
  784. this.$router.push({
  785. path: "/dialysis/details",
  786. query: { patient_id: val.patient_id, date: val.sch_time_int,mode_id:val.mode_id }
  787. });
  788. },
  789. selectSchedulType(scheduleType) {
  790. this.schedulType = scheduleType;
  791. this.listQuery.schedul_type = scheduleType;
  792. this.requestSchedualDoctors(this.time);
  793. },
  794. selectPartitionType(partitionType) {
  795. this.partitionType = partitionType;
  796. this.listQuery.partition_type = partitionType;
  797. this.requestSchedualDoctors(this.time);
  798. },
  799. selectCostType(costType){
  800. this.costType = costType
  801. this.requestSchedualDoctors(this.time);
  802. },
  803. selectDeliveryWay(val){
  804. this.delivery_way = val
  805. this.requestSchedualDoctors(this.time)
  806. },
  807. selectExcutionWay(val){
  808. this.excution_way = val
  809. this.requestSchedualDoctors(this.time)
  810. },
  811. changeTime() {
  812. this.listQuery.schedul_time = this.time;
  813. this.requestSchedualDoctors(this.time)
  814. },
  815. getAllZone: function() {
  816. GetAllZone().then(response => {
  817. if (response.data.state == 0) {
  818. this.$message.error(response.data.msg);
  819. return false;
  820. } else {
  821. this.partitionArr = response.data.data.zone;
  822. this.partitionArr.unshift({ id: 0, name: "全部" });
  823. var dics = response.data.data.dics
  824. var obj = {id:0,name:"全部"}
  825. this.deliveryWay.push(obj)
  826. this.deliveryWay.push(...dics)
  827. }
  828. });
  829. },
  830. requestSchedualDoctors (time) {
  831. var name = ""
  832. for(let i=0;i<this.deliveryWay.length;i++){
  833. if(this.delivery_way == this.deliveryWay[i].id){
  834. name = this.deliveryWay[i].name
  835. }
  836. }
  837. if(name == '全部'){
  838. name = ""
  839. }
  840. let newTime = moment(time).format('YYYY-MM-DD')
  841. var schedule_type = this.listQuery.schedul_type
  842. var partition_type = this.listQuery.partition_type
  843. 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 => {
  844. var resp = rs.data
  845. if (resp.state == 1) {
  846. this.admin_users = resp.data.adminUser
  847. var config = resp.data.config
  848. this.config = config
  849. let project_config = resp.data.project_config
  850. if(project_config.is_open == 1){
  851. this.project = resp.data.project
  852. console.log("wode 2o2o3o3o23o32o32o23o32o32o", this.project)
  853. let projectArr = []
  854. if(this.org_id!= 10318 && this.org_id!=10265){
  855. this.project.map(item => {
  856. resp.data.hisAdvices.map(it => {
  857. if(item.patient_id == it.patient_id){
  858. projectArr.push(item)
  859. }
  860. })
  861. })
  862. console.log("projectArr2332323232323232",projectArr)
  863. resp.data.hisAdvices.map((item,index) => {
  864. if(projectArr[index].project && projectArr[index].project.length > 0){
  865. projectArr[index].project.map(it => {
  866. let obj = {
  867. advice_doctor: it.doctor,
  868. start_time:it.start_time,
  869. 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,
  870. execution_time:it.execution_time,
  871. execution_state:it.execution_state,
  872. execution_staff:it.execution_staff,
  873. check_time:it.check_time,
  874. check_state:it.check_state,
  875. checker:it.checker,
  876. created_time:it.ctime,
  877. delivery_way:'',
  878. execution_frequency:'',
  879. remark:'',
  880. id:it.id,
  881. patient_id:it.patient_id,
  882. parent_id:0,
  883. groupno:0,
  884. sort:item.device_number.sort,
  885. assess_time:item.dialysisassesmentbefor&&item.dialysisassesmentbefor?item.dialysisassesmentbefor.created_time:"3753619200"
  886. }
  887. item.doctor_advice.push(obj)
  888. })
  889. }
  890. })
  891. console.log("hh3oo1o3o123o3oo312o132o312o31o132o",resp.data.hisAdvices)
  892. }
  893. }
  894. if(config.is_open == 0 || config.is_open == 2){
  895. var schedules = resp.data.scheduals
  896. var newList = []
  897. if(this.is_sort == 0){
  898. newList = schedules
  899. }
  900. if(this.is_sort == 1){
  901. schedules.map(item => {
  902. item.is_sort = item.device_number.sort
  903. item.assess_time = item.dialysisassesmentbefor&&item.dialysisassesmentbefor?item.dialysisassesmentbefor.created_time:"3753619200"
  904. })
  905. newList = schedules.sort(this.compare('is_sort'))
  906. }
  907. if(this.is_sort == 2){
  908. schedules.map(item => {
  909. item.is_sort = item.device_number.sort
  910. item.assess_time = item.dialysisassesmentbefor?item.dialysisassesmentbefor.created_time:"3753619200"
  911. })
  912. newList = schedules.sort(this.compare('assess_time'))
  913. }
  914. this.show = true
  915. this.showOne = false
  916. let arr = []
  917. let newArr = []
  918. let newSchedules = []
  919. newList.map(item => {
  920. item.doctor_advice.map(it =>{
  921. it.name = item.patient.name
  922. if(item.prescription != null){
  923. it.dialyzer_perfusion_apparatus = item.prescription.dialyzer_perfusion_apparatus
  924. it.dialysis_dialyszers = item.prescription.dialysis_dialyszers
  925. it.dialysis_irrigation = item.prescription.dialysis_irrigation
  926. }
  927. it.schedule_type = item.schedule_type
  928. it.zoneId = item.device_number.zone.id
  929. it.dialysis_no = item.patient.dialysis_no
  930. it.mode_id = item.mode_id
  931. it.number = item.device_number.number
  932. it.zone_name = item.device_number.zone.name
  933. it.sort = item.device_number.sort,
  934. arr.push(it)
  935. })
  936. item.is_sort = item.device_number.sort
  937. item.assess_time = item.dialysisassesmentbefor?item.dialysisassesmentbefor.created_time:"3753619200"
  938. })
  939. console.log("schedules9999999998888888888",schedules)
  940. if(this.schedulType == 0){
  941. newSchedules = arr
  942. }else{
  943. arr.map(item => {
  944. if (item.schedule_type == this.schedulType) {
  945. newSchedules.push(item)
  946. }
  947. })
  948. }
  949. if(this.partitionType == 0){
  950. this.scheduleMap = newSchedules
  951. }else {
  952. let a = []
  953. arr.map(item => {
  954. if(this.partitionType == item.zoneId){
  955. a.push(item)
  956. }
  957. })
  958. this.scheduleMap = a
  959. }
  960. this.scheduleMap.map(ele => {
  961. let firstIndex = this.scheduleMap.findIndex(item => {
  962. return item.patient_id === ele.patient_id // 当category相同的时候,返回第一个相同的Index 赋值给 firstIndex
  963. })
  964. if (this.scheduleMap.findIndex(item => { return item.patient_id === firstIndex}) === -1) {
  965. newArr.push({
  966. length: this.scheduleMap.filter(item => {
  967. return item.patient_id === ele.patient_id //利用数组的filter方法,过滤出相同category的数组的长度。数组长度-即为跨多少行
  968. }).length,
  969. firstIndex: firstIndex // firstIndex 返回的是第一个catergory就满足的第一个Index,即为rowIndex开始于第几行。
  970. })
  971. }
  972. })
  973. this.indexInfoList = newArr
  974. console.log("this.scheduleMap", this.scheduleMap)
  975. }
  976. if(config.is_open == 1){
  977. this.show = false
  978. this.showOne = true
  979. var schedules = resp.data.hisAdvices
  980. let arr = []
  981. let newArr = []
  982. let newSchedules = []
  983. var newList = []
  984. if(this.is_sort == 0){
  985. newList = schedules
  986. }
  987. if(this.is_sort == 1){
  988. schedules.map(item => {
  989. item.is_sort = item.device_number.sort
  990. item.assess_time = item.dialysisassesmentbefor&&item.dialysisassesmentbefor?item.dialysisassesmentbefor.created_time:"3753619200"
  991. })
  992. newList = schedules.sort(this.compare('is_sort'))
  993. }
  994. if(this.is_sort == 2){
  995. schedules.map(item => {
  996. item.is_sort = item.device_number.sort
  997. item.assess_time = item.dialysisassesmentbefor&&item.dialysisassesmentbefor?item.dialysisassesmentbefor.created_time:"3753619200"
  998. })
  999. newList = schedules.sort(this.compare('assess_time'))
  1000. }
  1001. newList.map(item => {
  1002. item.doctor_advice.map(it =>{
  1003. it.name = item.patient.name
  1004. if(item.prescription != null){
  1005. it.dialyzer_perfusion_apparatus = item.prescription.dialyzer_perfusion_apparatus
  1006. it.dialysis_dialyszers = item.prescription.dialysis_dialyszers
  1007. it.dialysis_irrigation = item.prescription.dialysis_irrigation
  1008. }
  1009. it.schedule_type = item.schedule_type
  1010. it.zoneId = item.device_number.zone.id
  1011. it.dialysis_no = item.patient.dialysis_no
  1012. it.mode_id = item.mode_id
  1013. it.number = item.device_number.number
  1014. it.zone_name = item.device_number.zone.name
  1015. it.sort = item.device_number.sort,
  1016. arr.push(it)
  1017. })
  1018. item.is_sort = item.device_number.sort
  1019. item.assess_time = item.dialysisassesmentbefor&&item.dialysisassesmentbefor?item.dialysisassesmentbefor.created_time:"3753619200"
  1020. })
  1021. if(this.schedulType == 0){
  1022. newSchedules = arr
  1023. }else{
  1024. arr.map(item => {
  1025. if (item.schedule_type == this.schedulType) {
  1026. newSchedules.push(item)
  1027. }
  1028. })
  1029. }
  1030. if(this.partitionType == 0){
  1031. this.scheduleMap = newSchedules
  1032. }else {
  1033. let a = []
  1034. arr.map(item => {
  1035. if(this.partitionType == item.zoneId){
  1036. a.push(item)
  1037. }
  1038. })
  1039. this.scheduleMap = a
  1040. }
  1041. this.scheduleMap.map(ele => {
  1042. let firstIndex = this.scheduleMap.findIndex(item => {
  1043. return item.patient_id === ele.patient_id // 当category相同的时候,返回第一个相同的Index 赋值给 firstIndex
  1044. })
  1045. if (this.scheduleMap.findIndex(item => { return item.patient_id === firstIndex}) === -1) {
  1046. newArr.push({
  1047. length: this.scheduleMap.filter(item => {
  1048. return item.patient_id === ele.patient_id //利用数组的filter方法,过滤出相同category的数组的长度。数组长度-即为跨多少行
  1049. }).length,
  1050. firstIndex: firstIndex // firstIndex 返回的是第一个catergory就满足的第一个Index,即为rowIndex开始于第几行。
  1051. })
  1052. }
  1053. })
  1054. this.indexInfoList = newArr
  1055. }
  1056. }
  1057. })
  1058. },
  1059. compare:function (k) {
  1060. return function (a, b) {
  1061. var M = a[k];
  1062. var N = b[k];
  1063. return M - N; // 从低向高排
  1064. // return N - M; // 从高向低排
  1065. }
  1066. },
  1067. getValue: function(val) {
  1068. if (val != undefined) {
  1069. return val.value;
  1070. } else {
  1071. return "";
  1072. }
  1073. },
  1074. handleCurrentChange(val) {
  1075. this.listQuery.page = val;
  1076. this.getSchedualPatientList();
  1077. },
  1078. changeSearchMode: function() {
  1079. if (this.search_mode == 1) {
  1080. this.search_mode = 2;
  1081. } else {
  1082. this.search_mode = 1;
  1083. }
  1084. },
  1085. searchPatientAction: function() {
  1086. this.listQuery.keywords = this.patient_search_keyword;
  1087. console.log(this.patient_search_keyword);
  1088. if (this.patient_search_keyword.length == 0) {
  1089. return;
  1090. }
  1091. this.getSchedualPatientList();
  1092. },
  1093. handleSizeChange(val) {
  1094. this.listQuery.limit = val;
  1095. this.getSchedualPatientList();
  1096. },
  1097. batchPrintAction: function() {
  1098. if (this.selecting_schs.length === 0) {
  1099. this.$message.error("请至少选择一条需要打印的内容");
  1100. return false;
  1101. }
  1102. // 模板ID为6
  1103. var sch_ids = [];
  1104. for (let index = 0; index < this.selecting_schs.length; index++) {
  1105. sch_ids.push(this.selecting_schs[index].patient_id);
  1106. }
  1107. this.$store.dispatch("SetAdviceIDs", sch_ids);
  1108. var name = ""
  1109. for(let i=0;i<this.deliveryWay.length;i++){
  1110. if(this.delivery_way == this.deliveryWay[i].id){
  1111. name = this.deliveryWay[i].name
  1112. }
  1113. }
  1114. if(name == '全部'){
  1115. name = ""
  1116. }
  1117. if(this.org_id == 9671 || this.org_id == 10340 || this.org_id == 0){
  1118. this.$router.push({ path: "/dialysis/doctorAdvicePrint/one",query:{time: new Date(this.time).getTime(),delivery_way:name} });
  1119. }
  1120. if(this.org_id != 9671 && this.org_id != 10340 && this.org_id!=0){
  1121. this.$router.push({ path: "/dialysis/doctorAdvicePrint",query:{time: new Date(this.time).getTime(),delivery_way:name} });
  1122. }
  1123. },
  1124. signPrintAction:function(){
  1125. if (this.selecting_schs.length === 0) {
  1126. this.$message.error("请至少选择一条需要打印的内容");
  1127. return false;
  1128. }
  1129. // 模板ID为6
  1130. var sch_ids = [];
  1131. for (let index = 0; index < this.selecting_schs.length; index++) {
  1132. sch_ids.push(this.selecting_schs[index].patient_id);
  1133. }
  1134. this.$store.dispatch("SetAdviceIDs", sch_ids);
  1135. var name = ""
  1136. for(let i=0;i<this.deliveryWay.length;i++){
  1137. if(this.delivery_way == this.deliveryWay[i].id){
  1138. name = this.deliveryWay[i].name
  1139. }
  1140. }
  1141. if(name == '全部'){
  1142. name = ""
  1143. }
  1144. this.$router.push({ path: "/dialysis/signPrint",query:{time: new Date(this.time).getTime(),delivery_way:name} });
  1145. },
  1146. batchPrintActionOne: function() {
  1147. if (this.selecting_schs.length === 0) {
  1148. this.$message.error("请至少选择一条需要打印的内容");
  1149. return false;
  1150. }
  1151. var sch_ids = [];
  1152. for (let index = 0; index < this.selecting_schs.length; index++) {
  1153. sch_ids.push(this.selecting_schs[index].sch_id);
  1154. }
  1155. this.$store.dispatch("SetBatchPrintDialysisRecordIDs", sch_ids);
  1156. if (this.template_id == 2 || this.template_id == 0) {
  1157. this.$router.push({ path: "/dialysis/print/batch/otherone" });
  1158. } else if (this.template_id == 1) {
  1159. this.$router.push({ path: "/dialysis/print/batch" });
  1160. } else if (this.template_id == 5) {
  1161. this.$router.push({ path: "/dialysis/print/batch/fiveone" });
  1162. } else if (this.template_id == 22) {
  1163. this.$router.push({ path: "/dialysis/print/batch/twentyTwo_one" });
  1164. }
  1165. },
  1166. batchPrintActionTwo: function() {
  1167. if (this.selecting_schs.length === 0) {
  1168. this.$message.error("请至少选择一条需要打印的内容");
  1169. return false;
  1170. }
  1171. var sch_ids = [];
  1172. for (let index = 0; index < this.selecting_schs.length; index++) {
  1173. sch_ids.push(this.selecting_schs[index].sch_id);
  1174. }
  1175. this.$store.dispatch("SetBatchPrintDialysisRecordIDs", sch_ids);
  1176. if (this.template_id == 2 || this.template_id == 0) {
  1177. this.$router.push({ path: "/dialysis/print/batch/othertwo" });
  1178. } else if (this.template_id == 1) {
  1179. this.$router.push({ path: "/dialysis/print/batch" });
  1180. } else if (this.template_id == 5) {
  1181. this.$router.push({ path: "/dialysis/print/batch/fivetwo" });
  1182. } else if (this.template_id == 22) {
  1183. this.$router.push({ path: "/dialysis/print/batch/twentyTwo_two" });
  1184. }
  1185. },
  1186. compare (property) {
  1187. return function (a, b) {
  1188. var value1 = a[property]
  1189. var value2 = b[property]
  1190. return value1 - value2
  1191. }
  1192. },
  1193. // tableRowClassName({ row, rowIndex }) {
  1194. // if (row.stop_state == 1 || row.execution_state == 1) {
  1195. // return 'stoped-row';
  1196. // }
  1197. // return 'success-rows'
  1198. // row.index = rowIndex
  1199. // const arr = this.hoverOrderArr
  1200. // for (let i = 0; i < arr.length; i++) {
  1201. // if (rowIndex == arr[i]) {
  1202. // return 'success-row'
  1203. // }
  1204. // }
  1205. // },
  1206. objectSpanMethod({ row, column, rowIndex, columnIndex }) {
  1207. if (columnIndex === 0) {
  1208. let index = this.indexInfoList.findIndex(item => { //遍历数组
  1209. return item.firstIndex === rowIndex
  1210. })
  1211. if (index > -1) {
  1212. return {
  1213. rowspan: this.indexInfoList[index].length,
  1214. colspan: 1
  1215. }
  1216. } else {
  1217. return {
  1218. rowspan: 0,
  1219. colspan: 0
  1220. }
  1221. }
  1222. }
  1223. if (columnIndex === 1) {
  1224. let index = this.indexInfoList.findIndex(item => { //遍历数组
  1225. return item.firstIndex === rowIndex
  1226. })
  1227. if (index > -1) {
  1228. return {
  1229. rowspan: this.indexInfoList[index].length,
  1230. colspan: 1
  1231. }
  1232. } else {
  1233. return {
  1234. rowspan: 0,
  1235. colspan: 0
  1236. }
  1237. }
  1238. }
  1239. if (columnIndex === 2) {
  1240. let index = this.indexInfoList.findIndex(item => { //遍历数组
  1241. return item.firstIndex === rowIndex
  1242. })
  1243. if (index > -1) {
  1244. return {
  1245. rowspan: this.indexInfoList[index].length,
  1246. colspan: 1
  1247. }
  1248. } else {
  1249. return {
  1250. rowspan: 0,
  1251. colspan: 0
  1252. }
  1253. }
  1254. }
  1255. },
  1256. adviceNameShow({ row, column, rowIndex, columnIndex }) {
  1257. if (columnIndex == 2) {
  1258. return 'dialysisadvicenamedisplay'
  1259. } else {
  1260. return ''
  1261. }
  1262. },
  1263. getXuserName(id) {
  1264. if (id <= 0) {
  1265. return ''
  1266. }
  1267. var name = ''
  1268. if (
  1269. this.admin_users == null ||
  1270. typeof this.admin_users.length === 'undefined'
  1271. ) {
  1272. return name
  1273. }
  1274. var leng = this.admin_users.length
  1275. if (leng == 0) {
  1276. return name
  1277. }
  1278. for (let index = 0; index < leng; index++) {
  1279. if (this.admin_users[index].id == id) {
  1280. name = this.admin_users[index].name
  1281. break
  1282. }
  1283. }
  1284. return name
  1285. },
  1286. getAdviceContent(row, isChild) {
  1287. let tempSingleDoseDesc = ''
  1288. let tempDrugSpecDesc = ''
  1289. let tempPrescribingNumberDesc = ''
  1290. if (row.prescribing_number) {
  1291. tempPrescribingNumberDesc =
  1292. row.prescribing_number + '' + row.prescribing_number_unit
  1293. }
  1294. if (row.single_dose) {
  1295. if (this.template_id != 6) {
  1296. tempSingleDoseDesc =
  1297. ' 单次用量 ' + ' ' + row.single_dose + '' + row.single_dose_unit
  1298. } else {
  1299. tempSingleDoseDesc = row.single_dose ? row.single_dose : '' + '' + row.single_dose_unit ? row.single_dose_unit : ''
  1300. }
  1301. }
  1302. if (row.advice_desc) {
  1303. tempDrugSpecDesc = '(' + row.advice_desc + row.drug_spec_unit + ')'
  1304. }
  1305. if (isChild == 1) {
  1306. // 不是子药
  1307. // console.log(tempDrugSpecDesc)
  1308. // console.log(tempPrescribingNumberDesc)
  1309. // console.log(tempSingleDoseDesc)
  1310. // console.log(11,row.delivery_way)
  1311. // console.log(22,row.execution_frequency)
  1312. return (
  1313. row.advice_name +
  1314. tempDrugSpecDesc +
  1315. ' ' +
  1316. tempPrescribingNumberDesc +
  1317. tempSingleDoseDesc +
  1318. ' ' +
  1319. row.delivery_way +
  1320. ' ' +
  1321. row.execution_frequency
  1322. )
  1323. } else {
  1324. // 是子药
  1325. return (
  1326. row.advice_name +
  1327. tempDrugSpecDesc +
  1328. ' ' +
  1329. tempPrescribingNumberDesc +
  1330. tempSingleDoseDesc
  1331. )
  1332. }
  1333. },
  1334. handleSelectionChange(val){
  1335. console.log("val88888888",val)
  1336. this.selecting_schs = val;
  1337. this.is_status = 1
  1338. },
  1339. handleSelectionChangeOne(val){
  1340. this.selecting_schs = val;
  1341. this.is_status = 1
  1342. console.log("val32323323223",val)
  1343. },
  1344. querySearchAsync(keyword, cb) {
  1345. let key = '';
  1346. if (keyword != undefined) {
  1347. key = keyword
  1348. }
  1349. let searchArray = []
  1350. PostSearch(key).then(response => {
  1351. if (response.data.state == 1) {
  1352. searchArray = response.data.data.patient
  1353. console.log('searcharrya', searchArray)
  1354. cb(searchArray)
  1355. }
  1356. })
  1357. return searchArray
  1358. },
  1359. handleSelect(val) {
  1360. this.patient_id = val.id
  1361. this.requestSchedualDoctors(this.time)
  1362. },
  1363. toSeach(){
  1364. this.patient_id = 0
  1365. this.requestSchedualDoctors(this.time)
  1366. },
  1367. toExcution(){
  1368. if(this.selecting_schs.length ==0){
  1369. this.$message.error("请勾选需要执行的医嘱")
  1370. return false
  1371. }
  1372. console.log("hhhahhhahhh",this.is_status)
  1373. if(this.is_status == 1){
  1374. this.execTimeDialogVisible = true
  1375. }
  1376. if(this.is_status == 2){
  1377. this.execTimeDialogVisibleOne = true
  1378. }
  1379. },
  1380. excutionDoctorAdvice(){
  1381. if (this.execTime.length == 0) {
  1382. this.$message.error('请选择执行时间!')
  1383. return false
  1384. }
  1385. var execTime = Math.round(new Date(this.execTime).getTime() / 1000)
  1386. var ids=[]
  1387. if(this.selecting_schs!=null && this.selecting_schs.length >0){
  1388. for(let i=0;i<this.selecting_schs.length;i++){
  1389. ids.push(this.selecting_schs[i].patient_id)
  1390. }
  1391. }
  1392. var str = ids.join(",")
  1393. var params = {
  1394. str:str,
  1395. advice_date: moment(this.time).format('YYYY-MM-DD'),
  1396. is_open:this.config.is_open,
  1397. exec_time:execTime
  1398. }
  1399. console.log("params232322323wo",params)
  1400. this.exceLoading = true
  1401. excutionDoctorAdvice(params).then(response=>{
  1402. if(response.data.state == 1){
  1403. if(response.data.data.msg == 2){
  1404. var drug_name = response.data.data.drug.drug_name
  1405. var dose = response.data.data.drug.dose
  1406. var dose_unit = response.data.data.drug.dose_unit
  1407. var min_number = response.data.data.drug.min_number
  1408. var max_unit = response.data.data.drug.max_unit
  1409. var min_unit = response.data.data.drug.min_unit
  1410. var str = drug_name + " "+dose+dose_unit +"*"+min_number +max_unit +"/"+min_unit
  1411. this.$message.error(str +"库存不足,执行失败!")
  1412. this.exceLoading = false
  1413. this.execTimeDialogVisible = false
  1414. this.requestSchedualDoctors(this.time)
  1415. }
  1416. if(response.data.data.msg == 3){
  1417. this.$message.error("执行人和核对人不能是同一个人,执行失败!")
  1418. }
  1419. }
  1420. })
  1421. },
  1422. toCheck(){
  1423. if(this.selecting_schs.length ==0){
  1424. this.$message.error("请勾选需要执行的医嘱")
  1425. return false
  1426. }
  1427. var ids=[]
  1428. if(this.selecting_schs!=null && this.selecting_schs.length >0){
  1429. for(let i=0;i<this.selecting_schs.length;i++){
  1430. ids.push(this.selecting_schs[i].patient_id)
  1431. }
  1432. }
  1433. var str = ids.join(",")
  1434. var params = {
  1435. str:str,
  1436. advice_date: moment(this.time).format('YYYY-MM-DD'),
  1437. is_open:this.config.is_open,
  1438. }
  1439. checkNewDoctorAdvice(params).then(response=>{
  1440. if(response.data.state == 1){
  1441. if(response.data.data.msg == 2){
  1442. var advice = response.data.data.advice
  1443. this.$message.error(advice.advice_name +"执行人和核对人不能是同一个人,核对失败!")
  1444. this.requestSchedualDoctors(this.time)
  1445. }else{
  1446. this.$message.success("核对成功!")
  1447. this.requestSchedualDoctors(this.time)
  1448. }
  1449. }
  1450. })
  1451. },
  1452. toSettle(){
  1453. if(this.selecting_schs.length ==0){
  1454. this.$message.error("请勾选需要执行的医嘱")
  1455. return false
  1456. }
  1457. var ids=[]
  1458. if(this.selecting_schs!=null && this.selecting_schs.length >0){
  1459. for(let i=0;i<this.selecting_schs.length;i++){
  1460. ids.push(this.selecting_schs[i].patient_id)
  1461. }
  1462. }
  1463. var str = ids.join(",")
  1464. var params = {
  1465. str:str,
  1466. advice_date: moment(this.time).format('YYYY-MM-DD'),
  1467. is_open:this.config.is_open,
  1468. }
  1469. settleNewDoctorAdvice(params).then(response=>{
  1470. if(response.data.state == 1){
  1471. this.$message.success("收费成功!")
  1472. this.requestSchedualDoctors(this.time)
  1473. }
  1474. })
  1475. },
  1476. selectSortType(id){
  1477. this.is_sort = id
  1478. this.requestSchedualDoctors(this.time);
  1479. },
  1480. handleRowClick (row) {
  1481. },
  1482. tableRowClassName({row, rowIndex}) {
  1483. row.index = rowIndex
  1484. if(row.index = rowIndex){
  1485. return 'success-row'
  1486. }
  1487. },
  1488. handleCurrentChangeList(row){
  1489. this.selecting_schs.push(row)
  1490. this.current_row= row
  1491. this.is_status = 2
  1492. },
  1493. excutionDoctorAdviceOne(){
  1494. if(this.current_row.execution_state == 1){
  1495. this.$message.error("所选医嘱已核对,无需再核对!")
  1496. return false
  1497. }
  1498. if (this.execTime.length == 0) {
  1499. this.$message.error('请选择执行时间!')
  1500. return false
  1501. }
  1502. var execTime = Math.round(new Date(this.execTime).getTime() / 1000)
  1503. var params= {
  1504. advice_id:this.current_row.id,
  1505. advice_date: moment(this.time).format('YYYY-MM-DD'),
  1506. exec_time:execTime,
  1507. }
  1508. excutionDoctorAdviceById(params).then(response=>{
  1509. if(response.data.state == 1){
  1510. if(response.data.data.msg == 2){
  1511. var drug_name = response.data.data.drug.drug_name
  1512. var dose = response.data.data.drug.dose
  1513. var dose_unit = response.data.data.drug.dose_unit
  1514. var min_number = response.data.data.drug.min_number
  1515. var max_unit = response.data.data.drug.max_unit
  1516. var min_unit = response.data.data.drug.min_unit
  1517. var str = drug_name + " "+dose+dose_unit +"*"+min_number +max_unit +"/"+min_unit
  1518. this.$message.error(str +"库存不足,执行失败!")
  1519. this.exceLoading = false
  1520. this.execTimeDialogVisibleOne = false
  1521. this.requestSchedualDoctors(this.time)
  1522. }
  1523. if(response.data.data.msg == 1){
  1524. var msg = response.data.data.msg
  1525. this.$message.success("执行成功!")
  1526. this.exceLoading = false
  1527. this.execTimeDialogVisibleOne = false
  1528. this.requestSchedualDoctors(this.time)
  1529. }
  1530. if(response.data.data.msg == 3){
  1531. this.$message.error("执行人与核对人不能是同一个人,执行失败!")
  1532. }
  1533. }
  1534. })
  1535. },
  1536. toStatic() {
  1537. this.tableList = []
  1538. var params = {
  1539. schedule_type:this.schedule_type,
  1540. partion_type:this.partion_type,
  1541. selected_date: moment(this.time).format('YYYY-MM-DD'),
  1542. }
  1543. console.log("params2332232wo",params)
  1544. getDialysisAdviceToday(params).then(response=>{
  1545. if(response.data.state == 1){
  1546. var doctorList = []
  1547. var druglist = response.data.data.drug
  1548. this.druglist = druglist
  1549. this.startdialogVisible = true
  1550. var list = response.data.data.list
  1551. var config = response.data.data.config
  1552. console.log("dcotor---------------",this.doctorList)
  1553. if(list!=null && list.length > 0){
  1554. for(let i=0;i<list.length;i++){
  1555. for(let j=0;j<list[i].xt_doctor_advice.length;j++){
  1556. doctorList.push(list[i].xt_doctor_advice[j])
  1557. }
  1558. }
  1559. }
  1560. if(config.is_open!=1){
  1561. if(doctorList!=null && doctorList.length > 0){
  1562. let dataInfo = {}
  1563. doctorList.forEach((item, index) => {
  1564. let { advice_name } = item
  1565. if (!dataInfo[advice_name]) {
  1566. dataInfo[advice_name] = {
  1567. advice_name:item.advice_name,
  1568. child: [],
  1569. count:0,
  1570. drug_id:item.drug_id,
  1571. specification_name:item.advice_desc +item.drug_spec_unit,
  1572. patient_id:item.patient_id,
  1573. }
  1574. }
  1575. })
  1576. let arr = Object.values(dataInfo)
  1577. // console.log("arr23332323232",arr)
  1578. if(arr.length > 0){
  1579. for(let i=0;i<doctorList.length;i++){
  1580. for(let j=0;j<arr.length;j++){
  1581. if(doctorList[i].advice_name == arr[j].advice_name){
  1582. arr[j].child.push(doctorList[i])
  1583. }
  1584. }
  1585. }
  1586. }
  1587. this.tableList = []
  1588. for(let i=0;i<list.length;i++){
  1589. for(let j=0;j<arr.length;j++){
  1590. if(list[i].patient_id == arr[j].patient_id){
  1591. this.tableList.push(arr[j])
  1592. }
  1593. }
  1594. }
  1595. }
  1596. }
  1597. var his_doctor_advice = []
  1598. for(let i=0;i<list.length;i++){
  1599. for(let j=0;j<list[i].his_doctor_advice.length;j++){
  1600. his_doctor_advice.push(list[i].his_doctor_advice[j])
  1601. }
  1602. }
  1603. console.log("his_doctor_advice",his_doctor_advice)
  1604. var newHisArr = []
  1605. for(let i=0;i<his_doctor_advice.length;i++){
  1606. his_doctor_advice[i].count_one = 0
  1607. if(his_doctor_advice[i].prescribing_number_unit == his_doctor_advice[i].drug.max_unit){
  1608. his_doctor_advice[i].prescribing_number = parseInt(his_doctor_advice[i].prescribing_number) * his_doctor_advice[i].drug.min_number
  1609. his_doctor_advice[i].count_one = parseInt(his_doctor_advice[i].prescribing_number) * his_doctor_advice[i].drug.min_number
  1610. }
  1611. }
  1612. for(let i=0;i<his_doctor_advice.length;i++){
  1613. for(let j=0;j<druglist.length;j++){
  1614. if(his_doctor_advice[i].drug_id == druglist[j].id){
  1615. newHisArr.push(his_doctor_advice[i])
  1616. }
  1617. }
  1618. }
  1619. console.log("下盘子3223323223",newHisArr)
  1620. if(config.is_open == 1){
  1621. if(newHisArr!=null && newHisArr.length > 0){
  1622. let dataInfoOne = {}
  1623. newHisArr.forEach((item, index) => {
  1624. let { advice_name } = item
  1625. if (!dataInfoOne[advice_name]) {
  1626. dataInfoOne[advice_name] = {
  1627. advice_name:item.advice_name,
  1628. child: [],
  1629. count:0,
  1630. specification_name:this.getSpecification(item.drug_id),
  1631. drug_id:item.drug_id,
  1632. patient_id:item.patient_id,
  1633. min_number:item.drug.min_number,
  1634. max_unit:item.drug.max_unit,
  1635. min_unit:item.drug.min_unit
  1636. }
  1637. }
  1638. })
  1639. let hisarr = Object.values(dataInfoOne)
  1640. console.log("hisarr233232233232",hisarr)
  1641. if(hisarr.length > 0){
  1642. for(let i=0;i<newHisArr.length;i++){
  1643. for(let j=0;j<hisarr.length;j++){
  1644. if(newHisArr[i].drug_id == hisarr[j].drug_id){
  1645. hisarr[j].child.push(newHisArr[i])
  1646. }
  1647. }
  1648. }
  1649. }
  1650. console.log("hisarr",hisarr)
  1651. this.tableList = []
  1652. this.tableList = hisarr
  1653. }
  1654. console.log("中国人民解放军",this.tableList)
  1655. }
  1656. }
  1657. })
  1658. },
  1659. toStaticOne() {
  1660. this.tableList = []
  1661. var params = {
  1662. schedule_type:this.schedule_type,
  1663. partion_type:this.partion_type,
  1664. selected_date: moment(this.time).format('YYYY-MM-DD'),
  1665. }
  1666. getDialysisAdviceToday(params).then(response=>{
  1667. if(response.data.state == 1){
  1668. var doctorList = []
  1669. var druglist = response.data.data.drug
  1670. this.druglist = druglist
  1671. this.startdialogVisibleOne = true
  1672. var list = response.data.data.list
  1673. var config = response.data.data.config
  1674. this.adminUserList = response.data.data.doctorList
  1675. if(list!=null && list.length > 0){
  1676. for(let i=0;i<list.length;i++){
  1677. for(let j=0;j<list[i].xt_doctor_advice.length;j++){
  1678. list[i].xt_doctor_advice[j].mode_id = list[i].mode_id
  1679. list[i].xt_doctor_advice[j].zone_name = list[i].device_number.zone.name
  1680. list[i].xt_doctor_advice[j].sort = list[i].device_number.zone.sort
  1681. doctorList.push(list[i].xt_doctor_advice[j])
  1682. }
  1683. }
  1684. }
  1685. if(config.is_open!=1){
  1686. if(doctorList!=null && doctorList.length > 0){
  1687. let dataInfo = {}
  1688. doctorList.forEach((item, index) => {
  1689. item.advice_name = item.advice_name.replace(/\s/g,"")
  1690. let { advice_name } = item
  1691. if (!dataInfo[advice_name]) {
  1692. dataInfo[advice_name] = {
  1693. advice_name:item.advice_name,
  1694. child: [],
  1695. count:0,
  1696. execution_staff:item.execution_staff,
  1697. specification_name:item.advice_desc +item.drug_spec_unit,
  1698. patient_id:item.patient_id,
  1699. }
  1700. }
  1701. })
  1702. let arr = Object.values(dataInfo)
  1703. for(let i=0;i<arr.length;i++){
  1704. for(let j=0;j<doctorList.length;j++){
  1705. if(arr[i].advice_name == doctorList[j].advice_name){
  1706. arr[i].child.push(doctorList[j])
  1707. }
  1708. }
  1709. }
  1710. this.tabHead = arr
  1711. console.log("tabHead",this.tabHead)
  1712. }
  1713. if(doctorList!=null && doctorList.length > 0){
  1714. let dataInfoOne = {}
  1715. doctorList.forEach((item, index) => {
  1716. let { execution_staff } = item
  1717. if (!dataInfoOne[execution_staff]) {
  1718. dataInfoOne[execution_staff] = {
  1719. execution_staff:item.execution_staff,
  1720. child: [],
  1721. count:0,
  1722. sort:item.sort,
  1723. }
  1724. }
  1725. })
  1726. let newArr = Object.values(dataInfoOne)
  1727. if(newArr!=null && newArr.length >0){
  1728. for(let i=0;i<newArr.length;i++){
  1729. for(let j=0;j<doctorList.length;j++){
  1730. if(newArr[i].execution_staff == doctorList[j].execution_staff){
  1731. newArr[i].child.push(doctorList[j])
  1732. }
  1733. }
  1734. }
  1735. }
  1736. var newList = newArr.sort(this.compareList('sort'))
  1737. if(newList!=null && newList.length >0){
  1738. for(let i=0;i<newList.length;i++){
  1739. newList[i].is_total = 1
  1740. }
  1741. }
  1742. var obj = {is_total:0,count:0,execution_staff:0,child:[]}
  1743. newList.push(obj)
  1744. this.tableDataList = newList
  1745. console.log("999999999999999999-------",this.tableDataList)
  1746. }
  1747. }
  1748. }
  1749. })
  1750. },
  1751. getSpecification(id){
  1752. var specification_name = ""
  1753. for(let i=0;i<this.druglist.length;i++){
  1754. if(id == this.druglist[i].id){
  1755. 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
  1756. }
  1757. }
  1758. return specification_name
  1759. },
  1760. getCount(val){
  1761. var count = 0
  1762. if(val!=null && val.length > 0){
  1763. for(let i=0;i<val.length;i++){
  1764. count += parseInt(val[i].prescribing_number)
  1765. }
  1766. }
  1767. if(count > 0){
  1768. return count
  1769. }else{
  1770. return 0
  1771. }
  1772. },
  1773. getHisCount(val,max_unit,min_unit,min_number){
  1774. var total = 0
  1775. var max_str = "";
  1776. var min_str = "";
  1777. for(let i=0;i<val.length;i++){
  1778. total+=parseInt(val[i].prescribing_number)
  1779. }
  1780. if (total < min_number) {
  1781. min_str = total + min_unit;
  1782. }
  1783. if (total == 0) {
  1784. min_str = "";
  1785. max_str = "";
  1786. }
  1787. if (total >= min_number) {
  1788. if (parseInt(total / min_number) != 0) {
  1789. max_str = parseInt(total / min_number) + max_unit;
  1790. }
  1791. if (total % min_number != 0) {
  1792. min_str = (total % min_number) + min_unit;
  1793. }
  1794. }
  1795. return max_str + min_str;
  1796. },
  1797. toPrintOne(){
  1798. var schedule_date = moment(this.time).format('YYYY-MM-DD')
  1799. 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})
  1800. },
  1801. toPrintTwo(){
  1802. var schedule_date = moment(this.time).format('YYYY-MM-DD')
  1803. this.$router.push({path:"/dialysis/doctorNewAdviceStaticPrint?schedule_type="+this.schedule_type+"&partion_type="+this.partion_type+"&schedule_date="+schedule_date+"&is_open="+this.config.is_open})
  1804. },
  1805. toExportListOne(){
  1806. import('@/vendor/Export2Excel').then(excel => {
  1807. if(this.tableList!=null && this.tableList.length > 0){
  1808. for(let i=0;i<this.tableList.length;i++){
  1809. this.tableList[i].index = i+1
  1810. if(this.config.is_open == 1){
  1811. 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)
  1812. }
  1813. if(this.config.is_open!=1){
  1814. this.tableList[i].total_count = this.getCount(this.tableList[i].child)
  1815. }
  1816. }
  1817. }
  1818. const tHeader = ['序号','药品名称','规格','数量']
  1819. const filterVal = ['index','advice_name','specification_name','total_count']
  1820. const data = this.formatJson(filterVal, this.tableList)
  1821. excel.export_json_to_excel({
  1822. header: tHeader,
  1823. data,
  1824. filename: '药品统计'
  1825. })
  1826. this.downloadLoading = false
  1827. })
  1828. },
  1829. formatJson(filterVal, jsonData) {
  1830. return jsonData.map(v => filterVal.map(j => v[j]));
  1831. },
  1832. changeScheduleType(){
  1833. this.tableList = []
  1834. this.toStatic()
  1835. },
  1836. changePartionType(){
  1837. this.tableList = []
  1838. this.toStatic()
  1839. },
  1840. changeScheduleTypeOne(){
  1841. this.tableDataList = []
  1842. this.toStaticOne()
  1843. },
  1844. changePartionTypeOne(){
  1845. this.tableDataList = []
  1846. this.toStaticOne()
  1847. },
  1848. getModeId(val){
  1849. if(val!=null && val.length > 0){
  1850. let dataInfo = {}
  1851. val.forEach((item, index) => {
  1852. let { patient_id } = item
  1853. if (!dataInfo[patient_id]) {
  1854. dataInfo[patient_id] = {
  1855. patient_id:item.patient_id,
  1856. child: [],
  1857. count:0,
  1858. mode_id:item.mode_id,
  1859. }
  1860. }
  1861. })
  1862. let newArr = Object.values(dataInfo)
  1863. if(newArr!=null && newArr.length >0){
  1864. let dataInfo = {}
  1865. newArr.forEach((item, index) => {
  1866. let { mode_id } = item
  1867. if (!dataInfo[mode_id]) {
  1868. dataInfo[mode_id] = {
  1869. mode_id:item.mode_id,
  1870. child: [],
  1871. count:0,
  1872. }
  1873. }
  1874. })
  1875. let hisNewArr = Object.values(dataInfo)
  1876. if(hisNewArr!=null && hisNewArr.length >0){
  1877. for(let i=0;i<hisNewArr.length;i++){
  1878. for(let j=0;j<newArr.length;j++){
  1879. if(hisNewArr[i].mode_id == newArr[j].mode_id){
  1880. hisNewArr[i].child.push(newArr[j])
  1881. }
  1882. }
  1883. }
  1884. }
  1885. var str = ""
  1886. for(let i=0;i<hisNewArr.length;i++){
  1887. if(hisNewArr[i].mode_id == 1){
  1888. hisNewArr[i].mode_id = "HD"
  1889. }
  1890. if(hisNewArr[i].mode_id == 2){
  1891. hisNewArr[i].mode_id = "HDF"
  1892. }
  1893. if(hisNewArr[i].mode_id == 3){
  1894. hisNewArr[i].mode_id = "HD+HP"
  1895. }
  1896. if(hisNewArr[i].mode_id == 4){
  1897. hisNewArr[i].mode_id = "HP"
  1898. }
  1899. if(hisNewArr[i].mode_id == 5){
  1900. hisNewArr[i].mode_id = "HF"
  1901. }
  1902. if(hisNewArr[i].mode_id == 6){
  1903. hisNewArr[i].mode_id = "SCUF"
  1904. }
  1905. if(hisNewArr[i].mode_id == 7){
  1906. hisNewArr[i].mode_id = "IUF"
  1907. }
  1908. if(hisNewArr[i].mode_id == 8){
  1909. hisNewArr[i].mode_id = "HFHD"
  1910. }
  1911. if(hisNewArr[i].mode_id == 9){
  1912. hisNewArr[i].mode_id = "HFHD+HP"
  1913. }
  1914. if(hisNewArr[i].mode_id == 10){
  1915. hisNewArr[i].mode_id = "PHF"
  1916. }
  1917. if(hisNewArr[i].mode_id == 11){
  1918. hisNewArr[i].mode_id = "HFR"
  1919. }
  1920. if(hisNewArr[i].mode_id == 12){
  1921. hisNewArr[i].mode_id = "HDF+HP"
  1922. }
  1923. if(hisNewArr[i].mode_id == 13){
  1924. hisNewArr[i].mode_id = "CRRT"
  1925. }
  1926. if(hisNewArr[i].mode_id == 14){
  1927. hisNewArr[i].mode_id = "腹水回输"
  1928. }
  1929. if(hisNewArr[i].mode_id == 15){
  1930. hisNewArr[i].mode_id = "IUF+HD"
  1931. }
  1932. if(hisNewArr[i].mode_id == 20){
  1933. hisNewArr[i].mode_id = "UF"
  1934. }
  1935. if(hisNewArr[i].mode_id == 21){
  1936. hisNewArr[i].mode_id = "HD+"
  1937. }
  1938. if(hisNewArr[i].mode_id == 22){
  1939. hisNewArr[i].mode_id = "血浆胆红素吸附+HDF"
  1940. }
  1941. if(hisNewArr[i].mode_id == 23){
  1942. hisNewArr[i].mode_id = "血浆胆红素吸附"
  1943. }
  1944. if(hisNewArr[i].mode_id == 24){
  1945. hisNewArr[i].mode_id = "I-HDF"
  1946. }
  1947. if(hisNewArr[i].mode_id == 25){
  1948. hisNewArr[i].mode_id = "HD高通"
  1949. }
  1950. if(hisNewArr[i].mode_id == 26){
  1951. hisNewArr[i].mode_id = "CVVH"
  1952. }
  1953. if(hisNewArr[i].mode_id == 27){
  1954. hisNewArr[i].mode_id = "CVVHD"
  1955. }
  1956. if(hisNewArr[i].mode_id == 28){
  1957. hisNewArr[i].mode_id = "CVVHDF"
  1958. }
  1959. if(hisNewArr[i].mode_id == 29){
  1960. hisNewArr[i].mode_id = "PE"
  1961. }
  1962. if(hisNewArr[i].mode_id == 30){
  1963. hisNewArr[i].mode_id = "血浆胆红素吸附+HP"
  1964. }
  1965. if(hisNewArr[i].mode_id == 31){
  1966. hisNewArr[i].mode_id = "HPD"
  1967. }
  1968. if(hisNewArr[i].mode_id == 32){
  1969. hisNewArr[i].mode_id = "HDP"
  1970. }
  1971. str += hisNewArr[i].mode_id +"("+hisNewArr[i].child.length+")" +"\n"
  1972. }
  1973. return str
  1974. }
  1975. // return newArr.length
  1976. }
  1977. },
  1978. getDrugCount(val,advice_name){
  1979. if(val!=null){
  1980. for(let i=0;i<val.length;i++){
  1981. val[i].advice_name = val[i].advice_name.replace(/\s/g,"")
  1982. }
  1983. }
  1984. if(val!=null && val.length >0){
  1985. let dataInfo = {}
  1986. val.forEach((item, index) => {
  1987. let { advice_name } = item
  1988. if (!dataInfo[advice_name]) {
  1989. dataInfo[advice_name] = {
  1990. advice_name:item.advice_name,
  1991. child: [],
  1992. count:0,
  1993. }
  1994. }
  1995. })
  1996. let newArr = Object.values(dataInfo)
  1997. if(newArr!=null && newArr.length >0){
  1998. for(let i=0;i<newArr.length;i++){
  1999. for(let j=0;j<val.length;j++){
  2000. if(newArr[i].advice_name == val[j].advice_name){
  2001. newArr[i].child.push(val[j])
  2002. }
  2003. }
  2004. }
  2005. }
  2006. var total = 0
  2007. var newHisArr =[]
  2008. if(newArr!=null && newArr.length >0){
  2009. for(let i=0;i<newArr.length;i++){
  2010. if(newArr[i].advice_name == advice_name){
  2011. newHisArr.push(newArr[i])
  2012. }
  2013. }
  2014. }
  2015. if(newHisArr!=null && newHisArr.length>0){
  2016. for(let i=0;i<newHisArr.length;i++){
  2017. for(let j=0;j<newHisArr[i].child.length;j++){
  2018. total += parseInt(newHisArr[i].child[j].prescribing_number)
  2019. }
  2020. }
  2021. }
  2022. return total
  2023. }
  2024. },
  2025. getAdminUserName(id){
  2026. var name = ""
  2027. for(let i=0;i<this.adminUserList.length;i++){
  2028. if(id == this.adminUserList[i].id){
  2029. name = this.adminUserList[i].name
  2030. }
  2031. }
  2032. return name
  2033. },
  2034. getZoneName(val){
  2035. var zone_name = ""
  2036. if(val!=null && val.length >0){
  2037. zone_name = val[0].zone_name
  2038. }
  2039. return zone_name
  2040. },
  2041. compareList: function (k) {
  2042. return function (a, b) {
  2043. var M = a[k]
  2044. var N = b[k]
  2045. return M - N // 从低向高排
  2046. // return N - M; // 从高向低排
  2047. }
  2048. },
  2049. getSummaries(param) {
  2050. const { columns, data } = param;
  2051. const sums = [];
  2052. columns.forEach((column, index) => {
  2053. console.log("index---------",index)
  2054. if (index === 0) {
  2055. sums[index] = '总数';
  2056. return;
  2057. }
  2058. if(index > 2){
  2059. const values = data.map(item => item[column.property]);
  2060. console.log("data0----------------",data)
  2061. }
  2062. });
  2063. return sums;
  2064. },
  2065. getAllSumCount(advice_name){
  2066. var hisNewArr =[]
  2067. if(this.tabHead.length!=null && this.tabHead.length >0){
  2068. for(let i=0;i<this.tabHead.length;i++){
  2069. if(this.tabHead[i].advice_name == advice_name){
  2070. hisNewArr.push(this.tabHead[i])
  2071. }
  2072. }
  2073. }
  2074. var total = 0
  2075. if(hisNewArr!=null && hisNewArr.length > 0){
  2076. for(let i=0;i<hisNewArr.length;i++){
  2077. for(let j=0;j<hisNewArr[i].child.length;j++){
  2078. total += parseInt(hisNewArr[i].child[j].prescribing_number)
  2079. }
  2080. }
  2081. }
  2082. if (total > 0) {
  2083. return total
  2084. }else{
  2085. return 0
  2086. }
  2087. },
  2088. getTimeSix(val) {
  2089. if(val == ""){
  2090. return ""
  2091. }else {
  2092. return uParseTime(val, '{y}-{m}-{d}')
  2093. }
  2094. },
  2095. toJiao(){
  2096. GetMobileScheduleList().then(response=>{
  2097. if(response.data.state == 1){
  2098. var schedule = response.data.data.schedule
  2099. console.log("schedule---------------",schedule)
  2100. var arr = []
  2101. for(let i=0;i<schedule.length;i++){
  2102. if(schedule[i].monitor_record.ultrafiltration_volume!=schedule[i].xt_assesment_after_dislysis.actual_ultrafiltration){
  2103. arr.push(schedule[i])
  2104. }
  2105. }
  2106. import('@/vendor/Export2Excel').then(excel => {
  2107. if(arr!=null && arr.length > 0){
  2108. for(let i=0;i<arr.length;i++){
  2109. arr[i].patient_name = arr[i].patient.name
  2110. arr[i].target_ultrafiltration = arr[i].dialysis_prescription.target_ultrafiltration
  2111. arr[i].ultrafiltration_volume = arr[i].monitor_record.ultrafiltration_volume
  2112. arr[i].actual_ultrafiltration = arr[i].xt_assesment_after_dislysis.actual_ultrafiltration
  2113. arr[i].start_time = this.getTimeSix(arr[i].schedule_date)
  2114. }
  2115. }
  2116. const tHeader = ['序号','日期','患者姓名','目标超滤量','监测超滤量','实际超滤量']
  2117. const filterVal = ['index','start_time','patient_name','target_ultrafiltration','ultrafiltration_volume','actual_ultrafiltration']
  2118. const data = this.formatJson(filterVal, arr)
  2119. excel.export_json_to_excel({
  2120. header: tHeader,
  2121. data,
  2122. filename: '监测数据统计'
  2123. })
  2124. })
  2125. }
  2126. })
  2127. }
  2128. },
  2129. components: {
  2130. BreadCrumb
  2131. }
  2132. };
  2133. </script>
  2134. <style rel="stylesheet/scss" lang="scss" scoped>
  2135. .app-container {
  2136. // margin: 20px;
  2137. font-size: 15px;
  2138. .filter-container {
  2139. padding-bottom: 5px;
  2140. }
  2141. .cqd-dataTitle {
  2142. color: #303133;
  2143. font-size: 14px;
  2144. border-bottom: 2px #e4e7ed solid;
  2145. height: 36px;
  2146. line-height: 36px;
  2147. margin: 0 0 25px 0;
  2148. position: relative;
  2149. }
  2150. .cqd-dataTitle::before {
  2151. position: absolute;
  2152. left: 0;
  2153. bottom: -2px;
  2154. content: "";
  2155. width: 42px;
  2156. height: 2px;
  2157. background: #409eff;
  2158. }
  2159. .search-component {
  2160. width: 500px;
  2161. .searchBox {
  2162. width: 300px;
  2163. height: 36px;
  2164. line-height: 36px;
  2165. padding-left: 15px;
  2166. border: 1px #dcdfe6 solid;
  2167. border-right: none;
  2168. outline: none;
  2169. float: left;
  2170. border-radius: 6px 0 0 6px;
  2171. font-size: 14px;
  2172. color: #333;
  2173. background: #fff;
  2174. box-shadow: 3px 3px 4px rgba(135, 135, 135, 0.05);
  2175. }
  2176. .searchBtn {
  2177. background-color: #409eff;
  2178. color: #fff;
  2179. font-size: 15px;
  2180. text-align: center;
  2181. height: 36px;
  2182. line-height: 36px;
  2183. float: left;
  2184. outline: none;
  2185. width: 70px;
  2186. border: none;
  2187. border-radius: 0 6px 6px 0;
  2188. font-family: "Microsoft Yahei";
  2189. cursor: pointer;
  2190. }
  2191. }
  2192. .amount {
  2193. font-weight: normal;
  2194. padding: 10px 0 0 0;
  2195. color: #606266;
  2196. font-size: 14px;
  2197. span {
  2198. color: #ef2525;
  2199. font-family: "Arial";
  2200. padding: 0 2px;
  2201. }
  2202. }
  2203. .el-table td .cell{
  2204. white-space: pre-wrap;
  2205. }
  2206. }
  2207. .el-table td,
  2208. .el-table th.is-leaf,
  2209. .el-table--border,
  2210. .el-table--group {
  2211. border-color: #d0d3da;
  2212. }
  2213. .el-table--border::after,
  2214. .el-table--group::after,
  2215. .el-table::before {
  2216. background-color: #d0d3da;
  2217. }
  2218. .el-checkbox__inner::after {
  2219. height: 10px;
  2220. left: 7px;
  2221. }
  2222. .el-checkbox__inner {
  2223. width: 20px;
  2224. height: 20px;
  2225. }
  2226. </style>