提交merge1.3

This commit is contained in:
2025-12-27 15:30:25 +08:00
parent 8c607c8749
commit 088861f66e
1245 changed files with 220442 additions and 77616 deletions

View File

@@ -67,9 +67,7 @@
</el-card>
<el-card style="width: 60%">
<div>
<el-button size="default" type="primary" @click="openAddTprDialog"
>新增</el-button
>
<el-button size="default" type="primary" @click="openAddTprDialog">新增</el-button>
</div>
<div class="business-temperature-sheet" style="width: 60%">
<div>
@@ -133,7 +131,7 @@
@close="closePatientDetialDialog"
/>
<!-- </div> -->
<iframe id="printIframe" ref="printIframe" style="display:none;"></iframe>
<iframe id="printIframe" ref="printIframe" style="display: none"></iframe>
</div>
</template>
@@ -173,7 +171,7 @@ const queryParams = ref({
orgId: userStore.orgId,
});
const data1 = reactive({
const data1 = reactive({
patientInfo: {},
grParamBOS: {
age: '',
@@ -192,10 +190,10 @@ const data1 = reactive({
total: '',
hospDate: '',
operaDate: '',
outdate: ''
outdate: '',
},
rows: [],
types: []
types: [],
});
const patientData = ref({});
const integerPoints = [2, 6, 10, 14, 18, 22];
@@ -268,7 +266,7 @@ function init1(data) {
console.log('体温单初始化', data);
const inDate = data.grParamBOS.hospDate;
const outdate = data.grParamBOS.outdate;
week.value = Math.floor(dateDiff(inDate, outdate) / 7);
week.value = Math.floor(dateDiff(inDate, outdate) / 10);
setTemperatureComp(data);
}
@@ -276,6 +274,8 @@ function init1(data) {
* 点击患者列表行 获取患者体温单数据
*/
function viewPatient(row) {
console.log('1232312123221231');
patientInfo.value = row;
console.log('点击患者列表行 获取患者体温单数据', row);
chargeLoading.value = true;
@@ -375,7 +375,7 @@ function getSignsCharts() {
function getPatientList() {}
// 体温单控件数据设置
function setTemperatureComp(data) {
console.log(data,'体温单控件数据设置');
console.log(JSON.stringify(), '体温单控件数据设置');
if (data !== undefined) {
inputData.value = data;
}
@@ -434,12 +434,12 @@ function sliceData(data) {
const datas = cloneDeep(data);
datas.rows = rows;
datas.types = types;
console.log(datas,"666666666666666666")
console.log(datas, '666666666666666666');
return datas;
}
// 计算时间差
function dateDiff(start, end) {
let diffTime = start ? moment(new Date()).diff(moment(start.substring(0, 10))) / 1000 :start;
let diffTime = start ? moment(new Date()).diff(moment(start.substring(0, 10))) / 1000 : start;
if (end) {
diffTime = moment(end.substring(0, 10)).diff(moment(start.substring(0, 10))) / 1000;
}
@@ -475,39 +475,45 @@ function printPage() {
clone.style.transformOrigin = 'top left';
clone.style.width = 'calc(210mm * 1.11)';
clone.style.height = 'calc(297mm * 1.11)';
clone.style.marginLeft = '50px';
clone.style.marginLeft = '50px';
// 插入到 body 中以便 html2pdf 渲染
document.body.appendChild(clone);
// 设置 html2pdf 配置
const opt = {
margin: 0,
filename: '体温单.pdf',
image: { type: 'jpeg', quality: 1 },
html2canvas: { scale: 2, useCORS: true }, // 启用跨域资源支持
jsPDF: { unit: 'mm', format: 'a4', orientation: 'portrait' },
pagebreak: { mode: ['avoid-all'] },
margin: 0,
filename: '体温单.pdf',
image: { type: 'jpeg', quality: 1 },
html2canvas: { scale: 2, useCORS: true }, // 启用跨域资源支持
jsPDF: { unit: 'mm', format: 'a4', orientation: 'portrait' },
pagebreak: { mode: ['avoid-all'] },
onclone: (clonedDoc) => {
const chart = clonedDoc.getElementById(clone.id);
if (chart) {
chart.style.width = '210mm'; // 强制 A4 宽度
chart.style.margin = '0 auto';
}
}
},
};
// 导出为 PDF 并打印
html2pdf().from(clone).set(opt).toPdf().get('pdf').then(function (pdf) {
pdf.autoPrint(); // 自动打印
window.open(pdf.output('bloburl'), '_blank'); // 在新窗口打开 PDF以便用户确认
}).finally(() => {
document.body.removeChild(clone); // 清理临时元素
});
html2pdf()
.from(clone)
.set(opt)
.toPdf()
.get('pdf')
.then(function (pdf) {
pdf.autoPrint(); // 自动打印
window.open(pdf.output('bloburl'), '_blank'); // 在新窗口打开 PDF以便用户确认
})
.finally(() => {
document.body.removeChild(clone); // 清理临时元素
});
}
// 转化时间
function formatDateTo(dateStr) {
const [formattedDate, timePartWithSeconds] = dateStr ? dateStr.split('T'): ['', ''];
const [formattedDate, timePartWithSeconds] = dateStr ? dateStr.split('T') : ['', ''];
const [formattedHour, minutePart] = timePartWithSeconds.split(':');
const formattedTime = `${formattedHour}:${minutePart}`;
@@ -580,7 +586,7 @@ function formatHourTimes(dateStr, temperaturePulses) {
* 打开体征录入
*/
function openAddTprDialog() {
patientData.value = patientInfo.value
patientData.value = patientInfo.value;
openAddTpr.value = true;
// patientId.value = row.id;
nextTick(() => {
@@ -633,4 +639,4 @@ function closePatientDetialDialog(str) {
max-height: 270mm;
overflow: hidden;
}
</style>
</style>