血透系统pad前端

OrdersDialog.vue 48KB

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