Elizabeth's proactive approach involves introducing urinal toilet attachment , an ingenious concept that optimizes space and functionality.

courseOfDisease.vue 18KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514
  1. <template>
  2. <!-- <div class="main-contain">
  3. <div class="position">
  4. <bread-crumb></bread-crumb>
  5. </div> -->
  6. <div class="patient-container">
  7. <patient-sidebar :id="patient_id" defaultActive="1-2"></patient-sidebar>
  8. <!-- <div class="app-container"> -->
  9. <div v-loading="loading">
  10. <div class="patient-app-container advice-container app-container">
  11. <div>
  12. <span style="margin-left: 10px;float:right;">
  13. <el-button type="primary" icon="el-icon-circle-plus-outline" size="small"
  14. @click="show_dialog = true">新增</el-button>
  15. <el-button type="primary" icon="el-icon-edit-outline" size="small"
  16. @click="showEdit">修改</el-button>
  17. <el-button type="primary" icon="el-icon-printer" size="small"
  18. @click="print">打印</el-button>
  19. <el-button size="small" v-show="selectingRows.length > 0" type="danger"
  20. @click="deleteAction">删除</el-button>
  21. </span>
  22. <!--<span class="filter_title">日期查询</span>-->
  23. <!--<el-date-picker size="small" v-model="date" type="daterange" range-separator="至" start-placeholde="开始日期" end-placeholde="结束日期" value-format="timestamp" :clearable="false" @change="requestCourseRecords()"></el-date-picker>-->
  24. </div>
  25. <!--<div></div>-->
  26. <div class="cell clearfix">
  27. <label class="title"><span class="name">日期查询</span> : </label>
  28. <el-date-picker v-model="start_time" prefix-icon="el-icon-date" :editable="false" style="width: 196px;"
  29. type="date" placeholder="选择日期时间" align="right" format="yyyy-MM-dd"
  30. value-format="yyyy-MM-dd" @change="startTimeChange"></el-date-picker>
  31. <span class="">-</span>
  32. <el-date-picker v-model="end_time" prefix-icon="el-icon-date" :editable="false" style="width: 196px;"
  33. type="date" placeholder="选择日期时间" align="right" format="yyyy-MM-dd"
  34. value-format="yyyy-MM-dd" @change="endTimeChange"></el-date-picker>
  35. </div>
  36. <div class="record">
  37. <el-row :gutter="15">
  38. <el-col :span="10">
  39. <el-table :header-cell-style="{
  40. backgroundColor: 'rgb(245, 247, 250)',
  41. color: '#606266'
  42. }"
  43. :row-style="{ color: '#303133' }" ref="record_table" :data="records"
  44. border highlight-current-row @current-change="didChangeCurrentRecord"
  45. @selection-change="didSelectionChange"
  46. :row-class-name="tableRow"
  47. @row-click="onRowClick"
  48. >
  49. <el-table-column type="selection" width="40" align="center"></el-table-column>
  50. <el-table-column label="病程标题" align="center">
  51. <template slot-scope="scope">
  52. {{ scope.row.title}}
  53. </template>
  54. </el-table-column>
  55. <el-table-column label="记录时间" align="center">
  56. <template slot-scope="scope">
  57. {{ recordTime(scope.row.record_time) }}
  58. </template>
  59. </el-table-column>
  60. <el-table-column label="记录医生" align="center">
  61. <template slot-scope="scope">
  62. {{ doctorName(scope.row.recorder) }}
  63. </template>
  64. </el-table-column>
  65. </el-table>
  66. </el-col>
  67. <el-col :span="14">
  68. <div class="record_content_panel">
  69. <div style="background-color:rgb(245, 247, 250)" class="title">病程内容</div>
  70. <div class="content">
  71. <span v-if="current_select_record" v-html="current_select_record.content">{{current_select_record.content }}</span>
  72. <span v-else></span>
  73. </div>
  74. </div>
  75. </el-col>
  76. </el-row>
  77. </div>
  78. </div>
  79. <!-- </div> -->
  80. <el-dialog title="新增病程记录" width="50%" top="5vh" :visible.sync="show_dialog">
  81. <div>
  82. <div class="new_record_form">
  83. <div class="cell clearfix">
  84. <label class="title"><span class="name">病程日期</span> : </label>
  85. <el-date-picker v-model="course_of_disease_time" prefix-icon="el-icon-date" :editable="false"
  86. style="width: 200px;"
  87. type="datetime" placeholder="选择日期时间" align="right" format="yyyy-MM-dd HH:mm"
  88. value-format="yyyy-MM-dd HH:mm"></el-date-picker>
  89. <label class="title"><span class="name">日常病程</span> : </label>
  90. <el-select v-model="select_template" placeholder="可选择病程模板" @change="didSelectTemplate">
  91. <el-option v-for="(option, index) in templates" :key="index" :label="option.title"
  92. :value="option.content"></el-option>
  93. </el-select>
  94. </div>
  95. <div class="cell clearfix" style="margin-top: 10px">
  96. <label class="title"><span class="name">病程标题</span> : </label>
  97. <el-input v-model="title" style="width: 420px"></el-input>
  98. </div>
  99. <div class="textarea_panel">
  100. <keep-alive>
  101. <editor ref="editor"
  102. id="editors"
  103. style="width: 600px"
  104. v-bind:r_content="new_content"
  105. >
  106. </editor>
  107. </keep-alive>
  108. </div>
  109. <div style="text-align: right; padding-right: 0px; padding-top: 10px; padding-bottom: 10px;">
  110. <el-button @click="show_dialog = false">取消</el-button>
  111. <el-button :disabled="$store.getters.xt_user.subscibe.state==3?true:false" type="primary"
  112. @click="createAction" :loading="uploading_new_record">保存
  113. </el-button>
  114. </div>
  115. </div>
  116. </div>
  117. </el-dialog>
  118. <el-dialog title="修改病程记录" width="50%" top="5vh" :visible.sync="show_edit_dialog">
  119. <div>
  120. <div class="new_record_form">
  121. <div class="cell clearfix">
  122. <label class="title"><span class="name">病程日期</span> : </label>
  123. <el-date-picker v-model="edit_course_of_disease_time" prefix-icon="el-icon-date" :editable="false"
  124. style="width: 200px;"
  125. type="datetime"
  126. placeholder="选择日期时间" align="right" format="yyyy-MM-dd HH:mm"
  127. value-format="yyyy-MM-dd HH:mm"></el-date-picker>
  128. <label class="title"><span class="name">日常病程</span> : </label>
  129. <el-select v-model="select_template" placeholder="可选择病程模板" @change="didEditSelectTemplate">
  130. <el-option v-for="(option, index) in templates" :key="index" :label="option.title"
  131. :value="option.content"></el-option>
  132. </el-select>
  133. </div>
  134. <div class="cell clearfix" style="margin-top: 10px">
  135. <label class="title"><span class="name">病程标题</span> : </label>
  136. <el-input v-model="edit_title" style="width: 420px"></el-input>
  137. </div>
  138. <div class="textarea_panel">
  139. <!--<el-input v-model="edit_new_content" type="textarea" rows="6" resize="none"></el-input>-->
  140. <keep-alive>
  141. <editor ref="edit_neditor"
  142. id="edit_editor"
  143. style="width: 600px"
  144. v-bind:r_content="edit_new_content">
  145. </editor>
  146. </keep-alive>
  147. </div>
  148. <div style="text-align: right; padding-right: 0px; padding-top: 10px; padding-bottom: 10px;">
  149. <el-button @click="show_edit_dialog = false">取消</el-button>
  150. <el-button :disabled="$store.getters.xt_user.subscibe.state==3?true:false" type="primary"
  151. @click="modifyAction" :loading="uploading_new_record">保存
  152. </el-button>
  153. </div>
  154. </div>
  155. </div>
  156. </el-dialog>
  157. </div>
  158. </div>
  159. <!-- </div> -->
  160. </template>
  161. <script>
  162. import PatientSidebar from './components/PatientSidebar'
  163. import Editor from '@/components/Editor'
  164. import {
  165. createCourseOfDiseaseRecord,
  166. deleteCourseOfDiseaseRecords,
  167. getCourseOfDiseaseRecords,
  168. modifyCourseOfDiseaseRecord,
  169. GetCoursePrintData
  170. } from '@/api/patient'
  171. import { parseTime } from '@/utils'
  172. import BreadCrumb from '@/xt_pages/components/bread-crumb'
  173. export default {
  174. name: 'CourseOfDisease',
  175. components: {
  176. PatientSidebar,
  177. BreadCrumb,
  178. Editor
  179. },
  180. data() {
  181. return {
  182. loading: false,
  183. title: '',
  184. patient_id: 0,
  185. date: [],
  186. start_time: '',
  187. end_time: '',
  188. course_of_disease_time: '',
  189. records: [],
  190. doctors: [],
  191. current_select_record: null,
  192. show_dialog: false,
  193. show_edit_dialog: false,
  194. uploading_new_record: false,
  195. templates: this.$store.getters.configlist.course_disease,
  196. select_template: '',
  197. new_content: '',
  198. edit_new_content: '',
  199. edit_course_of_disease_time: '',
  200. selectingRows: [],
  201. table_current_index: -1,
  202. edit_current_id: 0,
  203. edit_title: '',
  204. ids:"",
  205. idArr:[],
  206. }
  207. },
  208. created() {
  209. this.patient_id = parseInt(this.$route.query.id)
  210. if (isNaN(this.patient_id) || this.patient_id <= 0) {
  211. this.$notify.error({
  212. title: '错误',
  213. message: '无效的id'
  214. })
  215. this.$router.push('/patients/patients')
  216. return
  217. }
  218. var now = new Date()
  219. this.date = [now.getTime() - (7 * 24 * 60 * 60 * 1000), now.getTime()]
  220. var nowDate = new Date()
  221. var nowYear = nowDate.getFullYear()
  222. var nowMonth = nowDate.getMonth() + 1
  223. var nowDay = nowDate.getDate()
  224. this.end_time =
  225. nowYear +
  226. '-' +
  227. (nowMonth < 10 ? '0' + nowMonth : nowMonth) +
  228. '-' +
  229. (nowDay < 10 ? '0' + nowDay : nowDay)
  230. nowDate.setMonth(nowDate.getMonth() - 1)
  231. nowYear = nowDate.getFullYear()
  232. nowMonth = nowDate.getMonth() + 1
  233. nowDay = nowDate.getDate()
  234. this.start_time =
  235. nowYear +
  236. '-' +
  237. (nowMonth < 10 ? '0' + nowMonth : nowMonth) +
  238. '-' +
  239. (nowDay < 10 ? '0' + nowDay : nowDay)
  240. this.requestCourseRecords()
  241. },
  242. methods: {
  243. requestCourseRecords: function() {
  244. this.loading = true
  245. getCourseOfDiseaseRecords(this.patient_id, this.start_time, this.end_time).then(rs => {
  246. this.loading = false
  247. var resp = rs.data
  248. if (resp.state == 1) {
  249. this.current_select_record = null
  250. this.records = resp.data.records
  251. this.doctors = resp.data.doctors
  252. } else {
  253. this.$message.error(resp.msg)
  254. }
  255. }).catch(error => {
  256. this.loading = false
  257. this.$message.error(error)
  258. })
  259. },
  260. didChangeCurrentRecord: function(record) {
  261. this.current_select_record = record
  262. },
  263. recordTime: function(timestamp) {
  264. var time = new Date(timestamp * 1000)
  265. return parseTime(time, '{y}-{m}-{d} {h}:{m}')
  266. },
  267. doctorName: function(doctor_id) {
  268. for (let index = 0; index < this.doctors.length; index++) {
  269. const doctor = this.doctors[index]
  270. if (doctor.id == doctor_id) {
  271. return doctor.name
  272. }
  273. }
  274. return ''
  275. },
  276. modifyAction: function() {
  277. this.edit_new_content = this.$refs.edit_neditor.content
  278. if (this.edit_new_content.length == 0) {
  279. this.$message.error('请填写病程内容')
  280. return
  281. }
  282. this.uploading_new_record = true
  283. modifyCourseOfDiseaseRecord(this.patient_id, this.edit_new_content, this.edit_course_of_disease_time, this.edit_current_id, this.edit_title).then(rs => {
  284. this.uploading_new_record = false
  285. var resp = rs.data
  286. if (resp.state == 1) {
  287. this.records[this.table_current_index].content = resp.data.record.content
  288. this.records[this.table_current_index].record_time = resp.data.record.record_time
  289. this.records[this.table_current_index].recorder = resp.data.record.recorder
  290. this.records[this.table_current_index].title = resp.data.record.title
  291. this.show_edit_dialog = false
  292. this.edit_new_content = ''
  293. this.table_current_index = -1
  294. } else {
  295. this.table_current_index = -1
  296. this.$message.error(resp.msg)
  297. }
  298. }).catch(error => {
  299. this.table_current_index = -1
  300. this.uploading_new_record = false
  301. this.$message.error(error)
  302. })
  303. },
  304. createAction: function() {
  305. this.new_content = this.$refs.editor.content
  306. console.log("hhhhh2h3h232323232",this.new_content)
  307. if (this.new_content.length == 0) {
  308. this.$message.error('请填写病程内容')
  309. return
  310. }
  311. this.uploading_new_record = true
  312. createCourseOfDiseaseRecord(this.patient_id, this.new_content, this.course_of_disease_time, this.title).then(rs => {
  313. this.uploading_new_record = false
  314. var resp = rs.data
  315. if (resp.state == 1) {
  316. this.records.unshift(resp.data.record)
  317. // this.$refs.record_table.setCurrentRow()
  318. // this.$refs.record_table.setCurrentRow(this.records[0])
  319. // this.current_select_record = this.records[0]
  320. this.show_dialog = false
  321. this.new_content = ''
  322. this.title = ''
  323. } else {
  324. this.$message.error(resp.msg)
  325. }
  326. }).catch(error => {
  327. this.uploading_new_record = false
  328. this.$message.error(error)
  329. })
  330. },
  331. didSelectTemplate: function(templateContent) {
  332. this.new_content = this.new_content.length > 0 ? (this.new_content + templateContent) : templateContent
  333. }, didEditSelectTemplate: function(templateContent) {
  334. this.edit_new_content = this.edit_new_content.length > 0 ? (this.edit_new_content + templateContent) : templateContent
  335. },
  336. didSelectionChange: function(selectRows) {
  337. var arr = []
  338. for(let i=0;i<selectRows.length;i++){
  339. arr.push(selectRows[i].id)
  340. }
  341. var newArr = arr.join(',')
  342. this.ids = newArr
  343. console.log("select23322332",this.ids)
  344. this.selectingRows = selectRows
  345. },
  346. deleteAction: function() {
  347. if (this.selectingRows.length == 0) {
  348. return
  349. }
  350. var ids = []
  351. for (let index = 0; index < this.selectingRows.length; index++) {
  352. const row = this.selectingRows[index]
  353. ids.push(row.id)
  354. }
  355. var ids_str = ids.join(',')
  356. this.loading = true
  357. deleteCourseOfDiseaseRecords(this.patient_id, ids_str).then(rs => {
  358. var resp = rs.data
  359. if (resp.state == 1) {
  360. for (let id_index = 0; id_index < ids.length; id_index++) {
  361. for (let record_index = 0; record_index < this.records.length; record_index++) {
  362. if (ids[id_index] == this.records[record_index].id) {
  363. this.records.splice(record_index, 1)
  364. break
  365. }
  366. }
  367. }
  368. this.selectingRows = []
  369. this.$message.success('已删除')
  370. } else {
  371. this.$message.error(resp.msg)
  372. }
  373. this.loading = false
  374. }).catch(err => {
  375. this.loading = false
  376. this.$message.error(err)
  377. })
  378. }, startTimeChange(val) {
  379. this.requestCourseRecords()
  380. }, endTimeChange(val) {
  381. this.requestCourseRecords()
  382. }, showEdit() {
  383. if (this.table_current_index == -1) {
  384. this.$message.error('请选择要修改的病程内容')
  385. return
  386. }
  387. this.show_edit_dialog = true
  388. this.edit_course_of_disease_time = this.recordTime(this.records[this.table_current_index].record_time)
  389. this.edit_new_content = this.records[this.table_current_index].content
  390. this.edit_current_id = this.records[this.table_current_index].id
  391. this.edit_title = this.records[this.table_current_index].title
  392. this.$refs.record_table.setCurrentRow(null)
  393. }, tableRow({ row, rowIndex }) {
  394. // 把每一行的索引放进row
  395. row.index = rowIndex
  396. }, onRowClick(row, event, column) {
  397. this.table_current_index = row.index
  398. },
  399. print(){
  400. // if (this.table_current_index == -1) {
  401. // this.$message.error('请选择要打印的病程')
  402. // return
  403. // }
  404. if(this.ids.length == 0){
  405. this.$message.error('请选择要打印的病程')
  406. return
  407. }
  408. this.$router.push({ path: "/course/print?ids="+this.ids+"&patient_id="+this.patient_id});
  409. }
  410. }
  411. }
  412. </script>
  413. <style rel="stylesheet/css" lang="scss" scoped>
  414. .container {
  415. margin-left: 180px;
  416. padding: 20px;
  417. background: #fff;
  418. min-height: calc(100vh - 173px);
  419. margin-bottom: 15px;
  420. .record {
  421. padding-top: 20px;
  422. }
  423. }
  424. .record_content_panel {
  425. border-width: 1px;
  426. border-style: solid;
  427. border-color: #ebeef5;
  428. min-height: 200px;
  429. .title {
  430. font-size: 14px;
  431. font-weight: 500;
  432. color: #909399;
  433. line-height: 44px;
  434. height: 44px;
  435. text-align: center;
  436. border-bottom-width: 1px;
  437. border-bottom-style: solid;
  438. border-bottom-color: #ebeef5;
  439. }
  440. .content {
  441. padding: 12px 15px;
  442. font-size: 15px;
  443. color: gray;
  444. line-height: 22px;
  445. }
  446. }
  447. .new_record_form {
  448. /*/ / padding: 10 px, 25 px;*/
  449. .textarea_panel {
  450. margin-top: 10px;
  451. }
  452. }
  453. </style>
  454. <style>
  455. .el-table td,
  456. .el-table th.is-leaf,
  457. .el-table--border,
  458. .el-table--group {
  459. border-color: #d0d3da;
  460. }
  461. .el-table--border::after,
  462. .el-table--group::after,
  463. .el-table::before {
  464. background-color: #d0d3da;
  465. }
  466. </style>