提交 d94eb141 编写于 作者: Yuanzhao.dai's avatar Yuanzhao.dai

选人优化

上级 a653627b
...@@ -136,6 +136,9 @@ export default { ...@@ -136,6 +136,9 @@ export default {
...payload ...payload
}).then(({data}) => { }).then(({data}) => {
context.commit('GET_RESIDENT_LIST', data); context.commit('GET_RESIDENT_LIST', data);
context.dispatch('getSelectResident',{
planId: payload.planId
})
}); });
}, },
getGroupList(context, payload) { getGroupList(context, payload) {
...@@ -159,6 +162,9 @@ export default { ...@@ -159,6 +162,9 @@ export default {
getPlanDetail(context, payload) { getPlanDetail(context, payload) {
getPlanDetail(payload).then(({data}) => { getPlanDetail(payload).then(({data}) => {
context.commit('GET_PLAN_DETAIL', data); context.commit('GET_PLAN_DETAIL', data);
context.dispatch('getSelectResident',{
planId: data.id
})
}); });
}, },
getRemarkOption(context, payload) { getRemarkOption(context, payload) {
......
...@@ -10,7 +10,13 @@ ...@@ -10,7 +10,13 @@
width="65%" width="65%"
center> center>
<div class="finish-content"> <div class="finish-content">
<el-form ref="searchData" :model="searchData" :inline="true" class="select-width" size="small"> <el-form
ref="searchData"
:model="searchData"
:inline="true"
class="select-width"
size="small">
<el-form-item> <el-form-item>
<el-select v-model="searchData.sex" @change="changeSex"> <el-select v-model="searchData.sex" @change="changeSex">
<el-option <el-option
...@@ -62,10 +68,13 @@ ...@@ -62,10 +68,13 @@
ref="multipleTable" ref="multipleTable"
center center
style="width: 100%;margin-top: 20px;" style="width: 100%;margin-top: 20px;"
:row-key="getRowKeys"
@selection-change="handleSelectionChange"> @selection-change="handleSelectionChange">
<el-table-column <el-table-column
type="selection" type="selection"
align="center"> align="center"
:reserve-selection="true"
:selectable="checkboxInit">
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="nickname" prop="nickname"
...@@ -124,7 +133,7 @@ ...@@ -124,7 +133,7 @@
</template> </template>
<script> <script>
import { mapState, mapActions } from 'vuex'
import { getBasicData, getPlanPatientsList, getAllDiseases, getAllLabels } from '@/utils/followup/followapis' import { getBasicData, getPlanPatientsList, getAllDiseases, getAllLabels } from '@/utils/followup/followapis'
export default { export default {
components: {}, components: {},
...@@ -133,7 +142,7 @@ ...@@ -133,7 +142,7 @@
return { return {
showSelectPatient: true, showSelectPatient: true,
allSelects: [], allSelects: [],
eachSelects: [],//仅仅是操作选择的总人员 // eachSelects: [],//仅仅是操作选择的总人员
// totalSelect: [],// 当前所选的人 // totalSelect: [],// 当前所选的人
labelId: '', labelId: '',
diseaseId: '', diseaseId: '',
...@@ -143,7 +152,6 @@ ...@@ -143,7 +152,6 @@
ageEnd: '', ageEnd: '',
srvPackageId: '', srvPackageId: '',
searchCondition: '', searchCondition: '',
patientsData: [], patientsData: [],
searchData: { searchData: {
sex: '性别', sex: '性别',
...@@ -175,12 +183,22 @@ ...@@ -175,12 +183,22 @@
labelId: '', labelId: '',
labelName: '分组' labelName: '分组'
}], }],
trueAdd:[], //真正新加 newSelects: [], //新选中的人
getRowKeys(row) {
// console.log('sshkdhdk',row)
return row.patientId;
},
} }
}, },
computed: {
...mapState('planManage', {
eachSelects: state => state.eachSelects,
})
},
props: { props: {
isShowSelectPatient: Boolean, //是否显示model, isShowSelectPatient: Boolean, //是否显示model,
patientIdList: Array,// 确定已经选过的居民 patientIdList: Array,// 确定已经选过的居民
oldPatientIdList: Array,// 确定已经选过的居民
}, },
watch: { watch: {
isShowSelectPatient(val){ isShowSelectPatient(val){
...@@ -221,31 +239,16 @@ ...@@ -221,31 +239,16 @@
}) })
} }
}, },
eachSelects(val, oldVal){ },
if(val.length&&oldVal.length) { methods: {
console.log('新',val);
console.log('新',oldVal);
if(val.length>oldVal.length) {
let add = val.filter(function(n) {
return oldVal.indexOf(n) == -1
});
this.trueAdd.push(add)
console.log('加人',this.trueAdd)
} else if(val.length<=oldVal.length) {
let reduce = oldVal.filter(function(n) {
return val.indexOf(n) == -1
});
/*this.trueAdd = this.trueAdd.filter(function(n) {
return reduce.indexOf(n) == -1
});*/
console.log('减人',reduce)
} else {
} checkboxInit(row,index){
} if(row.disableNum == undefined) {
return 1
} else {
return row.disableNum
} }
}, },
methods: {
getPatientsList(){ getPatientsList(){
const data = { const data = {
pageSize: this.paginationSet.pageSize, pageSize: this.paginationSet.pageSize,
...@@ -265,15 +268,29 @@ ...@@ -265,15 +268,29 @@
this.getSex() this.getSex()
this.paginationSet.total = res.data.totalRows this.paginationSet.total = res.data.totalRows
// 设置所请求的当页人员是否成为选中状态 // 设置所请求的当页人员是否成为选中状态
if(this.patientIdList.length > 0){ // console.log('传入的已选居民',this.patientIdList)
this.patientsData.forEach((item)=>{ this.patientsData.forEach((item)=>{
item.disableNum = 1;
if(this.patientIdList.length > 0){
if(this.patientIdList.includes(item.patientId)){// 如果已经选过居民 if(this.patientIdList.includes(item.patientId)){// 如果已经选过居民
this.$nextTick(()=>{ this.$nextTick(()=>{
this.$refs.multipleTable.toggleRowSelection(item,true); this.$refs.multipleTable.toggleRowSelection(item,true);
}) })
} }
}
if(this.oldPatientIdList!=undefined&&this.oldPatientIdList.length) {
this.patientsData.forEach((item)=>{
if(this.oldPatientIdList.includes(item.patientId)){// 如果已经选过居民
item.disableNum = 0
} else {
item.disableNum = 1
}
}) })
} }
})
// console.log(this.oldPatientIdList)
}else{ }else{
this.patientsData = [] this.patientsData = []
} }
...@@ -296,12 +313,16 @@ ...@@ -296,12 +313,16 @@
}, },
// 选择居民 // 选择居民
handleSelectionChange(val) { handleSelectionChange(val) {
console.log('每次选中居民',val) const _this = this;
this.eachSelects = val _this.newSelects = [];
val.forEach(item => {
if(item.disableNum == 1) {
_this.newSelects.push(item)
}
})
}, },
// 切换分页 // 切换分页
handleCurrentChangePre(val) { handleCurrentChangePre(val) {
// console.log('handleCurrentChangePre')
this.paginationSet.pageNum = val this.paginationSet.pageNum = val
this.getPatientsList() this.getPatientsList()
}, },
...@@ -309,7 +330,7 @@ ...@@ -309,7 +330,7 @@
this.$emit('closeSelectPatient',false) this.$emit('closeSelectPatient',false)
}, },
sureClick(){ sureClick(){
this.$emit('sureSelectPatient',false,this.eachSelects) this.$emit('sureSelectPatient',false,this.newSelects)
}, },
handleSizeChangePre(val) { handleSizeChangePre(val) {
// console.log('handleSizeChangePre') // console.log('handleSizeChangePre')
......
...@@ -238,13 +238,13 @@ ...@@ -238,13 +238,13 @@
let getArguments = arguments[0]; let getArguments = arguments[0];
this.isShowSelectPatient = getArguments[0]; this.isShowSelectPatient = getArguments[0];
const selectPatients = getArguments[1]; // 每次选中获取的人 const selectPatients = getArguments[1]; // 每次选中获取的人
this.hasSelectedList = selectPatients;
console.log('呵呵呵呵',arguments)
this.baseInfo.patientIdList = [];
selectPatients.forEach((item)=>{ selectPatients.forEach((item)=>{
if(!this.baseInfo.patientIdList.includes(item.patientId)){ this.baseInfo.patientIdList.push(item.patientId);
this.hasSelectedList.push(item)
this.baseInfo.patientIdList.push(item.patientId); // 页面中数据存储所有选择的人,没有去重
}
}) })
this.baseInfo.hasSelectedNum = this.baseInfo.patientIdList.length; this.baseInfo.hasSelectedNum = this.hasSelectedList.length;
}, },
continueAdd(val) { continueAdd(val) {
this.isShowSelectedDialog = val; this.isShowSelectedDialog = val;
......
...@@ -64,6 +64,7 @@ ...@@ -64,6 +64,7 @@
<select-patient <select-patient
:isShowSelectPatient="isShowSelectPatient" :isShowSelectPatient="isShowSelectPatient"
:patientIdList="planDetailData.patientIdList" :patientIdList="planDetailData.patientIdList"
:oldPatientIdList="selectResidentIdList"
@closeSelectPatient="closeSelectPatient" @closeSelectPatient="closeSelectPatient"
@sureSelectPatient="sureSelectPatient(arguments)"> @sureSelectPatient="sureSelectPatient(arguments)">
</select-patient> </select-patient>
...@@ -135,10 +136,12 @@ ...@@ -135,10 +136,12 @@
showFollowTime: false, //是否展示全部时间 showFollowTime: false, //是否展示全部时间
showAddPatientTime: false,//是否展示添加居民选择时间 showAddPatientTime: false,//是否展示添加居民选择时间
addPatientData: {}, //选择时间数据 addPatientData: {}, //选择时间数据
/*joinSelectedList: [], //新添加居民
joinPatientIdList: [], //新添加居民id oldSelect:[],
joinSelectedNames: [], //新添加居民名字*/ selectResidentIdList: [], //oldID
selectPatients: [], //选择居民列表已选人 newHasSelectedList: [],
initResidentList: [], //重置需要的居民列表
initResidentIdList: [], //重置需要的id
} }
}, },
created() { created() {
...@@ -146,9 +149,7 @@ ...@@ -146,9 +149,7 @@
this.getPlanDetail(this.$route.query.planId); //获取计划详情 this.getPlanDetail(this.$route.query.planId); //获取计划详情
this.getRemarkOption() this.getRemarkOption()
this.getNodeTimeList(this.$route.query.planId); // 获取随访时间列表 this.getNodeTimeList(this.$route.query.planId); // 获取随访时间列表
this.getSelectResident({
planId: this.$route.query.planId
}); //已选居民
let planModifyCrumbList = sessionStorage.getItem('planModifyCrumb'); let planModifyCrumbList = sessionStorage.getItem('planModifyCrumb');
this.planModifyCrumb = JSON.parse(planModifyCrumbList); this.planModifyCrumb = JSON.parse(planModifyCrumbList);
}, },
...@@ -158,7 +159,6 @@ ...@@ -158,7 +159,6 @@
nodeTimeList: state => state.nodeTimeList, nodeTimeList: state => state.nodeTimeList,
residentList: state => state.residentList, residentList: state => state.residentList,
remarkOption: state => state.remarkOption, remarkOption: state => state.remarkOption,
// setTimeNodeList: state => state.setTimeNodeList,
selectResidentList: state => state.selectResidentList selectResidentList: state => state.selectResidentList
}) })
}, },
...@@ -185,37 +185,32 @@ ...@@ -185,37 +185,32 @@
this.isShowSelectedDialog = val; this.isShowSelectedDialog = val;
}, },
sureSelectPatient() { sureSelectPatient() {
console.log('getArguments',arguments[0])
let getArguments = arguments[0]; let getArguments = arguments[0];
// alert(this.selectResidentList.length+'-'+getArguments[1].length)
this.isShowSelectPatient = getArguments[0]; this.isShowSelectPatient = getArguments[0];
this.selectPatients = getArguments[1]; // 每次选中获取的人 const newAddPatientList = getArguments[1]; // 新选中的人
let selectPeople = []; const showNames = [];
let selectPeopleIds = []; const newIds = [];
let selectNames = [] newAddPatientList.forEach(item => {
this.hasSelectedList.forEach(function (item) { showNames.push(item.nickname)
selectPeople.push(item) newIds.push(item.patientId)
});
this.patientIdList.forEach(function (item) {
selectPeopleIds.push(item)
})
this.selectPatients.forEach((item)=>{
if(!this.planDetailData.patientIdList.includes(item.patientId)){// 页面中数据存储所有选择的人,没有去重
selectPeople.push(item);
selectPeopleIds.push(item.id)
selectNames.push(item.nickname)
}
}) })
this.newHasSelectedList = JSON.parse(JSON.stringify(this.initResidentList));
this.newHasSelectedList = this.newHasSelectedList.concat(newAddPatientList);
if(this.newHasSelectedList.length > this.hasSelectedList.length) {
this.showAddPatientTime = true;
this.addPatientData = { this.addPatientData = {
id: this.$route.query.planId, id: this.$route.query.planId,
addPatients: true, addPatients: true,
patientIdList: selectPeopleIds, patientNames: showNames.join('、'),
patientNames: selectNames.join('、'), }
} else {
this.hasSelectedList = JSON.parse(JSON.stringify(this.newHasSelectedList));
this.planDetailData.patientIdList = JSON.parse(JSON.stringify(this.initResidentIdList));
const _this = this;
newAddPatientList.forEach(item => {
_this.planDetailData.patientIdList.push(item.patientId)
})
} }
this.showAddPatientTime = true
}, },
continueAdd(val) { continueAdd(val) {
this.isShowSelectedDialog = val; this.isShowSelectedDialog = val;
...@@ -301,36 +296,33 @@ ...@@ -301,36 +296,33 @@
this.showAddPatientTime = isShow this.showAddPatientTime = isShow
}, },
sendJoinTime(joinData) { sendJoinTime(joinData) {
console.log('this.hasSelectedList new',this.hasSelectedList) const _this = this;
if(joinData) { if(joinData) {
// alert(joinData) _this.hasSelectedList = [];
_this.planDetailData.patientIdList = [];
this.planDetailData.joinTime =joinData; _this.newHasSelectedList.forEach(item => {
console.log('新添加时间',this.planDetailData.joinTime) _this.hasSelectedList.push(item)
this.selectPatients.forEach((item)=>{ _this.planDetailData.patientIdList.push(item.patientId)
if(!this.planDetailData.patientIdList.includes(item.patientId)){// 页面中数据存储所有选择的人,没有去重
this.hasSelectedList.push(item)
this.planDetailData.patientIdList.push(item.patientId);
}
}) })
this.planDetailData.hasSelectedNum = this.patientIdList.length; this.planDetailData.joinTime = joinData;
} else {
} }
}, },
}, },
watch: { watch: {
planDetail(val) { planDetail(val) {
// console.log(val) this.planDetailData = val;
this.planDetailData = val
this.setTimeNodeList = val.fPlanTimeReqList this.setTimeNodeList = val.fPlanTimeReqList
if(this.planDetailData.resourceId){ if(this.planDetailData.resourceId){
this.isStandedTemplate = true this.isStandedTemplate = true
}else{ }else{
this.isStandedTemplate = false this.isStandedTemplate = false
} }
}, },
selectResidentList(val) { selectResidentList(val) {
const _this = this const _this = this
_this.planDetailData.patientIdList = []
let people = {} let people = {}
if(val) { if(val) {
val.forEach(function (item, index) { val.forEach(function (item, index) {
...@@ -341,10 +333,14 @@ ...@@ -341,10 +333,14 @@
mobilePhone: item.mobilePhone, mobilePhone: item.mobilePhone,
labelId: item.labelName, labelId: item.labelName,
patientId: item.patientId patientId: item.patientId
} };
_this.patientIdList.push(item.patientId) _this.hasSelectedList.push(people);
_this.hasSelectedList.push(people) _this.planDetailData.patientIdList.push(item.patientId)
_this.selectResidentIdList.push(item.patientId)
_this.initResidentList.push(people);
_this.initResidentIdList.push(item.patientId);
}) })
_this.newHasSelectedList = JSON.parse(JSON.stringify(_this.initResidentIdList));
} }
} }
} }
...@@ -354,6 +350,23 @@ ...@@ -354,6 +350,23 @@
<style lang="scss" scoped> <style lang="scss" scoped>
@import '../../../style/followup/followup-common'; @import '../../../style/followup/followup-common';
@import '../../../style/followup/element-reset.css'; @import '../../../style/followup/element-reset.css';
.bread-crumb {
position: fixed;
left: 255px;
top: 64px;
width: 100%;
background: #fff;
height: 61px;
padding: 20px 20px 30px;
z-index: 99;
border-top: 3px solid #F0F2F5;
.el-breadcrumb__inner {
font-size: 14px;
}
a:hover {
color: #449284;
}
}
.header{ .header{
display: flex; display: flex;
align-items: center; align-items: center;
......
...@@ -129,6 +129,7 @@ ...@@ -129,6 +129,7 @@
<select-patient <select-patient
:isShowSelectPatient="isShowSelectPatient" :isShowSelectPatient="isShowSelectPatient"
:patientIdList="initialPatientIdList" :patientIdList="initialPatientIdList"
:oldPatientIdList="initialPatientIdList"
@closeSelectPatient="closeSelectPatient" @closeSelectPatient="closeSelectPatient"
@sureSelectPatient="sureSelectPatient(arguments)"> @sureSelectPatient="sureSelectPatient(arguments)">
</select-patient> </select-patient>
...@@ -223,6 +224,7 @@ ...@@ -223,6 +224,7 @@
groupList: state => state.groupList, groupList: state => state.groupList,
planStatusOption: state => state.planStatusOption, planStatusOption: state => state.planStatusOption,
followStartTimeList: state => state.followStartTimeList, followStartTimeList: state => state.followStartTimeList,
selectResidentList: state => state.selectResidentList
}) })
}, },
methods: { methods: {
...@@ -369,20 +371,16 @@ ...@@ -369,20 +371,16 @@
this.showAddPatientTime = isShow this.showAddPatientTime = isShow
}, },
sureSelectPatient() { sureSelectPatient() {
console.log('arguments',arguments)
let getArguments = arguments[0]; let getArguments = arguments[0];
this.isShowSelectPatient = getArguments[0]; this.isShowSelectPatient = getArguments[0];
const selectPatients = getArguments[1]; // 每次选中获取的人 const selectPatients = getArguments[1]; // 每次选中获取的人
// this.hasSelectedList = selectPatients;
console.log(selectPatients)
let patientIds = [] let patientIds = []
let patientNames = [] let patientNames = []
selectPatients.forEach((item)=>{ selectPatients.forEach((item)=>{
if(!this.initialPatientIdList.includes(item.patientId)){
patientIds.push(item.patientId) patientIds.push(item.patientId)
patientNames.push(item.nickname) patientNames.push(item.nickname)
}
}) })
this.addPatientData = { this.addPatientData = {
id: this.$route.query.planId, id: this.$route.query.planId,
...@@ -392,7 +390,6 @@ ...@@ -392,7 +390,6 @@
status: this.status status: this.status
} }
this.showAddPatientTime = true this.showAddPatientTime = true
// this.baseInfo.hasSelectedNum = this.baseInfo.patientIdList.length;
}, },
handleSelectionChange(val) { handleSelectionChange(val) {
console.log('已选居民',val) console.log('已选居民',val)
...@@ -408,21 +405,21 @@ ...@@ -408,21 +405,21 @@
}) })
}, },
residentList(val) { residentList(val) {
const _this = this if(this.status == 1) {
if(val.fPlanPatientInfoDtoList) { this.statusTotal = val.notCount
val.fPlanPatientInfoDtoList.forEach(function (item,index) { } else if (this.status == 2) {
_this.initialPatientIdList.push(item.patientId) this.statusTotal = val.handCount
})
}
if(_this.status == 1) {
_this.statusTotal = val.notCount
} else if (_this.status == 2) {
_this.statusTotal = val.handCount
} else if (_this.status == 3) { } else if (_this.status == 3) {
_this.statusTotal = val.yesCount this.statusTotal = val.yesCount
} }
} },
selectResidentList(val) {
const _this = this
val.forEach(function (item,index) {
_this.initialPatientIdList.push(item.patientId)
});
},
}, },
beforeRouteEnter(to, from, next) { beforeRouteEnter(to, from, next) {
next(vm=> { next(vm=> {
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册