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

DoctorAdviceDialog.vue 82KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585
  1. <template>
  2. <div class="doctor-advice-box">
  3. <el-dialog
  4. :title="add_title"
  5. :visible.sync="isLastOrNextVisible"
  6. width="1010px"
  7. @close="resetDialog"
  8. :modal-append-to-body="false"
  9. >
  10. <div class="txsj">
  11. <el-button
  12. round
  13. @click="openLast(3)"
  14. >上一方
  15. </el-button>
  16. <el-button
  17. round
  18. @click="openNext(4)"
  19. >下一方
  20. </el-button>
  21. </div>
  22. <!--<el-table-->
  23. <!--:header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)' }"-->
  24. <!--:data="other_doctor_advices"-->
  25. <!--border-->
  26. <!--style="width: 100%"-->
  27. <!--ref="advices_list"-->
  28. <!--@row-click="cellMouseEnter"-->
  29. <!--:row-class-name="tableRowClassName"-->
  30. <!--:span-method="objectSpanMethod"-->
  31. <!--:cell-class-name="adviceNameShow"-->
  32. <!--:modal-append-to-body="false"-->
  33. <!--highlight-current-row-->
  34. <!--@current-change="handleCurrentChange"-->
  35. <!--&gt;-->
  36. <!--<el-table-column prop="advice_name" min-width="50px" label="医嘱内容" align="center">-->
  37. <!--<template slot-scope="scope">-->
  38. <!--<span class="el-dropdown-link">-->
  39. <!--{{ getAdviceContent(scope.row, 1)-->
  40. <!--}}-->
  41. <!--<i class="el-icon-arrow-down el-icon&#45;&#45;right"></i>-->
  42. <!--</span>-->
  43. <!--</template>-->
  44. <!--</el-table-column>-->
  45. <!--</el-table>-->
  46. <el-form
  47. ref="adForm"
  48. :rules="adRules"
  49. :model="adForm"
  50. label-width="90px"
  51. >
  52. <el-row>
  53. <el-col :span="12">
  54. <el-form-item
  55. label="开始时间 :"
  56. required
  57. prop="other_start_time"
  58. style="width:100%;"
  59. >
  60. <el-date-picker
  61. type="datetime"
  62. format="yyyy-MM-dd HH:mm"
  63. value-format="yyyy-MM-dd HH:mm"
  64. placeholder="选择时间"
  65. v-model="adForm.other_start_time"
  66. style="width:100%;"
  67. ></el-date-picker>
  68. </el-form-item>
  69. </el-col>
  70. </el-row>
  71. </el-form>
  72. <div style='margin-bottom:20px;'>
  73. {{getContent()}}
  74. </div>
  75. <el-table
  76. :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)' }"
  77. :data="other_doctor_advices"
  78. border
  79. style="width: 100%"
  80. ref="advices_list"
  81. >
  82. <el-table-column
  83. label="医嘱内容"
  84. property="advice_name"
  85. style="word-break: keep-all;white-space:nowrap;"
  86. align="center"
  87. ></el-table-column>
  88. <el-table-column label="药品规格" align="center">
  89. <template slot-scope="scope">
  90. <span v-if="scope.row.advice_desc">{{ scope.row.advice_desc}}{{ scope.row.drug_spec_unit }}</span>
  91. </template>
  92. </el-table-column>
  93. <el-table-column
  94. label="开药数量"
  95. min-width="80"
  96. property="prescribing_number"
  97. align="center"
  98. >
  99. <template slot-scope="scope">
  100. <span v-if="scope.row.prescribing_number != 0">{{ scope.row.prescribing_number}}{{ scope.row.prescribing_number_unit }}</span>
  101. </template>
  102. </el-table-column>
  103. <el-table-column
  104. label="单次用量"
  105. min-width="80"
  106. property="single_dose"
  107. align="center"
  108. >
  109. <template slot-scope="scope">
  110. <span v-if="scope.row.single_dose != 0">{{ scope.row.single_dose}}{{ scope.row.single_dose_unit }}</span>
  111. </template>
  112. </el-table-column>
  113. <el-table-column
  114. label="给药途径"
  115. min-width="80"
  116. property="delivery_way"
  117. align="center"
  118. >
  119. <template slot-scope="scope">
  120. <span v-if="scope.row.parent_row == 0">{{scope.row.delivery_way}}</span>
  121. </template>
  122. </el-table-column>
  123. <el-table-column
  124. label="执行频率"
  125. min-width="80"
  126. property="execution_frequency"
  127. align="center"
  128. >
  129. <template slot-scope="scope">
  130. <span v-if="scope.row.parent_row == 0">{{scope.row.execution_frequency}}</span>
  131. </template>
  132. </el-table-column>
  133. </el-table>
  134. <div slot="footer" class="dialog-footer">
  135. <el-button @click="isLastOrNextVisible = false">取 消</el-button>
  136. <el-button type="primary" @click="AddNewAdvice('adForm')">设为本次临嘱</el-button>
  137. </div>
  138. </el-dialog>
  139. <el-dialog
  140. :title="title"
  141. :visible.sync="isVisibility"
  142. width="1010px"
  143. @close="resetDialog"
  144. :modal-append-to-body="false"
  145. >
  146. <div class="txsj">
  147. <el-button
  148. round
  149. @click="openLast(1)"
  150. >上一方
  151. </el-button>
  152. <el-button
  153. round
  154. @click="openNext(2)"
  155. >下一方
  156. </el-button>
  157. </div>
  158. <div class="txsj" v-show="showAdvicePanel">
  159. <el-button
  160. round
  161. @click="openGroupFrom"
  162. :loading="deleLoading"
  163. :disabled="!is_has_create"
  164. >新增医嘱
  165. </el-button>
  166. <el-button
  167. v-if="currentRow != null"
  168. round
  169. :disabled="!is_has_exce"
  170. @click="execAdvice"
  171. :loading="deleLoading"
  172. >执行医嘱
  173. </el-button>
  174. <el-button v-else disabled round @click="execAdvice" :loading="deleLoading">执行医嘱</el-button>
  175. <el-button
  176. v-if="currentRow != null"
  177. round
  178. :disabled="!is_has_check"
  179. @click="checkAdvice"
  180. :loading="deleLoading"
  181. >医嘱核对
  182. </el-button>
  183. <el-button v-else disabled round @click="checkAdvice" :loading="deleLoading">医嘱核对</el-button>
  184. <el-button
  185. v-if="groupSelectRow != null"
  186. :disabled="!is_has_modify && !is_has_modify_other"
  187. round
  188. @click="openEditGroupAdvice"
  189. :loading="deleLoading"
  190. >修改医嘱
  191. </el-button>
  192. <el-button v-else disabled round @click="openEditGroupAdvice" :loading="deleLoading">修改医嘱</el-button>
  193. <el-button
  194. v-if="groupSelectRow != null"
  195. :disabled="!is_has_del && !is_has_del_other"
  196. round
  197. @click="openDeleteGroupAdvice"
  198. :loading="deleLoading"
  199. >删除医嘱
  200. </el-button>
  201. <el-button v-else disabled round @click="openDeleteGroupAdvice" :loading="deleLoading">删除医嘱</el-button>
  202. <!--<el-button round @click="openNewChild" :loading="deleLoading">新增子药</el-button>-->
  203. </div>
  204. <!-- 医嘱列表 -->
  205. <!-- @row-click="cellMouseEnter" -->
  206. <!--&lt;!&ndash;:header-cell-style="{ backgroundColor: 'rgb(64, 158, 255)', color: 'white'}"&ndash;&gt;@current-change="selectRow"-->
  207. <el-table
  208. :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)' }"
  209. :data="doctor_advices"
  210. border
  211. style="width: 100%"
  212. v-show="showAdvicePanel"
  213. ref="advices_list"
  214. @row-click="cellMouseEnter"
  215. :row-class-name="tableRowClassName"
  216. :span-method="objectSpanMethod"
  217. :cell-class-name="adviceNameShow"
  218. :modal-append-to-body="false"
  219. highlight-current-row
  220. >
  221. <el-table-column prop="date" label="开嘱医生" align="center" min-width="26px">
  222. <template slot-scope="scope">
  223. <span>{{ getXuserName(scope.row.advice_doctor) }}</span>
  224. </template>
  225. </el-table-column>
  226. <el-table-column prop="start_time" label="开始时间" align="center" min-width="35px">
  227. <template slot-scope="scope">
  228. <span>
  229. {{scope.row.start_time | parseTime('{y}-{m}-{d} {h}:{i}')}}
  230. </span>
  231. </template>
  232. </el-table-column>
  233. <el-table-column prop="advice_name" min-width="50px" label="医嘱内容" align="center">
  234. <template slot-scope="scope">
  235. <el-dropdown trigger="click" v-if="scope.row.parent_id == 0">
  236. <span class="el-dropdown-link">
  237. {{ getAdviceContent(scope.row, 1)}}
  238. <i class="el-icon-arrow-down el-icon--right"></i>
  239. </span>
  240. <el-dropdown-menu slot="dropdown">
  241. <el-dropdown-item @click.native="openEdit(scope.$index, scope.row)">修改医嘱</el-dropdown-item>
  242. <el-dropdown-item @click.native="openDelete(scope.$index, scope.row)">删除医嘱</el-dropdown-item>
  243. <el-dropdown-item @click.native="openNewChildTwo(scope.$index, scope.row)">新增子药</el-dropdown-item>
  244. </el-dropdown-menu>
  245. </el-dropdown>
  246. <el-dropdown trigger="click" v-if="scope.row.parent_id > 0">
  247. <span class="el-dropdown-link">
  248. &emsp;{{ getAdviceContent(scope.row, 2)}}
  249. <i class="el-icon-arrow-down el-icon--right"></i>
  250. </span>
  251. <el-dropdown-menu slot="dropdown">
  252. <el-dropdown-item @click.native="openEdit(scope.$index, scope.row)">修改子药</el-dropdown-item>
  253. <el-dropdown-item @click.native="openDelete(scope.$index, scope.row)">删除子药</el-dropdown-item>
  254. </el-dropdown-menu>
  255. </el-dropdown>
  256. </template>
  257. </el-table-column>
  258. <el-table-column
  259. prop="execution_time"
  260. align="center"
  261. min-width="30px"
  262. label="执行时间"
  263. sortable
  264. >
  265. <template slot-scope="scope">
  266. <span v-if="scope.row.execution_time != 0">
  267. {{scope.row.start_time | parseTime('{m}-{d} {h}:{i}')}}
  268. </span>
  269. <span v-else></span>
  270. </template>
  271. </el-table-column>
  272. <el-table-column prop="execution_staff" align="center" min-width="30px" label="执行护士">
  273. <template slot-scope="scope">
  274. <span v-if="scope.row.parent_id == 0">
  275. {{getXuserName(scope.row.execution_staff)}}
  276. </span>
  277. <span v-else></span>
  278. </template>
  279. </el-table-column>
  280. <el-table-column
  281. v-if="template_id != 6"
  282. prop="checker"
  283. min-width="30px"
  284. align="center"
  285. label="核对人员"
  286. >
  287. <template slot-scope="scope">
  288. <span v-if="scope.row.parent_id == 0">
  289. {{getXuserName(scope.row.checker)}}
  290. </span>
  291. <span v-else></span>
  292. </template>
  293. </el-table-column>
  294. </el-table>
  295. <!-- 医嘱列表 end -->
  296. <!-- 新医嘱列表 -->
  297. <!-- <div class="orderTable">
  298. <table class="table">
  299. <tr @click="cancelAdviceSelect" class="tableTh">
  300. <th width="8%">开嘱医生</th>
  301. <th width="12%">开始时间</th>
  302. <th width="52%">医嘱内容</th>
  303. <th width="12%">执行时间</th>
  304. <th width="8%">执行护士</th>
  305. <th v-if="template_id != 6" width="8%">核对人员</th>
  306. </tr>
  307. <template v-for="(group, group_index) in advice_groups">
  308. <tr
  309. v-for="(advice, advice_index) in group.advices"
  310. :key="advice.id"
  311. :class="{ 'row-class-active': current_group_index == group_index && current_advice_index < 0 }"
  312. >
  313. <td
  314. v-if="advice_index == 0"
  315. :rowspan="group.advices.length"
  316. @click="selectGroupAdviceAction(group_index, -1, null,group)"
  317. >
  318. <span v-if="advice.parent_id==0">{{getXuserName(advice.advice_doctor)}}</span>
  319. <span v-else></span>
  320. </td>
  321. <td
  322. v-if="advice_index == 0"
  323. :rowspan="group.advices.length"
  324. @click="selectGroupAdviceAction(group_index, -1, null,group)"
  325. >
  326. <span>{{uParseTime(advice.start_time, '{m}-{d} {h}:{i}')}}</span>
  327. </td>
  328. <td
  329. :class="{ 'advice_content': advice.parent_id == 0, 'subadvice_content': advice.parent_id > 0, 'td-active':current_group_index == group_index && advice.is_selected == 1 }"
  330. @click="selectAdviceAction(group_index, advice_index, advice)"
  331. >
  332. <div class="txt">
  333. <span>{{advice.advice_name }}</span>
  334. <span
  335. v-if="advice.advice_desc"
  336. >({{ advice.advice_desc }}{{advice.drug_spec_unit}})</span>
  337. <span
  338. v-if="advice.prescribing_number"
  339. >&nbsp;&nbsp;{{advice.prescribing_number}}{{advice.prescribing_number_unit}}</span>
  340. <span
  341. v-if="advice.single_dose && template_id == 6"
  342. >{{advice.single_dose}}{{advice.single_dose_unit}}</span>
  343. <span
  344. v-if="advice.single_dose && template_id != 6"
  345. >单次用量{{advice.single_dose}}{{advice.single_dose_unit}}</span>
  346. <span v-if="advice.parent_id == 0">{{advice.delivery_way}}</span>
  347. <span v-if="advice.parent_id == 0">{{advice.execution_frequency}}</span>
  348. <span v-if="advice.parent_id == 0 && advice.remark.length > 0">({{advice.remark}})</span>
  349. </div>
  350. </td>
  351. <td
  352. :class="{'td-active':current_group_index == group_index && advice.is_selected == 1}"
  353. @click="selectAdviceAction(group_index,advice_index, advice)"
  354. >{{uParseTime(advice.execution_time, '{m}-{d} {h}:{i}')}}</td>
  355. <td
  356. :class="{'td-active':current_group_index == group_index && advice.is_selected == 1}"
  357. @click="selectAdviceAction(group_index,advice_index, advice)"
  358. >{{getXuserName(advice.execution_staff)}}</td>
  359. <td
  360. v-if="template_id != 6"
  361. :class="{'td-active':current_group_index == group_index && advice.is_selected == 1}"
  362. @click="selectAdviceAction(group_index,advice_index, advice)"
  363. >{{getXuserName(advice.checker)}}</td>
  364. </tr>
  365. </template>
  366. </table>
  367. </div>-->
  368. <!-- 新医嘱列表 -->
  369. <!-- 新增医嘱(子药)表单 -->
  370. <!-- 医嘱表单 -->
  371. <el-form ref="form" :model="form" label-width="100px" v-show="showAdviceForm">
  372. <el-row :gutter="20">
  373. <el-col :span="8">
  374. <el-form-item label="开始时间:">
  375. <el-date-picker
  376. format="yyyy-MM-dd HH:mm"
  377. value-format="yyyy-MM-dd HH:mm"
  378. type="datetime"
  379. :disabled="form.parent_id == 0 ? false : true"
  380. placeholder="选择日期"
  381. v-model="form.start_time"
  382. style="width: 100%;"
  383. ></el-date-picker>
  384. </el-form-item>
  385. </el-col>
  386. <el-col :span="8">
  387. <el-form-item label="医嘱名称:">
  388. <el-autocomplete
  389. style="width:100%;"
  390. class="inline-input"
  391. v-model="form.advice_name"
  392. :fetch-suggestions="querySearch"
  393. placeholder="请输入内容"
  394. @select="handleSelect"
  395. @input="changeDrugName"
  396. ></el-autocomplete>
  397. </el-form-item>
  398. </el-col>
  399. <el-col :span="8">
  400. <el-form-item label="药品规格:">
  401. <el-autocomplete
  402. style="width:100px;"
  403. class="inline-input"
  404. v-model="form.advice_desc"
  405. :fetch-suggestions="querySearch1"
  406. placeholder="请输入内容"
  407. @input="changeDrugDesc"
  408. ></el-autocomplete>
  409. <el-select
  410. v-model="form.drug_spec_unit"
  411. style="width: 100px;"
  412. filterable
  413. placeholder="选择"
  414. >
  415. <el-option
  416. v-for="item in unitsOption"
  417. :key="item.id"
  418. :label="item.name"
  419. :value="item.name"
  420. ></el-option>
  421. </el-select>
  422. </el-form-item>
  423. </el-col>
  424. </el-row>
  425. <el-row :gutter="20">
  426. <el-col :span="8">
  427. <el-form-item label="开药数量:">
  428. <el-input v-model="form.prescribing_number" style="width: 40%;"></el-input>
  429. <el-select
  430. v-model="form.prescribing_number_unit"
  431. style="width: 56%;"
  432. filterable
  433. placeholder="选择"
  434. >
  435. <el-option
  436. v-for="item in unitsOption"
  437. :key="item.id"
  438. :label="item.name"
  439. :value="item.name"
  440. ></el-option>
  441. </el-select>
  442. </el-form-item>
  443. </el-col>
  444. <el-col :span="8">
  445. <el-form-item label="单次用量:">
  446. <el-input v-model="form.single_dose" style="width: 40%;"></el-input>
  447. <el-select
  448. v-model="form.single_dose_unit"
  449. style="width: 56%;"
  450. filterable
  451. placeholder="选择"
  452. >
  453. <el-option
  454. v-for="item in unitsOption"
  455. :key="item.id"
  456. :label="item.name"
  457. :value="item.name"
  458. ></el-option>
  459. </el-select>
  460. </el-form-item>
  461. </el-col>
  462. <el-col :span="8">
  463. <el-form-item label="给药途径:">
  464. <el-select
  465. v-model="form.delivery_way"
  466. :disabled="form.parent_id == 0 ? false : true"
  467. filterable
  468. placeholder="请选择(输入可搜索)"
  469. >
  470. <el-option
  471. v-for="item in deliveryWayOptions"
  472. :key="item.id"
  473. :label="item.name"
  474. :value="item.name"
  475. ></el-option>
  476. </el-select>
  477. </el-form-item>
  478. </el-col>
  479. </el-row>
  480. <el-row :gutter="20">
  481. <el-col :span="8">
  482. <el-form-item label="执行频率:">
  483. <el-select
  484. v-model="form.execution_frequency"
  485. :disabled="form.parent_id == 0 ? false : true"
  486. filterable
  487. placeholder="请选择(输入可搜索)"
  488. >
  489. <el-option
  490. v-for="item in executionFrequencyOptions"
  491. :key="item.id"
  492. :label="item.name"
  493. :value="item.name"
  494. ></el-option>
  495. </el-select>
  496. </el-form-item>
  497. </el-col>
  498. </el-row>
  499. </el-form>
  500. <div slot="footer" class="dialog-footer" v-show="showAdviceForm">
  501. <el-button @click="hideForm">取 消</el-button>
  502. <el-button type="primary" v-if="form.id == 0" @click="submitAdvice" :loading="loading">保 存</el-button>
  503. <el-button type="primary" v-else @click="submitEditAdvice" :loading="loading">保 存</el-button>
  504. </div>
  505. <!-- 医嘱表单 end -->
  506. </el-dialog>
  507. <el-dialog
  508. title="选择执行时间"
  509. :visible.sync="execTimeDialogVisible"
  510. width="400px"
  511. @close="closeTimePanel"
  512. :show-close="isClose"
  513. :close-on-click-modal="isClose"
  514. :close-on-press-escape="isClose"
  515. :modal-append-to-body="false"
  516. >
  517. <el-date-picker
  518. v-model="execTime"
  519. format="yyyy-MM-dd HH:mm:00"
  520. value-format="yyyy-MM-dd HH:mm:00"
  521. type="datetime"
  522. placeholder="选择执行时间"
  523. style="width:100%"
  524. ></el-date-picker>
  525. <span slot="footer" class="dialog-footer">
  526. <el-button @click="closeTimePanel" :loading="exceLoading">取 消</el-button>
  527. <el-button type="primary" @click="submitExce" :loading="exceLoading">保 存</el-button>
  528. </span>
  529. </el-dialog>
  530. <add-group-advice
  531. :adviceTemplates="adviceTemplates"
  532. :executionFrequencyOptions="executionFrequencyOptions"
  533. :unitsOption="unitsOption"
  534. :deliveryWayOptions="deliveryWayOptions"
  535. :adviceTemplateMaps="adviceTemplateMaps"
  536. :patientID="patient.id"
  537. :adviceTableData="doctor_advices"
  538. :recordDate="record_date"
  539. ref="addGroupForm"
  540. ></add-group-advice>
  541. <edit-group-advice
  542. :adviceTemplates="adviceTemplates"
  543. :executionFrequencyOptions="executionFrequencyOptions"
  544. :unitsOption="unitsOption"
  545. :deliveryWayOptions="deliveryWayOptions"
  546. :adviceTemplateMaps="adviceTemplateMaps"
  547. :patientID="patient.id"
  548. :adviceTableData="doctor_advices"
  549. :recordDate="record_date"
  550. ref="editGroupForm"
  551. v-on:add-new-order="addNewOrder"
  552. :admin_users="admin_users"
  553. ></edit-group-advice>
  554. </div>
  555. </template>
  556. <script>
  557. import AddGroupAdvice from './adviceDialog/AddGroupAdvice'
  558. import EditGroupAdvice from './adviceDialog/EditGroupAdvice'
  559. import { uParseTime } from '@/utils/tools'
  560. import {
  561. CheckDoctorAdvice,
  562. CreateDoctorAdvice,
  563. CreateGroupAdvice,
  564. DeleteDoctorAdvice,
  565. DeleteGroupAdvice,
  566. EditDoctorAdvice,
  567. ExecDoctorAdvice,
  568. getAdviceConfig,
  569. GetLastOrNextDoctorAdvice
  570. } from '@/api/advice'
  571. import { getDataConfig } from '@/utils/data'
  572. import request from '@/utils/request'
  573. import { getDialysisScheduleDetail } from '@/api/dialysis_record'
  574. import { getSelfMedicalList } from "@/api/drug/drug"
  575. export default {
  576. name: 'DoctorAdviceDialog',
  577. props: {
  578. dialysis_order: {
  579. // 透析记录
  580. type: Object,
  581. default: () => {
  582. return { id: 0 }
  583. }
  584. },
  585. patient: {
  586. // 患者信息
  587. type: Object,
  588. default: () => {
  589. return { id: 0 }
  590. }
  591. },
  592. doctor_advices: {
  593. type: Array
  594. },
  595. admin_users: {
  596. // 系统用户列表
  597. type: Array,
  598. default: () => {
  599. return []
  600. }
  601. }
  602. },
  603. data() {
  604. return {
  605. adRules: {
  606. start_time: [{ required: true, message: '请选择开始时间' }]
  607. },
  608. adForm: {
  609. other_start_time: ''
  610. },
  611. request_record_date: '',
  612. isLastOrNextVisible: false,
  613. other_doctor_advices: [],
  614. sch: null,
  615. is_has_create: true,
  616. is_has_exce: true,
  617. is_has_check: true,
  618. is_has_modify_exce: true,
  619. is_has_modify: true,
  620. is_has_modify_other: true,
  621. is_has_del: true,
  622. is_has_del_other: true,
  623. tempArr: [],
  624. execTimeDialogVisible: false,
  625. currentBoxClass: 'current-box-class',
  626. isClose: false,
  627. isShow: false,
  628. loading: false,
  629. sameRowArr: [],
  630. hoverOrderArr: [],
  631. isVisibility: false,
  632. record_date: '',
  633. template_id: 0,
  634. deleLoading: false,
  635. exceLoading: false,
  636. execTime: '',
  637. current_group_index: -1,
  638. title: '临时医嘱',
  639. add_title: '新增医嘱',
  640. showAdviceForm: false,
  641. showAdvicePanel: true,
  642. showNameForm: false,
  643. showGroupForm: false,
  644. showTemplateForm: false,
  645. current_template_id: -1,
  646. adviceTemplates: [],
  647. adviceTemplateMaps: {},
  648. deliveryWayOptions: [],
  649. executionFrequencyOptions: [],
  650. unitsOption: [],
  651. // admin_users: [],
  652. templateRules: {
  653. id: [{ required: true, message: '请选择医嘱模板' }]
  654. },
  655. nameRules: {
  656. advice_name: [{ required: true, message: '请填写医嘱内容' }]
  657. },
  658. form: {
  659. id: 0,
  660. advice_type: 2,
  661. advice_date: '',
  662. start_time: '',
  663. advice_name: '',
  664. advice_desc: '',
  665. single_dose: '',
  666. single_dose_unit: '',
  667. prescribing_number: '',
  668. prescribing_number_unit: '',
  669. delivery_way: '',
  670. execution_frequency: '',
  671. advice_doctor: '',
  672. remark: '',
  673. parent_id: 0,
  674. drug_id:0,
  675. drug_name_id:0,
  676. way:0,
  677. },
  678. nameForm: {
  679. advice_name: '',
  680. single_dose: '',
  681. single_dose_unit: '',
  682. drug_spec: '',
  683. drug_spec_unit: '',
  684. prescribing_number: '',
  685. prescribing_number_unit: '',
  686. delivery_way: '',
  687. execution_frequency: '',
  688. isEdit: 0,
  689. index: 0
  690. },
  691. groupForm: {
  692. advice_type: 2,
  693. advice_date: '',
  694. start_time: '',
  695. adviceNames: [],
  696. advice_doctor: '',
  697. remark: '',
  698. parent_id: 0
  699. },
  700. adviceList: [],
  701. currentIndex: -1,
  702. currentRow: null,
  703. groupSelectRow: null,
  704. templateForm: { id: '' },
  705. doctorAdvices: [],
  706. patientid: '',
  707. drugSpec:[],
  708. medicals:[],
  709. all_drug:[],
  710. current_drug_name:"",
  711. current_drug_spec: "",
  712. drug_id: 0,
  713. src_type:""
  714. }
  715. },
  716. watch: {
  717. 'assessment_after_dislysis.id': function() {
  718. if (this.assessment_after_dislysis.id > 0) {
  719. for (var index in this.form) {
  720. this.form[index] = this.assessment_after_dislysis[index]
  721. }
  722. }
  723. },
  724. 'dialysis_order.id': function() {
  725. this.form['dialysis_order_id'] = this.dialysis_order.id
  726. },
  727. doctor_advices: function() {
  728. this.handleSpanTempArr()
  729. this.hoverOrderArr = []
  730. this.handleStyle()
  731. }
  732. },
  733. methods: {
  734. getContent: function() {
  735. if (this.sch != null) {
  736. var date = uParseTime(this.sch.schedule_date, '{y}-{m}-{d}')
  737. var week = ''
  738. var sch_type = ''
  739. switch (this.sch.schedule_week) {
  740. case 1:
  741. week = '周一'
  742. break
  743. case 2:
  744. week = '周二'
  745. break
  746. case 3:
  747. week = '周三'
  748. break
  749. case 4:
  750. week = '周四'
  751. break
  752. case 5:
  753. week = '周五'
  754. break
  755. case 6:
  756. week = '周六'
  757. break
  758. case 7:
  759. week = '周日'
  760. break
  761. }
  762. switch (this.sch.schedule_type) {
  763. case 1:
  764. sch_type = '上午'
  765. break
  766. case 2:
  767. sch_type = '下午'
  768. break
  769. case 3:
  770. sch_type = '晚上'
  771. break
  772. }
  773. return date + '(' + week + '/' + sch_type + ')'
  774. } else {
  775. return ''
  776. }
  777. },
  778. AddNewAdvice(name) {
  779. this.$refs[name].validate(valid => {
  780. if (valid) {
  781. var submitForm = {
  782. advice_type: 2,
  783. advice_date: this.record_date,
  784. start_time: this.adForm.other_start_time,
  785. adviceNames: this.other_doctor_advices,
  786. remark: ''
  787. }
  788. let mode = '1'
  789. CreateGroupAdvice(this.patientid, 0, submitForm, mode).then(
  790. response => {
  791. if (response.data.state == 0) {
  792. this.$message.error(response.data.msg);
  793. return false;
  794. } else {
  795. this.$notify({
  796. title: "成功",
  797. message: "新增成功",
  798. type: "success",
  799. duration: 2000
  800. });
  801. this.$refs[name].resetFields();
  802. this.isLastOrNextVisible = false;
  803. this.$parent.$parent.getScheduleDetail()
  804. return false;
  805. }
  806. }
  807. );
  808. }
  809. });
  810. },
  811. // isPermission () {
  812. // if(this.$store.getters.xt_user.user.user_type == 3 ) {
  813. // return false
  814. // } else {
  815. // return true
  816. // }
  817. // },
  818. adviceNameShow({ row, column, rowIndex, columnIndex }) {
  819. if (columnIndex == 2) {
  820. return 'dialysisadvicenamedisplay'
  821. } else {
  822. return ''
  823. }
  824. },
  825. submitEditAdvice() {
  826. if (this.form.advice_name.length == 0) {
  827. this.$message.error('请填写医嘱名称')
  828. return
  829. }
  830. if (this.form.start_time.length == 0) {
  831. this.$message.error('请选择开始时间')
  832. return
  833. }
  834. if (!(this.patient.id > 0)) {
  835. this.$message.error('没有选择患者')
  836. return false
  837. }
  838. // console.log(this.form)
  839. let mode = '2'
  840. if (this.form.advice_doctor != this.$store.getters.xt_user.user.id) {
  841. mode = '3'
  842. }
  843. EditDoctorAdvice(this.patient.id, this.form.id, this.form, mode).then(
  844. response => {
  845. if (response.data.state == 0) {
  846. this.$message.error(response.data.msg)
  847. return false
  848. } else {
  849. this.$notify({
  850. title: '成功',
  851. message: '修改医嘱成功',
  852. type: 'success',
  853. duration: 2000
  854. })
  855. this.showAdviceForm = false
  856. this.showAdvicePanel = true
  857. var advice = response.data.data.advice
  858. this.doctor_advices[this.currentIndex].drug_spec = advice.drug_spec
  859. this.doctor_advices[this.currentIndex].drug_spec_unit =
  860. advice.drug_spec_unit
  861. this.doctor_advices[this.currentIndex].start_time =
  862. advice.start_time
  863. this.doctor_advices[this.currentIndex].advice_name =
  864. advice.advice_name
  865. this.doctor_advices[this.currentIndex].advice_desc =
  866. advice.advice_desc
  867. this.doctor_advices[this.currentIndex].single_dose =
  868. advice.single_dose
  869. this.doctor_advices[this.currentIndex].single_dose_unit =
  870. advice.single_dose_unit
  871. this.doctor_advices[this.currentIndex].delivery_way =
  872. advice.delivery_way
  873. this.doctor_advices[this.currentIndex].execution_frequency =
  874. advice.execution_frequency
  875. this.doctor_advices[this.currentIndex].prescribing_number =
  876. advice.prescribing_number
  877. this.doctor_advices[this.currentIndex].prescribing_number_unit =
  878. advice.prescribing_number_unit
  879. this.doctor_advices[this.currentIndex].advice_doctor =
  880. advice.advice_doctor
  881. this.doctor_advices[this.currentIndex].remark = advice.remark
  882. this.doctor_advice[this.currentIndex].drug_id = advice.drug_id
  883. this.doctor_advice[this.currentIndex].drug_name_id = advice.drug_name_id
  884. this.doctor.advice[this.currentIndex].way = advice.way
  885. this.currentIndex = -1
  886. return false
  887. }
  888. }
  889. )
  890. }
  891. ,
  892. // submitGroupAdvice() {
  893. // if (this.groupForm.start_time.length == 0) {
  894. // this.$message.error('请选择开始时间')
  895. // return
  896. // }
  897. // CreateGroupAdvice(this.patient.id, this.groupForm).then(response => {
  898. // if (response.data.state == 0) {
  899. // this.$message.error(response.data.msg)
  900. // return false
  901. // } else {
  902. // this.$notify({
  903. // title: '成功',
  904. // message: '新增成功',
  905. // type: 'success',
  906. // duration: 2000
  907. // })
  908. // this.currentIndex = -1
  909. // this.currentRow = null
  910. // this.setCurrent()
  911. // this.hideGroupForm()
  912. // for (const index in response.data.data.advices) {
  913. // this.doctor_advices.unshift(response.data.data.advices[index])
  914. // }
  915. // this.groupForm = {
  916. // advice_type: 2,
  917. // advice_date: '',
  918. // start_time: '',
  919. // adviceNames: [],
  920. // advice_doctor: '',
  921. // remark: '',
  922. // parent_id: 0
  923. // }
  924. // return false
  925. // }
  926. // })
  927. // },
  928. // submitTempForm() {
  929. // var _this = this
  930. // if (this.templateForm.id.length == 0) {
  931. // this.$message.error('请选择医嘱模板')
  932. // return
  933. // }
  934. // if (_this.templateForm.id in _this.adviceTemplateMaps) {
  935. // var mapid = _this.templateForm.id
  936. // for (const index in _this.adviceTemplateMaps[mapid].DoctorAdviceTemplate) {
  937. // var item = {
  938. // advice_name: _this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index].advice_name,
  939. // single_dose: _this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index].single_dose,
  940. // single_dose_unit: _this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index].single_dose_unit,
  941. // drug_spec: _this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index].drug_spec,
  942. // drug_spec_unit: _this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index].drug_spec_unit,
  943. // prescribing_number: _this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index].prescribing_number,
  944. // prescribing_number_unit: _this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index].prescribing_number_unit,
  945. // delivery_way: _this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index].delivery_way,
  946. // execution_frequency: _this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index].execution_frequency,
  947. // isEdit: 0,
  948. // index: 0
  949. // }
  950. // _this.groupForm.adviceNames.push(item)
  951. // }
  952. // }
  953. // this.title = '新增医嘱'
  954. // this.showTemplateForm = false
  955. // this.showGroupForm = true
  956. // },
  957. openAdviceTemplate() {
  958. this.templateForm = { id: '' }
  959. this.title = '选择医嘱模板'
  960. this.showTemplateForm = true
  961. this.showGroupForm = false
  962. }
  963. ,
  964. submitNameForm() {
  965. if (this.nameForm.advice_name.length == 0) {
  966. this.$message.error('请填写医嘱名称')
  967. return
  968. }
  969. if (this.nameForm.isEdit) {
  970. this.groupForm.adviceNames[
  971. this.nameForm.index
  972. ].advice_name = this.nameForm.advice_name
  973. this.groupForm.adviceNames[
  974. this.nameForm.index
  975. ].single_dose = this.nameForm.single_dose
  976. this.groupForm.adviceNames[
  977. this.nameForm.index
  978. ].single_dose_unit = this.nameForm.single_dose_unit
  979. this.groupForm.adviceNames[
  980. this.nameForm.index
  981. ].drug_spec = this.nameForm.drug_spec
  982. this.groupForm.adviceNames[
  983. this.nameForm.index
  984. ].drug_spec_unit = this.nameForm.drug_spec_unit
  985. this.groupForm.adviceNames[
  986. this.nameForm.index
  987. ].prescribing_number = this.nameForm.prescribing_number
  988. this.groupForm.adviceNames[
  989. this.nameForm.index
  990. ].prescribing_number_unit = this.nameForm.prescribing_number_unit
  991. this.groupForm.adviceNames[
  992. this.nameForm.index
  993. ].delivery_way = this.nameForm.delivery_way
  994. this.groupForm.adviceNames[this.nameForm.index].execution_frequency = this.nameForm.execution_frequency
  995. this.groupForm.adviceNames[this.nameForm.index].drug_name_id = this.nameForm.drug_name_id
  996. this.groupForm.adviceNames[this.nameForm.index].way = this.nameForm.way
  997. this.groupForm.adviceNames[this.nameForm.index].drug_id = this.nameForm.drug_id
  998. } else {
  999. this.groupForm.adviceNames.push(this.nameForm)
  1000. }
  1001. this.title = '新增医嘱'
  1002. this.showNameForm = false
  1003. this.showGroupForm = true
  1004. }
  1005. ,
  1006. groupClassName({ row, rowIndex }) {
  1007. row.index = rowIndex
  1008. }
  1009. ,
  1010. selectGroupAdvice(row) {
  1011. this.groupSelectRow = row
  1012. }
  1013. ,
  1014. openDeleteGroupAdvice() {
  1015. if (this.groupSelectRow === null) {
  1016. this.$message.error('未选择要删除的医嘱内容')
  1017. return
  1018. }
  1019. this.DeleteGroupAdvice(this.groupSelectRow.groupno)
  1020. // this.$confirm('确认删除些条医嘱内容?', '删除医嘱内容', {
  1021. // confirmButtonText: '确定',
  1022. // cancelButtonText: '取消',
  1023. // type: 'warning'
  1024. // }).then(() => {
  1025. // this.groupForm.adviceNames.splice(this.groupSelectRow.index, 1);
  1026. // }).catch(() => {
  1027. // });
  1028. }
  1029. ,
  1030. openAdviceName(isEdit) {
  1031. if (isEdit) {
  1032. if (this.groupSelectRow === null) {
  1033. this.$message.error('未选择要修改的医嘱内容')
  1034. return
  1035. }
  1036. this.nameForm = {
  1037. advice_name: this.groupSelectRow.advice_name,
  1038. single_dose: this.groupSelectRow.single_dose,
  1039. single_dose_unit: this.groupSelectRow.single_dose_unit,
  1040. drug_spec: this.groupSelectRow.drug_spec,
  1041. drug_spec_unit: this.groupSelectRow.drug_spec_unit,
  1042. prescribing_number: this.groupSelectRow.prescribing_number,
  1043. prescribing_number_unit: this.groupSelectRow.prescribing_number_unit,
  1044. delivery_way: this.groupSelectRow.delivery_way,
  1045. execution_frequency: this.groupSelectRow.execution_frequency,
  1046. isEdit: 1,
  1047. index: this.groupSelectRow.index
  1048. }
  1049. console.log("88888888",this.nameForm)
  1050. } else {
  1051. this.nameForm = {
  1052. advice_name: '',
  1053. single_dose: '',
  1054. single_dose_unit: '',
  1055. drug_spec: '',
  1056. drug_spec_unit: '',
  1057. prescribing_number: '',
  1058. prescribing_number_unit: '',
  1059. delivery_way: '',
  1060. execution_frequency: '',
  1061. isEdit: 0,
  1062. index: 0
  1063. }
  1064. }
  1065. this.title = '新增医嘱内容'
  1066. this.showNameForm = true
  1067. this.showGroupForm = false
  1068. }
  1069. ,
  1070. tableRowClassName({ row, rowIndex }) {
  1071. // if (row.stop_state == 1 || row.execution_state == 1) {
  1072. // return 'stoped-row';
  1073. // }
  1074. // return 'success-rows'
  1075. row.index = rowIndex
  1076. const arr = this.hoverOrderArr
  1077. for (let i = 0; i < arr.length; i++) {
  1078. if (rowIndex == arr[i]) {
  1079. return 'success-row'
  1080. }
  1081. }
  1082. }
  1083. ,
  1084. changeAdviceName(key) {
  1085. if (key in this.adviceTemplateMaps) {
  1086. this.form.advice_name = this.adviceTemplateMaps[key].advice_name
  1087. this.form.advice_desc = this.adviceTemplateMaps[key].advice_desc
  1088. this.form.single_dose_unit = this.adviceTemplateMaps[
  1089. key
  1090. ].single_dose_unit
  1091. this.form.single_dose = this.adviceTemplateMaps[key].single_dose + ''
  1092. this.form.prescribing_number_unit = this.adviceTemplateMaps[
  1093. key
  1094. ].prescribing_number_unit
  1095. this.form.prescribing_number =
  1096. this.adviceTemplateMaps[key].prescribing_number + ''
  1097. this.form.delivery_way = this.adviceTemplateMaps[key].delivery_way
  1098. this.form.execution_frequency = this.adviceTemplateMaps[key].execution_frequency
  1099. this.form.drug_name_id = this.adviceTemplateMaps[key].drug_name_id
  1100. this.form.drug_id = this.adviceTemplateMaps[key].drug_id
  1101. this.form.way = this.adviceTemplateMaps[key].way
  1102. }
  1103. }
  1104. ,
  1105. submitExce() {
  1106. if (this.currentRow == null) {
  1107. this.$message.error('请先选择要执行的医嘱!')
  1108. return false
  1109. }
  1110. if (this.execTime.length == 0) {
  1111. this.$message.error('请选择执行时间!')
  1112. return false
  1113. }
  1114. var execTime = Math.round(new Date(this.execTime).getTime() / 1000)
  1115. if (execTime < this.currentRow.start_time) {
  1116. this.$message.error('执行医嘱不能在开始之前!')
  1117. return false
  1118. }
  1119. this.exceLoading = true
  1120. let mode = '6'
  1121. console.log("222222",this.currentRow.id)
  1122. ExecDoctorAdvice(this.patient.id, this.currentRow.id, this.execTime, mode).then(response => {
  1123. if (response.data.state == 0) {
  1124. this.$message.error(response.data.msg)
  1125. this.exceLoading = false
  1126. return false
  1127. } else {
  1128. this.$notify({
  1129. title: '成功',
  1130. message: '执行医嘱成功',
  1131. type: 'success',
  1132. duration: 2000
  1133. })
  1134. var exid = response.data.data.advice.id
  1135. if (response.data.data.advice.parent_id > 0) {
  1136. exid = response.data.data.advice.parent_id
  1137. }
  1138. // if (this.currentRow.parent_id > 0) {
  1139. // exid = this.currentRow.parent_id;
  1140. // }
  1141. this.currentRow.execution_state = 1
  1142. this.currentRow.execution_staff =
  1143. response.data.data.advice.execution_staff
  1144. this.currentRow.execution_time =
  1145. response.data.data.advice.execution_time
  1146. var alen = this.doctor_advices.length
  1147. for (var index in this.doctor_advices) {
  1148. if (
  1149. this.doctor_advices[index].id == exid ||
  1150. this.doctor_advices[index].parent_id == exid
  1151. ) {
  1152. this.doctor_advices[index].execution_state = 1
  1153. this.doctor_advices[index].execution_staff =
  1154. response.data.data.advice.execution_staff
  1155. this.doctor_advices[index].execution_time =
  1156. response.data.data.advice.execution_time
  1157. // this.doctor_advices[index].checker = response.data.data.advice.checker;
  1158. break
  1159. }
  1160. }
  1161. this.execTimeDialogVisible = false
  1162. return false
  1163. }
  1164. })
  1165. .catch(() => {
  1166. this.exceLoading = false
  1167. })
  1168. }
  1169. ,
  1170. submitAdvice() {
  1171. if (this.form.advice_name.length == 0) {
  1172. this.$message.error('请填写医嘱名称')
  1173. return
  1174. }
  1175. if (this.form.start_time.length == 0) {
  1176. this.$message.error('请选择开始时间')
  1177. return
  1178. }
  1179. if (!(this.patient.id > 0)) {
  1180. this.$message.error('没有选择患者')
  1181. return false
  1182. }
  1183. let mode = '1'
  1184. if(this.src_type == ""){
  1185. this.form.way = 0
  1186. this.form.drug_id = 0
  1187. this.form.drug_name_id = 0
  1188. }
  1189. if(this.src_type == 2){ //自备药
  1190. var arr = this.form.advice_name.split("(自备药)")
  1191. this.form.advice_name = arr[0]
  1192. }
  1193. console.log("新增医嘱子药",this.form)
  1194. CreateDoctorAdvice(this.patient.id, this.form, mode)
  1195. .then(response => {
  1196. this.loading = false
  1197. if (response.data.state == 0) {
  1198. this.$message.error(response.data.msg)
  1199. return false
  1200. } else {
  1201. this.$notify({
  1202. title: '成功',
  1203. message: '新增医嘱成功',
  1204. type: 'success',
  1205. duration: 2000
  1206. })
  1207. this.currentIndex = -1
  1208. this.currentRow = null
  1209. this.setCurrent()
  1210. this.hideForm()
  1211. if (this.form.parent_id > 0) {
  1212. var spliceIndex = -1
  1213. for (let index = this.doctor_advices.length - 1; ; index--) {
  1214. if (
  1215. this.doctor_advices[index].parent_id === this.form.parent_id
  1216. ) {
  1217. spliceIndex = index
  1218. break
  1219. } else if (
  1220. this.doctor_advices[index].id === this.form.parent_id
  1221. ) {
  1222. spliceIndex = index
  1223. break
  1224. }
  1225. }
  1226. if (spliceIndex > -1) {
  1227. spliceIndex += 1
  1228. if (spliceIndex === this.doctor_advices.length) {
  1229. this.doctor_advices.push(response.data.data.advice)
  1230. } else {
  1231. var swapData = this.doctor_advices.splice(spliceIndex)
  1232. this.doctor_advices.push(response.data.data.advice)
  1233. for (var index in swapData) {
  1234. this.doctor_advices.push(swapData[index]) // = this.doctor_advices.concat(swapData);
  1235. }
  1236. }
  1237. }
  1238. } else {
  1239. this.doctor_advices.unshift(response.data.data.advice)
  1240. }
  1241. // this.$emit("new_create", response.data.data.advice);
  1242. return false
  1243. }
  1244. })
  1245. .catch(v => {
  1246. this.loading = false
  1247. })
  1248. }
  1249. ,
  1250. openNewChildTwo(index, row) {
  1251. this.currentRow = row
  1252. if (this.currentRow == null) {
  1253. this.$message.error('请先选择要新增子药的医嘱!')
  1254. return false
  1255. }
  1256. if (
  1257. this.currentRow.stop_state == 1 ||
  1258. this.currentRow.execution_state == 1
  1259. ) {
  1260. this.$message.error('所选医嘱已停止或执行')
  1261. return false
  1262. }
  1263. this.title = '新增子药'
  1264. this.showAdviceForm = true
  1265. this.showAdvicePanel = false
  1266. this.form = {
  1267. id: 0,
  1268. advice_type: 2,
  1269. advice_date: this.record_date,
  1270. start_time: uParseTime(
  1271. this.currentRow.start_time,
  1272. '{y}-{m}-{d} {h}:{i}'
  1273. ),
  1274. advice_name: '',
  1275. drug_spec: '',
  1276. drug_spec_unit: '',
  1277. single_dose: '',
  1278. single_dose_unit: '',
  1279. prescribing_number: '',
  1280. prescribing_number_unit: '',
  1281. delivery_way: this.currentRow.delivery_way,
  1282. execution_frequency: this.currentRow.execution_frequency,
  1283. advice_doctor: '',
  1284. remark: '',
  1285. parent_id: this.currentRow.id,
  1286. drug_id:0,
  1287. drug_name_id:0,
  1288. way:0,
  1289. }
  1290. }
  1291. ,
  1292. openNewChild() {
  1293. if (this.currentRow == null) {
  1294. this.$message.error('请先选择要新增子药的医嘱!')
  1295. return false
  1296. }
  1297. if (
  1298. this.currentRow.stop_state == 1 ||
  1299. this.currentRow.execution_state == 1
  1300. ) {
  1301. this.$message.error('所选医嘱已停止或执行')
  1302. return false
  1303. }
  1304. this.title = '新增子药'
  1305. this.showAdviceForm = true
  1306. this.showAdvicePanel = false
  1307. this.form = {
  1308. id: 0,
  1309. advice_type: 2,
  1310. advice_date: this.record_date,
  1311. start_time: uParseTime(
  1312. this.currentRow.start_time,
  1313. '{y}-{m}-{d} {h}:{i}'
  1314. ),
  1315. advice_name: '',
  1316. drug_spec: '',
  1317. drug_spec_unit: '',
  1318. single_dose: '',
  1319. single_dose_unit: '',
  1320. prescribing_number: '',
  1321. prescribing_number_unit: '',
  1322. delivery_way: this.currentRow.delivery_way,
  1323. execution_frequency: this.currentRow.execution_frequency,
  1324. advice_doctor: '',
  1325. remark: '',
  1326. parent_id: this.currentRow.id
  1327. }
  1328. }
  1329. ,
  1330. openEdit(index, row) {
  1331. if (row.stop_state == 1 || row.execution_state == 1) {
  1332. this.$message.error('所选医嘱已停止或执行')
  1333. return false
  1334. }
  1335. this.title = row.parent_id > 0 ? '编辑子药' : '编辑医嘱'
  1336. this.showAdviceForm = true
  1337. this.showAdvicePanel = false
  1338. this.currentIndex = index
  1339. this.form = {
  1340. id: row.id,
  1341. advice_type: 2,
  1342. advice_date: uParseTime(row.advice_date, '{y}-{m}-{d}'),
  1343. start_time: uParseTime(row.start_time, '{y}-{m}-{d} {h}:{i}'),
  1344. advice_desc: row.advice_desc,
  1345. advice_name: row.advice_name,
  1346. drug_spec: row.drug_spec != 0 ? '' + row.drug_spec : '',
  1347. drug_spec_unit: row.drug_spec_unit,
  1348. single_dose: row.single_dose != 0 ? '' + row.single_dose : '',
  1349. single_dose_unit: row.single_dose_unit,
  1350. prescribing_number:
  1351. row.prescribing_number != 0 ? '' + row.prescribing_number : '',
  1352. prescribing_number_unit: row.prescribing_number_unit,
  1353. delivery_way: row.delivery_way,
  1354. execution_frequency: row.execution_frequency,
  1355. advice_doctor: row.advice_doctor,
  1356. remark: row.remark,
  1357. parent_id: row.parent_id,
  1358. drug_id:0,
  1359. way:0,
  1360. drug_name_id:0,
  1361. }
  1362. }
  1363. ,
  1364. openEditGroupAdvice() {
  1365. if (this.groupSelectRow === null) {
  1366. this.$message.error('未选择要修改的医嘱内容')
  1367. return
  1368. }
  1369. console.log("22222",this.groupSelectRow.groupno)
  1370. this.$refs.editGroupForm.open(this.groupSelectRow.groupno)
  1371. }
  1372. ,
  1373. openGroupFrom() {
  1374. this.$refs.addGroupForm.open()
  1375. // this.title="新增医嘱";
  1376. // this.showGroupForm = true;
  1377. // this.showAdviceForm = false;
  1378. // this.showAdvicePanel = false;
  1379. // this.$refs.advices_list.setCurrentRow(null);
  1380. // this.currentIndex = -1;
  1381. // this.currentRow = null;
  1382. // this.groupForm.advice_date = this.record_date;
  1383. // this.form = {
  1384. // id: 0,
  1385. // advice_type: 2,
  1386. // advice_date: this.record_date,
  1387. // start_time: "",
  1388. // advice_name: "",
  1389. // advice_desc: "",
  1390. // single_dose: "",
  1391. // single_dose_unit: "",
  1392. // prescribing_number: "",
  1393. // prescribing_number_unit: "",
  1394. // delivery_way: "",
  1395. // execution_frequency: "",
  1396. // advice_doctor: "",
  1397. // remark: "",
  1398. // parent_id: 0
  1399. // };
  1400. }
  1401. ,
  1402. checkAdvice() {
  1403. // console.log(this.$store.getters.xt_user)
  1404. if (this.currentRow == null) {
  1405. this.$message.error('请先选择要核对的医嘱!')
  1406. return false
  1407. }
  1408. if (this.currentRow.check_state == 1) {
  1409. this.$message.error('所选医嘱已核对')
  1410. return false
  1411. }
  1412. if (
  1413. this.currentRow.execution_staff > 0 &&
  1414. this.currentRow.execution_staff == this.$store.getters.xt_user.user.id
  1415. ) {
  1416. this.$message.error('核对与执行不能是同一人')
  1417. return false
  1418. }
  1419. this.$confirm('确认提交核对?', '医嘱核对', {
  1420. confirmButtonText: '确定',
  1421. cancelButtonText: '取消',
  1422. closeOnClickModal: false,
  1423. type: 'warning'
  1424. })
  1425. .then(() => {
  1426. this.deleLoading = true
  1427. let mode = '7'
  1428. CheckDoctorAdvice(this.patient.id, this.currentRow.id, mode).then(
  1429. response => {
  1430. if (response.data.state == 0) {
  1431. this.$message.error(response.data.msg)
  1432. this.deleLoading = false
  1433. return false
  1434. } else {
  1435. this.$notify({
  1436. title: '成功',
  1437. message: '核对成功',
  1438. type: 'success',
  1439. duration: 2000
  1440. })
  1441. var exid = response.data.data.advice.id
  1442. if (response.data.data.advice.parent_id > 0) {
  1443. exid = response.data.data.advice.parent_id
  1444. }
  1445. // if (this.currentRow.parent_id > 0) {
  1446. // exid = this.currentRow.parent_id;
  1447. // }
  1448. this.currentRow.check_state = 1
  1449. this.currentRow.check_time =
  1450. response.data.data.advice.check_time
  1451. this.currentRow.checker = response.data.data.advice.checker
  1452. var alen = this.doctor_advices.length
  1453. for (var index in this.doctor_advices) {
  1454. if (
  1455. this.doctor_advices[index].id == exid ||
  1456. this.doctor_advices[index].parent_id == exid
  1457. ) {
  1458. this.doctor_advices[index].check_state = 1
  1459. this.doctor_advices[index].check_time =
  1460. response.data.data.advice.check_time
  1461. this.doctor_advices[index].checker =
  1462. response.data.data.advice.checker
  1463. // break;
  1464. }
  1465. }
  1466. this.deleLoading = false
  1467. }
  1468. }
  1469. )
  1470. })
  1471. .catch(() => {
  1472. this.deleLoading = false
  1473. })
  1474. }
  1475. ,
  1476. execAdvice() {
  1477. if (this.is_has_exce == false) {
  1478. this.$message.error('你没有执行医嘱的权限')
  1479. return false
  1480. }
  1481. this.execTimeDialogVisible = true
  1482. // if (this.currentAdvices.length <= 0) {
  1483. // return;
  1484. // }
  1485. if (this.current_select_object == 1) {
  1486. var isExecution = true
  1487. var adviceArr = this.advice_groups[this.current_group_index].advices
  1488. for (let i = 0; i < adviceArr.length; i++) {
  1489. if (
  1490. adviceArr[i].execution_state == 2 &&
  1491. adviceArr[i].is_selected == 1
  1492. ) {
  1493. isExecution = false
  1494. }
  1495. }
  1496. if (isExecution) {
  1497. this.$message.error('所选医嘱已停止或执行')
  1498. return false
  1499. }
  1500. for (let i = 0; i < adviceArr.length; i++) {
  1501. if (
  1502. adviceArr[i].is_selected == 1 &&
  1503. adviceArr[i].checker > 0 &&
  1504. adviceArr[i].checker == this.$store.getters.user.admin.id
  1505. ) {
  1506. this.$message.error('核对医嘱与执行不能是同一人')
  1507. return false
  1508. }
  1509. }
  1510. var currentAdviceIdArr = []
  1511. for (let i = 0; i < adviceArr.length; i++) {
  1512. if (adviceArr[i].is_selected == 1) {
  1513. currentAdviceIdArr.push(adviceArr[i].id)
  1514. }
  1515. }
  1516. this.currentAdviceIdsStr = currentAdviceIdArr.join(',')
  1517. this.nowExecTime = new Date(adviceArr[0].start_time * 1000)
  1518. } else {
  1519. if (!(this.current_group_index >= 0 && this.current_advice_index < 0)) {
  1520. return
  1521. }
  1522. var isExecution = true
  1523. var group_top_advice = this.advice_groups[this.current_group_index]
  1524. .advices[0]
  1525. var adviceArr = this.advice_groups[this.current_group_index].advices
  1526. for (let i = 0; i < adviceArr.length; i++) {
  1527. if (
  1528. adviceArr[i].is_selected == 1 &&
  1529. adviceArr[i].execution_state == 2
  1530. ) {
  1531. isExecution = false
  1532. }
  1533. }
  1534. if (isExecution) {
  1535. this.$message.error('所选医嘱已停止或执行')
  1536. return false
  1537. }
  1538. for (let i = 0; i < adviceArr.length; i++) {
  1539. if (
  1540. adviceArr[i].is_selected == 1 &&
  1541. adviceArr[i].checker > 0 &&
  1542. adviceArr[i].checker == this.$store.getters.user.admin.id
  1543. ) {
  1544. this.$message.error('核对与执行不能是同一人')
  1545. return false
  1546. }
  1547. }
  1548. this.nowExecTime = new Date(group_top_advice.start_time * 1000)
  1549. }
  1550. this.$refs.exec_time.open()
  1551. // if (this.currentRow == null) {
  1552. // this.$message.error("请先选择要执行的医嘱!");
  1553. // return false;
  1554. // }
  1555. //
  1556. // if (
  1557. // this.currentRow.stop_state == 1 ||
  1558. // this.currentRow.execution_state == 1
  1559. // ) {
  1560. // this.$message.error("所选医嘱已停止或执行");
  1561. // return false;
  1562. // }
  1563. //
  1564. // if (
  1565. // this.currentRow.checker > 0 &&
  1566. // this.currentRow.checker == this.$store.getters.xt_user.user.id
  1567. // ) {
  1568. // this.$message.error("核对与执行不能是同一人");
  1569. // return false;
  1570. // }
  1571. //
  1572. // this.execTimeDialogVisible = true;
  1573. // this.deleLoading = true;
  1574. }
  1575. ,
  1576. DeleteGroupAdvice(groupno) {
  1577. this.$confirm('确认删除这组医嘱?', '医嘱删除', {
  1578. confirmButtonText: '确定',
  1579. cancelButtonText: '取消',
  1580. type: 'warning'
  1581. })
  1582. .then(() => {
  1583. console.log(this.currentRow)
  1584. let mode = '4'
  1585. if (
  1586. this.currentRow.advice_doctor != this.$store.getters.xt_user.user.id
  1587. ) {
  1588. mode = '5'
  1589. }
  1590. DeleteGroupAdvice(groupno, mode).then(response => {
  1591. if (response.data.state == 0) {
  1592. this.$message.error(response.data.msg)
  1593. return false
  1594. } else {
  1595. this.$notify({
  1596. title: '成功',
  1597. message: '医嘱已经删除',
  1598. type: 'success',
  1599. duration: 2000
  1600. })
  1601. var alen = this.doctor_advices.length
  1602. for (let index = alen - 1; index >= 0; index--) {
  1603. if (this.doctor_advices[index].groupno === groupno) {
  1604. this.doctor_advices.splice(index, 1)
  1605. }
  1606. }
  1607. }
  1608. })
  1609. })
  1610. .catch(() => {
  1611. })
  1612. this.handleSpanTempArr()
  1613. }
  1614. ,
  1615. openDelete(index, row) {
  1616. this.currentRow = row
  1617. this.$confirm('确认删除此条医嘱?', '医嘱删除', {
  1618. confirmButtonText: '确定',
  1619. cancelButtonText: '取消',
  1620. closeOnClickModal: false,
  1621. type: 'warning'
  1622. })
  1623. .then(() => {
  1624. this.deleLoading = true
  1625. let mode = '4'
  1626. if (
  1627. this.currentRow.advice_doctor != this.$store.getters.xt_user.user.id
  1628. ) {
  1629. mode = '5'
  1630. }
  1631. DeleteDoctorAdvice(this.currentRow.id, mode).then(response => {
  1632. this.deleLoading = false
  1633. if (response.data.state == 0) {
  1634. this.$message.error(response.data.msg)
  1635. return false
  1636. } else {
  1637. this.$notify({
  1638. title: '成功',
  1639. message: '医嘱已经删除',
  1640. type: 'success',
  1641. duration: 2000
  1642. })
  1643. this.deleteResetData(this.currentRow)
  1644. this.currentRow = null
  1645. this.setCurrent()
  1646. }
  1647. })
  1648. })
  1649. .catch(() => {
  1650. this.deleLoading = false
  1651. })
  1652. }
  1653. ,
  1654. deleteAdvice() {
  1655. if (this.currentRow == null) {
  1656. this.$message.error('请先选择要删除的医嘱!')
  1657. return false
  1658. }
  1659. this.$confirm('确认删除此条医嘱?', '医嘱删除', {
  1660. confirmButtonText: '确定',
  1661. cancelButtonText: '取消',
  1662. closeOnClickModal: false,
  1663. type: 'warning'
  1664. })
  1665. .then(() => {
  1666. this.deleLoading = true
  1667. let mode = '4'
  1668. if (
  1669. this.currentRow.advice_doctor != this.$store.getters.xt_user.user.id
  1670. ) {
  1671. mode = '5'
  1672. }
  1673. DeleteDoctorAdvice(this.currentRow.id, mode).then(response => {
  1674. this.deleLoading = false
  1675. if (response.data.state == 0) {
  1676. this.$message.error(response.data.msg)
  1677. return false
  1678. } else {
  1679. this.$notify({
  1680. title: '成功',
  1681. message: '医嘱已经删除',
  1682. type: 'success',
  1683. duration: 2000
  1684. })
  1685. this.deleteResetData(this.currentRow)
  1686. this.currentRow = null
  1687. this.setCurrent()
  1688. }
  1689. })
  1690. })
  1691. .catch(() => {
  1692. this.deleLoading = false
  1693. })
  1694. }
  1695. ,
  1696. deleteResetData(row) {
  1697. if (row.parent_id > 0) {
  1698. for (var index in this.doctor_advices) {
  1699. if (this.doctor_advices[index].id == row.id) {
  1700. this.doctor_advices.splice(index, 1)
  1701. break
  1702. }
  1703. }
  1704. } else {
  1705. var spliceIndex = -1
  1706. var splitNums = 0
  1707. for (var index in this.doctor_advices) {
  1708. if (this.doctor_advices[index].id == row.id) {
  1709. spliceIndex = index
  1710. splitNums++
  1711. } else if (this.doctor_advices[index].parent_id == row.id) {
  1712. splitNums++
  1713. }
  1714. }
  1715. this.doctor_advices.splice(spliceIndex, splitNums)
  1716. }
  1717. }
  1718. ,
  1719. selectRow(row) {
  1720. this.currentRow = row
  1721. }
  1722. ,
  1723. getAdviceConfig() {
  1724. getAdviceConfig().then(response => {
  1725. if (response.data.state == 1) {
  1726. this.deliveryWayOptions =
  1727. response.data.data.drugways === null
  1728. ? []
  1729. : response.data.data.drugways
  1730. this.executionFrequencyOptions =
  1731. response.data.data.efs === null ? [] : response.data.data.efs
  1732. this.adviceTemplates =
  1733. response.data.data.advice_templates === null
  1734. ? []
  1735. : response.data.data.advice_templates
  1736. var templateLen = this.adviceTemplates.length
  1737. for (let index = 0; index < templateLen; index++) {
  1738. if (!this.adviceTemplates[index].DoctorAdviceTemplate) {
  1739. continue
  1740. }
  1741. var DoctorAdviceTemplate = this.adviceTemplates[index]
  1742. .DoctorAdviceTemplate
  1743. for (let i = 0; i < DoctorAdviceTemplate.length; i++) {
  1744. DoctorAdviceTemplate[i].selection = false
  1745. }
  1746. var item = this.adviceTemplates[index]
  1747. item.DoctorAdviceTemplate = []
  1748. var datMap = {}
  1749. for (const key in DoctorAdviceTemplate) {
  1750. if (DoctorAdviceTemplate[key].parent_id == 0) {
  1751. datMap[DoctorAdviceTemplate[key].id] =
  1752. DoctorAdviceTemplate[key]
  1753. }
  1754. }
  1755. for (const key in DoctorAdviceTemplate) {
  1756. if (DoctorAdviceTemplate[key].parent_id in datMap) {
  1757. if ('children' in datMap[DoctorAdviceTemplate[key].parent_id]) {
  1758. datMap[DoctorAdviceTemplate[key].parent_id].children.push(
  1759. DoctorAdviceTemplate[key]
  1760. )
  1761. } else {
  1762. datMap[DoctorAdviceTemplate[key].parent_id].children = []
  1763. datMap[DoctorAdviceTemplate[key].parent_id].children.push(
  1764. DoctorAdviceTemplate[key]
  1765. )
  1766. }
  1767. }
  1768. }
  1769. for (const key in datMap) {
  1770. item.DoctorAdviceTemplate.push(datMap[key])
  1771. }
  1772. this.$set(
  1773. this.adviceTemplateMaps,
  1774. this.adviceTemplates[index].id,
  1775. item
  1776. )
  1777. }
  1778. }
  1779. })
  1780. this.handleSpanTempArr()
  1781. this.handleStyle()
  1782. }
  1783. ,
  1784. getXuserName(id) {
  1785. if (id <= 0) {
  1786. return ''
  1787. }
  1788. var name = ''
  1789. if (
  1790. this.admin_users == null ||
  1791. typeof this.admin_users.length === 'undefined'
  1792. ) {
  1793. return name
  1794. }
  1795. var leng = this.admin_users.length
  1796. if (leng == 0) {
  1797. return name
  1798. }
  1799. for (let index = 0; index < leng; index++) {
  1800. if (this.admin_users[index].id == id) {
  1801. name = this.admin_users[index].name
  1802. break
  1803. }
  1804. }
  1805. return name
  1806. }
  1807. ,
  1808. addNewOrder() {
  1809. this.$refs.addGroupForm.open()
  1810. }
  1811. ,
  1812. show() {
  1813. this.isVisibility = true
  1814. this.getPermission()
  1815. }
  1816. ,
  1817. hide() {
  1818. this.isVisibility = false
  1819. }
  1820. ,
  1821. hideForm() {
  1822. this.title = '临时医嘱'
  1823. this.showGroupForm = false
  1824. this.showAdviceForm = false
  1825. this.showAdvicePanel = true
  1826. }
  1827. ,
  1828. hideNameForm() {
  1829. this.title = '新增医嘱'
  1830. this.showGroupForm = true
  1831. this.showNameForm = false
  1832. }
  1833. ,
  1834. hideTemplateForm() {
  1835. this.title = '新增医嘱'
  1836. this.showGroupForm = true
  1837. this.showTemplateForm = false
  1838. }
  1839. ,
  1840. hideGroupForm() {
  1841. this.title = '临时医嘱'
  1842. this.showAdviceForm = false
  1843. this.showGroupForm = false
  1844. this.showAdvicePanel = true
  1845. }
  1846. ,
  1847. resetDialog() {
  1848. this.hoverOrderArr = []
  1849. this.title = '临时医嘱'
  1850. this.showAdviceForm = false
  1851. this.showGroupForm = false
  1852. this.showAdvicePanel = true
  1853. this.currentRow = null
  1854. this.groupSelectRow = null
  1855. this.setCurrent()
  1856. }
  1857. ,
  1858. closeTimePanel() {
  1859. this.execTimeDialogVisible = false
  1860. this.deleLoading = false
  1861. this.exceLoading = false
  1862. this.execTime = ''
  1863. }
  1864. ,
  1865. setCurrent(row) {
  1866. this.$refs.advices_list.setCurrentRow(row)
  1867. }
  1868. ,
  1869. isShowStartTime(index, row) {
  1870. if (row.parent_id > 0) {
  1871. return false
  1872. } else if (
  1873. index > 0 &&
  1874. row.groupno > 0 &&
  1875. row.groupno == this.doctor_advices[index - 1].groupno
  1876. ) {
  1877. return false
  1878. }
  1879. return true
  1880. }
  1881. ,
  1882. mergeSpan({ row, column, rowIndex, columnIndex }) {
  1883. if (columnIndex != 2) {
  1884. const _row = this.tempArr[rowIndex]
  1885. const _col = _row > 0 ? 1 : 0
  1886. return {
  1887. rowspan: _row,
  1888. colspan: _col
  1889. }
  1890. }
  1891. }
  1892. ,
  1893. handleSpanTempArr() {
  1894. this.tempArr = []
  1895. for (let i = 0; i < this.doctor_advices.length; i++) {
  1896. if (i === 0) {
  1897. this.tempArr.push(1)
  1898. this.pos = 0
  1899. } else {
  1900. // 判断当前元素与上一个元素是否相同
  1901. if (
  1902. this.doctor_advices[i].groupno ===
  1903. this.doctor_advices[i - 1].groupno
  1904. ) {
  1905. this.tempArr[this.pos] += 1
  1906. this.tempArr.push(0)
  1907. } else {
  1908. this.tempArr.push(1)
  1909. this.pos = i
  1910. }
  1911. }
  1912. }
  1913. }
  1914. ,
  1915. cellMouseEnter: function(row, column, event) {
  1916. console.log("数据是",row)
  1917. this.currentRow = row
  1918. // this.groupSelectRow = row
  1919. // this.sameRowArr.forEach((arr, i) => {
  1920. // if (arr.indexOf(row.index) != -1) {
  1921. // this.hoverOrderArr = arr
  1922. // }
  1923. // })
  1924. }
  1925. ,
  1926. cellMouseLeave: function(row, column, cell, event) {
  1927. this.hoverOrderArr = []
  1928. }
  1929. ,
  1930. handleStyle() {
  1931. let sameRowArr = [],
  1932. sIdx = 0
  1933. this.doctor_advices.forEach((item, index) => {
  1934. item.index = index
  1935. if (index === 0) {
  1936. sameRowArr.push([index])
  1937. } else {
  1938. if (item.groupno === this.doctor_advices[index - 1].groupno) {
  1939. sameRowArr[sIdx].push(index)
  1940. } else {
  1941. sIdx = sIdx + 1
  1942. sameRowArr.push([index])
  1943. }
  1944. }
  1945. })
  1946. this.sameRowArr = sameRowArr
  1947. }
  1948. ,
  1949. getAdviceContent(row, isChild) {
  1950. let tempSingleDoseDesc = ''
  1951. let tempDrugSpecDesc = ''
  1952. let tempPrescribingNumberDesc = ''
  1953. if (row.prescribing_number) {
  1954. tempPrescribingNumberDesc =
  1955. row.prescribing_number + '' + row.prescribing_number_unit
  1956. }
  1957. if (row.single_dose) {
  1958. if (this.template_id != 6) {
  1959. tempSingleDoseDesc =
  1960. ' 单次用量 ' + ' ' + row.single_dose + '' + row.single_dose_unit
  1961. } else {
  1962. tempSingleDoseDesc = row.single_dose + '' + row.single_dose_unit
  1963. }
  1964. }
  1965. if (row.advice_desc) {
  1966. tempDrugSpecDesc = '(' + row.advice_desc + row.drug_spec_unit + ')'
  1967. }
  1968. if (isChild == 1) {
  1969. // 不是子药
  1970. return (
  1971. row.advice_name +
  1972. tempDrugSpecDesc +
  1973. ' ' +
  1974. tempPrescribingNumberDesc +
  1975. tempSingleDoseDesc +
  1976. ' ' +
  1977. row.delivery_way +
  1978. ' ' +
  1979. row.execution_frequency
  1980. )
  1981. } else {
  1982. // 是子药
  1983. return (
  1984. row.advice_name +
  1985. tempDrugSpecDesc +
  1986. ' ' +
  1987. tempPrescribingNumberDesc +
  1988. tempSingleDoseDesc
  1989. )
  1990. }
  1991. }
  1992. ,
  1993. getPermission() {
  1994. request
  1995. .get('/api/func_per/get', {
  1996. params: {
  1997. create_url: '/api/patients/advice/creategroup?mode=1',
  1998. modify_url: '/api/patients/advice/edit?mode=2',
  1999. modify_other_url: '/api/patients/advice/edit?mode=3',
  2000. del_url: '/api/patients/advice/delete?mode=4',
  2001. del_other_url: '/api/patients/advice/delete?mode=5',
  2002. exce_url: '/api/patients/advice/exec?mode=6',
  2003. check_url: '/api/patients/advice/check?mode=7',
  2004. module: 4
  2005. }
  2006. })
  2007. .then(res => {
  2008. console.log(res)
  2009. if (res.data.state == 0) {
  2010. this.hasPermission = false
  2011. } else if (res.data.state == 1) {
  2012. this.is_has_create = res.data.data.is_has_create
  2013. this.is_has_exce = res.data.data.is_has_exce
  2014. this.is_has_check = res.data.data.is_has_check
  2015. this.is_has_modify = res.data.data.is_has_modify
  2016. this.is_has_modify_other = res.data.data.is_has_modify_other
  2017. this.is_has_modify_exce = res.data.data.is_has_modify_exce
  2018. this.is_has_del = res.data.data.is_has_del
  2019. this.is_has_del_other = res.data.data.is_has_del_other
  2020. }
  2021. })
  2022. }
  2023. ,
  2024. arraySpanMethod({ row, column, rowIndex, columnIndex }) {
  2025. if (rowIndex % 2 === 0) {
  2026. if (columnIndex === 0) {
  2027. return [1, 2]
  2028. } else if (columnIndex === 1) {
  2029. return [0, 0]
  2030. }
  2031. }
  2032. }
  2033. ,
  2034. handleCurrentChange(row) {
  2035. this.currentRow = row;
  2036. // this.groupSelectRow = row;
  2037. // this.sameRowArr.forEach((arr, i) => {
  2038. // if (arr.indexOf(row.index) != -1) {
  2039. // this.hoverOrderArr = arr;
  2040. // }
  2041. // });
  2042. },
  2043. objectSpanMethod({ row, column, rowIndex, columnIndex }) {
  2044. if (columnIndex === 0) {
  2045. if (rowIndex % 2 === 0) {
  2046. return {
  2047. rowspan: 2,
  2048. colspan: 1
  2049. }
  2050. } else {
  2051. return {
  2052. rowspan: 0,
  2053. colspan: 0
  2054. }
  2055. }
  2056. }
  2057. if (columnIndex === 1) {
  2058. if (rowIndex % 2 === 0) {
  2059. return {
  2060. rowspan: 2,
  2061. colspan: 1
  2062. }
  2063. } else {
  2064. return {
  2065. rowspan: 0,
  2066. colspan: 0
  2067. }
  2068. }
  2069. }
  2070. }
  2071. ,
  2072. GetLastOrNextDoctorAdvice(params) {
  2073. GetLastOrNextDoctorAdvice(params).then(response => {
  2074. if (response.data.state == 1) {
  2075. var doctor_advices = response.data.data.advices
  2076. this.other_doctor_advices = doctor_advices
  2077. this.request_record_date = uParseTime(this.other_doctor_advices[0].record_date, '{y}-{m}-{d}')
  2078. this.sch = response.data.data.schedule
  2079. } else {
  2080. this.$message.error(response.data.msg)
  2081. }
  2082. })
  2083. },
  2084. getDialysisScheduleDetail() {
  2085. if(this.$route.query.showView && this.$route.query.showView == true){
  2086. return
  2087. }
  2088. getDialysisScheduleDetail(this.patientid, this.record_date).then(response => {
  2089. if (response.data.state == 1) {
  2090. var doctor_advices = response.data.data.doctor_advices
  2091. this.doctorAdvices = doctor_advices
  2092. }
  2093. })
  2094. }
  2095. ,
  2096. openLast(val) {
  2097. if (val == 1) {
  2098. this.isLastOrNextVisible = true
  2099. this.isVisibility = false
  2100. this.request_record_date = this.record_date
  2101. let params = {
  2102. patient_id: this.patientid,
  2103. record_time: this.request_record_date,
  2104. type: 1
  2105. }
  2106. this.GetLastOrNextDoctorAdvice(params)
  2107. } else if (val == 3) {
  2108. let params = {
  2109. patient_id: this.patientid,
  2110. record_time: this.request_record_date,
  2111. type: 1
  2112. }
  2113. this.GetLastOrNextDoctorAdvice(params)
  2114. }
  2115. },
  2116. openNext(val) {
  2117. if (val == 2) {
  2118. this.isLastOrNextVisible = true
  2119. this.isVisibility = false
  2120. this.request_record_date = this.record_date
  2121. let params = {
  2122. patient_id: this.patientid,
  2123. record_time: this.request_record_date,
  2124. type: 2
  2125. }
  2126. this.GetLastOrNextDoctorAdvice(params)
  2127. } else if (val == 4) {
  2128. let params = {
  2129. patient_id: this.patientid,
  2130. record_time: this.request_record_date,
  2131. type: 2
  2132. }
  2133. this.GetLastOrNextDoctorAdvice(params)
  2134. }
  2135. },
  2136. getSelfMedicalList(){
  2137. const params = {
  2138. patient_id:this.$route.query.patient_id
  2139. }
  2140. getSelfMedicalList(params).then(response=>{
  2141. if (response.data.state == 1) {
  2142. this.arr_drug = []
  2143. var medicalList = response.data.data.private_drug_list
  2144. var base_drug_list = response.data.data.base_drug_list
  2145. var base_drug_cofig = response.data.data.base_drug_config
  2146. var private_drug_cofig = response.data.data.private_drug_config
  2147. if(private_drug_cofig != null&&private_drug_cofig.drug_start == 1) {
  2148. for (let i = 0; i < medicalList.length; i++) {
  2149. if(medicalList[i].drug_specs != null) {
  2150. for (let a = 0; a < medicalList[i].drug_specs.length; a++) {
  2151. medicalList[i].drug_specs[a]['type'] = 2
  2152. }
  2153. }
  2154. let obj = {
  2155. drug_name: "",
  2156. drug_desc: "",
  2157. delivery_way: "",
  2158. execution_frequency: "",
  2159. single_dose: "",
  2160. single_dose_unit: "",
  2161. prescribing_number: "",
  2162. prescribing_number_unit: "",
  2163. type_id: "",
  2164. type: "",
  2165. custom_id: "",
  2166. drug_specs: [],
  2167. }
  2168. medicalList[i].drug_name = medicalList[i].drug_name + "(自备药)"
  2169. obj.drug_name = medicalList[i].drug_name
  2170. obj.delivery_way = medicalList[i].delivery_way
  2171. obj.execution_frequency = medicalList[i].execution_frequency
  2172. obj.single_dose = medicalList[i].single_dose
  2173. obj.prescribing_number = medicalList[i].prescribing_number
  2174. obj.type_id = medicalList[i].id
  2175. obj.type = 2
  2176. obj.custom_id = this.rand(10000000, 99999999)
  2177. obj.drug_specs = medicalList[i].drug_specs
  2178. console.log("222",this.all_drug)
  2179. this.all_drug.push(obj)
  2180. }
  2181. }
  2182. for (let i = 0; i < base_drug_list.length; i++) {
  2183. if(base_drug_list[i].drug_specs != null) {
  2184. for (let a = 0; a < base_drug_list[i].drug_specs.length; a++) {
  2185. base_drug_list[i].drug_specs[a]['type'] = 1
  2186. }
  2187. }
  2188. let obj = {
  2189. drug_name: "",
  2190. drug_desc: "",
  2191. delivery_way: "",
  2192. execution_frequency: "",
  2193. single_dose: "",
  2194. single_dose_unit: "",
  2195. prescribing_number: "",
  2196. prescribing_number_unit: "",
  2197. type_id: "",
  2198. type: "",
  2199. custom_id: "",
  2200. drug_specs: [],
  2201. }
  2202. obj.drug_name = base_drug_list[i].drug_name
  2203. obj.delivery_way = base_drug_list[i].delivery_way
  2204. obj.execution_frequency = base_drug_list[i].execution_frequency
  2205. obj.single_dose = base_drug_list[i].single_dose
  2206. obj.prescribing_number = base_drug_list[i].prescribing_number
  2207. obj.type_id = base_drug_list[i].id
  2208. obj.type = 1
  2209. obj.custom_id = this.rand(10000000, 99999999)
  2210. obj.drug_specs = base_drug_list[i].drug_specs
  2211. this.all_drug.push(obj)
  2212. console.log("2222",this.all_drug)
  2213. }
  2214. }
  2215. })
  2216. },
  2217. changeDrugName(name){
  2218. this.current_drug_name = name
  2219. this.form.advice_desc = ""
  2220. this.$forceUpdate()
  2221. this.drugSpec = []
  2222. for (let i = 0; i < this.all_drug.length; i++) {
  2223. if (this.all_drug[i].drug_name == name) {
  2224. this.drugSpec = this.all_drug[i].drug_specs
  2225. }
  2226. }
  2227. },
  2228. changeDrugDesc(name) {
  2229. this.$forceUpdate()
  2230. this.current_drug_spec = name
  2231. for (let i = 0; i < this.drugSpec.length; i++) {
  2232. if (this.drugSpec[i].drug_spec == name) {
  2233. this.form.advice_desc = this.drugSpec[i].drug_spec
  2234. this.form.prescribing_number = this.drugSpec[i].prescribing_number.toString()
  2235. this.form.single_dose = this.drugSpec[i].single_dose.toString()
  2236. this.form.delivery_way = this.drugSpec[i].delivery_way.toString()
  2237. this.form.execution_frequency = this.drugSpec[i].execution_frequency.toString()
  2238. this.form.drug_id = this.drugSpec[i].id
  2239. this.src_type = this.drugSpec[i].type
  2240. this.form.drug_id = this.drugSpec[i].id
  2241. this.form.way = this.drugSpec[i].type
  2242. this.form.drug_spec_unit = this.drugSpec[i].min_unit
  2243. this.form.prescribing_number_unit = this.drugSpec[i].min_unit
  2244. this.form.single_dose_unit = this.drugSpec[i].min_unit
  2245. if(this.drugSpec[i].drug_name_id){
  2246. this.form.drug_name_id = this.drugSpec[i].drug_name_id
  2247. }else{
  2248. this.form.drug_name_id = 0
  2249. }
  2250. }
  2251. }
  2252. },
  2253. rand(min, max) {
  2254. return Math.floor(Math.random() * (max - min)) + min;
  2255. },
  2256. querySearch(queryString, cb) {
  2257. console.log('queryString',queryString)
  2258. var restaurants = this.all_drug;
  2259. restaurants.map(item => {
  2260. item.value = item.drug_name
  2261. })
  2262. var results = queryString ? restaurants.filter(this.createFilter(queryString)) : restaurants;
  2263. // 调用 callback 返回建议列表的数据
  2264. console.log('results',results)
  2265. cb(results);
  2266. },
  2267. createFilter(queryString) {
  2268. return (restaurant) => {
  2269. return (restaurant.drug_name.toLowerCase().indexOf(queryString.toLowerCase()) === 0);
  2270. };
  2271. },
  2272. querySearch1(queryString, cb) {
  2273. console.log('queryString',queryString)
  2274. var restaurants = this.drugSpec;
  2275. console.log(restaurants)
  2276. restaurants.map(item => {
  2277. item.value = item.drug_spec
  2278. })
  2279. var results = queryString ? restaurants.filter(this.createFilter(queryString)) : restaurants;
  2280. // 调用 callback 返回建议列表的数据
  2281. console.log('results',results)
  2282. cb(results);
  2283. },
  2284. handleSelect(){
  2285. }
  2286. },
  2287. created() {
  2288. var date = this.$route.query && this.$route.query.date
  2289. this.record_date = uParseTime(date, '{y}-{m}-{d}')
  2290. this.form.advice_date = this.record_date
  2291. this.getAdviceConfig()
  2292. this.unitsOption = getDataConfig('hemodialysis', 'units')
  2293. this.template_id = this.$store.getters.xt_user.template_info.template_id
  2294. this.patientid = this.$route.query.patient_id
  2295. this.request_record_date = this.record_date
  2296. this.getDialysisScheduleDetail()
  2297. //获取自备药
  2298. this.getSelfMedicalList()
  2299. },
  2300. components: {
  2301. AddGroupAdvice,
  2302. EditGroupAdvice
  2303. }
  2304. }
  2305. </script>
  2306. <style>
  2307. @import "../../../../../static/css/table_row.css";
  2308. .txsj {
  2309. text-align: center;
  2310. margin-bottom: 20px;
  2311. }
  2312. .dialysisadvicenamedisplay .cell {
  2313. float: left;
  2314. text-align: left;
  2315. }
  2316. </style>
  2317. <style lang="scss" scoped>
  2318. .table {
  2319. width: 100%;
  2320. .tableTh {
  2321. th {
  2322. padding: 10px 0px;
  2323. background-color: rgb(245, 247, 250);
  2324. color: #909399;
  2325. font-weight: bold;
  2326. text-align: center;
  2327. }
  2328. }
  2329. tr {
  2330. th {
  2331. /*/ / background: $ main-color;*/
  2332. /*/ / color: #fff;*/
  2333. /*/ / height: 1.2 rem;*/
  2334. /*/ / line-height: 1.2 rem;*/
  2335. /*/ /*/
  2336. }
  2337. td {
  2338. line-height: 0.6rem;
  2339. .txt {
  2340. /*/ / float: left;*/
  2341. padding: 0 10px 0 10px;
  2342. /*/ / width: 75 %;*/
  2343. text-align: left;
  2344. }
  2345. .ico {
  2346. float: right;
  2347. width: 60px;
  2348. text-align: right;
  2349. padding-right: 3px;
  2350. }
  2351. .iconfont {
  2352. font-size: 20px;
  2353. padding: 0 2px;
  2354. color: #7b8a97;
  2355. }
  2356. .handle {
  2357. color: #409eff;
  2358. /*/ / padding: 0 7 px;*/
  2359. }
  2360. }
  2361. .advice_content {
  2362. /*/ / background: #eff6fc;*/
  2363. }
  2364. .subadvice_content {
  2365. /*/ / background: #fafcfe;*/
  2366. padding-left: 20px;
  2367. }
  2368. .td-active {
  2369. background: #badcff !important;
  2370. }
  2371. }
  2372. .row-class-active {
  2373. td {
  2374. background: #badcff;
  2375. }
  2376. }
  2377. }
  2378. </style>
  2379. <!--<style scoped>-->
  2380. <!--.txsj{-->
  2381. <!--text-align: center;-->
  2382. <!--margin-bottom: 20px;-->
  2383. <!--}-->
  2384. <!--</style>-->
  2385. <!--<style rel="stylesheet/scss" lang="scss" >-->
  2386. <!--.row-class-active {-->
  2387. <!--background: #badcff;-->
  2388. <!--}-->
  2389. <!--.doctor-advice-box .current-box-class .current-row>td{-->
  2390. <!--background: #6fb5fa;-->
  2391. <!--color:#fff;-->
  2392. <!--}-->
  2393. <!--.doctor-advice-box .current-box-class .current-row:hover>td{-->
  2394. <!--background: #6fb5fa;-->
  2395. <!--}-->
  2396. <!--// .doctor-advice-box .current-box-class .stoped-row>td{-->
  2397. <!--// background: #c9c9c9;-->
  2398. <!--// color:#000;-->
  2399. <!--// }-->
  2400. <!--// .doctor-advice-box .current-box-class .stoped-row:hover>td{-->
  2401. <!--// background: #c9c9c9;-->
  2402. <!--// }-->
  2403. <!--</style>-->