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

hisTemplate.vue 75KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900
  1. <template>
  2. <div class="main-contain">
  3. <div class="position">
  4. <bread-crumb :crumbs='crumbs'></bread-crumb>
  5. </div>
  6. <div class="app-container">
  7. <el-tabs>
  8. <el-tab-pane label="医嘱模板 ">
  9. <div>
  10. <div class="filter-container">
  11. <el-button
  12. class="filter-item"
  13. style="margin-left: 10px;margin-right: 10px"
  14. @click="handleCreateTemplate"
  15. type="primary"
  16. size="small"
  17. icon="el-icon-circle-plus-outline"
  18. >{{$t('table.add')}}
  19. </el-button>
  20. </div>
  21. <el-table
  22. :data="adviceTemplates"
  23. border
  24. fit
  25. :row-style="{ color: '#303133' }"
  26. :header-cell-style="{
  27. backgroundColor: 'rgb(245, 247, 250)',
  28. color: '#606266'
  29. }"
  30. @cell-mouse-leave="cellMouseLeave"
  31. @cell-mouse-enter="cellMouseEnter"
  32. :row-class-name="tableRowClassNames"
  33. :span-method="merge"
  34. style="width: 100%;min-height:500px;"
  35. >
  36. <el-table-column
  37. prop="id"
  38. label="模版名称"
  39. align="center"
  40. width="100">
  41. <template slot-scope="scope">
  42. <span v-if="isShow(scope.$index, scope.row)">{{scope.row.name}}</span>
  43. <span v-else></span>
  44. </template>
  45. </el-table-column>
  46. <el-table-column
  47. prop="amount1"
  48. align="center"
  49. label="医嘱内容">
  50. <template slot-scope="scope">
  51. <el-dropdown trigger="click" v-if="scope.row.parent_id == 0">
  52. <span class="el-dropdown-link" v-if="scope.row.parent_id == 0">
  53. {{scope.row.advice_name}}<i class="el-icon-arrow-down el-icon--right"></i>
  54. </span>
  55. <el-dropdown-menu slot="dropdown">
  56. <el-dropdown-item @click.native="openEdit(scope.$index, scope.row)">修改医嘱</el-dropdown-item>
  57. <el-dropdown-item @click.native="openDelete(scope.$index, scope.row)">删除医嘱</el-dropdown-item>
  58. </el-dropdown-menu>
  59. </el-dropdown>
  60. </template>
  61. </el-table-column>
  62. <el-table-column
  63. prop="amount1"
  64. align="center"
  65. label="药品规格">
  66. <!-- {{drugDesc(scope.row)}} -->
  67. <template slot-scope="scope">
  68. <span v-if="scope.row.advice_desc">{{scope.row.advice_desc}}{{scope.row.drug_spec_unit}}</span>
  69. </template>
  70. </el-table-column>
  71. <el-table-column
  72. prop="amount2"
  73. width="90"
  74. align="center"
  75. label="开药数量">
  76. <template slot-scope="scope" v-if="scope.row.prescribing_number != ''">
  77. <span>{{scope.row.prescribing_number}}{{scope.row.prescribing_number_unit}}</span>
  78. </template>
  79. </el-table-column>
  80. <el-table-column
  81. prop="amount2"
  82. width="90"
  83. align="center"
  84. label="单次用量">
  85. <template slot-scope="scope" v-if="scope.row.single_dose != ''">
  86. <span>{{scope.row.single_dose}}{{scope.row.single_dose_unit}}</span>
  87. </template>
  88. </el-table-column>
  89. <el-table-column
  90. prop="amount3"
  91. align="center"
  92. label="给药途径">
  93. <template slot-scope="scope" v-if="scope.row.parent_id == 0">
  94. <span>{{scope.row.delivery_way}}</span>
  95. </template>
  96. </el-table-column>
  97. <el-table-column
  98. prop="amount3"
  99. align="center"
  100. label="执行频率">
  101. <template slot-scope="scope" v-if="scope.row.parent_id == 0">
  102. <span>{{scope.row.execution_frequency}}</span>
  103. </template>
  104. </el-table-column>
  105. <el-table-column
  106. align="center"
  107. label="操作"
  108. width="180"
  109. class-name="small-padding fixed-width"
  110. >
  111. <template slot-scope="scope">
  112. <el-tooltip class="item" effect="dark" content="编辑" placement="top">
  113. <el-button
  114. type="primary"
  115. size="small"
  116. icon="el-icon-edit-outline"
  117. v-if="isShow(scope.$index, scope.row)"
  118. @click="handleUpdateAdviceTemplate(scope.row, scope.$index)"
  119. >
  120. </el-button>
  121. </el-tooltip>
  122. <el-tooltip class="item" effect="dark" content="删除" placement="top">
  123. <el-button
  124. size="small"
  125. type="danger"
  126. icon="el-icon-delete"
  127. @click="handleDeleteAdviceTemplate(scope.row, scope.$index)"
  128. >
  129. </el-button>
  130. </el-tooltip>
  131. </template>
  132. </el-table-column>
  133. </el-table>
  134. <!--增删改查都是本地处理的dialog-->
  135. <el-dialog title="新增医嘱模版" :visible.sync="templateTableVisible" width="700px" :close-on-click-modal="false">
  136. <div>
  137. <el-form ref="form" :model="form" :rule="formRules" label-width="100px">
  138. <el-form-item label="模版名称" style="width: 300px" prop="name">
  139. <el-input v-model="form.name"></el-input>
  140. </el-form-item>
  141. </el-form>
  142. <div class="txsj" style="text-align: center;margin-bottom: 30px">
  143. <el-button round @click="newRecordAction">新增医嘱内容</el-button>
  144. <el-button round @click="modifyRecordAction">修改医嘱内容</el-button>
  145. <el-button round @click="deleteRecordAction">删除医嘱内容</el-button>
  146. </div>
  147. <el-table
  148. ref="table" :data="adviceTableData"
  149. border
  150. highlight-current-row
  151. max-height="300"
  152. :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)'}"
  153. :row-class-name="tableRow"
  154. @row-click="onRowClick"
  155. style="width: 100%">
  156. <el-table-column label="医嘱内容" align="center" width="144">
  157. <template slot-scope="scope">
  158. {{scope.row.advice_name}}
  159. </template>
  160. </el-table-column>
  161. <el-table-column align="center" label="药品规格">
  162. <template slot-scope="scope">
  163. <span v-if="scope.row.advice_desc">{{scope.row.advice_desc}}{{scope.row.drug_spec_unit}}</span>
  164. </template>
  165. </el-table-column>
  166. <el-table-column prop="prescribing_number" align="center" label="开药数量">
  167. <template slot-scope="scope" v-if="scope.row.prescribing_number != ''">
  168. {{scope.row.prescribing_number}}{{scope.row.prescribing_number_unit}}
  169. </template>
  170. </el-table-column>
  171. <el-table-column prop="single_dose" align="center" label="单次用量">
  172. <template slot-scope="scope" v-if="scope.row.single_dose != ''">
  173. {{scope.row.single_dose}}{{scope.row.single_dose_unit}}
  174. </template>
  175. </el-table-column>
  176. <el-table-column prop="breathing_rate" align="center" label="给药途径">
  177. <template slot-scope="scope">
  178. {{scope.row.delivery_way}}
  179. </template>
  180. </el-table-column>
  181. <el-table-column prop="blood_flow_volume" align="center" label="执行频率">
  182. <template slot-scope="scope">
  183. {{scope.row.execution_frequency}}
  184. </template>
  185. </el-table-column>
  186. </el-table>
  187. </div>
  188. <div slot="footer" class="dialog-footer">
  189. <el-button @click="cancelTableHandle">取消</el-button>
  190. <el-button type="primary" @click="submitTableTemplate('form')">保 存</el-button>
  191. </div>
  192. </el-dialog>
  193. <el-dialog :title="editDialogTitle" :visible.sync="templateEditFormVisible" width="854px">
  194. <el-form
  195. ref="templateFormEdit"
  196. :rules="templateEditRules"
  197. :model="templateFormEdit"
  198. label-width="90px"
  199. >
  200. <el-row>
  201. <el-col :span="24">
  202. <el-form-item :label="edit_advice_name" required prop="advice_name">
  203. <el-select
  204. v-model="templateFormEdit.advice_name"
  205. filterable
  206. clearable
  207. allow-create
  208. placeholder="请选择(输入可搜索)"
  209. @change="changeDrugNameTwo"
  210. >
  211. <el-option
  212. v-for="(item,index) in all_drug"
  213. :key="index"
  214. :label="item.drug_name"
  215. :value="item.drug_name"
  216. ></el-option>
  217. </el-select>
  218. </el-form-item>
  219. </el-col>
  220. <el-col :span="15">
  221. <el-form-item label="药品规格 :" prop="advice_desc">
  222. <el-col :span="8">
  223. <!--<el-input v-model="templateFormEdit.prescribing_number"></el-input>-->
  224. <el-select
  225. v-model="templateFormEdit.advice_desc"
  226. filterable
  227. clearable
  228. allow-create
  229. placeholder="请选择(输入可搜索)"
  230. @change="changeDrugDescTwo"
  231. >
  232. <el-option
  233. v-for="item,index in drugSpec"
  234. :key="index"
  235. :label="item.drug_spec"
  236. :value="item.drug_spec"
  237. ></el-option>
  238. </el-select>
  239. </el-col>
  240. <el-col class="line" :span="1">&nbsp;</el-col>
  241. <el-col :span="14">
  242. <el-select
  243. v-model="templateFormEdit.drug_spec_unit"
  244. filterable
  245. clearable
  246. allow-create
  247. placeholder="选择"
  248. >
  249. <el-option
  250. v-for="item in unitsOption"
  251. :key="item.id"
  252. :label="item.name "
  253. :value="item.name"
  254. ></el-option>
  255. </el-select>
  256. </el-col>
  257. </el-form-item>
  258. </el-col>
  259. <el-col :span="12">
  260. <el-form-item label="开药数量 :" prop="prescribing_number">
  261. <el-col :span="9">
  262. <el-input v-model="templateFormEdit.prescribing_number"></el-input>
  263. </el-col>
  264. <el-col class="line" :span="1">&nbsp;</el-col>
  265. <el-col :span="14">
  266. <el-select
  267. v-model="templateFormEdit.prescribing_number_unit"
  268. filterable
  269. clearable
  270. allow-create
  271. placeholder="选择"
  272. >
  273. <el-option
  274. v-for="item in unitsOption"
  275. :key="item.id"
  276. :label="item.name "
  277. :value="item.name"
  278. ></el-option>
  279. </el-select>
  280. </el-col>
  281. </el-form-item>
  282. </el-col>
  283. <el-col :span="12">
  284. <el-form-item label="单次用量 :" prop="single_dose">
  285. <el-col :span="9">
  286. <el-input v-model="templateFormEdit.single_dose"></el-input>
  287. </el-col>
  288. <el-col class="line" :span="1">&nbsp;</el-col>
  289. <el-col :span="14">
  290. <el-select
  291. v-model="templateFormEdit.single_dose_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-col :span="12" >
  308. <el-form-item label="给药途径 :" prop="delivery_way">
  309. <el-select
  310. v-model="templateFormEdit.delivery_way"
  311. filterable
  312. clearable
  313. allow-create
  314. placeholder="请选择(输入可搜索)"
  315. style="width:100%"
  316. >
  317. <el-option
  318. v-for="item in drugways"
  319. :key="item.id"
  320. :label="item.name "
  321. :value="item.name"
  322. ></el-option>
  323. </el-select>
  324. </el-form-item>
  325. </el-col>
  326. <el-col :span="12" >
  327. <el-form-item label="执行频率 :" prop="execution_frequency">
  328. <el-select
  329. v-model="templateFormEdit.execution_frequency"
  330. clearable
  331. allow-create
  332. filterable
  333. placeholder="请选择(输入可搜索)"
  334. style="width:100%"
  335. >
  336. <el-option
  337. v-for="item in executionFrequencyOptions"
  338. :key="item.id"
  339. :label="item.name"
  340. :value="item.name"
  341. ></el-option>
  342. </el-select>
  343. </el-form-item>
  344. </el-col>
  345. </el-row>
  346. </el-form>
  347. <div slot="footer" class="dialog-footer">
  348. <el-button @click="cancelEditHandle">取消</el-button>
  349. <el-button type="primary" @click="submitEditTemplate('templateFormEdit')">保 存</el-button>
  350. </div>
  351. </el-dialog>
  352. <!--增删改查都请求网络类型的dialog-->
  353. <el-dialog title="编辑医嘱模版" :visible.sync="templateTableTwoVisible" width="800px">
  354. <div>
  355. <!--<el-form ref="form" :model="form" :rule="formRules" label-width="100px">-->
  356. <!--<el-form-item label="模版名称" style="width: 300px" prop="name">-->
  357. <!--<el-input v-model="form.name" ></el-input>-->
  358. <!--</el-form-item>-->
  359. <!--</el-form>-->
  360. <div class="txsj" style="text-align: center;margin-bottom: 30px">
  361. <el-button round @click="newRecordActionTwo">新增医嘱内容</el-button>
  362. <!--<el-button round @click="deleteRecordActionTwo">删除医嘱内容</el-button>-->
  363. <!--<el-button round @click="modifyRecordActionTwo">修改医嘱内容</el-button>-->
  364. </div>
  365. <el-table :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)'}" ref="table"
  366. :data="adviceTableDataTwo" border highlight-current-row max-height="300">
  367. <el-table-column label="医嘱内容">
  368. <template slot-scope="scope">
  369. <span v-if="scope.row.parent_id == 0">{{scope.row.advice_name}}</span>
  370. <span v-if="scope.row.parent_id > 0"> &emsp;{{scope.row.advice_name}}</span>
  371. </template>
  372. </el-table-column>
  373. <el-table-column align="center" label="药品规格">
  374. <!-- {{drugDesc(scope.row)}} -->
  375. <template slot-scope="scope">
  376. <span v-if="scope.row.advice_desc">{{scope.row.advice_desc}}{{scope.row.drug_spec_unit}}</span>
  377. </template>
  378. </el-table-column>
  379. <el-table-column prop="prescribing_number" align="center" label="开药数量">
  380. <template slot-scope="scope" v-if="scope.row.prescribing_number != ''">
  381. {{scope.row.prescribing_number}}{{scope.row.prescribing_number_unit}}
  382. </template>
  383. </el-table-column>
  384. <el-table-column align="center" label="单次用量">
  385. <template slot-scope="scope" v-if="scope.row.single_dose != ''">
  386. {{scope.row.single_dose}}{{scope.row.single_dose_unit}}
  387. </template>
  388. </el-table-column>
  389. <el-table-column align="center" label="给药途径">
  390. <template slot-scope="scope">
  391. <span v-if="scope.row.parent_id == 0">{{scope.row.delivery_way}}</span>
  392. </template>
  393. </el-table-column>
  394. <el-table-column align="center" label="执行频率">
  395. <template slot-scope="scope">
  396. <span v-if="scope.row.parent_id == 0">{{scope.row.execution_frequency}}</span>
  397. </template>
  398. </el-table-column>
  399. <el-table-column align="center" label="提醒频率" v-if="form.advice_type == 1">
  400. <template slot-scope="scope">
  401. <span v-if="scope.row.frequency_type == 1">每次必推</span>
  402. <span v-if="scope.row.frequency_type == 2">{{scope.row.day_count}}天/1次</span>
  403. <span v-if="scope.row.frequency_type == 3">每周{{scope.row.week_days}}</span>
  404. </template>
  405. </el-table-column>
  406. </el-table>
  407. </div>
  408. <div slot="footer" class="dialog-footer">
  409. <el-button @click="cancelTableHandleTwo">取消</el-button>
  410. <el-button type="primary" @click="modifyTemplateName">保 存</el-button>
  411. </div>
  412. </el-dialog>
  413. <el-dialog title="新增医嘱" :visible.sync="templateFormTwoVisible" width="854px">
  414. <el-form
  415. ref="templateForm"
  416. :rules="templateEditRules"
  417. :model="templateForm"
  418. label-width="90px"
  419. >
  420. <el-row>
  421. <el-col :span="24">
  422. <el-form-item label="医嘱内容 :" required prop="advice_name">
  423. <!-- <el-input v-model="templateForm.advice_name"></el-input> -->
  424. <el-select
  425. v-model="templateForm.advice_name"
  426. filterable
  427. clearable
  428. allow-create
  429. placeholder="请选择(输入可搜索)"
  430. style="width:100%;"
  431. @change="changeDrugName"
  432. >
  433. <el-option
  434. v-for="(item,index) in all_drug"
  435. :key="index"
  436. :label="item.drug_name"
  437. :value="item.drug_name"
  438. ></el-option>
  439. </el-select>
  440. <!--<el-autocomplete-->
  441. <!--style="width:100%;"-->
  442. <!--class="inline-input"-->
  443. <!--v-model="templateForm.advice_name"-->
  444. <!--:fetch-suggestions="querySearch"-->
  445. <!--placeholder="请输入内容"-->
  446. <!--@select="handleSelect"-->
  447. <!--@input="changeDrugName"-->
  448. <!--&gt;</el-autocomplete>-->
  449. </el-form-item>
  450. </el-col>
  451. <el-col :span="12">
  452. <el-form-item label="药品规格 :" prop="advice_desc">
  453. <el-col :span="9">
  454. <!-- <el-input v-model="templateForm.advice_desc"></el-input> -->
  455. <el-select
  456. v-model="templateForm.advice_desc"
  457. filterable
  458. clearable
  459. allow-create
  460. placeholder="请选择(输入可搜索)"
  461. @change="changeDrugDesc"
  462. >
  463. <el-option
  464. v-for="item,index in drugSpec"
  465. :key="index"
  466. :label="item.drug_spec"
  467. :value="item.drug_spec"
  468. ></el-option>
  469. </el-select>
  470. <!--<el-autocomplete-->
  471. <!--style="width:100px;"-->
  472. <!--class="inline-input"-->
  473. <!--v-model="templateForm.advice_desc"-->
  474. <!--:fetch-suggestions="querySearch1"-->
  475. <!--placeholder="请输入内容"-->
  476. <!--@select="handleSelect1"-->
  477. <!--@input="changeDrugDesc"-->
  478. <!--&gt;</el-autocomplete>-->
  479. </el-col>
  480. <el-col class="line" :span="1">&nbsp;</el-col>
  481. <el-col :span="14">
  482. <el-select
  483. v-model="templateForm.drug_spec_unit"
  484. filterable
  485. clearable
  486. allow-create
  487. placeholder="选择"
  488. >
  489. <el-option
  490. v-for="item in unitsOption"
  491. :key="item.id"
  492. :label="item.name "
  493. :value="item.name"
  494. ></el-option>
  495. </el-select>
  496. </el-col>
  497. </el-form-item>
  498. </el-col>
  499. <el-col :span="12">
  500. <el-form-item label="开药数量 :" prop="prescribing_number">
  501. <el-col :span="9">
  502. <el-input v-model="templateForm.prescribing_number"></el-input>
  503. </el-col>
  504. <el-col class="line" :span="1">&nbsp;</el-col>
  505. <el-col :span="14">
  506. <el-select
  507. v-model="templateForm.prescribing_number_unit"
  508. filterable
  509. clearable
  510. allow-create
  511. placeholder="选择"
  512. >
  513. <el-option
  514. v-for="item in unitsOption"
  515. :key="item.id"
  516. :label="item.name "
  517. :value="item.name"
  518. ></el-option>
  519. </el-select>
  520. </el-col>
  521. </el-form-item>
  522. </el-col>
  523. <el-col :span="12">
  524. <el-form-item label="单次用量 :" prop="single_dose">
  525. <el-col :span="9">
  526. <el-input v-model="templateForm.single_dose"></el-input>
  527. </el-col>
  528. <el-col class="line" :span="1">&nbsp;</el-col>
  529. <el-col :span="14">
  530. <el-select
  531. v-model="templateForm.single_dose_unit"
  532. filterable
  533. clearable
  534. allow-create
  535. placeholder="选择"
  536. >
  537. <el-option
  538. v-for="item in unitsOption"
  539. :key="item.id"
  540. :label="item.name "
  541. :value="item.name"
  542. ></el-option>
  543. </el-select>
  544. </el-col>
  545. </el-form-item>
  546. </el-col>
  547. <el-col :span="12">
  548. <el-form-item label="给药途径 :" prop="delivery_way">
  549. <el-select
  550. v-model="templateForm.delivery_way"
  551. filterable
  552. clearable
  553. allow-create
  554. placeholder="请选择(输入可搜索)"
  555. style="width:100%"
  556. >
  557. <el-option
  558. v-for="item in drugways"
  559. :key="item.id"
  560. :label="item.name "
  561. :value="item.name"
  562. ></el-option>
  563. </el-select>
  564. </el-form-item>
  565. </el-col>
  566. <el-col :span="12">
  567. <el-form-item label="执行频率 :" prop="execution_frequency">
  568. <el-select
  569. v-model="templateForm.execution_frequency"
  570. clearable
  571. allow-create
  572. filterable
  573. placeholder="请选择(输入可搜索)"
  574. style="width:100%"
  575. >
  576. <el-option
  577. v-for="item in executionFrequencyOptions"
  578. :key="item.id"
  579. :label="item.name"
  580. :value="item.name"
  581. ></el-option>
  582. </el-select>
  583. </el-form-item>
  584. </el-col>
  585. </el-row>
  586. </el-form>
  587. <div slot="footer" class="dialog-footer">
  588. <el-button @click="cancelHandleTwo">取消</el-button>
  589. <el-button type="primary" @click="submitTemplateTwo('templateForm')">保 存</el-button>
  590. </div>
  591. </el-dialog>
  592. <el-dialog :title="dialogTitle" :visible.sync="templateFormVisible" width="854px">
  593. <el-form
  594. ref="templateForm"
  595. :rules="templateRules"
  596. :model="templateForm"
  597. label-width="90px"
  598. >
  599. <el-row >
  600. <el-col :span="24">
  601. <el-form-item label="医嘱内容:" required prop="advice_name">
  602. <el-select
  603. v-model="templateForm.advice_name"
  604. filterable
  605. clearable
  606. allow-create
  607. placeholder="请选择(输入可搜索)"
  608. style="width:100%"
  609. @change="changeDrugName"
  610. >
  611. <el-option
  612. v-for="(item,index) in all_drug"
  613. :key="index"
  614. :label="item.drug_name"
  615. :value="item.drug_name"
  616. ></el-option>
  617. </el-select>
  618. </el-form-item>
  619. </el-col>
  620. <el-col :span="15">
  621. <el-form-item label="药品规格 :" prop="advice_desc">
  622. <el-col :span="8">
  623. <!-- <el-input v-model="templateForm.advice_desc"></el-input> -->
  624. <el-select
  625. v-model="templateForm.advice_desc"
  626. filterable
  627. clearable
  628. allow-create
  629. placeholder="请选择(输入可搜索)"
  630. style="width:150px"
  631. @change="changeDrugDesc"
  632. >
  633. <el-option
  634. v-for="item in drugSpec"
  635. :key="item.id"
  636. :label="item.drug_spec"
  637. :value="item.drug_spec"
  638. ></el-option>
  639. </el-select>
  640. <!--<el-autocomplete-->
  641. <!--style="width:100px;"-->
  642. <!--class="inline-input"-->
  643. <!--v-model="templateForm.advice_desc"-->
  644. <!--:fetch-suggestions="querySearch1"-->
  645. <!--placeholder="请输入内容"-->
  646. <!--@input="changeDrugDesc"-->
  647. <!--&gt;</el-autocomplete>-->
  648. </el-col>
  649. <el-col class="line" :span="2">&nbsp;</el-col>
  650. <el-col :span="14">
  651. <el-select
  652. v-model="templateForm.drug_spec_unit"
  653. filterable
  654. clearable
  655. allow-create
  656. placeholder="选择"
  657. >
  658. <el-option
  659. v-for="item in unitsOption"
  660. :key="item.id"
  661. :label="item.name "
  662. :value="item.name"
  663. ></el-option>
  664. </el-select>
  665. </el-col>
  666. </el-form-item>
  667. </el-col>
  668. <el-col :span="12">
  669. <el-form-item label="开药数量 :" prop="prescribing_number">
  670. <el-col :span="9">
  671. <el-input v-model="templateForm.prescribing_number"></el-input>
  672. </el-col>
  673. <el-col class="line" :span="1">&nbsp;</el-col>
  674. <el-col :span="14">
  675. <el-select
  676. v-model="templateForm.prescribing_number_unit"
  677. filterable
  678. clearable
  679. allow-create
  680. placeholder="选择"
  681. >
  682. <el-option
  683. v-for="item in unitsOption"
  684. :key="item.id"
  685. :label="item.name "
  686. :value="item.name"
  687. ></el-option>
  688. </el-select>
  689. </el-col>
  690. </el-form-item>
  691. </el-col>
  692. <el-col :span="12">
  693. <el-form-item label="单次用量 :" prop="single_dose">
  694. <el-col :span="9">
  695. <el-input v-model="templateForm.single_dose"></el-input>
  696. </el-col>
  697. <el-col class="line" :span="1">&nbsp;</el-col>
  698. <el-col :span="14">
  699. <el-select
  700. v-model="templateForm.single_dose_unit"
  701. filterable
  702. clearable
  703. allow-create
  704. placeholder="选择"
  705. >
  706. <el-option
  707. v-for="item in unitsOption"
  708. :key="item.id"
  709. :label="item.name "
  710. :value="item.name"
  711. ></el-option>
  712. </el-select>
  713. </el-col>
  714. </el-form-item>
  715. </el-col>
  716. <el-col :span="12" v-if="!isAddChild">
  717. <el-form-item label="给药途径 :" prop="delivery_way">
  718. <el-select
  719. v-model="templateForm.delivery_way"
  720. filterable
  721. clearable
  722. allow-create
  723. placeholder="请选择(输入可搜索)"
  724. style="width:100%"
  725. >
  726. <el-option
  727. v-for="item in drugways"
  728. :key="item.id"
  729. :label="item.name "
  730. :value="item.name"
  731. ></el-option>
  732. </el-select>
  733. </el-form-item>
  734. </el-col>
  735. <el-col :span="12" v-if="!isAddChild">
  736. <el-form-item label="执行频率 :" prop="execution_frequency">
  737. <el-select
  738. v-model="templateForm.execution_frequency"
  739. clearable
  740. allow-create
  741. filterable
  742. placeholder="请选择(输入可搜索)"
  743. style="width:100%"
  744. >
  745. <el-option
  746. v-for="item in executionFrequencyOptions"
  747. :key="item.id"
  748. :label="item.name"
  749. :value="item.name"
  750. ></el-option>
  751. </el-select>
  752. </el-form-item>
  753. </el-col>
  754. </el-row>
  755. </el-form>
  756. <div slot="footer" class="dialog-footer">
  757. <el-button @click="cancelHandle('templateForm')">取消</el-button>
  758. <el-button type="primary" @click="submitTemplate('templateForm')">保 存</el-button>
  759. </div>
  760. </el-dialog>
  761. </div>
  762. </el-tab-pane>
  763. </el-tabs>
  764. </div>
  765. </div>
  766. </template>
  767. <style>
  768. @import "../../../static/css/table_row.css";
  769. .filter-item {
  770. float: right;
  771. }
  772. </style>
  773. <script>
  774. import {
  775. CreateHisSingleAdviceTemplate,
  776. DeleteHisAdviceTemplate,
  777. postHisAdviceTemplate,
  778. updateHisTemplateName,
  779. UpdateHisAdviceTemplate,
  780. DeleteHisParentAdviceTemplate,
  781. getAllHisAdviceTemplate
  782. } from '@/api/his/his'
  783. import BreadCrumb from '@/xt_pages/components/bread-crumb'
  784. import { getDataConfig } from '@/utils/data'
  785. import { getSelfMedicalList } from "@/api/drug/drug"
  786. export default {
  787. name: 'hisTemplate',
  788. components: { BreadCrumb },
  789. data() {
  790. return {
  791. day_count: '',
  792. crumbs: [
  793. { path: false, name: '模版管理' },
  794. { path: '', name: '医嘱模版' }
  795. ],
  796. rowIndex: -1,
  797. current_template_id: 0,
  798. currentObject: {},
  799. tempArr: [],
  800. sameRowArr: [],
  801. advice_content_name: '',
  802. table_current_index: -1,
  803. adviceTableData: [],
  804. templateName: '',
  805. adviceTableDataTwo: [],
  806. table_current_index_two: -1,
  807. currentIndex: -1,
  808. isEdit: false,
  809. dialogTitle: '',
  810. is_open_remind:0,
  811. is_init:0,
  812. isAddChild: false,
  813. parent_id: 0,
  814. editDialogTitle: '编辑医嘱',
  815. drugdicFormVisible: false,
  816. drugwayFormVisible: false,
  817. templateFormVisible: false,
  818. templateTableTwoVisible: false,
  819. templateEditFormVisible: false,
  820. edit_advice_name: '',
  821. templateTableVisible: false,
  822. templateFormTwoVisible: false,
  823. templateEditFormTwoVisible: false,
  824. efFormVisible: false,
  825. activeName: 'drugdic',
  826. hoverOrderArr: [],
  827. createdTimes: 0,
  828. drugdics: [],
  829. adviceTemplates: [],
  830. current_template_name: '',
  831. editForm: {
  832. name: ''
  833. },
  834. loading:false,
  835. drugways: [],
  836. executionFrequencyOptions: [],
  837. drugdicRules: {
  838. name: [{ required: true, message: '请填写医嘱内容' }]
  839. },
  840. formRules: {
  841. name: [
  842. { required: true, message: '请输入模版名称', trigger: 'blur' }
  843. ],
  844. advice_type: [
  845. { required: true, message: '请选择模版类型', trigger: 'change' }
  846. ]
  847. },
  848. drugwayRules: {
  849. name: [{ required: true, message: '请填写给药途径' }]
  850. },
  851. efRules: {
  852. name: [{ required: true, message: '请填写执行频率' }]
  853. },
  854. templateRules: {
  855. advice_name: [{ required: true, message: '请填写医嘱内容' }]
  856. },
  857. templateEditRules: {
  858. advice_name: [{ required: true, message: '请填写医嘱内容' }]
  859. },
  860. templateForm: {
  861. drug_spec: '',
  862. drug_spec_unit: '',
  863. advice_name: '',
  864. advice_desc: '',
  865. single_dose: '',
  866. single_dose_unit: '',
  867. prescribing_number: '',
  868. prescribing_number_unit: '',
  869. delivery_way: '',
  870. execution_frequency: '',
  871. id: 0,
  872. drug_id:0,
  873. },
  874. dialogConfigVisible:false,
  875. templateFormEdit: {
  876. drug_spec: '',
  877. drug_spec_unit: '',
  878. advice_name: '',
  879. advice_desc: '',
  880. single_dose: '',
  881. single_dose_unit: '',
  882. prescribing_number: '',
  883. prescribing_number_unit: '',
  884. delivery_way: '',
  885. execution_frequency: '',
  886. id: 0
  887. },
  888. drugdicForm: {
  889. name: '',
  890. spec: '',
  891. spec_unit: '',
  892. form: '',
  893. form_unit: '',
  894. id: 0
  895. },
  896. form: {
  897. name: '',
  898. advice_type: 0
  899. },
  900. drugwayForm: {
  901. name: '',
  902. id: 0
  903. },
  904. efForm: {
  905. name: '',
  906. id: 0
  907. },
  908. drugforms: [
  909. { lable: 1, name: '胶囊' },
  910. { lable: 2, name: '注射剂' },
  911. { lable: 3, name: '片剂' },
  912. { lable: 4, name: '注射液' },
  913. { lable: 5, name: '栓剂' },
  914. { lable: 6, name: '膏' },
  915. { lable: 7, name: '颗粒剂' },
  916. { lable: 8, name: '粉剂' },
  917. { lable: 9, name: '口服液' },
  918. { lable: 10, name: '干混悬剂' },
  919. { lable: 11, name: '丸剂' },
  920. { lable: 12, name: '气雾剂' },
  921. { lable: 13, name: '内服溶液' },
  922. { lable: 14, name: '外用溶液' },
  923. { lable: 15, name: '软膏剂' },
  924. { lable: 16, name: '胶剂' }
  925. ],
  926. medicals:[],
  927. drugSpec:[],
  928. all_drug:[],
  929. current_drug_name:"",
  930. current_drug_spec: "",
  931. drug_id: 0,
  932. src_type:"",
  933. way:0
  934. }
  935. },
  936. created() {
  937. this.getAdviceConfig()
  938. this.unitsOption = getDataConfig('hemodialysis', 'units')
  939. this.getDoctorInitConfig()
  940. },
  941. methods: {
  942. changeDrugName(name){
  943. this.current_drug_name = name
  944. this.templateForm.advice_desc = ''
  945. this.drugSpec = []
  946. for (let i = 0; i < this.all_drug.length; i++) {
  947. if (this.all_drug[i].drug_name == name) {
  948. this.drugSpec = this.all_drug[i].drug_specs
  949. }
  950. }
  951. },
  952. changeDrugDesc(name) {
  953. this.current_drug_spec = name
  954. for (let i = 0; i < this.drugSpec.length; i++) {
  955. if (this.drugSpec[i].drug_spec == name) {
  956. this.templateForm.advice_desc = this.drugSpec[i].drug_spec
  957. this.templateForm.prescribing_number = this.drugSpec[i].prescribing_number.toString()
  958. this.templateForm.single_dose = this.drugSpec[i].single_dose.toString()
  959. this.templateForm.delivery_way = this.drugSpec[i].delivery_way.toString()
  960. this.templateForm.execution_frequency = this.drugSpec[i].execution_frequency.toString()
  961. this.templateForm.drug_id = this.drugSpec[i].id
  962. this.templateForm.single_dose_unit = this.drugSpec[i].min_unit
  963. this.templateForm.prescribing_number_unit = this.drugSpec[i].min_unit
  964. this.templateForm.drug_spec_unit = this.drugSpec[i].min_unit
  965. }
  966. }
  967. },
  968. changeDrugNameTwo(name){
  969. this.current_drug_name = name
  970. this.templateFormEdit.advice_desc = ''
  971. this.drugSpec = []
  972. for (let i = 0; i < this.all_drug.length; i++) {
  973. if (this.all_drug[i].drug_name == name) {
  974. this.drugSpec = this.all_drug[i].drug_specs
  975. }
  976. }
  977. },
  978. changeDrugDescTwo(name) {
  979. this.current_drug_spec = name
  980. for (let i = 0; i < this.drugSpec.length; i++) {
  981. if (this.drugSpec[i].drug_spec == name) {
  982. this.templateFormEdit.advice_desc = this.drugSpec[i].drug_spec
  983. this.templateFormEdit.prescribing_number = this.drugSpec[i].prescribing_number.toString()
  984. this.templateFormEdit.single_dose = this.drugSpec[i].single_dose.toString()
  985. this.templateFormEdit.delivery_way = this.drugSpec[i].delivery_way.toString()
  986. this.templateFormEdit.execution_frequency = this.drugSpec[i].execution_frequency.toString()
  987. this.templateFormEdit.single_dose_unit = this.drugSpec[i].min_unit
  988. this.templateFormEdit.drug_spec_unit = this.drugSpec[i].drug_spec_unit
  989. this.templateFormEdit.prescribing_number_unit = this.drugSpec[i].prescribing_number_unit
  990. this.templateFormEdit.drug_id = this.drugSpec[i].id
  991. }
  992. }
  993. },
  994. adviceNameShow({ row, column, rowIndex, columnIndex }) {
  995. if (columnIndex == 1) {
  996. return 'templateadvicenamedisplay'
  997. } else {
  998. return ''
  999. }
  1000. },
  1001. showCreatedTimes() {
  1002. this.createdTimes = this.createdTimes + 1
  1003. },
  1004. cancelHandle(formName) {
  1005. this.table_current_index = -1
  1006. this.resetForm(formName)
  1007. if (this.isAddChild) {
  1008. this.templateFormVisible = false
  1009. } else {
  1010. this.templateFormVisible = false
  1011. this.templateTableVisible = true
  1012. }
  1013. },
  1014. handleCreateTemplate() {
  1015. this.form.advice_type = 0
  1016. this.templateTableVisible = true
  1017. },
  1018. newRecordAction() {
  1019. this.dialogTitle = '新增医嘱内容'
  1020. this.advice_content_name = '医嘱内容'
  1021. this.isEdit = false
  1022. this.parent_id = 0
  1023. this.isAddChild = false
  1024. this.templateTableVisible = false
  1025. this.templateFormVisible = true
  1026. }, deleteRecordAction: function() {
  1027. if (this.table_current_index == -1) {
  1028. this.$message.error('请选择一条医嘱记录')
  1029. return
  1030. }
  1031. this.$confirm('删除记录', '是否删除该医嘱记录', {
  1032. confirmButtonText: '确 定',
  1033. cancelButtonText: '取 消',
  1034. type: 'warning'
  1035. }).then(() => {
  1036. this.adviceTableData.splice(this.table_current_index, 1)
  1037. this.table_current_index = -1
  1038. }).catch(() => {
  1039. })
  1040. }, tableRow({ row, rowIndex }) {
  1041. // 把每一行的索引放进row
  1042. row.index = rowIndex
  1043. },
  1044. onRowClick(row, event, column) {
  1045. this.table_current_index = row.index
  1046. },
  1047. modifyRecordAction: function() {
  1048. if (this.table_current_index == -1) {
  1049. this.$message.error('请选择一条医嘱记录')
  1050. return
  1051. }
  1052. this.isEdit = true
  1053. const adviceTable = this.adviceTableData[this.table_current_index]
  1054. for (var index in adviceTable) {
  1055. this.templateForm[index] = adviceTable[index]
  1056. }
  1057. this.templateFormVisible = true
  1058. this.templateTableVisible = false
  1059. this.dialogTitle = '编辑医嘱内容'
  1060. this.advice_content_name = '医嘱内容'
  1061. }, cancelTableHandle: function() {
  1062. this.$confirm('放弃编辑', '是否放弃编辑,已编辑的数据将无法恢复', {
  1063. confirmButtonText: '确 定',
  1064. cancelButtonText: '取 消',
  1065. type: 'warning'
  1066. }).then(() => {
  1067. this.adviceTableData = []
  1068. this.form.name = ''
  1069. this.templateFormVisible = false
  1070. this.templateTableVisible = false
  1071. }).catch(() => {
  1072. })
  1073. },
  1074. //添加医嘱模版
  1075. submitTableTemplate(formName) {
  1076. if (this.adviceTableData.length <= 0) {
  1077. this.$message.error('至少添加一条医嘱信息')
  1078. return
  1079. }
  1080. const params = {
  1081. 'data': this.adviceTableData
  1082. }
  1083. let name = encodeURIComponent(this.form.name)
  1084. console.log("params",params)
  1085. postHisAdviceTemplate(params, name, this.form.advice_type).then(response => {
  1086. if (response.data.state == 0) {
  1087. this.$message.error(response.data.msg)
  1088. return false
  1089. } else {
  1090. this.$message.success('添加模版成功')
  1091. var template = response.data.data.template
  1092. if (template.advices.length > 0) {
  1093. for (let i = 0; i < template.advices.length; i++) {
  1094. const object = {}
  1095. const DoctorAdviceTemplate = template.advices[i]
  1096. for (const key in DoctorAdviceTemplate) {
  1097. object[key] = DoctorAdviceTemplate[key]
  1098. }
  1099. object['name'] = template.name
  1100. object['isNoSub'] = 2
  1101. this.adviceTemplates.unshift(object)
  1102. }
  1103. }
  1104. this.handleSpanTempArr()
  1105. this.form.name = ''
  1106. this.adviceTableData = []
  1107. this.templateFormVisible = false
  1108. this.templateTableVisible = false
  1109. }
  1110. })
  1111. },
  1112. resetForm(formName) {
  1113. this.$refs[formName].resetFields()
  1114. },
  1115. handleDeleteAdviceTemplate(row, index) {
  1116. this.$confirm('确认删除此医嘱模板?', '删除', {
  1117. confirmButtonText: '确 定',
  1118. cancelButtonText: '取 消',
  1119. type: 'warning'
  1120. })
  1121. .then(() => {
  1122. DeleteHisParentAdviceTemplate(row.template_id).then(response => {
  1123. if (response.data.state == 0) {
  1124. this.$message.error(response.data.msg)
  1125. return false
  1126. } else {
  1127. this.$message.success('删除成功')
  1128. // console.log(this.adviceTemplates.length)
  1129. // for(let i = 0;i < this.adviceTemplates.length; i++){
  1130. // if(this.adviceTemplates[i].template_id == row.template_id){
  1131. // this.adviceTemplates.splice(i,1);
  1132. // }
  1133. // }
  1134. this.getAdviceConfig()
  1135. }
  1136. })
  1137. })
  1138. .catch(() => {
  1139. })
  1140. },
  1141. submitTemplate(formName) {
  1142. this.$refs[formName].validate(valid => {
  1143. this.templateForm.single_dose = parseFloat(this.templateForm.single_dose)
  1144. this.templateForm.prescribing_number = parseFloat(this.templateForm.prescribing_number)
  1145. if (isNaN(this.templateForm.single_dose)) {
  1146. this.templateForm.single_dose = 0
  1147. }
  1148. if (isNaN(this.templateForm.prescribing_number)) {
  1149. this.templateForm.prescribing_number = 0
  1150. }
  1151. if (valid) {
  1152. const templateFormTwo = {}
  1153. templateFormTwo.template_id = this.current_template_id
  1154. templateFormTwo.advice_name = this.templateForm.advice_name
  1155. templateFormTwo.advice_desc = this.templateForm.advice_desc
  1156. templateFormTwo.drug_spec = this.templateForm.drug_spec
  1157. templateFormTwo.drug_spec_unit = this.templateForm.drug_spec_unit
  1158. templateFormTwo.single_dose = this.templateForm.single_dose
  1159. templateFormTwo.single_dose_unit = this.templateForm.single_dose_unit
  1160. templateFormTwo.prescribing_number = this.templateForm.prescribing_number
  1161. templateFormTwo.prescribing_number_unit = this.templateForm.prescribing_number_unit
  1162. templateFormTwo.delivery_way = this.templateForm.delivery_way
  1163. templateFormTwo.execution_frequency = this.templateForm.execution_frequency
  1164. templateFormTwo.parent_id = this.parent_id
  1165. if (this.isAddChild) {
  1166. } else {
  1167. const templateFormTwo = {}
  1168. templateFormTwo.advice_name = this.templateForm.advice_name
  1169. templateFormTwo.advice_desc = this.templateForm.advice_desc
  1170. templateFormTwo.drug_spec = this.templateForm.drug_spec
  1171. templateFormTwo.drug_spec_unit = this.templateForm.drug_spec_unit
  1172. templateFormTwo.single_dose = this.templateForm.single_dose
  1173. templateFormTwo.single_dose_unit = this.templateForm.single_dose_unit
  1174. templateFormTwo.prescribing_number = this.templateForm.prescribing_number
  1175. templateFormTwo.prescribing_number_unit = this.templateForm.prescribing_number_unit
  1176. templateFormTwo.delivery_way = this.templateForm.delivery_way
  1177. templateFormTwo.execution_frequency = this.templateForm.execution_frequency
  1178. templateFormTwo.drug_id = this.templateForm.drug_id
  1179. templateFormTwo.parent_id = this.parent_id
  1180. this.templateForm.advice_name = ''
  1181. this.templateForm.advice_desc = ''
  1182. if (this.isEdit) {
  1183. for (let i = 0; i < this.adviceTableData.length; i++) {
  1184. if (i == this.table_current_index) {
  1185. this.adviceTableData[i].advice_name = templateFormTwo.advice_name
  1186. this.adviceTableData[i].advice_desc = templateFormTwo.advice_desc
  1187. this.adviceTableData[i].drug_spec = templateFormTwo.drug_spec
  1188. this.adviceTableData[i].drug_spec_unit = templateFormTwo.drug_spec_unit
  1189. this.adviceTableData[i].single_dose = templateFormTwo.single_dose
  1190. this.adviceTableData[i].single_dose_unit = templateFormTwo.single_dose_unit
  1191. this.adviceTableData[i].prescribing_number = templateFormTwo.prescribing_number
  1192. this.adviceTableData[i].prescribing_number_unit = templateFormTwo.prescribing_number_unit
  1193. this.adviceTableData[i].delivery_way = templateFormTwo.delivery_way
  1194. this.adviceTableData[i].execution_frequency = templateFormTwo.execution_frequency
  1195. this.adviceTableData[i].drug_id = templateFormTwo.drug_id
  1196. }
  1197. }
  1198. } else {
  1199. this.adviceTableData.unshift(templateFormTwo)
  1200. }
  1201. console.log(this.adviceTableData)
  1202. this.templateFormVisible = false
  1203. this.templateTableVisible = true
  1204. }
  1205. this.$refs[formName].resetFields()
  1206. }
  1207. })
  1208. },
  1209. handleCreateDrugWay() {
  1210. this.drugwayForm = {
  1211. name: '',
  1212. id: 0
  1213. }
  1214. this.drugwayFormVisible = true
  1215. this.dialogTitle = '新增给药途径'
  1216. this.isEdit = false
  1217. },
  1218. handleUpdateDrugWay(row, index) {
  1219. this.currentIndex = index
  1220. this.drugwayForm = {
  1221. name: row.name,
  1222. id: row.id
  1223. }
  1224. this.drugwayFormVisible = true
  1225. this.dialogTitle = '编辑给药途径'
  1226. this.isEdit = true
  1227. },
  1228. getAdviceConfig() {
  1229. this.adviceTemplates = []
  1230. getAllHisAdviceTemplate().then(response => {
  1231. if (response.data.state == 1) {
  1232. this.drugways = response.data.data.drugways
  1233. this.executionFrequencyOptions = response.data.data.efs
  1234. this.drugdics = response.data.data.drugs
  1235. this.all_drug = response.data.data.drugs
  1236. const len = response.data.data.advice_templates.length
  1237. for (let i = 0; i < len; i++) {
  1238. // 对于空医嘱模版的处理
  1239. if (response.data.data.advice_templates[i] != null && response.data.data.advice_templates[i].advices.length == 0) {
  1240. const object = {}
  1241. object['name'] = response.data.data.advice_templates[i].name
  1242. object['isNoSub'] = 1
  1243. object['template_id'] = response.data.data.advice_templates[i].id
  1244. this.adviceTemplates.push(object)
  1245. }
  1246. // 非空模版的处理
  1247. for (let y = 0; y < response.data.data.advice_templates[i].advices.length; y++) {
  1248. if (response.data.data.advice_templates[i].id == response.data.data.advice_templates[i].advices[y].template_id) {
  1249. const object = {}
  1250. const DoctorAdviceTemplate = response.data.data.advice_templates[i].advices[y]
  1251. for (const key in DoctorAdviceTemplate) {
  1252. object[key] = DoctorAdviceTemplate[key]
  1253. }
  1254. object['isNoSub'] = 2
  1255. object['name'] = response.data.data.advice_templates[i].name
  1256. this.adviceTemplates.push(object)
  1257. }
  1258. }
  1259. }
  1260. // 处理单元格合并的数据
  1261. this.handleSpanTempArr()
  1262. }
  1263. })
  1264. }, isShow(index, row) {
  1265. if (index > 0 && row.name == this.adviceTemplates[index - 1].name) {
  1266. return false
  1267. }
  1268. return true
  1269. }, cancelEditHandle() {
  1270. // this.templateTableVisible = true
  1271. this.templateEditFormVisible = false
  1272. },
  1273. //编辑医嘱
  1274. submitEditTemplate(formName) {
  1275. var drug_id = 0
  1276. for(let i=0;i<this.all_drug.length;i++){
  1277. if(this.templateFormEdit.advice_name == this.all_drug[i].drug_name){
  1278. drug_id = this.all_drug[i].id
  1279. }
  1280. }
  1281. this.templateFormEdit.drug_id = drug_id
  1282. console.log("编辑子药",this.templateFormEdit)
  1283. this.$refs[formName].validate(valid => {
  1284. this.templateFormEdit.single_dose = parseFloat(this.templateFormEdit.single_dose)
  1285. this.templateFormEdit.prescribing_number = parseFloat(this.templateFormEdit.prescribing_number)
  1286. if (isNaN(this.templateFormEdit.single_dose)) {
  1287. this.templateFormEdit.single_dose = 0
  1288. }
  1289. if (isNaN(this.templateFormEdit.prescribing_number)) {
  1290. this.templateFormEdit.prescribing_number = 0
  1291. }
  1292. if (valid) {
  1293. UpdateHisAdviceTemplate(this.templateFormEdit.id, this.templateFormEdit,this.templateFormEdit.drug_id).then(
  1294. response => {
  1295. if (response.data.state == 0) {
  1296. this.$message.error(response.data.msg)
  1297. return false
  1298. } else {
  1299. this.$message.success('修改成功')
  1300. this.templateEditFormVisible = false
  1301. this.resetForm(formName)
  1302. var template = response.data.data.template
  1303. this.adviceTemplates[this.currentIndex].advice_name = template.advice_name
  1304. this.adviceTemplates[this.currentIndex].advice_desc = template.advice_desc
  1305. this.adviceTemplates[this.currentIndex].drug_spec = template.drug_spec
  1306. this.adviceTemplates[this.currentIndex].drug_spec_unit = template.drug_spec_unit
  1307. this.adviceTemplates[this.currentIndex].single_dose = template.single_dose
  1308. this.adviceTemplates[this.currentIndex].single_dose_unit = template.single_dose_unit
  1309. this.adviceTemplates[this.currentIndex].delivery_way = template.delivery_way
  1310. this.adviceTemplates[this.currentIndex].execution_frequency = template.execution_frequency
  1311. this.adviceTemplates[this.currentIndex].prescribing_number = template.prescribing_number
  1312. this.adviceTemplates[this.currentIndex].prescribing_number_unit = template.prescribing_number_unit
  1313. this.adviceTemplates[this.currentIndex].day_count = template.day_count
  1314. this.adviceTemplates[this.currentIndex].week_days = template.week_days
  1315. this.adviceTemplates[this.currentIndex].frequency_type = template.frequency_type
  1316. this.adviceTemplates[this.currentIndex].drug_id = template.drug_id
  1317. this.currentIndex = -1
  1318. return false
  1319. }
  1320. }
  1321. )
  1322. }
  1323. })
  1324. },
  1325. drugDesc(row) {
  1326. if (row.isNoSub == 2) {
  1327. if (row.drug_spec.length <= 0) {
  1328. return ''
  1329. } else {
  1330. if (row.prescribing_number == 0) {
  1331. return row.drug_spec + '' + row.drug_spec_unit
  1332. } else {
  1333. return row.drug_spec + '' + row.drug_spec_unit + ' * ' + row.prescribing_number + row.prescribing_number_unit
  1334. }
  1335. }
  1336. }
  1337. }, drugDescTwo(row) {
  1338. if (row.drug_spec.length <= 0) {
  1339. return ''
  1340. } else {
  1341. if (row.prescribing_number == 0) {
  1342. return row.drug_spec + '' + row.drug_spec_unit
  1343. } else {
  1344. return row.drug_spec + '' + row.drug_spec_unit + ' * ' + row.prescribing_number + row.prescribing_number_unit
  1345. }
  1346. }
  1347. }, newRecordActionTwo() {
  1348. this.templateFormTwoVisible = true
  1349. }, deleteRecordActionTwo() {
  1350. if (this.table_current_index_two == -1) {
  1351. this.$message.error('请选择一条医嘱记录')
  1352. return
  1353. }
  1354. this.$confirm('删除记录', '是否删除该医嘱记录', {
  1355. confirmButtonText: '确 定',
  1356. cancelButtonText: '取 消',
  1357. type: 'warning'
  1358. }).then(() => {
  1359. const id = this.adviceTableDataTwo[this.table_current_index_two].id
  1360. const template_id = this.adviceTableDataTwo[this.table_current_index_two].template_id
  1361. DeleteHisAdviceTemplate(id, template_id).then(response => {
  1362. if (response.data.state == 0) {
  1363. this.$message.error(response.data.msg)
  1364. return false
  1365. } else {
  1366. this.$message.success('删除成功')
  1367. for (let i = 0; i < this.adviceTemplates.length; i++) {
  1368. console.log(this.adviceTemplates[i].id)
  1369. if (this.adviceTemplates[i].id == this.adviceTableDataTwo[this.table_current_index_two].id) {
  1370. this.adviceTemplates.splice(i, 1)
  1371. }
  1372. }
  1373. this.adviceTableDataTwo.splice(this.table_current_index_two, 1)
  1374. this.table_current_index_two = -1
  1375. }
  1376. })
  1377. }).catch(() => {
  1378. })
  1379. }, modifyRecordActionTwo() {
  1380. if (this.table_current_index_two == -1) {
  1381. this.$message.error('请选择一条医嘱记录')
  1382. return
  1383. }
  1384. this.templateFormEdit = {
  1385. drug_spec: this.adviceTableDataTwo[this.table_current_index_two].drug_spec,
  1386. drug_spec_unit: this.adviceTableDataTwo[this.table_current_index_two].drug_spec_unit,
  1387. advice_name: this.adviceTableDataTwo[this.table_current_index_two].advice_name,
  1388. advice_desc: this.adviceTableDataTwo[this.table_current_index_two].advice_desc,
  1389. single_dose: this.adviceTableDataTwo[this.table_current_index_two].single_dose,
  1390. single_dose_unit: this.adviceTableDataTwo[this.table_current_index_two].single_dose_unit,
  1391. prescribing_number: this.adviceTableDataTwo[this.table_current_index_two].prescribing_number,
  1392. prescribing_number_unit: this.adviceTableDataTwo[this.table_current_index_two].prescribing_number_unit,
  1393. delivery_way: this.adviceTableDataTwo[this.table_current_index_two].delivery_way,
  1394. execution_frequency: this.adviceTableDataTwo[this.table_current_index_two].execution_frequency,
  1395. id: this.adviceTableDataTwo[this.table_current_index_two].id
  1396. }
  1397. this.templateEditFormTwoVisible = true
  1398. }, tableRowClassNameTwo({ row, rowIndex }) {
  1399. // 把每一行的索引放进row
  1400. row.index = rowIndex
  1401. },
  1402. onRowClickTwo(row, event, column) {
  1403. this.table_current_index_two = row.index
  1404. }, cancelHandleTwo() {
  1405. this.templateFormTwoVisible = false
  1406. },
  1407. submitTemplateTwo(formName) {
  1408. this.templateForm['template_id'] = this.current_template_id
  1409. this.templateForm['advice_type'] = this.form.advice_type
  1410. // 编辑创建医嘱模版
  1411. CreateHisSingleAdviceTemplate(this.templateForm).then(response => {
  1412. if (response.data.state == 0) {
  1413. this.$message.error(response.data.msg)
  1414. return false
  1415. } else {
  1416. const source = response.data.data.template
  1417. const objects = {}
  1418. for (const keys in source) {
  1419. objects[keys] = source[keys]
  1420. }
  1421. objects['name'] = this.current_template_name
  1422. objects['isNoSub'] = 2
  1423. this.adviceTableDataTwo.unshift(response.data.data.template)
  1424. this.getAdviceConfig()
  1425. this.resetForm(formName)
  1426. this.templateFormTwoVisible = false
  1427. this.$message.success('添加成功')
  1428. return false
  1429. }
  1430. })
  1431. }, cancelTableHandleTwo() {
  1432. this.templateTableTwoVisible = false
  1433. this.adviceTableDataTwo = []
  1434. }, cancelEditHandleTwo() {
  1435. this.templateEditFormTwoVisible = false
  1436. },
  1437. submitEditTemplateTwo(formName) {
  1438. this.$refs[formName].validate(valid => {
  1439. this.templateFormEdit.single_dose = parseFloat(this.templateFormEdit.single_dose)
  1440. this.templateFormEdit.prescribing_number = parseFloat(this.templateFormEdit.prescribing_number)
  1441. if (isNaN(this.templateFormEdit.single_dose)) {
  1442. this.templateFormEdit.single_dose = 0
  1443. }
  1444. if (isNaN(this.templateFormEdit.prescribing_number)) {
  1445. this.templateFormEdit.prescribing_number = 0
  1446. }
  1447. if (valid) {
  1448. UpdateHisAdviceTemplate(this.templateFormEdit.id, this.templateFormEdit).then(
  1449. response => {
  1450. if (response.data.state == 0) {
  1451. this.$message.error(response.data.msg)
  1452. return false
  1453. } else {
  1454. this.$message.success('修改成功')
  1455. this.templateEditFormTwoVisible = false
  1456. this.resetForm(formName)
  1457. var template = response.data.data.template
  1458. this.adviceTableDataTwo[this.table_current_index_two].advice_name = template.advice_name
  1459. this.adviceTableDataTwo[this.table_current_index_two].advice_desc = template.advice_desc
  1460. this.adviceTableDataTwo[this.table_current_index_two].drug_spec = template.drug_spec
  1461. this.adviceTableDataTwo[this.table_current_index_two].drug_spec_unit = template.drug_spec_unit
  1462. this.adviceTableDataTwo[this.table_current_index_two].single_dose = template.single_dose
  1463. this.adviceTableDataTwo[this.table_current_index_two].single_dose_unit = template.single_dose_unit
  1464. this.adviceTableDataTwo[this.table_current_index_two].delivery_way = template.delivery_way
  1465. this.adviceTableDataTwo[this.table_current_index_two].execution_frequency = template.execution_frequency
  1466. this.adviceTableDataTwo[this.table_current_index_two].prescribing_number = template.prescribing_number
  1467. this.adviceTableDataTwo[this.table_current_index_two].prescribing_number_unit = template.prescribing_number_unit
  1468. for (let i = 0; i < this.adviceTemplates.length; i++) {
  1469. if (this.adviceTemplates[i].id == this.adviceTableDataTwo[this.table_current_index_two].id) {
  1470. this.adviceTemplates[i].advice_name = template.advice_name
  1471. this.adviceTemplates[i].advice_desc = template.advice_desc
  1472. this.adviceTemplates[i].drug_spec = template.drug_spec
  1473. this.adviceTemplates[i].drug_spec_unit = template.drug_spec_unit
  1474. this.adviceTemplates[i].single_dose = template.single_dose
  1475. this.adviceTemplates[i].single_dose_unit = template.single_dose_unit
  1476. this.adviceTemplates[i].delivery_way = template.delivery_way
  1477. this.adviceTemplates[i].execution_frequency = template.execution_frequency
  1478. this.adviceTemplates[i].prescribing_number = template.prescribing_number
  1479. this.adviceTemplates[i].prescribing_number_unit = template.prescribing_number_unit
  1480. }
  1481. }
  1482. return false
  1483. }
  1484. }
  1485. )
  1486. }
  1487. })
  1488. }, merge({ row, column, rowIndex, columnIndex }) {
  1489. if (columnIndex === 0 || columnIndex === 7) {
  1490. const _row = this.tempArr[rowIndex]
  1491. const _col = _row > 0 ? 1 : 0
  1492. return {
  1493. rowspan: _row,
  1494. colspan: _col
  1495. }
  1496. }
  1497. }, tableRowClassNames({ row, rowIndex }) {
  1498. const arr = this.hoverOrderArr
  1499. for (let i = 0; i < arr.length; i++) {
  1500. if (rowIndex == arr[i]) {
  1501. return 'success-row'
  1502. }
  1503. }
  1504. }, cellMouseEnter: function(row, column, cell, event) {
  1505. if (column.label == '模版名称') {
  1506. this.sameRowArr.forEach((arr, i) => {
  1507. if (arr.indexOf(row.index) != -1) {
  1508. this.hoverOrderArr = arr
  1509. }
  1510. })
  1511. } else if (column.label == '操作') {
  1512. this.sameRowArr.forEach((arr, i) => {
  1513. if (arr.indexOf(row.index) != -1) {
  1514. this.hoverOrderArr = arr
  1515. }
  1516. })
  1517. } else {
  1518. this.hoverOrderArr = []
  1519. }
  1520. }, cellMouseLeave: function(row, column, cell, event) {
  1521. this.hoverOrderArr = []
  1522. },
  1523. // 修改医嘱模版
  1524. openEdit(index, row) {
  1525. console.log("row22222",row)
  1526. this.hoverOrderArr = []
  1527. this.currentIndex = index
  1528. this.templateFormEdit.drug_spec_unit = row.drug_spec_unit
  1529. this.templateFormEdit.drug_spec = row.drug_spec
  1530. this.templateFormEdit.advice_desc = row.advice_desc
  1531. this.templateFormEdit.advice_name = row.advice_name
  1532. this.templateFormEdit.delivery_way = row.delivery_way
  1533. this.templateFormEdit.execution_frequency = row.execution_frequency
  1534. this.templateFormEdit.prescribing_number = row.prescribing_number
  1535. this.templateFormEdit.prescribing_number_unit = row.prescribing_number_unit
  1536. this.templateFormEdit.single_dose = row.single_dose
  1537. this.templateFormEdit.single_dose_unit = row.single_dose_unit
  1538. this.templateFormEdit.id = row.id
  1539. this.templateFormEdit.parent_id = row.parent_id
  1540. this.templateFormEdit.drug_id = row.drug_id
  1541. this.templateEditFormVisible = true
  1542. if (row.parent_id > 0) {
  1543. this.editDialogTitle = '编辑子药'
  1544. this.edit_advice_name = '子药名称'
  1545. } else {
  1546. this.editDialogTitle = '编辑医嘱'
  1547. this.edit_advice_name = '医嘱内容'
  1548. }
  1549. },
  1550. openDelete(index, row) {
  1551. this.hoverOrderArr = []
  1552. this.$confirm('删除记录', '是否删除该医嘱', {
  1553. confirmButtonText: '确 定',
  1554. cancelButtonText: '取 消',
  1555. type: 'warning'
  1556. }).then(() => {
  1557. const id = row.id
  1558. const template_id = row.template_id
  1559. const parent_id = row.parent_id
  1560. DeleteHisAdviceTemplate(id, template_id, parent_id).then(response => {
  1561. if (response.data.state == 0) {
  1562. this.$message.error(response.data.msg)
  1563. return false
  1564. } else {
  1565. this.$message.success('删除成功')
  1566. if (row.parent_id > 0) { // 删除子医嘱
  1567. this.adviceTemplates.splice(index, 1)
  1568. } else { // 如果医嘱下面包含子医嘱,删除医嘱和子医嘱
  1569. // 删除子医嘱
  1570. for (let i = 0; i < this.adviceTemplates.length; i++) {
  1571. if (this.adviceTemplates[i].parent_id == row.id) {
  1572. this.adviceTemplates.splice(i--, 1)
  1573. }
  1574. }
  1575. // 删除医嘱
  1576. this.adviceTemplates.splice(index, 1)
  1577. // 当该模版下没有医嘱的时候,创建一个空模版
  1578. let count = 0 // 用于计数
  1579. for (let i = 0; i < this.adviceTemplates.length; i++) {
  1580. if (this.adviceTemplates[i].template_id == row.template_id) {
  1581. count = count + 1
  1582. }
  1583. }
  1584. if (count == 0) {
  1585. const object = {}
  1586. object['name'] = row.name
  1587. object['isNoSub'] = 1
  1588. object['template_id'] = row.template_id
  1589. this.adviceTemplates.splice(index, 0, object)
  1590. }
  1591. }
  1592. // 处理单元格合并的数据
  1593. this.handleSpanTempArr()
  1594. }
  1595. })
  1596. }).catch(() => {
  1597. })
  1598. }, openDeleteChild(index, row) {
  1599. this.hoverOrderArr = []
  1600. this.$confirm('删除子药', '是否删除该子药', {
  1601. confirmButtonText: '确 定',
  1602. cancelButtonText: '取 消',
  1603. type: 'warning'
  1604. }).then(() => {
  1605. const id = row.id
  1606. const template_id = row.template_id
  1607. const parent_id = row.parent_id
  1608. DeleteHisAdviceTemplate(id, template_id, parent_id).then(response => {
  1609. if (response.data.state == 0) {
  1610. this.$message.error(response.data.msg)
  1611. return false
  1612. } else {
  1613. this.$message.success('删除成功')
  1614. if (row.parent_id > 0) { // 删除子医嘱
  1615. this.adviceTemplates.splice(index, 1)
  1616. } else { // 如果医嘱下面包含子医嘱,删除医嘱和子医嘱
  1617. // 删除子医嘱
  1618. for (let i = 0; i < this.adviceTemplates.length; i++) {
  1619. if (this.adviceTemplates[i].parent_id == row.id) {
  1620. this.adviceTemplates.splice(i--, 1)
  1621. }
  1622. }
  1623. // 删除医嘱
  1624. this.adviceTemplates.splice(index, 1)
  1625. // 当该模版下没有医嘱的时候,创建一个空模版
  1626. let count = 0 // 用于计数
  1627. for (let i = 0; i < this.adviceTemplates.length; i++) {
  1628. if (this.adviceTemplates[i].template_id == row.template_id) {
  1629. count = count + 1
  1630. }
  1631. }
  1632. if (count == 0) {
  1633. const object = {}
  1634. object['name'] = row.name
  1635. object['isNoSub'] = 1
  1636. object['template_id'] = row.template_id
  1637. this.adviceTemplates.splice(index, 0, object)
  1638. }
  1639. }
  1640. // 处理单元格合并的数据
  1641. this.handleSpanTempArr()
  1642. }
  1643. })
  1644. }).catch(() => {
  1645. })
  1646. },
  1647. openNewChild(index, row) {
  1648. this.hoverOrderArr = []
  1649. this.current_template_id = row.template_id
  1650. this.parent_id = row.id
  1651. this.isAddChild = true
  1652. this.isEdit = false
  1653. this.templateFormVisible = true
  1654. this.dialogTitle = '新增子药'
  1655. this.advice_content_name = '子药名称'
  1656. }, deleteRecordAction: function() {
  1657. if (this.table_current_index == -1) {
  1658. this.$message.error('请选择一条医嘱记录')
  1659. return
  1660. }
  1661. this.$confirm('删除记录', '是否删除该医嘱记录', {
  1662. confirmButtonText: '确 定',
  1663. cancelButtonText: '取 消',
  1664. type: 'warning'
  1665. }).then(() => {
  1666. this.adviceTableData.splice(this.table_current_index, 1)
  1667. this.table_current_index = -1
  1668. }).catch(() => {
  1669. })
  1670. }, handleSpanTempArr() {
  1671. this.tempArr = []
  1672. for (let i = 0; i < this.adviceTemplates.length; i++) {
  1673. if (i === 0) {
  1674. this.tempArr.push(1)
  1675. this.pos = 0
  1676. } else {
  1677. // 判断当前元素与上一个元素是否相同
  1678. if (this.adviceTemplates[i].template_id === this.adviceTemplates[i - 1].template_id) {
  1679. this.tempArr[this.pos] += 1
  1680. this.tempArr.push(0)
  1681. } else {
  1682. this.tempArr.push(1)
  1683. this.pos = i
  1684. }
  1685. }
  1686. }
  1687. let sameRowArr = [], sIdx = 0
  1688. this.adviceTemplates.forEach((item, index) => {
  1689. item.index = index
  1690. if (index === 0) {
  1691. sameRowArr.push([index])
  1692. } else {
  1693. if (item.template_id === this.adviceTemplates[index - 1].template_id) {
  1694. sameRowArr[sIdx].push(index)
  1695. } else {
  1696. sIdx = sIdx + 1
  1697. sameRowArr.push([index])
  1698. }
  1699. }
  1700. })
  1701. this.sameRowArr = sameRowArr
  1702. },
  1703. handleUpdateAdviceTemplate(row, index) {
  1704. this.current_template_id = row.template_id
  1705. this.current_template_name = row.name
  1706. this.form.name = row.name
  1707. this.form.advice_type = row.advice_type
  1708. this.templateTableTwoVisible = true
  1709. this.adviceTableDataTwo = []
  1710. for (let i = 0; i < this.adviceTemplates.length; i++) {
  1711. if (this.adviceTemplates[i].template_id == row.template_id) {
  1712. this.adviceTableDataTwo.push(this.adviceTemplates[i])
  1713. }
  1714. }
  1715. },
  1716. modifyTemplateName() {
  1717. const params = {
  1718. template_name: this.form.name,
  1719. template_id: this.current_template_id
  1720. }
  1721. updateHisTemplateName(params).then(response => {
  1722. if (response.data.state == 0) {
  1723. this.$message.error(response.data.msg)
  1724. return false
  1725. } else {
  1726. this.$message.success('修改成功')
  1727. this.templateTableTwoVisible = false
  1728. for (let i = 0; i < this.adviceTemplates.length; i++) {
  1729. if (this.adviceTemplates[i].template_id == this.current_template_id) {
  1730. this.adviceTemplates[i].name = response.data.data.template_name
  1731. }
  1732. }
  1733. }
  1734. })
  1735. }, rand(min, max) {
  1736. return Math.floor(Math.random() * (max - min)) + min;
  1737. }
  1738. }
  1739. }
  1740. </script>
  1741. <style>
  1742. .center th .cell {
  1743. text-align: center !important;
  1744. }
  1745. .templateadvicenamedisplay .cell {
  1746. float: left;
  1747. text-align: left;
  1748. }
  1749. .el-table td,
  1750. .el-table th.is-leaf,
  1751. .el-table--border,
  1752. .el-table--group {
  1753. border-color: #d0d3da;
  1754. }
  1755. .el-table--border::after,
  1756. .el-table--group::after,
  1757. .el-table::before {
  1758. background-color: #d0d3da;
  1759. }
  1760. </style>