123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520 |
- <template>
- <div id='prescriptionPrint'>
- <div id='prescription-print' class="prescription-print" v-for="(item,index) in advicePrint" :key="index">
-
- <div style="display:flex;justify-content: space-between;font-weight:bold;align-items:center;">
- <div style="width:200px;display:flex;justify-content: space-between;font-weight:bold;">
- <span>费别</span>
- <span>自费</span>
- <span>公费</span>
- <span>保险</span>
- <span>其他</span>
- </div>
- <div>就诊日期:{{getTime(item.ctime,'{y}-{m}-{d}')}}</div>
- </div>
-
- <div class="printTitle">{{orgname}}</div>
- <div class="printTitle">处方、治疗单</div>
-
- <div class="infoTitle">
- <div>门诊编号:</div>
- <div>电脑号:</div>
- </div>
-
- <div class="infoMain">
- <div style="margin-bottom: 10px;width:25%">姓名:{{item.patient.name}}</div>
- <div style="margin-bottom: 10px;width:25%">性别:
- <span v-if="item.patient.gender == 1">男</span>
- <span v-if="item.patient.gender == 2">女</span>
- </div>
- <div style="margin-bottom: 10px;width:25%">年龄:
- <span>{{getAge(item.patient)?getAge(item.patient):""}}</span>
- </div>
- <div style="margin-bottom: 10px;width:25%">参保类型:{{hisPatient.social_type?hisPatient.social_type:''}}
- </div>
- <div style="margin-bottom: 10px;width:50%;">联系电话:{{item.patient.phone}}</div>
- <div style="width:50%;">地址:{{item.patient.unit_address}}</div>
- <div style="width:100%;">诊断:{{getDiagnosis(item.info.diagnosis)}}</div>
- </div>
-
- <div class="prescriptionBox">
- <table style="width:100%;text-align:center;line-height:25px;">
- <tr>
- <td>序号</td>
- <td>项目名称</td>
- <td>数量</td>
- <td>单位</td>
- <td>单价</td>
- <td>部位</td>
- <td>备注</td>
- <td>天数</td>
- </tr>
- <tr v-for="(it,index) in item.project" :key="index">
- <td>{{index+1}}</td>
- <td>{{it.type == 2 ? it.project.project_name : it.good_info.good_name}}</td>
- <td>{{it.count}}</td>
- <td>{{getUnit(it.unit)}}</td>
- <td>{{it.price.toFixed(2)}}</td>
- <td></td>
- <td>{{it.remark}}</td>
- <td>{{it.day}}</td>
-
- </tr>
-
- <tr v-for="(it,index) in item.advices" :key="index">
- <td>{{index+1}}</td>
- <td>{{it.advice_name?it.advice_name:''}}</td>
- <td>{{it.single_dose?it.single_dose:''}}</td>
- <td>{{it.single_dose_unit?it.single_dose_unit:''}}</td>
- <td>{{it.price.toFixed(2)}}</td>
- <td></td>
- <td>{{it.remark}}</td>
- <td>{{it.day}}</td>
-
- </tr>
- </table>
- </div>
-
- <div class="infoTitle">
- <div>开单医生:{{item.doctor?item.doctor:''}}</div>
- <div>签章:</div>
- </div>
-
- <div class="actionBar">
- <div>执行医生:{{item.doctor?item.doctor:''}}</div>
- <div>费用:{{getTotalOne(item.id).toFixed(2)?getTotalOne(item.id).toFixed(2):''}}元</div>
- </div>
-
- <table style="width:100%;text-align:center;line-height:25px;border-collapse: collapse;" border="1">
- <tr>
- <td style="width:16%;">治疗时间</td>
- <td style="width:16%;"></td>
- <td style="width:16%;"></td>
- <td style="width:16%;"></td>
- <td style="width:16%;"></td>
- <td style="width:16%;"></td>
- </tr>
- <tr>
- <td style="width:16%;">医生签字</td>
- <td style="width:16%;"></td>
- <td style="width:16%;"></td>
- <td style="width:16%;"></td>
- <td style="width:16%;"></td>
- <td style="width:16%;"></td>
- </tr>
- <tr>
- <td style="width:16px;">患者签字</td>
- <td style="width:16px;"></td>
- <td style="width:16px;"></td>
- <td style="width:16px;"></td>
- <td style="width:16px;"></td>
- <td style="width:16px;"></td>
- </tr>
- </table>
- </div>
-
-
- <!-- <div id='prescriptionPrint'>
-
- <div v-for="(item,index) in advicePrint" :key="index">
- <div id='prescription-print' class="prescription-print" style="page-break-after: always;">
- <div style="display:flex;justify-content: space-between;font-weight:bold;">
- <div style="width:200px;display:flex;justify-content: space-between;font-weight:bold;">
- <span>费别</span>
- <span>自费</span>
- <span>公费</span>
- <span>保险</span>
- <span>其他</span>
- </div>
- <div>就诊日期:{{getTime(item.ctime)}}</div>
- </div>
-
- <div class="printTitle">血液透析中心</div>
-
- <div class="printTitle">处方、治疗单</div>
-
- <div class="infoTitle">
- <div>门诊编号:</div>
- <div>电脑号:</div>
- </div>
-
- <div class="infoMain">
- <div style="margin-bottom: 10px;width:25%">姓名:{{item.patient.name}}</div>
- <div style="margin-bottom: 10px;width:25%">性别:
- <span v-if="item.patient.gender == 1">男</span>
- <span v-if="item.patient.gender == 2">女</span>
- </div>
- <div style="margin-bottom: 10px;width:25%">年龄:
- <span>{{item.patient.age}}</span>
- </div>
- <div style="margin-bottom: 10px;width:25%">参保类型:</div>
- <div style="margin-bottom: 10px;width:50%;">联系电话:{{item.patient.phone}}</div>
- <div style="width:50%;">地址:{{item.patient.unit_address}}</div>
- <div style="width:100%;">诊断:{{item.patient.diagnose}}</div>
- </div>
-
- <div class="prescriptionBox">
- <table style="width:100%;text-align:center;line-height:25px;">
- <tr>
- <td>序号</td>
- <td>项目名称</td>
- <td>数量</td>
- <td>单位</td>
- <td>单价</td>
- <td>部位</td>
- <td>备注</td>
- <td>天数</td>
- </tr>
- <tr v-for="(it,index) in item.project" :key="index">
- <td>{{index+1}}</td>
- <td>{{getProjectName(it.project_id)}}</td>
- <td>{{it.single_dose}}</td>
- <td>{{getUnit(it.unit)}}</td>
- <td>{{it.price}}</td>
- <td></td>
- <td>{{it.remark}}</td>
- <td>{{it.day}}</td>
-
- </tr>
- </table>
- </div>
- <div class="infoTitle">
- <div>开单医生:{{getDoctor(item.doctor)?getDoctor(item.doctor):""}}</div>
- <div>签章:</div>
- </div>
- <div class="actionBar">
- <div>执行医生:{{getDoctor(item.doctor)?getDoctor(item.doctor):""}}</div>
- <div>费用:</div>
- </div>
- <table style="width:100%;text-align:center;line-height:25px;border-collapse: collapse;" border="1">
- <tr>
- <td style="width:16%;">治疗时间</td>
- <td style="width:16%;"></td>
- <td style="width:16%;"></td>
- <td style="width:16%;"></td>
- <td style="width:16%;"></td>
- <td style="width:16%;"></td>
- </tr>
- <tr>
- <td style="width:16%;">医生签字</td>
- <td style="width:16%;"></td>
- <td style="width:16%;"></td>
- <td style="width:16%;"></td>
- <td style="width:16%;"></td>
- <td style="width:16%;"></td>
- </tr>
- <tr>
- <td style="width:16px;">患者签字</td>
- <td style="width:16px;"></td>
- <td style="width:16px;"></td>
- <td style="width:16px;"></td>
- <td style="width:16px;"></td>
- <td style="width:16px;"></td>
- </tr>
- </table>
- </div>
-
- </div>
-
- </div> -->
- </div>
- </template>
- <script>
- import { jsGetAge, uParseTime } from '@/utils/tools'
- import { getAllDoctorList, getPrescriptionPrint } 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: [],
- projectList: [],
- prescriptions: [],
- 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: '医保自费' }
-
- ],
- hisPatient: {},
- diagnoses: []
- }
- },
- methods: {
- 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, '-')
-
- },
- printThisPage() {
- var ptime = Math.round(new Date().getTime() / 1000)
- this.print_time = uParseTime(ptime, '{y}-{m}-{d} {h}:{i}')
-
- const style =
- '@media print {.printTitle{font-size: 22px;text-align: center;font-weight: bold;}.infoTitle{display: flex;margin-top:10px;line-height: 1px;padding:0 10px;}.infoTitle p{width: 200px;}.otherInfo{display: flex;margin-top:10px;padding:0 10px;}.otherInfo span{display:inline-block;}.recordTitle{display: flex;margin-top:10px;line-height: 24px;padding:0 10px;border-bottom: 2px solid #000;}.recordTitle p{width: 200px;}}'
- printJS({
- printable: 'prescription-print',
- type: 'html',
- style: style,
- scanStyles: false
- })
- },
- 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,
- ids: this.ids
- }
- console.log('999999', params)
- getPrescriptionPrint(params).then(response => {
- if (response.data.state == 1) {
- var advicePrint = response.data.data.advicePrint
- console.log('adviceprint', advicePrint)
- this.advicePrint = advicePrint
- this.prescriptions = advicePrint
- var projectlist = response.data.data.projectlist
- console.log('所有项目列表', projectlist)
- this.projectList = projectlist
- this.hisPatient = response.data.data.hisPatient
-
- }
- })
- },
- 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
- },
- getUnit(id) {
- var unit = ''
- for (let i = 0; i < this.projectList.length; i++) {
- if (id == this.projectList[i].id) {
- unit = this.projectList[i].unit
- }
- }
- return unit
- },
-
- getTotalOne(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
- },
- getInitData() {
- getInitData().then(response => {
- if (response.data.state == 1) {
- this.diagnoses = response.data.data.diagnose
- console.log('争端', this.diagnoses)
- }
- })
- },
- getDiagnosis(id) {
- var name = ''
- for (let i = 0; i < this.diagnoses.length; i++) {
- if (id == this.diagnoses[i].id) {
- name = this.diagnoses[i].class_name
- }
- }
- return name
- }
- },
- created() {
- this.getInitData()
- this.getAllDoctorList()
- this.getPrescriptionPrint()
- var xtuser = this.$store.getters.xt_user
- this.orgname = xtuser.org.org_name
-
- },
- watch: {
- patient_id: function(val) {
- console.log('101000010101010', this.patient_id, this.record_date, this.prescription_id)
- // this.getPrescriptionPrint()
- },
- ids: function(val) {
- this.ids = val
- console.log('this.idsids', this.ids)
- 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;
- }
-
- .prescription-print {
- font-size: 14px;
- }
-
- .printTitle {
- font-size: 18px;
- text-align: center;
- font-weight: bold;
- margin-top: 10px;
- }
-
- .infoTitle {
- display: flex;
- border-bottom: 2px solid #000;
- margin-top: 10px;
- line-height: 24px;
- padding: 0 10px;
- }
-
- .infoTitle div {
- width: 300px;
- }
-
- .infoMain {
- display: flex;
- flex-wrap: wrap;
- border-bottom: 2px solid #000;
- padding: 0 10px;
- }
-
- .infoMain div {
- width: 50%;
- line-height: 24px;
- }
-
- .prescriptionBox {
- padding: 0 10px;
- min-height: 600px;
- }
-
- .Rp {
- font-size: 22px;
- font-weight: bold;
- }
-
- .drugsBox {
- padding-left: 40px;
- margin-bottom: 10px;
- }
-
- .drugsBox p {
- line-height: 30px;
- }
-
- .drugsOne {
- line-height: 24px;
- }
-
- .drugsOne span {
- margin-right: 20px;
- }
-
- .actionBar {
- display: flex;
- justify-content: space-between;
- line-height: 24px;
- padding: 0 10px;
- }
-
- .actionBar div {
- width: 150px;
- }
- </style>
|