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