You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

975 lines
34 KiB

<template>
<div>
<!--组件主体-->
<div style="display: flex">
<div :style="'width:' + (window.pageWidth - 200 - 145) + 'px;'" @contextmenu.prevent="onContextmenu">
<div>
<el-table @body-scrolling="load" :data="tableData" border
:height="window.pageHeight < 600 ? 248 : Math.floor(((window.pageHeight - 250) * 2) / 3)"
highlight-current-row @row-click="rowClick" @row-dblclick="rowDblclick" size="small" row-key="id"
@selection-change="handleSelectionChange" ref="info" id="info"
:row-class-name="handleRowClassName">
<!-- 取消勾选改为选中
<el-table-column type="selection" width="40" show-overflow-tooltip/>
:height="window.pageHeight < 600 ? 202 : Math.floor(((window.pageHeight - 302) * 2) / 3)"
-->
<el-table-column v-for="(item, index) in headerCols" :key="`col_${index}`"
:min-width="dropCol[index].minWidth" :align="dropCol[index].align" :label="item.label"
:prop="dropCol[index].prop" :sortable="dropCol[index].prop == 'sn' ? false : true">
<template slot-scope="scope">
<div v-if="dropCol[index].prop == 'sn'">
{{ scope.$index + 1 }}
</div>
<div v-else-if="dropCol[index].prop == 'completeFlag'">
{{ dddw(dict.completeFlag, "id", scope.row.completeFlag, "displayName") }}
</div>
<div v-else-if="dropCol[index].prop == 'guidePrintTimes'">
<i class="el-icon-printer" v-if="scope.row.guidePrintTimes > 0" style="font-size: 20px; color: green" />
</div>
<div v-else-if="dropCol[index].prop == 'isLock'
|| dropCol[index].prop == 'isVip'
|| dropCol[index].prop == 'isUpload'
">
{{ scope.row[dropCol[index].prop] == "Y" ? "是" : "否" }}
</div>
<div v-else-if="dropCol[index].prop == 'customerOrgParentName'">
{{ scope.row.customerOrgParentName
? scope.row.customerOrgParentName
: scope.row.customerOrgName }}
</div>
<div v-else-if="dropCol[index].prop == 'sexId'">
{{ dddw(dict.sex, "id", scope.row[dropCol[index].prop], "displayName") }}
</div>
<div v-else-if="dropCol[index].prop == 'groupPack'">
<div
v-if="scope.row.medicalPackageId !== dict.personOrgId && scope.row.customerOrgId === dict.personOrgId">
{{ dddw(dict.medicalPackage, "id", scope.row.medicalPackageId, "displayName") }}
</div>
<div
v-if="scope.row.medicalPackageId !== dict.personOrgId && scope.row.customerOrgId !== dict.personOrgId">
{{ dddw(dict.customerOrgGroupAll, "id", scope.row.customerOrgGroupId, "displayName") }}
</div>
</div>
<div v-else-if="dropCol[index].prop == 'nationId'">
{{ dddw(dict.nation, "id", scope.row[dropCol[index].prop], "displayName") }}
</div>
<div v-else-if="dropCol[index].prop == 'birthDate'
|| dropCol[index].prop == 'creationTime'">
{{ scope.row[dropCol[index].prop] ? moment(scope.row[dropCol[index].prop]).format('yyyy-MM-DD') : '' }}
</div>
<div v-else-if="dropCol[index].prop == 'maritalStatusId'">
{{ dddw(dict.maritalStatus, "id", scope.row[dropCol[index].prop], "displayName") }}
</div>
<div v-else-if="dropCol[index].prop == 'medicalTypeId'">
{{ dddw(dict.medicalType, "id", scope.row[dropCol[index].prop], "displayName") }}
</div>
<div v-else-if="dropCol[index].prop == 'personnelTypeId'">
{{ dddw(dict.personnelType, "id", scope.row[dropCol[index].prop], "displayName") }}
</div>
<div v-else>
{{ scope.row[dropCol[index].prop] }}
</div>
</template>
</el-table-column>
<!--
"sexHormoneTermId": "00000000-0000-0000-0000-000000000000",
"interposeMeasure": null,
"medicalConclusionId": "00000000-0000-0000-0000-000000000000",
"reportPrintTimes": 0,
"isMedicalStart": "N",
"medicalStartDate": "6/28/2023",
"isRecoverGuide": "N",
"summaryDate": "",
"summaryDoctor": null,
"isAudit": "N",
"auditDoctor": null,
"auditDate": "",
"isNameHide": "N",
"isPhoneFollow": "N",
"thirdInfo": null,
"guidePrintTimes": null,
"remark": null,
"medicalCenterId": "00000000-0000-0000-0000-000000000000",
"customerOrgRegisterId": "00000000-0000-0000-0000-000000000000",
"lastModifierName": "",
"lastModificationTime": null,
"lastModifierId": null,
"creatorId": null,
"id": "3a0c196d-a6d0-37fe-5c32-4806bdc4530f"
-->
</el-table>
<div style="display: flex;justify-content:space-between;">
<div></div>
<div>
<span style="font-size:12px;">共:{{ loadOpts.totalCount }} 条记录,当前显示:{{ tableData.length }}
条。</span>
</div>
</div>
</div>
<!-- 给合项目 基本信息 -->
<el-tabs v-model="tabChoosed" style="margin-top: -22px;">
<!-- 给合项目 -->
<el-tab-pane label="预览" name="1">
<PatientRegisterAsbItem />
</el-tab-pane>
</el-tabs>
</div>
<div style="margin-left: 10px;">
<div v-show="checkPagePriv(pagePriv.privs, '全选')" class="listBtn">
<el-button type="success" class="commonbutton" @click="btnChooseAll(1)">全选</el-button>
</div>
<div v-show="checkPagePriv(pagePriv.privs, '取消全选')" class="listBtn">
<el-button type="success" class="commonbutton" @click="btnChooseAll(0)">取消全选</el-button>
</div>
<div v-show="checkPagePriv(pagePriv.privs, '预览设置')" class="listBtn">
<el-button type="primary" class="commonbutton" @click="btnPrintPre">预览设置</el-button>
</div>
<div v-show="checkPagePriv(pagePriv.privs, '打印')" class="listBtn">
<el-button type="danger" class="commonbutton" @click="btnPrint">打印</el-button>
</div>
<div v-show="checkPagePriv(pagePriv.privs, '发送申请')" class="listBtn">
<el-button type="" class="commonbutton" @click="btnSendLis">发送申请</el-button>
</div>
<div v-show="checkPagePriv(pagePriv.privs, '撤消申请')" class="listBtn">
<el-button type="" class="commonbutton" @click="btnUndoLis">撤消申请</el-button>
</div>
</div>
</div>
<!--组件弹窗-->
<div>
<!-- 通用进度条 -->
<el-dialog title="数据处理中……" :visible.sync="elProgress.display" width="600px" height="400" :show-close="false"
:close-on-click-modal="false" :append-to-body="true">
<ElProgressOCX />
</el-dialog>
</div>
</div>
</template>
<script>
import moment from "moment";
import { mapState, mapActions } from "vuex";
import { getapi, postapi, putapi, deletapi } from "@/api/api";
import Sortable from "sortablejs";
import FileSaver from 'file-saver';
import html2canvas from 'html2canvas';
import {
getPagePriv, checkPagePriv,
dddw,
objCopy,
arrayReduce,
arrayExistObj,
deepCopy,
} from "../../utlis/proFunc";
import ElProgressOCX from "../../components/report/ElProgressOCX.vue";
export default {
components: {
ElProgressOCX,
},
data() {
return {
pagePriv: {
routeUrlorPageName: 'patientLis', //当前页面归属路由或归属页面权限名称
privs: [] // 页面权限
},
peisid: null,
startPoint: -1, // 多选起点 -1 表示选择
endPoint: -1, // 多选终点 -1 表示未选择
tableData: [], //表格数据
tableDataCurrentRow: {}, // 当前被选中的行
multipleSelection: [], //选中的数据列表
tabChoosed: "1",
rClickRow: null, //右击的行
rClickColumn: null, //右击的列(预留)
//动态列
headerCols: [],
//拖动列
dropCol: [
{ label: "序号", prop: "sn", minWidth: 40, align: "center" },
{ label: "体检进度", prop: "completeFlag", minWidth: 80, align: "center" },
{ label: "打印", prop: "guidePrintTimes", minWidth: 55, align: "center" },
{ label: "锁住", prop: "isLock", minWidth: 55, align: "center" },
{ label: "单位", prop: "customerOrgParentName", minWidth: 180, align: "center" },
{ label: "部门", prop: "customerOrgName", minWidth: 120, align: "center" },
{ label: "姓名", prop: "patientName", minWidth: 80, align: "center" },
{ label: "性别", prop: "sexId", minWidth: 55, align: "center" },
{ label: "年龄", prop: "age", minWidth: 55, align: "center" },
{ label: "颜色", prop: "lisrequest", minWidth: 120, align: "center" },
{ label: "容器", prop: "lisrequest", minWidth: 120, align: "center" },
{ label: "项目分组", prop: "lisrequest", minWidth: 120, align: "center" },
{ label: "申请项目", prop: "lisrequest", minWidth: 120, align: "center" },
{ label: "检验码号", prop: "lisrequest", minWidth: 120, align: "center" },
{ label: "人员条码号", prop: "patientRegisterNo", minWidth: 150, align: "center" },
{ label: "档案号", prop: "patientNo", minWidth: 100, align: "center" },
{ label: "体检次数", prop: "medicalTimes", minWidth: 80, align: "center" },
{ label: "分组/套餐", prop: "groupPack", minWidth: 150, align: "center" },
{ label: "民族", prop: "nationId", minWidth: 55, align: "center" },
{ label: "身份证", prop: "idNo", minWidth: 150, align: "center" },
{ label: "出生日期", prop: "birthDate", minWidth: 80, align: "center" },
{ label: "邮箱", prop: "email", minWidth: 150, align: "center" },
{ label: "手机", prop: "mobileTelephone", minWidth: 100, align: "center" },
{ label: "电话", prop: "telephone", minWidth: 100, align: "center" },
{ label: "地址", prop: "address", minWidth: 300, align: "" },
{ label: "体检卡号", prop: "medicalCardNo", minWidth: 80, align: "center" },
{ label: "工卡号", prop: "jobCardNo", minWidth: 80, align: "center" },
{ label: "婚姻状况", prop: "maritalStatusId", minWidth: 80, align: "center" },
{ label: "体检类别", prop: "medicalTypeId", minWidth: 80, align: "center" },
{ label: "人员类别", prop: "personnelTypeId", minWidth: 80, align: "center" },
{ label: "职务", prop: "jobPost", minWidth: 80, align: "center" },
{ label: "职称", prop: "jobTitle", minWidth: 80, align: "center" },
{ label: "介绍人", prop: "salesman", minWidth: 80, align: "center" },
{ label: "是否VIP", prop: "isVip", minWidth: 80, align: "center" },
{ label: "登记人", prop: "creatorName", minWidth: 80, align: "center" },
{ label: "登记日期", prop: "creationTime", minWidth: 80, align: "center" },
{ label: "是否上传", prop: "isUpload", minWidth: 80, align: "center" },
],
dom: null, //用于滚动加载数据
lazyLoading: false, //是否懒加载中
loadOpts: {
totalCount: 0,
skipCount: 0,
maxResultCount: 100,
},
loadOptsInit: {},
oneClick: 0, // 1 表示行单击一次
DbClick: 0, // 1 表示行有单击第二次
};
},
created() {
//获取用户当前页面的权限
let userPriv = window.sessionStorage.getItem('userPriv')
if (userPriv) this.pagePriv.privs = deepCopy(getPagePriv(this.pagePriv.routeUrlorPageName))
this.loadOptsInit = Object.assign({}, this.loadOpts)
},
//挂载完成
mounted() {
// 初始化可以拖动的列
this.headerCols = deepCopy(this.dropCol)
this.dropCol = this.columnDrop(this.dropCol);
this.$nextTick(() => {
this.scrollFull()
})
},
computed: {
...mapState([
"window",
"dataTransOpts",
"dialogWin",
"dict",
"elProgress",
"patientRegister",
"customerOrg",
]),
},
methods: {
...mapActions(["getCustomerOrgGroup", "getPatientRegisterAbs"]),
moment, dddw, deepCopy, checkPagePriv,
// 扩展定义表格行样式
handleRowClassName({ row, rowIndex }) {
// highLightBg 为 'selected'的高亮
//console.log(rowIndex, row)
//return row.highLightBg == 'selected' ? 'high-light-bg' : '';
if (row.choosed) {
return "current-row";
} else {
return "";
}
},
// 全选 取消全选
btnChooseAll(type){
if(type == 1){
// 全选
}else{
}
},
// 行选择
rowSelected(rows) {
rows.forEach((e) => {
this.$refs["info"].toggleRowSelection(e, true);
});
},
refFuncSetData(item, v) {
setData(this, item, v)
},
handleSelectionChange(rows) {
//this.multipleSelection = rows;
//console.log('this.multipleSelection',this.multipleSelection)
rows.forEach((item) => {
item.highLightBg = "selected";
});
// 取消全选
if (!rows.length) {
this.tableData.forEach((item) => {
item.highLightBg = "";
});
}
this.multipleSelection = JSON.parse(JSON.stringify(rows));
},
//点击体检次数行
rowClick(row) {
if (this.oneClick == 0) {
this.oneClick = 1;
} else {
this.DbClick = 1;
}
//双击事件
if (this.DbClick == 1) { //第一次点击的节点和第二次点击的节点id相同
this.rowClickRetrieve(row)
return;
}
setTimeout(() => { //300ms内没有第二次点击,执行单击事件
if (this.oneClick == 1 && this.DbClick == 0) this.rowClickRetrieve(row)
}, 300)
},
rowClickRetrieve(row) {
this.oneClick = 0;
this.DbClick = 0;
// 按住了shift键
if (this.window.shift) {
//清除所有选择
this.tableData.forEach((e, index) => {
e.choosed = false;
e.index = index;
});
if (this.startPoint == -1) {
this.tableData[row.index].choosed = true;
this.startPoint = row.index;
} else {
if (this.startPoint > row.index) {
for (let i = row.index; i <= this.startPoint; i++) {
this.tableData[i].choosed = true;
}
} else if (this.startPoint <= row.index) {
for (let i = this.startPoint; i <= row.index; i++) {
this.tableData[i].choosed = true;
}
}
}
} else if (this.window.ctrl) { // 按住了ctrl 键
this.tableData[row.index].choosed = true;
if (this.startPoint == -1) {
this.startPoint = row.index;
}
} else {
// 未按住了ctrl 、shift 键
//清除所有选择
console.log("清除所有选择");
this.tableData.forEach((e, index) => {
e.choosed = false;
e.index = index;
});
console.log(this.tableData, row.index);
console.log(this.tableData[row.index].choosed);
this.tableData[row.index].choosed = true;
this.startPoint = row.index;
}
//选中了多个点编辑时,排序最前的作为当前选中的
console.log('row.index <= this.startPoint', row.index, this.startPoint)
let lfind = -1
for (let i = 0; i < this.tableData.length; i++) {
if (this.tableData[i].choosed) {
lfind = i
break
}
}
if (lfind > -1) {
// 弹出编辑框,只有在编辑框显示时,才去触发获取数据
this.dataTransOpts.tableS.patient_register.id = this.tableData[lfind].id
this.tableDataCurrentRow = deepCopy(this.tableData[lfind])
this.dataTransOpts.refresh.register_check_asbitem.M++ //触发所选组合项目刷新
}
},
// 双击
rowDblclick(row) {
this.rowClick(row)
this.btnEdit()
},
//查询
async Query() {
// 查询时,清掉明细数据 (滚动时不清)
this.dataTransOpts.tableS.patient_register.id = ''
this.tableDataCurrentRow = {} // 清除选择
this.tableData = []
setTimeout(() => {
this.dataTransOpts.refresh.register_check_asbitem.M++ //触发所选组合项目刷新
}, 10);
this.loadOpts = Object.assign(this.loadOpts, this.loadOptsInit)
await this.getPrList()
},
//数据量多时,滚动加载
async load() {
this.loadOpts.skipCount++
await this.getPrList()
},
// 获取列表数据
async getPrList() {
if (this.loadOpts.skipCount != 0 && this.loadOpts.skipCount * this.loadOpts.maxResultCount >= this.loadOpts.totalCount) return
console.log('getPrList', this.loadOpts)
let body = {
skipCount: this.loadOpts.skipCount,
maxResultCount: this.loadOpts.maxResultCount
};
console.log(`this.patientRegister.query`, this.patientRegister.query);
if (this.patientRegister.query.customerOrgFlag) {
// if (this.patientRegister.query.CustomerOrgParentId) {
// body.customerOrgId = this.patientRegister.query.CustomerOrgParentId;
// } else {
// if (this.patientRegister.query.customerOrgId)
// body.customerOrgId = this.patientRegister.query.customerOrgId;
// }
if (this.patientRegister.query.customerOrgId) body.customerOrgId = this.patientRegister.query.customerOrgId;
if (this.patientRegister.query.customerOrgId
&& this.patientRegister.query.customerOrgId != this.dict.personOrgId
&& this.patientRegister.query.customerOrgRegister.id) {
body.customerOrgRegisterId = this.patientRegister.query.customerOrgRegister.id
}
}
if (this.patientRegister.query.sex)
body.sexId = this.patientRegister.query.sex;
if (this.patientRegister.query.patientName)
body.patientName = this.patientRegister.query.patientName;
if (this.patientRegister.query.completeFlag)
body.completeFlag = this.patientRegister.query.completeFlag;
//StartDate EndDate
if (
this.patientRegister.query.startDate &&
this.patientRegister.query.endDate
) {
body.startDate = moment(this.patientRegister.query.startDate).format(
"yyyy-MM-DD"
);
body.endDate = moment(this.patientRegister.query.endDate).format(
"yyyy-MM-DD"
);
if (body.startDate > body.endDate) {
this.$message.warning("起始日期不能大于截止日期,数据校验不通过!");
return;
}
}
if (this.patientRegister.query.phone)
body.phone = this.patientRegister.query.phone;
if (this.patientRegister.query.idCardNo)
body = { idNo: this.patientRegister.query.idCardNo };
if (this.patientRegister.query.patientNo)
body = { patientNo: this.patientRegister.query.patientNo };
if (this.patientRegister.query.patientRegisterNo)
body = {
patientRegisterNo: this.patientRegister.query.patientRegisterNo,
};
console.log("/api/app/patientregister/getlistinfilter", body);
postapi("/api/app/patientregister/getlistinfilter", body)
.then(res => {
if (res.code != -1) {
// 刷新最大记录数
this.loadOpts.totalCount = res.data.totalCount
let curLoad = res.data.items
let oldCount = 0
if (body.skipCount == 0) { //查询
this.tableData = [];
} else {
// 懒加载 ,原数据集不用清空
oldCount = this.tableData.length
}
curLoad.forEach((e, index) => {
this.tableData.push(Object.assign({ index: Number(oldCount) + Number(index), choosed: false }, e))
})
//如果 有选中 记录,则刷新其对应的组合项目
if (this.dataTransOpts.tableS.patient_register.id) {
this.dataTransOpts.refresh.register_check_asbitem.M++
}
}
})
},
//滚动加载数据
scrollFull() {
this.dom = this.$refs['info'].bodyWrapper
console.log('this.dom', this.dom)
this.dom.addEventListener('scroll', async () => {
// console.log('scrollTop',this.dom.scrollTop,'clientHeight',this.dom.clientHeight,'scrollHeight',this.dom.scrollHeight);
if (this.dom.scrollTop + this.dom.clientHeight + 20 > this.dom.scrollHeight && !this.lazyLoading) {
// 获取到的不是全部数据 当滚动到底部
console.log('scrollTop', this.dom.scrollTop, 'clientHeight', this.dom.clientHeight, 'scrollHeight', this.dom.scrollHeight);
if ((Number(this.loadOpts.skipCount) + 1) * Number(this.loadOpts.maxResultCount) >= Number(this.loadOpts.totalCount)) {
this.lazyLoading = false
} else {
this.lazyLoading = true
await this.load()
this.lazyLoading = false
// this.dom.scrollTop = this.dom.scrollTop - 100
}
}
})
},
// 预览设置
btnPrintPre(){
},
// 打印
btnPrint(){
},
// 发送检验申请
btnSendLis(){
console.log('btnSendLis')
},
// 撤消检验申请
btnUndoLis(){
console.log('btnUndoLis')
},
//检验申请
async lisRequest(prId) {
let isPrintLisRequest = false;
let res = null;
if (prId.length < 1) {
this.$message.info("人员信息尚未保存,不可执行此操作!");
return;
}
try {
res = await postapi(
`/api/app/lisrequest/setlisrequest?PatientRegisterId=${prId}`
);
console.log(
`/api/app/lisrequest/setlisrequest?PatientRegisterId=${prId}`,
res
);
} catch (error) {
return;
}
if (res.code != -1) {
this.$message.info("发送检验申请成功!");
isPrintLisRequest = true;
}
//重复申请,重打
if (res.code == -1 && res.message.indexOf("已申请") > -1) {
isPrintLisRequest = true;
}
if (!isPrintLisRequest) return;
try {
await this.$confirm("是否打印检验申请单?", "提示", {
confirmButtonText: "是",
cancelButtonText: "否",
type: "info",
showClose: false,
closeOnClickModal: false,
closeOnPressEscape: false,
});
} catch (error) {
return;
}
//打印检验申请单
this.lisPrint(prId, "0003", false);
},
//检验条码打印
lisPrint(prId, ReportCode, isPreview) {
if (!this.$peisAPI) {
this.$message.info("此功能,需要在壳客户端才可运行!");
return;
}
let token = window.sessionStorage.getItem("token");
let user = window.sessionStorage.getItem("user");
let toOutShell = {
ReportCode,
token,
preViewCanPrint: "N",
Parameters: [
{ Name: "printer", Value: user },
{ Name: "hisLog", Value: "pic/hisLog.jpg" },
],
BusinessCode:prId
};
if (isPreview) {
/*
postapi(
`/api/app/printreport/getlisrequestreport?PatientRegisterId=${prId}`
)
.then((res) => {
if (res.code != -1) {
toOutShell.ReportTable = { lisRequest: res.data };
console.log(
"JSON.stringify(toOutShell)",
JSON.stringify(toOutShell)
);
return this.$peisAPI.printPre(JSON.stringify(toOutShell));
}
})
.catch((err) => {
this.$message.warning(err);
});
*/
this.$peisAPI.printPre(JSON.stringify(toOutShell))
.then(res => {
if (JSON.parse(res).code < 0) {
this.$message.warning({ showClose: true, message: JSON.parse(res).message });
}
})
.catch((err) => {
console.log('打印检验条码错误', err)
this.$message.warning({ showClose: true, message: `${err}` });
});
} else {
/*
postapi(
`/api/app/printreport/getlisrequestreport?PatientRegisterId=${prId}`
)
.then((res) => {
if (res.code != -1) {
toOutShell.ReportTable = { lisRequest: res.data };
console.log(
"JSON.stringify(toOutShell)",
JSON.stringify(toOutShell)
);
return this.$peisAPI.print(JSON.stringify(toOutShell));
}
})
.then((res) => {
//console.log("res", res);
if (JSON.parse(res).code >= 0) {
//更新打印状态 /api/app/lisrequest/updatelisrequestisprint
// {
// "operateType": 0, 操作类型(1.按PatientRegisterId 2.按LisRequestId)
// "patientRegisterId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
// "lisRequestId": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
// }
return postapi("/api/app/lisrequest/updatelisrequestisprint", {
operateType: 1,
patientRegisterId: prId,
});
}
})
.catch((err) => {
this.$message.warning(err);
});
*/
this.$peisAPI.print(JSON.stringify(toOutShell))
.then(res => {
if (JSON.parse(res).code < 0) {
this.$message.warning({ showClose: true, message: JSON.parse(res).message });
}else{
return postapi("/api/app/lisrequest/updatelisrequestisprint", {
operateType: 1,
patientRegisterId: prId,
});
}
})
.then(res => {
if(res && res.code < 0){
this.$message.error({ showClose: true, message: `${res.message}` });
}
})
.catch((err) => {
console.log('打印检验条码错误', err)
this.$message.error({ showClose: true, message: `${err}` });
});
}
},
//pacs条码打印
pacsPrint(prId, ReportCode, isPreview) {
if (!this.$peisAPI) {
this.$message.info("此功能,需要在壳客户端才可运行!");
return;
}
let token = window.sessionStorage.getItem("token");
let user = window.sessionStorage.getItem("user");
let toOutShell = {
ReportCode,
token,
preViewCanPrint: "Y",
Parameters: [
{ Name: "printer", Value: user },
{ Name: "hisLog", Value: "pic/hisLog.jpg" },
],
BusinessCode:prId
};
if (isPreview) {
/*
postapi(
`/api/app/printreport/getpacsnoreport?PatientRegisterId=${prId}`
)
.then((res) => {
if (res.code != -1) {
toOutShell.ReportTable = { lisRequest: res.data };
console.log(
"JSON.stringify(toOutShell)",
JSON.stringify(toOutShell)
);
return this.$peisAPI.printPre(JSON.stringify(toOutShell));
}
})
.catch((err) => {
this.$message.warning(err);
});
*/
this.$peisAPI.printPre(JSON.stringify(toOutShell))
.then(res => {
if (JSON.parse(res).code < 0) {
this.$message.warning({ showClose: true, message: JSON.parse(res).message });
}
})
.catch((err) => {
console.log('打印pacs条码错误', err)
this.$message.warning({ showClose: true, message: `${err}` });
});
} else {
/*
postapi(
`/api/app/printreport/getpacsnoreport?PatientRegisterId=${prId}`
)
.then((res) => {
if (res.code != -1) {
toOutShell.ReportTable = { lisRequest: res.data };
console.log(
"JSON.stringify(toOutShell)",
JSON.stringify(toOutShell)
);
return this.$peisAPI.print(JSON.stringify(toOutShell));
}
})
.then((res) => {
if (JSON.parse(res).code >= 0) {
//更新打印状态 /api/app/lisrequest/updatelisrequestisprint
// {
// "operateType": 0, 操作类型(1.按PatientRegisterId 2.按LisRequestId)
// "patientRegisterId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
// "lisRequestId": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
// }
return postapi("/api/app/lisrequest/updatelisrequestisprint", {
operateType: 1,
patientRegisterId: prId,
});
}
})
.catch((err) => {
this.$message.warning(err);
});
*/
this.$peisAPI.print(JSON.stringify(toOutShell))
.then(res => {
if (JSON.parse(res).code < 0) {
this.$message.warning({ showClose: true, message: JSON.parse(res).message });
}else{
return postapi("/api/app/lisrequest/updatelisrequestisprint", {
operateType: 1,
patientRegisterId: prId,
});
}
})
.then(res => {
if(res && res.code < 0){
this.$message.error({ showClose: true, message: `${res.message}` });
}
})
.catch((err) => {
console.log('打印pacs条码错误', err)
this.$message.error({ showClose: true, message: `${err}` });
});
}
},
columnDrop(dropCol) {
//获取dom节点
const wrapperTr = document.querySelector(".el-table__header-wrapper tr");
Sortable.create(wrapperTr, {
animation: 180,
delay: 0,
// 元素被选中
onChoose: function (/**Event*/ evt) {
//console.log('onChoose',evt,evt.oldIndex)
evt.oldIndex; // element index within parent
},
// 元素未被选中的时候(从选中到未选中)
onUnchoose: function (/**Event*/ evt) {
// same properties as onEnd
},
// 开始拖拽的时候
onStart: function (/**Event*/ evt) {
//console.log('onStart',evt,evt.oldIndex)
evt.oldIndex; // element index within parent
},
onEnd: (evt) => {
const oldItem = dropCol[evt.oldIndex]; // dropCol[evt.oldIndex - 1];
if (oldItem) {
dropCol.splice(evt.oldIndex, 1);
dropCol.splice(evt.newIndex, 0, oldItem);
}
//console.log(this.headerCols, oldItem, dropCol);
},
});
return dropCol;
},
//通用导出
btnExport(elId) {
// 获取HTML元素(表格)
// let table = document.getElementById(elId); //.cloneNode(true)
this.$nextTick(() => {
let refsTable = this.$refs[elId] //.cloneNode(true) true
let table = document.getElementById(elId)
console.log('table,refsTable', table, refsTable)
let tableData = table.innerHTML
let fileName = moment(new Date()).format('yyyyMMDDHHmmss')
let blob = new Blob([tableData], { type: "text/plain;charset=utf-8" });
FileSaver.saveAs(blob, fileName + '.xls');
// 导出图片
// 使用html2canvas将HTML元素转换为画布
// let cloneTable = table.cloneNode(true) //[elId]
html2canvas(table).then(canvas => {
// 创建一个a元素用于下载
const link = document.createElement('a');
link.href = canvas.toDataURL('image/jpeg');
link.download = fileName + '.jpg';
document.body.appendChild(link);
link.click();
//document.body.removeChild(link);
// // 创建一个PDF对象
// var pdf = new jsPDF();
// // 设置PDF的尺寸
// pdf.addImage(canvas.toDataURL('image/png'), 'PNG', 0, 0, canvas.width, canvas.height);
// // 导出PDF
// pdf.save('员工信息表.pdf');
});
})
},
},
//监听事件
watch: {
"patientRegister.query.customerOrgId": {
// immediate: true, // 立即执行
// deep: true, // 深度监听复杂类型内变化
handler(newVal, oldVal) {
//console.log('watch:patientRegister.query.customerOrgId:',newVal,oldVal)
// 单位变化时,清除当前列表信息
if (newVal && newVal != oldVal) {
this.tableData = []
this.dataTransOpts.tableM.register_check_asbitem = []
}
}
},
//触发查询事件
"patientRegister.query.times"(newVal, oldVal) {
if (newVal != oldVal) {
//alert('触发查询事件')
this.Query();
}
},
//新增后,触发赋值
// "patientRegister.patientRegisterRd.id"(newVal, oldVal) {
// if (newVal != oldVal) {
// //console.log('patientRegister.patientRegisterRd.customerOrgId',this.patientRegister.patientRegisterRd.customerOrgId)
// objCopy(this.patientRegister.patientRegisterRd, this.form);
// }
// },
},
};
</script>
<style scoped>
@import "../../assets/css/global_input.css";
@import "../../assets/css/global_table.css";
@import "../../assets/css/global.css";
.box {
display: flex;
}
.listBtn {
margin-top: 5px;
text-align: center;
}
.btnClass {
width: 100px;
}
</style>