DoctorAdviceDialog.vue 92KB

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