血透系统PC前端

DoctorAdviceDialog.vue 50KB

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