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

DoctorAdviceDialog.vue 53KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472
  1. <template>
  2. <div class="doctor-advice-box">
  3. <el-dialog
  4. :title="title"
  5. :visible.sync="isVisibility"
  6. width="1010px"
  7. @close="resetDialog"
  8. :modal-append-to-body="false"
  9. >
  10. <div class="txsj" v-show="showAdvicePanel">
  11. <el-button round @click="openGroupFrom" :loading="deleLoading"
  12. :disabled="!is_has_create"
  13. >
  14. 新增医嘱
  15. </el-button>
  16. <el-button v-if="currentRow != null" round :disabled="!is_has_exce"
  17. @click="execAdvice" :loading="deleLoading">执行医嘱
  18. </el-button>
  19. <el-button v-else disabled round @click="execAdvice" :loading="deleLoading">执行医嘱</el-button>
  20. <el-button v-if="currentRow != null" round :disabled="!is_has_check"
  21. @click="checkAdvice" :loading="deleLoading">医嘱核对
  22. </el-button>
  23. <el-button v-else disabled round @click="checkAdvice" :loading="deleLoading">医嘱核对</el-button>
  24. <el-button
  25. v-if="groupSelectRow != null" :disabled="!is_has_modify && !is_has_modify_other"
  26. round @click="openEditGroupAdvice" :loading="deleLoading">修改医嘱
  27. </el-button>
  28. <el-button v-else disabled round @click="openEditGroupAdvice" :loading="deleLoading">修改医嘱</el-button>
  29. <el-button
  30. v-if="groupSelectRow != null" :disabled="!is_has_del && !is_has_del_other"
  31. round @click="openDeleteGroupAdvice" :loading="deleLoading">删除医嘱
  32. </el-button>
  33. <el-button v-else disabled round @click="openDeleteGroupAdvice" :loading="deleLoading">删除医嘱</el-button>
  34. <!--<el-button round @click="openNewChild" :loading="deleLoading">新增子药</el-button>-->
  35. </div>
  36. <!-- 医嘱列表 -->
  37. <!--&lt;!&ndash;:header-cell-style="{ backgroundColor: 'rgb(64, 158, 255)', color: 'white'}"&ndash;&gt;@current-change="selectRow"-->
  38. <el-table :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)'}" :data="doctor_advices" border
  39. style="width: 100%" v-show="showAdvicePanel"
  40. ref="advices_list" :row-class-name="tableRowClassName" :span-method="mergeSpan"
  41. @row-click="cellMouseEnter" :cell-class-name="adviceNameShow" :modal-append-to-body="false"
  42. >
  43. <el-table-column prop="date" label="开嘱医生" align="center" min-width="26px">
  44. <template slot-scope="scope">
  45. <span v-if="isShowStartTime(scope.$index, scope.row)">{{getXuserName(scope.row.advice_doctor)}}</span>
  46. </template>
  47. </el-table-column>
  48. <el-table-column prop="start_time" label="开始时间" align="center" min-width="35px">
  49. <template slot-scope="scope">
  50. <span v-if="isShowStartTime(scope.$index, scope.row)">{{scope.row.start_time | parseTime('{y}-{m}-{d} {h}:{i}')}}</span>
  51. </template>
  52. </el-table-column>
  53. <el-table-column prop="advice_name" min-width="50px" label="医嘱内容" align="center"
  54. >
  55. <template slot-scope="scope">
  56. <el-dropdown trigger="click" v-if="scope.row.parent_id == 0 ">
  57. <span class="el-dropdown-link">{{getAdviceContent(scope.row,1)}}<i
  58. class="el-icon-arrow-down el-icon--right"></i></span>
  59. <el-dropdown-menu slot="dropdown">
  60. <el-dropdown-item @click.native="openEdit(scope.$index, scope.row)">修改医嘱</el-dropdown-item>
  61. <el-dropdown-item @click.native="openDelete(scope.$index, scope.row)">删除医嘱</el-dropdown-item>
  62. <el-dropdown-item @click.native="openNewChildTwo(scope.$index, scope.row)">新增子药</el-dropdown-item>
  63. </el-dropdown-menu>
  64. </el-dropdown>
  65. <el-dropdown trigger="click" v-if="scope.row.parent_id > 0 ">
  66. <span class="el-dropdown-link">&emsp;{{getAdviceContent(scope.row,2)}}<i
  67. class="el-icon-arrow-down el-icon--right"></i></span>
  68. <el-dropdown-menu slot="dropdown">
  69. <el-dropdown-item
  70. @click.native="openEdit(scope.$index, scope.row)">修改子药
  71. </el-dropdown-item>
  72. <el-dropdown-item
  73. @click.native="openDelete(scope.$index, scope.row)">删除子药
  74. </el-dropdown-item>
  75. </el-dropdown-menu>
  76. </el-dropdown>
  77. </template>
  78. </el-table-column>
  79. <!--<el-table-column prop="advice_name" min-width="50px" label="医嘱内容" align="center"-->
  80. <!--v-else>-->
  81. <!--<template slot-scope="scope">-->
  82. <!--<span v-if="scope.row.parent_id == 0 " class="el-dropdown-link">{{getAdviceContent(scope.row,1)}}</span>-->
  83. <!--<span v-if="scope.row.parent_id > 0 "-->
  84. <!--class="el-dropdown-link">&emsp;{{getAdviceContent(scope.row,2)}}</span>-->
  85. <!--</template>-->
  86. <!--</el-table-column>-->
  87. <el-table-column prop="execution_time" align="center" min-width="30px" label="执行时间">
  88. <template slot-scope="scope">
  89. <span v-if="scope.row.execution_time!=0">{{scope.row.start_time | parseTime('{m}-{d} {h}:{i}')}}</span>
  90. <span v-else></span>
  91. </template>
  92. </el-table-column>
  93. <el-table-column prop="execution_staff" align="center" min-width="30px" label="执行护士">
  94. <template slot-scope="scope">
  95. <span v-if="scope.row.parent_id==0">{{getXuserName(scope.row.execution_staff)}}</span>
  96. <span v-else></span>
  97. </template>
  98. </el-table-column>
  99. <el-table-column v-if="template_id != 6" prop="checker" min-width="30px" align="center" label="核对人员">
  100. <template slot-scope="scope">
  101. <span v-if="scope.row.parent_id==0">{{getXuserName(scope.row.checker)}}</span>
  102. <span v-else></span>
  103. </template>
  104. </el-table-column>
  105. </el-table>
  106. <!-- 医嘱列表 end -->
  107. <!-- 医嘱表单 -->
  108. <el-form ref="form" :model="form" label-width="100px" v-show="showAdviceForm">
  109. <el-row :gutter="20">
  110. <!--<el-col :span="8">-->
  111. <!--<el-form-item label="医嘱类型:">-->
  112. <!--<el-input value="临时" disabled></el-input>-->
  113. <!--</el-form-item>-->
  114. <!--</el-col>-->
  115. <!--<el-col :span="8">-->
  116. <!--<el-form-item label="医嘱时间:">-->
  117. <!--<el-input v-model="form.advice_date" readonly></el-input>-->
  118. <!--&lt;!&ndash; <el-date-picker type="date" placeholder="选择日期" v-model="form.date1" style="width: 100%;"></el-date-picker> &ndash;&gt;-->
  119. <!--</el-form-item>-->
  120. <!--</el-col>-->
  121. <el-col :span="8">
  122. <el-form-item label="开始时间:">
  123. <el-date-picker format="yyyy-MM-dd HH:mm" value-format="yyyy-MM-dd HH:mm" type="datetime" :disabled="form.parent_id==0?false:true"
  124. placeholder="选择日期" v-model="form.start_time" style="width: 100%;"></el-date-picker>
  125. </el-form-item>
  126. </el-col>
  127. <el-col :span="8">
  128. <el-form-item label="医嘱名称:">
  129. <el-input v-model="form.advice_name"></el-input>
  130. </el-form-item>
  131. </el-col>
  132. <el-col :span="8">
  133. <el-form-item label="药品规格:">
  134. <el-input v-model="form.advice_desc" style="width: 40%;"></el-input>
  135. <el-select v-model="form.drug_spec_unit" style="width: 56%;" filterable placeholder="选择">
  136. <el-option v-for="item in unitsOption" :key="item.id" :label="item.name " :value="item.name">
  137. </el-option>
  138. </el-select>
  139. </el-form-item>
  140. </el-col>
  141. </el-row>
  142. <el-row :gutter="20">
  143. <el-col :span="8">
  144. <el-form-item label="开药数量:">
  145. <el-input v-model="form.prescribing_number" style="width: 40%;"></el-input>
  146. <el-select v-model="form.prescribing_number_unit" style="width: 56%;" filterable placeholder="选择">
  147. <el-option v-for="item in unitsOption" :key="item.id" :label="item.name " :value="item.name">
  148. </el-option>
  149. </el-select>
  150. <!-- <el-input v-model="form.prescribing_number_unit" style="width: 40%;"></el-input> -->
  151. </el-form-item>
  152. </el-col>
  153. <el-col :span="8">
  154. <el-form-item label="单次用量:">
  155. <el-input v-model="form.single_dose" style="width: 40%;"></el-input>
  156. <el-select v-model="form.single_dose_unit" style="width: 56%;" filterable placeholder="选择">
  157. <el-option v-for="item in unitsOption" :key="item.id" :label="item.name " :value="item.name">
  158. </el-option>
  159. </el-select>
  160. <!-- <el-input v-model="form.single_dose_unit" style="width: 40%;"></el-input> -->
  161. </el-form-item>
  162. </el-col>
  163. <el-col :span="8">
  164. <el-form-item label="给药途径:">
  165. <el-select v-model="form.delivery_way" :disabled="form.parent_id==0?false:true" filterable
  166. placeholder="请选择(输入可搜索)">
  167. <el-option v-for="item in deliveryWayOptions" :key="item.id" :label="item.name " :value="item.name">
  168. </el-option>
  169. </el-select>
  170. </el-form-item>
  171. </el-col>
  172. </el-row>
  173. <el-row :gutter="20">
  174. <el-col :span="8">
  175. <el-form-item label="执行频率:">
  176. <el-select v-model="form.execution_frequency" :disabled="form.parent_id==0?false:true" filterable
  177. placeholder="请选择(输入可搜索)">
  178. <el-option v-for="item in executionFrequencyOptions" :key="item.id" :label="item.name "
  179. :value="item.name">
  180. </el-option>
  181. </el-select>
  182. </el-form-item>
  183. </el-col>
  184. </el-row>
  185. </el-form>
  186. <div slot="footer" class="dialog-footer" v-show="showAdviceForm">
  187. <el-button @click="hideForm">取 消</el-button>
  188. <el-button type="primary" v-if="form.id==0" @click="submitAdvice" :loading="loading">保 存</el-button>
  189. <el-button type="primary" v-else @click="submitEditAdvice" :loading="loading">保 存</el-button>
  190. </div>
  191. <!-- 医嘱表单 end -->
  192. </el-dialog>
  193. <el-dialog
  194. title="选择执行时间"
  195. :visible.sync="execTimeDialogVisible"
  196. width="400px"
  197. @close="closeTimePanel"
  198. :show-close="isClose"
  199. :close-on-click-modal="isClose"
  200. :close-on-press-escape="isClose"
  201. :modal-append-to-body="false"
  202. >
  203. <el-date-picker
  204. v-model="execTime"
  205. format="yyyy-MM-dd HH:mm:00"
  206. value-format="yyyy-MM-dd HH:mm:00"
  207. type="datetime"
  208. placeholder="选择执行时间"
  209. style="width:100%"
  210. >
  211. </el-date-picker>
  212. <span slot="footer" class="dialog-footer">
  213. <el-button @click="closeTimePanel" :loading="exceLoading">取 消</el-button>
  214. <el-button type="primary" @click="submitExce" :loading="exceLoading">保 存</el-button>
  215. </span>
  216. </el-dialog>
  217. <add-group-advice :adviceTemplates="adviceTemplates" :executionFrequencyOptions="executionFrequencyOptions"
  218. :unitsOption="unitsOption" :deliveryWayOptions="deliveryWayOptions"
  219. :adviceTemplateMaps="adviceTemplateMaps" :patientID="patient.id" :adviceTableData="doctor_advices"
  220. :recordDate="record_date" ref="addGroupForm"></add-group-advice>
  221. <edit-group-advice :adviceTemplates="adviceTemplates" :executionFrequencyOptions="executionFrequencyOptions"
  222. :unitsOption="unitsOption" :deliveryWayOptions="deliveryWayOptions"
  223. :adviceTemplateMaps="adviceTemplateMaps" :patientID="patient.id"
  224. :adviceTableData="doctor_advices" :recordDate="record_date"
  225. ref="editGroupForm" v-on:add-new-order="addNewOrder"
  226. :admin_users="admin_users"></edit-group-advice>
  227. </div>
  228. </template>
  229. <script>
  230. import AddGroupAdvice from './adviceDialog/AddGroupAdvice'
  231. import EditGroupAdvice from './adviceDialog/EditGroupAdvice'
  232. import { uParseTime } from '@/utils/tools'
  233. import {
  234. CheckDoctorAdvice,
  235. CreateDoctorAdvice,
  236. DeleteDoctorAdvice,
  237. DeleteGroupAdvice,
  238. EditDoctorAdvice,
  239. ExecDoctorAdvice,
  240. getAdviceConfig
  241. } from '@/api/advice'
  242. import { getDataConfig } from '@/utils/data'
  243. import request from '@/utils/request'
  244. export default {
  245. name: 'DoctorAdviceDialog',
  246. props: {
  247. dialysis_order: {
  248. // 透析记录
  249. type: Object,
  250. default: () => {
  251. return { id: 0 }
  252. }
  253. },
  254. patient: {
  255. // 患者信息
  256. type: Object,
  257. default: () => {
  258. return { id: 0 }
  259. }
  260. },
  261. doctor_advices: {
  262. type: Array
  263. },
  264. admin_users: { // 系统用户列表
  265. type: Array,
  266. default: () => {
  267. return []
  268. }
  269. }
  270. },
  271. data() {
  272. return {
  273. is_has_create:true,
  274. is_has_exce:true,
  275. is_has_check:true,
  276. is_has_modify_exce:true,
  277. is_has_modify:true,
  278. is_has_modify_other:true,
  279. is_has_del:true,
  280. is_has_del_other:true,
  281. tempArr: [],
  282. execTimeDialogVisible: false,
  283. currentBoxClass: 'current-box-class',
  284. isClose: false,
  285. isShow: false,
  286. loading: false,
  287. sameRowArr: [],
  288. hoverOrderArr: [],
  289. isVisibility: false,
  290. record_date: '',
  291. template_id: 0,
  292. deleLoading: false,
  293. exceLoading: false,
  294. execTime: '',
  295. current_group_index: -1,
  296. title: '临时医嘱',
  297. showAdviceForm: false,
  298. showAdvicePanel: true,
  299. showNameForm: false,
  300. showGroupForm: false,
  301. showTemplateForm: false,
  302. current_template_id: -1,
  303. adviceTemplates: [],
  304. adviceTemplateMaps: {},
  305. deliveryWayOptions: [],
  306. executionFrequencyOptions: [],
  307. unitsOption: [],
  308. // admin_users: [],
  309. templateRules: {
  310. id: [{ required: true, message: '请选择医嘱模板' }]
  311. },
  312. nameRules: {
  313. advice_name: [{ required: true, message: '请填写医嘱内容' }]
  314. },
  315. form: {
  316. id: 0,
  317. advice_type: 2,
  318. advice_date: '',
  319. start_time: '',
  320. advice_name: '',
  321. advice_desc: '',
  322. single_dose: '',
  323. single_dose_unit: '',
  324. prescribing_number: '',
  325. prescribing_number_unit: '',
  326. delivery_way: '',
  327. execution_frequency: '',
  328. advice_doctor: '',
  329. remark: '',
  330. parent_id: 0
  331. },
  332. nameForm: {
  333. advice_name: '',
  334. single_dose: '',
  335. single_dose_unit: '',
  336. drug_spec: '',
  337. drug_spec_unit: '',
  338. prescribing_number: '',
  339. prescribing_number_unit: '',
  340. delivery_way: '',
  341. execution_frequency: '',
  342. isEdit: 0,
  343. index: 0
  344. },
  345. groupForm: {
  346. advice_type: 2,
  347. advice_date: '',
  348. start_time: '',
  349. adviceNames: [],
  350. advice_doctor: '',
  351. remark: '',
  352. parent_id: 0
  353. },
  354. adviceList: [],
  355. currentIndex: -1,
  356. currentRow: null,
  357. groupSelectRow: null,
  358. templateForm: { id: '' }
  359. }
  360. },
  361. watch: {
  362. 'assessment_after_dislysis.id': function() {
  363. if (this.assessment_after_dislysis.id > 0) {
  364. for (var index in this.form) {
  365. this.form[index] = this.assessment_after_dislysis[index]
  366. }
  367. }
  368. },
  369. 'dialysis_order.id': function() {
  370. this.form['dialysis_order_id'] = this.dialysis_order.id
  371. },
  372. 'doctor_advices': function() {
  373. this.handleSpanTempArr()
  374. this.hoverOrderArr = []
  375. this.handleStyle()
  376. }
  377. },
  378. methods: {
  379. // isPermission () {
  380. // if(this.$store.getters.xt_user.user.user_type == 3 ) {
  381. // return false
  382. // } else {
  383. // return true
  384. // }
  385. // },
  386. adviceNameShow({ row, column, rowIndex, columnIndex }) {
  387. if (columnIndex == 2) {
  388. return 'dialysisadvicenamedisplay'
  389. } else {
  390. return ''
  391. }
  392. },
  393. submitEditAdvice() {
  394. if (this.form.advice_name.length == 0) {
  395. this.$message.error('请填写医嘱名称')
  396. return
  397. }
  398. if (this.form.start_time.length == 0) {
  399. this.$message.error('请选择开始时间')
  400. return
  401. }
  402. if (!(this.patient.id > 0)) {
  403. this.$message.error('没有选择患者')
  404. return false
  405. }
  406. console.log(this.form)
  407. let mode = "2"
  408. if(this.form.advice_doctor != this.$store.getters.xt_user.user.id){
  409. mode = "3"
  410. }
  411. EditDoctorAdvice(this.patient.id, this.form.id, this.form,mode).then(response => {
  412. if (response.data.state == 0) {
  413. this.$message.error(response.data.msg)
  414. return false
  415. } else {
  416. this.$notify({
  417. title: '成功',
  418. message: '修改医嘱成功',
  419. type: 'success',
  420. duration: 2000
  421. })
  422. this.showAdviceForm = false
  423. this.showAdvicePanel = true
  424. var advice = response.data.data.advice
  425. this.doctor_advices[this.currentIndex].drug_spec = advice.drug_spec
  426. this.doctor_advices[this.currentIndex].drug_spec_unit = advice.drug_spec_unit
  427. this.doctor_advices[this.currentIndex].start_time = advice.start_time
  428. this.doctor_advices[this.currentIndex].advice_name = advice.advice_name
  429. this.doctor_advices[this.currentIndex].advice_desc = advice.advice_desc
  430. this.doctor_advices[this.currentIndex].single_dose = advice.single_dose
  431. this.doctor_advices[this.currentIndex].single_dose_unit = advice.single_dose_unit
  432. this.doctor_advices[this.currentIndex].delivery_way = advice.delivery_way
  433. this.doctor_advices[this.currentIndex].execution_frequency = advice.execution_frequency
  434. this.doctor_advices[this.currentIndex].prescribing_number = advice.prescribing_number
  435. this.doctor_advices[this.currentIndex].prescribing_number_unit = advice.prescribing_number_unit
  436. this.doctor_advices[this.currentIndex].advice_doctor = advice.advice_doctor
  437. this.doctor_advices[this.currentIndex].remark = advice.remark
  438. this.currentIndex = -1
  439. return false
  440. }
  441. })
  442. },
  443. // submitGroupAdvice() {
  444. // if (this.groupForm.start_time.length == 0) {
  445. // this.$message.error('请选择开始时间')
  446. // return
  447. // }
  448. // CreateGroupAdvice(this.patient.id, this.groupForm).then(response => {
  449. // if (response.data.state == 0) {
  450. // this.$message.error(response.data.msg)
  451. // return false
  452. // } else {
  453. // this.$notify({
  454. // title: '成功',
  455. // message: '新增成功',
  456. // type: 'success',
  457. // duration: 2000
  458. // })
  459. // this.currentIndex = -1
  460. // this.currentRow = null
  461. // this.setCurrent()
  462. // this.hideGroupForm()
  463. // for (const index in response.data.data.advices) {
  464. // this.doctor_advices.unshift(response.data.data.advices[index])
  465. // }
  466. // this.groupForm = {
  467. // advice_type: 2,
  468. // advice_date: '',
  469. // start_time: '',
  470. // adviceNames: [],
  471. // advice_doctor: '',
  472. // remark: '',
  473. // parent_id: 0
  474. // }
  475. // return false
  476. // }
  477. // })
  478. // },
  479. // submitTempForm() {
  480. // var _this = this
  481. // if (this.templateForm.id.length == 0) {
  482. // this.$message.error('请选择医嘱模板')
  483. // return
  484. // }
  485. // if (_this.templateForm.id in _this.adviceTemplateMaps) {
  486. // var mapid = _this.templateForm.id
  487. // for (const index in _this.adviceTemplateMaps[mapid].DoctorAdviceTemplate) {
  488. // var item = {
  489. // advice_name: _this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index].advice_name,
  490. // single_dose: _this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index].single_dose,
  491. // single_dose_unit: _this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index].single_dose_unit,
  492. // drug_spec: _this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index].drug_spec,
  493. // drug_spec_unit: _this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index].drug_spec_unit,
  494. // prescribing_number: _this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index].prescribing_number,
  495. // prescribing_number_unit: _this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index].prescribing_number_unit,
  496. // delivery_way: _this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index].delivery_way,
  497. // execution_frequency: _this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index].execution_frequency,
  498. // isEdit: 0,
  499. // index: 0
  500. // }
  501. // _this.groupForm.adviceNames.push(item)
  502. // }
  503. // }
  504. // this.title = '新增医嘱'
  505. // this.showTemplateForm = false
  506. // this.showGroupForm = true
  507. // },
  508. openAdviceTemplate() {
  509. this.templateForm = { id: '' }
  510. this.title = '选择医嘱模板'
  511. this.showTemplateForm = true
  512. this.showGroupForm = false
  513. },
  514. submitNameForm() {
  515. if (this.nameForm.advice_name.length == 0) {
  516. this.$message.error('请填写医嘱名称')
  517. return
  518. }
  519. if (this.nameForm.isEdit) {
  520. this.groupForm.adviceNames[this.nameForm.index].advice_name = this.nameForm.advice_name
  521. this.groupForm.adviceNames[this.nameForm.index].single_dose = this.nameForm.single_dose
  522. this.groupForm.adviceNames[this.nameForm.index].single_dose_unit = this.nameForm.single_dose_unit
  523. this.groupForm.adviceNames[this.nameForm.index].drug_spec = this.nameForm.drug_spec
  524. this.groupForm.adviceNames[this.nameForm.index].drug_spec_unit = this.nameForm.drug_spec_unit
  525. this.groupForm.adviceNames[this.nameForm.index].prescribing_number = this.nameForm.prescribing_number
  526. this.groupForm.adviceNames[this.nameForm.index].prescribing_number_unit = this.nameForm.prescribing_number_unit
  527. this.groupForm.adviceNames[this.nameForm.index].delivery_way = this.nameForm.delivery_way
  528. this.groupForm.adviceNames[this.nameForm.index].execution_frequency = this.nameForm.execution_frequency
  529. } else {
  530. this.groupForm.adviceNames.push(this.nameForm)
  531. }
  532. this.title = '新增医嘱'
  533. this.showNameForm = false
  534. this.showGroupForm = true
  535. },
  536. groupClassName({ row, rowIndex }) {
  537. row.index = rowIndex
  538. },
  539. selectGroupAdvice(row) {
  540. this.groupSelectRow = row
  541. },
  542. openDeleteGroupAdvice() {
  543. if (this.groupSelectRow === null) {
  544. this.$message.error('未选择要删除的医嘱内容')
  545. return
  546. }
  547. this.DeleteGroupAdvice(this.groupSelectRow.groupno)
  548. // this.$confirm('确认删除些条医嘱内容?', '删除医嘱内容', {
  549. // confirmButtonText: '确定',
  550. // cancelButtonText: '取消',
  551. // type: 'warning'
  552. // }).then(() => {
  553. // this.groupForm.adviceNames.splice(this.groupSelectRow.index, 1);
  554. // }).catch(() => {
  555. // });
  556. },
  557. openAdviceName(isEdit) {
  558. if (isEdit) {
  559. if (this.groupSelectRow === null) {
  560. this.$message.error('未选择要修改的医嘱内容')
  561. return
  562. }
  563. this.nameForm = {
  564. advice_name: this.groupSelectRow.advice_name,
  565. single_dose: this.groupSelectRow.single_dose,
  566. single_dose_unit: this.groupSelectRow.single_dose_unit,
  567. drug_spec: this.groupSelectRow.drug_spec,
  568. drug_spec_unit: this.groupSelectRow.drug_spec_unit,
  569. prescribing_number: this.groupSelectRow.prescribing_number,
  570. prescribing_number_unit: this.groupSelectRow.prescribing_number_unit,
  571. delivery_way: this.groupSelectRow.delivery_way,
  572. execution_frequency: this.groupSelectRow.execution_frequency,
  573. isEdit: 1,
  574. index: this.groupSelectRow.index
  575. }
  576. } else {
  577. this.nameForm = {
  578. advice_name: '',
  579. single_dose: '',
  580. single_dose_unit: '',
  581. drug_spec: '',
  582. drug_spec_unit: '',
  583. prescribing_number: '',
  584. prescribing_number_unit: '',
  585. delivery_way: '',
  586. execution_frequency: '',
  587. isEdit: 0,
  588. index: 0
  589. }
  590. }
  591. this.title = '新增医嘱内容'
  592. this.showNameForm = true
  593. this.showGroupForm = false
  594. },
  595. tableRowClassName({ row, rowIndex }) {
  596. // if (row.stop_state == 1 || row.execution_state == 1) {
  597. // return 'stoped-row';
  598. // }
  599. // return 'success-rows'
  600. row.index = rowIndex
  601. const arr = this.hoverOrderArr
  602. for (let i = 0; i < arr.length; i++) {
  603. if (rowIndex == arr[i]) {
  604. return 'success-row'
  605. }
  606. }
  607. },
  608. changeAdviceName(key) {
  609. if (key in this.adviceTemplateMaps) {
  610. this.form.advice_name = this.adviceTemplateMaps[key].advice_name
  611. this.form.advice_desc = this.adviceTemplateMaps[key].advice_desc
  612. this.form.single_dose_unit = this.adviceTemplateMaps[key].single_dose_unit
  613. this.form.single_dose = this.adviceTemplateMaps[key].single_dose + ''
  614. this.form.prescribing_number_unit = this.adviceTemplateMaps[key].prescribing_number_unit
  615. this.form.prescribing_number = this.adviceTemplateMaps[key].prescribing_number + ''
  616. this.form.delivery_way = this.adviceTemplateMaps[key].delivery_way
  617. this.form.execution_frequency = this.adviceTemplateMaps[key].execution_frequency
  618. }
  619. },
  620. submitExce() {
  621. if (this.currentRow == null) {
  622. this.$message.error('请先选择要执行的医嘱!')
  623. return false
  624. }
  625. if (this.execTime.length == 0) {
  626. this.$message.error('请选择执行时间!')
  627. return false
  628. }
  629. var execTime = Math.round(new Date(this.execTime).getTime() / 1000)
  630. if (execTime < this.currentRow.start_time) {
  631. this.$message.error('执行医嘱不能在开始之前!')
  632. return false
  633. }
  634. this.exceLoading = true
  635. let mode = "6"
  636. ExecDoctorAdvice(this.patient.id, this.currentRow.id, this.execTime,mode).then(response => {
  637. if (response.data.state == 0) {
  638. this.$message.error(response.data.msg)
  639. this.exceLoading = false
  640. return false
  641. } else {
  642. this.$notify({
  643. title: '成功',
  644. message: '执行医嘱成功',
  645. type: 'success',
  646. duration: 2000
  647. })
  648. var exid = response.data.data.advice.id
  649. if (response.data.data.advice.parent_id > 0) {
  650. exid = response.data.data.advice.parent_id
  651. }
  652. // if (this.currentRow.parent_id > 0) {
  653. // exid = this.currentRow.parent_id;
  654. // }
  655. this.currentRow.execution_state = 1
  656. this.currentRow.execution_staff = response.data.data.advice.execution_staff
  657. this.currentRow.execution_time = response.data.data.advice.execution_time
  658. var alen = this.doctor_advices.length
  659. for (var index in this.doctor_advices) {
  660. if (this.doctor_advices[index].id == exid || this.doctor_advices[index].parent_id == exid) {
  661. this.doctor_advices[index].execution_state = 1
  662. this.doctor_advices[index].execution_staff = response.data.data.advice.execution_staff
  663. this.doctor_advices[index].execution_time = response.data.data.advice.execution_time
  664. // this.doctor_advices[index].checker = response.data.data.advice.checker;
  665. break
  666. }
  667. }
  668. this.execTimeDialogVisible = false
  669. return false
  670. }
  671. }).catch(() => {
  672. this.exceLoading = false
  673. })
  674. },
  675. submitAdvice() {
  676. if (this.form.advice_name.length == 0) {
  677. this.$message.error('请填写医嘱名称')
  678. return
  679. }
  680. if (this.form.start_time.length == 0) {
  681. this.$message.error('请选择开始时间')
  682. return
  683. }
  684. if (!(this.patient.id > 0)) {
  685. this.$message.error('没有选择患者')
  686. return false
  687. }
  688. let mode ="1"
  689. CreateDoctorAdvice(this.patient.id, this.form,mode).then(response => {
  690. this.loading = false
  691. if (response.data.state == 0) {
  692. this.$message.error(response.data.msg)
  693. return false
  694. } else {
  695. this.$notify({
  696. title: '成功',
  697. message: '新增医嘱成功',
  698. type: 'success',
  699. duration: 2000
  700. })
  701. this.currentIndex = -1
  702. this.currentRow = null
  703. this.setCurrent()
  704. this.hideForm()
  705. if (this.form.parent_id > 0) {
  706. var spliceIndex = -1
  707. for (let index = this.doctor_advices.length - 1; ; index--) {
  708. if (this.doctor_advices[index].parent_id === this.form.parent_id) {
  709. spliceIndex = index
  710. break
  711. } else if (this.doctor_advices[index].id === this.form.parent_id) {
  712. spliceIndex = index
  713. break
  714. }
  715. }
  716. if (spliceIndex > -1) {
  717. spliceIndex += 1
  718. if (spliceIndex === this.doctor_advices.length) {
  719. this.doctor_advices.push(response.data.data.advice)
  720. } else {
  721. var swapData = this.doctor_advices.splice(spliceIndex)
  722. this.doctor_advices.push(response.data.data.advice)
  723. for (var index in swapData) {
  724. this.doctor_advices.push(swapData[index])// = this.doctor_advices.concat(swapData);
  725. }
  726. }
  727. }
  728. } else {
  729. this.doctor_advices.unshift(response.data.data.advice)
  730. }
  731. // this.$emit("new_create", response.data.data.advice);
  732. return false
  733. }
  734. }).catch(v => {
  735. this.loading = false
  736. })
  737. }, openNewChildTwo(index, row) {
  738. this.currentRow = row
  739. if (this.currentRow == null) {
  740. this.$message.error('请先选择要新增子药的医嘱!')
  741. return false
  742. }
  743. if (this.currentRow.stop_state == 1 || this.currentRow.execution_state == 1) {
  744. this.$message.error('所选医嘱已停止或执行')
  745. return false
  746. }
  747. this.title = '新增子药'
  748. this.showAdviceForm = true
  749. this.showAdvicePanel = false
  750. this.form = {
  751. id: 0,
  752. advice_type: 2,
  753. advice_date: this.record_date,
  754. start_time: uParseTime(
  755. this.currentRow.start_time,
  756. '{y}-{m}-{d} {h}:{i}'
  757. ),
  758. advice_name: '',
  759. drug_spec: '',
  760. drug_spec_unit: '',
  761. single_dose: '',
  762. single_dose_unit: '',
  763. prescribing_number: '',
  764. prescribing_number_unit: '',
  765. delivery_way: this.currentRow.delivery_way,
  766. execution_frequency: this.currentRow.execution_frequency,
  767. advice_doctor: '',
  768. remark: '',
  769. parent_id: this.currentRow.id
  770. }
  771. },
  772. openNewChild() {
  773. if (this.currentRow == null) {
  774. this.$message.error('请先选择要新增子药的医嘱!')
  775. return false
  776. }
  777. if (this.currentRow.stop_state == 1 || this.currentRow.execution_state == 1) {
  778. this.$message.error('所选医嘱已停止或执行')
  779. return false
  780. }
  781. this.title = '新增子药'
  782. this.showAdviceForm = true
  783. this.showAdvicePanel = false
  784. this.form = {
  785. id: 0,
  786. advice_type: 2,
  787. advice_date: this.record_date,
  788. start_time: uParseTime(
  789. this.currentRow.start_time,
  790. '{y}-{m}-{d} {h}:{i}'
  791. ),
  792. advice_name: '',
  793. drug_spec: '',
  794. drug_spec_unit: '',
  795. single_dose: '',
  796. single_dose_unit: '',
  797. prescribing_number: '',
  798. prescribing_number_unit: '',
  799. delivery_way: this.currentRow.delivery_way,
  800. execution_frequency: this.currentRow.execution_frequency,
  801. advice_doctor: '',
  802. remark: '',
  803. parent_id: this.currentRow.id
  804. }
  805. },
  806. openEdit(index, row) {
  807. if (row.stop_state == 1 || row.execution_state == 1) {
  808. this.$message.error('所选医嘱已停止或执行')
  809. return false
  810. }
  811. this.title = row.parent_id > 0 ? '编辑子药' : '编辑医嘱'
  812. this.showAdviceForm = true
  813. this.showAdvicePanel = false
  814. this.currentIndex = index
  815. this.form = {
  816. id: row.id,
  817. advice_type: 2,
  818. advice_date: uParseTime(
  819. row.advice_date,
  820. '{y}-{m}-{d}'
  821. ),
  822. start_time: uParseTime(
  823. row.start_time,
  824. '{y}-{m}-{d} {h}:{i}'
  825. ),
  826. advice_desc: row.advice_desc,
  827. advice_name: row.advice_name,
  828. drug_spec: row.drug_spec != 0 ? '' + row.drug_spec : '',
  829. drug_spec_unit: row.drug_spec_unit,
  830. single_dose: row.single_dose != 0 ? '' + row.single_dose : '',
  831. single_dose_unit: row.single_dose_unit,
  832. prescribing_number: row.prescribing_number != 0 ? '' + row.prescribing_number : '',
  833. prescribing_number_unit: row.prescribing_number_unit,
  834. delivery_way: row.delivery_way,
  835. execution_frequency: row.execution_frequency,
  836. advice_doctor: row.advice_doctor,
  837. remark: row.remark,
  838. parent_id: row.parent_id
  839. }
  840. },
  841. openEditGroupAdvice() {
  842. if (this.groupSelectRow === null) {
  843. this.$message.error('未选择要修改的医嘱内容')
  844. return
  845. }
  846. this.$refs.editGroupForm.open(this.groupSelectRow.groupno)
  847. },
  848. openGroupFrom() {
  849. this.$refs.addGroupForm.open()
  850. // this.title="新增医嘱";
  851. // this.showGroupForm = true;
  852. // this.showAdviceForm = false;
  853. // this.showAdvicePanel = false;
  854. // this.$refs.advices_list.setCurrentRow(null);
  855. // this.currentIndex = -1;
  856. // this.currentRow = null;
  857. // this.groupForm.advice_date = this.record_date;
  858. // this.form = {
  859. // id: 0,
  860. // advice_type: 2,
  861. // advice_date: this.record_date,
  862. // start_time: "",
  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. // advice_doctor: "",
  872. // remark: "",
  873. // parent_id: 0
  874. // };
  875. },
  876. checkAdvice() {
  877. console.log(this.$store.getters.xt_user)
  878. if (this.currentRow == null) {
  879. this.$message.error('请先选择要核对的医嘱!')
  880. return false
  881. }
  882. if (this.currentRow.check_state == 1) {
  883. this.$message.error('所选医嘱已核对')
  884. return false
  885. }
  886. if (this.currentRow.execution_staff > 0 && this.currentRow.execution_staff == this.$store.getters.xt_user.user.id) {
  887. this.$message.error('核对与执行不能是同一人')
  888. return false
  889. }
  890. this.$confirm('确认提交核对?', '医嘱核对', {
  891. confirmButtonText: '确定',
  892. cancelButtonText: '取消',
  893. closeOnClickModal: false,
  894. type: 'warning'
  895. }).then(() => {
  896. this.deleLoading = true
  897. let mode = "7"
  898. CheckDoctorAdvice(this.patient.id, this.currentRow.id,mode).then(response => {
  899. if (response.data.state == 0) {
  900. this.$message.error(response.data.msg)
  901. this.deleLoading = false
  902. return false
  903. } else {
  904. this.$notify({
  905. title: '成功',
  906. message: '核对成功',
  907. type: 'success',
  908. duration: 2000
  909. })
  910. var exid = response.data.data.advice.id
  911. if (response.data.data.advice.parent_id > 0) {
  912. exid = response.data.data.advice.parent_id
  913. }
  914. // if (this.currentRow.parent_id > 0) {
  915. // exid = this.currentRow.parent_id;
  916. // }
  917. this.currentRow.check_state = 1
  918. this.currentRow.check_time = response.data.data.advice.check_time
  919. this.currentRow.checker = response.data.data.advice.checker
  920. var alen = this.doctor_advices.length
  921. for (var index in this.doctor_advices) {
  922. if (this.doctor_advices[index].id == exid || this.doctor_advices[index].parent_id == exid) {
  923. this.doctor_advices[index].check_state = 1
  924. this.doctor_advices[index].check_time = response.data.data.advice.check_time
  925. this.doctor_advices[index].checker = response.data.data.advice.checker
  926. // break;
  927. }
  928. }
  929. this.deleLoading = false
  930. }
  931. })
  932. }).catch(() => {
  933. this.deleLoading = false
  934. })
  935. },
  936. execAdvice() {
  937. if (this.currentRow == null) {
  938. this.$message.error('请先选择要执行的医嘱!')
  939. return false
  940. }
  941. if (this.currentRow.stop_state == 1 || this.currentRow.execution_state == 1) {
  942. this.$message.error('所选医嘱已停止或执行')
  943. return false
  944. }
  945. if (this.currentRow.checker > 0 && this.currentRow.checker == this.$store.getters.xt_user.user.id) {
  946. this.$message.error('核对与执行不能是同一人')
  947. return false
  948. }
  949. this.execTimeDialogVisible = true
  950. this.deleLoading = true
  951. },
  952. DeleteGroupAdvice(groupno) {
  953. this.$confirm('确认删除这组医嘱?', '医嘱删除', {
  954. confirmButtonText: '确定',
  955. cancelButtonText: '取消',
  956. type: 'warning'
  957. }).then(() => {
  958. console.log(this.currentRow)
  959. let mode ="4"
  960. if(this.currentRow.advice_doctor != this.$store.getters.xt_user.user.id){
  961. mode = "5"
  962. }
  963. DeleteGroupAdvice(groupno,mode).then(response => {
  964. if (response.data.state == 0) {
  965. this.$message.error(response.data.msg)
  966. return false
  967. } else {
  968. this.$notify({
  969. title: '成功',
  970. message: '医嘱已经删除',
  971. type: 'success',
  972. duration: 2000
  973. })
  974. var alen = this.doctor_advices.length
  975. for (let index = alen - 1; index >= 0; index--) {
  976. if (this.doctor_advices[index].groupno === groupno) {
  977. this.doctor_advices.splice(index, 1)
  978. }
  979. }
  980. }
  981. })
  982. }).catch(() => {
  983. })
  984. this.handleSpanTempArr()
  985. },
  986. openDelete(index, row) {
  987. this.currentRow = row
  988. this.$confirm('确认删除此条医嘱?', '医嘱删除', {
  989. confirmButtonText: '确定',
  990. cancelButtonText: '取消',
  991. closeOnClickModal: false,
  992. type: 'warning'
  993. }).then(() => {
  994. this.deleLoading = true
  995. let mode ="4"
  996. if(this.currentRow.advice_doctor != this.$store.getters.xt_user.user.id) {
  997. mode = "5"
  998. }
  999. DeleteDoctorAdvice(this.currentRow.id,mode).then(response => {
  1000. this.deleLoading = false
  1001. if (response.data.state == 0) {
  1002. this.$message.error(response.data.msg)
  1003. return false
  1004. } else {
  1005. this.$notify({
  1006. title: '成功',
  1007. message: '医嘱已经删除',
  1008. type: 'success',
  1009. duration: 2000
  1010. })
  1011. this.deleteResetData(this.currentRow)
  1012. this.currentRow = null
  1013. this.setCurrent()
  1014. }
  1015. })
  1016. }).catch(() => {
  1017. this.deleLoading = false
  1018. })
  1019. },
  1020. deleteAdvice() {
  1021. if (this.currentRow == null) {
  1022. this.$message.error('请先选择要删除的医嘱!')
  1023. return false
  1024. }
  1025. this.$confirm('确认删除此条医嘱?', '医嘱删除', {
  1026. confirmButtonText: '确定',
  1027. cancelButtonText: '取消',
  1028. closeOnClickModal: false,
  1029. type: 'warning'
  1030. }).then(() => {
  1031. this.deleLoading = true
  1032. let mode ="4"
  1033. if(this.currentRow.advice_doctor != this.$store.getters.xt_user.user.id) {
  1034. mode = "5"
  1035. }
  1036. DeleteDoctorAdvice(this.currentRow.id,mode).then(response => {
  1037. this.deleLoading = false
  1038. if (response.data.state == 0) {
  1039. this.$message.error(response.data.msg)
  1040. return false
  1041. } else {
  1042. this.$notify({
  1043. title: '成功',
  1044. message: '医嘱已经删除',
  1045. type: 'success',
  1046. duration: 2000
  1047. })
  1048. this.deleteResetData(this.currentRow)
  1049. this.currentRow = null
  1050. this.setCurrent()
  1051. }
  1052. })
  1053. }).catch(() => {
  1054. this.deleLoading = false
  1055. })
  1056. },
  1057. deleteResetData(row) {
  1058. if (row.parent_id > 0) {
  1059. for (var index in this.doctor_advices) {
  1060. if (this.doctor_advices[index].id == row.id) {
  1061. this.doctor_advices.splice(index, 1)
  1062. break
  1063. }
  1064. }
  1065. } else {
  1066. var spliceIndex = -1
  1067. var splitNums = 0
  1068. for (var index in this.doctor_advices) {
  1069. if (this.doctor_advices[index].id == row.id) {
  1070. spliceIndex = index
  1071. splitNums++
  1072. } else if (this.doctor_advices[index].parent_id == row.id) {
  1073. splitNums++
  1074. }
  1075. }
  1076. this.doctor_advices.splice(spliceIndex, splitNums)
  1077. }
  1078. },
  1079. selectRow(row) {
  1080. this.currentRow = row
  1081. },
  1082. getAdviceConfig() {
  1083. getAdviceConfig().then(response => {
  1084. if (response.data.state == 1) {
  1085. this.deliveryWayOptions = response.data.data.drugways === null ? [] : response.data.data.drugways
  1086. this.executionFrequencyOptions = response.data.data.efs === null ? [] : response.data.data.efs
  1087. this.adviceTemplates = response.data.data.advice_templates === null ? [] : response.data.data.advice_templates
  1088. var templateLen = this.adviceTemplates.length
  1089. for (let index = 0; index < templateLen; index++) {
  1090. if (!this.adviceTemplates[index].DoctorAdviceTemplate) {
  1091. continue
  1092. }
  1093. var DoctorAdviceTemplate = this.adviceTemplates[index].DoctorAdviceTemplate
  1094. for (let i = 0; i < DoctorAdviceTemplate.length; i++) {
  1095. DoctorAdviceTemplate[i].selection = false
  1096. }
  1097. var item = this.adviceTemplates[index]
  1098. item.DoctorAdviceTemplate = []
  1099. var datMap = {}
  1100. for (const key in DoctorAdviceTemplate) {
  1101. if (DoctorAdviceTemplate[key].parent_id == 0) {
  1102. datMap[DoctorAdviceTemplate[key].id] = DoctorAdviceTemplate[key]
  1103. }
  1104. }
  1105. for (const key in DoctorAdviceTemplate) {
  1106. if (DoctorAdviceTemplate[key].parent_id in datMap) {
  1107. if ('children' in datMap[DoctorAdviceTemplate[key].parent_id]) {
  1108. datMap[DoctorAdviceTemplate[key].parent_id].children.push(DoctorAdviceTemplate[key])
  1109. } else {
  1110. datMap[DoctorAdviceTemplate[key].parent_id].children = []
  1111. datMap[DoctorAdviceTemplate[key].parent_id].children.push(DoctorAdviceTemplate[key])
  1112. }
  1113. }
  1114. }
  1115. for (const key in datMap) {
  1116. item.DoctorAdviceTemplate.push(datMap[key])
  1117. }
  1118. this.$set(this.adviceTemplateMaps, this.adviceTemplates[index].id, item)
  1119. }
  1120. }
  1121. })
  1122. this.handleSpanTempArr()
  1123. this.handleStyle()
  1124. },
  1125. getXuserName(id) {
  1126. if (id <= 0) {
  1127. return ''
  1128. }
  1129. var name = ''
  1130. if (
  1131. this.admin_users == null ||
  1132. typeof this.admin_users.length === 'undefined'
  1133. ) {
  1134. return name
  1135. }
  1136. var leng = this.admin_users.length
  1137. if (leng == 0) {
  1138. return name
  1139. }
  1140. for (let index = 0; index < leng; index++) {
  1141. if (this.admin_users[index].id == id) {
  1142. name = this.admin_users[index].name
  1143. break
  1144. }
  1145. }
  1146. return name
  1147. }, addNewOrder() {
  1148. this.$refs.addGroupForm.open()
  1149. },
  1150. show() {
  1151. this.isVisibility = true
  1152. this.getPermission()
  1153. },
  1154. hide() {
  1155. this.isVisibility = false
  1156. },
  1157. hideForm() {
  1158. this.title = '临时医嘱'
  1159. this.showGroupForm = false
  1160. this.showAdviceForm = false
  1161. this.showAdvicePanel = true
  1162. },
  1163. hideNameForm() {
  1164. this.title = '新增医嘱'
  1165. this.showGroupForm = true
  1166. this.showNameForm = false
  1167. },
  1168. hideTemplateForm() {
  1169. this.title = '新增医嘱'
  1170. this.showGroupForm = true
  1171. this.showTemplateForm = false
  1172. },
  1173. hideGroupForm() {
  1174. this.title = '临时医嘱'
  1175. this.showAdviceForm = false
  1176. this.showGroupForm = false
  1177. this.showAdvicePanel = true
  1178. },
  1179. resetDialog() {
  1180. this.hoverOrderArr = []
  1181. this.title = '临时医嘱'
  1182. this.showAdviceForm = false
  1183. this.showGroupForm = false
  1184. this.showAdvicePanel = true
  1185. this.currentRow = null
  1186. this.groupSelectRow = null
  1187. this.setCurrent()
  1188. },
  1189. closeTimePanel() {
  1190. this.execTimeDialogVisible = false
  1191. this.deleLoading = false
  1192. this.exceLoading = false
  1193. this.execTime = ''
  1194. },
  1195. setCurrent(row) {
  1196. this.$refs.advices_list.setCurrentRow(row)
  1197. },
  1198. isShowStartTime(index, row) {
  1199. if (row.parent_id > 0) {
  1200. return false
  1201. } else if (index > 0 && row.groupno > 0 && row.groupno == this.doctor_advices[index - 1].groupno) {
  1202. return false
  1203. }
  1204. return true
  1205. }, mergeSpan({ row, column, rowIndex, columnIndex }) {
  1206. if (columnIndex != 2) {
  1207. const _row = this.tempArr[rowIndex]
  1208. const _col = _row > 0 ? 1 : 0
  1209. return {
  1210. rowspan: _row,
  1211. colspan: _col
  1212. }
  1213. }
  1214. }, handleSpanTempArr() {
  1215. this.tempArr = []
  1216. for (let i = 0; i < this.doctor_advices.length; i++) {
  1217. if (i === 0) {
  1218. this.tempArr.push(1)
  1219. this.pos = 0
  1220. } else {
  1221. // 判断当前元素与上一个元素是否相同
  1222. if (this.doctor_advices[i].groupno === this.doctor_advices[i - 1].groupno) {
  1223. this.tempArr[this.pos] += 1
  1224. this.tempArr.push(0)
  1225. } else {
  1226. this.tempArr.push(1)
  1227. this.pos = i
  1228. }
  1229. }
  1230. }
  1231. }, cellMouseEnter: function(row, column, event) {
  1232. this.currentRow = row
  1233. this.groupSelectRow = row
  1234. this.sameRowArr.forEach((arr, i) => {
  1235. if (arr.indexOf(row.index) != -1) {
  1236. this.hoverOrderArr = arr
  1237. }
  1238. })
  1239. }, cellMouseLeave: function(row, column, cell, event) {
  1240. this.hoverOrderArr = []
  1241. }, handleStyle() {
  1242. let sameRowArr = [], sIdx = 0
  1243. this.doctor_advices.forEach((item, index) => {
  1244. item.index = index
  1245. if (index === 0) {
  1246. sameRowArr.push([index])
  1247. } else {
  1248. if (item.groupno === this.doctor_advices[index - 1].groupno) {
  1249. sameRowArr[sIdx].push(index)
  1250. } else {
  1251. sIdx = sIdx + 1
  1252. sameRowArr.push([index])
  1253. }
  1254. }
  1255. })
  1256. this.sameRowArr = sameRowArr
  1257. }, getAdviceContent(row, isChild) {
  1258. let tempSingleDoseDesc = ''
  1259. let tempDrugSpecDesc = ''
  1260. let tempPrescribingNumberDesc = ''
  1261. if (row.prescribing_number) {
  1262. tempPrescribingNumberDesc = row.prescribing_number + '' + row.prescribing_number_unit
  1263. }
  1264. if (row.single_dose) {
  1265. if (this.template_id != 6) {
  1266. tempSingleDoseDesc = ' 单次用量 ' + ' ' + row.single_dose + '' + row.single_dose_unit
  1267. } else {
  1268. tempSingleDoseDesc = row.single_dose + '' + row.single_dose_unit
  1269. }
  1270. }
  1271. if (row.advice_desc) {
  1272. tempDrugSpecDesc = '(' + row.advice_desc + row.drug_spec_unit + ')'
  1273. }
  1274. if (isChild == 1) { // 不是子药
  1275. return row.advice_name + tempDrugSpecDesc + ' ' + tempPrescribingNumberDesc + tempSingleDoseDesc + ' ' + row.delivery_way + ' ' + row.execution_frequency
  1276. } else { // 是子药
  1277. return row.advice_name + tempDrugSpecDesc + ' ' + tempPrescribingNumberDesc + tempSingleDoseDesc
  1278. }
  1279. },
  1280. getPermission() {
  1281. request.get("/api/func_per/get", {
  1282. params: {
  1283. create_url: "/api/patients/advice/creategroup?mode=1",
  1284. modify_url: "/api/patients/advice/edit?mode=2",
  1285. modify_other_url: "/api/patients/advice/edit?mode=3",
  1286. del_url: "/api/patients/advice/delete?mode=4",
  1287. del_other_url: "/api/patients/advice/delete?mode=5",
  1288. exce_url: "/api/patients/advice/exec?mode=6",
  1289. check_url: "/api/patients/advice/check?mode=7",
  1290. module: 4
  1291. }
  1292. }).then(res => {
  1293. console.log(res)
  1294. if (res.data.state == 0) {
  1295. this.hasPermission = false
  1296. } else if (res.data.state == 1) {
  1297. this.is_has_create = res.data.data.is_has_create
  1298. this.is_has_exce = res.data.data.is_has_exce
  1299. this.is_has_check = res.data.data.is_has_check
  1300. this.is_has_modify = res.data.data.is_has_modify
  1301. this.is_has_modify_other = res.data.data.is_has_modify_other
  1302. this.is_has_modify_exce = res.data.data.is_has_modify_exce
  1303. this.is_has_del = res.data.data.is_has_del
  1304. this.is_has_del_other = res.data.data.is_has_del_other
  1305. }
  1306. })
  1307. }
  1308. },
  1309. created() {
  1310. var date = this.$route.query && this.$route.query.date
  1311. this.record_date = uParseTime(date, '{y}-{m}-{d}')
  1312. this.form.advice_date = this.record_date
  1313. this.getAdviceConfig()
  1314. this.unitsOption = getDataConfig('hemodialysis', 'units')
  1315. this.template_id = this.$store.getters.xt_user.template_info.template_id
  1316. },
  1317. components: {
  1318. AddGroupAdvice,
  1319. EditGroupAdvice
  1320. }
  1321. }
  1322. </script>
  1323. <style>
  1324. @import "../../../../../static/css/table_row.css";
  1325. .txsj {
  1326. text-align: center;
  1327. margin-bottom: 20px;
  1328. }
  1329. .dialysisadvicenamedisplay .cell {
  1330. float: left;
  1331. text-align: left;
  1332. }
  1333. </style>
  1334. <!--<style scoped>-->
  1335. <!--.txsj{-->
  1336. <!--text-align: center;-->
  1337. <!--margin-bottom: 20px;-->
  1338. <!--}-->
  1339. <!--</style>-->
  1340. <!--<style rel="stylesheet/scss" lang="scss" >-->
  1341. <!--.row-class-active {-->
  1342. <!--background: #badcff;-->
  1343. <!--}-->
  1344. <!--.doctor-advice-box .current-box-class .current-row>td{-->
  1345. <!--background: #6fb5fa;-->
  1346. <!--color:#fff;-->
  1347. <!--}-->
  1348. <!--.doctor-advice-box .current-box-class .current-row:hover>td{-->
  1349. <!--background: #6fb5fa;-->
  1350. <!--}-->
  1351. <!--// .doctor-advice-box .current-box-class .stoped-row>td{-->
  1352. <!--// background: #c9c9c9;-->
  1353. <!--// color:#000;-->
  1354. <!--// }-->
  1355. <!--// .doctor-advice-box .current-box-class .stoped-row:hover>td{-->
  1356. <!--// background: #c9c9c9;-->
  1357. <!--// }-->
  1358. <!--</style>-->