血透系统PC前端

DoctorAdviceDialog.vue 49KB

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