血透系统PC前端

DoctorAdviceDialog.vue 48KB

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