courseOfDisease_new.vue 36KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168
  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" :prescription="prescription" :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" :longAdvice="longAdvice" :groupPrescriptionList="groupPrescriptionList"></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. prescription:[],
  335. berforList:[],
  336. monitorList:[],
  337. dryweightList:[],
  338. inpectionList:[],
  339. dialysisOrderList:[],
  340. patient:{},
  341. AuToShow:false,
  342. num:"",
  343. longAdvice:[],
  344. groupPrescriptionList:[]
  345. }
  346. },
  347. created() {
  348. this.admin_user_id = this.$store.getters.xt_user.user.id
  349. this.patient_id = parseInt(this.$route.query.id)
  350. this.org_id = this.$store.getters.xt_user.template_info.org_id;
  351. if (isNaN(this.patient_id) || this.patient_id <= 0) {
  352. this.$notify.error({
  353. title: '错误',
  354. message: '无效的id'
  355. })
  356. this.$router.push('/patients/patients')
  357. return
  358. }
  359. // const ceshi = ``
  360. // // const ceshi=`hellow word`
  361. // this.new_content = ceshi
  362. // this.$refs.editor.contents=ceshi
  363. this.fetchAllDoctorAndNurse()
  364. this.getlist()
  365. },
  366. methods: {
  367. changStartDate(val){
  368. this.start_date = val
  369. },
  370. changEndDate(val){
  371. this.end_date = val
  372. },
  373. datachange(val){
  374. if(val ==1){
  375. this.start_date = this.getFirstDayOfWeek(new Date())
  376. this.end_date = this.getTime(new Date())
  377. }else if(val ==2){
  378. this.getlastweek(new Date())
  379. }else if(val ==3){
  380. this.start_date = this.getFirstDayOfMonth(new Date())
  381. this.end_date = this.getTime(new Date())
  382. }else if(val ==4){
  383. this.getLastMonthFirstDay()
  384. this.getLastMonthLastDay()
  385. }
  386. },
  387. toContentPint(){
  388. this.$refs.editor.contents = this.template_content
  389. this.library_dialog = false
  390. },
  391. getCurrentChangeOne(val){
  392. this.$refs.editor.contents = val.content
  393. this.record_date = this.getTime(val.record_time)
  394. this.id = val.id
  395. },
  396. getCurrentChangeTwo(val){
  397. this.$refs.editorOne.contents = val.content
  398. this.template_content = ""
  399. this.template_content = val.content
  400. this.template_id = val.id
  401. },
  402. template_dele(){
  403. deleteCourseTempalte(this.template_id).then(response=>{
  404. if(response.data.state == 1){
  405. var msg = response.data.data.msg
  406. this.$message.success("删除成功!")
  407. this.library_dialog = false
  408. this.getPatientCoureOfTempalateOne()
  409. }
  410. })
  411. },
  412. getPatientCoureOfTempalateOne(){
  413. },
  414. rowclick(){
  415. },
  416. prints(){
  417. },
  418. saveTemplate(){
  419. var params = {
  420. title:this.title,
  421. content: this.$refs.editor.contents,
  422. }
  423. saveCoureseTemplateTitle(params).then(response=>{
  424. if(response.data.state == 1){
  425. var courseTemplate = response.data.data.courseTemplate
  426. this.$message.success("保存成功!")
  427. this.template_dialog = false
  428. }
  429. })
  430. },
  431. template_save(){
  432. var params = {
  433. template_id:this.template_id,
  434. content:this.$refs.editorOne.contents
  435. }
  436. saveCourseOfNewTemplate(params).then(response=>{
  437. if(response.data.state == 1){
  438. var msg = response.data.data.msg
  439. this.$message.success("保存成功")
  440. this.library_dialog = false
  441. }
  442. })
  443. },
  444. getDocName(admin_user_id){
  445. var user_name = ""
  446. for(let i=0;i<this.doctorOptions.length;i++){
  447. if(admin_user_id == this.doctorOptions[i].id){
  448. user_name = this.doctorOptions[i].name
  449. }
  450. }
  451. return user_name
  452. },
  453. getlist(){
  454. var params = {
  455. patient_id:this.patient_id
  456. }
  457. getPatientCourseOfDiseaseList(params).then(response=>{
  458. if(response.data.state == 1){
  459. var list = response.data.data.list
  460. this.tableData = []
  461. this.tableData = list
  462. }
  463. })
  464. },
  465. fetchAllDoctorAndNurse() {
  466. fetchAllDoctorAndNurse().then(response => {
  467. if (response.data.state == 1) {
  468. this.doctorOptions= []
  469. this.doctorOptions = response.data.data.doctors;
  470. }
  471. });
  472. },
  473. add_click(){
  474. this.admin_user_id = ""
  475. this.admin_user_id = this.$store.getters.xt_user.user.id
  476. this.fetchAllDoctorAndNurse()
  477. this.$refs.editor.contents = ""
  478. this.id = 0
  479. this.disabled = false
  480. this.add_index = 1
  481. },
  482. showCancel(){
  483. this.add_index = 0
  484. this.disabled = true
  485. },
  486. showSave(){
  487. this.add_index = 0
  488. this.disabled = true
  489. console.log("haaaaaaaaaaaaaaa",this.$refs)
  490. this.new_content = this.$refs.editor.contents
  491. if (this.new_content.length == 0) {
  492. this.$message.error('请填写病程内容')
  493. return
  494. }
  495. var params = {
  496. id:this.id,
  497. patient_id:this.patient_id,
  498. record_date:this.record_date,
  499. content:this.new_content,
  500. admin_user_id:this.admin_user_id,
  501. }
  502. console.log("params",params)
  503. createNewCourseOfDiseaseRecord(params).then(response => {
  504. if(response.data.state == 1){
  505. var msg = response.data.data.msg
  506. this.$message.success("保存成功!")
  507. this.getlist()
  508. }
  509. }).catch(error => {
  510. })
  511. },
  512. template_click(){
  513. console.log('this.add_index',this.add_index);
  514. if(this.add_index ==0){
  515. this.template_dialog = true
  516. }else{
  517. getPatientCoureOfTempalate().then(response=>{
  518. if(response.data.state == 1){
  519. this.library_dialog = true
  520. this.templateList = response.data.data.templateList
  521. console.log("hahhahahaha",this.$refs)
  522. if(this.templateList!=null && this.templateList.length>0){
  523. this.$refs.record_table_one.setCurrentRow(this.templateList[0])
  524. }
  525. console.log("haaaaaaaaaaaaa",this.templateList)
  526. }
  527. })
  528. }
  529. },
  530. auto_click(){
  531. this.start_date = this.getFirstDayOfWeek(new Date())
  532. this.end_date = this.getTime(new Date())
  533. this.getAutoPatientContent()
  534. // this.auto_dialog = true
  535. },
  536. autotext_click(){
  537. // this.$nextTick(()=>{
  538. // const iframeDoc = document.getElementsByClassName('edui-editor-iframeholder')[0].getElementsByTagName('iframe')[0].contentDocument.getElementsByTagName('tbody')[0].children[9].children[1]
  539. // var newListArr =[]
  540. // for(let j in this.tab){
  541. // const obj={
  542. // id:this.tab[j].id,
  543. // newlist:'newList'+j
  544. // }
  545. // newListArr.push(obj)
  546. // }
  547. // for(let i in this.tab){
  548. // for(let j in newListArr){
  549. // if(this.tab[i].id==newListArr[j].id){
  550. // let newList = document.createElement('p');
  551. // newList.style.cssText='display: flex;text-align: center;border-bottom: 1px solid black;';
  552. // let newListItem1 = document.createElement('span');
  553. // newListItem1.style.cssText= 'width: 30%;display: inline-block;padding: 5px 0;border-right: 1px solid black;'
  554. // let newListItem2 = document.createElement('span');
  555. // newListItem2.style.cssText= 'width: 20%;display: inline-block;padding: 5px 0;border-right: 1px solid black;'
  556. // let newListItem3 = document.createElement('span');
  557. // newListItem3.style.cssText= 'width: 20%;display: inline-block;padding: 5px 0;border-right: 1px solid black;'
  558. // let newListItem4 = document.createElement('span');
  559. // newListItem4.style.cssText= 'width: 20%;display: inline-block;padding: 5px 0;border-right: 1px solid black;'
  560. // let newListItem5 = document.createElement('span');
  561. // newListItem5.style.cssText= 'width: 20%;display: inline-block;padding: 5px 0;border-right: 1px solid black;'
  562. // let newListItem6 = document.createElement('span');
  563. // newListItem6.style.cssText= 'width: 10%;display: inline-block;padding: 5px 0;'
  564. // newListItem1.textContent = this.tab[i].name;
  565. // newListItem2.textContent = this.tab[i].type;
  566. // newListItem3.textContent = this.tab[i].start;
  567. // newListItem4.textContent = this.tab[i].dosage;
  568. // newListItem5.textContent = this.tab[i].pinlv;
  569. // newListItem6.textContent = this.tab[i].status;
  570. // newList.appendChild(newListItem1);
  571. // newList.appendChild(newListItem2);
  572. // newList.appendChild(newListItem3);
  573. // newList.appendChild(newListItem4);
  574. // newList.appendChild(newListItem5);
  575. // newList.appendChild(newListItem6);
  576. // iframeDoc.appendChild(newList)
  577. // }
  578. // }
  579. // }
  580. // })
  581. this.AuToShow = true
  582. // this.getAutoPatientContent()
  583. },
  584. // 本周
  585. getFirstDayOfWeek(date){
  586. var weekday = date.getDay()
  587. date.setDate(date.getDate()-weekday+1);//往前算(weekday-1)天,年份、月份会自动变化
  588. return this.timeFormat(date);
  589. },
  590. // 上周
  591. getlastweek(date){
  592. date.setDate(date.getDate()-7 - date.getDay() + 1);
  593. var m =''
  594. var d = ''
  595. if(date.getMonth() + 1<10){
  596. m = '0'+(date.getMonth() + 1)
  597. }else{
  598. m = date.getMonth() + 1
  599. }
  600. if(date.getDate()<10){
  601. d = '0'+date.getDate()
  602. }else{
  603. d = date.getDate()
  604. }
  605. // this.start_date = date.getFullYear() + "-" + (date.getMonth() + 1) + "-" + date.getDate() ;
  606. this.start_date = date.getFullYear() + "-" + m + "-" + d ;
  607. date.setDate(date.getDate() +6);
  608. var mm = ''
  609. var dd = ''
  610. if(date.getMonth() + 1<10){
  611. mm = '0'+(date.getMonth() + 1)
  612. }else{
  613. mm = date.getMonth() + 1
  614. }
  615. if(date.getDate()<10){
  616. dd = '0'+date.getDate()
  617. }else{
  618. dd = date.getDate()
  619. }
  620. // if(date.getMonth() + 1<10)
  621. // this.end_date = date.getFullYear() + "-" + (date.getMonth() + 1) + "-" + date.getDate();
  622. this.end_date = date.getFullYear() + "-" + mm + "-" + dd ;
  623. console.log('this.end_date',this.end_date);
  624. },
  625. // 本月
  626. getFirstDayOfMonth (date) {
  627. date.setDate(1);
  628. return this.timeFormat(date);
  629. },
  630. //上个月第一天
  631. getLastMonthFirstDay() {
  632. var date = new Date();
  633. date.setDate(0);
  634. var y = date.getFullYear(); //获取年份
  635. var m = date.getMonth() + 1; //获取月份
  636. m = m < 10 ? "0" + m : m;
  637. this.start_date = [y, m, '01'].join("-")
  638. // return [y, m, '01'].join("-");
  639. },
  640. // 上个月最后一天
  641. getLastMonthLastDay() {
  642. var date = new Date();
  643. date.setDate(0);
  644. var y = date.getFullYear(); //获取年份
  645. var m = date.getMonth() + 1; //获取月份
  646. var d = new Date(y, m, 0).getDate(); //获取当月最后一日
  647. m = m < 10 ? "0" + m : m; //月份补 0
  648. d = d < 10 ? "0" + d : d; //日数补 0
  649. this.end_date = [y, m, d].join("-")
  650. // return [y, m, d].join("-");
  651. },
  652. // 日期格式化
  653. timeFormat(date) {
  654. if (!date || typeof(date) === "string") {
  655. this.error("参数异常,请检查...");
  656. }
  657. var y = date.getFullYear(); //年
  658. if(date.getMonth() + 1<10){
  659. var m ='0'+(date.getMonth() + 1); //月
  660. }else{
  661. var m =date.getMonth() + 1; //月
  662. }
  663. if(date.getDate()<10){
  664. var d ='0'+date.getDate(); //日
  665. }else{
  666. var d = date.getDate(); //日
  667. }
  668. // var d = date.getDate(); //日
  669. return y + "-" + m + "-" + d;
  670. },
  671. requestCourseRecords: function() {
  672. this.loading = true
  673. getCourseOfDiseaseRecords(this.patient_id, this.start_time, this.end_time).then(rs => {
  674. this.loading = false
  675. var resp = rs.data
  676. if (resp.state == 1) {
  677. this.current_select_record = null
  678. this.records = resp.data.records
  679. console.log("records232322332323232323223",this.records)
  680. this.doctors = resp.data.doctors
  681. } else {
  682. this.$message.error(resp.msg)
  683. }
  684. }).catch(error => {
  685. this.loading = false
  686. this.$message.error(error)
  687. })
  688. },
  689. didChangeCurrentRecord: function(record) {
  690. this.current_select_record = record
  691. },
  692. recordTime: function(timestamp) {
  693. var time = new Date(timestamp * 1000)
  694. return parseTime(time, '{y}-{m}-{d} {h}:{i}:{s}')
  695. },
  696. doctorName: function(doctor_id) {
  697. for (let index = 0; index < this.doctors.length; index++) {
  698. const doctor = this.doctors[index]
  699. if (doctor.id == doctor_id) {
  700. return doctor.name
  701. }
  702. }
  703. return ''
  704. },
  705. modifyAction: function() {
  706. this.edit_new_content = this.$refs.edit_neditor.content
  707. if (this.edit_new_content.length == 0) {
  708. this.$message.error('请填写病程内容')
  709. return
  710. }
  711. this.uploading_new_record = true
  712. modifyCourseOfDiseaseRecord(this.patient_id, this.edit_new_content, this.edit_course_of_disease_time, this.edit_current_id, this.edit_title).then(rs => {
  713. this.uploading_new_record = false
  714. var resp = rs.data
  715. if (resp.state == 1) {
  716. this.records[this.table_current_index].content = resp.data.record.content
  717. this.records[this.table_current_index].record_time = resp.data.record.record_time
  718. this.records[this.table_current_index].recorder = resp.data.record.recorder
  719. this.records[this.table_current_index].title = resp.data.record.title
  720. this.show_edit_dialog = false
  721. this.edit_new_content = ''
  722. this.table_current_index = -1
  723. } else {
  724. this.table_current_index = -1
  725. this.$message.error(resp.msg)
  726. }
  727. }).catch(error => {
  728. this.table_current_index = -1
  729. this.uploading_new_record = false
  730. this.$message.error(error)
  731. })
  732. },
  733. getAutoPatientContent(){
  734. if(this.start_date == ""){
  735. this.$message.error("请选择开始时间")
  736. }
  737. if(this.end_date == ""){
  738. this.$message.error("请选择结束时间")
  739. }
  740. var params = {
  741. start_time:this.start_date,
  742. end_time:this.end_date,
  743. patient_id:this.patient_id,
  744. }
  745. console.log("start_time==============",params)
  746. getAutoPatientContent(params).then(response=>{
  747. if(response.data.state == 1){
  748. var prescription = response.data.data.prescription
  749. this.prescription=[]
  750. this.prescription = prescription
  751. var berfor = response.data.data.berfor
  752. this.berforList = []
  753. this.berforList = berfor
  754. var monitorList = response.data.data.monitorList
  755. this.monitorList = []
  756. this.monitorList = monitorList
  757. var dryweightList = response.data.data.dryweightList
  758. this.dryweightList = []
  759. this.dryweightList = dryweightList
  760. var inpectionList = response.data.data.inpectionList
  761. this.inpectionList = []
  762. this.inpectionList = inpectionList
  763. var patient = response.data.data.patient
  764. if(patient.gender == 1){
  765. patient.gender_name = "男"
  766. }
  767. if(patient.gender == 2){
  768. patient.gender_name = "女"
  769. }
  770. this.patient = patient
  771. var dialysisOrderList =response.data.data.dialysisOrder
  772. this.dialysisOrderList = []
  773. this.dialysisOrderList = dialysisOrderList
  774. var longAdvice = response.data.data.longAdvice
  775. this.longAdvice = []
  776. this.longAdvice = longAdvice
  777. this.groupPrescriptionList = response.data.data.groupPrescriptionList
  778. this.auto_dialog = true
  779. }
  780. })
  781. },
  782. didSelectTemplate: function(templateContent) {
  783. this.new_content = this.new_content.length > 0 ? (this.new_content + templateContent) : templateContent
  784. }, didEditSelectTemplate: function(templateContent) {
  785. this.edit_new_content = this.edit_new_content.length > 0 ? (this.edit_new_content + templateContent) : templateContent
  786. },
  787. didSelectionChange: function(selectRows) {
  788. var arr = []
  789. for(let i=0;i<selectRows.length;i++){
  790. arr.push(selectRows[i].id)
  791. }
  792. var newArr = arr.join(',')
  793. this.ids = newArr
  794. console.log("select23322332",this.ids)
  795. this.selectingRows = selectRows
  796. },
  797. deleteAction(){
  798. if(this.id == 0){
  799. this.$message.error("请选择要删除的信息!")
  800. return false
  801. }
  802. this.$confirm('确定要取消吗?', '提示', {
  803. confirmButtonText: '确定',
  804. cancelButtonText: '取消',
  805. type: 'warning'
  806. }).then(() => {
  807. deleteNewCouseOfDisease(this.id).then(response=>{
  808. if (response.data.state==1) {
  809. var msg = response.data.data.msg
  810. this.$message.success("删除成功!")
  811. this.getlist()
  812. }
  813. });
  814. }).catch(() => {
  815. });
  816. },
  817. showEdit() {
  818. this.add_index =1
  819. this.disabled = false
  820. }, tableRow({ row, rowIndex }) {
  821. // 把每一行的索引放进row
  822. row.index = rowIndex
  823. }, onRowClick(row, event, column) {
  824. this.table_current_index = row.index
  825. },
  826. print(){
  827. if(this.ids.length == 0){
  828. this.$message.error('请选择要打印的病程')
  829. return
  830. }
  831. this.$router.push({ path: "/course/print?ids="+this.ids+"&patient_id="+this.patient_id});
  832. },
  833. getModeId(mode_id){
  834. var mode_name = ""
  835. if(mode_id == 1){
  836. mode_name ="HD"
  837. }
  838. if(mode_id == 2){
  839. mode_name ="HDF"
  840. }
  841. if(mode_id == 3){
  842. mode_name ="HD+HP"
  843. }
  844. if(mode_id == 4){
  845. mode_name ="HP"
  846. }
  847. if(mode_id == 5){
  848. mode_name ="HF"
  849. }
  850. if(mode_id == 6){
  851. mode_name ="SCUF"
  852. }
  853. if(mode_id == 7){
  854. mode_name ="IUF"
  855. }
  856. if(mode_id == 8){
  857. mode_name ="HFHD"
  858. }
  859. if(mode_id == 9){
  860. mode_name ="HFHD+HP"
  861. }
  862. if(mode_id == 10){
  863. mode_name ="PHF"
  864. }
  865. if(mode_id == 11){
  866. mode_name ="HFR"
  867. }
  868. if(mode_id == 12){
  869. mode_name ="HDF+HP"
  870. }
  871. if(mode_id == 13){
  872. mode_name ="CRRT"
  873. }
  874. if(mode_id == 14){
  875. mode_name ="腹水回输"
  876. }
  877. if(mode_id == 19){
  878. mode_name ="IUF+HD"
  879. }
  880. if(mode_id == 20){
  881. mode_name ="UF"
  882. }
  883. if(mode_id == 21){
  884. mode_name ="HD+"
  885. }
  886. if(mode_id == 22){
  887. mode_name ="血浆胆红素吸附+HDF"
  888. }
  889. if(mode_id == 23){
  890. mode_name ="血浆胆红素吸附"
  891. }
  892. if(mode_id == 24){
  893. mode_name ="I-HDF"
  894. }
  895. if(mode_id == 25){
  896. mode_name ="HD高通"
  897. }
  898. if(mode_id == 26){
  899. mode_name ="CVVH"
  900. }
  901. if(mode_id == 27){
  902. mode_name ="CVVHD"
  903. }
  904. if(mode_id == 28){
  905. mode_name ="CVVHDF"
  906. }
  907. if(mode_id == 29){
  908. mode_name ="PE"
  909. }
  910. if(mode_id == 30){
  911. mode_name ="血浆胆红素吸附+HP"
  912. }
  913. if(mode_id == 31){
  914. mode_name ="HPD"
  915. }
  916. if(mode_id == 32){
  917. mode_name ="HDP"
  918. }
  919. return mode_name
  920. },
  921. GetAnticoagulant(id){
  922. var anticoagulant_name = ""
  923. if(id == 1){
  924. anticoagulant_name = "无肝素"
  925. }
  926. if(id == 2){
  927. anticoagulant_name = "普通肝素"
  928. }
  929. if(id == 3){
  930. anticoagulant_name = "低分子肝素"
  931. }
  932. if(id == 4){
  933. anticoagulant_name = "阿加曲班"
  934. }
  935. if(id == 5){
  936. anticoagulant_name = "枸橼酸钠"
  937. }
  938. if(id == 6){
  939. anticoagulant_name = "低分子肝素钙"
  940. }
  941. if(id == 7){
  942. anticoagulant_name = "低分子肝素钠"
  943. }
  944. if(id == 8){
  945. anticoagulant_name = "依诺肝素"
  946. }
  947. if(id == 9){
  948. anticoagulant_name = "达肝素"
  949. }
  950. if(id == 10){
  951. anticoagulant_name = "体外抗凝"
  952. }
  953. if(id == 11){
  954. anticoagulant_name = "那屈肝素"
  955. }
  956. if(id == 12){
  957. anticoagulant_name = "无抗凝剂"
  958. }
  959. if(id == 13){
  960. anticoagulant_name = "那屈肝素钙"
  961. }
  962. if(id == 14){
  963. anticoagulant_name = "肝素钙注射液"
  964. }
  965. if(id == 15){
  966. anticoagulant_name = "甲磺酸萘莫司他"
  967. }
  968. return anticoagulant_name
  969. },
  970. getTime (time) {
  971. return uParseTime(time, '{y}-{m}-{d}')
  972. },
  973. getTimeOne (time) {
  974. return uParseTime(time, '{y}-{m}-{d}')
  975. },
  976. newcontent(val){
  977. this.new_content =''
  978. this.new_content = val
  979. // console.log('1111112323',this.new_content);
  980. this.$refs.editor.contents = this.new_content
  981. }
  982. },
  983. }
  984. </script>
  985. <style rel="stylesheet/css" lang="scss" scoped>
  986. .container {
  987. margin-left: 180px;
  988. padding: 20px;
  989. background: #fff;
  990. min-height: calc(100vh - 173px);
  991. margin-bottom: 15px;
  992. .record {
  993. padding-top: 20px;
  994. }
  995. }
  996. .record_content_panel {
  997. border-width: 1px;
  998. border-style: solid;
  999. border-color: #ebeef5;
  1000. min-height: 200px;
  1001. .title {
  1002. font-size: 14px;
  1003. font-weight: 500;
  1004. color: #909399;
  1005. line-height: 44px;
  1006. height: 44px;
  1007. text-align: center;
  1008. border-bottom-width: 1px;
  1009. border-bottom-style: solid;
  1010. border-bottom-color: #ebeef5;
  1011. }
  1012. .content {
  1013. padding: 12px 15px;
  1014. font-size: 15px;
  1015. color: gray;
  1016. line-height: 22px;
  1017. }
  1018. }
  1019. .new_record_form {
  1020. /*/ / padding: 10 px, 25 px;*/
  1021. .textarea_panel {
  1022. margin-top: 10px;
  1023. }
  1024. }
  1025. .eldialog{
  1026. .el-dialog{
  1027. .el-dialog__body{
  1028. max-height: calc(100vh - 80px) !important;
  1029. padding: 0px 20px;
  1030. }
  1031. }
  1032. }
  1033. .Second_title{
  1034. border-left: 5px solid #3891f1f5;
  1035. text-align: left;
  1036. padding-left: 5px;
  1037. // margin-left: 10px;
  1038. margin-bottom: 5px;
  1039. font-size: 16px;
  1040. }
  1041. .text_margin{
  1042. display: block;
  1043. }
  1044. </style>
  1045. <style lang="scss">
  1046. .el-table td,
  1047. .el-table th.is-leaf,
  1048. .el-table--border,
  1049. .el-table--group {
  1050. border-color: #d0d3da;
  1051. }
  1052. .el-table--border::after,
  1053. .el-table--group::after,
  1054. .el-table::before {
  1055. background-color: #d0d3da;
  1056. }
  1057. .eldialog{
  1058. .el-dialog{
  1059. .el-dialog__body{
  1060. max-height: calc(100vh - 80px) !important;
  1061. padding: 0px 20px;
  1062. }
  1063. }
  1064. }
  1065. .lirary{
  1066. .el-dialog__body{
  1067. padding: 0px 20px !important;
  1068. }
  1069. .el-dialog__footer{
  1070. text-align: center;
  1071. }
  1072. }
  1073. .course{
  1074. .el-dialog{
  1075. height: 90%;
  1076. // position: fixed !important;
  1077. // top: 10% !important;
  1078. }
  1079. }
  1080. </style>