123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650 |
- <template>
- <div class="main-contain">
- <div class="position">
- <bread-crumb :crumbs='crumbs'></bread-crumb>
- </div>
- <div class="app-container">
- <div class="cell clearfix">
- <!-- <el-input style="width: 180px;" v-model.trim="search_input" class="filter-item"/> -->
- <el-autocomplete
- style="margin:16px 5px"
- popper-class="my-autocomplete"
- v-model.trim="search_input"
- :fetch-suggestions="querySearchAsync"
- :trigger-on-focus="false"
- placeholder="病人名字或者透析号"
- @select="handleSelect"
- >
- <i class="el-icon-search el-input__icon" slot="suffix"> </i>
- <template slot-scope="{ item }">
- <div class="name">{{ item.name }}</div>
- </template>
- </el-autocomplete>
- <el-button style="margin-right:10px;" class="filter-item" type="primary" icon="el-icon-search"
- @click="searchAction">搜索
- </el-button>
-
- <el-date-picker type="datetime" format="yyyy-MM-dd HH:mm" value-format="yyyy-MM-dd HH:mm"
- placeholder="选择时间" v-model="start_time" style="width:200px"
- @change="changeStart"
- >
- </el-date-picker>
- -
- <el-date-picker type="datetime" format="yyyy-MM-dd HH:mm" value-format="yyyy-MM-dd HH:mm"
- placeholder="选择时间" v-model="end_time" style="width:200px"
- @change="changeEnd"
- >
- </el-date-picker>
-
- </div>
- <el-table :data="tableData" border :row-style="{ color: '#303133' }"
- :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}"
- highlight-current-row>
- <el-table-column align="center" type="index" label="序号" width="60">
- </el-table-column>
- <el-table-column align="center" prop="dialysis_no" label="姓名" width="80">
- <template slot-scope="scope">{{scope.row.name }}</template>
- </el-table-column>
- <el-table-column align="center" prop="name" label="证件号" width='180'>
- <template slot-scope="scope">{{ scope.row.id_card_no }}</template>
- </el-table-column>
- <el-table-column align="center" prop="name" label="就诊号" width="80">
- <template slot-scope="scope">
- {{scope.row.number}}
- </template>
- </el-table-column>
- <el-table-column align="center" prop="name" label="入院科室" width="80">
- <template slot-scope="scope">{{getDepartMent(scope.row.departments)}}</template>
- </el-table-column>
- <el-table-column align="center" prop="name" label="入院时间" width="100">
- <template slot-scope="scope">{{scope.row.in_hosptial_time}}</template>
- </el-table-column>
- <el-table-column align="center" prop="name" label="出院时间" width="100">
- <template slot-scope="scope">{{scope.row.out_hosptial_time}}</template>
- </el-table-column>
- <el-table-column align="center" prop="name" label="疾病类型" width="100">
- <template slot-scope="scope">{{GetSickType(scope.row.sick_type)}}</template>
- </el-table-column>
- <el-table-column align="center" prop="name" label="诊断" width="100">
- <template slot-scope="scope">{{GetDiagnosisName(parseInt(scope.row.diagnosis))}}</template>
- </el-table-column>
- <el-table-column align="center" prop="name" label="医疗类别" width="100">
- <template slot-scope="scope">
- <div v-if="scope.row.med_type == 11">普通住院</div>
- <div v-if="scope.row.med_type == 14">门诊特殊病</div>
- <div v-if="scope.row.med_type == 240101">门诊视同住院</div>
- </template>
- </el-table-column>
-
- <el-table-column align="center" prop="name" label="结算类型" width="70">
- <template slot-scope="scope">{{getBanlance(scope.row.balance_accounts_type) }}</template>
- </el-table-column>
-
-
-
- <el-table-column align="center" prop="name" label="医生" width="80">
- <template slot-scope="scope">{{getDoctor(scope.row.doctor) }}</template>
- </el-table-column>
- <el-table-column align="center" prop="name" label="状态" width="70">
- <template slot-scope="scope">
- <div v-if="scope.row.status == 0">{{"已经撤销出院"}}</div>
- <div v-if="scope.row.status == 1 && scope.row.in_hospital_status == 1 && scope.row.out_hospital_status == 0">{{"在院"}}</div>
- <div v-if="scope.row.status == 1 && scope.row.in_hospital_status == 1 && scope.row.out_hospital_status == 1">{{"已出院"}}</div>
- </template>
- </el-table-column>
- <!-- <el-table-column align="center" prop="name" label="操作" width="180">-->
- <!-- <template slot-scope="scope">-->
- <!-- <el-button size="mini" type="primary" v-if="scope.row.status == 1"-->
- <!-- @click="toReturnPatient(scope.row)">退号-->
- <!-- </el-button>-->
- <!-- </template>-->
- <!-- </el-table-column>-->
- </el-table>
-
- <el-pagination
- @size-change="handleSizeChange"
- @current-change="handleCurrentChange"
- :page-sizes="[10, 50, 100]"
- :page-size="10"
- background
- style="margin-top:20px;float: right"
- layout="total, sizes, prev, pager, next, jumper"
- :total="total"
- >
- </el-pagination>
-
- </div>
- </div>
- </template>
-
- <script>
- const moment = require('moment')
- import BreadCrumb from '@/xt_pages/components/bread-crumb'
- import {getInHospitalHistory,getInitData} from '@/api/his/his'
- import { uParseTime } from '@/utils/tools'
- import { getDictionaryDataConfig } from '@/utils/data'
- import axios from 'axios'
- export default {
- components: {
- BreadCrumb
- },
- data() {
- return {
- crumbs: [
- { path: false, name: '住院登记' },
- { path: false, name: '住院历史' }
- ],
- register_type: 0,
- search_input: '',
- value1: '',
- tableData: [],
- register: [
- { value: 0, label: '全部' },
- { value: 1, label: '普通' },
- { value: 2, label: '主治' },
- { value: 3, label: '主任' },
- { value: 4, label: '免收诊金' },
- { value: 5, label: '专家' }
- ],
- start_time: moment().format('YYYY-MM-DD HH:mm'),
- end_time: moment().format('YYYY-MM-DD HH:mm'),
- limit: 10,
- page: 1,
- total: 0,
- departMent: [],
- doctorList: [],
- medicalCare: [{
- id: 1,
- name: '职工基本医疗保险'
- }, {
- id: 2,
- name: '公务员医疗补助'
- }, {
- id: 3,
- name: '大额医疗费用补助'
- }, {
- id: 4,
- name: '离休人员医疗'
- }, {
- id: 5,
- name: '城乡居民基本医疗保险'
- }, {
- id: 6,
- name: '城乡居民大病医疗保险'
- },
- {
- id: 7,
- name: '生育保险'
- }],
- certificates: [{
- value: 1,
- label: '内地身份证'
- }, {
- value: 2,
- label: '社保卡'
- }, {
- value: 3,
- label: '护照'
- }, {
- value: 4,
- label: '军官证'
- }, {
- value: 5,
- label: '台胞证'
- }, {
- value: 6,
- label: '港澳地区身份证'
- }],
- settlement:
- [
- { value: 1, label: '医保' },
- { value: 2, label: '自费' },
- { value: 3, label: '公费' },
- { value: 4, label: '农保' },
- { value: 5, label: '会员' },
- { value: 6, label: '职工' },
- { value: 7, label: '合同' },
- {value: 8, label: '医保自费'},
-
- ],
- // medicalCare: [{
- // value: 1,
- // label: '职工基本医疗保险'
- // }, {
- // value: 2,
- // label: "公务员医疗补助"
- // },{
- // value: 3,
- // label: "大额医疗费用补助"
- // },{
- // value: 4,
- // label: "离休人员医疗"
- // },{
- // value: 5,
- // label: "城乡居民基本医疗保险"
- // },{
- // value: 6,
- // label: "城乡居民大病医疗保险"
- // },
- // {
- // value: 7,
- // label: "生育保险"
- // }],
- newRegister: [{
- value: 1,
- label: '普通'
- }, {
- value: 2,
- label: '主治'
- }, {
- value: 3,
- label: '主任'
- }, {
- value: 4,
- label: '免收诊金'
- }, {
- value: 5,
- label: '专家'
- }],
-
- tablePatient: [],
- creator: '',
- startUnix: '',
-
- dialogVisible: false,
- form: {},
- is_Name: false,
- sick:[],
- diagnoses:[],
- }
- },
- created() {
- // let a = JSON.parse(localStorage.getItem("temp"))
- // let arr = []
- // a.map(item => {
- // if(item.org_id == this.$store.getters.xt_user.org_id){
- // item.create_time = moment(item.create_time * 1000).format('YYYY-MM-DD')
- // arr.push(item)
- // }
-
- // })
- // this.tableData = arr
- //获取所有挂号号的患者
-
- this.creator = this.$store.getters.xt_user.user.user_name
- var today = moment().startOf('day').format('YYYY-MM-DD')
- var todayUnix = Date.parse(today) / 1000
- this.startUnix = todayUnix - 28800
- this.getInitData()
- this.getlist()
- this.getDictionaryDataConfig()
- },
- methods: {
- getInitData() {
- getInitData().then((response) => {
- if (response.data.state == 0) {
- this.$message.error(response.data.msg);
- return false;
- } else {
- this.sick = response.data.data.sick;
- this.diagnoses = response.data.data.diagnose;
- }
- });
- },GetSickType(id){
- for(let i = 0;i < this.sick.length; i++){
- if(this.sick[i].id == id){
- return this.sick[i].class_name
- }
- }
- return ""
- },
- GetDiagnosisName(id){
- for(let i = 0;i < this.diagnoses.length; i++){
- if(this.diagnoses[i].id == id){
- return this.diagnoses[i].class_name
- }
- }
- return ""
- },
- searchAction() {
- this.getlist()
- },
- // changeTime(val){
- // let arr = JSON.parse(localStorage.getItem("temp"))
- // arr.map(item => {
- // item.create_time = moment(item.create_time * 1000).format('YYYY-MM-DD')
- // })
- // this.tableData = arr
- // console.log(new Date(val[0]).getTime() / 1000)
- // console.log(new Date(val[1]).getTime() / 1000)
- // let arr1 = this.tableData
- // let a = []
- // arr1.map(item => {
- // if(new Date(item.create_time).getTime() / 1000 > new Date(val[0]).getTime() / 1000 && new Date(item.create_time).getTime() / 1000 < new Date(val[1]).getTime() / 1000 && item.org_id == this.$store.getters.xt_user.org_id){
- // a.push(item)
- // }
- // })
- // this.tableData = a
- // },
- changeStart(val) {
- this.start_time = val
- this.getlist()
- },
- changeEnd(val) {
- this.end_time = val
- this.getlist()
- },
- changeRegister(val) {
- this.getlist()
- },
- handleSizeChange(val) {
- this.limit = val
- this.getlist()
- },
- handleCurrentChange(val) {
- this.page = val
- this.getlist()
- },
- getlist() {
- var params = {
- keyword: this.search_input,
- start_time: this.start_time,
- end_time: this.end_time,
- limit: this.limit,
- page: this.page
- }
- getInHospitalHistory(params).then(response => {
- if (response.data.state == 1) {
- var history = response.data.data.history
-
- console.log('history', history)
- this.tableData = history
- var total = response.data.data.total
- console.log('total', total)
- this.total = total
- var department = response.data.data.department
- console.log('department', department)
- this.departMent = department
- var doctor = response.data.data.doctor
- console.log('doctor', doctor)
- this.doctorList = doctor
- }
- })
-
- },
- getDepartMent(id) {
- var name = ''
- for (let i = 0; i < this.departMent.length; i++) {
- if (id == this.departMent[i].id) {
- name = this.departMent[i].name
- }
- }
- return name
- },
- getDoctor(id) {
- var user_name = ''
- for (let i = 0; i < this.doctorList.length; i++) {
- if (id == this.doctorList[i].admin_user_id) {
- user_name = this.doctorList[i].user_name
- }
- }
- return user_name
- },
- getMedicalTreatment(id) {
- var name = ''
- for (let i = 0; i < this.medicalCare.length; i++) {
- if (this.medicalCare[i].id == id) {
- name = this.medicalCare[i].name
- }
- }
- return name
- },
- getTime(value, temp) {
- if (value != undefined) {
- return uParseTime(value, temp)
- }
- return ''
- }, toReturnSZPatient(val) {
- if(val.balance_accounts_type == 2){
- this.$confirm('是否退号', '退号 ', {
- confirmButtonText: '确 定',
- cancelButtonText: '取 消',
- type: 'warning'
- }).then(() => {
- let params = {
- 'id': val.id,
- };
- refundNumber(params).then(response => {
- if (response.data.state == 0) {
- this.$message.error(response.data.msg);
- this.loadingtwo = false;
- return false
- } else {
- this.getlist()
- this.$message({ message: '退号成功', type: 'success' });
-
- }
- })
-
- }).catch(() => {
-
- })
-
- }else{
- var that = this
- this.$confirm('是否退号', '退号', {
- confirmButtonText: '确 定',
- cancelButtonText: '取 消',
- type: 'warning'
- }).then(() => {
- axios.get('http://127.0.0.1:9532/sz/api/refundnumber/get', {
- params: {
- his_patient_id: val.id,
- record_time: this.getTime(val.record_date, '{y}-{m}-{d}'),
- admin_user_id: this.$store.getters.xt_user.user.id,
- patient_id: val.patient_id
- }
- })
- .then(function(response) {
- if (response.data.state == 0) {
- that.$message.error(response.data.msg)
- return false
- } else {
- if (response.data.data.failed_code == -10) {
- that.$confirm(response.data.data.msg, '医保错误信息', {
- confirmButtonText: '确 定',
- type: 'warning'
- }).then(() => {
-
- }).catch(() => {
- })
- // that.$message.error(response.data.data.msg)
-
- } else {
- that.getlist()
- that.$message({ message: '退号成功', type: 'success' })
- }
- }
- })
- .catch(function(error) {
- })
- }).catch(() => {
- })
- }
- },
- toReturnPatient(row) {
- var that = this
- this.$confirm('确认退号吗?', '退号', {
- confirmButtonText: '确 定',
- cancelButtonText: '取 消',
- type: 'warning'
- }).then(() => {
- //
- let params = {
- 'id':row.id,
- 'patient_id': row.patient_id,
- 'record_time': that.getTimes(row.record_date),
- 'admin_user_id': this.$store.getters.xt_user.user.id
- }
- axios.get('http://127.0.0.1:9532/api/refundnumber/post', {
- params: params
- })
- .then(function(response) {
- if (response.data.state == 0) {
- that.$message.error(response.data.msg)
- return false
- } else {
- if (response.data.data.failed_code == -10) {
- // that.$message.error(response.data.data.msg)
- that.$confirm(response.data.data.msg, '医保错误信息', {
- confirmButtonText: '确 定',
- type: 'warning'
- }).then(() => {
-
- }).catch(() => {
- })
- } else {
- that.$message({ message: '退号成功', type: 'success', duration: 5000 });
- that.getlist()
- }
- }
- })
- .catch(function(error) {
- })
- //
- // changePatient(id).then(response => {
- // if (response.data.state == 1) {
- // var msg = response.data.data.msg
- // this.$message.success('退号成功')
- // this.getlist()
- // } else {
- // this.$message.error('患者已就诊,退号失败')
- // }
- // })
- })
- .catch(() => {
- })
- }, getTimes(time) {
- return uParseTime(time, '{y}-{m}-{d}')
- },
-
- querySearchAsync(keyword, cb) {
- let key = '';
- if (keyword != undefined) {
- key = keyword
- }
- let searchArray = []
-
- var params = {
- keyword: key
- }
- console.log('params', params)
- getHisPatient(params).then(response => {
- if (response.data.state == 1) {
- searchArray = response.data.data.patient
- console.log('searcharrya', searchArray)
- cb(searchArray)
- }
- })
- return searchArray
- },
-
- handleSelect(val) {
- this.search_input = val.name
- this.getlist()
- },
- handleClose(done) {
- done()
- },
- open(obj) {
- this.dialogVisible = true
- this.form = obj
- console.log(obj)
- },
- getDictionaryDataConfig(type) {
- let arr = getDictionaryDataConfig('system', 'social_type')
- let str = ''
- arr.map(item => {
- if (item.id == type) {
- str = item.name
- }
- })
- return str
- },
- getCertificates(type) {
- let arr = this.certificates
- let str = ''
- arr.map(item => {
- if (item.value == type) {
- str = item.label
- }
- })
- return str
- },
- getSettlement(type) {
- let arr = this.settlement
- let str = ''
- arr.map(item => {
- if (item.value == type) {
- str = item.label
- }
- })
- return str
- },
- getMedicalCare(type) {
- let arr = this.medicalCare
- let str = ''
- arr.map(item => {
- if (item.id == type) {
- str = item.name
- }
- })
- return str
- },
- getRegister(type) {
- let arr = this.newRegister
- let str = ''
- arr.map(item => {
- if (item.value == type) {
- str = item.label
- }
- })
- return str
- },
- getDepartMent(type) {
- let arr = this.departMent
- let str = ''
- arr.map(item => {
- if (item.id == type) {
- str = item.name
- }
- })
- return str
- },
-
- getBanlance(id) {
- var label = ''
- for (let i = 0; i < this.settlement.length; i++) {
- if (id == this.settlement[i].value) {
- label = this.settlement[i].label
- }
- }
- return label
- }
- }
- }
- </script>
-
- <style lang="scss" scoped>
- .basicForm {
- display: flex;
- flex-wrap: wrap;
- justify-content: space-between;
-
- .el-form-item {
- width: 33%;
- }
-
- }
- </style>
|