Browse Source

Merge

master
pengjun 2 years ago
parent
commit
9bd1dcf7d4
  1. 158
      src/components/patientRegister/MergeAsbitem.vue
  2. 15
      src/components/patientRegister/PatientRegisterEdit.vue

158
src/components/patientRegister/MergeAsbitem.vue

@ -1,6 +1,7 @@
<template>
<div>
<div>
<!--
<div style="margin-top: -20px; margin-bottom: 5px;">
<span>项目类别</span>
<el-cascader :options="dict.itemTypeTree" v-model="itemTypeIds" style="margin-left: 3px;width:160px;"
@ -8,36 +9,42 @@
clearable filterable @change="getAsbItemByItemType" size="small">
</el-cascader>
</div>
-->
<el-table :data="tableData" border style="width: 100%" row-key="id" height="300" highlight-current-row size="small"
@selection-change="handleSelectionChange" :span-method="spanMethod" ref="tableData"
:row-style="{ height: '30px' }">
@selection-change="handleSelectionChange" ref="tableData" :row-style="{ height: '30px' }">
<el-table-column type="selection" :selectable="selectable" align="center" />
<el-table-column label="项目类别" width="120" prop="itemTypeName" />
<el-table-column label="组合项目" width="140" prop="asbitemName" />
<!-- isItemResultMerger 项目是否可以合并 -->
<el-table-column label="已合并" width="60" prop="isAsbitemMerger" align="center">
<el-table-column label="检查项目" width="120" prop="mergerAsbitemName" />
<el-table-column label="项目类别" min-width="120">
<template slot-scope="scope">
<div>{{ scope.row.isAsbitemMerger == 'Y' ? '是' : '否' }}</div>
<table style="border: 0;width:100%;">
<tr v-for="item in scope.row.registerCheckAsbitems">
<td>{{ item.itemTypeName }}</td>
</tr>
</table>
</template>
</el-table-column>
<el-table-column label="合并后项目名称" width="190" prop="mergerAsbitemName">
<el-table-column label="组合项目" min-width="140">
<template slot-scope="scope">
<div>{{ scope.row.isAsbitemMerger == 'Y' ? scope.row.mergerAsbitemName : '' }}</div>
<table style="border: 0;width:100%;">
<tr v-for="item in scope.row.registerCheckAsbitems">
<td>{{ item.asbitemName }}</td>
</tr>
</table>
</template>
</el-table-column>
</el-table>
</div>
<!-- 按钮区域 -->
<div style="display: flex; margin-top: 30px; margin-left: 280px">
<div style="margin-left: 10px">
<el-button class="commonbutton" type="primary" @click="mergeSubmit" style="width:80px;">合并项目</el-button>
<el-button class="commonbutton" type="primary" @click="btnSubmit('+')" style="width:80px;">合并项目</el-button>
</div>
<div style="margin-left: 10px">
<el-button class="commonbutton" type="info" @click="unMergeSubmit" style="width:80px;">取消合并</el-button>
<el-button class="commonbutton" type="info" @click="btnSubmit('-')" style="width:80px;">取消合并</el-button>
</div>
<div style="margin-left: 10px">
<el-button class="commonbutton" type="danger" @click="patientRegister.mergeAsbitemVisble = false" style="width:80px;">关闭</el-button>
<el-button class="commonbutton" type="danger" @click="patientRegister.mergeAsbitemVisble = false"
style="width:80px;">关闭</el-button>
</div>
</div>
</div>
@ -46,7 +53,6 @@
<script>
import { mapState } from "vuex";
import { getapi, postapi, putapi, deletapi } from "@/api/api";
import { examinationgender } from "@/request/systemapi";
import { dddw, arrayExistObj, deepCopy } from "../../utlis/proFunc";
import { getTreeAllChildIdsById } from "../../utlis/tree";
// import
@ -64,7 +70,7 @@ export default {
{ label: "申请新的条码", value: "new" },
], //
selectedData: [], //
finalSelected:[], //selectedData
finalSelected: [], //selectedData
};
},
@ -131,40 +137,40 @@ export default {
startRow = i;
preVal = this.tableData[i].registerCheckId;
}
if (i == this.tableData.length - 1 && preVal === curVal){
if (i == this.tableData.length - 1 && preVal === curVal) {
this.spanRow.push({ startRow, endRow: i });
}
}
}
},
handleSelectionChange(v) {
handleSelectionChange(v) {
this.selectedData = v;
},
//
getFinalSelected(){
getFinalSelected() {
let currSelectedCheckIds = [];
let finalSelectedIds = [];
this.finalSelected = deepCopy(this.selectedData); //
this.selectedData.forEach(e => {
if(currSelectedCheckIds.indexOf(e.registerCheckId) < 0) currSelectedCheckIds.push(e.registerCheckId);
if (currSelectedCheckIds.indexOf(e.registerCheckId) < 0) currSelectedCheckIds.push(e.registerCheckId);
finalSelectedIds.push(e.registerAsbitemId);
});
console.log('currSelectedCheckIds', currSelectedCheckIds);
console.log('finalSelectedIds', finalSelectedIds);
// //
this.tableData.forEach(e => {
if(currSelectedCheckIds.indexOf(e.registerCheckId) > -1){
if(finalSelectedIds.indexOf(e.registerAsbitemId) < 0){
if (currSelectedCheckIds.indexOf(e.registerCheckId) > -1) {
if (finalSelectedIds.indexOf(e.registerAsbitemId) < 0) {
finalSelectedIds.push(e.registerAsbitemId);
this.finalSelected.push(e);
}
}
}
});
console.log('this.selectedData', this.selectedData);
@ -191,7 +197,7 @@ export default {
} else {
this.tableData = [];
this.tableDataAll.forEach(e => {
if (itemTypeIdsChild.indexOf(e.itemTypeId) > -1 ) {
if (itemTypeIdsChild.indexOf(e.itemTypeId) > -1) {
this.tableData.push(e);
}
});
@ -201,7 +207,7 @@ export default {
},
getAsbItemList(id) {
this.tableDataAll = [];
this.tableDataAll = [];
// /api/app/registerasbitem/getmergeregisterasbitemlist?PatientRegisterId=3fa85f64-5717-4562-b3fc-2c963f66afa6
// "registerAsbitemId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
// "asbitemName": "string",
@ -212,49 +218,91 @@ export default {
// "mergerAsbitemName": "string"
getapi(
`/api/app/registerasbitem/getmergeregisterasbitemlist?PatientRegisterId=${id}`
`/api/app/registerasbitem/GetMergeRegisterAsbitemList?PatientRegisterId=${id}`
).then((res) => {
if(res.code != -1){
if (res.code != -1) {
//isItemResultMerger
res.data.forEach(e =>{
//
if(e.isItemResultMerger.toUpperCase() == 'Y'){
this.tableDataAll.push(e);
}
});
this.getAsbItemByItemType();
}
// res.data.forEach(e => {
// //
// if (e.isItemResultMerger.toUpperCase() == 'Y') {
// this.tableDataAll.push(e);
// }
// });
// this.getAsbItemByItemType();
this.tableData = res.data
this.selectedData = []
}
});
},
//
mergeSubmit() {
let registerAsbitemIds = [];
let itemTypes = [];
this.getFinalSelected();
this.finalSelected.forEach(e => {
if(itemTypes.indexOf(e.itemTypeId) < 0) itemTypes.push(e.itemTypeId);
registerAsbitemIds.push(e.registerAsbitemId);
btnSubmit(mergeType) {
let registerCheckIds = [];
let count = (mergeType == '+') ? 2 : 1
if (this.selectedData.length < count) {
this.$message.warning({showClose:true,message:`请至少勾选 ${count} 个以上要${mergeType == '+' ? '合并' : '取消合并'}的检查项目!`});
return;
}
this.selectedData.forEach(e => {
registerCheckIds.push(e.registerCheckId)
});
if(itemTypes.length > 1){
this.$message.warning("勾选了不同类别的项目,数据校验失败,不可执行此操作!");
return;
if (mergeType == '+') {
postapi("/api/app/registerasbitem/MergeRegisterAsbitem", { registerCheckIds }).then(
(res) => {
if (res.code != -1) {
console.log("操作成功!");
this.getAsbItemList(this.id);
}
}
);
} else {
postapi("/api/app/registerasbitem/cancelmergeregisterasbitem", { registerCheckIds }).then(
(res) => {
if (res.code != -1) {
console.log("操作成功!");
this.getAsbItemList(this.id);
}
}
);
}
},
if (registerAsbitemIds.length < 2) {
this.$message.warning("请勾选 2 个以上要合并的项目!");
//
mergeSubmit() {
let registerCheckIds = [];
// let itemTypes = [];
// this.getFinalSelected();
// this.finalSelected.forEach(e => {
// if (itemTypes.indexOf(e.itemTypeId) < 0) itemTypes.push(e.itemTypeId);
// registerAsbitemIds.push(e.registerAsbitemId);
// });
// if (itemTypes.length > 1) {
// this.$message.warning("");
// return;
// }
if (this.selectedData.length < 2) {
this.$message.warning("请勾选 2 个以上要合并的检查项目!");
return;
}
this.selectedData.forEach(e => {
registerCheckIds.push(e.registerCheckId)
});
let body = {
registerAsbitemIds,
medicalCenterId: this.medicalCenterId
registerCheckIds,
// medicalCenterId: this.medicalCenterId
};
postapi("/api/app/registerasbitem/mergeregisterasbitem", body).then(
//
// {
// "registerCheckIds": [
// "3fa85f64-5717-4562-b3fc-2c963f66afa6"
// ]
// }
postapi("/api/app/registerasbitem/MergeRegisterAsbitem", body).then(
(res) => {
if (res.code != -1) {
console.log("操作成功!");

15
src/components/patientRegister/PatientRegisterEdit.vue

@ -909,7 +909,10 @@ export default {
this.form.nationId = idNos.nationId
this.form.idNo = idNos.IDCode
this.form.address = idNos.Address
this.peoplePhoto = 'data:image/bmp;base64,' + idNos.Photo
this.patientRegister.photo = 'data:image/bmp;base64,' + idNos.Photo
this.changeIdNo() //
}
})
},
@ -1381,20 +1384,20 @@ export default {
return;
}
if (!this.$peisAPI) {
this.$message.info("此功能,需要在壳客户端才可运行!")
this.$message.info({showClose:true,message:"此功能,需要在壳客户端才可运行!"})
return
}
this.$peisAPI.photoGrah()
.then(res => {
console.log(res)
//alert(res)
console.log('this.$peisAPI.photoGrah 原始返回结果',res)
let lres = JSON.parse(res)
if (lres.code && lres.code.toLowerCase() == 'success') {
if (lres.code == 1) {
let uploadPhoto = {
patientRegisterId: this.form.id,
photo: lres.Photo,
photo: lres.data.Photo,
};
this.patientRegister.photo = `data:image/${lres.PhotoFormat};base64,${lres.Photo}`
this.peoplePhoto = `data:image/${lres.data.PhotoFormat == 'jpg' ? 'jpeg':lres.data.PhotoFormat};base64,${lres.data.Photo}`
this.patientRegister.photo = `data:image/${lres.data.PhotoFormat == 'jpg' ? 'jpeg':lres.data.PhotoFormat};base64,${lres.data.Photo}`
return postapi(`/api/app/patient-register/up-load-img`, uploadPhoto)
} else {
this.$message.error("上传照片错误" + lres.code)

Loading…
Cancel
Save