DoctorAdviceDialog.vue 89KB

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