| | |
| | | <el-form-item label="设备描述" prop=""> |
| | | {{deviceInfo.brand + " " + deviceInfo.model + " " + deviceInfo.state}} |
| | | </el-form-item> |
| | | <el-form-item label="装机时间" prop="rentTime"> |
| | | <el-form-item label="领用时间" prop="rentTime"> |
| | | <el-date-picker |
| | | v-model="formData.rentTime" |
| | | type="date" |
| | | value-format="x" |
| | | placeholder="选择装机时间" |
| | | placeholder="选择领用时间" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="备注" prop="remark"> |
| | |
| | | </el-form> |
| | | <el-button @click="submitForm" type="primary" :disabled="formLoading">领用完成</el-button> |
| | | <el-button @click="resetForm()">重 置</el-button> |
| | | <el-button @click="printBill()">打印小票</el-button> |
| | | <el-button @click="printBill(formData.patId)">打印小票</el-button> |
| | | <el-button @click="cancelInstall" :disabled="formLoading">放弃装机</el-button> |
| | | |
| | | <!-- 医生装机列表 --> |
| | |
| | | import {dateFormatter} from "@/utils/formatTime"; |
| | | import {JobRecordApi, JobRecordVO} from "@/api/ecg/jobrecord"; |
| | | import {DeviceApi, DeviceVO} from "@/api/ecg/devmanage"; |
| | | import {curDayEnd, curDayStart} from "@/utils/dateUtil"; |
| | | import {calculateAge, curDayEnd, curDayStart, formatTimestamp} from "@/utils/dateUtil"; |
| | | import {RoomBedVO} from "@/api/ecg/doctor"; |
| | | import {hiprint, defaultElementTypeProvider} from "vue-plugin-hiprint" |
| | | import {hiprint} from "vue-plugin-hiprint"; |
| | | import {AppointmentApi, AppointmentVO} from "@/api/ecg/appointment"; |
| | | import { useCheckTypeStoreWithOut } from '@/store/modules/checkType' |
| | | import {PrefixInteger} from "@/utils/formatter"; |
| | | |
| | | /** 设备领用 表单 */ |
| | | defineComponent({ name: 'DevReadyPanel' }) |
| | |
| | | const dialogVisible = ref(false) // 弹窗的是否展示 |
| | | |
| | | const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用 |
| | | |
| | | const checkTypeStore = useCheckTypeStoreWithOut() |
| | | |
| | | const formData = ref({ |
| | | id: undefined, |
| | |
| | | return |
| | | |
| | | // formDate 对应 DevRent |
| | | // formData.value = data //不能整个赋值,1.会导致 rent_id 出现从而影响后端逻辑处理,2. 默认装机时间被清空 |
| | | // formData.value = data //不能整个赋值, 默认领用时间被清空 |
| | | formData.value.id = data.id; |
| | | formData.value.patDetails = data.patDetails |
| | | } |
| | | |
| | |
| | | formData.value = await DevRentApi.getDevRent(rentId) |
| | | } |
| | | |
| | | const printBill = async () => { |
| | | // ElNotification({ |
| | | // title: '温馨提示', |
| | | // message: '待实现!', |
| | | // type: 'warning' |
| | | // }) |
| | | const printBill = async (patId: string) => { |
| | | |
| | | const curAppointment: AppointmentVO = await AppointmentApi.getCurAppointmentByPatId( patId ) |
| | | console.info( curAppointment ) |
| | | |
| | | // 引入后使用示例 |
| | | hiprint.init({ |
| | | // host: 'http://192.168.2.100:17521', |
| | | // host: 'http://192.168.2.100:17521', |
| | | token: '111111' |
| | | }); |
| | | // 下列方法都是没有拖拽设计页面的, 相当于代码模式, 使用代码设计页面 |
| | | // 想要实现拖拽设计页面,请往下看 '自定义设计' |
| | | var hiprintTemplate = new hiprint.PrintTemplate(); // 可传参数 |
| | | var panel = hiprintTemplate.addPrintPanel({ width: 100, height: 130, paperFooter: 340, paperHeader: 10 }); |
| | | //文本 |
| | | const checkTypeName = checkTypeStore.getCheckTypeName(curAppointment.bookCheckType) |
| | | panel.addPrintText({ options: { width: 140, height: 15, top: 20, left: 20, title: checkTypeName, textAlign: 'center', fontSize: 13 } }); |
| | | const patientBaisc = curAppointment.patName + " " + calGender(curAppointment.patGender) + " " + calculateAge(curAppointment.patBirthday) + "岁" |
| | | panel.addPrintText({ options: { width: 140, height: 15, top: 40, left: 20, title: patientBaisc, textAlign: 'center' , fontSize: 12} }); |
| | | const ward_bed = curAppointment.patWardDesc + "-" + curAppointment.patBedNo |
| | | panel.addPrintText({ options: { width: 140, height: 15, top: 60, left: 20, title: ward_bed, textAlign: 'center' } }); |
| | | const bookTime = formatTimestamp(curAppointment.bookDate) + " " + getBookBeginTime(curAppointment.bookTimeslot) |
| | | panel.addPrintText({ options: { width: 140, height: 15, top: 80, left: 20, title: bookTime, textAlign: 'center' } }); |
| | | panel.addPrintText({ options: { width: 140, height: 15, top: 100, left: 20, title: curAppointment.patId, textAlign: 'center' } }); |
| | | panel.addPrintText({ options: { width: 140, height: 15, top: 120, left: 20, title: curAppointment.patMobile, textAlign: 'center', fontSize: 12 } }); |
| | | //条形码 |
| | | panel.addPrintText({ options: { width: 140, height: 35, top: 140, left: 20, title: curAppointment.patId, textType: 'barcode' } }); |
| | | |
| | | //打印 |
| | | hiprintTemplate.print([{},{},{}]); // 可以传 [定位参数] http://https://ccsimple.github.io/sv-print-docs/config/template.html#%E8%87%AA%E5%AE%9A%E4%B9%89%E8%AE%BE%E8%AE%A1%E4%BD%BF%E7%94%A8%E7%A4%BA%E4%BE%8B |
| | | } |
| | | /* hiprint 示例 |
| | | // 引入后使用示例 |
| | | hiprint.init({ |
| | | // host: 'http://192.168.2.100:17521', |
| | | token: '111111' |
| | | }); |
| | | // 下列方法都是没有拖拽设计页面的, 相当于代码模式, 使用代码设计页面 |
| | |
| | | panel.addPrintText({ options: { width: 35, height: 35, top: 40, left: 165, title: '123456', textType: 'qrcode' } }); |
| | | //长文本 |
| | | panel.addPrintLongText({ options: { width: 180, height: 35, top: 90, left: 20, title: '长文本:hiprint是一个很好的webjs打印,浏览器在的地方他都可以运行' } }); |
| | | //打印 |
| | | //打印 直接打印 |
| | | hiprintTemplate.print2({}); // 可以传 [定位参数] http://https://ccsimple.github.io/sv-print-docs/config/template.html#%E8%87%AA%E5%AE%9A%E4%B9%89%E8%AE%BE%E8%AE%A1%E4%BD%BF%E7%94%A8%E7%A4%BA%E4%BE%8B |
| | | } |
| | | */ |
| | | /* 分页打印 |
| | | HiPrint.print({ |
| | | pages: [ |
| | |
| | | }); |
| | | */ |
| | | |
| | | const getBookBeginTime = (bookTimeslot: number): string => { |
| | | const hour = parseInt( bookTimeslot/1000000 ); |
| | | const minute = parseInt( bookTimeslot/10000 ) % 100; |
| | | return PrefixInteger(hour,2) + ":" + PrefixInteger(minute, 2); |
| | | } |
| | | |
| | | const calGender = (_gender: number): string => { |
| | | if (1 === _gender) |
| | | return "男" |
| | | else |
| | | return "女" |
| | | } |
| | | |
| | | const getDevInfo = async () => { |
| | | deviceInfo.value.category = '' |
| | | deviceInfo.value.brand = '' |