|
|
|
@ -10,9 +10,8 @@ |
|
|
|
<div style="display: flex"> |
|
|
|
<div> |
|
|
|
<span>体检中心:</span> |
|
|
|
<el-select v-model="medicalCenterId" placeholder="请选择体检中心" |
|
|
|
default-first-option clearable filterable style="margin-left: 10px" @change="changeMedicalCenter" |
|
|
|
size="small"> |
|
|
|
<el-select v-model="medicalCenterId" placeholder="请选择体检中心" default-first-option clearable filterable |
|
|
|
style="margin-left: 10px" @change="changeMedicalCenter" size="small"> |
|
|
|
<el-option v-for="item in dict.medicalCenter" :key="item.id" :label="item.displayName" :value="item.id"> |
|
|
|
{{ item.displayName }} |
|
|
|
</el-option> |
|
|
|
@ -25,7 +24,7 @@ |
|
|
|
<el-table-column type="index" label="序号" width="50" align="center" /> |
|
|
|
<el-table-column label="id" prop="id" min-width="200" align="center" /> |
|
|
|
<el-table-column prop="displayName" label="名称" min-width="150" /> |
|
|
|
<el-table-column v-if="!medicalCenterId" prop="medicalCenterId" label="体检中心" min-width="150"> |
|
|
|
<el-table-column v-show="!medicalCenterId" prop="medicalCenterId" label="体检中心" min-width="150"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
{{ dddw(dict.medicalCenter, "id", scope.row.medicalCenterId, "displayName") }} |
|
|
|
</template> |
|
|
|
@ -46,7 +45,7 @@ |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column prop="queueTime" label="候诊时间" min-width="80" align="center" /> |
|
|
|
<el-table-column prop="isActive" label="是否启用" min-width="80" align="center"> |
|
|
|
<el-table-column prop="isActive" label="启用" min-width="40" align="center"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<div style="font-family: 'Microsoft YaHei';">{{ scope.row.isActive == 'Y' ? '√' : '' }}</div> |
|
|
|
</template> |
|
|
|
@ -83,10 +82,10 @@ |
|
|
|
<el-button class="deleteButton" @click="btnDel">删除</el-button> |
|
|
|
</div> |
|
|
|
<div v-show="checkPagePriv(pagePriv.privs, '置顶')" style="margin-top: 5px"> |
|
|
|
<el-button class="commonbutton" @click="btnSetTop">置顶</el-button> |
|
|
|
<el-button class="commonbutton" @click="btnSetBottomOrTop(1)">置顶</el-button> |
|
|
|
</div> |
|
|
|
<div v-show="checkPagePriv(pagePriv.privs, '置底')" style="margin-top: 5px"> |
|
|
|
<el-button class="commonbutton" @click="btnSetBottom">置底</el-button> |
|
|
|
<el-button class="commonbutton" @click="btnSetBottomOrTop(2)">置底</el-button> |
|
|
|
</div> |
|
|
|
<div v-show="checkPagePriv(pagePriv.privs, '保存排序')" style="margin-top: 5px"> |
|
|
|
<el-button class="commonbutton" @click="btnSort" :disabled="!isDrag">保存排序</el-button> |
|
|
|
@ -96,12 +95,12 @@ |
|
|
|
|
|
|
|
<!--分组项目信息 --> |
|
|
|
<div> |
|
|
|
<RoomAsbitem :customerOrgGroup="curCustomerOrgGroup" :refreshMoney="refreshMoney" /> |
|
|
|
<RoomAsbitem :room="curRoom" /> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
<!-- 新增或者编辑弹框 --> |
|
|
|
<el-dialog :title="dataTransOpts.tableS.customer_org_group.id ? '编辑' : '新增'" :close-on-click-modal="false" |
|
|
|
<el-dialog :title="dataTransOpts.tableS.room.id ? '编辑' : '新增'" :close-on-click-modal="false" |
|
|
|
:visible.sync="dialogWin.RoomEdit" width="800px" @close="close_dialogWinRoomEdit"> |
|
|
|
<RoomEdit :params="RoomEditParams" /> |
|
|
|
</el-dialog> |
|
|
|
@ -138,38 +137,22 @@ export default { |
|
|
|
}, |
|
|
|
|
|
|
|
tableData: [], //体检单位分组 |
|
|
|
customerOrgId: "", //当前选中的体检单位id |
|
|
|
customerOrgRegisterList: [], //体检次数列表 |
|
|
|
customerOrgRegister: {}, //体检次数 |
|
|
|
|
|
|
|
curCustomerOrgGroup: {}, // 当前选中分组 |
|
|
|
RoomEditParams: {}, //分组 新增时 用到参数 |
|
|
|
curRoom: {}, // 当前选中房间 |
|
|
|
RoomEditParams: {}, //房间 新增时 用到参数 |
|
|
|
medicalCenterId: "", // 体检中心 |
|
|
|
|
|
|
|
isDrag: false, |
|
|
|
form: { |
|
|
|
//体检单位分组 |
|
|
|
customerOrgId: "", //复制分组时用到(预留查历次分组) |
|
|
|
isComplete: "N", //体检次数是否完成,如完成不允许调整分组项目 |
|
|
|
id: "", |
|
|
|
medicalCenterId: null, //所属体检次数 |
|
|
|
displayName: "", |
|
|
|
price: 0, |
|
|
|
itemTypeId: "", |
|
|
|
medicalCenterId: "", |
|
|
|
forSexId: "A", |
|
|
|
maritalStatusId: "A", |
|
|
|
ageLowerLimit: 0, |
|
|
|
ageUpperLimit: 200, |
|
|
|
jobPost: "", |
|
|
|
jobTitle: "", |
|
|
|
remark: "", |
|
|
|
isMaxMedicalTimes: "N", |
|
|
|
roomTypeFlag: "0", |
|
|
|
queueTime: 0, |
|
|
|
isActive: "Y" |
|
|
|
}, |
|
|
|
formOri: {}, //用于对比分析哪些信息更改了 |
|
|
|
formInit: {}, //表单初始值 |
|
|
|
rules: { |
|
|
|
displayName: [{ required: true, message: "请填写分组名称", trigger: "blur" }], |
|
|
|
}, |
|
|
|
|
|
|
|
}; |
|
|
|
}, |
|
|
|
computed: { |
|
|
|
@ -211,7 +194,7 @@ export default { |
|
|
|
this.tableData.forEach((item, index) => { |
|
|
|
result.push({ id: item.id, displayOrder: index }); |
|
|
|
}); |
|
|
|
putapi("/api/app/customerorggroup/updatesortmany", { |
|
|
|
postapi("/api/app/Room/updatesortmany", { |
|
|
|
itemList: result, |
|
|
|
}).then((res) => { |
|
|
|
console.log("操作成功"); |
|
|
|
@ -221,26 +204,6 @@ export default { |
|
|
|
|
|
|
|
//初始化Sortable组件 |
|
|
|
rowDrop() { |
|
|
|
// this.$nextTick(() => { |
|
|
|
// const tbody = document.querySelector(".el-table__body-wrapper tbody"); |
|
|
|
// const _this = this; |
|
|
|
// Sortable.create(tbody, { |
|
|
|
// handle: ".move", |
|
|
|
// animation: 300, |
|
|
|
// onEnd({ newIndex, oldIndex }) { |
|
|
|
// _this.isDrag = false; |
|
|
|
// const currRow = _this.tableData.splice(oldIndex, 1)[0]; |
|
|
|
// _this.tableData.splice(newIndex, 0, currRow); |
|
|
|
// _this.tableData.map((item, index) => { |
|
|
|
// if (index == newIndex && index == oldIndex) { |
|
|
|
// } else if (index == oldIndex) { |
|
|
|
// } else if (index == newIndex) { |
|
|
|
// } |
|
|
|
// }); |
|
|
|
// console.log(_this.tableData.map((item) => item.displayOrder)); |
|
|
|
// }, |
|
|
|
// }); |
|
|
|
// }); |
|
|
|
|
|
|
|
this.$nextTick(() => { |
|
|
|
const el = document.querySelector(".el-table__body-wrapper tbody"); |
|
|
|
@ -260,45 +223,36 @@ export default { |
|
|
|
}); |
|
|
|
}, |
|
|
|
|
|
|
|
//置底 |
|
|
|
btnSetBottom() { |
|
|
|
if (!this.dataTransOpts.tableS.customer_org_group.id) { |
|
|
|
// 置底 或 置顶 |
|
|
|
btnSetBottomOrTop(sortType) { |
|
|
|
if (!this.dataTransOpts.tableS.room.id) { |
|
|
|
this.$message.warning("请选择操作的数据"); |
|
|
|
return; |
|
|
|
} |
|
|
|
let lfind = arrayExistObj(this.tableData, "id", this.dataTransOpts.tableS.customer_org_group.id); |
|
|
|
let currentRow = {}; |
|
|
|
|
|
|
|
putapi( |
|
|
|
`/api/app/customerorggroup/updatemanysort?id=${this.dataTransOpts.tableS.customer_org_group.id}&SortType=2` |
|
|
|
).then((res) => { |
|
|
|
console.log("操作成功"); |
|
|
|
currentRow = this.tableData.splice(lfind, 1)[0]; //删除并赋值 |
|
|
|
this.tableData.push(currentRow); |
|
|
|
this.$refs["tableData"].setCurrentRow(currentRow); |
|
|
|
}); |
|
|
|
}, |
|
|
|
|
|
|
|
//置顶 |
|
|
|
btnSetTop() { |
|
|
|
if (!this.dataTransOpts.tableS.customer_org_group.id) { |
|
|
|
this.$message.warning("请选择操作的数据"); |
|
|
|
return; |
|
|
|
let body = { |
|
|
|
roomId: this.dataTransOpts.tableS.room.id, |
|
|
|
sortType |
|
|
|
} |
|
|
|
|
|
|
|
let lfind = arrayExistObj(this.tableData, "id", this.dataTransOpts.tableS.customer_org_group.id); |
|
|
|
let currentRow = {}; |
|
|
|
|
|
|
|
putapi( |
|
|
|
`/api/app/customerorggroup/updatemanysort?id=${this.dataTransOpts.tableS.customer_org_group.id}&SortType=1` |
|
|
|
).then((res) => { |
|
|
|
console.log("操作成功"); |
|
|
|
currentRow = this.tableData.splice(lfind, 1)[0]; |
|
|
|
this.tableData.unshift(currentRow); |
|
|
|
this.$refs["tableData"].setCurrentRow(currentRow); |
|
|
|
}); |
|
|
|
postapi('/api/app/Room/UpdateManySort', body) |
|
|
|
.then((res) => { |
|
|
|
if (res.code > -1) { |
|
|
|
console.log("操作成功"); |
|
|
|
let lfind = arrayExistObj(this.tableData, "id", body.roomId); |
|
|
|
if (lfind > -1) { |
|
|
|
let currentRow = {}; |
|
|
|
currentRow = this.tableData.splice(lfind, 1)[0]; //删除并赋值 |
|
|
|
if (sortType == 2) { |
|
|
|
this.tableData.push(currentRow); |
|
|
|
} else { |
|
|
|
this.tableData.unshift(currentRow); |
|
|
|
} |
|
|
|
this.$refs["tableData"].setCurrentRow(currentRow); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
//选中颜色 |
|
|
|
handleRowClassName({ row, rowIndex }) { |
|
|
|
// highLightBg 为 'selected'的高亮 |
|
|
|
@ -339,6 +293,8 @@ export default { |
|
|
|
|
|
|
|
//获取房间列表 |
|
|
|
getRoom(medicalCenterId) { |
|
|
|
this.dataTransOpts.tableS.room.id = "" |
|
|
|
this.curRoom = {} |
|
|
|
this.isDrag = false; |
|
|
|
objCopy(this.formInit, this.form); |
|
|
|
this.form.medicalCenterId = medicalCenterId; |
|
|
|
@ -352,7 +308,7 @@ export default { |
|
|
|
}); |
|
|
|
}, |
|
|
|
|
|
|
|
//选择体检中心 |
|
|
|
//选择体检中心 |
|
|
|
changeMedicalCenter(v) { |
|
|
|
// console.log('changeMedicalCenter', v) |
|
|
|
this.getRoom(v) |
|
|
|
@ -360,21 +316,18 @@ export default { |
|
|
|
|
|
|
|
//点击房间 |
|
|
|
rowClick(row) { |
|
|
|
this.dataTransOpts.tableS.customer_org_group.id = row.id |
|
|
|
this.curCustomerOrgGroup = deepCopy(row); |
|
|
|
this.curCustomerOrgGroup.isComplete = this.customerOrgRegister.isComplete; |
|
|
|
setTimeout(() => { |
|
|
|
this.dataTransOpts.refresh.customer_org_group_detail.M++; |
|
|
|
}, 20); |
|
|
|
this.curRoom = row |
|
|
|
this.dataTransOpts.tableS.room.id = row.id |
|
|
|
this.dataTransOpts.refresh.room_detail.M++; |
|
|
|
}, |
|
|
|
|
|
|
|
// 新增(编辑调用时,传入id值) 弹框 |
|
|
|
btnAdd(id) { |
|
|
|
if (!id) this.dataTransOpts.tableS.room.id = '' |
|
|
|
|
|
|
|
|
|
|
|
this.dataTransOpts.refresh.room.S++ |
|
|
|
if (!id) this.dataTransOpts.refresh.room_detail.M++; //新增则清掉已选组合项目 |
|
|
|
|
|
|
|
|
|
|
|
this.RoomEditParams = { |
|
|
|
medicalCenterId: this.medicalCenterId |
|
|
|
} |
|
|
|
@ -383,23 +336,19 @@ export default { |
|
|
|
|
|
|
|
//编辑弹框 |
|
|
|
btnEdit() { |
|
|
|
if (!this.dataTransOpts.tableS.customer_org_group.id) { |
|
|
|
this.$message.warning("请先选择体检分组"); |
|
|
|
if (!this.dataTransOpts.tableS.room.id) { |
|
|
|
this.$message.warning("请先选择分诊叫号房间"); |
|
|
|
return; |
|
|
|
} |
|
|
|
this.btnAdd(this.dataTransOpts.tableS.customer_org_group.id) |
|
|
|
this.btnAdd(this.dataTransOpts.tableS.room.id) |
|
|
|
}, |
|
|
|
|
|
|
|
//删除 |
|
|
|
btnDel() { |
|
|
|
if (!this.dataTransOpts.tableS.customer_org_group.id) { |
|
|
|
if (!this.dataTransOpts.tableS.room.id) { |
|
|
|
this.$message.warning("请选择需要操作的数据"); |
|
|
|
return; |
|
|
|
} |
|
|
|
if (this.customerOrgRegister.isComplete.toUpperCase() == "Y") { |
|
|
|
this.$message.warning("该单位体检次数已完成,不允许删除分组"); |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
this.$confirm("此操作将永久删除该记录, 是否继续?", "提示", { |
|
|
|
confirmButtonText: "是", |
|
|
|
@ -407,17 +356,15 @@ export default { |
|
|
|
type: "warning", |
|
|
|
}) |
|
|
|
.then(() => { |
|
|
|
return deletapi(`/api/app/customer-org-group/${this.dataTransOpts.tableS.customer_org_group.id}`); |
|
|
|
return postapi('/api/app/Room/Delete', { roomId: this.dataTransOpts.tableS.room.id }); |
|
|
|
}) |
|
|
|
.then((res) => { |
|
|
|
if (res.code != -1) { |
|
|
|
console.log("删除成功"); |
|
|
|
let lfind = arrayExistObj(this.tableData, "id", this.dataTransOpts.tableS.customer_org_group.id); |
|
|
|
let lfind = arrayExistObj(this.tableData, "id", this.dataTransOpts.tableS.room.id); |
|
|
|
if (lfind > -1) this.tableData.splice(lfind, 1); |
|
|
|
this.dataTransOpts.tableS.customer_org_group.id = '' |
|
|
|
setTimeout(() => { |
|
|
|
this.dataTransOpts.refresh.customer_org_group_detail.M++ |
|
|
|
}, 20); |
|
|
|
this.dataTransOpts.tableS.room.id = '' |
|
|
|
this.dataTransOpts.refresh.room_detail.M++ |
|
|
|
} |
|
|
|
}) |
|
|
|
.catch((err) => { |
|
|
|
@ -428,66 +375,12 @@ export default { |
|
|
|
}); |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
madeNewGroupAsbitems(oldGroupAsbitems, newTotal) { |
|
|
|
newTotal = Math.round(Number(newTotal) * 100) / 100; |
|
|
|
let newGroupAsbitems = []; |
|
|
|
let oldTotal = Number(0); |
|
|
|
oldGroupAsbitems.forEach((e) => { |
|
|
|
oldTotal += Number(e.asbitemMoney); //customerOrgGroupDetailMoney |
|
|
|
}); |
|
|
|
oldTotal = Math.round(Number(oldTotal) * 100) / 100; |
|
|
|
|
|
|
|
let discount = 0; |
|
|
|
if (oldTotal != 0) discount = Math.round((newTotal * 10000) / oldTotal) / 100; |
|
|
|
|
|
|
|
oldTotal = Number(0); |
|
|
|
oldGroupAsbitems.forEach((e) => { |
|
|
|
e.customerOrgGroupDetailPrice = Math.round(e.price * discount) / 100; |
|
|
|
e.customerOrgGroupDetailMoney = |
|
|
|
Math.round( |
|
|
|
e.customerOrgGroupDetailPrice * e.customerOrgGroupDetailAmount * 100 |
|
|
|
) / 100; |
|
|
|
oldTotal += Number(e.customerOrgGroupDetailMoney); |
|
|
|
}); |
|
|
|
oldTotal = Math.round(Number(oldTotal) * 100) / 100; |
|
|
|
|
|
|
|
//console.log('discount,oldTotal',discount,oldTotal) |
|
|
|
|
|
|
|
let didTotal = Math.round(Number(newTotal - oldTotal) * 100) / 100; |
|
|
|
if (didTotal != 0) { |
|
|
|
for (let i = 0; i < oldGroupAsbitems.length; i++) { |
|
|
|
if (oldGroupAsbitems[i].customerOrgGroupDetailAmount == 1) { |
|
|
|
oldGroupAsbitems[i].customerOrgGroupDetailPrice = |
|
|
|
Math.round( |
|
|
|
(Number(oldGroupAsbitems[i].customerOrgGroupDetailPrice) + |
|
|
|
Number(didTotal)) * |
|
|
|
100 |
|
|
|
) / 100; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
oldGroupAsbitems.forEach((e) => { |
|
|
|
newGroupAsbitems.push({ |
|
|
|
customerOrgGroupId: e.customerOrgGroupId, |
|
|
|
asbitemId: e.asbitemId, |
|
|
|
price: e.customerOrgGroupDetailPrice, |
|
|
|
amount: e.customerOrgGroupDetailAmount, |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
return newGroupAsbitems; |
|
|
|
}, |
|
|
|
|
|
|
|
// 关闭 分组 新增/编辑 |
|
|
|
close_dialogWinRoomEdit() { |
|
|
|
let id = this.dataTransOpts.tableS.customer_org_group.id |
|
|
|
let id = this.dataTransOpts.tableS.room.id |
|
|
|
if (id) { |
|
|
|
// 点编辑 或 新增有提交 |
|
|
|
getapi(`/api/app/customer-org-group/${id}`) |
|
|
|
postapi('/api/app/Room/Get', { roomId:id }) |
|
|
|
.then(res => { |
|
|
|
if (res.code != -1) { |
|
|
|
let lfind = -1 |
|
|
|
@ -504,16 +397,18 @@ export default { |
|
|
|
this.$refs["tableData"].setCurrentRow(this.tableData[lfind]); |
|
|
|
|
|
|
|
// 更新 customer_org_group_detail 参数 |
|
|
|
this.curCustomerOrgGroup = deepCopy(res.data); |
|
|
|
this.curCustomerOrgGroup.isComplete = this.customerOrgRegister.isComplete; |
|
|
|
this.curRoom = deepCopy(res.data); |
|
|
|
|
|
|
|
this.dataTransOpts.refresh.room_detail.M++; |
|
|
|
} |
|
|
|
}) |
|
|
|
} else { |
|
|
|
// 点 新增 但未提交 |
|
|
|
this.dataTransOpts.tableS.customer_org_group.id = this.curCustomerOrgGroup.id || '' |
|
|
|
this.dataTransOpts.tableS.room.id = this.curRoom.id || '' |
|
|
|
this.dataTransOpts.refresh.room_detail.M++; |
|
|
|
} |
|
|
|
|
|
|
|
this.dataTransOpts.refresh.customer_org_group_detail.M++; |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
}; |
|
|
|
|