Commit 389a75c7 authored by 刘怀志's avatar 刘怀志

64274 病历管理,点击重置后会导致选择的内容无法回显在文本框内

parent edeae38d
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
label-width="68px" label-width="68px"
size="small" size="small"
> >
<el-form-item class="nick-style" style="padding-right: 15px;" prop="petNickname"> <el-form-item prop="petNickname">
<el-input <el-input
v-model.trim="queryParams.medicalRecordNo" v-model.trim="queryParams.medicalRecordNo"
clearable clearable
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
/> />
</el-form-item> </el-form-item>
<el-form-item v-if="!checkRole(['pt-admin'])" style=" margin-left: 3.25rem !important;" prop="hospitalName"> <el-form-item v-if="!checkRole(['pt-admin'])" prop="hospitalName">
<el-select v-model="queryParams.hospitalName" clearable placeholder="所属医院"> <el-select v-model="queryParams.hospitalName" clearable placeholder="所属医院">
<el-option <el-option
v-for="item in HospitalList" v-for="item in HospitalList"
...@@ -30,10 +30,10 @@ ...@@ -30,10 +30,10 @@
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item prop="doctorName"> <el-form-item prop="doctorIdList">
<el-select <el-select
v-if="!checkRole(['pt-admin'])" v-if="!checkRole(['pt-admin'])"
v-model="queryParams.doctorIdList" v-model="doctorIdList"
collapse-tags collapse-tags
multiple multiple
clearable clearable
...@@ -241,6 +241,7 @@ export default { ...@@ -241,6 +241,7 @@ export default {
dicts: ['pet_insure'], dicts: ['pet_insure'],
data() { data() {
return { return {
doctorIdList: [],
// 所属科室下拉框字典写死 // 所属科室下拉框字典写死
departmentList: [], departmentList: [],
// 所属科室下拉框字典写死 // 所属科室下拉框字典写死
...@@ -487,6 +488,7 @@ export default { ...@@ -487,6 +488,7 @@ export default {
/** 查询病例管理列表 */ /** 查询病例管理列表 */
getList() { getList() {
this.loading = true this.loading = true
this.queryParams.doctorIdList = this.doctorIdList.join(',')
listRecord(this.queryParams).then(response => { listRecord(this.queryParams).then(response => {
console.log('这是我传的查询数据:', this.queryParams) console.log('这是我传的查询数据:', this.queryParams)
console.log('病历列表的数据:', response) console.log('病历列表的数据:', response)
...@@ -556,7 +558,37 @@ export default { ...@@ -556,7 +558,37 @@ export default {
}, },
/** 重置按钮操作 */ /** 重置按钮操作 */
resetQuery() { resetQuery() {
this.resetForm('queryForm') this.queryParams = {
orderByColumn: null,
isAsc: null,
// 排序方式声明
params: {
sort: null
},
pageNum: 1,
pageSize: 20,
petNickname: null,
nickname: null,
petOwnerNumber: null,
doctorIdList: [],
deptId: null,
departmentId: null,
diagnosticResults: null,
visitNumber: null,
visitTime: null,
visitOffice: null,
visitInformation: null,
orders: null,
medicationInformation: null,
petId: null,
petOwnerId: null,
doctorId: null,
petJson: null,
doctorJson: null,
ownerJson: null,
createBy: ''
}
this.doctorIdList = []
this.queryParams.isAsc = null this.queryParams.isAsc = null
this.queryParams.isAsc = 'desc' this.queryParams.isAsc = 'desc'
this.handleQuery() this.handleQuery()
...@@ -589,13 +621,4 @@ export default { ...@@ -589,13 +621,4 @@ export default {
.form-style { .form-style {
margin-bottom: 20px; margin-bottom: 20px;
} }
//搜索框病历框/昵称..宽度
.nick-style{
::v-deep .el-form-item nick-style el-form-item--small{
width: 18.625rem;
}
::v-deep .el-input__inner{
width: 18.625rem;
}
}
</style> </style>
...@@ -129,6 +129,7 @@ ...@@ -129,6 +129,7 @@
:header-cell-style="{background:'#F4F4F4'}" :header-cell-style="{background:'#F4F4F4'}"
:data="registerList" :data="registerList"
@select="selectChange" @select="selectChange"
@select-all="selectChange"
> >
<el-table-column align="center" type="selection" width="55" /> <el-table-column align="center" type="selection" width="55" />
<el-table-column align="left" label="序号" min-width="55" prop="index" show-overflow-tooltip type="index" /> <el-table-column align="left" label="序号" min-width="55" prop="index" show-overflow-tooltip type="index" />
...@@ -296,6 +297,8 @@ export default { ...@@ -296,6 +297,8 @@ export default {
loading: true, loading: true,
// 选中数组 // 选中数组
ids: [], ids: [],
// 所有挂号信息ID(用于辅助, 里面的数据永远不变, 除了 新增/删除 数据时)
idsForever: [],
// 非单个禁用 // 非单个禁用
single: true, single: true,
// 非多个禁用 // 非多个禁用
...@@ -388,6 +391,7 @@ export default { ...@@ -388,6 +391,7 @@ export default {
// 获取全部挂号的id // 获取全部挂号的id
this.registerIds = response.rows.idList this.registerIds = response.rows.idList
this.registerIdsForever = response.rows.idList this.registerIdsForever = response.rows.idList
this.idsForever = response.rows.idList
console.log('这是我要调的挂号列表内容:', this.registerList) console.log('这是我要调的挂号列表内容:', this.registerList)
this.total = response.total this.total = response.total
this.loading = false this.loading = false
...@@ -473,12 +477,9 @@ export default { ...@@ -473,12 +477,9 @@ export default {
// 选择全部 // 选择全部
checkAll() { checkAll() {
this.registerIds = this.registerIdsForever this.ids = this.idsForever
// 标志位, 使得@select回调函数判断往哪个临时集合里添加
this.isCheckAll = true
// 调用手动勾选 // 调用手动勾选
this.manualCheck() this.manualCheck()
console.log('全部选择', this.isCheckAll)
}, },
// 手动勾选 // 手动勾选
manualCheck() { manualCheck() {
...@@ -486,54 +487,36 @@ export default { ...@@ -486,54 +487,36 @@ export default {
this.$nextTick().then(() => { this.$nextTick().then(() => {
// 当前页结合数据的id只要在临时集合里,就使得复选框勾选 // 当前页结合数据的id只要在临时集合里,就使得复选框勾选
this.registerList.forEach(item => { this.registerList.forEach(item => {
if (this.isCheckAll) { if (this.ids.includes(item.id)) {
if (this.registerIds.includes(item.id)) { this.$refs.table.toggleRowSelection(item, true)
this.$refs.table.toggleRowSelection(item, true)
}
} else { } else {
if (this.registerEmptyIds.includes(item.id)) { this.$refs.table.toggleRowSelection(item, false)
this.$refs.table.toggleRowSelection(item, true)
}
} }
}) })
}) })
}, },
// 反向选择(把永久临时集合和变化的临时集合做减法重新赋给变化的临时集合赋给) // 反向选择(把永久临时集合和变化的临时集合做减法重新赋给变化的临时集合赋给)
reverseSelection() { reverseSelection() {
console.log('永久的集合', this.registerIdsForever) const temp = []
console.log('临时集合', this.registerEmptyIds) this.registerList.forEach(item => {
if (this.isCheckAll) { console.log(this.ids.includes(item.id))
this.registerEmptyIds = this.registerIdsForever.filter(id => !this.registerIds.includes(id)) if (!this.ids.includes(item.id)) {
} else { temp.push(item.id)
this.registerEmptyIds = this.registerIdsForever.filter(id => !this.registerEmptyIds.includes(id)) }
} })
this.isCheckAll = false this.ids = temp
this.getList() this.manualCheck()
}, },
// 表格当前手动勾选的 // 表格当前手动勾选的
// 表格当前手动勾选的
selectChange(selection, row) { selectChange(selection, row) {
console.log('selectChange', selection, '----', row) console.log('selectChange', selection, '----', row)
if (this.isCheckAll) { const temp = []
// 判断当前选中的存不存在,存在删除;不存在添加 selection.forEach(item => {
if (this.registerIds.includes(row.id)) { temp.push(item.id)
this.registerIds = this.registerIds.filter(id => id !== row.id) })
console.log('filter', this.registerIds.filter(id => id !== row.id)) this.ids = temp
} else {
this.registerIds.push(row.id)
}
} else {
if (this.registerEmptyIds.includes(row.id)) {
this.registerEmptyIds = this.registerEmptyIds.filter(id => id !== row.id)
} else {
this.registerEmptyIds.push(row.id)
}
}
this.ids = selection.map(item => item.id)
this.single = selection.length !== 1
this.multiple = !selection.length
console.log('this.ids', this.ids)
}, },
/** 功能按钮--导出按钮操作 */ /** 功能按钮--导出按钮操作 */
handleExport() { handleExport() {
if (this.ids.length !== 0) { if (this.ids.length !== 0) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment