123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298 |
- <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 size="small" style="width:150px;" v-model="keywords"
- class="filter-item"/>
- <el-button size="small" style="margin:0 10px;" class="filter-item" type="primary" @click="searchAction">搜索
- </el-button>
- <el-date-picker v-model="record_date" prefix-icon="el-icon-date" @change="handleScheduleDateChange"
- :editable="false" :clearable="false" style="width: 196px;margin-right:10px;" type="date"
- format="yyyy-MM-dd"
- value-format="yyyy-MM-dd"
- placeholder="选择日期时间" align="right"></el-date-picker>
- <el-button size="small" style="margin:0 10px;" class="filter-item" type="primary" @click="batchPrint(1)">处方筏批量打印</el-button>
- <el-button size="small" style="margin:0 10px;" class="filter-item" type="primary" @click="batchPrint(2)">治疗单批量打印</el-button>
- <el-button size="small" style="margin:0 10px;" class="filter-item" type="primary" @click="batchPrint(3)">检验单批量打印</el-button>
- </div>
- <el-table :data="tableData" border ref="table" style="width: 100%;" :row-style="{ color: '#303133' }" @selection-change="handleSelectionChange"
- :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}" highlight-current-row>
- <el-table-column align="center" type="selection" width="55"></el-table-column>
- <el-table-column align="center" label="序号" width="60" type="index"></el-table-column>
- <el-table-column align="center" prop="name" label="姓名" width="100">
- <template slot-scope="scope">{{scope.row.patients?scope.row.patients.name:''}}</template>
- </el-table-column>
- <el-table-column align="center" prop="name" label="处方日期" width="200">
- <template slot-scope="scope"> {{getTimes(scope.row.ctime)}}</template>
-
- </el-table-column>
- <!--<el-table-column align="center" prop="name" label="患者类型">-->
- <!--<template slot-scope="scope">{{}}</template>-->
- <!--</el-table-column>-->
- <el-table-column align="center" prop="name" label="处方号">
- <template slot-scope="scope">{{scope.row.prescription_number}}</template>
- </el-table-column>
- <el-table-column align="center" prop="name" label="开立医生">
- <template slot-scope="scope">{{scope.row.doctor}}</template>
- </el-table-column>
- <el-table-column align="center" prop="name" label="诊断">
- <template slot-scope="scope">{{getDiagnosis(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.id > 0">已就诊</div>
- <div v-else>未就诊</div>
- </template>
- </el-table-column>
- <el-table-column align="center" prop="name" label="操作" width="100">
- <template slot-scope="scope">
- <el-button size="mini" type="primary" @click="handerShowDetail(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>
- <inquiries-detail ref="inquiriesDetail"></inquiries-detail>
- <el-dialog
- class="centerDialog"
- width="600px"
- title="打印"
- :visible.sync="innerVisible"
- append-to-body>
- <template>
- <el-button
- style="float:right;"
- size="small"
- icon="el-icon-printer"
- @click="printThisPage"
- type="primary"
- >打印
- </el-button>
- </template>
- <div id='printMain'>
- <print ref="print" v-if="printType == 1" :printData='printData'></print>
- <treatPrint ref="treatPrint" v-if="printType == 2" :printData='printData'></treatPrint>
- <checkPrint ref="checkPrint" v-if="printType == 3" :printData='printData'></checkPrint>
- </div>
-
- </el-dialog>
- </div>
- </div>
- </template>
-
- <script>
- import BreadCrumb from '@/xt_pages/components/bread-crumb'
- import inquiriesDetail from './components/inquiriesDetail'
- import { getHisPrescriptionList } from '@/api/his/his'
- import { uParseTime } from '@/utils/tools'
- import { getInitData, getBatchPrint } from '@/api/his/his'
- import print from './batch_print_template/index'
- import treatPrint from './batch_print_treatTemplate/index'
- import checkPrint from './batch_print_checkTemplate/index'
- export default {
- components: {
- BreadCrumb,
- inquiriesDetail,
- print,
- treatPrint,
- checkPrint
- },
- data() {
- return {
- keywords:"",
- total:0,
- record_date:"",
- page:1,
- limit:10,
- crumbs: [
- { path: false, name: '门诊医生站' },
- { path: false, name: '既往查询' }
- ],
- tableData: [],
- diagnoses:[],
- innerVisible: false,
- selecting_schs:[],
- printData:[],
- printType: 0,
- org_id:'',
- }
- },
- methods: {
- printThisPage() {
- if(this.org_id == 10138){
- const style =
- '@media print {#prescription-print{font-size:14px;border:1px solid white}.prescription-print:last-child {page-break-after: auto;}.printTitle{font-size: 22px;text-align: center;font-weight: bold;margin-bottom: 10px;}.infoTitle{display: flex;margin-top:10px;}.infoTitle div{width: 200px;}.infoMain{display: flex;flex-wrap: wrap;margin-top:10px;}.infoMain div{width: 50%;line-height: 24px;}.prescriptionBox{min-height:350px;}.Rp{font-size: 18px;font-weight: bold;}.drugsBox{padding-left: 40px;margin-bottom: 10px;}.drugsBox div{line-height: 20px;}.drugsOne{line-height: 24px;}.drugsOne span{margin-right: 20px;}.doctorBox{display: flex;justify-content: space-between;padding:0 10px;line-height: 24px;border-bottom: 2px solid #000;}.actionBar{display: flex;justify-content: space-between; line-height: 24px;padding:0 10px;}.actionBar p{width:150px;}.under_line{display: inline-block;border-bottom: 1px solid #000;flex: 1;}@media print {html {zoom: 88%;}}#prescription-print{font-size:14px;border:1px solid white}.prescription-print:last-child {page-break-after: auto;}.printTitle{font-size: 22px;text-align: center;font-weight: bold;margin-bottom: 10px;}.infoTitle{display: flex;margin-top:10px;}.infoTitle div{width: 200px;}.infoMain{display: flex;flex-wrap: wrap;margin-top:10px;}.infoMain div{width: 50%;line-height: 24px;}.prescriptionBox{min-height:350px;}.Rp{font-size: 18px;font-weight: bold;}.drugsBox{padding-left: 40px;margin-bottom: 10px;}.drugsBox div{line-height: 20px;}.drugsOne{line-height: 24px;}.drugsOne span{margin-right: 20px;}.doctorBox{display: flex;justify-content: space-between;padding:0 10px;line-height: 24px;border-bottom: 2px solid #000;}.actionBar{display: flex;justify-content: space-between; line-height: 24px;padding:0 10px;}.actionBar p{width:150px;}.under_line{display: inline-block;border-bottom: 1px solid #000;flex: 1;}@media print {html {zoom: 87%;}}}'
- printJS({
- printable: 'printMain',
- type: 'html',
- style: style,
- scanStyles: false
- })
- }else{
- const style =
- '@media print {#prescription-print{font-size:14px;border:1px solid white}.printTitle{font-size: 22px;text-align: center;font-weight: bold;margin-bottom: 10px;}.infoTitle{display: flex;border-bottom: 2px solid #000;margin-top:10px;line-height: 1px; padding:0 10px;}.infoTitle p{width: 200px;font-size:14px;}.infoMain{display: flex;flex-wrap: wrap;border-bottom: 2px solid #000;padding:0 10px;}.infoMain div{width: 50%;line-height: 24px;}.prescriptionBox{min-height:450px;}.Rp{font-size: 18px;font-weight: bold;}.drugsBox{padding-left: 40px;margin-bottom: 10px;}.drugsBox div{line-height: 20px;}.drugsOne{line-height: 24px;}.drugsOne span{margin-right: 20px;}.doctorBox{display: flex;justify-content: space-between;padding:0 10px;line-height: 24px;border-bottom: 2px solid #000;}.actionBar{display: flex;justify-content: space-between; line-height: 24px;padding:0 10px;}.actionBar p{width:150px;}.under_line{display: inline-block;border-bottom: 1px solid #000;flex: 1;}@media print {html {zoom: 88%;}}#prescription-print{font-size:14px;border:1px solid white}.prescription-print:last-child {page-break-after: auto;}.printTitle{font-size: 22px;text-align: center;font-weight: bold;margin-bottom: 10px;}.infoTitle{display: flex;margin-top:10px;}.infoTitle div{width: 200px;}.infoMain{display: flex;flex-wrap: wrap;margin-top:10px;}.infoMain div{width: 50%;line-height: 24px;}.prescriptionBox{min-height:450px;}.Rp{font-size: 18px;font-weight: bold;}.drugsBox{padding-left: 40px;margin-bottom: 10px;}.drugsBox div{line-height: 20px;}.drugsOne{line-height: 24px;}.drugsOne span{margin-right: 20px;}.doctorBox{display: flex;justify-content: space-between;padding:0 10px;line-height: 24px;border-bottom: 2px solid #000;}.actionBar{display: flex;justify-content: space-between; line-height: 24px;padding:0 10px;}.actionBar p{width:150px;}.under_line{display: inline-block;border-bottom: 1px solid #000;flex: 1;}.NoCell{display: flex;justify-content: space-between;margin-bottom: 10px;}.underLine{display: inline-block;border-bottom: 1px solid #000;text-align: center;line-height: 24px;}.basicCell{display: flex;} .basicCell span{line-height: 24px;margin-bottom: 10px;}}'
- printJS({
- printable: 'printMain',
- type: 'html',
- style: style,
- scanStyles: false
- })
- }
- this.innerVisible = false
- // this.$nextTick(() => {
- // this.$refs.print.printThisPage()
- // this.$refs.treatPrint.printThisPage()
- // this.$refs.checkPrint.printThisPage()
- // })
- },
-
- searchAction(){
- this.page = 1;
- this.limit = 10;
- this.getHisPrescriptionList()
-
- },
- handleScheduleDateChange(){
- this.page = 1;
- this.limit = 10;
- this.getHisPrescriptionList()
-
- },
- handleCurrentChange(page) {
- this.page = page;
- this.getHisPrescriptionList()
-
- },
-
- handleSizeChange(limit) {
- this.limit = limit;
- this.getHisPrescriptionList()
-
-
- },
- getTimes(time) {
- return uParseTime(time, "{y}-{m}-{d} {h}:{i}:{s}");
- },
- handerShowDetail(row) {
- if(row.id == 0){
- this.$message.error("未就诊")
- return
- }
- this.$refs.inquiriesDetail.show(row.id)
- }, getHisPrescriptionList() {
- let params = {
- record_date:this.record_date,
- page: this.page,
- limit: this.limit,
- keywords: this.keywords,
- }
- getHisPrescriptionList(params).then(response => {
- if (response.data.state == 0) {
- this.$message.error(response.data.msg)
- return false
- } else {
- this.tableData = response.data.data.order
- this.total = response.data.data.total
- this.$nextTick(() => {
- this.$refs.table.doLayout(); //解决表格错位
- });
- }
- })
-
- },
- getInitData() {
- getInitData().then(response => {
- if (response.data.state == 0) {
- this.$message.error(response.data.msg)
- return false
- } else {
- this.diagnoses = response.data.data.diagnose
- console.log("诊断列表",this.diagnoses)
- }
- })
- },
- getDiagnosis(id){
- let ids = id.split(",")
- var name = ""
- for(let i = 0; i < ids.length; i++){
-
- for(let b=0;b<this.diagnoses.length;b++){
- if(parseInt(ids[i]) == this.diagnoses[b].id){
- if(name.length == 0){
- name = this.diagnoses[b].class_name
- }else{
- name = name +"," + this.diagnoses[b].class_name
-
- }
- }
- }
-
- }
-
-
-
-
- return name
- },
- handleSelectionChange(val) {
-
- this.selecting_schs = val;
-
- },
- batchPrint(type){
- this.printType = type
- if (this.selecting_schs.length === 0) {
- this.$message.error("请至少选择一条需要打印的内容");
- return false;
- }
- this.innerVisible = true
- var sch_ids = [];
-
- for (let index = 0; index < this.selecting_schs.length; index++) {
- sch_ids.push(this.selecting_schs[index].patient_id);
- }
- console.log('sch_ids',sch_ids)
- let params = {
- record_date: this.record_date,
- patient_ids: sch_ids.join(","),
- type: type
- }
- getBatchPrint(params).then(res => {
- console.log('res',res)
- let printData = res.data.data.patients
- this.printData = printData
- })
- }
- }, created() {
- var nowDate = new Date()
- var nowYear = nowDate.getFullYear()
- var nowMonth = nowDate.getMonth() + 1
- var nowDay = nowDate.getDate()
- this.record_date =
- nowYear +
- '-' +
- (nowMonth < 10 ? '0' + nowMonth : nowMonth) +
- '-' +
- (nowDay < 10 ? '0' + nowDay : nowDay)
-
- this.org_id = this.$store.getters.xt_user.template_info.org_id
-
- this.getHisPrescriptionList()
- this.getInitData()
-
- }
- }
- </script>
|