血透系统pad前端

OrdersDialog.vue 48KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435
  1. <template>
  2. <div>
  3. <div class="Dialog" v-show="index==0" style="width: 18rem;">
  4. <div class="DialogTit" @click="$emit('orderDialog')">
  5. <span class="iconfont">&#xe6e9;</span>
  6. <h1 class="name">临时医嘱</h1>
  7. <span class="success">&nbsp;</span>
  8. </div>
  9. <div class="yzNav" style="width:100%;">
  10. <span @click="openNewAdvice"
  11. :class="{ forbid: this.$store.getters.user.user.user_type == 3 }"
  12. >新增医嘱</span>
  13. <span
  14. v-if="isShowExce"
  15. @click="execAdvice"
  16. :class="{ forbid: (current_advice&& current_advice.parent_id > 0)||(this.$store.getters.user.user.user_type == 2 && !isPremission) }"
  17. >执行医嘱</span>
  18. <span
  19. v-if="isShowMofifyExce"
  20. @click="modifyExecAdvice"
  21. :class="{ forbid: (current_advice&& current_advice.parent_id > 0) }"
  22. >修改执行医嘱</span>
  23. <span v-if="template_id != 6"
  24. @click="checkAdvice"
  25. :class="{ forbid: (current_advice&& current_advice.parent_id > 0) || (this.$store.getters.user.user.user_type == 2 && !isPremission) }"
  26. >医嘱核对</span>
  27. <span
  28. @click="openNewChild"
  29. :class="{ forbid: current_advice == null || current_advice.parent_id > 0 || currentAdvices.length != 1 || this.$store.getters.user.user.user_type == 3 }"
  30. >添加子药</span>
  31. <span v-if="currentSubAdvices.length <= 0" @click="modifyAdviceAction"
  32. :class="{ forbid: current_group_index < 0 || currentAdvices.length != 1 }">修改医嘱</span>
  33. <span v-if="currentSubAdvices.length <= 0" @click="deleteAdviceAction"
  34. :class="{ forbid: current_group_index < 0 || currentAdvices.length <= 0 }">删除医嘱</span>
  35. <span v-if="currentSubAdvices.length > 0" @click="modifySubdviceAction">修改子医嘱</span>
  36. <span v-if="currentSubAdvices.length > 0" @click="deleteSubAdviceAction">删除子医嘱</span>
  37. </div>
  38. <div class="DialogContent choose" id="dialogTop" style="height:6.5rem;">
  39. <div class="content clearfix">
  40. <table class="table">
  41. <tr @click="cancelAdviceSelect">
  42. <th width="8%">开嘱医生</th>
  43. <th width="10%">开始时间</th>
  44. <th width="40%">医嘱内容</th>
  45. <th width="10%">执行时间</th>
  46. <th width="10%">执行护士</th>
  47. <th v-if="template_id != 6" width="10%">核对人员</th>
  48. </tr>
  49. <template v-for="(group, group_index) in advice_groups">
  50. <tr
  51. v-for="(advice, advice_index) in group.advices"
  52. :key="advice.id"
  53. :class="{ 'row-class-active': current_group_index == group_index && current_advice_index < 0 }"
  54. >
  55. <td
  56. v-if="advice_index == 0"
  57. :rowspan="group.advices.length"
  58. @click="selectGroupAdviceAction(group_index, -1, null,group)"
  59. >
  60. <span v-if="advice.parent_id==0">{{getXuserName(advice.advice_doctor)}}</span>
  61. <span v-else></span>
  62. </td>
  63. <td
  64. v-if="advice_index == 0"
  65. :rowspan="group.advices.length"
  66. @click="selectGroupAdviceAction(group_index, -1, null,group)"
  67. >
  68. <span>{{uParseTime(advice.start_time, '{m}-{d} {h}:{i}')}}</span>
  69. </td>
  70. <td
  71. :class="{ 'advice_content': advice.parent_id == 0, 'subadvice_content': advice.parent_id > 0, 'td-active':current_group_index == group_index && advice.is_selected == 1 }"
  72. @click="selectAdviceAction(group_index, advice_index, advice)"
  73. >
  74. <div class="txt">
  75. <span>{{advice.advice_name }}</span>
  76. <span v-if="advice.advice_desc">({{ advice.advice_desc }}{{advice.drug_spec_unit}})</span>
  77. <span v-if="advice.prescribing_number">&nbsp;&nbsp;{{advice.prescribing_number}}{{advice.prescribing_number_unit}}</span>
  78. <span v-if="advice.single_dose && template_id != 6" >单次用量{{advice.single_dose}}{{advice.single_dose_unit}}</span>
  79. <span v-if="advice.parent_id == 0">{{advice.delivery_way}}</span>
  80. <span v-if="advice.parent_id == 0">{{advice.execution_frequency}}</span>
  81. <span v-if="advice.parent_id == 0 && advice.remark.length > 0">({{advice.remark}})</span>
  82. </div>
  83. </td>
  84. <td
  85. :class="{'td-active':current_group_index == group_index && advice.is_selected == 1}"
  86. @click="selectAdviceAction(group_index,advice_index, advice)"
  87. >{{uParseTime(advice.execution_time, '{m}-{d} {h}:{i}')}}
  88. </td>
  89. <td
  90. :class="{'td-active':current_group_index == group_index && advice.is_selected == 1}"
  91. @click="selectAdviceAction(group_index,advice_index, advice)"
  92. > {{getXuserName(advice.execution_staff)}}
  93. </td>
  94. <td
  95. :class="{'td-active':current_group_index == group_index && advice.is_selected == 1}"
  96. @click="selectAdviceAction(group_index,advice_index, advice)"
  97. >{{getXuserName(advice.checker)}}
  98. </td>
  99. </tr>
  100. </template>
  101. </table>
  102. </div>
  103. </div>
  104. </div>
  105. <add-new-order-dialog
  106. v-show="index==1&&isShowDialog"
  107. @back-action="index = 0"
  108. :patient_id="patient.id"
  109. :drug_spec_unit_options="unitsOption"
  110. :delivery_way_options="deliveryWayOptions"
  111. :execution_frequency_options="executionFrequencyOptions"
  112. :single_dose_unit_options="unitsOption"
  113. :prescribing_number_unit_options="unitsOption"
  114. :advice_templates="adviceTemplates"
  115. @did-create-advices="didCreateAdvices"
  116. ></add-new-order-dialog>
  117. <advice-form
  118. ref="subdrug_form"
  119. @back="index = 0"
  120. @did-create-subdrug="didAddSubdrug"
  121. :single_dose_unit_options="unitsOption"
  122. :prescribing_number_unit_options="unitsOption"
  123. :drug_spec_unit_options="unitsOption"
  124. ></advice-form>
  125. <modify-advice-form
  126. ref="modify_advice_form"
  127. @back="index = 0"
  128. @did-modify="didModifyAdvice"
  129. :drug_spec_unit_options="unitsOption"
  130. :delivery_way_options="deliveryWayOptions"
  131. :execution_frequency_options="executionFrequencyOptions"
  132. :single_dose_unit_options="unitsOption"
  133. :prescribing_number_unit_options="unitsOption"
  134. ></modify-advice-form>
  135. <modify-advice-group-dialog
  136. ref="modify_advice_group"
  137. @back="index = 0"
  138. :patient_id="patient.id"
  139. :delivery_way_options="deliveryWayOptions"
  140. :execution_frequency_options="executionFrequencyOptions"
  141. :single_dose_unit_options="unitsOption"
  142. :drug_spec_unit_options="unitsOption"
  143. :prescribing_number_unit_options="unitsOption"
  144. :advice_templates="adviceTemplates"
  145. @did-create-advices="didCreateAdvices"
  146. ></modify-advice-group-dialog>
  147. <mt-datetime-picker
  148. ref="exec_time"
  149. type="datetime"
  150. @confirm="handleExecTime"
  151. v-model="nowExecTime"
  152. ></mt-datetime-picker>
  153. <mt-datetime-picker
  154. ref="mofify_exec_time"
  155. type="datetime"
  156. @confirm="handleModifyExecTime"
  157. v-model="nowExecTime"
  158. ></mt-datetime-picker>
  159. </div>
  160. </template>
  161. <script>
  162. import {Dialog, Toast} from 'vant'
  163. import {
  164. CheckDoctorAdvice,
  165. CreateDoctorAdvice,
  166. DeleteDoctorAdviceNew,
  167. DeleteSubDoctorAdvice,
  168. EditDoctorAdvice,
  169. ExecDoctorAdvice,
  170. getAdviceConfig,
  171. ModifyExecDoctorAdvice
  172. } from '@/api/advice'
  173. import {uParseTime} from '@/utils/tools'
  174. import CheckBoxSubMenu from './subMenu/checkBoxSubMenu'
  175. import {getDataConfig} from '@/utils/data'
  176. import AddNewOrderDialog from './new_order/AddNewOrders'
  177. import AdviceForm from './new_order/order_form'
  178. import ModifyAdviceForm from './modify_order/modify_order_form'
  179. import ModifyAdviceGroupDialog from './modify_order/ModifyAdviceGroup'
  180. export default {
  181. name: 'OrdersDialog',
  182. components: {
  183. CheckBoxSubMenu,
  184. AddNewOrderDialog,
  185. AdviceForm,
  186. ModifyAdviceForm,
  187. ModifyAdviceGroupDialog,
  188. },
  189. props: {
  190. advice_groups: {
  191. type: Array,
  192. default: () => {
  193. return []
  194. }
  195. },
  196. patient_prop: {
  197. type: Object
  198. },
  199. advice_list_prop: {
  200. type: Array
  201. },
  202. admin_users_prop: {
  203. type: Array
  204. },
  205. special_premission:{
  206. type: Array
  207. }
  208. },
  209. data () {
  210. return {
  211. isShowDialog: true,
  212. template_id: 0,
  213. isShowExce: true,
  214. isShowMofifyExce: false,
  215. title: '临时医嘱',
  216. index: 0,
  217. doctor: '',
  218. adviceTemplates: [],
  219. drugOptions: {},
  220. deliveryWayOptions: [],
  221. executionFrequencyOptions: [],
  222. unitsOption: [],
  223. unitsObj: [],
  224. record_date: '',
  225. nowExecTime: new Date(),
  226. patient: {
  227. id: 0
  228. },
  229. admin_users: [],
  230. adviceList: [],
  231. parent_id: 0,
  232. current_select_object: -1,
  233. current_group_index: -1,
  234. current_advice_index: -1,
  235. current_advice: null,
  236. currentAdviceIdsStr: '',
  237. currentAdvices: [],
  238. currentSubAdvices: [],
  239. isPremission:false,
  240. }
  241. },
  242. created () {
  243. this.template_id = this.$store.getters.user.template_info.template_id
  244. var date = this.$route.query && this.$route.query.date
  245. date *= 1000
  246. var newDate = new Date(date)
  247. var y = newDate.getFullYear()
  248. var m = newDate.getMonth() + 1
  249. var d = newDate.getDate()
  250. if (isNaN(y) || isNaN(m) || isNaN(d)) {
  251. newDate = new Date()
  252. y = newDate.getFullYear()
  253. m = newDate.getMonth() + 1
  254. d = newDate.getDate()
  255. }
  256. this.record_date =
  257. y + '-' + (m < 10 ? '0' + m : m) + '-' + (d < 10 ? '0' + d : d)
  258. this.patient = this.patient_prop
  259. this.adviceList = this.advice_list_prop
  260. this.admin_users = this.admin_users_prop
  261. this.doctor = this.$store.getters.user.user.user_name
  262. this.getAdviceConfig()
  263. this.unitsOption = getDataConfig('hemodialysis', 'units')
  264. for (var index in this.unitsOption) {
  265. this.unitsObj[this.unitsOption[index].id] = this.unitsOption[index]
  266. }
  267. for (let i = 0; i < this.special_premission.length; i++) {
  268. if (this.$store.getters.user.user.id == this.special_premission[i].admin_user_id) {
  269. this.isPremission = true
  270. }
  271. }
  272. },
  273. watch: {
  274. 'advice_groups': function () {
  275. },
  276. 'currentAdvices': function (currentAdvices) {
  277. if (currentAdvices.length == 0) {
  278. this.isShowExce = true
  279. this.isShowMofifyExce = false
  280. } else {
  281. let a = 0
  282. for (let i = 0; i < currentAdvices.length; i++) {
  283. if (currentAdvices[i].execution_state == 1) {
  284. a = a + 1
  285. }
  286. }
  287. if (a == currentAdvices.length) {
  288. this.isShowExce = false
  289. this.isShowMofifyExce = true
  290. }else{
  291. this.isShowExce = true
  292. this.isShowMofifyExce = false
  293. }
  294. }
  295. }
  296. },
  297. methods: {
  298. modifyExecAdvice: function () {
  299. // if(!this.isPremission){
  300. // Toast.fail('你没有权限修改医嘱!')
  301. // }else{
  302. this.nowExecTime = new Date(this.currentAdvices[0].start_time * 1000)
  303. this.$refs.mofify_exec_time.open()
  304. // }
  305. },
  306. didCreateAdvices: function (advices) {
  307. if (advices.length == 0) {
  308. return
  309. }
  310. for (let i = 0; i < advices.length; i++) {
  311. advices[i]['is_selected'] = 0
  312. }
  313. var new_group = Object.assign(
  314. {},
  315. {
  316. group_no: 0,
  317. start_time: 0,
  318. advices: []
  319. }
  320. )
  321. new_group.group_no = advices[0].groupno
  322. new_group.start_time = advices[0].start_time
  323. new_group.advices.push(...advices)
  324. var insertIndex = -1
  325. for (let index = 0; index < this.advice_groups.length; index++) {
  326. const group = this.advice_groups[index]
  327. if (group.start_time < new_group.start_time) {
  328. insertIndex = index
  329. break
  330. }
  331. }
  332. if (insertIndex < 0) {
  333. this.advice_groups.push(new_group)
  334. } else {
  335. this.advice_groups.splice(insertIndex, 0, new_group)
  336. }
  337. this.index = 0
  338. this.advice_groups.sort((a, b) => a.start_time - b.start_time)
  339. },
  340. didModifyAdvice: function (advice) {
  341. Toast.loading({forbidClick: true, duration: 0})
  342. EditDoctorAdvice(advice.id, {
  343. advice_name: advice.title,
  344. advice_desc: advice.advice_desc,
  345. remark: advice.remark,
  346. start_time: advice.start_time,
  347. drug_spec: String(advice.drug_spec),
  348. drug_spec_unit: advice.drug_spec_unit,
  349. delivery_way: advice.delivery_way,
  350. execution_frequency: advice.execution_frequency,
  351. single_dose: String(advice.single_dose),
  352. single_dose_unit: advice.single_dose_unit,
  353. prescribing_number: String(advice.prescribing_number),
  354. prescribing_number_unit: advice.prescribing_number_unit
  355. })
  356. .then(rs => {
  357. if (rs.data.state == 1) {
  358. var resp_advice = rs.data.data.advice
  359. if(!rs.data.data.isChange){
  360. var group = this.advice_groups[this.current_group_index]
  361. for (let index = 0; index < group.advices.length; index++) {
  362. const advice = group.advices[index]
  363. if (advice.id == resp_advice.id) {
  364. advice.advice_name = resp_advice.advice_name
  365. advice.advice_desc = resp_advice.advice_desc
  366. advice.remark = resp_advice.remark;
  367. advice.start_time = resp_advice.start_time;
  368. advice.drug_spec = resp_advice.drug_spec;
  369. (advice.drug_spec_unit = resp_advice.drug_spec_unit),
  370. (advice.delivery_way = resp_advice.delivery_way),
  371. (advice.execution_frequency =
  372. resp_advice.execution_frequency),
  373. (advice.single_dose = resp_advice.single_dose),
  374. (advice.single_dose_unit = resp_advice.single_dose_unit),
  375. (advice.prescribing_number = resp_advice.prescribing_number),
  376. (advice.prescribing_number_unit =
  377. resp_advice.prescribing_number_unit)
  378. break
  379. }
  380. }
  381. }else{
  382. // var group = this.advice_groups[this.current_group_index]
  383. //先删除旧数据,再插入新数据
  384. var adviceArr = this.advice_groups[this.current_group_index].advices
  385. for (let y = resp_advice.length - 1; y >= 0; y--) {
  386. for (let i = adviceArr.length - 1; i >= 0; i--) {
  387. if (adviceArr[i].id == resp_advice[y].id || adviceArr[i].parent_id == resp_advice[y].id) {
  388. adviceArr.splice(i, 1)
  389. }
  390. }
  391. }
  392. var newAdvice = {}
  393. newAdvice['advices'] = resp_advice
  394. newAdvice['group_no'] = resp_advice[0].groupno
  395. this.advice_groups.push(newAdvice)
  396. }
  397. this.currentAdvices = []
  398. this.currentSubAdvices = []
  399. for (let i = 0; i < this.advice_groups.length; i++) {
  400. for (let y = 0; y < this.advice_groups[i].advices.length; y++) {
  401. var advices = this.advice_groups[i].advices[y]
  402. advices.is_selected = 0
  403. }
  404. }
  405. console.log(this.advice_groups)
  406. this.advice_groups.sort((a, b) => a.advices[0].start_time - b.advices[0].start_time)
  407. this.$refs.modify_advice_form.dismiss()
  408. Toast.clear()
  409. this.index = 0
  410. } else {
  411. Toast.fail(rs.data.msg)
  412. }
  413. })
  414. .catch(err => {
  415. Toast.fail(err)
  416. })
  417. },
  418. uParseTime (time, format) {
  419. if (time == 0) {
  420. return ''
  421. }
  422. return uParseTime(time, format)
  423. },
  424. getXuserName (id) {
  425. if (id <= 0) {
  426. return ''
  427. }
  428. var name = ''
  429. if (
  430. this.admin_users == null ||
  431. typeof this.admin_users.length == 'undefined'
  432. ) {
  433. return name
  434. }
  435. var leng = this.admin_users.length
  436. if (leng == 0) {
  437. return name
  438. }
  439. for (let index = 0; index < leng; index++) {
  440. if (this.admin_users[index].id == id) {
  441. name = this.admin_users[index].name
  442. break
  443. }
  444. }
  445. return name
  446. },
  447. didAddSubdrug: function (subdrug) {
  448. Toast.loading({forbidClick: true, duration: 0})
  449. CreateDoctorAdvice(this.patient.id, {
  450. parent_id: subdrug.parent_id,
  451. advice_type: 2,
  452. advice_date: subdrug.record_time,
  453. start_time: subdrug.start_time,
  454. advice_name: subdrug.title,
  455. advice_desc: subdrug.advice_desc,
  456. drug_spec: String(subdrug.drug_spec),
  457. drug_spec_unit: subdrug.drug_spec_unit,
  458. single_dose: String(subdrug.single_dose),
  459. single_dose_unit: subdrug.single_dose_unit,
  460. prescribing_number: String(subdrug.prescribing_number),
  461. prescribing_number_unit: subdrug.prescribing_number_unit
  462. // delivery_way: subdrug.delivery_way,
  463. // execution_frequency: subdrug.execution_frequency
  464. })
  465. .then(response => {
  466. if (response.data.state == 0) {
  467. Toast.fail(response.data.msg)
  468. return false
  469. } else {
  470. Toast.success('添加成功')
  471. var resp_advice = response.data.data.advice
  472. var group_index = this.current_group_index
  473. var adviceArr = this.advice_groups[this.current_group_index].advices
  474. for (let i = 0; i < adviceArr.length; i++) {
  475. if (adviceArr[i].id == this.currentAdvices[0].id && adviceArr[i].is_selected == 1) {
  476. var advice_index = i
  477. }
  478. }
  479. var group = this.advice_groups[group_index]
  480. var insert_index = -1
  481. var last_child_index = -1
  482. for (
  483. let index = advice_index + 1;
  484. index < group.advices.length;
  485. index++
  486. ) {
  487. const advice = group.advices[index]
  488. if (resp_advice.parent_id != advice.parent_id) {
  489. insert_index = index
  490. break
  491. } else {
  492. last_child_index = index
  493. }
  494. }
  495. if (insert_index < 0) {
  496. if (last_child_index < 0) {
  497. group.advices.splice(advice_index + 1, 0, resp_advice)
  498. } else {
  499. group.advices.splice(last_child_index + 1, 0, resp_advice)
  500. }
  501. } else {
  502. group.advices.splice(insert_index, 0, resp_advice)
  503. }
  504. this.cancelAdviceSelect()
  505. this.$refs.subdrug_form.dismiss()
  506. this.index = 0
  507. // this.$emit("new_create", response.data.data.advice);
  508. this.currentAdvices = []
  509. this.currentSubAdvices = []
  510. for (let i = 0; i < this.advice_groups.length; i++) {
  511. for (let y = 0; y < this.advice_groups[i].advices.length; y++) {
  512. var advices = this.advice_groups[i].advices[y]
  513. advices.is_selected = 0
  514. }
  515. }
  516. return false
  517. }
  518. })
  519. .catch(err => {
  520. Toast.fail(err)
  521. })
  522. },
  523. getAdviceConfig () {
  524. getAdviceConfig().then(response => {
  525. if (response.data.state == 1) {
  526. this.deliveryWayOptions =
  527. response.data.data.drugways === null
  528. ? []
  529. : response.data.data.drugways
  530. this.executionFrequencyOptions =
  531. response.data.data.efs === null ? [] : response.data.data.efs
  532. this.adviceTemplates =
  533. response.data.data.advice_templates === null
  534. ? []
  535. : response.data.data.advice_templates
  536. }
  537. })
  538. },handleModifyExecTime(time){
  539. var exceTime = this.handleTime(time)
  540. var currentAdviceIdArr = []
  541. var exceParams = null
  542. for (let i = 0; i < this.currentAdvices.length; i++) {
  543. if ( this.currentAdvices[i].execution_state == 1) {
  544. currentAdviceIdArr.push(this.currentAdvices[i].id)
  545. }
  546. }
  547. this.currentAdviceIdsStr = currentAdviceIdArr.join(',')
  548. if (this.current_select_object == 1) {
  549. exceParams = {
  550. groupno: 0,
  551. advice_id: this.currentAdviceIdsStr,
  552. execution_time: exceTime
  553. }
  554. } else {
  555. var group = this.advice_groups[this.current_group_index]
  556. exceParams = {
  557. groupno: group.group_no <= 0 ? 0 : group.group_no,
  558. advice_id: group.group_no <= 0 ? group.advices[0].id : 0,
  559. execution_time: exceTime
  560. }
  561. }
  562. ModifyExecDoctorAdvice(exceParams)
  563. .then(response => {
  564. if (response.data.state == 0) {
  565. Toast.fail(response.data.msg)
  566. return false
  567. } else {
  568. Toast.success('执行成功!')
  569. var advice = response.data.data.advice
  570. if (this.current_select_object == 1) {
  571. var ids = this.currentAdviceIdsStr.split(',')
  572. var adviceArr = this.advice_groups[this.current_group_index].advices
  573. for (let i = 0; i < adviceArr.length; i++) {
  574. for (let a = 0; a < ids.length; a++) {
  575. if ((adviceArr[i].execution_state == 1 && adviceArr[i].id == ids[a]) || (adviceArr[i].execution_state == 1 && adviceArr[i].parent_id == ids[a])) {
  576. adviceArr[i].execution_time = advice.execution_time
  577. }
  578. }
  579. }
  580. } else {
  581. for (let index = 0; index < group.advices.length; index++) {
  582. const adv = group.advices[index]
  583. if (adv.execution_state == 1) {
  584. adv.execution_time = advice.execution_time
  585. }
  586. }
  587. }
  588. }
  589. })
  590. .catch(err => {
  591. Toast.fail(err)
  592. return false
  593. })
  594. },
  595. handleExecTime (time) {
  596. var exceTime = this.handleTime(time)
  597. var exceParams = null
  598. if (this.current_select_object == 1) {
  599. exceParams = {
  600. groupno: 0,
  601. advice_id: this.currentAdviceIdsStr,
  602. execution_time: exceTime
  603. }
  604. } else {
  605. var group = this.advice_groups[this.current_group_index]
  606. exceParams = {
  607. groupno: group.group_no <= 0 ? 0 : group.group_no,
  608. advice_id: group.group_no <= 0 ? group.advices[0].id : 0,
  609. execution_time: exceTime
  610. }
  611. }
  612. Toast.loading({forbidClick: true, duration: 0})
  613. ExecDoctorAdvice(exceParams)
  614. .then(response => {
  615. if (response.data.state == 0) {
  616. Toast.fail(response.data.msg)
  617. return false
  618. } else {
  619. Toast.success('执行成功!')
  620. var advice = response.data.data.advice
  621. if (this.current_select_object == 1) {
  622. var ids = this.currentAdviceIdsStr.split(',')
  623. var adviceArr = this.advice_groups[this.current_group_index].advices
  624. for (let i = 0; i < adviceArr.length; i++) {
  625. for (let a = 0; a < ids.length; a++) {
  626. if ((adviceArr[i].execution_state == 2 && adviceArr[i].id == ids[a]) || (adviceArr[i].execution_state == 2 && adviceArr[i].parent_id == ids[a])) {
  627. adviceArr[i].execution_staff = advice.execution_staff
  628. adviceArr[i].execution_time = advice.execution_time
  629. adviceArr[i].execution_state = advice.execution_state
  630. }
  631. }
  632. }
  633. } else {
  634. for (let index = 0; index < group.advices.length; index++) {
  635. const adv = group.advices[index]
  636. if (adv.execution_state == 2) {
  637. adv.execution_staff = advice.execution_staff
  638. adv.execution_time = advice.execution_time
  639. adv.execution_state = advice.execution_state
  640. }
  641. }
  642. }
  643. }
  644. })
  645. .catch(err => {
  646. Toast.fail(err)
  647. return false
  648. })
  649. },
  650. handleTime (time) {
  651. var year = time.getFullYear()
  652. var month = time.getMonth() + 1
  653. var day = time.getDate()
  654. var hour = time.getHours()
  655. var minute = time.getMinutes()
  656. if (month < 10) {
  657. month = '0' + month
  658. }
  659. if (day < 10) {
  660. day = '0' + day
  661. }
  662. if (hour < 10) {
  663. hour = '0' + hour
  664. }
  665. if (minute < 10) {
  666. minute = '0' + minute
  667. }
  668. return year + '-' + month + '-' + day + ' ' + hour + ':' + minute + ':00'
  669. }, deleteSubAdviceAction: function () {
  670. if (this.currentSubAdvices.length <= 0) {
  671. return
  672. }
  673. Dialog.confirm({
  674. title: '删除医嘱',
  675. message: '确认删除医嘱吗?'
  676. }).then(() => {
  677. Toast.loading({forbidClick: true, duration: 0})
  678. DeleteSubDoctorAdvice(this.currentSubAdvices[0].id)
  679. .then(rs => {
  680. if (rs.data.state == 1) {
  681. Toast.success('删除成功')
  682. var adviceArr = this.advice_groups[this.current_group_index].advices
  683. for (let i = adviceArr.length - 1; i >= 0; i--) {
  684. if (adviceArr[i].id == this.currentSubAdvices[0].id) {
  685. adviceArr.splice(i, 1)
  686. }
  687. }
  688. this.currentSubAdvices = []
  689. this.currentAdvices = []
  690. for (let i = 0; i < this.advice_groups.length; i++) {
  691. for (let y = 0; y < this.advice_groups[i].advices.length; y++) {
  692. var advices = this.advice_groups[i].advices[y]
  693. advices.is_selected = 0
  694. }
  695. }
  696. } else {
  697. Toast.fail(rs.data.msg)
  698. }
  699. })
  700. .catch(err => {
  701. Toast.fail(err)
  702. })
  703. })
  704. },
  705. deleteAdviceAction: function () {
  706. if (this.current_select_object == 1) {
  707. if (this.currentAdvices.length <= 0) {
  708. return
  709. }
  710. Dialog.confirm({
  711. title: '删除医嘱',
  712. message: '确认删除医嘱吗?'
  713. }).then(() => {
  714. Toast.loading({forbidClick: true, duration: 0})
  715. var group_no = 0
  716. var advice_id = this.currentAdvices.join(',')
  717. var ids = []
  718. for (let i = 0; i < this.currentAdvices.length; i++) {
  719. ids.push(this.currentAdvices[i].id)
  720. }
  721. advice_id = ids.join(',')
  722. DeleteDoctorAdviceNew(group_no, advice_id)
  723. .then(rs => {
  724. if (rs.data.state == 1) {
  725. Toast.success('删除成功')
  726. var adviceArr = this.advice_groups[this.current_group_index].advices
  727. for (let y = ids.length - 1; y >= 0; y--) {
  728. for (let i = adviceArr.length - 1; i >= 0; i--) {
  729. if (adviceArr[i].id == ids[y] || adviceArr[i].parent_id == ids[y]) {
  730. adviceArr.splice(i, 1)
  731. }
  732. }
  733. }
  734. this.currentSubAdvices = []
  735. this.currentAdvices = []
  736. for (let i = 0; i < this.advice_groups.length; i++) {
  737. for (let y = 0; y < this.advice_groups[i].advices.length; y++) {
  738. var advices = this.advice_groups[i].advices[y]
  739. advices.is_selected = 0
  740. }
  741. }
  742. } else {
  743. Toast.fail(rs.data.msg)
  744. }
  745. })
  746. .catch(err => {
  747. Toast.fail(err)
  748. })
  749. })
  750. } else {
  751. if (this.current_group_index < 0) {
  752. return
  753. }
  754. var group = this.advice_groups[this.current_group_index]
  755. Dialog.confirm({
  756. title: '删除医嘱',
  757. message: '确认删除这组医嘱吗?'
  758. }).then(() => {
  759. Toast.loading({forbidClick: true, duration: 0})
  760. var group_no = group.group_no <= 0 ? 0 : group.group_no
  761. var advice_id = 0
  762. if (group.group_no <= 0) {
  763. advice_id = group.advices[0].id
  764. } else if (this.current_advice != null) {
  765. group_no = 0
  766. advice_id = this.current_advice.id
  767. }
  768. DeleteDoctorAdviceNew(group_no, advice_id)
  769. .then(rs => {
  770. if (rs.data.state == 1) {
  771. Toast.success('删除成功')
  772. // if (group.group_no <= 0) {
  773. // this.advice_groups.splice(this.current_group_index, 1);
  774. // } else {
  775. if (this.current_advice_index >= 0) {
  776. // if (group.advices.length <= 1) {
  777. // this.advice_groups.splice(this.current_group_index, 1);
  778. // } else {
  779. var advice = group.advices[this.current_advice_index]
  780. if (advice.parent_id > 0) {
  781. group.advices.splice(this.current_advice_index, 1)
  782. } else {
  783. var child_count = 0
  784. for (
  785. let index = this.current_advice_index + 1;
  786. index < group.advices.length;
  787. index++
  788. ) {
  789. const adv = group.advices[index]
  790. if (adv.parent_id == advice.id) {
  791. child_count++
  792. }
  793. }
  794. group.advices.splice(
  795. this.current_advice_index,
  796. child_count + 1
  797. )
  798. }
  799. if (group.advices.length == 0) {
  800. this.advice_groups.splice(this.current_group_index, 1)
  801. }
  802. // }
  803. } else {
  804. this.advice_groups.splice(this.current_group_index, 1)
  805. }
  806. // }
  807. this.cancelAdviceSelect()
  808. } else {
  809. Toast.fail(rs.data.msg)
  810. }
  811. })
  812. .catch(err => {
  813. Toast.fail(err)
  814. })
  815. })
  816. }
  817. },
  818. checkAdvice () {
  819. if (this.currentAdvices.length <= 0) {
  820. return
  821. }
  822. if (this.current_select_object == 1) {
  823. var isCheck = true
  824. var adviceArr = this.advice_groups[this.current_group_index].advices
  825. for (let i = 0; i < adviceArr.length; i++) {
  826. if (adviceArr[i].check_state == 0 && adviceArr[i].is_selected == 1) {
  827. isCheck = false
  828. }
  829. }
  830. if (isCheck) {
  831. Toast.fail('所选医嘱已核对')
  832. return false
  833. }
  834. for (let i = 0; i < adviceArr.length; i++) {
  835. if (adviceArr[i].is_selected == 1 && adviceArr[i].execution_staff > 0 && adviceArr[i].execution_staff == this.$store.getters.user.user.id) {
  836. Toast.fail('核对与执行不能是同一人')
  837. return false
  838. }
  839. }
  840. var currentAdviceIdArr = []
  841. for (let i = 0; i < adviceArr.length; i++) {
  842. if (adviceArr[i].is_selected == 1) {
  843. currentAdviceIdArr.push(adviceArr[i].id)
  844. }
  845. }
  846. this.currentAdviceIdsStr = currentAdviceIdArr.join(',')
  847. } else {
  848. if (!(this.current_group_index >= 0 && this.current_advice_index < 0)) {
  849. return
  850. }
  851. var isCheck = true
  852. var group_top_advice = this.advice_groups[this.current_group_index]
  853. .advices[0]
  854. var adviceArr = this.advice_groups[this.current_group_index].advices
  855. var advice = null
  856. for (let i = 0; i < adviceArr.length; i++) {
  857. if (adviceArr[i].check_state == 0) {
  858. isCheck = false
  859. }
  860. }
  861. if (isCheck) {
  862. Toast.fail('所选医嘱已核对')
  863. return false
  864. }
  865. for (let i = 0; i < adviceArr.length; i++) {
  866. if (adviceArr[i].is_selected == 1 && adviceArr[i].execution_staff > 0 && adviceArr[i].execution_staff == this.$store.getters.user.user.id) {
  867. Toast.fail('核对与执行不能是同一人')
  868. return false
  869. }
  870. }
  871. // if (
  872. // group_top_advice.execution_staff > 0 &&
  873. // group_top_advice.execution_staff == this.$store.getters.user.user.id
  874. // ) {
  875. // Toast.fail('核对与执行不能是同一人')
  876. // return false
  877. // }
  878. }
  879. Dialog.confirm({
  880. title: '医嘱核对',
  881. message: '确认提交核对?'
  882. }).then(() => {
  883. var params = null
  884. Toast.loading({forbidClick: true, duration: 0})
  885. if (this.current_select_object == 1) {
  886. params = {
  887. groupno: 0,
  888. advice_id: this.currentAdviceIdsStr
  889. }
  890. } else {
  891. var group = this.advice_groups[this.current_group_index]
  892. params = {
  893. groupno: group.group_no <= 0 ? 0 : group.group_no,
  894. advice_id: group.group_no <= 0 ? group.advices[0].id : 0
  895. }
  896. }
  897. CheckDoctorAdvice(params)
  898. .then(response => {
  899. if (response.data.state == 0) {
  900. return false
  901. } else {
  902. Toast.success('核对成功!')
  903. var advice = response.data.data.advice
  904. if (this.current_select_object == 1) {
  905. var ids = this.currentAdviceIdsStr.split(',')
  906. var adviceArr = this.advice_groups[this.current_group_index].advices
  907. for (let i = 0; i < adviceArr.length; i++) {
  908. for (let a = 0; a < ids.length; a++) {
  909. if ((adviceArr[i].check_state == 0 && adviceArr[i].id == ids[a]) || (adviceArr[i].check_state == 0 && adviceArr[i].parent_id == ids[a])) {
  910. adviceArr[i].checker = advice.checker
  911. adviceArr[i].check_time = advice.check_time
  912. adviceArr[i].check_state = advice.check_state
  913. }
  914. }
  915. }
  916. } else {
  917. for (let index = 0; index < group.advices.length; index++) {
  918. const adv = group.advices[index]
  919. adv.checker = advice.checker
  920. adv.check_time = advice.check_time
  921. adv.check_state = advice.check_state
  922. }
  923. }
  924. }
  925. })
  926. .catch(err => {
  927. Toast.fail(err)
  928. })
  929. })
  930. // .catch(err => {
  931. // Toast.fail(err);
  932. // });
  933. },
  934. execAdvice () {
  935. if (this.currentAdvices.length <= 0) {
  936. return
  937. }
  938. if (this.current_select_object == 1) {
  939. var isExecution = true
  940. var adviceArr = this.advice_groups[this.current_group_index].advices
  941. for (let i = 0; i < adviceArr.length; i++) {
  942. if (adviceArr[i].execution_state == 2 && adviceArr[i].is_selected == 1) {
  943. isExecution = false
  944. }
  945. }
  946. if (isExecution) {
  947. Toast.fail('所选医嘱已停止或执行')
  948. return false
  949. }
  950. for (let i = 0; i < adviceArr.length; i++) {
  951. if (adviceArr[i].is_selected == 1 && adviceArr[i].checker > 0 && adviceArr[i].checker == this.$store.getters.user.user.id) {
  952. Toast.fail('核对与执行不能是同一人')
  953. return false
  954. }
  955. }
  956. var currentAdviceIdArr = []
  957. for (let i = 0; i < adviceArr.length; i++) {
  958. if (adviceArr[i].is_selected == 1) {
  959. currentAdviceIdArr.push(adviceArr[i].id)
  960. }
  961. }
  962. this.currentAdviceIdsStr = currentAdviceIdArr.join(',')
  963. this.nowExecTime = new Date(adviceArr[0].start_time * 1000)
  964. } else {
  965. if (!(this.current_group_index >= 0 && this.current_advice_index < 0)) {
  966. return
  967. }
  968. var isExecution = true
  969. var group_top_advice = this.advice_groups[this.current_group_index]
  970. .advices[0]
  971. var adviceArr = this.advice_groups[this.current_group_index].advices
  972. for (let i = 0; i < adviceArr.length; i++) {
  973. if (adviceArr[i].is_selected == 1 && adviceArr[i].execution_state == 2) {
  974. isExecution = false
  975. }
  976. }
  977. if (isExecution) {
  978. Toast.fail('所选医嘱已停止或执行')
  979. return false
  980. }
  981. for (let i = 0; i < adviceArr.length; i++) {
  982. if (adviceArr[i].is_selected == 1 && adviceArr[i].checker > 0 && adviceArr[i].checker == this.$store.getters.user.user.id) {
  983. Toast.fail('核对与执行不能是同一人')
  984. return false
  985. }
  986. }
  987. this.nowExecTime = new Date(group_top_advice.start_time * 1000)
  988. }
  989. this.$refs.exec_time.open()
  990. },
  991. openNewChild () {
  992. if (this.$store.getters.user.user.user_type == 3) {
  993. Toast.fail('你没有权限添加子药!')
  994. return
  995. }
  996. if (this.currentAdvices.length == 0) {0
  997. return false
  998. }
  999. this.current_advice = this.currentAdvices[0]
  1000. if (
  1001. this.current_advice.stop_state == 1 ||
  1002. this.current_advice.execution_state == 1 ||
  1003. this.current_advice.check_state == 1
  1004. ) {
  1005. Toast.fail('所选医嘱已停止或执行或核对')
  1006. return false
  1007. }
  1008. this.index = 2
  1009. var start_time = uParseTime(
  1010. this.current_advice.start_time,
  1011. '{y}-{m}-{d} {h}:{i}'
  1012. )
  1013. this.$refs.subdrug_form.showWithNewSubDrug(
  1014. this.current_advice.id,
  1015. this.record_date,
  1016. start_time,
  1017. this.current_advice.delivery_way,
  1018. this.current_advice.execution_frequency
  1019. )
  1020. return
  1021. },
  1022. openNewAdvice () {
  1023. if (this.$store.getters.user.user.user_type == 3) {
  1024. Toast.fail('你没有权限新增医嘱!')
  1025. return
  1026. }
  1027. this.currentAdvices = []
  1028. this.currentSubAdvices = []
  1029. for (let i = 0; i < this.advice_groups.length; i++) {
  1030. for (let y = 0; y < this.advice_groups[i].advices.length; y++) {
  1031. var advices = this.advice_groups[i].advices[y]
  1032. advices.is_selected = 0
  1033. }
  1034. }
  1035. this.index = 1
  1036. this.current_group_index = -1
  1037. this.current_advice_index = -1
  1038. this.current_advice = null
  1039. }, modifySubdviceAction: function () {
  1040. if (this.currentSubAdvices.length <= 0) {
  1041. return
  1042. }
  1043. if (this.current_advice_index >= 0) {
  1044. this.index = 3
  1045. var advice = this.currentSubAdvices[0]
  1046. this.$refs.modify_advice_form.showWithModify({
  1047. id: advice.id,
  1048. parent_id: advice.parent_id,
  1049. title: advice.advice_name,
  1050. advice_desc: advice.advice_desc,
  1051. remark: advice.remark,
  1052. drug_spec: advice.drug_spec,
  1053. drug_spec_unit: advice.drug_spec_unit,
  1054. delivery_way: advice.delivery_way,
  1055. execution_frequency: advice.execution_frequency,
  1056. single_dose: advice.single_dose,
  1057. single_dose_unit: advice.single_dose_unit,
  1058. prescribing_number: advice.prescribing_number,
  1059. prescribing_number_unit: advice.prescribing_number_unit
  1060. })
  1061. }
  1062. },
  1063. modifyAdviceAction: function () {
  1064. if (this.current_group_index < 0) {
  1065. return
  1066. }
  1067. var group = this.advice_groups[this.current_group_index]
  1068. if (this.current_advice_index >= 0) {
  1069. this.index = 3
  1070. var advice = this.currentAdvices[0]
  1071. this.$refs.modify_advice_form.showWithModify({
  1072. id: advice.id,
  1073. parent_id: advice.parent_id,
  1074. title: advice.advice_name,
  1075. advice_desc: advice.advice_desc,
  1076. remark: advice.remark,
  1077. start_time: advice.start_time,
  1078. drug_spec: advice.drug_spec,
  1079. drug_spec_unit: advice.drug_spec_unit,
  1080. delivery_way: advice.delivery_way,
  1081. execution_frequency: advice.execution_frequency,
  1082. single_dose: advice.single_dose,
  1083. single_dose_unit: advice.single_dose_unit,
  1084. prescribing_number: advice.prescribing_number,
  1085. prescribing_number_unit: advice.prescribing_number_unit
  1086. })
  1087. } else {
  1088. if (group.group_no <= 0) {
  1089. this.index = 3
  1090. var advice = group.advices[0]
  1091. this.$refs.modify_advice_form.showWithModify({
  1092. id: advice.id,
  1093. parent_id: advice.parent_id,
  1094. title: advice.advice_name,
  1095. advice_desc: advice.advice_desc,
  1096. remark: advice.remark,
  1097. drug_spec: advice.drug_spec,
  1098. drug_spec_unit: advice.drug_spec_unit,
  1099. delivery_way: advice.delivery_way,
  1100. execution_frequency: advice.execution_frequency,
  1101. single_dose: advice.single_dose,
  1102. single_dose_unit: advice.single_dose_unit,
  1103. prescribing_number: advice.prescribing_number,
  1104. prescribing_number_unit: advice.prescribing_number_unit
  1105. })
  1106. } else {
  1107. this.index = 4
  1108. this.$refs.modify_advice_group.show(group.group_no, group.advices)
  1109. }
  1110. }
  1111. },
  1112. cancelAdviceSelect: function () {
  1113. this.current_group_index = -1
  1114. this.current_advice_index = -1
  1115. this.current_advice = null
  1116. },
  1117. selectAdviceAction: function (group_index, advice_index, advice) {
  1118. console.log(this.current_group_index)
  1119. console.log(group_index)
  1120. console.log(advice.parent_id)
  1121. if ((this.current_group_index != -1 && this.current_group_index != group_index) || advice.parent_id > 0) { //选择其他组,将原来的组选择状态清除
  1122. this.currentAdvices = []
  1123. this.currentSubAdvices = []
  1124. for (let i = 0; i < this.advice_groups.length; i++) {
  1125. for (let y = 0; y < this.advice_groups[i].advices.length; y++) {
  1126. var advices = this.advice_groups[i].advices[y]
  1127. advices.is_selected = 0
  1128. }
  1129. }
  1130. }
  1131. for (let i = 0; i < this.advice_groups.length; i++) { //选择子医嘱,将已经选择的医嘱选择状态清除
  1132. for (let y = 0; y < this.advice_groups[i].advices.length; y++) {
  1133. var advices = this.advice_groups[i].advices[y]
  1134. if (advices.parent_id > 0) {
  1135. advices.is_selected = 0
  1136. }
  1137. }
  1138. }
  1139. for (let i = 0; i < this.advice_groups.length; i++) { //设置选择状态
  1140. for (let y = 0; y < this.advice_groups[i].advices.length; y++) {
  1141. var advices = this.advice_groups[i].advices[y]
  1142. if (advices.id == advice.id) {
  1143. if (advice.is_selected == 1) {
  1144. advice.is_selected = 0
  1145. for (let a = this.currentAdvices.length - 1; a >= 0; a--) {
  1146. if (this.currentAdvices[a].id == advice.id) {
  1147. this.currentAdvices.splice(a, 1)
  1148. }
  1149. }
  1150. } else {
  1151. advice.is_selected = 1
  1152. if (advice.parent_id == 0) {
  1153. this.currentAdvices.push(advice)
  1154. }
  1155. }
  1156. }
  1157. }
  1158. }
  1159. if (advice.parent_id == 0) {
  1160. this.currentSubAdvices = []
  1161. } else {
  1162. this.currentSubAdvices.push(advice)
  1163. }
  1164. this.current_select_object = 1 //单条医嘱
  1165. this.current_group_index = group_index
  1166. this.current_advice_index = advice_index
  1167. this.current_advice = advice
  1168. }, selectGroupAdviceAction: function (group_index, advice_index, advice, group) {
  1169. if (this.current_group_index != -1 && this.current_group_index != group_index) { //选择其他组,将原来的组选择状态清除
  1170. this.currentAdvices = []
  1171. this.currentSubAdvices = []
  1172. for (let i = 0; i < this.advice_groups.length; i++) {
  1173. for (let y = 0; y < this.advice_groups[i].advices.length; y++) {
  1174. var advices = this.advice_groups[i].advices[y]
  1175. advices.is_selected = 0
  1176. }
  1177. }
  1178. }
  1179. for (let i = 0; i < this.advice_groups.length; i++) { //选择子医嘱,将已经选择的医嘱选择状态清除
  1180. for (let y = 0; y < this.advice_groups[i].advices.length; y++) {
  1181. var advices = this.advice_groups[i].advices[y]
  1182. if (advices.parent_id > 0) {
  1183. advices.is_selected = 0
  1184. }
  1185. }
  1186. }
  1187. for (let i = 0; i < this.advice_groups.length; i++) {
  1188. for (let y = 0; y < this.advice_groups[i].advices.length; y++) {
  1189. var advices = this.advice_groups[i].advices[y]
  1190. if (advices.groupno == group.group_no) {
  1191. advices.is_selected = 1
  1192. this.currentAdvices.push(advices)
  1193. }
  1194. }
  1195. }
  1196. this.current_select_object = 2 //单组医嘱
  1197. this.current_group_index = group_index
  1198. this.current_advice_index = advice_index
  1199. this.current_advice = advice
  1200. }
  1201. }
  1202. }
  1203. </script>
  1204. <style style="stylesheet/scss" lang="scss" scoped>
  1205. .DialogContent{
  1206. .content{
  1207. .yzNav{
  1208. position: fixed;
  1209. top: 0.16rem;
  1210. }
  1211. }
  1212. }
  1213. .table {
  1214. width: 100%;
  1215. tr {
  1216. th {
  1217. background: $main-color;
  1218. color: #fff;
  1219. height: 0.88rem;
  1220. line-height: 0.88rem;
  1221. }
  1222. td {
  1223. line-height: 0.4rem;
  1224. .txt {
  1225. // float: left;
  1226. padding: 0 10px 0 10px;
  1227. // width: 75%;
  1228. text-align: left;
  1229. }
  1230. .ico {
  1231. float: right;
  1232. width: 60px;
  1233. text-align: right;
  1234. padding-right: 3px;
  1235. }
  1236. .iconfont {
  1237. font-size: 20px;
  1238. padding: 0 2px;
  1239. color: #7b8a97;
  1240. }
  1241. .handle {
  1242. color: #409eff;
  1243. // padding: 0 7px;
  1244. }
  1245. }
  1246. .advice_content {
  1247. // background: #eff6fc;
  1248. }
  1249. .subadvice_content {
  1250. // background: #fafcfe;
  1251. padding-left: 20px;
  1252. }
  1253. .td-active {
  1254. background: #badcff !important;
  1255. }
  1256. }
  1257. .row-class-active {
  1258. td {
  1259. background: #badcff;
  1260. }
  1261. }
  1262. }
  1263. .content {
  1264. .cell {
  1265. float: left;
  1266. width: 3.42rem;
  1267. margin: 0.35rem 0.3rem 0 0.4rem;
  1268. label {
  1269. display: block;
  1270. height: 0.55rem;
  1271. line-height: 0.55rem;
  1272. color: $pgh-color;
  1273. }
  1274. select {
  1275. width: 100%;
  1276. padding: 0.2rem 0;
  1277. border: 1px $border-color solid;
  1278. border-radius: 2px;
  1279. padding-left: 5px;
  1280. }
  1281. .inputBox {
  1282. border: 1px $border-color solid;
  1283. border-radius: 2px;
  1284. padding: 0.18rem 0;
  1285. padding-left: 5px;
  1286. }
  1287. .textarea {
  1288. width: 100%;
  1289. height: 1.22rem;
  1290. border: 1px $border-color solid;
  1291. border-radius: 2px;
  1292. padding-left: 5px;
  1293. }
  1294. }
  1295. .width {
  1296. width: 90%;
  1297. @include box-sizing;
  1298. margin-top: 1rem;
  1299. label {
  1300. display: inline-block;
  1301. }
  1302. button {
  1303. background: $main-color;
  1304. color: #fff;
  1305. border-radius: 6px;
  1306. width: 3rem;
  1307. height: 0.9rem;
  1308. line-height: 0.9rem;
  1309. text-align: center;
  1310. margin: 0 0.1rem 0.6rem 0.1rem;
  1311. border: 1px $main-color solid;
  1312. &.smt-danger {
  1313. background: #fff;
  1314. color: $main-color;
  1315. }
  1316. }
  1317. }
  1318. .center {
  1319. text-align: center;
  1320. }
  1321. }
  1322. </style>