123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522 |
- <template>
- <div>
- <div id='prescriptionPrint1'>
- <div v-for="(item,index) in advicePrint" :key="index">
- <div id='prescription-print' v-if="item.project.length == 0" v-for='(i,pageIndex) in item.pageArr.length' :key="pageIndex" class="prescription-print" style="page-break-after: always;">
- <img src="https://kuyi.shengws.com/bailin/bltotle.jpg" style="width:100%" alt="">
- <div class="printTitle">
- 处方笺
- <span v-if="item.med_type == '1111'" style="margin-left: 50px;border: 1px solid #000;">精一</span>
- <span v-if="item.med_type == '1112'" style="margin-left: 50px;border: 1px solid #000;">精二</span>
- </div>
- <div style="display:flex;">
- <div style="width:33%;display:flex;">费别:<span class="under_line"><span>{{ faber && faber.transBody ? getName(faber.transBody.outputlist1) : '自费' }}</span></span></div>
- <div style="width:33%;display:flex;">电脑号:<span class="under_line">{{ faber && faber.transBody ? faber.transBody.aac999 : '' }}</span></div>
- <div style="width:33%;display:flex;">处方编号:<span class="under_line">{{ item.prescription_number.substring(item.prescription_number.length-6) }}</span></div>
- </div>
-
-
- <div class="infoTitle">
- <div>姓名:{{item.patient.name? item.patient.name.indexOf("(") > -1 ? item.patient.name.substring(0,item.patient.name.indexOf("(")) : item.patient.name :""}}</div>
- <div>性别:
- <span v-if="item.patient.gender == 1">男</span>
- <span v-if="item.patient.gender == 2">女</span>
- </div>
- <div>年龄:{{getNewAge(item.patient.birthday)?getNewAge(item.patient.birthday):""}}岁</div>
- </div>
- <div class="infoMain">
- <div style="margin-bottom: 10px;display:flex;">门诊号码:<span class="under_line" v-if="hisPatient.number">{{hisPatient.number?hisPatient.number:""}}</span></div>
- <div style="margin-bottom: 10px;display:flex;">科别:<span class="under_line" v-if="item.info">{{item.info?getDepart(item.info.departments):''}}</span></div>
- <div style="margin-bottom: 10px;display:flex;">临床诊断:{{ item.info.diagnosis ? getDiagnosis(item.info.diagnosis) : ''}}</div>
- <div style="margin-bottom: 10px;display:flex;">自费药品签名:<span class="under_line"></span></div>
- <!-- <div style="margin-bottom: 10px;display:flex;">医保卡号:{{item.hisPatient.number?item.hisPatient.number:""}}</div> -->
- <div style="margin-bottom: 10px;display:flex;">联系方式:<span class="under_line">{{item.patient.phone}}</span></div>
- <div style="margin-bottom: 10px;display:flex;">开具日期:<span class="under_line">{{getTime(item.pre_time) ? getTime(item.pre_time).split(' ')[0] : ''}}</span></div>
- <!-- <div>地址:{{item.patient.home_address}}</div> -->
- <!-- <div style="display:flex;width:50%;">临床诊断:{{getDiagnosis(item.info.diagnosis)}}</div> -->
- </div>
- <div class="prescriptionBox">
- <div class="Rp">Rp:</div>
- <div class="drugsBox" v-for="(it,index) in item.advices.slice(pageIndex * 5,(pageIndex * 5) + item.pageArr[pageIndex])" :key="index">
- <!-- <div class="drugsOne"><span style="font-weight:bold;">{{ index+1 + '.' }}</span>{{it.advice_name?it.advice_name:""}} {{it.single_dose}}{{it.single_dose_unit}} × {{it.prescribing_number}}{{it.prescribing_number_unit}}</div> -->
- <div class="drugsOne"><span style="font-weight:bold;">{{ index+1 + '.' }}</span>{{it.advice_name?it.advice_name:""}} <span v-if="it.drug.min_unit != it.drug.dose_unit">{{it.drug.dose}}{{it.drug.dose_unit}} * </span>{{it.drug.min_number}}{{it.drug.min_unit}}/{{it.drug.max_unit}} × {{it.prescribing_number}}{{it.prescribing_number_unit}}</div>
- <div style="margin-left:100px;"><span>用法:{{it.single_dose}}{{it.single_dose_unit}}</span> <span>{{it.execution_frequency}} {{it.delivery_way}} </span> <span>{{it.advice_desc}}</span></div>
- </div>
- <div class="drugsBox" v-for="(it,i) in item.additionalcharge" :key="i">
- <div class="drugsOne">{{it.item_name?it.item_name:""}}: {{it.price.toFixed(4)}}元/{{it.count}}次</div>
- </div>
-
- <!-- <div class="drugsBox" v-for="(it,index) in item.project" :key="index">
- <div class="drugsOne"><span style="font-weight:bold;">{{ index+1 + '.' }}</span>{{ it.type == 2 ? it.project.project_name : it.good_info.good_name }} {{it.single_dose}}{{it.single_dose_unit}} × {{it.count}}{{unit}}</div>
- <div style="margin-left:100px;"><span>用法:{{it.single_dose}}{{it.single_dose_unit}}</span> <span>{{it.delivery_way}}</span> <span>{{it.advice_desc}}</span></div>
- </div>
- <div class="drugsBox" v-for="(it,i) in item.additionalcharge" :key="i">
- <div class="drugsOne">{{it.project_id?it.project_id:""}}: {{it.price}}元/{{it.count}}次</div>
- </div> -->
- <div style="text-align:center;" >(以下空白)</div>
-
- </div>
- <div style="display:flex;">
- <div>医 师:<span style="width:100px;display:inline-block;">{{item.doctor?item.doctor:""}}</span></div>
- <!-- <div>药品金额:{{getTotalOne(item.id).toFixed(2)?getTotalOne(item.id).toFixed(2):0}}</div> -->
- </div>
- <div style="display:flex;">
- <div style="display:flex;">审核药师:<span style="width:100px" class="under_line"></span></div>
- <div style="display:flex;">调剂药师:<span style="width:100px" class="under_line"></span></div>
- <div style="display:flex;">核对/发药药师:<span style="width:100px" class="under_line"></span></div>
- </div>
- <div>
- 打印日期:{{getTime(new Date())?getTime(new Date()):""}}
- </div>
- <div>*处方当日有效,特殊情况可适当延长,一般不超过3天</div>
- <div>*药品属于特殊商品,非质量问题不允许退换</div>
- <img src="https://kuyi.shengws.com/bailin/blend.jpg" style="width:100%" alt="">
- <!-- <div class="doctorBox">
- <p>医师:{{item.doctor?item.doctor:""}}</p>
- <p>日期:{{getTime(item.ctime)?getTime(item.ctime):""}}</p>
- </div>
- <div class="actionBar">
-
- <p>审核:</p>
- <p>配对:</p>
- <p>核对:</p>
- <p>发药:</p>
- <p>药费:{{getTotalOne(item.id).toFixed(2)?getTotalOne(item.id).toFixed(2):0}}元</p>
- </div> -->
- <div style="page-break-after:always"></div>
- </div>
- </div>
-
- </div>
- </div>
-
- </template>
- <script>
- import { jsGetAge, uParseTime } from '@/utils/tools'
- import {getAllDoctorList,getPrescriptionPrint,getHisPatientDetail} from "@/api/project/project"
- import {getInitData} from "@/api/his/his"
- export default {
- props:{
- patient_id:Number,
- record_date:String,
- prescription_id:Number,
- ids:String
- },
- data(){
- return {
- doctorList:[],
- advicePrint:{},
- patient:{},
- tableData:[],
- prescriptionInfo:[],
- hisPatient:{},
- department:[],
- prescriptions:[],
- projectList:[],
- orgname:"",
- diagnoses:[],
- pageArr:[],
- faber:{}
- }
- },
- methods:{
- getNewAge(birthday){
- // var myDate = new Date(birthday * 1000)
- // var month = myDate.getMonth() + 1
- // var day = myDate.getDate()
- // var age = new Date().getFullYear() - myDate.getFullYear()
- // if (month < new Date().getMonth() + 1 || new Date().getMonth() + 1 == month && day <= new Date().getDate()) {
- // age++
- // }
- // return age
- var nowTime = new Date().getTime();
- //一年毫秒数(365 * 86400000 = 31536000000)
- return Math.ceil((nowTime-(birthday * 1000))/31536000000);
- },
- getAge(patient){
- var thisLen = patient.id_card_no.length
- var birth = ''
- if (thisLen == 15) {
- birth = '19' + patient.id_card_no.substr(6, 6)
- } else {
- birth = patient.id_card_no.substr(6, 8)
- }
- var births =
- birth.substr(0, 4) +
- '-' +
- birth.substr(4, 2) +
- '-' +
- birth.substr(6, 2)
- return jsGetAge(births, '-')
-
- },
-
- getAllDoctorList(){
- getAllDoctorList().then(response=>{
- if(response.data.state == 1){
- var doctor = response.data.data.doctor
-
- this.doctorList = doctor
- }
- })
- },
-
- getDoctor(id){
- var name = ""
- for(let i=0;i<this.doctorList.length;i++){
- if(id == this.doctorList[i].admin_user_id){
- name = this.doctorList[i].user_name
- }
- }
- return name
- },
- getTime(value, temp) {
- if (value != undefined) {
- return uParseTime(value, temp)
- }
- return ''
- },
- getPrescriptionPrint(){
- var params = {
- // patient_id:this.patient_id,
- // record_date:this.record_date,
- // prescription_id:this.prescription_id,
- patient_id:this.patient_id,
- record_date:this.record_date,
- prescription_id:this.prescription_id,
- ids:this.ids
- }
- console.log("params",params)
- getPrescriptionPrint(params).then(response=>{
- if(response.data.state == 1){
- var advicePrint = response.data.data.advicePrint
- console.log("adviceprint9999",advicePrint)
- this.advicePrint = advicePrint
- this.getPage()
- this.prescriptions = advicePrint
- console.log("处方222222",this.prescriptions)
- var hisPatient = response.data.data.hisPatient
- console.log("hisPatient",hisPatient)
- this.hisPatient = hisPatient
- var projectlist = response.data.data.projectlist
- console.log("所有项目列表",projectlist)
- this.projectList = projectlist
-
- let outputlist1Name = response.data.data.his.patient_info ? JSON.parse(response.data.data.his.patient_info) : {};
- this.faber = outputlist1Name
-
-
- }
- })
- },
- getHisPatientDetail(){
- const params = {
- patient_id:this.patient_id
- }
- getHisPatientDetail(params).then(response=>{
- if(response.data.state == 1){
- var hisPatient = response.data.data.hisPatient
- console.log("挂号病人",hisPatient)
- this.hisPatient = hisPatient
- }
- })
- },
- getInitData(){
- getInitData().then(response=>{
- if(response.data.state == 1){
- this.department = response.data.data.department
- this.diagnoses = response.data.data.diagnose.sort(this.compare('id'))
- console.log("争端",this.diagnoses)
- }
- })
- },
- getDepart(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
- },
- getTotalOne(id) {
- console.log('id',id)
- var total = 0
- var addtotal = 0
- for (let i = 0; i < this.prescriptions.length; i++) {
- if(id == this.prescriptions[i].id){
- if (this.prescriptions[i].project != null) {
- for (let a = 0; a < this.prescriptions[i].project.length; a++) {
- total = total + this.prescriptions[i].project[a].price * this.prescriptions[i].project[a].count
- }
- }
-
- if (this.prescriptions[i].additionalcharge != null) {
- for (let a = 0; a < this.prescriptions[i].additionalcharge.length; a++) {
- addtotal = addtotal + this.prescriptions[i].additionalcharge[a].price * this.prescriptions[i].additionalcharge[a].count
- }
- }
- addtotal = Math.floor(addtotal * 100) / 100
- }
-
- }
-
- for (let i = 0; i < this.prescriptions.length; i++) {
- if(id == this.prescriptions[i].id){
- if (this.prescriptions[i].advices != null) {
- for (let a = 0; a < this.prescriptions[i].advices.length; a++) {
- total = total + this.prescriptions[i].advices[a].price * this.prescriptions[i].advices[a].prescribing_number
- }
- }
-
- if (this.prescriptions[i].additionalcharge != null) {
- for (let a = 0; a < this.prescriptions[i].additionalcharge.length; a++) {
- addtotal = addtotal + this.prescriptions[i].additionalcharge[a].price * this.prescriptions[i].additionalcharge[a].count
- }
- }
- addtotal = Math.floor(addtotal * 100) / 100
- }
- }
-
- return total + addtotal
- },
-
- getProjectName(id){
- var project_name = ""
- for(let i=0;i<this.projectList.length;i++){
- if(id == this.projectList[i].id){
- project_name = this.projectList[i].project_name
- }
- }
- return project_name
- },
-
- getDiagnosis(ids){
- let newIds = ids.split(',').sort(function(a,b){
- return a-b;
- })
- var name = ""
- let nameArr = []
- for(let i=0;i<this.diagnoses.length;i++){
- // if(id == this.diagnoses[i].id){
- // name = this.diagnoses[i].class_name
- // }
-
- if(newIds.indexOf(this.diagnoses[i].id.toString()) > -1){
- // name += diagnoses[i].class_name + ' '
- nameArr.push(this.diagnoses[i].class_name)
- }
- }
- let newNameArr = []
- nameArr.map((item,index) => {
- if(item == '尿毒症'){
- newNameArr.push(item)
- nameArr.splice(index,1,'')
- }
- })
- newNameArr.push(...nameArr)
- return newNameArr.join(' ')
- },
- compare(property) {
- return function(a,b){
- var value1 = a[property];
- var value2 = b[property];
- return value1 - value2;//升序排序
- }
- },
- getPage(){
- this.page = 1
- this.pageArr = []
-
- this.advicePrint.map(item => {
- let arr = []
- item.pageArr = []
- if(item.advices.length <= 5){
- this.page = 1
- arr.push(item.advices.length)
- item.pageArr.push(arr)
-
- }else if(item.advices.length > 5){
- this.page = parseInt(item.advices.length / 5)
- let num = item.advices.length % 5
- for (var i=0;i<this.page;i++){
- item.pageArr.push([5])
- }
- if(num != 0){
- item.pageArr.push([num])
- }
- }
- })
- // console.log('this.pageArr',this.pageArr)
- },
- getName(list) {
- console.log('list',list)
- let new_list = []
- for (let i = 0; i < list.length; i++) {
- if (list[i].aac031 == '1') {
- new_list.push(list[i])
- }
- }
-
- switch (new_list[0].bcc334) {
- case "A31001":
- return "深圳医保1档"
- break
- case "A31002":
- return "深圳医保2档"
-
- break
- case "A31003":
- return "深圳医保3档"
-
- break
- case "A31004":
- return "二档(少儿)"
-
- break
- case "A31005":
- return "学生二档"
-
- break
- case "A31006":
- return "大学生二档"
-
- break
- case "A32001":
- return "在职公务员"
- break
- case "A32002":
- return "在职驻深公务员"
-
- break
- case "A39301":
- return "家属统筹医疗"
-
- break
- case "A41001":
- return "工伤在职"
-
- break
- case "A51001":
- return "生育在职"
-
- break
- case "A52001":
- return "生育医疗一档"
-
- break
- case "A52002":
- return "生育医疗一档"
-
- break
- case "C31001":
- return "一档医疗退休"
-
- break
- case "C31002":
- return "二档医疗退休"
- break
-
- }
-
-
-
- },
-
- },
- created(){
- this.getPrescriptionPrint()
- this.getAllDoctorList()
- this.getInitData()
-
- this.getHisPatientDetail()
- var xtuser = this.$store.getters.xt_user;
- this.orgname = xtuser.org.org_name;
-
- },
- watch:{
- ids:function(val){
- console.log('val1111111111111111111111111111',val)
- this.ids = val
- this.getPrescriptionPrint()
- }
- }
- }
- </script>
-
-
- <style lang="scss" scoped>
- .prescription-print{
- -webkit-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.27), 0 0 60px rgba(0, 0, 0, 0.06) inset;
- -moz-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.27), 0 0 40px rgba(0, 0, 0, 0.06) inset;
- box-shadow: 0 1px 4px rgba(0, 0, 0, 0.27), 0 0 40px rgba(0, 0, 0, 0.06) inset;
- margin-bottom: 20px;
- padding:20px 10px;
- }
- .printTitle{
- font-size: 22px;
- text-align: center;
- font-weight: bold;
- margin-bottom: 10px;
- }
- .infoTitle{
- display: flex;
- margin-top:10px;
- line-height: 24px;
- }
- .infoTitle div{
- width: 200px;
- }
- .infoMain{
- display: flex;
- flex-wrap: wrap;
- margin-top:10px;
- }
- .infoMain div{
- width: 50%;
- line-height: 24px;
- }
- .prescriptionBox{
- padding:0 10px;
- min-height:400px;
- }
- .Rp{
- font-size: 22px;
- 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;
- }
- </style>
|