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

DoctorAdviceDialog.vue 95KB

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