courseOfDisease_new.vue 61KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843
  1. <template>
  2. <!-- <div class="main-contain">
  3. <div class="position">
  4. <bread-crumb></bread-crumb>
  5. </div> -->
  6. <div class="patient-container">
  7. <PatientSidebar :id="patient_id" defaultActive="3-5"></PatientSidebar>
  8. <div v-loading="loading">
  9. <div class="patient-app-container advice-container app-container" style="">
  10. <div style="display: flex;">
  11. <div style="width: 34%;">
  12. <div style="display: flex;">
  13. <div style="flex: 1.1;">
  14. <span style="display: inline-block;border-left: 5px solid #3891f1f5;padding-left: 5px;">病史列表</span>
  15. </div>
  16. <div style="flex: 0.9;text-align: right;">
  17. <el-button type="primary" size="small" @click="add_click">添加</el-button>
  18. </div>
  19. </div>
  20. <div>
  21. <el-table class="table"
  22. ref="phy_table"
  23. :data="tableData"
  24. :highlight-current-row="true"
  25. @current-change="getCurrentChangeOne"
  26. style="width: 100%">
  27. <el-table-column prop="index" label="序号" width="50">
  28. <template slot-scope="scope">
  29. {{ scope.$index + 1 }}
  30. </template>
  31. </el-table-column>
  32. <el-table-column prop="date" label="时间" width="">
  33. <template slot-scope="scope">
  34. {{ getTime(scope.row.record_time) }}
  35. </template>
  36. </el-table-column>
  37. <el-table-column prop="doctor" label="医生">
  38. <template slot-scope="scope">
  39. {{ getDocName(scope.row.recorder) }}
  40. </template>
  41. </el-table-column>
  42. </el-table>
  43. </div>
  44. </div>
  45. <div style="width: 65%;margin-left: 10px;">
  46. <div style="display: flex;">
  47. <div style="flex: 1;">
  48. <span style="display: inline-block;border-left: 5px solid #3891f1f5;padding-left: 5px;">详情</span>
  49. </div>
  50. <div style="flex: 1;text-align: right;">
  51. <div v-if='add_index == 0'>
  52. <el-button type="primary" size="small" @click="showEdit">修改</el-button>
  53. <el-button size="small" type="danger" @click="deleteAction">删除</el-button>
  54. <el-button type="primary" size="small" @click="prints">打印</el-button>
  55. </div>
  56. <div v-if="add_index == 1">
  57. <el-button type="primary" size="small" @click="showSave">保存</el-button>
  58. <el-button size="small" @click="showCancel">取消</el-button>
  59. </div>
  60. </div>
  61. </div>
  62. <div style="display: flex;margin: 10px 0;">
  63. <div style="flex: 1;">
  64. 记录时间:
  65. <el-date-picker v-model="record_date" prefix-icon="el-icon-date" :editable="false"
  66. style="width: 250px;"
  67. type="datetime" placeholder="选择日期时间" align="right" format="yyyy-MM-dd HH:mm:ss"
  68. value-format="yyyy-MM-dd HH:mm:ss"></el-date-picker>
  69. </div>
  70. <div style="flex: 1;">
  71. 病程医生:
  72. <el-select v-model="admin_user_id" placeholder="请选择" :disabled="disabled">
  73. <el-option
  74. v-for="item in doctorOptions"
  75. :key="item.id"
  76. :label="item.name"
  77. :value="item.id">
  78. </el-option>
  79. </el-select>
  80. </div>
  81. </div>
  82. <div>
  83. <span style="display: inline-block;border-left: 5px solid #3891f1f5;padding-left: 5px;margin-bottom: 5px;">
  84. 病程内容
  85. </span>
  86. <div style="display:flex;">
  87. <div>
  88. 取值时间:
  89. <el-select v-model="quzhi_date" @change="datachange" placeholder="请选择" style="width: 120px;">
  90. <el-option
  91. v-for="item in quzhi_options"
  92. :key="item.value"
  93. :label="item.label"
  94. :value="item.value">
  95. </el-option>
  96. </el-select>
  97. </div>
  98. <div style="margin:0 10px">
  99. <el-date-picker
  100. @change="changStartDate"
  101. v-model="start_date"
  102. type="date"
  103. value-format="yyyy-MM-dd"
  104. placeholder="选择日期"
  105. style="width: 150px;">
  106. </el-date-picker>
  107. <span>-</span>
  108. <el-date-picker
  109. @change="changEndDate"
  110. v-model="end_date"
  111. type="date"
  112. value-format="yyyy-MM-dd"
  113. placeholder="选择日期"
  114. style="width: 150px;">
  115. </el-date-picker>
  116. </div>
  117. <!-- <div>
  118. <el-button type="primary" size="small" @click="autotext_click">
  119. 生成
  120. </el-button>
  121. <el-button type="primary" size="small" @click="auto_dialog=false">
  122. 取消
  123. </el-button>
  124. </div> -->
  125. </div>
  126. <div style="margin: 10px 0;">
  127. <el-button type="primary" size="small" @click="template_click">
  128. {{ add_index ==0 ? '设置模板' : '模板库' }}
  129. </el-button>
  130. <el-button type="primary" size="small" @click="auto_click">
  131. 自动生成
  132. </el-button>
  133. </div>
  134. <ueditor ref="editor" id="editors" :content="new_content"></ueditor>
  135. </div>
  136. </div>
  137. </div>
  138. </div>
  139. <el-dialog
  140. title="设置模板"
  141. :visible.sync="template_dialog"
  142. width="20%"
  143. center>
  144. <div>
  145. 模板名称:
  146. <el-input v-model="title" placeholder="请输入内容" style="width: 160px;"></el-input>
  147. </div>
  148. <span slot="footer" class="dialog-footer">
  149. <el-button @click="template_dialog = false">取 消</el-button>
  150. <el-button type="primary" @click="saveTemplate">确 定</el-button>
  151. </span>
  152. </el-dialog>
  153. <el-dialog
  154. title="模板库"
  155. :visible.sync="library_dialog"
  156. width="70%"
  157. class="lirary"
  158. >
  159. <div>
  160. <div style="display: flex;">
  161. <div style="width: 27%;">
  162. <el-table
  163. :data="templateList"
  164. :highlight-current-row="true"
  165. @row-click="rowclick"
  166. ref="record_table_one"
  167. @current-change="getCurrentChangeTwo"
  168. style="width: 100%">
  169. <el-table-column prop="index" label="序号" width="">
  170. <template slot-scope="scope">
  171. {{ scope.$index + 1 }}
  172. </template>
  173. </el-table-column>
  174. <el-table-column prop="name" label="模板名称" width="">
  175. <template slot-scope="scope">
  176. {{ scope.row.title }}
  177. </template>
  178. </el-table-column>
  179. </el-table>
  180. </div>
  181. <div style="width: 72%;margin-left: 10px;">
  182. <div class="Second_title">模板内容</div>
  183. <div style="">
  184. <keep-alive>
  185. <ueditor ref="editorOne" id="editors" :content="new_content"></ueditor>
  186. </keep-alive>
  187. </div>
  188. </div>
  189. </div>
  190. </div>
  191. <span slot="footer" class="dialog-footer" style="text-align: center;">
  192. <el-button type="danger" @click="template_dele">删除模板</el-button>
  193. <el-button type="primary" @click="template_save">保存模板</el-button>
  194. <el-button type="primary" @click="toContentPint">应用</el-button>
  195. <el-button @click="library_dialog = false">取消</el-button>
  196. </span>
  197. </el-dialog>
  198. <el-dialog
  199. title="提示"
  200. :visible.sync="auto_dialog"
  201. width="70%"
  202. top="0"
  203. >
  204. <div>
  205. <!-- <div style="display:flex;"> -->
  206. <!-- <div>
  207. 取值时间:
  208. <el-select v-model="quzhi_date" @change="datachange" placeholder="请选择" style="width: 120px;">
  209. <el-option
  210. v-for="item in quzhi_options"
  211. :key="item.value"
  212. :label="item.label"
  213. :value="item.value">
  214. </el-option>
  215. </el-select>
  216. </div>
  217. <div style="margin:0 10px">
  218. <el-date-picker
  219. @change="changStartDate"
  220. v-model="start_date"
  221. type="date"
  222. value-format="yyyy-MM-dd"
  223. placeholder="选择日期"
  224. style="width: 150px;">
  225. </el-date-picker>
  226. <span>-</span>
  227. <el-date-picker
  228. @change="changEndDate"
  229. v-model="end_date"
  230. type="date"
  231. value-format="yyyy-MM-dd"
  232. placeholder="选择日期"
  233. style="width: 150px;">
  234. </el-date-picker>
  235. </div> -->
  236. <div style="text-align: right;margin-bottom: 10px;">
  237. <el-button type="primary" size="small" @click="autotext_click">
  238. 生成
  239. </el-button>
  240. <el-button type="primary" size="small" @click="auto_dialog=false">
  241. 取消
  242. </el-button>
  243. </div>
  244. <!-- </div> -->
  245. <div v-show="AuToShow">
  246. <text_content @new_content="newcontent" :patient="patient" :prescriptionList="prescriptionList" :berforList="berforList"
  247. :monitorList="monitorList" :dryweightList="dryweightList" :inpectionList="inpectionList" :dialysisOrderList="dialysisOrderList"
  248. :start_date="start_date" :end_date="end_date" :patient_id="patient_id" :num="num"></text_content>
  249. </div>
  250. </div>
  251. </el-dialog>
  252. </div>
  253. </div>
  254. </template>
  255. <script>
  256. import PatientSidebar from './components/PatientSidebar'
  257. import PatientSidebar_new from './components/PatientSidebar_new'
  258. import Editor from '@/components/Editor'
  259. import ueditor from '@/components/Uedtior'
  260. import text_content from './text_content'
  261. const moment = require('moment')
  262. import { getDataConfig } from "@/utils/data";
  263. import {
  264. createNewCourseOfDiseaseRecord,
  265. deleteNewCouseOfDisease,
  266. modifyCourseOfDiseaseRecord,
  267. getPatientCourseOfDiseaseList,
  268. saveCoureseTemplateTitle,
  269. getPatientCoureOfTempalate,
  270. saveCourseOfNewTemplate,
  271. deleteCourseTempalte,
  272. getAutoPatientContent
  273. } from '@/api/patient'
  274. import { fetchAllDoctorAndNurse } from "@/api/doctor";
  275. import { parseTime } from '@/utils'
  276. import BreadCrumb from '@/xt_pages/components/bread-crumb'
  277. import { uParseTime } from '@/utils/tools'
  278. export default {
  279. name: 'CourseOfDisease',
  280. components: {
  281. PatientSidebar,
  282. BreadCrumb,
  283. Editor,
  284. PatientSidebar_new,
  285. ueditor,
  286. text_content,
  287. },
  288. data() {
  289. return {
  290. loading: false,
  291. title: '',
  292. patient_id: 0,
  293. date: [],
  294. start_time: '',
  295. end_time: '',
  296. course_of_disease_time: moment(new Date()).format('YYYY-MM-DD HH:mm:ss'),
  297. records: [],
  298. doctors: [],
  299. current_select_record: null,
  300. show_dialog: false,
  301. show_edit_dialog: false,
  302. uploading_new_record: false,
  303. templates: this.$store.getters.configlist.course_disease,
  304. select_template: '',
  305. new_content: '',
  306. edit_new_content: '',
  307. edit_course_of_disease_time: '',
  308. selectingRows: [],
  309. table_current_index: -1,
  310. edit_current_id: 0,
  311. edit_title: '',
  312. ids:"",
  313. idArr:[],
  314. org_id:0,
  315. add_index:0,
  316. disabled:true,
  317. template_dialog:false,
  318. library_dialog:false,
  319. auto_dialog:false,
  320. quzhi_date:1,
  321. start_date:'',
  322. end_date:'',
  323. quzhi_options:[{value:1,label:'本周'},{value:2,label:'上周'},{value:3,label:'本月'},{value:4,label:'上周'},],
  324. tableData:[],
  325. admin_user_id:0,
  326. record_date:moment(new Date()).format('YYYY-MM-DD HH:mm:ss'),
  327. template_name:"",
  328. id:0,
  329. doctorOptions:[],
  330. template_content:"",
  331. template_id:0,
  332. title:"",
  333. templateList:[],
  334. tab:[{id:1,name:'人促红注射液',type:'长期医嘱',start:'2024-12-04',dosage:"3000iu",pinlv:'一周三次',status:''},
  335. {id:2,name:'人促红注射液2',type:'长期医嘱',start:'2024-12-05',dosage:"3000iu",pinlv:'一周三次',status:''},
  336. ],
  337. prescriptionList:[],
  338. berforList:[],
  339. monitorList:[],
  340. dryweightList:[],
  341. inpectionList:[],
  342. dialysisOrderList:[],
  343. patient:{},
  344. AuToShow:false,
  345. num:22222222
  346. // name:"",
  347. // gander:"",
  348. // age:0,
  349. // dialysis_no:"",
  350. // patient_new:{},
  351. // prescriptionList:[],
  352. // berforList:[],
  353. // monitorList:[],
  354. // dryweightList:[],
  355. // inpectionList:[],
  356. // dialysisOrderList:[],
  357. // patient:{},
  358. }
  359. },
  360. created() {
  361. this.admin_user_id = this.$store.getters.xt_user.user.id
  362. this.patient_id = parseInt(this.$route.query.id)
  363. this.org_id = this.$store.getters.xt_user.template_info.org_id;
  364. if (isNaN(this.patient_id) || this.patient_id <= 0) {
  365. this.$notify.error({
  366. title: '错误',
  367. message: '无效的id'
  368. })
  369. this.$router.push('/patients/patients')
  370. return
  371. }
  372. // const ceshi = ``
  373. // // const ceshi=`hellow word`
  374. // this.new_content = ceshi
  375. // this.$refs.editor.contents=ceshi
  376. this.fetchAllDoctorAndNurse()
  377. this.getlist()
  378. },
  379. methods: {
  380. changStartDate(val){
  381. this.start_date = val
  382. },
  383. changEndDate(val){
  384. this.end_date = val
  385. },
  386. datachange(val){
  387. if(val ==1){
  388. this.start_date = this.getFirstDayOfWeek(new Date())
  389. this.end_date = this.getTime(new Date())
  390. }else if(val ==2){
  391. this.getlastweek(new Date())
  392. }else if(val ==3){
  393. this.start_date = this.getFirstDayOfMonth(new Date())
  394. this.end_date = this.getTime(new Date())
  395. }else if(val ==4){
  396. this.getLastMonthFirstDay()
  397. this.getLastMonthLastDay()
  398. }
  399. },
  400. toContentPint(){
  401. this.$refs.editor.contents = this.template_content
  402. this.library_dialog = false
  403. },
  404. getCurrentChangeOne(val){
  405. this.$refs.editor.contents = val.content
  406. this.record_date = this.getTime(val.record_time)
  407. this.id = val.id
  408. },
  409. getCurrentChangeTwo(val){
  410. this.$refs.editorOne.contents = val.content
  411. this.template_content = ""
  412. this.template_content = val.content
  413. this.template_id = val.id
  414. },
  415. template_dele(){
  416. deleteCourseTempalte(this.template_id).then(response=>{
  417. if(response.data.state == 1){
  418. var msg = response.data.data.msg
  419. this.$message.success("删除成功!")
  420. this.library_dialog = false
  421. this.getPatientCoureOfTempalateOne()
  422. }
  423. })
  424. },
  425. getPatientCoureOfTempalateOne(){
  426. },
  427. rowclick(){
  428. },
  429. prints(){
  430. },
  431. saveTemplate(){
  432. var params = {
  433. title:this.title,
  434. content: this.$refs.editor.contents,
  435. }
  436. saveCoureseTemplateTitle(params).then(response=>{
  437. if(response.data.state == 1){
  438. var courseTemplate = response.data.data.courseTemplate
  439. this.$message.success("保存成功!")
  440. this.template_dialog = false
  441. }
  442. })
  443. },
  444. template_save(){
  445. var params = {
  446. template_id:this.template_id,
  447. content:this.$refs.editorOne.contents
  448. }
  449. saveCourseOfNewTemplate(params).then(response=>{
  450. if(response.data.state == 1){
  451. var msg = response.data.data.msg
  452. this.$message.success("保存成功")
  453. this.library_dialog = false
  454. }
  455. })
  456. },
  457. getDocName(admin_user_id){
  458. var user_name = ""
  459. for(let i=0;i<this.doctorOptions.length;i++){
  460. if(admin_user_id == this.doctorOptions[i].id){
  461. user_name = this.doctorOptions[i].name
  462. }
  463. }
  464. return user_name
  465. },
  466. getlist(){
  467. var params = {
  468. patient_id:this.patient_id
  469. }
  470. getPatientCourseOfDiseaseList(params).then(response=>{
  471. if(response.data.state == 1){
  472. var list = response.data.data.list
  473. this.tableData = []
  474. this.tableData = list
  475. }
  476. })
  477. },
  478. fetchAllDoctorAndNurse() {
  479. fetchAllDoctorAndNurse().then(response => {
  480. if (response.data.state == 1) {
  481. this.doctorOptions= []
  482. this.doctorOptions = response.data.data.doctors;
  483. }
  484. });
  485. },
  486. add_click(){
  487. this.admin_user_id = ""
  488. this.admin_user_id = this.$store.getters.xt_user.user.id
  489. this.fetchAllDoctorAndNurse()
  490. this.$refs.editor.contents = ""
  491. this.id = 0
  492. this.disabled = false
  493. this.add_index = 1
  494. },
  495. showCancel(){
  496. this.add_index = 0
  497. this.disabled = true
  498. },
  499. showSave(){
  500. this.add_index = 0
  501. this.disabled = true
  502. console.log("haaaaaaaaaaaaaaa",this.$refs)
  503. this.new_content = this.$refs.editor.contents
  504. if (this.new_content.length == 0) {
  505. this.$message.error('请填写病程内容')
  506. return
  507. }
  508. var params = {
  509. id:this.id,
  510. patient_id:this.patient_id,
  511. record_date:this.record_date,
  512. content:this.new_content,
  513. admin_user_id:this.admin_user_id,
  514. }
  515. console.log("params",params)
  516. createNewCourseOfDiseaseRecord(params).then(response => {
  517. if(response.data.state == 1){
  518. var msg = response.data.data.msg
  519. this.$message.success("保存成功!")
  520. this.getlist()
  521. }
  522. }).catch(error => {
  523. })
  524. },
  525. template_click(){
  526. console.log('this.add_index',this.add_index);
  527. if(this.add_index ==0){
  528. this.template_dialog = true
  529. }else{
  530. getPatientCoureOfTempalate().then(response=>{
  531. if(response.data.state == 1){
  532. this.library_dialog = true
  533. this.templateList = response.data.data.templateList
  534. console.log("hahhahahaha",this.$refs)
  535. if(this.templateList!=null && this.templateList.length>0){
  536. this.$refs.record_table_one.setCurrentRow(this.templateList[0])
  537. }
  538. console.log("haaaaaaaaaaaaa",this.templateList)
  539. }
  540. })
  541. }
  542. },
  543. auto_click(){
  544. this.start_date = this.getFirstDayOfWeek(new Date())
  545. this.end_date = this.getTime(new Date())
  546. // this.getAutoPatientContent()
  547. this.auto_dialog = true
  548. },
  549. autotext_click(){
  550. // this.$nextTick(()=>{
  551. // const iframeDoc = document.getElementsByClassName('edui-editor-iframeholder')[0].getElementsByTagName('iframe')[0].contentDocument.getElementsByTagName('tbody')[0].children[9].children[1]
  552. // var newListArr =[]
  553. // for(let j in this.tab){
  554. // const obj={
  555. // id:this.tab[j].id,
  556. // newlist:'newList'+j
  557. // }
  558. // newListArr.push(obj)
  559. // }
  560. // for(let i in this.tab){
  561. // for(let j in newListArr){
  562. // if(this.tab[i].id==newListArr[j].id){
  563. // let newList = document.createElement('p');
  564. // newList.style.cssText='display: flex;text-align: center;border-bottom: 1px solid black;';
  565. // let newListItem1 = document.createElement('span');
  566. // newListItem1.style.cssText= 'width: 30%;display: inline-block;padding: 5px 0;border-right: 1px solid black;'
  567. // let newListItem2 = document.createElement('span');
  568. // newListItem2.style.cssText= 'width: 20%;display: inline-block;padding: 5px 0;border-right: 1px solid black;'
  569. // let newListItem3 = document.createElement('span');
  570. // newListItem3.style.cssText= 'width: 20%;display: inline-block;padding: 5px 0;border-right: 1px solid black;'
  571. // let newListItem4 = document.createElement('span');
  572. // newListItem4.style.cssText= 'width: 20%;display: inline-block;padding: 5px 0;border-right: 1px solid black;'
  573. // let newListItem5 = document.createElement('span');
  574. // newListItem5.style.cssText= 'width: 20%;display: inline-block;padding: 5px 0;border-right: 1px solid black;'
  575. // let newListItem6 = document.createElement('span');
  576. // newListItem6.style.cssText= 'width: 10%;display: inline-block;padding: 5px 0;'
  577. // newListItem1.textContent = this.tab[i].name;
  578. // newListItem2.textContent = this.tab[i].type;
  579. // newListItem3.textContent = this.tab[i].start;
  580. // newListItem4.textContent = this.tab[i].dosage;
  581. // newListItem5.textContent = this.tab[i].pinlv;
  582. // newListItem6.textContent = this.tab[i].status;
  583. // newList.appendChild(newListItem1);
  584. // newList.appendChild(newListItem2);
  585. // newList.appendChild(newListItem3);
  586. // newList.appendChild(newListItem4);
  587. // newList.appendChild(newListItem5);
  588. // newList.appendChild(newListItem6);
  589. // iframeDoc.appendChild(newList)
  590. // }
  591. // }
  592. // }
  593. // })
  594. this.AuToShow = true
  595. // this.getAutoPatientContent()
  596. },
  597. // 本周
  598. getFirstDayOfWeek(date){
  599. var weekday = date.getDay()
  600. date.setDate(date.getDate()-weekday+1);//往前算(weekday-1)天,年份、月份会自动变化
  601. return this.timeFormat(date);
  602. },
  603. // 上周
  604. getlastweek(date){
  605. date.setDate(date.getDate()-7 - date.getDay() + 1);
  606. var m =''
  607. var d = ''
  608. if(date.getMonth() + 1<10){
  609. m = '0'+(date.getMonth() + 1)
  610. }else{
  611. m = date.getMonth() + 1
  612. }
  613. if(date.getDate()<10){
  614. d = '0'+date.getDate()
  615. }else{
  616. d = date.getDate()
  617. }
  618. // this.start_date = date.getFullYear() + "-" + (date.getMonth() + 1) + "-" + date.getDate() ;
  619. this.start_date = date.getFullYear() + "-" + m + "-" + d ;
  620. date.setDate(date.getDate() +6);
  621. var mm = ''
  622. var dd = ''
  623. if(date.getMonth() + 1<10){
  624. mm = '0'+(date.getMonth() + 1)
  625. }else{
  626. mm = date.getMonth() + 1
  627. }
  628. if(date.getDate()<10){
  629. dd = '0'+date.getDate()
  630. }else{
  631. dd = date.getDate()
  632. }
  633. // if(date.getMonth() + 1<10)
  634. // this.end_date = date.getFullYear() + "-" + (date.getMonth() + 1) + "-" + date.getDate();
  635. this.end_date = date.getFullYear() + "-" + mm + "-" + dd ;
  636. console.log('this.end_date',this.end_date);
  637. },
  638. // 本月
  639. getFirstDayOfMonth (date) {
  640. date.setDate(1);
  641. return this.timeFormat(date);
  642. },
  643. //上个月第一天
  644. getLastMonthFirstDay() {
  645. var date = new Date();
  646. date.setDate(0);
  647. var y = date.getFullYear(); //获取年份
  648. var m = date.getMonth() + 1; //获取月份
  649. m = m < 10 ? "0" + m : m;
  650. this.start_date = [y, m, '01'].join("-")
  651. // return [y, m, '01'].join("-");
  652. },
  653. // 上个月最后一天
  654. getLastMonthLastDay() {
  655. var date = new Date();
  656. date.setDate(0);
  657. var y = date.getFullYear(); //获取年份
  658. var m = date.getMonth() + 1; //获取月份
  659. var d = new Date(y, m, 0).getDate(); //获取当月最后一日
  660. m = m < 10 ? "0" + m : m; //月份补 0
  661. d = d < 10 ? "0" + d : d; //日数补 0
  662. this.end_date = [y, m, d].join("-")
  663. // return [y, m, d].join("-");
  664. },
  665. // 日期格式化
  666. timeFormat(date) {
  667. if (!date || typeof(date) === "string") {
  668. this.error("参数异常,请检查...");
  669. }
  670. var y = date.getFullYear(); //年
  671. if(date.getMonth() + 1<10){
  672. var m ='0'+(date.getMonth() + 1); //月
  673. }else{
  674. var m =date.getMonth() + 1; //月
  675. }
  676. if(date.getDate()<10){
  677. var d ='0'+date.getDate(); //日
  678. }else{
  679. var d = date.getDate(); //日
  680. }
  681. // var d = date.getDate(); //日
  682. return y + "-" + m + "-" + d;
  683. },
  684. requestCourseRecords: function() {
  685. this.loading = true
  686. getCourseOfDiseaseRecords(this.patient_id, this.start_time, this.end_time).then(rs => {
  687. this.loading = false
  688. var resp = rs.data
  689. if (resp.state == 1) {
  690. this.current_select_record = null
  691. this.records = resp.data.records
  692. console.log("records232322332323232323223",this.records)
  693. this.doctors = resp.data.doctors
  694. } else {
  695. this.$message.error(resp.msg)
  696. }
  697. }).catch(error => {
  698. this.loading = false
  699. this.$message.error(error)
  700. })
  701. },
  702. didChangeCurrentRecord: function(record) {
  703. this.current_select_record = record
  704. },
  705. recordTime: function(timestamp) {
  706. var time = new Date(timestamp * 1000)
  707. return parseTime(time, '{y}-{m}-{d} {h}:{i}:{s}')
  708. },
  709. doctorName: function(doctor_id) {
  710. for (let index = 0; index < this.doctors.length; index++) {
  711. const doctor = this.doctors[index]
  712. if (doctor.id == doctor_id) {
  713. return doctor.name
  714. }
  715. }
  716. return ''
  717. },
  718. modifyAction: function() {
  719. this.edit_new_content = this.$refs.edit_neditor.content
  720. if (this.edit_new_content.length == 0) {
  721. this.$message.error('请填写病程内容')
  722. return
  723. }
  724. this.uploading_new_record = true
  725. modifyCourseOfDiseaseRecord(this.patient_id, this.edit_new_content, this.edit_course_of_disease_time, this.edit_current_id, this.edit_title).then(rs => {
  726. this.uploading_new_record = false
  727. var resp = rs.data
  728. if (resp.state == 1) {
  729. this.records[this.table_current_index].content = resp.data.record.content
  730. this.records[this.table_current_index].record_time = resp.data.record.record_time
  731. this.records[this.table_current_index].recorder = resp.data.record.recorder
  732. this.records[this.table_current_index].title = resp.data.record.title
  733. this.show_edit_dialog = false
  734. this.edit_new_content = ''
  735. this.table_current_index = -1
  736. } else {
  737. this.table_current_index = -1
  738. this.$message.error(resp.msg)
  739. }
  740. }).catch(error => {
  741. this.table_current_index = -1
  742. this.uploading_new_record = false
  743. this.$message.error(error)
  744. })
  745. },
  746. getAutoPatientContent(){
  747. if(this.start_date == ""){
  748. this.$message.error("请选择开始时间")
  749. }
  750. if(this.end_date == ""){
  751. this.$message.error("请选择结束时间")
  752. }
  753. var params = {
  754. start_time:this.start_date,
  755. end_time:this.end_date,
  756. patient_id:this.patient_id,
  757. }
  758. console.log("start_time==============",params)
  759. getAutoPatientContent(params).then(response=>{
  760. if(response.data.state == 1){
  761. var prescription = response.data.data.prescription
  762. var hd_total =0
  763. var hdArr =[]
  764. var hdf_total =0
  765. var hdfArr=[]
  766. var hdhp_total = 0
  767. var hdhpArr = []
  768. var hp_total = 0
  769. var hpArr= []
  770. var hf_total = 0
  771. var hfArr = []
  772. var scuf_total =0
  773. var scufArr = []
  774. var iuf_total =0
  775. var iufArr = []
  776. var hfhd_total =0
  777. var hfhdArr = []
  778. var hfhdhp_total =0
  779. var hfhdhpArr = []
  780. var phf_total =0
  781. var phfArr = []
  782. var hdfhp_total =0
  783. var hdfhpArr = []
  784. var crrt_total =0
  785. var crrtArr = []
  786. var iufhd_total =0
  787. var iufhdArr = []
  788. var uf_total =0
  789. var ufArr = []
  790. var hdjia_total =0
  791. var hdjiaArr = []
  792. var ihdf_total =0
  793. var ihdfArr = []
  794. var hdgaotong_total =0
  795. var hdgaotongArr = []
  796. var cvvh_total =0
  797. var cvvhArr = []
  798. var cvvhd_total =0
  799. var cvvhdArr = []
  800. var cvvhdf_total =0
  801. var cvvhdfArr = []
  802. var petotal =0
  803. var peArr=[]
  804. var hpdtotal =0
  805. var hpdArr=[]
  806. var hdptotal=0
  807. var hdpArr =[]
  808. var hfdtotal=0
  809. var hfdArr =[]
  810. var hdf100total=0
  811. var hdf100Arr =[]
  812. var hdf600total=0
  813. var hdf600Arr =[]
  814. var hdf100total=0
  815. var hdf100Arr =[]
  816. var hdf800total=0
  817. var hdf800Arr =[]
  818. var hdf1000total=0
  819. var hdf1000Arr =[]
  820. var hdf80total=0
  821. var hdf80Arr =[]
  822. var hf16total=0
  823. var hf16Arr =[]
  824. var hdwugantotal=0
  825. var hdwuganArr =[]
  826. var hdf17total=0
  827. var hdf17Arr =[]
  828. var hddiantotal=0
  829. var hddianArr =[]
  830. var hd2total=0
  831. var hd2Arr =[]
  832. var total_count = 0
  833. var total_min = 0
  834. var total_hour = 0
  835. var total_hour_str =""
  836. var dialyzerPerfusionApparatus = []
  837. var dialyzerArr = []
  838. var dialysisStrainerArr = []
  839. var dialysisIrrigationArr = []
  840. var kaliumArr= []
  841. var sodiumArr= []
  842. var calciumArr= []
  843. var bicarbonateArr = []
  844. var prescriptionSodiumArr = []
  845. if(prescription!=null && prescription.length>0){
  846. total_count = prescription.length
  847. }
  848. if(prescription!=null && prescription.length>0){
  849. for(let i=0;i<prescription.length;i++){
  850. if(prescription[i].dialyzer_perfusion_apparatus!=""){
  851. dialyzerPerfusionApparatus.push(prescription[i].dialyzer_perfusion_apparatus)
  852. }
  853. if(prescription[i].dialysis_dialyszers!=""){
  854. dialyzerArr.push(prescription[i].dialysis_dialyszers)
  855. }
  856. if(prescription[i].dialysis_strainer!=""){
  857. dialysisStrainerArr.push(prescription[i].dialysis_strainer)
  858. }
  859. if(prescription[i].dialysis_irrigation!=""){
  860. dialysisIrrigationArr.push(prescription[i].dialysis_irrigation)
  861. }
  862. if(prescription[i].kalium!=""){
  863. kaliumArr.push(prescription[i].kalium)
  864. }
  865. if(prescription[i].sodium!=""){
  866. sodiumArr.push(prescription[i].kalium)
  867. }
  868. if(prescription[i].calcium!=""){
  869. calciumArr.push(prescription[i].calcium)
  870. }
  871. if(prescription[i].bicarbonate!=""){
  872. bicarbonateArr.push(prescription[i].bicarbonate)
  873. }
  874. if(prescription[i].prescription_sodium!=""){
  875. prescriptionSodiumArr.push(prescription[i].prescription_sodium)
  876. }
  877. total_min += parseInt(prescription[i].dialysis_duration_hour *60)+ parseInt(prescription[i].dialysis_duration_minute)
  878. if(prescription[i].mode_id == 1){
  879. hdArr.push(prescription[i])
  880. }
  881. if(prescription[i].mode_id == 2){
  882. hdfArr.push(prescription[i])
  883. }
  884. if(prescription[i].mode_id == 3){
  885. hdhpArr.push(prescription[i])
  886. }
  887. if(prescription[i].mode_id == 4){
  888. hpArr.push(prescription[i])
  889. }
  890. if(prescription[i].mode_id == 5){
  891. hfArr.push(prescription[i])
  892. }
  893. if(prescription[i].mode_id == 6){
  894. scufArr.push(prescription[i])
  895. }
  896. if(prescription[i].mode_id == 7){
  897. iufArr.push(prescription[i])
  898. }
  899. if(prescription[i].mode_id == 8){
  900. hfhdArr.push(prescription[i])
  901. }
  902. if(prescription[i].mode_id == 9){
  903. hfhdhpArr.push(prescription[i])
  904. }
  905. if(prescription[i].mode_id == 10){
  906. phfArr.push(prescription[i])
  907. }
  908. if(prescription[i].mode_id == 11){
  909. hfArr.push(prescription[i])
  910. }
  911. if(prescription[i].mode_id == 12){
  912. hdfhpArr.push(prescription[i])
  913. }
  914. if(prescription[i].mode_id == 13){
  915. crrtArr.push(prescription[i])
  916. }
  917. if(prescription[i].mode_id == 19){
  918. iufhdArr.push(prescription[i])
  919. }
  920. if(prescription[i].mode_id == 20){
  921. ufArr.push(prescription[i])
  922. }
  923. if(prescription[i].mode_id == 21){
  924. hdjiaArr.push(prescription[i])
  925. }
  926. if(prescription[i].mode_id == 24){
  927. ihdfArr.push(prescription[i])
  928. }
  929. if(prescription[i].mode_id == 25){
  930. hdgaotongArr.push(prescription[i])
  931. }
  932. if(prescription[i].mode_id == 26){
  933. cvvhArr.push(prescription[i])
  934. }
  935. if(prescription[i].mode_id == 27){
  936. cvvhdArr.push(prescription[i])
  937. }
  938. if(prescription[i].mode_id == 28){
  939. cvvhdfArr.push(prescription[i])
  940. }
  941. if(prescription[i].mode_id == 29){
  942. peArr.push(prescription[i])
  943. }
  944. if(prescription[i].mode_id == 31){
  945. hpdArr.push(prescription[i])
  946. }
  947. if(prescription[i].mode_id == 32){
  948. hdpArr.push(prescription[i])
  949. }
  950. if(prescription[i].mode_id == 33){
  951. hfdArr.push(prescription[i])
  952. }
  953. if(prescription[i].mode_id == 34){
  954. hdf100Arr.push(prescription[i])
  955. }
  956. if(prescription[i].mode_id == 35){
  957. hdf600Arr.push(prescription[i])
  958. }
  959. if(prescription[i].mode_id == 36){
  960. hdf800Arr.push(prescription[i])
  961. }
  962. if(prescription[i].mode_id == 37){
  963. hdf1000Arr.push(prescription[i])
  964. }
  965. if(prescription[i].mode_id == 38){
  966. hdf80Arr.push(prescription[i])
  967. }
  968. if(prescription[i].mode_id == 39){
  969. hf16Arr.push(prescription[i])
  970. }
  971. if(prescription[i].mode_id == 40){
  972. hdwuganArr.push(prescription[i])
  973. }
  974. if(prescription[i].mode_id == 41){
  975. hdf17Arr.push(prescription[i])
  976. }
  977. if(prescription[i].mode_id == 42){
  978. hddianArr.push(prescription[i])
  979. }
  980. if(prescription[i].mode_id == 43){
  981. hd2Arr.push(prescription[i])
  982. }
  983. }
  984. }
  985. total_hour = ((total_min/60)/total_count).toFixed(2)
  986. total_hour_str = total_hour +"小时/次"
  987. hd_total = hdArr.length
  988. var hd_str = ""
  989. if(hd_total>0){
  990. hd_str = "HD"+hd_total +"次"
  991. }
  992. hdf_total = hdfArr.length
  993. var hdf_str =""
  994. if(hdf_total>0){
  995. hdf_str = "HDF"+hd_total +"次"
  996. }
  997. hdhp_total = hdhpArr.length
  998. var hdhp_str =""
  999. if(hdhp_total>0){
  1000. hdhp_str = "HD+HP"+hdhp_total+"次"
  1001. }
  1002. hp_total = hpArr.length
  1003. var hp_str= ""
  1004. if(hp_total>0){
  1005. hp_str = "HP"+hdptotal+"次"
  1006. }
  1007. hf_total = hfArr.length
  1008. var hf_str = ""
  1009. if(hf_total>0){
  1010. hf_str = "HF "+hf_total+"次"
  1011. }
  1012. var scuf_str = ""
  1013. scuf_total = scufArr.length
  1014. if(scuf_total>0){
  1015. scuf_str = "SCUF"+scuf_total+"次"
  1016. }
  1017. iuf_total = iufArr
  1018. var iuf_str= ""
  1019. if(iuf_total>0){
  1020. iuf_str = "IUF"+iuf_total+"次"
  1021. }
  1022. hfhd_total = hfhd_total
  1023. var hfhd_str= ""
  1024. if(hfhd_total>0){
  1025. hfhd_str = "HFHD"+hfhd_total+"次"
  1026. }
  1027. hfhdhp_total = hfhdhpArr
  1028. var hfhdhp_str =""
  1029. if(hfhdhp_total>0){
  1030. hfhdhp_str = "HFHD+HP"+hfhdhp_total+"次"
  1031. }
  1032. phf_total = phfArr
  1033. var phf_str= ""
  1034. if(phf_total>0){
  1035. phf_str = "PHF"+phf_total + "次"
  1036. }
  1037. hdfhp_total = hdfhpArr
  1038. var hdfhp_str =""
  1039. if(hdfhp_total>0){
  1040. hdfhp_str = "HDFHP"+hdfhp_total+"次"
  1041. }
  1042. crrt_total = crrtArr
  1043. var crrt_str =""
  1044. if(crrt_total>0){
  1045. crrt_str = "CRRT"+crrt_total+"次"
  1046. }
  1047. iuf_total = iufhdArr
  1048. var iuf_str = ""
  1049. if(iuf_total>0){
  1050. iuf_str = "IUF"+iuf_total+"次"
  1051. }
  1052. uf_total = ufArr
  1053. var uf_str= ""
  1054. if(uf_total>0){
  1055. uf_str = "UF"+uf_total +"次"
  1056. }
  1057. hdjia_total = hdjiaArr
  1058. var hdjia_str =""
  1059. if(hdjia_total>0){
  1060. hdjia_str = "HD+"+hdjia_total+"次"
  1061. }
  1062. ihdf_total = ihdfArr
  1063. var ihdf_str = ""
  1064. if(ihdf_total>0){
  1065. ihdf_str = "IHDF"+ihdf_total +"次"
  1066. }
  1067. hdgaotong_total = hdgaotongArr
  1068. var hdgaotong_str = ""
  1069. if(hdgaotong_total>0){
  1070. hdgaotong_str = "HD高通"+hdgaotong_total+"次"
  1071. }
  1072. cvvh_total = cvvhArr
  1073. var cvvh_str =""
  1074. if(cvvh_total>0){
  1075. cvvh_str = "CVVH"+cvvh_total + "次"
  1076. }
  1077. cvvhd_total = cvvhdArr
  1078. var cvvhd_str = ""
  1079. if(cvvhd_total>0){
  1080. cvvhd_str = "CVVHD"+cvvhd_total+"次"
  1081. }
  1082. cvvhdf_total =cvvhdfArr
  1083. var cvvhdf_str = ""
  1084. if(cvvhdf_total>0){
  1085. cvvhdf_str="CVVHDF"+cvvhdf_total+"次"
  1086. }
  1087. petotal = peArr
  1088. var pe_str =""
  1089. if(petotal>0){
  1090. pe_str = "PE"+petotal+"次"
  1091. }
  1092. hpdtotal = hpdArr
  1093. var hpd_str =""
  1094. if(hpdtotal>0){
  1095. hpd_str = "HDP"+hpdtotal+"次"
  1096. }
  1097. hfdtotal = hfdArr
  1098. var hfd_str =""
  1099. if(hfdtotal>0){
  1100. hfd_str ="HFD"+hfdtotal +"次"
  1101. }
  1102. hdf100total = hdf1000Arr
  1103. var hdf100str = ""
  1104. if(hdf100total>0){
  1105. hdf100str = "HDF100"+hdf100total+"次"
  1106. }
  1107. hdf600total = hdf600Arr
  1108. var hdf600str = ""
  1109. if(hdf600total>0){
  1110. hdf600str = "HDF600"+hdf600total+"次"
  1111. }
  1112. hdf100total = hdf1000Arr
  1113. var hdf1000str = ""
  1114. if(hdf100total>0){
  1115. hdf1000str = "HDF1000"+hdf100total+"次"
  1116. }
  1117. hdf80total = hdf80Arr
  1118. var hdf80str = ""
  1119. if(hdf80total>0){
  1120. hdf80str ="HDF80"+hdf80str +"次"
  1121. }
  1122. hf16total = hf16Arr
  1123. var hf16str = ""
  1124. if(hf16total>0){
  1125. hf16str = "HF16"+ hf16Arr +"次"
  1126. }
  1127. hdwugantotal = hdwuganArr
  1128. var hdwuganstr = ""
  1129. if(hdwugantotal>0){
  1130. hdwuganstr = "HD无肝素"+hdwugantotal+"次"
  1131. }
  1132. hdf17total = hdf17Arr
  1133. var hdf17str = ""
  1134. if(hdf17total>0){
  1135. hdf17str = "HDF17"+hdf17total + "次"
  1136. }
  1137. hddiantotal = hddianArr
  1138. var hddianstr = ""
  1139. if(hddiantotal>0){
  1140. hddianstr = "HD."+hddiantotal + "次"
  1141. }
  1142. var hd2str = ""
  1143. hd2total = hd2Arr
  1144. if(hd2total>0){
  1145. hd2str = "HD2"+hd2total+"次"
  1146. }
  1147. var berfor = response.data.data.berfor
  1148. this.berforList = []
  1149. this.berforList = berfor
  1150. var monitorList = response.data.data.monitorList
  1151. this.monitorList = []
  1152. this.monitorList = monitorList
  1153. var dryweightList = response.data.data.dryweightList
  1154. this.dryweightList = []
  1155. this.dryweightList = dryweightList
  1156. var inpectionList = response.data.data.inpectionList
  1157. this.inpectionList = []
  1158. this.inpectionList = inpectionList
  1159. this.patient = {}
  1160. var patient = response.data.data.patient
  1161. console.log("patinet-=================",patient)
  1162. if(patient.gender == 1){
  1163. patient.gender_name = "男"
  1164. }
  1165. if(patient.gender == 2){
  1166. patient.gender_name = "女"
  1167. }
  1168. this.patient2 = patient
  1169. console.log('this.patient2',this.patient2);
  1170. var dialysisOrderList =response.data.data.dialysisOrder
  1171. var total_count = 0
  1172. if(dialysisOrderList!=null&&dialysisOrderList.length>0){
  1173. total_count = dialysisOrderList.length
  1174. }
  1175. total_count = this.dialysisOrderList.length
  1176. let dialyzerPerfusionApparatusObj={}
  1177. let dialyzerPerfusionApparatusStr = ""
  1178. let dialyzerArrObj = {}
  1179. let dialyzer_str = ""
  1180. let dialysisStrainerObj = {}
  1181. let dialysisStrainerStr = ""
  1182. let dialysisIrrigationObj = {}
  1183. let dialysisIrrigationStr = ""
  1184. let kaliumObj = {}
  1185. let kaliumStr =""
  1186. let kalium =""
  1187. if(kaliumArr!=null && kaliumArr.length>0){
  1188. kaliumArr.forEach(item => {
  1189. kaliumObj[item] = (kaliumObj[item] + 1) || 1
  1190. })
  1191. }
  1192. if(kaliumObj!=""){
  1193. kaliumStr = JSON.stringify(kaliumObj).replace(/^{|}$/g, '')
  1194. }
  1195. if(kaliumStr!=""){
  1196. var str = kaliumStr.split(":")[0]
  1197. kalium = "钾:" + str.replace(/^"(.*)"$/, '$1')+"."+"0"+"mmol/L" + "(" +kaliumStr.split(":")[1]+")"
  1198. }
  1199. let sodiumObj = {}
  1200. let sodiumStr =""
  1201. let sodium = ""
  1202. if(sodiumArr!=null && sodiumArr.length>0){
  1203. sodiumArr.forEach(item => {
  1204. sodiumObj[item] = (sodiumObj[item] + 1) || 1
  1205. })
  1206. }
  1207. if(sodiumObj!=""){
  1208. sodiumStr = JSON.stringify(sodiumObj).replace(/^{|}$/g, '')
  1209. }
  1210. if(sodiumStr!=""){
  1211. var str = sodiumStr.split(":")[0]
  1212. sodium = "钠:" + str.replace(/^"(.*)"$/, '$1')+"mmol/L" + "(" +sodiumStr.split(":")[1]+")"
  1213. }
  1214. let calciumObj = {}
  1215. let calciumStr =""
  1216. let calcium =""
  1217. if(calciumArr!=null && calciumArr.length>0){
  1218. calciumArr.forEach(item => {
  1219. calciumObj[item] = (calciumObj[item] + 1) || 1
  1220. })
  1221. }
  1222. if(calciumObj!=""){
  1223. calciumStr = JSON.stringify(calciumObj).replace(/^{|}$/g, '')
  1224. }
  1225. if(calciumStr!=""){
  1226. var str = calciumStr.split(":")[0]
  1227. calcium = "钙:" + str.replace(/^"(.*)"$/, '$1')+"mmol/L" + "(" +calciumStr.split(":")[1]+")"
  1228. }
  1229. let bicarbonateObj = {}
  1230. let bicarbonateStr =""
  1231. let bicarbonate = ""
  1232. if(bicarbonateArr!=null && bicarbonateArr.length>0){
  1233. bicarbonateArr.forEach(item => {
  1234. bicarbonateObj[item] = (bicarbonateObj[item] + 1) || 1
  1235. })
  1236. }
  1237. if(bicarbonateObj!=""){
  1238. bicarbonateStr = JSON.stringify(bicarbonateObj).replace(/^{|}$/g, '')
  1239. }
  1240. if(bicarbonateStr!=""){
  1241. var str = bicarbonateStr.split(":")[0]
  1242. bicarbonate = "碳酸氢根:" + str.replace(/^"(.*)"$/, '$1')+"mmol/L" + "(" +bicarbonateStr.split(":")[1]+")"
  1243. }
  1244. if(dialyzerPerfusionApparatus!=null && dialyzerPerfusionApparatus.length>0){
  1245. dialyzerPerfusionApparatus.forEach(item => {
  1246. dialyzerPerfusionApparatusObj[item] = (dialyzerPerfusionApparatusObj[item] + 1) || 1
  1247. })
  1248. }
  1249. if(dialyzerPerfusionApparatus!=null && dialyzerPerfusionApparatus.length>0){
  1250. dialyzerPerfusionApparatus.forEach(item => {
  1251. dialyzerPerfusionApparatusObj[item] = (dialyzerPerfusionApparatusObj[item] + 1) || 1
  1252. })
  1253. }
  1254. if(dialyzerPerfusionApparatusObj!=""){
  1255. dialyzerPerfusionApparatusStr = JSON.stringify(dialyzerPerfusionApparatusObj).replace(/^{|}$/g, '')
  1256. }
  1257. if(dialyzerArr!=null && dialyzerArr.length>0){
  1258. dialyzerArr.forEach(item => {
  1259. dialyzerArrObj[item] = (dialyzerArrObj[item] + 1) || 1
  1260. })
  1261. }
  1262. dialyzer_str = JSON.stringify(dialyzerArrObj).replace(/^{|}$/g, '')
  1263. if(dialysisStrainerArr!=null && dialysisStrainerArr.length>0){
  1264. dialysisStrainerArr.forEach(item => {
  1265. dialysisStrainerObj[item] = (dialysisStrainerObj[item] + 1) || 1
  1266. })
  1267. }
  1268. dialysisStrainerStr = JSON.stringify(dialysisStrainerObj).replace(/^{|}$/g, '')
  1269. if(dialysisIrrigationArr!=null && dialysisIrrigationArr.length>0){
  1270. dialysisIrrigationArr.forEach(item => {
  1271. dialysisIrrigationObj[item] = (dialysisIrrigationObj[item] + 1) || 1
  1272. })
  1273. }
  1274. dialysisIrrigationStr = JSON.stringify(dialysisIrrigationObj).replace(/^{|}$/g, '')
  1275. var longAdvice = response.data.data.longAdvice
  1276. // const contents = `<table border="1" class="table" style="border-collapse: collapse;width: 100%;">
  1277. // <tr>
  1278. // <th colspan="2" style="padding: 5px;">透析阶段小结(${this.start_date } ~${this.end_date })</th>
  1279. // </tr>
  1280. // <tr>
  1281. // <td width="130" style="padding: 5px;">基本信息</td>
  1282. // <td style="padding: 5px;">
  1283. // <span>姓名:${patient.name } </span> <span>性别:${ patient.gender_name }</span> <span>年龄:${ patient.age }</span> <span>透析号:${ patient.dialysis_no }</span>
  1284. // </td>
  1285. // </tr>
  1286. // <tr>
  1287. // <td style="align-items: center;padding: 5px;">透析处方</td>
  1288. // <td style='padding:5px'>
  1289. // <p style='font-weight: bold;'>总次数:${ total_count } ;</p>
  1290. // <p style='margin-bottom: 10px;' >其中${hd_str}${hdf_str}${hdhp_str}${hp_str}${hf_str}${scuf_str}${iuf_str}${hfhd_str}${hfhdhp_str}${phf_str}${hdfhp_str}${crrt_str}${iuf_str}${uf_str}${hdjia_str}${ihdf_str}${hdgaotong_str}${cvvh_str}${cvvhdf_str}${pe_str}${hpd_str}${hfd_str}${hdf100str}${hdf600str}${hdf1000str}${hdf80str}${hf16str}${hdwuganstr}${hdf17str}${hddianstr}${hd2str},平均${total_hour_str},使用${dialyzerPerfusionApparatusStr}${dialyzer_str}${dialysisIrrigationStr}${dialysisStrainerStr};</p>
  1291. // <p style='margin-bottom: 10px;'>${kalium};${sodium};${bicarbonate}</p>
  1292. // <p style='font-weight: bold;'>抗凝方式:</p>
  1293. // <p >低分子肝素,剂量:3500.00~3500.00IU;</p>
  1294. // </td>
  1295. // </tr>
  1296. // <tr>
  1297. // <td style="align-items: center;padding: 5px;">透析情况</td>
  1298. // <td style='padding:5px'>
  1299. // <p>透析间期平均体重增加:2.90kg;</p>
  1300. // <p>凝血:透析器-0度(1次);</p>
  1301. // <p>平均血流量:250.00mL/min;最大血流量:250mL/min;</p>
  1302. // <p>平均超滤量:2900.00ml/次;平均超滤率:9.84mL/kg/h;</p>
  1303. // <p><span style='font-weight: bold;'>透前血压:</span>&nbsp;<span class="">收缩压:174~174mmHg;舒张压:69~69mmHg;</span></p>
  1304. // <p><span style='font-weight: bold;'>透后血压:</span>&nbsp;<span class="">收缩压:155~155mmHg;舒张压:87~87mmHg;</span></p>
  1305. // <p><span style='font-weight: bold;'>透中最低血压:</span>&nbsp;<span class="">收缩压:148~148mmHg;舒张压:56~56mmHg;</span></p>
  1306. // <p><span style='font-weight: bold;'>透中最高血压:</span>&nbsp;<span class="">收缩压:175~175mmHg;舒张压:87~87mmHg;</span></p>
  1307. // </td>
  1308. // </tr>
  1309. // <tr>
  1310. // <td style="align-items: center;padding: 5px;">干体重</td>
  1311. // <td style='padding: 5px;'>
  1312. // <p>
  1313. // <span style='font-weight: bold;'>当前干体重:</span>&nbsp;<span class="">73.7kg;</span>
  1314. // </p>
  1315. // <p>
  1316. // <span style='font-weight: bold;'>调整记录:</span>&nbsp;<span class="">无</span>
  1317. // </p>
  1318. // </td>
  1319. // </tr>
  1320. // <tr>
  1321. // <td style="align-items: center;padding: 5px;">血管通路</td>
  1322. // <td style='padding: 5px;'>
  1323. // <p>
  1324. // <span style='font-weight: bold;'>使用的血管通路:</span>&nbsp;<span class="">${ this.ceshi } &nbsp;&nbsp;建立时间:${ this.ceshi }</span>
  1325. // </p>
  1326. // </td>
  1327. // </tr>
  1328. // <tr>
  1329. // <td style="align-items: center;padding: 5px;">合并症/并发症</td>
  1330. // <td style='padding: 5px;'>
  1331. // <p>
  1332. // <span style='font-weight: bold;'>合并症:</span>&nbsp;<span class="">无</span>
  1333. // </p>
  1334. // <p>
  1335. // <span style='font-weight: bold;'>透析并发症:</span>&nbsp;<span class="">无</span>
  1336. // </p>
  1337. // </td>
  1338. // </tr>
  1339. // <tr>
  1340. // <td style="align-items: center;padding: 5px;">检验结果</td>
  1341. // <td style='padding: 5px;'>
  1342. // <span class="">无</span>
  1343. // </td>
  1344. // </tr>
  1345. // <tr>
  1346. // <td style="align-items: center;padding: 5px;">检查结果</td>
  1347. // <td style='padding: 5px;'>
  1348. // <span class="">无</span>
  1349. // </td>
  1350. // </tr>
  1351. // <tr>
  1352. // <td style="align-items: center;padding: 5px;">医嘱用药</td>
  1353. // <td class='' style="padding: 0;">
  1354. // <p style="display: flex;text-align: center;border-bottom: 1px solid black;">
  1355. // <span style="width: 30%;display: inline-block;padding: 5px 0;border-right: 1px solid black;">药物名称</span><span style="width:20% ;display: inline-block;padding: 5px 0;border-right: 1px solid black;">医嘱类型</span><span style="width: 20%;display: inline-block;padding: 5px 0;border-right: 1px solid black;">开始时间</span><span style="width: 20%;display: inline-block;padding: 5px 0;border-right: 1px solid black;">单次用量</span><span style="width: 20%;display: inline-block;padding: 5px 0;border-right: 1px solid black;">执行频率</span><span style="width: 10%;padding: 5px 0;display: inline-block;">状态</span></p>
  1356. // </td>
  1357. // </tr>
  1358. // <tr>
  1359. // <td style="align-items: center;padding: 5px;">透析总评价和建议</td>
  1360. // <td style='padding: 5px;'>
  1361. // <p class="">1、血压控制不良,随时监测血压,并加用口服降压药,将血压控制在正常范围;</p>
  1362. // <p class="">2、透析间期体重增加稳定,继续保持;</p>
  1363. // <p class="">3、血液透析时血流量达标,注意保护内瘘避免狭窄;</p>
  1364. // </td>
  1365. // </tr>
  1366. // <tr>
  1367. // <td style="align-items: center;padding: 5px;">医师签名</td>
  1368. // <td style='padding: 5px;'>
  1369. // <p class=""></p>
  1370. // </td>
  1371. // </tr>
  1372. // </table>`
  1373. // this.content = contents
  1374. }
  1375. })
  1376. },
  1377. didSelectTemplate: function(templateContent) {
  1378. this.new_content = this.new_content.length > 0 ? (this.new_content + templateContent) : templateContent
  1379. }, didEditSelectTemplate: function(templateContent) {
  1380. this.edit_new_content = this.edit_new_content.length > 0 ? (this.edit_new_content + templateContent) : templateContent
  1381. },
  1382. didSelectionChange: function(selectRows) {
  1383. var arr = []
  1384. for(let i=0;i<selectRows.length;i++){
  1385. arr.push(selectRows[i].id)
  1386. }
  1387. var newArr = arr.join(',')
  1388. this.ids = newArr
  1389. console.log("select23322332",this.ids)
  1390. this.selectingRows = selectRows
  1391. },
  1392. deleteAction(){
  1393. if(this.id == 0){
  1394. this.$message.error("请选择要删除的信息!")
  1395. return false
  1396. }
  1397. this.$confirm('确定要取消吗?', '提示', {
  1398. confirmButtonText: '确定',
  1399. cancelButtonText: '取消',
  1400. type: 'warning'
  1401. }).then(() => {
  1402. deleteNewCouseOfDisease(this.id).then(response=>{
  1403. if (response.data.state==1) {
  1404. var msg = response.data.data.msg
  1405. this.$message.success("删除成功!")
  1406. this.getlist()
  1407. }
  1408. });
  1409. }).catch(() => {
  1410. });
  1411. },
  1412. showEdit() {
  1413. this.add_index =1
  1414. this.disabled = false
  1415. }, tableRow({ row, rowIndex }) {
  1416. // 把每一行的索引放进row
  1417. row.index = rowIndex
  1418. }, onRowClick(row, event, column) {
  1419. this.table_current_index = row.index
  1420. },
  1421. print(){
  1422. if(this.ids.length == 0){
  1423. this.$message.error('请选择要打印的病程')
  1424. return
  1425. }
  1426. this.$router.push({ path: "/course/print?ids="+this.ids+"&patient_id="+this.patient_id});
  1427. },
  1428. getModeId(mode_id){
  1429. var mode_name = ""
  1430. if(mode_id == 1){
  1431. mode_name ="HD"
  1432. }
  1433. if(mode_id == 2){
  1434. mode_name ="HDF"
  1435. }
  1436. if(mode_id == 3){
  1437. mode_name ="HD+HP"
  1438. }
  1439. if(mode_id == 4){
  1440. mode_name ="HP"
  1441. }
  1442. if(mode_id == 5){
  1443. mode_name ="HF"
  1444. }
  1445. if(mode_id == 6){
  1446. mode_name ="SCUF"
  1447. }
  1448. if(mode_id == 7){
  1449. mode_name ="IUF"
  1450. }
  1451. if(mode_id == 8){
  1452. mode_name ="HFHD"
  1453. }
  1454. if(mode_id == 9){
  1455. mode_name ="HFHD+HP"
  1456. }
  1457. if(mode_id == 10){
  1458. mode_name ="PHF"
  1459. }
  1460. if(mode_id == 11){
  1461. mode_name ="HFR"
  1462. }
  1463. if(mode_id == 12){
  1464. mode_name ="HDF+HP"
  1465. }
  1466. if(mode_id == 13){
  1467. mode_name ="CRRT"
  1468. }
  1469. if(mode_id == 14){
  1470. mode_name ="腹水回输"
  1471. }
  1472. if(mode_id == 19){
  1473. mode_name ="IUF+HD"
  1474. }
  1475. if(mode_id == 20){
  1476. mode_name ="UF"
  1477. }
  1478. if(mode_id == 21){
  1479. mode_name ="HD+"
  1480. }
  1481. if(mode_id == 22){
  1482. mode_name ="血浆胆红素吸附+HDF"
  1483. }
  1484. if(mode_id == 23){
  1485. mode_name ="血浆胆红素吸附"
  1486. }
  1487. if(mode_id == 24){
  1488. mode_name ="I-HDF"
  1489. }
  1490. if(mode_id == 25){
  1491. mode_name ="HD高通"
  1492. }
  1493. if(mode_id == 26){
  1494. mode_name ="CVVH"
  1495. }
  1496. if(mode_id == 27){
  1497. mode_name ="CVVHD"
  1498. }
  1499. if(mode_id == 28){
  1500. mode_name ="CVVHDF"
  1501. }
  1502. if(mode_id == 29){
  1503. mode_name ="PE"
  1504. }
  1505. if(mode_id == 30){
  1506. mode_name ="血浆胆红素吸附+HP"
  1507. }
  1508. if(mode_id == 31){
  1509. mode_name ="HPD"
  1510. }
  1511. if(mode_id == 32){
  1512. mode_name ="HDP"
  1513. }
  1514. return mode_name
  1515. },
  1516. GetAnticoagulant(id){
  1517. var anticoagulant_name = ""
  1518. if(id == 1){
  1519. anticoagulant_name = "无肝素"
  1520. }
  1521. if(id == 2){
  1522. anticoagulant_name = "普通肝素"
  1523. }
  1524. if(id == 3){
  1525. anticoagulant_name = "低分子肝素"
  1526. }
  1527. if(id == 4){
  1528. anticoagulant_name = "阿加曲班"
  1529. }
  1530. if(id == 5){
  1531. anticoagulant_name = "枸橼酸钠"
  1532. }
  1533. if(id == 6){
  1534. anticoagulant_name = "低分子肝素钙"
  1535. }
  1536. if(id == 7){
  1537. anticoagulant_name = "低分子肝素钠"
  1538. }
  1539. if(id == 8){
  1540. anticoagulant_name = "依诺肝素"
  1541. }
  1542. if(id == 9){
  1543. anticoagulant_name = "达肝素"
  1544. }
  1545. if(id == 10){
  1546. anticoagulant_name = "体外抗凝"
  1547. }
  1548. if(id == 11){
  1549. anticoagulant_name = "那屈肝素"
  1550. }
  1551. if(id == 12){
  1552. anticoagulant_name = "无抗凝剂"
  1553. }
  1554. if(id == 13){
  1555. anticoagulant_name = "那屈肝素钙"
  1556. }
  1557. if(id == 14){
  1558. anticoagulant_name = "肝素钙注射液"
  1559. }
  1560. if(id == 15){
  1561. anticoagulant_name = "甲磺酸萘莫司他"
  1562. }
  1563. return anticoagulant_name
  1564. },
  1565. getTime (time) {
  1566. return uParseTime(time, '{y}-{m}-{d}')
  1567. },
  1568. getTimeOne (time) {
  1569. return uParseTime(time, '{y}-{m}-{d}')
  1570. },
  1571. newcontent(val){
  1572. this.new_content =''
  1573. this.new_content = val
  1574. // console.log('1111112323',this.new_content);
  1575. this.$refs.editor.contents = this.new_content
  1576. }
  1577. },
  1578. }
  1579. </script>
  1580. <style rel="stylesheet/css" lang="scss" scoped>
  1581. .container {
  1582. margin-left: 180px;
  1583. padding: 20px;
  1584. background: #fff;
  1585. min-height: calc(100vh - 173px);
  1586. margin-bottom: 15px;
  1587. .record {
  1588. padding-top: 20px;
  1589. }
  1590. }
  1591. .record_content_panel {
  1592. border-width: 1px;
  1593. border-style: solid;
  1594. border-color: #ebeef5;
  1595. min-height: 200px;
  1596. .title {
  1597. font-size: 14px;
  1598. font-weight: 500;
  1599. color: #909399;
  1600. line-height: 44px;
  1601. height: 44px;
  1602. text-align: center;
  1603. border-bottom-width: 1px;
  1604. border-bottom-style: solid;
  1605. border-bottom-color: #ebeef5;
  1606. }
  1607. .content {
  1608. padding: 12px 15px;
  1609. font-size: 15px;
  1610. color: gray;
  1611. line-height: 22px;
  1612. }
  1613. }
  1614. .new_record_form {
  1615. /*/ / padding: 10 px, 25 px;*/
  1616. .textarea_panel {
  1617. margin-top: 10px;
  1618. }
  1619. }
  1620. .eldialog{
  1621. .el-dialog{
  1622. .el-dialog__body{
  1623. max-height: calc(100vh - 80px) !important;
  1624. padding: 0px 20px;
  1625. }
  1626. }
  1627. }
  1628. .Second_title{
  1629. border-left: 5px solid #3891f1f5;
  1630. text-align: left;
  1631. padding-left: 5px;
  1632. // margin-left: 10px;
  1633. margin-bottom: 5px;
  1634. font-size: 16px;
  1635. }
  1636. .text_margin{
  1637. display: block;
  1638. }
  1639. </style>
  1640. <style lang="scss">
  1641. .el-table td,
  1642. .el-table th.is-leaf,
  1643. .el-table--border,
  1644. .el-table--group {
  1645. border-color: #d0d3da;
  1646. }
  1647. .el-table--border::after,
  1648. .el-table--group::after,
  1649. .el-table::before {
  1650. background-color: #d0d3da;
  1651. }
  1652. .eldialog{
  1653. .el-dialog{
  1654. .el-dialog__body{
  1655. max-height: calc(100vh - 80px) !important;
  1656. padding: 0px 20px;
  1657. }
  1658. }
  1659. }
  1660. .lirary{
  1661. .el-dialog__body{
  1662. padding: 0px 20px !important;
  1663. }
  1664. .el-dialog__footer{
  1665. text-align: center;
  1666. }
  1667. }
  1668. .course{
  1669. .el-dialog{
  1670. height: 90%;
  1671. // position: fixed !important;
  1672. // top: 10% !important;
  1673. }
  1674. }
  1675. </style>