EditGroupAdvice.vue 95KB

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