123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351 |
- <template>
- <div>
- <div class="cell clearfix" style="float: right">
- <el-button
- style="float: right"
- size="small"
- icon="el-icon-printer"
- @click="printAction()"
- type="primary"
- >打印
- </el-button>
- </div>
-
- <div class="cell clearfix">
- <label class="title"> <span class="name">时间</span> : </label>
- <div class="time">
- <ul class>
- <li
- :class="item.id == week_type ? 'active' : ''"
- @click="selectWeekType(item.id)"
- v-for="item in weekArr"
- :key="item.id"
- >
- {{ item.name }}
- </li>
- </ul>
- </div>
- </div>
- <el-table
- :row-style="{ color: '#303133' }"
- :data="scheduleData"
- border
- :header-cell-style="{
- backgroundColor: 'rgb(245, 247, 250)',
- color: '#606266'
- }"
- style="width: 100%"
- >
- <el-table-column label="姓名" min-width="100" align="center">
- <template slot-scope="scope">
- {{ scope.row.patient}}
- </template>
- </el-table-column>
- <el-table-column label="分区" min-width="70" align="center">
- <template slot-scope="scope">
- {{ scope.row.zone.name }}
- </template>
- </el-table-column>
- <el-table-column label="班次" min-width="70" align="center">
- <template slot-scope="scope">
- {{ getSchedulesType(scope.row.schedule_type) }}
- </template>
- </el-table-column>
- <el-table-column label="机号" min-width="70" align="center">
- <template slot-scope="scope">
- {{ scope.row.number.number }}
- </template>
- </el-table-column>
- <el-table-column label="透析模式" min-width="100" align="center">
- <template slot-scope="scope">
- {{ modeOptions[scope.row.mode_id].name }}
- </template>
- </el-table-column>
- <el-table-column label="透析器" min-width="100" align="center">
- <template slot-scope="scope">
- {{ scope.row.prescription.dialyzer_perfusion_apparatus }}
- </template>
- </el-table-column>
- <el-table-column label="抗凝剂" min-width="100" align="center">
- <template slot-scope="scope">
- {{
- scope.row.prescription.anticoagulant
- ? anticoagulants_confit[scope.row.prescription.anticoagulant].name
- : ""
- }}
- </template>
- </el-table-column>
- <el-table-column label="总量" min-width="100" align="center">
- <template slot-scope="scope">
- <span v-if="scope.row.prescription.anticoagulant == 1">{{scope.row.prescription.anticoagulant_zongliang?scope.row.prescription.anticoagulant_zongliang+'mg':''}}</span>
- <span v-if="scope.row.prescription.anticoagulant == 2">{{scope.row.prescription.anticoagulant_zongliang?scope.row.prescription.anticoagulant_zongliang+'iu':''}}</span>
- <span v-if="scope.row.prescription.anticoagulant == 3">{{scope.row.prescription.anticoagulant_zongliang?scope.row.prescription.anticoagulant_zongliang+'iu':''}}</span>
- <span v-if="scope.row.prescription.anticoagulant == 4">{{scope.row.prescription.anticoagulant_zongliang?scope.row.prescription.anticoagulant_zongliang+'mg':''}}</span>
-
- </template>
- </el-table-column>
-
- <el-table-column label="长期医嘱" min-width="440" align="center">
- <template slot-scope="scope">
- <span style="white-space: pre">{{getAdvice(scope.row.doctor_advice)}}</span>
- </template>
- </el-table-column>
- </el-table>
- </div>
- </template>
-
- <script>
- import { getSchedules, getScheduleWeekDay } from '@/api/schedule'
- import WeekItem from './WeekItem'
-
- export default {
- name: 'tableWeeks',
- props: {
- weekTime: {
- type: String,
- default: 'thisWeek'
- }
- },
-
- data() {
- return {
- weekArr: [
- { id: 1, name: '周一' },
- { id: 2, name: '周二' },
- { id: 3, name: '周三' },
- { id: 4, name: '周四' },
- { id: 5, name: '周五' },
- { id: 6, name: '周六' },
- { id: 7, name: '周日' }
- ],
- anticoagulants_confit: null,
-
- week_type: '1',
- weekTitle: ['', '', '', '', '', '', ''],
- weekData: {
- Monday: [],
- Tuesday: [],
- Wednesday: [],
- Thursday: [],
- Friday: [],
- Saturday: [],
- Sunday: []
- },
- scheduleData: [],
- modeOptions: null
- }
- },
- watch: {
- weekTime: function() {
- var theType = this.weekType(this.weekTime)
- this.getSchedules(theType)
- }
- },
-
- methods: {
- printAction(){
- console.log("111111")
- this.$router.push({ path: '/schedule/remind/print?week_type=' + this.week_type })
-
- },
- getScheduleWeekDay(weekType) {
- getScheduleWeekDay(weekType).then(response => {
- this.scheduleData = []
- if (response.data.state == 1) {
- this.scheduleData = response.data.data.schdules
- console.log(this.scheduleData)
- } else {
- this.$message.error('网络错误')
- return false
- }
- })
- },
-
- // getSchedules(weekType) {
- // getSchedules(weekType).then(response => {
- // this.scheduleData = []
- // if (response.data.state == 1) {
- // this.weekTitle = response.data.data.weekTitle
- // var theSchedules = response.data.data.schdules
- // var that = this
- // theSchedules.forEach(function(schedule) {
- // schedule['mode_name'] = typeof (that.modeOptions[schedule.mode_id]) == 'undefined' ? '' : that.modeOptions[schedule.mode_id].name
- // var weekPath = that.weekPath(schedule.schedule_week)
- // if (weekPath.length > 0) {
- // that.weekData[weekPath].push(schedule)
- // }
- // })
- // var rowNum = 0
- // console.log(that.weekData)
- // for (var index in that.weekData) {
- // var thisLen = that.weekData[index].length
- // rowNum = rowNum >= thisLen ? rowNum : thisLen
- // }
- // console.log(rowNum)
- // for (let index = 0; index < rowNum; index++) {
- // var dataItem = {}
- // for (var weekIndex in that.weekData) {
- // var weekItem = that.weekData[weekIndex].shift()
- // console.log('weekItem', weekItem)
- // if (typeof (weekItem) != 'undefined') {
- // dataItem[weekIndex] = weekItem
- // }
- // }
- // that.scheduleData.push(dataItem)
- // }
- //
- // console.log(that.scheduleData)
- //
- // } else {
- // this.$message.error('网络错误')
- // return false
- // }
- // })
- // },
- weekType(weekTime) {
- var theType = 2
- switch (weekTime) {
- case 'lastWeek':
- theType = 1
- break
- case 'thisWeek':
- theType = 2
- break
- case 'nextWeek':
- theType = 3
- break
- case 'nextTwoWeek':
- theType = 4
- break
- default:
- theType = 2
- break
- }
- return theType
- },
- weekPath(week) {
- var weekArr = {
- 1: 'Monday',
- 2: 'Tuesday',
- 3: 'Wednesday',
- 4: 'Thursday',
- 5: 'Friday',
- 6: 'Saturday',
- 7: 'Sunday'
- }
- if (typeof (weekArr[week]) == 'undefined') {
- return ''
- }
- return weekArr[week]
- }, selectWeekType(type) {
- this.week_type = type
- let params = {
- week_type: this.week_type
- }
- this.getScheduleWeekDay(params)
- }, getSchedulesType: function(type) {
- let type_name = ''
- switch (type) {
- case 1:
- type_name = '上午'
- break
- case 2:
- type_name = '下午'
- break
- case 3:
- type_name = '晚上'
- break
- }
- return type_name
- },
- getAdvice:function(doctor_advice) {
-
- let name = ""
- for (let i = 0; i< doctor_advice.length; i++){
-
- let prescribing_number = ''
- let single_dose = ''
- let drug_spec = ''
-
- if (doctor_advice[i].prescribing_number > 0) {
- prescribing_number = doctor_advice[i].prescribing_number + doctor_advice[i].prescribing_number_unit
- }
- if (doctor_advice[i].single_dose > 0) {
- single_dose = ' 单次用量 ' + doctor_advice[i].single_dose + doctor_advice[i].single_dose_unit
- }
-
- if (doctor_advice[i].drug_spec > 0) {
- drug_spec = doctor_advice[i].drug_spec + doctor_advice[i].drug_spec_unit
- }
-
-
- name = name + doctor_advice[i].advice_name +" "+ drug_spec+" "+ prescribing_number + " "+single_dose+" " + doctor_advice[i].delivery_way+" "+ doctor_advice[i].execution_frequency +" " + doctor_advice[i].remark +"\n"
-
- if (doctor_advice[i].child.length > 0){
-
- for (let a = 0 ; a < doctor_advice[i].child.length; a++){
-
- if(doctor_advice[i].child[a].prescribing_number > 0){
- doctor_advice[i].child[a]['presc'] = doctor_advice[i].child[a].prescribing_number + doctor_advice[i].child[a].prescribing_number_unit
- }else{
- doctor_advice[i].child[a]['presc'] = ''
- }
-
- if(doctor_advice[i].child[a].single_dose > 0){
- doctor_advice[i].child[a]['single'] = " "+' 单次用量 '+" "+doctor_advice[i].child[a].single_dose + doctor_advice[i].child[a].single_dose_unit
- }else{
- doctor_advice[i].child[a]['single'] = ''
- }
-
-
- name = name+"▲"+doctor_advice[i].child[a].advice_name+""
- + doctor_advice[i].child[a].advice_desc
- + doctor_advice[i].child[a].drug_spec_unit
- + doctor_advice[i].child[a].presc
- + doctor_advice[i].child[a].single+"\n"
- }
-
-
- }
-
- }
- return name
-
-
-
- }
- },
- components: {
- WeekItem
- },
- created() {
- this.modeOptions = this.$store.getters.treatment_mode
- this.anticoagulants_confit = this.$store.getters.anticoagulants_confit
-
- this.week_type = new Date().getDay()
- if(this.week_type == 0){
- this.week_type = 7
-
- }
- let params = {
- week_type: this.week_type
- }
- this.getScheduleWeekDay(params)
- }
- }
- </script>
-
- <style rel="stylesheet/css" lang="scss">
- .el-table td,
- .el-table th.is-leaf,
- .el-table--border,
- .el-table--group {
- border-color: #d0d3da;
- }
- .el-table--border::after,
- .el-table--group::after,
- .el-table::before {
- background-color: #d0d3da;
- }
- </style>
|