|
|
<template> <div style="display: flex"> <div :style=" 'margin-left:5px;width:' + (window.pageWidth - 200 - 110 - 50) + 'px;' " @contextmenu.prevent="onContextmenu" > <el-table :data="patientRegister.prList" border :height=" window.pageHeight < 600 ? 202 : Math.floor(((window.pageHeight - 302) * 2) / 3) " highlight-current-row @row-click="rowClick" size="small" @selection-change="handleSelectionChange" @cell-contextmenu="onCellRightClick" ref="info" :row-class-name="handleRowClassName" > <!-- 取消勾选,改为选中 <el-table-column type="selection" width="40" show-overflow-tooltip/> --> <el-table-column v-for="(item, index) in headerCols" :key="`col_${index}`" :min-width="dropCol[index].minWidth" :align="dropCol[index].align" :label="item.label" > <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: 24px; 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, "organizationUnitId": "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> <!-- 给合项目 基本信息 --> <el-tabs v-model="tabChoosed"> <!-- 给合项目 --> <el-tab-pane label="已选组合项目" name="1"> <PatientRegisterAsbItem /> </el-tab-pane> </el-tabs> </div> <div style="margin-left: 10px;"> <div class="listBtn"> <el-button type="success" class="btnClass" @click="btnAdd">人员登记</el-button > </div> <div class="listBtn"> <el-button type="primary" class="btnClass" @click="btnEdit" >编辑</el-button > </div> <div class="listBtn"> <el-button type="danger" class="btnClass" @click="btnDel" >删除</el-button > </div> <!-- <div class="listBtn"> <el-button type="" class="btnClass" @click="openCamera" icon="el-icon-camera" >拍照</el-button > </div> <div class="listBtn"> <el-button type="" class="btnClass commonbutton">健康档案</el-button> </div> --> <div class="listBtn"> <el-button type="" class="btnClass" @click="btnGroupBatch" >批量调整分组</el-button > </div> <div class="listBtn"> <el-button type="" class="btnClass" @click="btnAsbBatch" >批量调整项目</el-button > </div> <div class="listBtn"> <el-button type="" class="btnClass" @click="guidePrint('0001', false)" >指引单打印</el-button > </div> <div class="listBtn"> <el-button type="" class="btnClass" @click="guidePrint('0001', true)" >指引单预览</el-button > </div> <!-- <div class="listBtn"> <el-button type="" class="btnClass commonbutton" @click="rowSelected(patientRegister.prList)">选中</el-button> </div> --> </div>
<!-- 体检人员登记 --> <el-dialog :title="patientRegister.patientRegisterRd.id ? '体检人员--编辑' : '体检人员--新增'" :visible.sync="dialogVisible" :close-on-click-modal="false" fullscreen @close="closeDialogPR" > <PatientRegisterEdit :formInitData="patientRegister.patientRegisterRd" :editTimes="editTimes" /> </el-dialog>
<!-- 拍照 --> <el-dialog title="拍照" :visible.sync="patientRegister.cameraVisble" width="400" height="800" :show-close="false" :append-to-body="true" :close-on-click-modal="false" > <Camera :id="patientRegister.patientRegisterId" /> </el-dialog>
<!-- 指引单 --> <el-dialog title="指引单" :visible.sync="dialogGuide" width="400" height="800" :append-to-body="true" :close-on-click-modal="false" > <div>{{ guideMsg }}</div> </el-dialog>
<!-- 批量调整分组 --> <el-dialog title="批量调整分组" :visible.sync="dialogGroup" width="600px" height="800" :append-to-body="true" :close-on-click-modal="false" > <div> <div> 批量调整分组只针对单位体检有效,个人体检将忽略此操作;不能调整已收费或已检的项目及已总检的体检人员。 </div> <div> <br /><span>分组</span> <el-select v-model="groupBatch.customerOrgGroupId" placeholder="请选择" filterable size="small" > <el-option v-for="item in patientRegister.customerOrgGroup" :key="item.id" :label="item.displayName" :value="item.id" /> </el-select> </div> <div> <br /><el-radio v-model="groupBatch.payTypeFlag" label="0" >个人支付</el-radio > <br /><el-radio v-model="groupBatch.payTypeFlag" label="1" >单位支付</el-radio > <br /><el-radio v-model="groupBatch.payTypeFlag" label="2" >免费</el-radio > </div> <div> <br /><el-checkbox v-model="groupBatch.isReserveAddAsbitem" >保留加做项目(包括不属于原分组的、没有设置分组的)</el-checkbox > </div> </div> <span slot="footer" class="dialog-footer"> <el-button type="primary" @click="groupBatchHandle">确 定</el-button> <el-button @click="dialogGroup = false">取 消</el-button> </span> </el-dialog>
<!-- 批量调整项目 --> <el-dialog title="批量调整项目" :visible.sync="dialogAsbitem" width="600px" height="800" :append-to-body="true" :close-on-click-modal="false" > <div> <div> 批量调整分组只针对单位体检有效,个人体检将忽略此操作;不能调整已收费或已检的项目及已总检的体检人员。 </div> <div> <br /><el-radio v-model="asbitemBatch.operate" label="add" >增加项目</el-radio > <el-radio v-model="asbitemBatch.operate" label="del" >删除项目</el-radio > </div> <div> <br /><el-checkbox v-model="asbitemBatch.isDeleteGroup" :disabled="asbitemBatch.operate == 'add' ? true : false" >如果删除项目属于分组则删除体检记录信息的分组设置</el-checkbox > </div> <div> <br /><span>直接录入</span> <el-select v-model="asbitemBatch.asbItemId" placeholder="快速选择组合项目" size="small" highlight-current-row filterable :filter-method="filterMethod" clearable @clear="quickAsb = deepCopy(dict.asbItemQuick)" @change="quickChoosedAsb" default-first-option ref="quickAsbOCX" style="width: 150px; text-align: left; padding-right: 15px" > <el-option v-for="item in quickAsb" :key="item.id" :value="item.id" :label="item.displayName" /> </el-select> </div> <div style="display: flex; margin-top: 2px"> <div style="width: 480px"> <el-table :data="asbitemBatch.asbitemsTemp" height="240" width="100%" show-summary @row-dblclick="removeAbs" size="small" highlight-current-row @row-click="rowClickaAbitemCurr" border > <el-table-column label="组合项目" width="150" prop="asbitemName" /> <el-table-column label="数量" prop="amount" width="60"> <template slot-scope="scope"> <el-input type="number" v-model="scope.row.amount" size="small" :disabled="asbitemBatch.operate == 'del' ? true : false" /> </template> </el-table-column> <el-table-column label="实收价格" prop="chargePrice" width="90"> <template slot-scope="scope"> <el-input type="number" v-model="scope.row.chargePrice" size="small" :disabled="asbitemBatch.operate == 'del' ? true : false" /> </template> </el-table-column> <el-table-column label="支付方式" prop="payTypeFlag" width="120"> <template slot-scope="scope"> <el-select v-model="scope.row.payTypeFlag" size="small" :disabled="asbitemBatch.operate == 'del' ? true : false" > <el-option v-for="item in dict.payType" :key="item.id" :label="item.displayName" :value="item.id" /> </el-select> </template> </el-table-column> </el-table> </div> <div style="display: block; width: 110px; margin-left: 10px"> <div style="margin-top: 5px"> <el-button type="danger" @click="asbitemDel(1)" style="width: 100px" >删除</el-button > </div> <div style="margin-top: 5px"> <el-button type="danger" @click="asbitemDel(0)" style="width: 100px" >删除全部</el-button > </div> <div style="margin-top: 5px"> <el-button type="primary" @click="changePayTypeFlag('0')" style="width: 100px" >全个人支付</el-button > </div> <div style="margin-top: 5px"> <el-button type="primary" @click="changePayTypeFlag('1')" style="width: 100px" >全单位支付</el-button > </div> <div style="margin-top: 5px"> <el-button type="primary" @click="changePayTypeFlag('2')" style="width: 100px" >全赠送</el-button > </div> </div> </div> </div> <span slot="footer" class="dialog-footer"> <el-button type="primary" @click="asbitemBatchHandle">确 定</el-button> <el-button @click="dialogAsbitem = false">取 消</el-button> </span> </el-dialog>
<!-- 通用进度条 --> <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></template><script>import moment from "moment";import { mapState, mapActions } from "vuex";import { getapi, postapi, putapi, deletapi } from "@/api/api";import Sortable from "sortablejs";
import { dddw, objCopy, arrayReduce, arrayExistObj, deepCopy,} from "@/utlis/proFunc";
import PatientRegisterEdit from "../../components/patientRegister/PatientRegisterEdit.vue";import Camera from "../../components/patientRegister/Camera.vue";import PatientRegisterAsbItem from "../../components/patientRegister/patientRegisterAsbItem.vue";
import ElProgressOCX from "../../components/report/ElProgressOCX.vue";
export default { components: { PatientRegisterEdit, Camera, PatientRegisterAsbItem, ElProgressOCX, }, data() { return { peisid:null, startPoint: -1, // 多选起点 -1 表示选择
endPoint: -1, // 多选终点 -1 表示选择
multipleSelection: [], //选中的数据列表
dialogVisible: false, dialogCamera: false, dialogGuide: false, guideMsg: "guideMsg", tabChoosed: "1", formInitData: {}, //体检登记初始表单数据
editTimes: 0,
rClickRow: null, //右击的行
rClickColumn: null, //右击的列(预留)
dialogGroup: false, groupBatch: { patientRegisterId: null, customerOrgGroupId: null, payTypeFlag: "1", //0:个人付费,1:单位付费 2:免费
isReserveAddAsbitem: true, //是否保留加做项目
},
dialogAsbitem: false, asbitemBatch: { operate: "add", isDeleteGroup: false, asbItemId: "", asbitemsTemp: [], //删除或增加项目临时用
asbitemCurr: {}, //当前选中要删除的项目(批量调整)
}, quickAsb: [], //可供快速选择的组合项目
//动态列
headerCols: [],
//拖动列
dropCol: [ { label: "序号",prop: "sn",minWidth: 40,align:"center"}, { label: "体检进度",prop: "completeFlag",minWidth: 80,align:"center"}, { label: "打印", prop: "guidePrintTimes", minWidth: 50,align:"center" }, { label: "锁住", prop: "isLock", minWidth: 50, 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: 50, align:"center"}, { label: "年龄", prop: "age", minWidth: 50, 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: 50, 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"}, ], }; },
created() { this.headerCols = deepCopy(this.dropCol) },
//挂载完成
mounted() { this.quickAsb = this.dict.asbItemAll; this.peisid = window.sessionStorage.getItem('peisid');
//初始化可以拖动的列
this.dropCol = this.columnDrop(this.dropCol); }, computed: { ...mapState([ "window", "dict", "elProgress", "patientRegister", "customerOrg", ]), }, methods: { ...mapActions(["getCustomerOrgGroup", "getPatientRegisterAbs"]), moment,dddw,deepCopy,
handleRowClassName({ row, rowIndex }) { // highLightBg 为 'selected'的高亮
//console.log(rowIndex, row)
//return row.highLightBg == 'selected' ? 'high-light-bg' : '';
if (row.choosed) { return "current-row"; } else { return ""; } },
rowSelected(rows) { rows.forEach((e) => { this.$refs["info"].toggleRowSelection(e, true); }); },
// 打印指引单(isPreview)
async guidePrint(ReportCode, isPreview) { if (!this.$peisAPI) { this.$message.info("此功能,需要在壳客户端才可运行!"); return; } let token = localStorage.getItem("token"); let user = localStorage.getItem("user"); let toOutShell = { ReportCode, token, preViewCanPrint: "N", Parameters: [ { Name: "printer", Value: user }, { Name: "hisLog", Value: "pic/hisLog.jpg" }, ], }; let lfind = -1;
if (this.multipleSelection.length < 1) { this.$message.info("请勾选要打印指引单的人员记录!"); return; }
if (isPreview) { //
//this.multipleSelection.forEach((item,index) =>{
postapi( `/api/app/printreport/getpatientregisterguidereport?PatientRegisterId=${this.multipleSelection[0].id}` ) .then((res) => { if (res.code != -1) { toOutShell.ReportTable = res.data; console.log( "JSON.stringify(toOutShell)", JSON.stringify(toOutShell) ); return this.$peisAPI.printPre(JSON.stringify(toOutShell)); } }) .catch((err) => { this.$message.warning(err); }); // });
} else { this.multipleSelection.forEach((item, index) => { postapi( `/api/app/printreport/getpatientregisterguidereport?PatientRegisterId=${item.id}` ) .then((res) => { if (res.code != -1) { toOutShell.ReportTable = 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) { //更新打印次数
return postapi( "api/app/patientregister/updatepatientregisterguideprinttimesmany", [item.id] ); } }) .then((res) => { if (res.code != -1) { lfind = arrayExistObj( this.patientRegister.prList, "id", item.id ); if (lfind > -1) { if (this.patientRegister.prList[lfind].guidePrintTimes) { this.patientRegister.prList[lfind].guidePrintTimes = Number( this.patientRegister.prList[lfind].guidePrintTimes ) + 1; } else { this.patientRegister.prList[lfind].guidePrintTimes = 1; } } } }) .catch((err) => { this.$message.warning(err); }); }); } },
handleSelectionChange(rows) { //this.multipleSelection = rows;
//console.log('this.multipleSelection',this.multipleSelection)
rows.forEach((item) => { item.highLightBg = "selected"; }); // 取消全选
if (!rows.length) { this.patientRegister.prList.forEach((item) => { item.highLightBg = ""; }); } this.multipleSelection = JSON.parse(JSON.stringify(rows)); },
//获取单位分组 /api/app/customer-org-group/in-customer-org-id/3a0c0444-d7a0-871f-4074-19faf1655caf
getCustomerOrgGroup(customerOrgId) { getapi( `/api/app/customer-org-group/in-customer-org-id/${customerOrgId}` ).then((res) => { console.log("getCustomerOrgGroup", res.data); if (res.code == 1) { this.patientRegister.customerOrgGroup = res.data; } }); },
//设置新增/编辑的form数据
setForm(formData){ this.patientRegister.patientRegisterRd = deepCopy(formData) if(!this.patientRegister.patientRegisterRd.id){ this.patientRegister.patientRegisterRd.customerOrgId = this.patientRegister.query.customerOrgId } },
//点击体检次数行
rowClick(row) { //console.log("this.patientRegister.prList",this.window,this.patientRegister.prList);
// 按住了shift键
if (this.window.shift) { //清除所有选择
this.patientRegister.prList.forEach((e,index) => { e.choosed = false; e.index = index; });
if (this.startPoint == -1) { this.patientRegister.prList[row.index].choosed = true; this.startPoint = row.index; }else{ if (this.startPoint > row.index) { for (let i = row.index; i <= this.startPoint; i++) { this.patientRegister.prList[i].choosed = true; } } else if (this.startPoint <= row.index) { for (let i = this.startPoint; i <= row.index; i++) { this.patientRegister.prList[i].choosed = true; } } } }else if (this.window.ctrl) { // 按住了ctrl 键
this.patientRegister.prList[row.index].choosed = true; if (this.startPoint == -1){ this.startPoint = row.index; } }else{ // 未按住了ctrl 、shift 键
//清除所有选择
console.log("清除所有选择"); this.patientRegister.prList.forEach((e,index) => { e.choosed = false; e.index = index; }); console.log(this.patientRegister.prList,row.index); console.log(this.patientRegister.prList[row.index].choosed);
this.patientRegister.prList[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.patientRegister.prList.length;i++){ if(this.patientRegister.prList[i].choosed){ lfind = i break } }
if(lfind > -1 && this.patientRegister.patientRegisterRd.id != this.patientRegister.prList[lfind].id){ this.setForm(this.patientRegister.prList[lfind]) // this.patientRegister.query.customerOrgParentId = this.patientRegister.prList[lfind].customerOrgParentId;
this.patientRegister.customerOrgGroupChange = 0; //控制体检列表记录切换时,0 无需触发更换分组操作
this.patientRegister.medicalPackageChange = 0; //控制体检列表记录切换时,0 无需触发更换套餐操作
// this.getCustomerOrgGroup(this.patientRegister.prList[lfind].customerOrgParentId);
this.dict.asbItem = [...this.dict.asbItemAll]; this.getPatientRegisterAbs(this.patientRegister.prList[lfind].id); }
},
//体检次数 相关操作
btnAdd() { if(!this.peisid || this.peisid == 'null'){ this.$message.warning("该用户未选归属体检中心,不能执行此操作!"); return } let customerOrgId = this.patientRegister.query.customerOrgId; if (!customerOrgId) { this.$message.warning("请选择单位或个人"); return; } this.patientRegister.patientRegisterRdInit.customerOrgId = customerOrgId this.setForm(this.patientRegister.patientRegisterRdInit) this.patientRegister.patientRegisterAbs = []; this.dialogVisible = true; this.editTimes++; //触发表单窗口,数据更新
this.getPatientRegisterAbs(); },
btnEdit() { if (!this.patientRegister.patientRegisterRd.id) { this.$message.warning("请选择要操作的记录"); return; } //console.log(this.patientRegister.patientRegisterRd,this.patientRegister.prList)
this.dialogVisible = true; this.editTimes++; //触发表单窗口,数据更新
},
//新增或编辑后选中记录
closeDialogPR(){ this.patientRegister.prList.forEach(e =>{ e.choosed = false }) let currentRow = {} let lfind = arrayExistObj(this.patientRegister.prList,'id',this.patientRegister.patientRegisterRd.id) if(lfind > -1){ this.patientRegister.prList[lfind].choosed = true currentRow = this.patientRegister.prList[lfind] }else if(this.patientRegister.patientRegisterRd.id){ currentRow = deepCopy(this.patientRegister.patientRegisterRd) lfind = this.patientRegister.prList.length currentRow.choosed = true currentRow.index = lfind this.patientRegister.prList.push(currentRow) }
if(lfind > -1){ setTimeout(() => { this.$refs['info'].setCurrentRow(currentRow) }, 100) } },
//拍照
openCamera() { if (!this.patientRegister.patientRegisterId) { this.$message.warning("请选择要操作的记录"); return; } this.patientRegister.cameraVisble = true; },
//删除(可批量删除)
// /api/app/patient-register/many?PatientRegisterIds=3a0c2cac-f44c-f407-9504-c1fc5e80a159&PatientRegisterIds=3a0c2cb3-d10c-ed70-db6a-b835e75ce641
btnDel() {
//选中(取消勾选)start -------------------------
this.multipleSelection = [] this.patientRegister.prList.forEach(e =>{ if(e.choosed){ this.multipleSelection.push(deepCopy(e)) } }) //选中(取消勾选) end -------------------------
if (this.multipleSelection.length < 1) { this.$message.warning("请先勾选要操作的记录"); return; }
let patientRegisterIds = []; for (let i = 0; i < this.multipleSelection.length; i++) { patientRegisterIds.push(this.multipleSelection[i]["id"]); }
this.$confirm("此操作将永久删除该记录, 是否继续?", "提示", { confirmButtonText: "是", cancelButtonText: "否", type: "warning", }) .then(() => { //console.log('{patientRegisterIds}',{patientRegisterIds})
return postapi(`/api/app/patient-register/delete-many`, { patientRegisterIds, }); }) .then((res) => { if(res.code != -1){ this.$message.success("操作成功"); arrayReduce(this.patientRegister.prList,this.multipleSelection,'id=id') this.setForm(this.patientRegister.patientRegisterRdInit) this.getPatientRegisterAbs(); } }) .catch((err) => { if (err == "cancel") { this.$message.info("已取消操作"); } }); },
//查询
async Query() { this.patientRegister.prList = []; let body = {maxResultCount:500};
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){ 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);
const loading = this.$loading({ lock: true, text: "Loading", spinner: "el-icon-loading", background: "rgba(0, 0, 0, 0.7)", }); postapi("/api/app/patientregister/getlistinfilter", body) .then((res) => { if (res.code != -1) { this.patientRegister.prList = res.data.items;
//配合多选使用
this.patientRegister.prList.forEach((item, index) => { item.index = index; item.choosed = false; }); } loading.close(); }) .catch((err) => { loading.close(); }); // try {
// let res =await postapi('/api/app/patientregister/getlistinfilter', body);
// this.patientRegister.prList = res.data;
// } catch (error) {
// console.log("query error",error);
// }
},
//右击菜单
onCellRightClick(row, column) { this.rClickRow = { ...row }; //右击的行记录
this.rClickColumn = { ...column }; //右击的列(预留)
console.log(row, column.property); }, onContextmenu(event) { //console.log('onContextmenu',event);
if (!this.rClickRow) return false; let row = { ...this.rClickRow }; this.$contextmenu({ items: [ { label: "发送检验申请", onClick: () => { this.lisRequest(row.id); }, }, { label: "预览检验条码", onClick: () => { this.lisPrint(row.id, "0002", true); }, }, { label: "打印检验条码", onClick: () => { this.lisPrint(row.id, "0002", false); }, }, { label: "预览Pacs条码", onClick: () => { this.pacsPrint(row.id, "0004", true); }, }, { label: "打印Pacs条码", onClick: () => { this.pacsPrint(row.id, "0004", false); }, }, { label: "----------------", }, ], event, //x: event.clientX,
//y: event.clientY,
customClass: "custom-class", zIndex: 3, minWidth: 80, });
this.rClickRow = null; return false; },
//批量更新分组按钮
btnGroupBatch() { let customerOrgId = this.patientRegister.query.customerOrgId; if (!customerOrgId) { this.$message.warning("请选择单位"); return; } //取消勾选,换成选择的方式 start
this.multipleSelection = []; this.patientRegister.prList.forEach((e) => { if (e.choosed) this.multipleSelection.push(e); }); //取消勾选,换成选择的方式 end
if (this.multipleSelection.length < 1) { this.$message.info("请选择要操作的记录!"); return; }
this.dialogGroup = true; },
//批量更新分组处理
async groupBatchHandle() { let groupBatch = { patientRegisterId: null, ...this.groupBatch };
if (groupBatch.isReserveAddAsbitem) { groupBatch.isReserveAddAsbitem = "Y"; } else { groupBatch.isReserveAddAsbitem = "N"; } console.log("groupBatch", groupBatch); if (!groupBatch.customerOrgGroupId) { this.$message.warning("请选择分组"); return; }
this.elProgress.display = true; this.elProgress.percentage = 0; for (let i = 0; i < this.multipleSelection.length; i++) { groupBatch.patientRegisterId = this.multipleSelection[i].id; try { await postapi( "/api/app/patientregister/updatepatientregistercustomerorggroup", groupBatch ); } catch (error) { console.log(error); } this.elProgress.percentage = Math.floor( ((i + 1) * 100) / this.multipleSelection.length ); } this.$message.success("操作成功!"); this.dialogGroup = false; this.Query(); },
//快速查询项目
filterMethod(keyWords) { //console.log('filterMethod',this.dict.asbItemQuick)
if (keyWords) { this.quickAsb = []; this.dict.asbItemQuick.forEach((item) => { if ( item.displayName.toLowerCase().indexOf(keyWords.toLowerCase()) > -1 || item.simpleCode.toLowerCase().indexOf(keyWords.toLowerCase()) > -1 || item.shortName.toLowerCase().indexOf(keyWords.toLowerCase()) > -1 ) { this.quickAsb.push(item); } }); } else { this.quickAsb = deepCopy(this.dict.asbItemQuick); } },
//快速选择项目
quickChoosedAsb(v) { //过滤已选的的组合项目
let lfind = -1; if (v) { lfind = arrayExistObj(this.quickAsb, "id", v); if (lfind > -1) { this.asbitemBatch.asbitemsTemp.push({ asbitemId: v, asbitemName: this.quickAsb[lfind].displayName, //仅作显示用
patientRegisterId: null, standardPrice: this.quickAsb[lfind].price, chargePrice: this.quickAsb[lfind].price, payTypeFlag: "1", //默认单位支付
isCharge: "N", amount: 1, }); this.quickAsb.splice(lfind, 1); arrayReduce(this.dict.asbItemQuick, { id: v }, "id=id"); } } //console.log(v, this.asbitemBatch.asbitemsTemp);
this.$nextTick(() => { this.$refs['quickAsbOCX'].blur(); //total asbItemId
this.asbItemId = '' this.quickAsb = deepCopy(this.dict.asbItemQuick) this.$refs['quickAsbOCX'].focus(); //total asbItemId
});
},
//删除临时显示的组合项目
removeAbs(row) { let lfind = arrayExistObj( this.asbitemBatch.asbitemsTemp, "asbitemId", row.asbitemId ); if (lfind > -1) this.asbitemBatch.asbitemsTemp.splice(lfind, 1); },
rowClickaAbitemCurr(row) { this.asbitemBatch.asbitemCurr = row; },
btnRemoveAbs() { if (!this.asbitemBatch.asbitemCurr.asbitemId) { this.$message.warning("请选择要删除的组合项目!"); return; } this.removeAbs(this.asbitemBatch.asbitemCurr); this.asbitemBatch.asbitemCurr.asbitemId = null; },
removeAllAbs() { this.asbitemBatch.asbitemsTemp = []; },
//批量更新项目
btnAsbBatch() { let customerOrgId = this.patientRegister.query.customerOrgId; if (!customerOrgId) { this.$message.warning("请选择单位"); return; } //取消勾选,换成选择的方式 start
this.multipleSelection = []; this.patientRegister.prList.forEach((e) => { if (e.choosed) this.multipleSelection.push(e); }); //取消勾选,换成选择的方式 end
if(this.multipleSelection.length < 1){ this.$message.warning("请选择要操作的记录") return }
this.dialogAsbitem = true; //供快速选择的组合项目
this.dict.asbItemQuick = deepCopy(this.dict.asbItemAll); this.asbitemBatch.asbitemCurr.asbitemId = null; this.asbitemBatch.asbitemsTemp = []; },
asbitemDel(type) { //typ==0 为批量删除
if (Number(type) == 0) { this.asbitemBatch.asbitemsTemp = []; } else { if (!this.asbitemBatch.asbitemCurr.asbitemId) { this.$message.warning("请选中要删除的项目!"); return; } //console.log(this.asbitemBatch.asbitemsTemp,this.asbitemBatch.asbitemCurr)
let lfind = arrayExistObj( this.asbitemBatch.asbitemsTemp, "asbitemId", this.asbitemBatch.asbitemCurr.asbitemId ); if (lfind > -1) { this.asbitemBatch.asbitemsTemp.splice(lfind, 1); this.asbitemBatch.asbitemCurr.asbitemId = null; } //console.log(lfind);
} },
//批量调整支付方式
changePayTypeFlag(flag) { this.asbitemBatch.asbitemsTemp.forEach((e) => { e.payTypeFlag = flag; return e; }); },
//批量调整项目
async asbitemBatchHandle() { let msg = "", body = {}; if (this.asbitemBatch.asbitemsTemp.length == 0) { this.$message.warning("没有选择组合项目,不可执行此操作!"); return; } if (this.asbitemBatch.operate == "add") { this.asbitemBatch.asbitemsTemp.forEach((e, index) => { if (!e.amount || !e.chargePrice) { msg = "第 " + (index + 1) + " 行,未输入数量或价格!"; } }); if (msg) { this.$message.warning(msg); return; } // {
// "organizationUnitId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
// "createRegisterAsbitemDtos": [
// {
// "asbitemId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
// "patientRegisterId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
// "standardPrice": 0,
// "chargePrice": 0,
// "payTypeFlag": "string",
// "isCharge": "string",
// "lisRequestId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
// "amount": 0,
// "groupPackageId": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
// }
// ]
// }
let createRegisterAsbitemDtos = deepCopy( this.asbitemBatch.asbitemsTemp );
createRegisterAsbitemDtos.forEach((e) => { delete e.asbitemName; return e; }); this.elProgress.display = true; this.elProgress.percentage = 0; for (let i = 0; i < this.multipleSelection.length; i++) { createRegisterAsbitemDtos.forEach((e) => { e.patientRegisterId = this.multipleSelection[i].id; return e; }); body = { organizationUnitId: this.multipleSelection[i].organizationUnitId, createRegisterAsbitemDtos, }; try { await postapi( "/api/app/registerasbitem/createregisterasbitemincustomerorgmany", body ); } catch (error) { console.log("批量增加项目错误,原因:", error); } this.elProgress.percentage = Math.floor( ((i + 1) * 100) / this.multipleSelection.length ); } } else { // {
// isDeleteGroup: 'N',
// patientRegisterId: null,
// asbitemIds: [],
// }
let asbitemIds = []; if (this.asbitemBatch.isDeleteGroup) { body.isDeleteGroup = "Y"; } else { body.isDeleteGroup = "N"; } this.elProgress.display = true; this.elProgress.percentage = 0; for (let i = 0; i < this.multipleSelection.length; i++) { this.asbitemBatch.asbitemsTemp.forEach((e) => { asbitemIds.push(e.asbitemId); });
body.patientRegisterId = this.multipleSelection[i].id; body.asbitemIds = asbitemIds;
try { await postapi( "/api/app/registerasbitem/deleteregisterasbitemincustomerorgmany", body ); } catch (error) { console.log("批量删除项目错误,原因:", error); } this.elProgress.percentage = Math.floor( ((i + 1) * 100) / this.multipleSelection.length ); } }
this.$message.success("操作成功!"); this.dialogAsbitem = false; this.Query(); },
//检验申请
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 = localStorage.getItem("token"); let user = localStorage.getItem("user"); let toOutShell = { ReportCode, token, preViewCanPrint: "N", Parameters: [ { Name: "printer", Value: user }, { Name: "hisLog", Value: "pic/hisLog.jpg" }, ], };
if (isPreview) { //http://140.143.162.39:9529/api/app/printreport/getlisrequestreport?PatientRegisterId=3a0d2e90-da68-3746-6775-bf17e5f9b295
//this.multipleSelection.forEach((item,index) =>{
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); }); // });
} 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); }); } },
//pacs条码打印
pacsPrint(prId, ReportCode, isPreview) { if (!this.$peisAPI) { this.$message.info("此功能,需要在壳客户端才可运行!"); return; } let token = localStorage.getItem("token"); let user = localStorage.getItem("user"); let toOutShell = { ReportCode, token, preViewCanPrint: "Y", Parameters: [ { Name: "printer", Value: user }, { Name: "hisLog", Value: "pic/hisLog.jpg" }, ], };
if (isPreview) { //http://140.143.162.39:9529/api/app/printreport/getpacsnoreport?PatientRegisterId=3a0c990e-5756-2dc0-19d5-69a617fe4048
//this.multipleSelection.forEach((item,index) =>{
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); }); // });
} 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); }); } },
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; }, },
//监听事件
watch: { //触发查询事件
"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>
|