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

EditGroupAdvice.vue 74KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805
  1. <template>
  2. <div id="user-edit-group-advice">
  3. <el-dialog title="编辑医嘱" :visible.sync="groupEditFormVisible" width="700px">
  4. <el-form ref="groupForm" :rules="groupRules" :model="groupForm" label-width="90px">
  5. <el-row>
  6. <el-col :span="12" >
  7. <el-form-item label="医嘱类型 :" required prop="advice_type">
  8. <el-input value="临时" disabled></el-input>
  9. </el-form-item>
  10. </el-col>
  11. <el-col :span="12" >
  12. <el-form-item label="开始时间 :" required prop="start_time">
  13. <el-date-picker
  14. type="datetime"
  15. format="yyyy-MM-dd HH:mm"
  16. value-format="yyyy-MM-dd HH:mm"
  17. placeholder="选择时间"
  18. v-model="groupForm.start_time"
  19. ></el-date-picker>
  20. </el-form-item>
  21. </el-col>
  22. </el-row>
  23. <el-row>
  24. <el-col :span="12">
  25. <el-form-item label="开嘱医生 :">
  26. <span>{{adminusername}} </span>
  27. </el-form-item>
  28. </el-col>
  29. <el-col :span="12">
  30. <el-form-item label="开嘱时间 :">
  31. <span>{{groupForm.advice_date}} </span>
  32. </el-form-item>
  33. </el-col>
  34. </el-row>
  35. <el-row>
  36. <el-col :span="2">&nbsp;&nbsp;</el-col>
  37. <el-col :span="5">
  38. <el-button
  39. :disabled="$store.getters.xt_user.subscibe.state==3?true:false"
  40. round
  41. @click="openAdviceTemplate()"
  42. >选择医嘱模板
  43. </el-button>
  44. </el-col>
  45. <el-col :span="5">
  46. <el-button :disabled="$store.getters.xt_user.subscibe.state==3?true:false" round
  47. @click="openGroupAdvice(0)">新增医嘱内容
  48. </el-button>
  49. </el-col>
  50. <el-col :span="5">
  51. <el-button :disabled="$store.getters.xt_user.subscibe.state==3?true:false" round
  52. @click="openGroupAdvice(1)">修改医嘱内容
  53. </el-button>
  54. </el-col>
  55. <el-col :span="5">
  56. <el-button
  57. :disabled="$store.getters.xt_user.subscibe.state==3?true:false"
  58. round
  59. @click="openDeleteGroupAdvice()"
  60. >删除医嘱内容
  61. </el-button>
  62. </el-col>
  63. </el-row>
  64. <el-row>
  65. <el-col :span="24">
  66. <el-table
  67. id="user-edit-advice-name-table"
  68. :data="groupForm.adviceNames"
  69. border
  70. fit
  71. :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)'}"
  72. highlight-current-row
  73. :row-class-name="groupClassName"
  74. @current-change="selectGroupAdvice"
  75. style="width: 100%;margin-top: 10px;margin-bottom: 10px;"
  76. :row-key="getRowKey"
  77. ref="advicenametable"
  78. >
  79. <el-table-column
  80. label="医嘱名称"
  81. property="advice_name"
  82. align="center"
  83. style="word-break: keep-all;white-space:nowrap;"
  84. ></el-table-column>
  85. <el-table-column
  86. label="药品规格"
  87. property="advice_desc"
  88. align="center"
  89. >
  90. <template slot-scope="scope">
  91. <span
  92. v-if="scope.row.advice_desc"
  93. >{{scope.row.advice_desc}}{{scope.row.drug_spec_unit}}</span>
  94. </template>
  95. </el-table-column>
  96. <!-- <el-table-column label="药品规格*数量" min-width="80" property="drug_spec" align="center">
  97. <template slot-scope="scope">
  98. <span
  99. v-if="scope.row.drug_spec!=0"
  100. >{{scope.row.drug_spec}}{{scope.row.drug_spec_unit}}</span>
  101. <span
  102. v-if="scope.row.prescribing_number!=0"
  103. >*{{scope.row.prescribing_number}}{{scope.row.prescribing_number_unit}}</span>
  104. </template>
  105. </el-table-column> -->
  106. <el-table-column label="开药数量" min-width="80" property="prescribing_number" align="center">
  107. <template slot-scope="scope">
  108. <span
  109. v-if="scope.row.prescribing_number!=0"
  110. >{{scope.row.prescribing_number}}{{scope.row.prescribing_number_unit}}</span>
  111. </template>
  112. </el-table-column>
  113. <el-table-column label="单次用量" min-width="80" property="single_dose" align="center">
  114. <template slot-scope="scope">
  115. <span
  116. v-if="scope.row.single_dose!=0"
  117. >{{scope.row.single_dose}}{{scope.row.single_dose_unit}}</span>
  118. </template>
  119. </el-table-column>
  120. <el-table-column label="给药途径" min-width="80" property="delivery_way" align="center">
  121. <template slot-scope="scope">
  122. <span v-if="scope.row.parent_row==0">{{scope.row.delivery_way}}</span>
  123. </template>
  124. </el-table-column>
  125. <el-table-column
  126. label="执行频率"
  127. min-width="80"
  128. property="execution_frequency"
  129. align="center"
  130. >
  131. <template slot-scope="scope">
  132. <span v-if="scope.row.parent_row==0">{{scope.row.execution_frequency}}</span>
  133. </template>
  134. </el-table-column>
  135. <el-table-column label="医嘱嘱托" min-width="80" property="remark" align="center">
  136. <template slot-scope="scope">
  137. <span v-if="scope.row.parent_row==0">{{scope.row.remark}}</span>
  138. </template>
  139. </el-table-column>
  140. </el-table>
  141. </el-col>
  142. </el-row>
  143. </el-form>
  144. </el-dialog>
  145. <el-dialog title="选择医嘱模板" :visible.sync="templateFormVisible" width="72%" :close-on-click-modal="false">
  146. <el-row :gutter="20">
  147. <el-col :span="8">
  148. <el-table
  149. :data="adviceTemplates"
  150. ref="templatetable"
  151. border
  152. highlight-current-row
  153. @current-change="templateTableChange"
  154. :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)'}"
  155. style="width: 100%">
  156. <el-table-column
  157. prop="name"
  158. align="center"
  159. label="模板名称">
  160. </el-table-column>
  161. </el-table>
  162. </el-col>
  163. <el-col :span="16">
  164. <el-table
  165. id='dialysis-update-select-template-table'
  166. :data="selectedTemp.list"
  167. border
  168. :span-method="spanselecttable"
  169. @select="selectAdvice"
  170. @selection-change="changeAdvice"
  171. @select-all="selectAllTemplateAdvice"
  172. row-key="row_key"
  173. ref="selecttemplatetable"
  174. style="width: 100%"
  175. :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)'}"
  176. >
  177. <el-table-column
  178. type="selection"
  179. width="55">
  180. </el-table-column>
  181. <el-table-column
  182. label="医嘱内容"
  183. property="advice_name"
  184. align="center"
  185. style="word-break: keep-all;white-space:nowrap;"
  186. ></el-table-column>
  187. <el-table-column
  188. label="规格"
  189. align="center"
  190. >
  191. <template slot-scope="scope">
  192. <span
  193. v-if="scope.row.advice_desc"
  194. >{{scope.row.advice_desc}}{{scope.row.drug_spec_unit}}</span>
  195. </template>
  196. </el-table-column>
  197. <el-table-column label="开药数量" min-width="80" property="prescribing_number" align="center">
  198. <template slot-scope="scope">
  199. <span
  200. v-if="scope.row.prescribing_number!=0"
  201. >{{scope.row.prescribing_number}}{{scope.row.prescribing_number_unit}}</span>
  202. </template>
  203. </el-table-column>
  204. <el-table-column label="单次用量" min-width="80" property="single_dose" align="center">
  205. <template slot-scope="scope">
  206. <span
  207. v-if="scope.row.single_dose!=0"
  208. >{{scope.row.single_dose}}{{scope.row.single_dose_unit}}</span>
  209. </template>
  210. </el-table-column>
  211. <el-table-column label="给药途径" min-width="80" property="delivery_way" align="center">
  212. <template slot-scope="scope">
  213. <span v-if="scope.row.parent_row==0">{{scope.row.delivery_way}}</span>
  214. </template>
  215. </el-table-column>
  216. <el-table-column
  217. label="执行频率"
  218. min-width="80"
  219. property="execution_frequency"
  220. align="center"
  221. >
  222. <template slot-scope="scope">
  223. <span v-if="scope.row.parent_row==0">{{scope.row.execution_frequency}}</span>
  224. </template>
  225. </el-table-column>
  226. </el-table>
  227. </el-col>
  228. </el-row>
  229. <div slot="footer" class="dialog-footer">
  230. <el-button @click="cancleDialog()">取消</el-button>
  231. <el-button
  232. :disabled="$store.getters.xt_user.subscibe.state==3?true:false"
  233. type="primary"
  234. @click="newAddTempForm()"
  235. >保 存
  236. </el-button>
  237. </div>
  238. </el-dialog>
  239. <el-dialog title="选择医嘱模板" :visible.sync="oldTemplateFormVisible" width="700px">
  240. <el-form ref="templateForm" :rules="templateRules" :model="templateForm">
  241. <el-row>
  242. <el-col :span="24">
  243. <el-form-item prop="id">
  244. <el-select
  245. v-model="templateForm.id"
  246. filterable
  247. clearable
  248. placeholder="请选择(输入可搜索)"
  249. style="width:100%"
  250. >
  251. <el-option
  252. v-for="item in adviceTemplates"
  253. :key="item.id"
  254. :label="item.name"
  255. :value="item.id"
  256. ></el-option>
  257. </el-select>
  258. </el-form-item>
  259. </el-col>
  260. </el-row>
  261. </el-form>
  262. <div slot="footer" class="dialog-footer">
  263. <el-button @click="templateFormVisible = false">取消</el-button>
  264. <el-button
  265. :disabled="$store.getters.xt_user.subscibe.state==3?true:false"
  266. type="primary"
  267. @click="addTempForm('templateForm')"
  268. >保 存
  269. </el-button>
  270. </div>
  271. </el-dialog>
  272. <el-dialog :title="nameFormTitle" :visible.sync="nameFormVisible" width="700px">
  273. <el-form ref="nameForm" :rules="nameRules" :model="nameForm" label-width="90px">
  274. <el-row>
  275. <el-col :span="12">
  276. <el-form-item label="医嘱内容 :" required prop="advice_name">
  277. <el-input v-model="nameForm.advice_name"></el-input>
  278. </el-form-item>
  279. </el-col>
  280. <el-col :span="12">
  281. <!--<el-form-item label="规格 :" prop="advice_desc">-->
  282. <!--<el-input v-model="nameForm.advice_desc"></el-input>-->
  283. <!--</el-form-item>-->
  284. <el-form-item label="药品规格 :" prop="advice_desc">
  285. <el-col :span="8">
  286. <el-input v-model="nameForm.advice_desc"></el-input>
  287. </el-col>
  288. <el-col class="line" :span="2">&nbsp;</el-col>
  289. <el-col :span="14">
  290. <el-select
  291. v-model="nameForm.drug_spec_unit"
  292. filterable
  293. clearable
  294. allow-create
  295. placeholder="选择"
  296. >
  297. <el-option
  298. v-for="item in unitsOption"
  299. :key="item.id"
  300. :label="item.name "
  301. :value="item.name"
  302. ></el-option>
  303. </el-select>
  304. </el-col>
  305. </el-form-item>
  306. </el-col>
  307. </el-row>
  308. <el-row>
  309. <el-col :span="12">
  310. <el-form-item label="开药数量 :" prop="prescribing_number">
  311. <el-col :span="8">
  312. <el-input v-model="nameForm.prescribing_number"></el-input>
  313. </el-col>
  314. <el-col class="line" :span="2">&nbsp;</el-col>
  315. <el-col :span="14">
  316. <el-select
  317. v-model="nameForm.prescribing_number_unit"
  318. filterable
  319. clearable
  320. allow-create
  321. placeholder="选择"
  322. >
  323. <el-option
  324. v-for="item in unitsOption"
  325. :key="item.id"
  326. :label="item.name "
  327. :value="item.name"
  328. ></el-option>
  329. </el-select>
  330. </el-col>
  331. </el-form-item>
  332. </el-col>
  333. <el-col :span="12">
  334. <el-form-item label="单次用量 :" prop="single_dose">
  335. <el-col :span="8">
  336. <el-input v-model="nameForm.single_dose"></el-input>
  337. </el-col>
  338. <el-col class="line" :span="2">&nbsp;</el-col>
  339. <el-col :span="14">
  340. <el-select
  341. v-model="nameForm.single_dose_unit"
  342. filterable
  343. clearable
  344. allow-create
  345. placeholder="选择"
  346. >
  347. <el-option
  348. v-for="item in unitsOption"
  349. :key="item.id"
  350. :label="item.name "
  351. :value="item.name"
  352. ></el-option>
  353. </el-select>
  354. </el-col>
  355. </el-form-item>
  356. </el-col>
  357. </el-row>
  358. <el-row>
  359. <el-col :span="12">
  360. <el-form-item label="给药途径 :" prop="delivery_way">
  361. <el-select
  362. v-model="nameForm.delivery_way"
  363. filterable
  364. clearable
  365. allow-create
  366. :disabled="isChild"
  367. placeholder="请选择(输入可搜索)"
  368. style="width:100%"
  369. >
  370. <el-option
  371. v-for="item in deliveryWayOptions"
  372. :key="item.id"
  373. :label="item.name "
  374. :value="item.name"
  375. ></el-option>
  376. </el-select>
  377. </el-form-item>
  378. </el-col>
  379. <el-col :span="12">
  380. <el-form-item label="执行频率 :" prop="execution_frequency">
  381. <el-select
  382. v-model="nameForm.execution_frequency"
  383. filterable
  384. clearable
  385. allow-create
  386. :disabled="isChild"
  387. placeholder="请选择(输入可搜索)"
  388. style="width:100%"
  389. >
  390. <el-option
  391. v-for="item in executionFrequencyOptions"
  392. :key="item.id"
  393. :label="item.name"
  394. :value="item.name"
  395. ></el-option>
  396. </el-select>
  397. </el-form-item>
  398. </el-col>
  399. </el-row>
  400. </el-form>
  401. <div slot="footer" class="dialog-footer">
  402. <el-button @click="nameFormVisible = false">取消</el-button>
  403. <el-button
  404. :disabled="$store.getters.xt_user.subscibe.state==3?true:false"
  405. type="primary"
  406. @click="submitNameForm('nameForm')"
  407. >保 存
  408. </el-button>
  409. </div>
  410. </el-dialog>
  411. </div>
  412. </template>
  413. <script>
  414. import {
  415. CreateDoctorAdvice,
  416. CreateGroupAdvice,
  417. DeleteDoctorAdvice,
  418. DeleteGroupAdvice,
  419. EditDoctorAdvice,
  420. getAdviceConfig,
  421. getDoctorAdviceList,
  422. StopDoctorAdvice
  423. } from '@/api/advice'
  424. import { jsGetAge, uParseTime } from '@/utils/tools'
  425. export default {
  426. name: 'AddGroupAdvice',
  427. data() {
  428. return {
  429. editRowKey: 0,
  430. oldTemplateFormVisible: false,
  431. templateFormVisible: false,
  432. groupEditFormVisible: false,
  433. nameFormVisible: false,
  434. groupSelectRow: null,
  435. nameFormTitle: '',
  436. isChild: false,
  437. isEdit: false,
  438. groupRules: {
  439. advice_type: [{ required: true, message: '请选择医嘱类型' }],
  440. advice_date: [{ required: true, message: '请选择医嘱时间' }],
  441. start_time: [{ required: true, message: '请选择开始时间' }],
  442. advice_name: [{ required: true, message: '请填写医嘱名称' }],
  443. advice_doctor: [{ required: true, message: '请选择开嘱医生' }]
  444. },
  445. nameRules: {
  446. advice_name: [{ required: true, message: '请填写医嘱内容' }]
  447. },
  448. templateRules: {
  449. id: [{ required: true, message: '请选择医嘱模板' }]
  450. },
  451. templateForm: { id: '' },
  452. nameForm: {
  453. advice_name: '',
  454. advice_desc: '',
  455. single_dose: '',
  456. single_dose_unit: '',
  457. drug_spec: '',
  458. drug_spec_unit: '',
  459. prescribing_number: '',
  460. prescribing_number_unit: '',
  461. delivery_way: '',
  462. execution_frequency: '',
  463. isEdit: 0,
  464. index: 0,
  465. id: 0,
  466. children: []
  467. },
  468. submitGroupForm: {
  469. advice_type: '',
  470. advice_date: '',
  471. start_time: '',
  472. adviceNames: [],
  473. advice_doctor: '',
  474. remark: '',
  475. parent_id: 0
  476. },
  477. groupForm: {
  478. advice_type: '',
  479. advice_date: '',
  480. start_time: '',
  481. adviceNames: [],
  482. advice_doctor: '',
  483. remark: '',
  484. parent_id: 0
  485. },
  486. adminusername: '',
  487. selectedTemp: { 'id': 0, name: '', org_id: 0, 'list': [], 'rows': [] },
  488. selectedTemplate: [],
  489. allSelectedTemplate: []
  490. }
  491. },
  492. props: {
  493. patientID: 0,
  494. adviceType: 0,
  495. rowKey: 0,
  496. groupNo: 0,
  497. adviceTemplates: {
  498. type: Array,
  499. default: function() {
  500. return []
  501. }
  502. },
  503. recordDate: '',
  504. adviceTypeOptions: {
  505. type: Array,
  506. default: function() {
  507. return []
  508. }
  509. },
  510. deliveryWayOptions: {
  511. type: Array,
  512. default: () => []
  513. },
  514. unitsOption: {
  515. type: Array,
  516. default: function() {
  517. return []
  518. }
  519. },
  520. executionFrequencyOptions: {
  521. type: Array,
  522. default: function() {
  523. return []
  524. }
  525. },
  526. adviceTemplateMaps: {
  527. type: Object,
  528. default: function() {
  529. return {}
  530. }
  531. },
  532. adviceTableData: {
  533. type: Array,
  534. default: function() {
  535. return []
  536. }
  537. },
  538. admin_users: { // 系统用户列表
  539. type: Array,
  540. default: () => {
  541. return []
  542. }
  543. }
  544. },
  545. methods: {
  546. getXuserName(id) {
  547. if (id <= 0) {
  548. return ''
  549. }
  550. var name = ''
  551. if (
  552. this.admin_users == null ||
  553. typeof this.admin_users.length === 'undefined'
  554. ) {
  555. return name
  556. }
  557. var leng = this.admin_users.length
  558. if (leng == 0) {
  559. return name
  560. }
  561. for (let index = 0; index < leng; index++) {
  562. if (this.admin_users[index].id == id) {
  563. name = this.admin_users[index].name
  564. break
  565. }
  566. }
  567. return name
  568. },
  569. openDeleteGroupAdvice() {
  570. if (this.groupSelectRow === null) {
  571. this.$message.error("未选择要删除的医嘱内容")
  572. return
  573. }
  574. console.log(this.groupSelectRow)
  575. var content = ''
  576. if (this.groupSelectRow.children.length > 0) {
  577. content = '确认删除此医嘱内容,包括它的子药?'
  578. } else {
  579. content = '确认删除此医嘱内容?'
  580. }
  581. var isChild = !!this.groupSelectRow.parent_row
  582. var title = isChild ? '删除子药内容' : '删除医嘱内容'
  583. var msg = isChild ? '确认删除此子药内容?' : content
  584. this.$confirm(msg, title, {
  585. confirmButtonText: '确定',
  586. cancelButtonText: '取消',
  587. type: 'warning'
  588. }).then(() => {
  589. let mode = "4"
  590. DeleteDoctorAdvice(this.groupSelectRow.id,mode).then(response => {
  591. if (response.data.state == 0) {
  592. this.$message.error(response.data.msg)
  593. return false
  594. } else {
  595. this.$notify({
  596. title: '成功',
  597. message: '医嘱已经删除',
  598. type: 'success',
  599. duration: 2000
  600. })
  601. var ale = this.groupForm.adviceNames.length
  602. var atle = this.adviceTableData.length
  603. for (let index = atle - 1; index >= 0; index--) {
  604. if (this.adviceTableData[index].parent_id === this.groupSelectRow.id || this.adviceTableData[index].id === this.groupSelectRow.id) {
  605. this.adviceTableData.splice(index, 1)
  606. }
  607. }
  608. if (isChild) {
  609. for (const index in this.groupForm.adviceNames) {
  610. if (this.groupForm.adviceNames[index].row_key == this.groupSelectRow.parent_row) {
  611. for (const j in this.groupForm.adviceNames[index].children) {
  612. if (this.groupForm.adviceNames[index].children[j].row_key == this.groupSelectRow.row_key) {
  613. this.groupForm.adviceNames[index].children.splice(j, 1)
  614. this.$set(this.groupForm.adviceNames, index, this.groupForm.adviceNames[index])
  615. break
  616. }
  617. }
  618. }
  619. }
  620. } else {
  621. for (const index in this.groupForm.adviceNames) {
  622. if (this.groupForm.adviceNames[index].row_key == this.groupSelectRow.row_key) {
  623. this.groupForm.adviceNames.splice(index, 1)
  624. break
  625. }
  626. }
  627. }
  628. }
  629. })
  630. if (isChild) {
  631. for (const index in this.groupForm.adviceNames) {
  632. if (this.groupForm.adviceNames[index].row_key == this.groupSelectRow.parent_row) {
  633. for (const j in this.groupForm.adviceNames[index].children) {
  634. if (this.groupForm.adviceNames[index].children[j].row_key == this.groupSelectRow.row_key) {
  635. this.groupForm.adviceNames[index].children.splice(j, 1)
  636. this.$set(this.groupForm.adviceNames, index, this.groupForm.adviceNames[index])
  637. this.toggleRowExpansion()
  638. break
  639. }
  640. }
  641. }
  642. }
  643. } else {
  644. for (const index in this.groupForm.adviceNames) {
  645. if (this.groupForm.adviceNames[index].row_key == this.groupSelectRow.row_key) {
  646. this.groupForm.adviceNames.splice(index, 1)
  647. this.toggleRowExpansion()
  648. break
  649. }
  650. }
  651. }
  652. }).catch(() => {
  653. })
  654. },
  655. submitNameForm(formName) {
  656. var _this = this
  657. this.$refs[formName].validate((valid) => {
  658. if (valid) {
  659. if (_this.nameForm.isEdit) {
  660. var submitForm = {
  661. advice_type: _this.groupForm.advice_type,
  662. advice_date: _this.groupForm.advice_date,
  663. start_time: _this.groupForm.start_time,
  664. advice_name: _this.nameForm.advice_name,
  665. advice_desc: _this.nameForm.advice_desc,
  666. single_dose: '' + _this.nameForm.single_dose,
  667. single_dose_unit: _this.nameForm.single_dose_unit,
  668. drug_spec: '' + _this.nameForm.drug_spec,
  669. drug_spec_unit: _this.nameForm.drug_spec_unit,
  670. prescribing_number: '' + _this.nameForm.prescribing_number,
  671. prescribing_number_unit: _this.nameForm.prescribing_number_unit,
  672. delivery_way: _this.nameForm.delivery_way,
  673. execution_frequency: _this.nameForm.execution_frequency,
  674. isEdit: 0,
  675. id: 0,
  676. advice_doctor: '',
  677. remark: _this.groupForm.remark,
  678. parent_id: _this.groupSelectRow.parent_id,
  679. groupno: _this.groupForm.groupno
  680. }
  681. let mode = "2"
  682. EditDoctorAdvice(this.patientID, this.groupSelectRow.id, submitForm,mode).then(response => {
  683. if (response.data.state == 0) {
  684. this.$message.error(response.data.msg)
  685. return false
  686. } else {
  687. this.$notify({
  688. title: '成功',
  689. message: '修改医嘱成功',
  690. type: 'success',
  691. duration: 2000
  692. })
  693. var ale = _this.groupForm.adviceNames.length
  694. var atle = _this.adviceTableData.length
  695. for (let index = 0; index < atle; index++) {
  696. if (_this.groupSelectRow.id == _this.adviceTableData[index].id) {
  697. var advice = response.data.data.advice
  698. _this.adviceTableData[index].drug_spec = advice.drug_spec
  699. _this.adviceTableData[index].drug_spec_unit = advice.drug_spec_unit
  700. _this.adviceTableData[index].start_time = advice.start_time
  701. _this.adviceTableData[index].advice_name = advice.advice_name
  702. _this.adviceTableData[index].advice_desc = advice.advice_desc
  703. _this.adviceTableData[index].single_dose = advice.single_dose
  704. _this.adviceTableData[index].single_dose_unit = advice.single_dose_unit
  705. _this.adviceTableData[index].delivery_way = advice.delivery_way
  706. _this.adviceTableData[index].execution_frequency = advice.execution_frequency
  707. _this.adviceTableData[index].prescribing_number = advice.prescribing_number
  708. _this.adviceTableData[index].prescribing_number_unit = advice.prescribing_number_unit
  709. break
  710. }
  711. }
  712. if (_this.isChild) {
  713. for (let index = 0; index < ale; index++) {
  714. if (_this.groupSelectRow.parent_row == _this.groupForm.adviceNames[index].row_key) {
  715. var cle = _this.groupForm.adviceNames[index].children.length
  716. var children = _this.groupForm.adviceNames[index].children
  717. for (let j = 0; j < ale; j++) {
  718. if (_this.groupSelectRow.row_key == children[j].row_key) {
  719. _this.groupForm.adviceNames[index].children[j].advice_name = _this.nameForm.advice_name
  720. _this.groupForm.adviceNames[index].children[j].advice_desc = _this.nameForm.advice_desc
  721. _this.groupForm.adviceNames[index].children[j].single_dose = '' + _this.nameForm.single_dose
  722. _this.groupForm.adviceNames[index].children[j].single_dose_unit = _this.nameForm.single_dose_unit
  723. _this.groupForm.adviceNames[index].children[j].drug_spec = '' + _this.nameForm.drug_spec
  724. _this.groupForm.adviceNames[index].children[j].drug_spec_unit = _this.nameForm.drug_spec_unit
  725. _this.groupForm.adviceNames[index].children[j].prescribing_number = '' + _this.nameForm.prescribing_number
  726. _this.groupForm.adviceNames[index].children[j].prescribing_number_unit = _this.nameForm.prescribing_number_unit
  727. _this.groupForm.adviceNames[index].children[j].delivery_way = _this.nameForm.delivery_way
  728. _this.groupForm.adviceNames[index].children[j].execution_frequency = _this.nameForm.execution_frequency
  729. _this.$set(_this.groupForm.adviceNames[index].children, j, _this.groupForm.adviceNames[index].children[j])
  730. break
  731. }
  732. }
  733. }
  734. }
  735. } else {
  736. for (let index = 0; index < ale; index++) {
  737. if (_this.groupSelectRow.row_key == _this.groupForm.adviceNames[index].row_key) {
  738. _this.groupForm.adviceNames[index].advice_name = _this.nameForm.advice_name
  739. _this.groupForm.adviceNames[index].advice_desc = _this.nameForm.advice_desc
  740. _this.groupForm.adviceNames[index].single_dose = '' + _this.nameForm.single_dose
  741. _this.groupForm.adviceNames[index].single_dose_unit = _this.nameForm.single_dose_unit
  742. _this.groupForm.adviceNames[index].drug_spec = '' + _this.nameForm.drug_spec
  743. _this.groupForm.adviceNames[index].drug_spec_unit = _this.nameForm.drug_spec_unit
  744. _this.groupForm.adviceNames[index].prescribing_number = '' + _this.nameForm.prescribing_number
  745. _this.groupForm.adviceNames[index].prescribing_number_unit = _this.nameForm.prescribing_number_unit
  746. _this.groupForm.adviceNames[index].delivery_way = _this.nameForm.delivery_way
  747. _this.groupForm.adviceNames[index].execution_frequency = _this.nameForm.execution_frequency
  748. _this.$set(_this.groupForm.adviceNames, index, _this.groupForm.adviceNames[index])
  749. break
  750. }
  751. }
  752. }
  753. }
  754. })
  755. } else {
  756. if (_this.isChild) {
  757. var submitForm = {
  758. advice_type: _this.groupForm.advice_type,
  759. advice_date: _this.groupForm.advice_date,
  760. start_time: _this.groupForm.start_time,
  761. advice_name: _this.nameForm.advice_name,
  762. advice_desc: _this.nameForm.advice_desc,
  763. single_dose: '' + _this.nameForm.single_dose,
  764. single_dose_unit: _this.nameForm.single_dose_unit,
  765. drug_spec: '' + _this.nameForm.drug_spec,
  766. drug_spec_unit: _this.nameForm.drug_spec_unit,
  767. prescribing_number: '' + _this.nameForm.prescribing_number,
  768. prescribing_number_unit: _this.nameForm.prescribing_number_unit,
  769. delivery_way: _this.nameForm.delivery_way,
  770. execution_frequency: _this.nameForm.execution_frequency,
  771. isEdit: 0,
  772. id: 0,
  773. advice_doctor: '',
  774. remark: _this.groupForm.remark,
  775. parent_id: _this.groupSelectRow.id,
  776. groupno: _this.groupForm.groupno
  777. }
  778. let mode = "1"
  779. CreateDoctorAdvice(this.patientID, submitForm,mode).then(response => {
  780. if (response.data.state == 0) {
  781. this.$message.error(response.data.msg)
  782. return false
  783. } else {
  784. this.$notify({
  785. title: '成功',
  786. message: '新增子药成功',
  787. type: 'success',
  788. duration: 2000
  789. })
  790. var spliceIndex = -1
  791. for (let index = _this.adviceTableData.length - 1; ; index--) {
  792. if (_this.adviceTableData[index].parent_id === _this.groupSelectRow.id) {
  793. spliceIndex = index
  794. break
  795. } else if (_this.adviceTableData[index].id === _this.groupSelectRow.id) {
  796. spliceIndex = index
  797. break
  798. }
  799. }
  800. if (spliceIndex > -1) {
  801. spliceIndex += 1
  802. if (spliceIndex === _this.adviceTableData.length) {
  803. _this.adviceTableData.push(response.data.data.advice)
  804. } else {
  805. _this.adviceTableData.splice(spliceIndex, 0, response.data.data.advice)
  806. }
  807. }
  808. var ale = _this.groupForm.adviceNames.length
  809. for (let index = 0; index < ale; index++) {
  810. if (_this.nameForm.parent_row == _this.groupForm.adviceNames[index].row_key) {
  811. _this.editRowKey++
  812. _this.nameForm.row_key = _this.editRowKey
  813. _this.groupForm.adviceNames[index].children.push(_this.nameForm)
  814. _this.$set(_this.groupForm.adviceNames, index, _this.groupForm.adviceNames[index])
  815. break
  816. }
  817. }
  818. // _this.resetForm(formName);
  819. return false
  820. }
  821. })
  822. } else {
  823. _this.submitGroupForm = {
  824. advice_type: _this.groupForm.advice_type,
  825. advice_date: _this.groupForm.advice_date,
  826. start_time: _this.groupForm.start_time,
  827. adviceNames: [
  828. {
  829. advice_name: _this.nameForm.advice_name,
  830. advice_desc: _this.nameForm.advice_desc,
  831. single_dose: '' + _this.nameForm.single_dose,
  832. single_dose_unit: _this.nameForm.single_dose_unit,
  833. drug_spec: '' + _this.nameForm.drug_spec,
  834. drug_spec_unit: _this.nameForm.drug_spec_unit,
  835. prescribing_number: '' + _this.nameForm.prescribing_number,
  836. prescribing_number_unit: _this.nameForm.prescribing_number_unit,
  837. delivery_way: _this.nameForm.delivery_way,
  838. execution_frequency: _this.nameForm.execution_frequency,
  839. isEdit: 0,
  840. id: 0,
  841. children: [],
  842. parent_row: 0
  843. }
  844. ],
  845. advice_doctor: '',
  846. remark: _this.groupForm.remark,
  847. parent_id: 0
  848. }
  849. let mode = "1"
  850. CreateGroupAdvice(_this.patientID, _this.groupForm.groupno, _this.submitGroupForm, mode).then(response => {
  851. if (response.data.state == 0) {
  852. _this.$message.error(response.data.msg)
  853. return false
  854. } else {
  855. _this.$notify({
  856. title: '成功',
  857. message: '新增成功',
  858. type: 'success',
  859. duration: 2000
  860. })
  861. // var alen = response.data.data.advices.length
  862. // for (let index = alen-1; index >=0; index--) {
  863. // _this.adviceTableData.unshift(response.data.data.advices[index]);
  864. // }
  865. // for (const index in response.data.data.advices) {
  866. // _this.adviceTableData.unshift(response.data.data.advices[index]);
  867. // }
  868. var groups = response.data.data.advices
  869. var childMap = {}
  870. for (const index in groups) {
  871. if (groups[index].parent_id == 0) {
  872. continue
  873. }
  874. if ((groups[index].parent_id in childMap) === false) {
  875. childMap[groups[index].parent_id] = []
  876. }
  877. childMap[groups[index].parent_id].push(groups[index])
  878. }
  879. var parentArr = []
  880. for (const index in groups) {
  881. if (groups[index].parent_id > 0) {
  882. continue
  883. }
  884. parentArr.push(groups[index])
  885. }
  886. var groupNo = groups[0].groupno
  887. var newData = { groupNo: parentArr }
  888. for (const index in _this.adviceTableData) {
  889. if (_this.adviceTableData[index].groupno == groupNo) {
  890. for (const i in parentArr) {
  891. if (parentArr[i].id in childMap) {
  892. for (const j in childMap[parentArr[i].id]) {
  893. _this.adviceTableData.splice(index, 0, childMap[parentArr[i].id][j])
  894. }
  895. }
  896. _this.adviceTableData.splice(index, 0, parentArr[i])
  897. }
  898. break
  899. }
  900. }
  901. for (const index in groups) {
  902. if (groups[index].parent_id > 0) {
  903. continue
  904. }
  905. _this.editRowKey++
  906. var item = {
  907. advice_name: groups[index].advice_name,
  908. advice_desc: groups[index].advice_desc,
  909. single_dose: '' + groups[index].single_dose,
  910. single_dose_unit: groups[index].single_dose_unit,
  911. drug_spec: '' + groups[index].drug_spec,
  912. drug_spec_unit: groups[index].drug_spec_unit,
  913. prescribing_number: '' + groups[index].prescribing_number,
  914. prescribing_number_unit: groups[index].prescribing_number_unit,
  915. delivery_way: groups[index].delivery_way,
  916. execution_frequency: groups[index].execution_frequency,
  917. isEdit: 0,
  918. index: 0,
  919. id: groups[index].id,
  920. children: [],
  921. parent_row: 0,
  922. row_key: _this.editRowKey
  923. }
  924. if (item.id in childMap) {
  925. for (const key in childMap[item.id]) {
  926. _this.editRowKey++
  927. var child = {
  928. advice_name: childMap[item.id][key].advice_name,
  929. advice_desc: childMap[item.id][key].advice_desc,
  930. single_dose: '' + childMap[item.id][key].single_dose,
  931. single_dose_unit: childMap[item.id][key].single_dose_unit,
  932. drug_spec: '' + childMap[item.id][key].drug_spec,
  933. drug_spec_unit: childMap[item.id][key].drug_spec_unit,
  934. prescribing_number: '' + childMap[item.id][key].prescribing_number,
  935. prescribing_number_unit: childMap[item.id][key].prescribing_number_unit,
  936. delivery_way: childMap[item.id][key].delivery_way,
  937. execution_frequency: childMap[item.id][key].execution_frequency,
  938. isEdit: 0,
  939. index: 0,
  940. id: childMap[item.id][key].id,
  941. children: [],
  942. parent_row: item.row_key,
  943. row_key: _this.editRowKey
  944. }
  945. item.children.push(child)
  946. }
  947. _this.$set(item, 'children', item.children)
  948. }
  949. _this.groupForm.adviceNames.unshift(item)
  950. }
  951. _this.resetForm(formName)
  952. return false
  953. }
  954. })
  955. }
  956. }
  957. _this.nameFormVisible = false
  958. }
  959. })
  960. },
  961. openGroupChild() {
  962. if (this.groupSelectRow === null) {
  963. this.$message.error("未选择医嘱内容,无法添加子药")
  964. return
  965. } else if (this.groupSelectRow.parent_row > 0) {
  966. this.$notify.error({
  967. title: '错误',
  968. message: '子药不能添加子药'
  969. })
  970. return
  971. }
  972. this.nameForm = {
  973. advice_name: '',
  974. advice_desc: '',
  975. single_dose: '',
  976. single_dose_unit: '',
  977. drug_spec: '',
  978. drug_spec_unit: '',
  979. prescribing_number: '',
  980. prescribing_number_unit: '',
  981. delivery_way: this.groupSelectRow.delivery_way,
  982. execution_frequency: this.groupSelectRow.execution_frequency,
  983. isEdit: 0,
  984. index: 0,
  985. children: [],
  986. parent_row: this.groupSelectRow.row_key,
  987. id: 0
  988. }
  989. this.isChild = true
  990. this.nameFormVisible = true
  991. this.nameFormTitle = '添加子药内容'
  992. },
  993. openGroupAdvice(isEdit) {
  994. this.isChild = false
  995. if (isEdit) {
  996. if (this.groupSelectRow === null) {
  997. this.$message.error("未选择要修改的医嘱内容")
  998. return
  999. }
  1000. if (this.groupSelectRow.parent_row) {
  1001. this.isChild = true
  1002. }
  1003. this.nameForm = {
  1004. advice_name: this.groupSelectRow.advice_name,
  1005. advice_desc: this.groupSelectRow.advice_desc,
  1006. single_dose: this.groupSelectRow.single_dose != 0 ? this.groupSelectRow.single_dose : '',
  1007. single_dose_unit: this.groupSelectRow.single_dose_unit,
  1008. drug_spec: this.groupSelectRow.drug_spec != 0 ? this.groupSelectRow.drug_spec : '',
  1009. drug_spec_unit: this.groupSelectRow.drug_spec_unit,
  1010. prescribing_number: this.groupSelectRow.prescribing_number != 0 ? this.groupSelectRow.prescribing_number : '',
  1011. prescribing_number_unit: this.groupSelectRow.prescribing_number_unit,
  1012. delivery_way: this.isChild ? '' : this.groupSelectRow.delivery_way,
  1013. execution_frequency: this.isChild ? '' : this.groupSelectRow.execution_frequency,
  1014. isEdit: 1,
  1015. index: this.groupSelectRow.index,
  1016. id: this.groupSelectRow.id,
  1017. children: [],
  1018. parent_row: this.groupSelectRow.parent_row
  1019. // row_key:this.groupSelectRow.row_key,
  1020. }
  1021. this.nameFormTitle = '修改医嘱内容'
  1022. this.nameFormVisible = true
  1023. } else {
  1024. this.nameForm = {
  1025. advice_name: '',
  1026. advice_desc: '',
  1027. single_dose: '',
  1028. single_dose_unit: '',
  1029. drug_spec: '',
  1030. drug_spec_unit: '',
  1031. prescribing_number: '',
  1032. prescribing_number_unit: '',
  1033. delivery_way: '',
  1034. execution_frequency: '',
  1035. isEdit: 0,
  1036. index: 0,
  1037. id: 0,
  1038. children: [],
  1039. parent_row: 0
  1040. }
  1041. this.nameFormTitle = '新增医嘱内容'
  1042. }
  1043. this.nameFormVisible = true
  1044. },
  1045. changeAdvice(selection) {
  1046. this.selectedTemplate = selection
  1047. }, selectAllTemplateAdvice(selection) {
  1048. var adviceArray = this.adviceTemplateMaps[this.selectedTemp.id].DoctorAdviceTemplate
  1049. for (let y = 0; y < adviceArray.length; y++) {
  1050. adviceArray[y].selection = false
  1051. }
  1052. if (selection.length > 0) {
  1053. for (let y = 0; y < adviceArray.length; y++) {
  1054. for (let i = 0; i < selection.length; i++) {
  1055. if (adviceArray[y].id == selection[i].advice_id) {
  1056. adviceArray[y].selection = true
  1057. }
  1058. }
  1059. }
  1060. }
  1061. },
  1062. selectAdvice(selection, row) {
  1063. // this.selectedTemplate = [];
  1064. var adviceArray = this.adviceTemplateMaps[this.selectedTemp.id].DoctorAdviceTemplate
  1065. for (let y = 0; y < adviceArray.length; y++) {
  1066. adviceArray[y].selection = false
  1067. }
  1068. if (selection.length > 0) {
  1069. for (let y = 0; y < adviceArray.length; y++) {
  1070. for (let i = 0; i < selection.length; i++) {
  1071. if (adviceArray[y].id == selection[i].advice_id) {
  1072. adviceArray[y].selection = true
  1073. }
  1074. }
  1075. }
  1076. }
  1077. // this.selectedTemplate = [];
  1078. if (row.children.length > 0) {
  1079. for (const index in row.children) {
  1080. this.$refs.selecttemplatetable.toggleRowSelection(row.children[index])
  1081. }
  1082. }
  1083. // 下面两步的作用是为了上选中的数据的输出顺序不变
  1084. for (const index in this.selectedTemp.list) {
  1085. this.$refs.selecttemplatetable.toggleRowSelection(this.selectedTemp.list[index])
  1086. if (this.selectedTemp.list[index].children.length > 0) {
  1087. for (const j in this.selectedTemp.list[index].children) {
  1088. this.$refs.selecttemplatetable.toggleRowSelection(this.selectedTemp.list[index].children[j])
  1089. }
  1090. }
  1091. }
  1092. for (const index in this.selectedTemp.list) {
  1093. this.$refs.selecttemplatetable.toggleRowSelection(this.selectedTemp.list[index])
  1094. if (this.selectedTemp.list[index].children.length > 0) {
  1095. for (const j in this.selectedTemp.list[index].children) {
  1096. this.$refs.selecttemplatetable.toggleRowSelection(this.selectedTemp.list[index].children[j])
  1097. }
  1098. }
  1099. }
  1100. }, cancleDialog() {
  1101. this.templateFormVisible = false
  1102. for (const indexs in this.adviceTemplateMaps) {
  1103. const adviceTemplate = this.adviceTemplateMaps[indexs]
  1104. for (const index in adviceTemplate.DoctorAdviceTemplate) {
  1105. adviceTemplate.DoctorAdviceTemplate[index].selection = false
  1106. }
  1107. }
  1108. },
  1109. spanselecttable({ row, column, rowIndex, columnIndex }) {
  1110. if (columnIndex == 0) {
  1111. const _row = this.selectedTemp.rows[rowIndex]
  1112. const _col = _row > 0 ? 1 : 0
  1113. return {
  1114. rowspan: _row,
  1115. colspan: _col
  1116. }
  1117. }
  1118. },
  1119. calcselectedTemp() {
  1120. var rowKeys = 0
  1121. for (const index in this.selectedTemp.list) {
  1122. var pkey = rowKeys
  1123. this.selectedTemp.rows[rowKeys] = 1
  1124. if (this.selectedTemp.list[index].children.length > 0) {
  1125. for (const childindex in this.selectedTemp.list[index].children) {
  1126. rowKeys++
  1127. this.selectedTemp.rows[pkey] += 1
  1128. this.selectedTemp.rows[rowKeys] = 0
  1129. }
  1130. }
  1131. rowKeys++
  1132. this.$nextTick(function() {
  1133. if (this.selectedTemp.list[index].selection) {
  1134. this.$refs.selecttemplatetable.toggleRowSelection(this.selectedTemp.list[index])
  1135. }
  1136. })
  1137. }
  1138. },
  1139. templateTableChange(currentRow, oldCurrentRow) {
  1140. this.selectedTemp = { 'id': 0, name: '', org_id: 0, 'list': [], 'rows': [] }
  1141. if (currentRow == null) {
  1142. return false
  1143. }
  1144. this.selectedTemp.id = currentRow.id
  1145. this.selectedTemp.name = currentRow.name
  1146. this.selectedTemp.org_id = currentRow.org_id
  1147. if (this.selectedTemp.id in this.adviceTemplateMaps) {
  1148. var mapid = this.selectedTemp.id
  1149. var thisRowKey = 0
  1150. for (const index in this.adviceTemplateMaps[mapid].DoctorAdviceTemplate) {
  1151. thisRowKey++
  1152. var item = {
  1153. advice_name: this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index].advice_name,
  1154. advice_desc: this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index].advice_desc,
  1155. single_dose: '' + this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index].single_dose,
  1156. single_dose_unit: this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index].single_dose_unit,
  1157. drug_spec: '' + this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index].drug_spec,
  1158. drug_spec_unit: this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index].drug_spec_unit,
  1159. prescribing_number: '' + this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index].prescribing_number,
  1160. prescribing_number_unit: this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index].prescribing_number_unit,
  1161. delivery_way: this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index].delivery_way,
  1162. execution_frequency: this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index].execution_frequency,
  1163. advice_id: this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index].id,
  1164. selection: this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index].selection,
  1165. isEdit: 0,
  1166. id: 0,
  1167. children: [],
  1168. parent_row: 0,
  1169. row_key: thisRowKey
  1170. }
  1171. if ('children' in this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index] && this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index].children.length > 0) {
  1172. var parentRow = thisRowKey
  1173. var children = this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index].children
  1174. for (const key in children) {
  1175. thisRowKey++
  1176. var child = {
  1177. advice_id: children[key].id,
  1178. advice_name: children[key].advice_name,
  1179. advice_desc: children[key].advice_desc,
  1180. single_dose: '' + children[key].single_dose,
  1181. single_dose_unit: children[key].single_dose_unit,
  1182. drug_spec: '' + children[key].drug_spec,
  1183. drug_spec_unit: children[key].drug_spec_unit,
  1184. prescribing_number: '' + children[key].prescribing_number,
  1185. prescribing_number_unit: children[key].prescribing_number_unit,
  1186. delivery_way: children[key].delivery_way,
  1187. execution_frequency: children[key].execution_frequency,
  1188. isEdit: 0,
  1189. id: 0,
  1190. children: [],
  1191. parent_row: parentRow,
  1192. row_key: thisRowKey
  1193. }
  1194. item.children.push(child)
  1195. }
  1196. this.$set(item, 'children', item.children)
  1197. }
  1198. this.selectedTemp.list.unshift(item)
  1199. }
  1200. }
  1201. },
  1202. newAddTempForm() {
  1203. this.allSelectedTemplate = []
  1204. var thisRowKey = 0
  1205. for (const indexs in this.adviceTemplateMaps) {
  1206. const adviceTemplate = this.adviceTemplateMaps[indexs]
  1207. for (const index in adviceTemplate.DoctorAdviceTemplate) {
  1208. if (adviceTemplate.DoctorAdviceTemplate[index].selection) {
  1209. thisRowKey++
  1210. var item = {
  1211. advice_name: adviceTemplate.DoctorAdviceTemplate[index].advice_name,
  1212. advice_desc: adviceTemplate.DoctorAdviceTemplate[index].advice_desc,
  1213. single_dose: '' + adviceTemplate.DoctorAdviceTemplate[index].single_dose,
  1214. single_dose_unit: adviceTemplate.DoctorAdviceTemplate[index].single_dose_unit,
  1215. drug_spec: '' + adviceTemplate.DoctorAdviceTemplate[index].drug_spec,
  1216. drug_spec_unit: adviceTemplate.DoctorAdviceTemplate[index].drug_spec_unit,
  1217. prescribing_number: '' + adviceTemplate.DoctorAdviceTemplate[index].prescribing_number,
  1218. prescribing_number_unit: adviceTemplate.DoctorAdviceTemplate[index].prescribing_number_unit,
  1219. delivery_way: adviceTemplate.DoctorAdviceTemplate[index].delivery_way,
  1220. execution_frequency: adviceTemplate.DoctorAdviceTemplate[index].execution_frequency,
  1221. advice_id: adviceTemplate.DoctorAdviceTemplate[index].id,
  1222. selection: adviceTemplate.DoctorAdviceTemplate[index].selection,
  1223. isEdit: 0,
  1224. id: 0,
  1225. children: [],
  1226. parent_row: 0,
  1227. row_key: thisRowKey
  1228. }
  1229. if ('children' in adviceTemplate.DoctorAdviceTemplate[index] && adviceTemplate.DoctorAdviceTemplate[index].children.length > 0) {
  1230. var parentRow = thisRowKey
  1231. var children = adviceTemplate.DoctorAdviceTemplate[index].children
  1232. for (const key in children) {
  1233. thisRowKey++
  1234. var child = {
  1235. advice_id: children[key].id,
  1236. advice_name: children[key].advice_name,
  1237. advice_desc: children[key].advice_desc,
  1238. single_dose: '' + children[key].single_dose,
  1239. single_dose_unit: children[key].single_dose_unit,
  1240. drug_spec: '' + children[key].drug_spec,
  1241. drug_spec_unit: children[key].drug_spec_unit,
  1242. prescribing_number: '' + children[key].prescribing_number,
  1243. prescribing_number_unit: children[key].prescribing_number_unit,
  1244. delivery_way: children[key].delivery_way,
  1245. execution_frequency: children[key].execution_frequency,
  1246. isEdit: 0,
  1247. id: 0,
  1248. children: [],
  1249. parent_row: parentRow,
  1250. row_key: thisRowKey
  1251. }
  1252. item.children.push(child)
  1253. this.allSelectedTemplate.unshift(child)
  1254. }
  1255. this.$set(item, 'children', item.children)
  1256. }
  1257. this.allSelectedTemplate.unshift(item)
  1258. adviceTemplate.DoctorAdviceTemplate[index].selection = false
  1259. }
  1260. }
  1261. }
  1262. var childMap = {}
  1263. for (const index in this.allSelectedTemplate) {
  1264. if (this.allSelectedTemplate[index].parent_row > 0) {
  1265. if (!(this.allSelectedTemplate[index].parent_row in childMap)) {
  1266. childMap[this.allSelectedTemplate[index].parent_row] = []
  1267. }
  1268. childMap[this.allSelectedTemplate[index].parent_row].push(this.allSelectedTemplate[index])
  1269. }
  1270. }
  1271. this.submitGroupForm = {
  1272. advice_type: this.groupForm.advice_type,
  1273. advice_date: this.groupForm.advice_date,
  1274. start_time: this.groupForm.start_time,
  1275. adviceNames: [],
  1276. advice_doctor: '',
  1277. remark: this.groupForm.remark,
  1278. parent_id: 0
  1279. }
  1280. for (const index in this.allSelectedTemplate) {
  1281. if (this.allSelectedTemplate[index].parent_row > 0) {
  1282. continue
  1283. }
  1284. this.editRowKey++
  1285. var item = {
  1286. advice_name: this.allSelectedTemplate[index].advice_name,
  1287. advice_desc: this.allSelectedTemplate[index].advice_desc,
  1288. single_dose: '' + this.allSelectedTemplate[index].single_dose,
  1289. single_dose_unit: this.allSelectedTemplate[index].single_dose_unit,
  1290. drug_spec: '' + this.allSelectedTemplate[index].drug_spec,
  1291. drug_spec_unit: this.allSelectedTemplate[index].drug_spec_unit,
  1292. prescribing_number: '' + this.allSelectedTemplate[index].prescribing_number,
  1293. prescribing_number_unit: this.allSelectedTemplate[index].prescribing_number_unit,
  1294. delivery_way: this.allSelectedTemplate[index].delivery_way,
  1295. execution_frequency: this.allSelectedTemplate[index].execution_frequency,
  1296. isEdit: 0,
  1297. id: 0,
  1298. children: [],
  1299. parent_row: 0,
  1300. row_key: this.editRowKey
  1301. }
  1302. if (this.allSelectedTemplate[index].children.length > 0) {
  1303. if (this.allSelectedTemplate[index].row_key in childMap) {
  1304. var parentRow = this.editRowKey
  1305. var children = childMap[this.allSelectedTemplate[index].row_key]
  1306. for (const key in children) {
  1307. this.editRowKey++
  1308. var child = {
  1309. advice_name: children[key].advice_name,
  1310. advice_desc: children[key].advice_desc,
  1311. single_dose: '' + children[key].single_dose,
  1312. single_dose_unit: children[key].single_dose_unit,
  1313. drug_spec: '' + children[key].drug_spec,
  1314. drug_spec_unit: children[key].drug_spec_unit,
  1315. prescribing_number: '' + children[key].prescribing_number,
  1316. prescribing_number_unit: children[key].prescribing_number_unit,
  1317. delivery_way: children[key].delivery_way,
  1318. execution_frequency: children[key].execution_frequency,
  1319. isEdit: 0,
  1320. id: 0,
  1321. children: [],
  1322. parent_row: parentRow,
  1323. row_key: this.editRowKey
  1324. }
  1325. item.children.push(child)
  1326. }
  1327. this.$set(item, 'children', item.children)
  1328. }
  1329. }
  1330. this.submitGroupForm.adviceNames.unshift(item)
  1331. }
  1332. let mode = "1"
  1333. CreateGroupAdvice(this.patientID, this.groupForm.groupno, this.submitGroupForm,mode).then(response => {
  1334. if (response.data.state == 0) {
  1335. this.$message.error(response.data.msg)
  1336. return false
  1337. } else {
  1338. this.$notify({
  1339. title: '成功',
  1340. message: '新增成功',
  1341. type: 'success',
  1342. duration: 2000
  1343. })
  1344. var groups = response.data.data.advices
  1345. var childMap = {}
  1346. for (const index in groups) {
  1347. if (groups[index].parent_id == 0) {
  1348. continue
  1349. }
  1350. if ((groups[index].parent_id in childMap) === false) {
  1351. childMap[groups[index].parent_id] = []
  1352. }
  1353. childMap[groups[index].parent_id].push(groups[index])
  1354. }
  1355. var parentArr = []
  1356. for (const index in groups) {
  1357. if (groups[index].parent_id > 0) {
  1358. continue
  1359. }
  1360. parentArr.push(groups[index])
  1361. }
  1362. var groupNo = groups[0].groupno
  1363. var newData = { groupNo: parentArr }
  1364. for (const index in this.adviceTableData) {
  1365. if (this.adviceTableData[index].groupno == groupNo) {
  1366. for (const i in parentArr) {
  1367. if (parentArr[i].id in childMap) {
  1368. for (const j in childMap[parentArr[i].id]) {
  1369. this.adviceTableData.splice(index, 0, childMap[parentArr[i].id][j])
  1370. }
  1371. }
  1372. this.adviceTableData.splice(index, 0, parentArr[i])
  1373. }
  1374. break
  1375. }
  1376. }
  1377. for (const index in groups) {
  1378. if (groups[index].parent_id > 0) {
  1379. continue
  1380. }
  1381. this.editRowKey++
  1382. var item = {
  1383. advice_name: groups[index].advice_name,
  1384. advice_desc: groups[index].advice_desc,
  1385. single_dose: '' + groups[index].single_dose,
  1386. single_dose_unit: groups[index].single_dose_unit,
  1387. drug_spec: '' + groups[index].drug_spec,
  1388. drug_spec_unit: groups[index].drug_spec_unit,
  1389. prescribing_number: '' + groups[index].prescribing_number,
  1390. prescribing_number_unit: groups[index].prescribing_number_unit,
  1391. delivery_way: groups[index].delivery_way,
  1392. execution_frequency: groups[index].execution_frequency,
  1393. isEdit: 0,
  1394. index: 0,
  1395. id: groups[index].id,
  1396. children: [],
  1397. parent_row: 0,
  1398. row_key: this.editRowKey
  1399. }
  1400. if (item.id in childMap) {
  1401. for (const key in childMap[item.id]) {
  1402. this.editRowKey++
  1403. var child = {
  1404. advice_name: childMap[item.id][key].advice_name,
  1405. advice_desc: childMap[item.id][key].advice_desc,
  1406. single_dose: '' + childMap[item.id][key].single_dose,
  1407. single_dose_unit: childMap[item.id][key].single_dose_unit,
  1408. drug_spec: '' + childMap[item.id][key].drug_spec,
  1409. drug_spec_unit: childMap[item.id][key].drug_spec_unit,
  1410. prescribing_number: '' + childMap[item.id][key].prescribing_number,
  1411. prescribing_number_unit: childMap[item.id][key].prescribing_number_unit,
  1412. delivery_way: childMap[item.id][key].delivery_way,
  1413. execution_frequency: childMap[item.id][key].execution_frequency,
  1414. isEdit: 0,
  1415. index: 0,
  1416. id: childMap[item.id][key].id,
  1417. children: [],
  1418. parent_row: item.row_key,
  1419. row_key: this.editRowKey
  1420. }
  1421. item.children.push(child)
  1422. }
  1423. this.$set(item, 'children', item.children)
  1424. }
  1425. this.groupForm.adviceNames.unshift(item)
  1426. }
  1427. return false
  1428. }
  1429. })
  1430. this.templateFormVisible = false
  1431. },
  1432. addTempForm(formName) {
  1433. var _this = this
  1434. this.$refs[formName].validate((valid) => {
  1435. if (valid) {
  1436. if (_this.templateForm.id in _this.adviceTemplateMaps) {
  1437. _this.submitGroupForm = {
  1438. advice_type: _this.groupForm.advice_type,
  1439. advice_date: _this.groupForm.advice_date,
  1440. start_time: _this.groupForm.start_time,
  1441. adviceNames: [],
  1442. advice_doctor: '',
  1443. remark: _this.groupForm.remark,
  1444. parent_id: 0
  1445. }
  1446. var mapid = _this.templateForm.id
  1447. for (const index in _this.adviceTemplateMaps[mapid].DoctorAdviceTemplate) {
  1448. _this.editRowKey++
  1449. var item = {
  1450. advice_name: _this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index].advice_name,
  1451. advice_desc: _this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index].advice_desc,
  1452. single_dose: '' + _this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index].single_dose,
  1453. single_dose_unit: _this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index].single_dose_unit,
  1454. drug_spec: '' + _this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index].drug_spec,
  1455. drug_spec_unit: _this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index].drug_spec_unit,
  1456. prescribing_number: '' + _this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index].prescribing_number,
  1457. prescribing_number_unit: _this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index].prescribing_number_unit,
  1458. delivery_way: _this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index].delivery_way,
  1459. execution_frequency: _this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index].execution_frequency,
  1460. isEdit: 0,
  1461. id: 0,
  1462. children: [],
  1463. parent_row: 0,
  1464. row_key: _this.editRowKey
  1465. }
  1466. if ('children' in _this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index] && _this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index].children) {
  1467. var parentRow = _this.editRowKey
  1468. var children = _this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index].children
  1469. for (const key in children) {
  1470. _this.editRowKey++
  1471. var child = {
  1472. advice_name: children[key].advice_name,
  1473. advice_desc: children[key].advice_desc,
  1474. single_dose: '' + children[key].single_dose,
  1475. single_dose_unit: children[key].single_dose_unit,
  1476. drug_spec: '' + children[key].drug_spec,
  1477. drug_spec_unit: children[key].drug_spec_unit,
  1478. prescribing_number: '' + children[key].prescribing_number,
  1479. prescribing_number_unit: children[key].prescribing_number_unit,
  1480. delivery_way: children[key].delivery_way,
  1481. execution_frequency: children[key].execution_frequency,
  1482. isEdit: 0,
  1483. id: 0,
  1484. children: [],
  1485. parent_row: parentRow,
  1486. row_key: _this.editRowKey
  1487. }
  1488. item.children.push(child)
  1489. }
  1490. _this.$set(item, 'children', item.children)
  1491. }
  1492. _this.submitGroupForm.adviceNames.push(item)
  1493. }
  1494. let mode = "1"
  1495. CreateGroupAdvice(_this.patientID, _this.groupForm.groupno, _this.submitGroupForm,mode).then(response => {
  1496. if (response.data.state == 0) {
  1497. _this.$message.error(response.data.msg)
  1498. return false
  1499. } else {
  1500. _this.$notify({
  1501. title: '成功',
  1502. message: '新增成功',
  1503. type: 'success',
  1504. duration: 2000
  1505. })
  1506. // var alen = response.data.data.advices.length
  1507. // for (let index = alen-1; index >=0; index--) {
  1508. // this.adviceTableData.unshift(response.data.data.advices[index]);
  1509. // }
  1510. var groups = response.data.data.advices
  1511. var childMap = {}
  1512. for (const index in groups) {
  1513. if (groups[index].parent_id == 0) {
  1514. continue
  1515. }
  1516. if ((groups[index].parent_id in childMap) === false) {
  1517. childMap[groups[index].parent_id] = []
  1518. }
  1519. childMap[groups[index].parent_id].push(groups[index])
  1520. }
  1521. var parentArr = []
  1522. for (const index in groups) {
  1523. if (groups[index].parent_id > 0) {
  1524. continue
  1525. }
  1526. parentArr.push(groups[index])
  1527. }
  1528. var groupNo = groups[0].groupno
  1529. var newData = { groupNo: parentArr }
  1530. for (const index in _this.adviceTableData) {
  1531. if (_this.adviceTableData[index].groupno == groupNo) {
  1532. for (const i in parentArr) {
  1533. if (parentArr[i].id in childMap) {
  1534. for (const j in childMap[parentArr[i].id]) {
  1535. _this.adviceTableData.splice(index, 0, childMap[parentArr[i].id][j])
  1536. }
  1537. }
  1538. _this.adviceTableData.splice(index, 0, parentArr[i])
  1539. }
  1540. break
  1541. }
  1542. }
  1543. for (const index in groups) {
  1544. if (groups[index].parent_id > 0) {
  1545. continue
  1546. }
  1547. _this.editRowKey++
  1548. var item = {
  1549. advice_name: groups[index].advice_name,
  1550. advice_desc: groups[index].advice_desc,
  1551. single_dose: '' + groups[index].single_dose,
  1552. single_dose_unit: groups[index].single_dose_unit,
  1553. drug_spec: '' + groups[index].drug_spec,
  1554. drug_spec_unit: groups[index].drug_spec_unit,
  1555. prescribing_number: '' + groups[index].prescribing_number,
  1556. prescribing_number_unit: groups[index].prescribing_number_unit,
  1557. delivery_way: groups[index].delivery_way,
  1558. execution_frequency: groups[index].execution_frequency,
  1559. isEdit: 0,
  1560. index: 0,
  1561. id: groups[index].id,
  1562. children: [],
  1563. parent_row: 0,
  1564. row_key: _this.editRowKey
  1565. }
  1566. if (item.id in childMap) {
  1567. for (const key in childMap[item.id]) {
  1568. _this.editRowKey++
  1569. var child = {
  1570. advice_name: childMap[item.id][key].advice_name,
  1571. advice_desc: childMap[item.id][key].advice_desc,
  1572. single_dose: '' + childMap[item.id][key].single_dose,
  1573. single_dose_unit: childMap[item.id][key].single_dose_unit,
  1574. drug_spec: '' + childMap[item.id][key].drug_spec,
  1575. drug_spec_unit: childMap[item.id][key].drug_spec_unit,
  1576. prescribing_number: '' + childMap[item.id][key].prescribing_number,
  1577. prescribing_number_unit: childMap[item.id][key].prescribing_number_unit,
  1578. delivery_way: childMap[item.id][key].delivery_way,
  1579. execution_frequency: childMap[item.id][key].execution_frequency,
  1580. isEdit: 0,
  1581. index: 0,
  1582. id: childMap[item.id][key].id,
  1583. children: [],
  1584. parent_row: item.row_key,
  1585. row_key: _this.editRowKey
  1586. }
  1587. item.children.push(child)
  1588. }
  1589. _this.$set(item, 'children', item.children)
  1590. }
  1591. _this.groupForm.adviceNames.unshift(item)
  1592. }
  1593. _this.resetForm(formName)
  1594. return false
  1595. }
  1596. })
  1597. }
  1598. _this.templateFormVisible = false
  1599. }
  1600. })
  1601. },
  1602. openAdviceTemplate() {
  1603. this.templateForm = { id: '' }
  1604. this.selectedTemp = { 'id': 0, name: '', org_id: 0, 'list': [], 'rows': [] }
  1605. this.selectedTemplate = []
  1606. if (typeof (this.$refs.templatetable) !== 'undefined') {
  1607. this.$refs.templatetable.setCurrentRow(null)
  1608. }
  1609. this.templateFormVisible = true
  1610. },
  1611. selectGroupAdvice(row) {
  1612. this.groupSelectRow = row
  1613. },
  1614. groupClassName({ row, rowIndex }) {
  1615. row.index = rowIndex
  1616. },
  1617. getRowKey(row) {
  1618. return row.row_key
  1619. },
  1620. resetForm(formName) {
  1621. this.$refs[formName].resetFields()
  1622. },
  1623. open(groupNo) {
  1624. this.groupEditFormVisible = true
  1625. this.groupSelectRow = null
  1626. if (typeof (this.$refs.advicenametable) !== 'undefined') {
  1627. this.$refs.advicenametable.setCurrentRow(null)
  1628. }
  1629. // groupNo
  1630. this.editRowKey = 0
  1631. var groups = []
  1632. for (const index in this.adviceTableData) {
  1633. if (groupNo == this.adviceTableData[index].groupno) {
  1634. groups.push(this.adviceTableData[index])
  1635. }
  1636. }
  1637. if (groups.length == 0) {
  1638. return false
  1639. }
  1640. this.adminusername = this.getXuserName(groups[0].advice_doctor)
  1641. this.groupForm = {
  1642. advice_type: groups[0].advice_type,
  1643. advice_date: uParseTime(groups[0].advice_date, '{y}-{m}-{d}'),
  1644. start_time: uParseTime(groups[0].start_time, '{y}-{m}-{d} {h}:{i}'),
  1645. adviceNames: [],
  1646. advice_doctor: '',
  1647. remark: groups[0].remark,
  1648. groupno: groupNo
  1649. }
  1650. var childMap = {}
  1651. for (const index in groups) {
  1652. if (groups[index].parent_id == 0) {
  1653. continue
  1654. }
  1655. if ((groups[index].parent_id in childMap) === false) {
  1656. childMap[groups[index].parent_id] = []
  1657. }
  1658. childMap[groups[index].parent_id].push(groups[index])
  1659. }
  1660. for (const index in groups) {
  1661. if (groups[index].parent_id > 0) {
  1662. continue
  1663. }
  1664. this.editRowKey++
  1665. var item = {
  1666. advice_name: groups[index].advice_name,
  1667. advice_desc: groups[index].advice_desc,
  1668. single_dose: '' + groups[index].single_dose,
  1669. single_dose_unit: groups[index].single_dose_unit,
  1670. drug_spec: '' + groups[index].drug_spec,
  1671. drug_spec_unit: groups[index].drug_spec_unit,
  1672. prescribing_number: '' + groups[index].prescribing_number,
  1673. prescribing_number_unit: groups[index].prescribing_number_unit,
  1674. delivery_way: groups[index].delivery_way,
  1675. execution_frequency: groups[index].execution_frequency,
  1676. isEdit: 0,
  1677. index: 0,
  1678. id: groups[index].id,
  1679. children: [],
  1680. parent_row: 0,
  1681. row_key: this.editRowKey
  1682. }
  1683. if (item.id in childMap) {
  1684. for (const key in childMap[item.id]) {
  1685. this.editRowKey++
  1686. var child = {
  1687. advice_name: childMap[item.id][key].advice_name,
  1688. advice_desc: childMap[item.id][key].advice_desc,
  1689. single_dose: '' + childMap[item.id][key].single_dose,
  1690. single_dose_unit: childMap[item.id][key].single_dose_unit,
  1691. drug_spec: '' + childMap[item.id][key].drug_spec,
  1692. drug_spec_unit: childMap[item.id][key].drug_spec_unit,
  1693. prescribing_number: '' + childMap[item.id][key].prescribing_number,
  1694. prescribing_number_unit: childMap[item.id][key].prescribing_number_unit,
  1695. delivery_way: childMap[item.id][key].delivery_way,
  1696. execution_frequency: childMap[item.id][key].execution_frequency,
  1697. isEdit: 0,
  1698. index: 0,
  1699. id: childMap[item.id][key].id,
  1700. children: [],
  1701. parent_row: item.row_key,
  1702. row_key: this.editRowKey
  1703. }
  1704. item.children.push(child)
  1705. }
  1706. this.$set(item, 'children', item.children)
  1707. }
  1708. this.groupForm.adviceNames.push(item)
  1709. }
  1710. }
  1711. },
  1712. watch: {
  1713. 'selectedTemp.list': function() {
  1714. this.calcselectedTemp()
  1715. }
  1716. }
  1717. }
  1718. </script>
  1719. <style>
  1720. #user-edit-advice-name-table .el-table__row {
  1721. display: table-row !important;
  1722. }
  1723. #user-edit-advice-name-table .el-table__expand-icon {
  1724. -webkit-transform: rotate(90deg) !important;
  1725. transform: rotate(90deg) !important;
  1726. }
  1727. #dialysis-update-select-template-table .el-table__row {
  1728. display: table-row !important;
  1729. }
  1730. #dialysis-update-select-template-table .el-table__expand-icon {
  1731. -webkit-transform: rotate(90deg) !important;
  1732. transform: rotate(90deg) !important;
  1733. }
  1734. </style>