Browse Source

merge

master
pengjun 2 years ago
parent
commit
57d24e6a8f
  1. 185
      src/components/patientRegister/MergeAsbitem.vue
  2. 17
      src/components/patientRegister/PatientRegisterItem.vue
  3. 9
      src/components/patientRegister/PatientRegisterList.vue
  4. 24
      src/components/patientRegister/patientRegisterAsbItem.vue

185
src/components/patientRegister/MergeAsbitem.vue

@ -9,8 +9,9 @@
</el-cascader>
</div>
<el-table :data="tableData" border style="width: 100%" row-key="id" height="300" highlight-current-row size="small"
@selection-change="handleSelectionChange" ref="tableData">
<el-table-column type="selection" />
@selection-change="handleSelectionChange" :span-method="spanMethod" ref="tableData"
:row-style="{ height: '30px' }">
<el-table-column type="selection" :selectable="selectable" />
<el-table-column label="项目类别" width="120" prop="itemTypeName" />
<el-table-column label="组合项目" width="140" prop="asbitemName" />
<!-- isItemResultMerger 项目是否可以合并 -->
@ -54,6 +55,7 @@ export default {
data() {
return {
tableData: [], //
spanRow: [], //{ startRow: 0, endRow: 0 }
tableDataAll: [], //
itemTypeIds: [], //ID
options: [
@ -62,6 +64,7 @@ export default {
{ label: "申请新的条码", value: "new" },
], //
selectedData: [], //
finalSelected:[], //selectedData
};
},
@ -75,72 +78,101 @@ export default {
},
methods: {
handleSelectionChange(v) {
console.log('this.selectedData ,v', this.selectedData,v);
selectable(row, index) {
//console.log(row,index);
let able = true;
if (index == 0) return true;
if (this.tableData[index - 1].registerCheckId == row.registerCheckId) able = false;
return able;
},
if (!v || v.length < 1) {
this.selectedData = v;
return;
spanMethod({ row, column, rowIndex, columnIndex }) {
//console.log(row, column, rowIndex, columnIndex);
if (columnIndex == 3) {
for (let i = 0; i < this.spanRow.length; i++) {
if (rowIndex == this.spanRow[i].startRow) {
return {
rowspan: Number(this.spanRow[i].endRow - this.spanRow[i].startRow) + 1,
colspan: 1
};
}
}
}
if (columnIndex == 4) {
for (let i = 0; i < this.spanRow.length; i++) {
if (rowIndex == this.spanRow[i].startRow) {
return {
rowspan: Number(this.spanRow[i].endRow - this.spanRow[i].startRow) + 1,
colspan: 1
};
} else if (this.spanRow[i].startRow < rowIndex && rowIndex <= this.spanRow[i].endRow) {
return {
rowspan: 0,
colspan: 0
}
}
}
}
},
//
parseSpanRow() {
this.spanRow = [];
let preVal = '', curVal = '';
let startRow = 0;
for (let i = 0; i < this.tableData.length; i++) {
if (i == 0) {
preVal = this.tableData[i].registerCheckId;
curVal = this.tableData[i].registerCheckId;
} else {
curVal = this.tableData[i].registerCheckId;
if (preVal !== curVal) {
if (startRow !== i - 1) this.spanRow.push({ startRow, endRow: i - 1 });
startRow = i;
preVal = this.tableData[i].registerCheckId;
}
if (i == this.tableData.length - 1 && preVal === curVal){
this.spanRow.push({ startRow, endRow: i });
}
}
}
},
this.selectedData = v;
//
// let currSelectedIds = [];
// let finalSelected = deepCopy(v); //
// v.forEach(e => {
// currSelectedIds.push(e.registerAsbitemId);
// });
// console.log('currSelectedIds', currSelectedIds);
// //
// this.selectedData.forEach(e => {
// //
// if (currSelectedIds.indexOf(e.registerAsbitemId) < 0) {
// for (let i = finalSelected.length - 1; i > -1; i--) {
// if(finalSelected[i].registerCheckId == e.registerCheckId){
// finalSelected.splice(i,1);
// }
// }
// }
// });
// //
// let currMergeIds = [];
// currSelectedIds = [];
// finalSelected.forEach(e => {
// currSelectedIds.push(e.registerAsbitemId);
// if(currMergeIds.indexOf(e.registerCheckId) < 0){
// currMergeIds.push(e.registerCheckId);
// }
// });
handleSelectionChange(v) {
this.selectedData = v;
},
// this.tableData.forEach(e =>{
// if(currMergeIds.indexOf(e.registerCheckId) > - 1){
// if(currSelectedIds.indexOf(e.registerAsbitemId) < 0){
// finalSelected.push(e);
// }
// }
// });
//
getFinalSelected(){
let currSelectedCheckIds = [];
let finalSelectedIds = [];
// this.selectedData = deepCopy(finalSelected);
this.finalSelected = deepCopy(this.selectedData); //
this.selectedData.forEach(e => {
if(currSelectedCheckIds.indexOf(e.registerCheckId) < 0) currSelectedCheckIds.push(e.registerCheckId);
finalSelectedIds.push(e.registerAsbitemId);
});
// console.log('this.selectedData', this.selectedData);
console.log('currSelectedCheckIds', currSelectedCheckIds);
console.log('finalSelectedIds', finalSelectedIds);
// this.$nextTick(function () {
// //this.$refs['tableData'].clearSelection();
// this.selectedData.forEach(row => {
// this.$refs['tableData'].toggleRowSelection(row,true)
// })
// });
// //
this.tableData.forEach(e => {
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);
console.log('this.finalSelected', this.finalSelected);
},
//
getAsbItemByItemType() {
let itemTypeIdsChild = [], id = '';
@ -164,11 +196,12 @@ export default {
}
});
}
this.parseSpanRow();
},
getAsbItemList(id) {
this.tableDataAll = [];
this.tableData = [];
// /api/app/registerasbitem/getmergeregisterasbitemlist?PatientRegisterId=3fa85f64-5717-4562-b3fc-2c963f66afa6
// "registerAsbitemId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
// "asbitemName": "string",
@ -181,27 +214,43 @@ export default {
getapi(
`/api/app/registerasbitem/getmergeregisterasbitemlist?PatientRegisterId=${id}`
).then((res) => {
this.tableDataAll = res.data;
if(res.code != -1){
//isItemResultMerger
res.data.forEach(e =>{
//
if(e.isItemResultMerger.toUpperCase() == 'Y'){
this.tableDataAll.push(e);
}
});
this.getAsbItemByItemType();
}
});
},
//
mergeSubmit() {
let registerAsbitemIds = [];
let itemTypes = [];
this.selectedData.forEach(e =>{
this.getFinalSelected();
this.finalSelected.forEach(e => {
if(itemTypes.indexOf(e.itemTypeName) < 0) itemTypes.push(e.itemTypeName);
registerAsbitemIds.push(e.registerAsbitemId);
});
if(registerAsbitemIds.length == 0){
this.$message.warning("请勾选要合并的项目!");
if(itemTypes.length > 1){
this.$message.warning("勾选了不同类别的项目,数据校验失败,不可执行此操作!");
return;
}
if (registerAsbitemIds.length < 2) {
this.$message.warning("请勾选 2 个以上要合并的项目!");
return;
}
let body={
let body = {
registerAsbitemIds,
organizationUnitId:this.organizationUnitId
organizationUnitId: this.organizationUnitId
};
@ -220,22 +269,22 @@ export default {
unMergeSubmit() {
let registerCheckIds = [];
this.selectedData.forEach(e =>{
if(registerCheckIds.indexOf(e.registerCheckId) < 0){
this.selectedData.forEach(e => {
if (e.isAsbitemMerger.toUpperCase() == 'Y' && registerCheckIds.indexOf(e.registerCheckId) < 0) {
registerCheckIds.push(e.registerCheckId);
}
});
if(registerCheckIds.length == 0){
this.$message.warning("未选择已合并的项目,不可执行此操作!");
if (registerCheckIds.length == 0) {
this.$message.warning("未选择已合并的项目,不可执行此操作!");
return;
}
console.log('registerCheckIds',registerCheckIds);
//console.log('registerCheckIds', registerCheckIds);
let body={
let body = {
registerCheckIds,
organizationUnitId:this.organizationUnitId
organizationUnitId: this.organizationUnitId
};
postapi("/api/app/registerasbitem/cancelmergeregisterasbitem", body).then(

17
src/components/patientRegister/PatientRegisterItem.vue

@ -268,7 +268,7 @@ export default {
}
//if (body.length > 0 ) await this.batchEditAsb(body, msg);
console.log('111111', msg, body.length, body, insBody.length, insBody);
//console.log('111111', msg, body.length, body, insBody.length, insBody);
if (body.length > 0 && insBody.length > 0) {
await this.batchEditAsb(body, '');
await this.batchAddAsb(insBody, msg);
@ -288,9 +288,17 @@ export default {
},
//
async batchAddAsb(body, msg) {
console.log(`/api/app/registerasbitem/createmany?OrganizationUnitId=${this.patientRegisterForm.organizationUnitId}`, body)
await postapi(`/api/app/registerasbitem/createmany?OrganizationUnitId=${this.patientRegisterForm.organizationUnitId}`, body)
async batchAddAsb(registerAsbitems, msg) {
let body = {
organizationUnitId:this.patientRegisterForm.organizationUnitId,
registerAsbitems
}
if(this.patientRegisterForm.organizationUnitId.id){
body.isAutoMerger = 'N'
}
//console.log(`/api/app/registerasbitem/createregisterasbitemmany`, body)
await postapi('/api/app/registerasbitem/createregisterasbitemmany', body)
.then((res) => {
console.log("batchAddAsb", res);
if (res.code == 1) {
@ -849,6 +857,7 @@ export default {
/*text-align: center;*/
padding-left: 1px;
padding-right: 1px;
/*background-color: rgb(255, 0, 255);*/
}
::v-deep .el-table th.el-table__cell {

9
src/components/patientRegister/PatientRegisterList.vue

@ -1156,4 +1156,11 @@ export default {
input[type="number"]::-webkit-outer-spin-button {
-webkit-appearance: none !important;
margin: 0 !important;
}</style>
}
::v-deep .el-table__body tr.current-row>td {
background-color:#409EFF !important;
}
</style>

24
src/components/patientRegister/patientRegisterAsbItem.vue

@ -7,11 +7,11 @@
ref="patientRegister.patientRegisterAbs">
<el-table-column type="index" label="序号" width="50" />
<el-table-column prop="asbitemName" label="已选组合项目" width="120" />
<el-table-column prop="standardPrice" label="标准价" />
<el-table-column prop="discount" label="折扣" />
<el-table-column prop="amount" label="数量" width="50" />
<el-table-column prop="chargePrice" label="价格" />
<el-table-column prop="payTypeFlag" label="支付方式">
<el-table-column prop="standardPrice" label="标准价" align="center" />
<el-table-column prop="discount" label="折扣" align="center" />
<el-table-column prop="amount" label="数量" width="50" align="center" />
<el-table-column prop="chargePrice" label="价格" align="center" />
<el-table-column prop="payTypeFlag" label="支付方式" align="center" >
<template slot-scope="scope">
<div>
{{
@ -20,12 +20,12 @@
</div>
</template>
</el-table-column>
<el-table-column prop="isCharge" label="收费" width="50">
<el-table-column prop="isCharge" label="收费" width="50" align="center" >
<template slot-scope="scope">
<el-checkbox :value="scope.row.isCharge == 'Y'" />
<el-checkbox :value="scope.row.isCharge == 'Y'" align="center" />
</template>
</el-table-column>
<el-table-column prop="checkCompleteFlag" label="状态">
<el-table-column prop="checkCompleteFlag" label="状态" align="center" >
<template slot-scope="scope">
<div>
{{
@ -39,13 +39,13 @@
</div>
</template>
</el-table-column>
<el-table-column prop="isLock" label="锁" width="50">
<el-table-column prop="isLock" label="锁" width="50" align="center" >
<template slot-scope="scope">
<el-checkbox :value="scope.row.isLock == 'Y'" />
<el-checkbox :value="scope.row.isLock == 'Y'" align="center" />
</template>
</el-table-column>
<el-table-column prop="creatorName" label="登记人"></el-table-column>
<el-table-column prop="creationTime" label="登记日期" width="90">
<el-table-column prop="creatorName" label="登记人" align="center" />
<el-table-column prop="creationTime" label="登记日期" width="90" align="center" >
<template slot-scope="scope">
<div>{{ lmoment(scope.row.creationTime, "yyyy-MM-DD") }}</div>
</template>

Loading…
Cancel
Save