123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667 |
- <template>
- <div class="main-contain summaryDetail">
- <div class="position">
- <bread-crumb :crumbs='crumbs'></bread-crumb>
- </div>
- <el-popover
- placement="bottom"
- width="210"
- trigger="click">
- <el-button size="small" ref="button_two" @click="open(1)">打印清单</el-button>
- <el-button size="small" ref="button_six" @click="open(2)">打印汇总</el-button>
- <el-button slot="reference" style="margin:10px 10px;float: right" type="primary" size="small" >打印</el-button>
-
- </el-popover>
- <div class="app-container" style="display:flex;flex: 1;padding: 20px 20px 0px 20px;">
- <div class="mainCenter">
- <div class="centerLeft">
- <div class="tabsBox">
- <el-table :data="tableData" border style="width: 100%;"
- :row-style="{ color: '#303133' }"
- :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}" highlight-current-row>
-
- <el-table-column align="center" prop="project_name" label="名称">
- <template slot-scope="scope">{{ scope.row.name }}</template>
- </el-table-column>
-
- <el-table-column align="center" prop="project_name" label="分类" width="100">
- <template slot-scope="scope">{{ scope.row.type == 1?'药品': scope.row.project_type == 2? '项目':'耗材'}}</template>
- </el-table-column>
-
-
- <el-table-column align="center" prop="single_dose" width="80" label="单次用量">
- <template slot-scope="scope">{{scope.row.single_dose}} {{scope.row.single_dose_unit}}</template>
-
- </el-table-column>
- <el-table-column align="center" prop="delivery_way" width="90" label="用法">
- <template slot-scope="scope">
- <!--<el-input v-model="scope.row.delivery_way" placeholder="" readonly></el-input>-->
- {{scope.row.delivery_way}}
-
- </template>
- </el-table-column>
- <el-table-column align="center" prop="execution_frequency" width="90" label="频率">
- <template slot-scope="scope">{{scope.row.execution_frequency}}</template>
- </el-table-column>
- <el-table-column align="center" prop="number_days" width="60" label="天数">
- <template slot-scope="scope">
- <!--<el-input v-model="scope.row.number_days" placeholder="" readonly></el-input>-->
- {{scope.row.day}}天
-
- </template>
- </el-table-column>
- <el-table-column align="center" prop="total" width="60" label="总量">
- <template slot-scope="scope">{{scope.row.count}} {{scope.row.prescribing_number_unit}}</template>
- </el-table-column>
- <el-table-column align="center" prop="name" width="60" label="单价">
- <template slot-scope="scope">
- <!--<el-input v-model="scope.row.price" placeholder="" readonly></el-input>-->
- {{scope.row.price}}元
-
- </template>
- </el-table-column>
-
- <el-table-column align="center" prop="name" width="60" label="总价">
- <template slot-scope="scope">
- <!--<el-input v-model="scope.row.price" placeholder="" readonly></el-input>-->
- {{scope.row.price.toFixed(4)}}元
-
- </template>
- </el-table-column>
-
-
- <el-table-column align="center" prop="name" width="80" label="备注">
- <template slot-scope="scope">
- <!--<el-input v-model="scope.row.remark" readonly></el-input>-->
- {{scope.row.remark}}
-
- </template>
- </el-table-column>
- </el-table>
-
- <div class="additionalBox">
- <div class="additionalOne" v-for="(item,index) in additions" :key="index">
- <span :title="item.item_name">{{item.item_name}}</span>
- <el-input v-model="item.price" placeholder="" style="width:50px;" readonly></el-input>
- 共
- <el-input v-model="item.count" placeholder="" style="width:50px;" readonly></el-input>
- 次
- <!--<i class="el-icon-delete deleteIcon" @click="delAddition(index,item)"></i>-->
- </div>
- </div>
-
- </div>
- <div class="costBox">
- <span>当前处方总费用:<span style="color:red;">{{ order.medfee_sumamt.toFixed(4)}}元</span></span>
- <span v-if="order.order_status == 1">待结算</span>
- <span v-if="order.order_status == 2">已结算</span>
- <span v-if="order.order_status == 3">已退费</span>
-
-
- </div>
- </div>
- <div class="centerRight">
- <p class="centerRightTitle">人员信息</p>
- <ul class="basicUl">
- <li style="width:50%;">姓名:{{patientInfo.name}}</li>
- <li style="width:50%;">性别:{{patientInfo.gender == 1 ? '男' : '女' }}</li>
- <li style="width:50%;">年龄:{{patientInfo.age }}</li>
- <li style="width:50%;">身高:{{patientInfo.height?patientInfo.height:''}}</li>
- <li style="width:50%;">体重:{{patientInfo.weight?patientInfo.weight:''}}</li>
- <li style="width:50%;">电话:{{patientInfo.phone}}</li>
- </ul>
- <p class="centerRightTitle" style="margin-top:10px;">收费信息</p>
- <ul class="basicUl">
- <li style="width:50%;">应收金额:{{order.medfee_sumamt.toFixed(4) }}元</li>
- <li style="width:50%;">实收金额:{{order.reality_price.toFixed(4)}}元</li>
- <li style="width:50%;">舍入金额:{{order.medfee_sumamt.toFixed(4) - order.reality_price.toFixed(4)}}元</li>
- <li style="width:50%;">优惠金额:{{order.preferential_price.toFixed(4)}}元</li>
- <li style="width:50%;">总金额</li>
- <li style="width:50%;">{{order.medfee_sumamt.toFixed(4)}}元</li>
- </ul>
- <!--<p class="centerRightTitle">发票费用</p>-->
- <!--<ul class="basicUl">-->
- <!--<li style="width:100%;">西药费:0.00元</li>-->
- <!--</ul>-->
- </div>
- </div>
- </div>
-
- <div v-if="listVisible">
- <el-dialog
- class="centerDialog"
- width="900px"
- title="打印"
- :visible.sync="listVisible">
- <list-print :paramsObj='paramsObj'></list-print>
- </el-dialog>
- </div>
-
- <div v-if="allListVisible">
- <el-dialog
- class="centerDialog"
- width="900px"
- title="打印"
- :visible.sync="allListVisible">
- <all-list-print :paramsObj='paramsObj'></all-list-print>
- </el-dialog>
- </div>
-
-
- </div>
- </template>
-
-
- <script>
- import BreadCrumb from '@/xt_pages/components/bread-crumb'
- import { getHisOrder } from '@/api/his/his'
- import prescriptionTable from './components/prescriptionTable'
- import { getDictionaryDataConfig} from "@/utils/data";
- import ListPrint from './listPrint'
- import AllListPrint from './allListPrint'
-
- export default {
- components:{
- AllListPrint,
- ListPrint,
- BreadCrumb,
- prescriptionTable,
-
- },
- data(){
- return{
- listVisible:false,
- allListVisible:false,
- paramsObj:{
- id:this.$route.query.id,
- balance_accounts_type:0
- },
- crumbs: [
- { path: false, name: '门诊收费' },
- { path: false, name: '项目消费明细汇总详情' }
- ],
- info: {},
- curPrescriptions: {},
- prescriptions: [],
- record_date: '',
- tableData: [],
- additions:[],
- editableTabsValue: '1',
- loadingone: false,
- editableTabs: [{
- title: '处方1',
- name: '1'
- }],
- tabIndex: 1,
- hisPatientInfo: {},
- loadingtwo: false,
- patientTableData: [{
- name: '杨美英',
- mdtrt_id: '1709946'
- }],
- patientInfo: { id: 0 },
- doctor: {},
- total: 0,
- state: '未收费',
- radio: 1,
- radioStatus: 1,
- search_input: '',
- order:{},
- }
- },created(){
- this.GetOrderDetail()
- },methods:{
- open(val){
- if(val == 1){
- this.paramsObj.id == this.$route.query.id
- this.paramsObj.balance_accounts_type = this.hisPatientInfo.balance_accounts_type
- this.listVisible = true
-
- }else if(val == 2){
- this.paramsObj.id == this.$route.query.id
- this.paramsObj.balance_accounts_type = this.hisPatientInfo.balance_accounts_type
-
- this.allListVisible = true
- }
- },
- // getTotal() {
- // var total = 0
- // for (let i = 0; i < this.prescriptions.length; i++) {
- // if (this.prescriptions[i].advices != null) {
- // for (let a = 0; a < this.prescriptions[i].advices.length; a++) {
- // console.log(this.prescriptions[i].advices[a].price )
- // console.log(this.prescriptions[i].advices[a].prescribing_number)
- //
- // total = parseFloat(total) + parseFloat(this.prescriptions[i].advices[a].price * this.prescriptions[i].advices[a].prescribing_number)
- // }
- // }
- // if (this.prescriptions[i].project != null) {
- // for (let a = 0; a < this.prescriptions[i].project.length; a++) {
- //
- // total = parseFloat(total) + parseFloat(this.prescriptions[i].project[a].price * this.prescriptions[i].project[a].count)
- // }
- // }
- //
- // if (this.prescriptions[i].addition != null) {
- // for (let b = 0; b < this.prescriptions[i].addition.length; b++) {
- // total = parseFloat(total) + parseFloat(this.prescriptions[i].addition[a].price * this.prescriptions[i].addition[b].count)
- // }
- // }
- // }
- // return total.toFixed(2)
- //
- // },
- getDictionaryDataConfig(module, filed_name) {
- return getDictionaryDataConfig(module, filed_name)
- },
- tabclickEvent(val) {
- for (let i = 0; i < this.prescriptions.length; i++) {
- if (this.prescriptions[i].name == val.name) {
- this.curPrescriptions = {}
- var temp = this.deepClone(this.prescriptions[i])
- this.curPrescriptions = temp
- }
- }
- },
- deepClone(source) {
- if (!source && typeof source !== 'object') {
- throw new Error('error arguments', 'shallowClone')
- }
- const targetObj = source.constructor === Array ? [] : {}
- Object.keys(source).forEach((keys) => {
- if (source[keys] && typeof source[keys] === 'object') {
- targetObj[keys] = this.deepClone(source[keys])
- } else {
- targetObj[keys] = source[keys]
- }
- })
- return targetObj
- }, getGroup(id){
- var name = ""
- var statistics_category = getDictionaryDataConfig('system','statistics_category')
- for(let i=0;i<statistics_category.length;i++){
- if(id == statistics_category[i].id){
- name = statistics_category[i].name
- }
- }
- return name
- },
- getTotal() {
- var total = 0
- for (let i = 0; i < this.prescriptions.length; i++) {
- if (this.prescriptions[i].advices != null) {
- for (let a = 0; a < this.prescriptions[i].advices.length; a++) {
- total = total + this.prescriptions[i].advices[a].retail_price * this.prescriptions[i].advices[a].prescribing_number
- }
- }
- if (this.prescriptions[i].project != null) {
- for (let b = 0; b < this.prescriptions[i].project.length; b++) {
- total = total + this.prescriptions[i].project[b].price * this.prescriptions[i].project[b].total
- }
- }
- }
- return total
- },
- moreState(tab, event) {
- if (tab == 'more') {
- return false
- }
- }, unique(array) {
- // res用来存储结果
- var res = []
- for (var i = 0, arrayLen = array.length; i < arrayLen; i++) {
- for (var j = 0, resLen = res.length; j < resLen; j++) {
- if (array[i].id === res[j].id && array[i].price === res[j].price) {
- break
- }
- }
- // 如果array[i]是唯一的,那么执行完循环,j等于resLen
- if (j === resLen) {
- res.push(array[i])
- }
- }
- return res
- },
- setMonthPrescription(month_prescriptions) {
- console.log(month_prescriptions)
- let drug_month_prescriptions = {
- advices: []
- }
- let drug_ids = []
- let project_month_prescriptions = {
- project: []
-
- }
- let project_ids = []
-
- let addition_month_prescriptions = {
- addition: []
-
- }
- let additions_ids = []
-
- for (let i = 0; i < month_prescriptions.length; i++) {
- if (month_prescriptions[i].type == 1) { //药品
- for (let a = 0; a < month_prescriptions[i].advices.length; a++) {
- let obj = {
- id: month_prescriptions[i].advices[a].drug_id,
- price: month_prescriptions[i].advices[a].price
-
- }
- drug_ids.push(obj)
- drug_month_prescriptions.advices.push(month_prescriptions[i].advices[a])
- }
-
- } else if (month_prescriptions[i].type == 2) { //项目
- for (let a = 0; a < month_prescriptions[i].project.length; a++) {
- let obj = {
- id: month_prescriptions[i].project[a].project_id,
- price: month_prescriptions[i].project[a].price
-
- }
- project_ids.push(obj)
- project_month_prescriptions.project.push(month_prescriptions[i].project[a])
- }
- }
- //附加收费
- for (let a = 0; a < month_prescriptions[i].addition.length; a++) {
- let obj = {
- id: month_prescriptions[i].addition[a].item_id,
- price: month_prescriptions[i].addition[a].price
-
- }
- additions_ids.push(obj)
- addition_month_prescriptions.addition.push(month_prescriptions[i].addition[a])
-
- }
-
- }
-
- drug_ids = this.unique(drug_ids)
- project_ids= this.unique(project_ids)
- additions_ids= this.unique(additions_ids)
-
-
-
-
-
- for (let i = 0; i < drug_ids.length; i++) {
- let obj = {}
- let count = 0
- for (let a = 0; a < drug_month_prescriptions.advices.length; a++) {
- if (drug_ids[i].price == drug_month_prescriptions.advices[a].price && drug_ids[i].id == drug_month_prescriptions.advices[a].drug_id) {
- obj['name'] = drug_month_prescriptions.advices[a].advice_name
- obj['statistical_classification'] = ''
- obj['type'] = 1
- obj['single_dose'] = drug_month_prescriptions.advices[a].single_dose
- obj['delivery_way'] = drug_month_prescriptions.advices[a].delivery_way
- obj['execution_frequency'] = drug_month_prescriptions.advices[a].execution_frequency
- obj['day'] = drug_month_prescriptions.advices[a].day
- obj['prescribing_number_unit'] = drug_month_prescriptions.advices[a].prescribing_number_unit
- obj['remark'] = drug_month_prescriptions.advices[a].remark
- obj['price'] = parseFloat(drug_month_prescriptions.advices[a].price)
- count = count + drug_month_prescriptions.advices[a].prescribing_number
-
- }
- }
- obj['count'] = count
- this.tableData.push(obj)
- }
-
- for (let i = 0; i < project_ids.length; i++) {
- let obj = {}
- let count = 0
- for (let a = 0; a < project_month_prescriptions.project.length; a++) {
- if (project_ids[i].price == project_month_prescriptions.project[a].price &&project_ids[i].id == project_month_prescriptions.project[a].project_id ) {
-
- if(project_month_prescriptions.project[a].type == 2){
- obj['name'] = project_month_prescriptions.project[a].project.project_name
- obj['statistical_classification'] = ''
- obj['project_type'] = 2
-
-
- }else if (project_month_prescriptions.project[a].type == 3){
- obj['name'] = project_month_prescriptions.project[a].good_info.good_name
- obj['statistical_classification'] = ''
- obj['project_type'] = 3
- }
- obj['single_dose'] = project_month_prescriptions.project[a].single_dose
- obj['delivery_way'] = project_month_prescriptions.project[a].delivery_way
- obj['execution_frequency'] = project_month_prescriptions.project[a].execution_frequency
- obj['day'] = project_month_prescriptions.project[a].day
- obj['single_dose_unit'] = project_month_prescriptions.project[a].unit
- obj['prescribing_number_unit'] = project_month_prescriptions.project[a].unit
- count = count + project_month_prescriptions.project[a].count
- obj['price'] = parseFloat(project_month_prescriptions.project[a].price)
- obj['remark'] = project_month_prescriptions.project[a].remark
- obj['type'] = 2
-
-
- }
- }
- obj['count'] = count
- this.tableData.push(obj)
-
- }
-
- for (let i = 0; i < additions_ids.length; i++) {
- let obj = {}
- let count = 0
- console.log(addition_month_prescriptions.addition)
- if (addition_month_prescriptions.addition) {
- for (let a = 0; a < addition_month_prescriptions.addition.length; a++) {
- if (additions_ids[i].price == addition_month_prescriptions.addition[a].price &&additions_ids[i].id == addition_month_prescriptions.addition[a].item_id) {
- obj['item_name'] = addition_month_prescriptions.addition[a].item_name
- count = count + addition_month_prescriptions.addition[a].count
- obj['price'] = parseFloat(addition_month_prescriptions.addition[a].price)
- }
- }
- obj['count'] = count
- this.additions.push(obj)
-
- }
- }
-
- },
-
- GetOrderDetail(){
- let params={
- number:this.$route.query.number,
- patient_id:this.$route.query.patient_id,
- }
- getHisOrder(params).then(response => {
- if (response.data.state == 0) {
- this.$message.error(response.data.msg)
- return false
- } else {
- this.patientInfo = response.data.data.order.patient
- this.hisPatientInfo = response.data.data.order.his_patient
- this.info = response.data.data.p_info
- this.order = response.data.data.order
-
- this.prescriptions = []
- this.tableData = []
-
-
- var prescription = response.data.data.prescription
- this.prescriptions = prescription
- this.setMonthPrescription(prescription)
-
-
- // for (let i = 0; i < response.data.data.prescription.length; i++) {
- // var prescription = response.data.data.prescription[i]
-
-
- // for (let b = 0; b < prescription.advices.length; b++) {
- // let obj = {
- // name: prescription.advices[b].advice_name,
- // statistical_classification:"",
- // type:1,
- // single_dose: prescription.advices[b].single_dose,
- // delivery_way: prescription.advices[b].delivery_way,
- // execution_frequency: prescription.advices[b].execution_frequency,
- // price: prescription.advices[b].price.toString(),
- // day: prescription.advices[b].day,
- // count:prescription.advices[b].prescribing_number.toString(),
- // remark: prescription.advices[b].remark,
- // single_dose_unit: prescription.advices[b].single_dose_unit,
- // prescribing_number_unit: prescription.advices[b].prescribing_number_unit,
- //
- // }
- // this.tableData.push(obj)
- // }
- //
- // for (let b = 0; b < prescription.project.length; b++) {
- // let obj = {
- // name: prescription.project[b].project.project_name,
- // statistical_classification: prescription.project[b].project.statistical_classification,
- // single_dose: prescription.project[b].single_dose,
- // delivery_way: prescription.project[b].delivery_way,
- // execution_frequency: prescription.project[b].execution_frequency,
- // price: prescription.project[b].price,
- // day: prescription.project[b].day,
- // count: prescription.project[b].count.toString(),
- // remark: prescription.project[b].remark,
- // single_dose_unit:prescription.project[b].project.unit,
- // prescribing_number_unit:prescription.project[b].project.unit,
- // type:2,
- // }
- // this.tableData.push(obj)
- // }
- //
- // for (let b = 0; b < prescription.addition.length; b++) {
- // this.additions.push( prescription.addition[b])
- // }
-
-
-
- // let index = i + 1
- // let obj = {
- // id: prescription.id,
- // name: '处方' + index,
- // advices: tempAdvice,
- // project: tempProject,
- // type: response.data.data.prescription[i].type
- // }
- // this.prescriptions.push(obj)
- // this.curPrescriptions = this.prescriptions[0]
-
- // }
- // this.tableData = response.data.data.order
-
- }
- })
- }
- }
- }
- </script>
-
- <style lang="scss" scoped>
- .summaryDetail{
- height: 100%;
- display: flex;
- flex-direction: column;
- .tabsBox{
- position: relative;
- height: 90%;
- overflow-y: auto;
- margin-bottom: 60px;
- .el-tabs__item{
- padding: 0 10px;
- }
- }
- .addTab{
- position: absolute;
- right: 0;
- top: 6px;
- z-index: 20;
- }
- .mainCenter{
- display: flex;
- flex:1;
- }
- .costBox{
- width:100%;
- height:60px;
- background:#fff;
- position: absolute;
- bottom:0;
- display: flex;
- justify-content: space-between;
- align-items: center;
- }
- .centerLeft{
- flex: 1;
- display: flex;
- flex-direction: column;
- position: relative;
- }
- .centerRight{
- width: 300px;
- margin-left: 5px;
- display: flex;
- flex-direction: column;
- }
- .RP{
- color:#409EFF;
- font-size: 20px;
- margin-bottom: 5px;
- }
- .centerRightTitle{
- color:#409EFF;
- padding:0 0 10px 0;
- }
- .basicUl{
- border-top: 1px solid #e5e5e5;
- border-left: 1px solid #e5e5e5;
- display: flex;
- flex-wrap: wrap;
- li{
- border-bottom: 1px solid #e5e5e5;
- border-right: 1px solid #e5e5e5;
- width: 100%;
- height: 38px;
- line-height: 38px;
- text-indent: 5px;
- font-size: 14px;
- }
- }
- .additionalBox{
- margin-top: 20px;
- display: flex;
- flex-wrap: wrap;
- .additionalOne{
- margin-right:20px;
- margin-bottom:10px;
- display: flex;
- align-items: center;
- >span{
- white-space: nowrap;
- overflow: hidden;
- text-overflow: ellipsis;
- width:80px;
- display: inline-block;
- font-size: 14px;
- }
- }
- .deleteIcon{
- color:red;
- margin-left:5px;
- }
- }
- }
- </style>
-
- <style lang="scss">
- .summaryDetail{
- .el-table th .cell, .el-table td .cell{
- padding: 0 2px;
- }
- .el-icon-delete{
- color:red;
- }
- }
-
- </style>
-
|