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

newDoctorAdvice.vue 85KB

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