提交 8ecd0e71 编写于 作者: tao.wu's avatar tao.wu

Merge branch 'dev-followUp-20190312' of...

Merge branch 'dev-followUp-20190312' of 192.168.110.53:com.pica.cloud.education.frontend/pica.cloud.web-education-admin into dev-followUp-20190312
...@@ -17,14 +17,14 @@ ...@@ -17,14 +17,14 @@
{{addPatientData.patientNames}} {{addPatientData.patientNames}}
</el-form-item> </el-form-item>
<el-form-item label="随访开始时间:" prop="joinTime"> <el-form-item label="随访开始时间:" prop="joinTime">
<el-select v-model="addPatientData.joinTime" size="small" clearable> <el-date-picker
<el-option v-model="addPatientData.joinTime"
v-for="(item, index) in followStartTimeList" type="date"
:key="item+index" placeholder="请选择随访开始时间"
:label="item" format="yyyy-MM-dd"
:value="item"> value-format="yyyy-MM-dd"
</el-option> clearable>
</el-select> </el-date-picker>
</el-form-item> </el-form-item>
</el-form> </el-form>
</div> </div>
...@@ -67,50 +67,58 @@ ...@@ -67,50 +67,58 @@
} }
}, },
mounted() { mounted() {
this.getFollowStartTimeList(this.$route.query.planId);// 获取随访时间列表 //this.getFollowStartTimeList(this.$route.query.planId);// 获取随访时间列表
}, },
computed: { computed: {
...mapState('planManage', { ...mapState('planManage', {
followStartTimeList: state => state.followStartTimeList, //followStartTimeList: state => state.followStartTimeList,
}) })
}, },
methods: { methods: {
...mapActions('planManage', ['getFollowStartTimeList', 'getResidentList']), ...mapActions('planManage', ['getFollowStartTimeList', 'getResidentList']),
clickClose() { clickClose() {
this.$emit('sendJoinTime',null)
this.$emit('closeAddPatientTime',false) this.$emit('closeAddPatientTime',false)
}, },
addPatient() { addPatient() {
this.$refs['addPatientData'].validate(valid => { this.$refs['addPatientData'].validate(valid => {
if (valid) { if (valid) {
const { id, patientIdList, joinTime } = this.addPatientData; if(this.$route.name == 'planModify') {
createFollowPlan({ this.$emit('sendJoinTime',this.addPatientData.joinTime)
id, this.$emit('closeAddPatientTime',false)
addPatients: true, } else {
patientIdList, const { id, patientIdList, joinTime } = this.addPatientData;
joinTime createFollowPlan({
}).then((data) => { id,
if(data.code == '000000') { addPatients: true,
this.$message({ patientIdList,
message: '添加成功!', joinTime
type: 'success' }).then((data) => {
}); if(data.code == '000000') {
this.getResidentList({ this.$message({
planId: this.addPatientData.id, message: '添加成功!',
status: this.addPatientData.status type: 'success'
}) });
this.clickClose() this.getResidentList({
} else { planId: this.addPatientData.id,
status: this.addPatientData.status
})
this.$emit('closeAddPatientTime',false)
} else {
this.$message({
message: `${data.message}`,
type: 'error'
});
}
}).catch((err) => {
this.$message({ this.$message({
message: `${data.message}`, message: `${err.message}`,
type: 'error' type: 'error'
}); });
}
}).catch((err) => {
this.$message({
message: `${err.message}`,
type: 'error'
}); });
}); }
} else { } else {
return false; return false;
} }
......
...@@ -175,6 +175,7 @@ ...@@ -175,6 +175,7 @@
labelId: '', labelId: '',
labelName: '分组' labelName: '分组'
}], }],
trueAdd:[], //真正新加
} }
}, },
props: { props: {
...@@ -219,6 +220,29 @@ ...@@ -219,6 +220,29 @@
this.labelOptions = this.labelOptions.concat(res.data.labelNameList); this.labelOptions = this.labelOptions.concat(res.data.labelNameList);
}) })
} }
},
eachSelects(val, oldVal){
if(val.length&&oldVal.length) {
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 {
}
}
} }
}, },
methods: { methods: {
...@@ -272,7 +296,7 @@ ...@@ -272,7 +296,7 @@
}, },
// 选择居民 // 选择居民
handleSelectionChange(val) { handleSelectionChange(val) {
// console.log('每次选中居民',val) console.log('每次选中居民',val)
this.eachSelects = val this.eachSelects = val
}, },
// 切换分页 // 切换分页
...@@ -339,7 +363,7 @@ ...@@ -339,7 +363,7 @@
} }
return ageObj; return ageObj;
} }
} },
} }
</script> </script>
......
...@@ -73,6 +73,11 @@ ...@@ -73,6 +73,11 @@
@closeSelectedDialog="closeSelectedDialog" @closeSelectedDialog="closeSelectedDialog"
@continueAdd="continueAdd" /> @continueAdd="continueAdd" />
<follow-time :showThisPage="showFollowTime" :nodeTimeList="nodeTimeList" @closeFollowTime="closeFollowTime"></follow-time> <follow-time :showThisPage="showFollowTime" :nodeTimeList="nodeTimeList" @closeFollowTime="closeFollowTime"></follow-time>
<add-patient-time
:showThisPage="showAddPatientTime"
:addPatientData="addPatientData"
@sendJoinTime="sendJoinTime"
@closeAddPatientTime="closeAddPatientTime"></add-patient-time>
</div> </div>
</template> </template>
...@@ -83,6 +88,8 @@ ...@@ -83,6 +88,8 @@
import FollowTime from '@/views/followup/plan-manage/dialog/follow-time'; import FollowTime from '@/views/followup/plan-manage/dialog/follow-time';
import {createFollowPlan} from '@/utils/followup/followapis' import {createFollowPlan} from '@/utils/followup/followapis'
//添加居民选择随访时间
import addPatientTime from '@/views/followup/plan-manage/dialog/add-patient-time';
import { mapState, mapActions } from 'vuex' import { mapState, mapActions } from 'vuex'
export default { export default {
...@@ -91,7 +98,8 @@ ...@@ -91,7 +98,8 @@
SelectPatient, SelectPatient,
HasSelectedPatient, HasSelectedPatient,
SetTimeNode, SetTimeNode,
FollowTime FollowTime,
addPatientTime
}, },
data() { data() {
return { return {
...@@ -125,6 +133,12 @@ ...@@ -125,6 +133,12 @@
isShowSelectedDialog: false, //显示已选居民 isShowSelectedDialog: false, //显示已选居民
nodeListModify: [], //修改node列表 nodeListModify: [], //修改node列表
showFollowTime: false, //是否展示全部时间 showFollowTime: false, //是否展示全部时间
showAddPatientTime: false,//是否展示添加居民选择时间
addPatientData: {}, //选择时间数据
/*joinSelectedList: [], //新添加居民
joinPatientIdList: [], //新添加居民id
joinSelectedNames: [], //新添加居民名字*/
selectPatients: [], //选择居民列表已选人
} }
}, },
created() { created() {
...@@ -171,16 +185,37 @@ ...@@ -171,16 +185,37 @@
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];
const selectPatients = getArguments[1]; // 每次选中获取的人 this.selectPatients = getArguments[1]; // 每次选中获取的人
selectPatients.forEach((item)=>{ let selectPeople = [];
if(!this.planDetailData.patientIdList.includes(item.patientId)){ let selectPeopleIds = [];
this.hasSelectedList.push(item) let selectNames = []
this.planDetailData.patientIdList.push(item.patientId); // 页面中数据存储所有选择的人,没有去重 this.hasSelectedList.forEach(function (item) {
selectPeople.push(item)
});
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.planDetailData.hasSelectedNum = this.patientIdList.length; this.addPatientData = {
id: this.$route.query.planId,
addPatients: true,
patientIdList: selectPeopleIds,
patientNames: selectNames.join('、'),
}
this.showAddPatientTime = true
}, },
continueAdd(val) { continueAdd(val) {
this.isShowSelectedDialog = val; this.isShowSelectedDialog = val;
...@@ -227,7 +262,6 @@ ...@@ -227,7 +262,6 @@
this.checkForm = false this.checkForm = false
if(val.status){ if(val.status){
// 关闭弹层,继续创建 // 关闭弹层,继续创建
this.planDetail.joinTime = '2019-04-09T16:00:00.000+0000'
this.planDetailData.fPlanTimeReqList = val.setTimeNodeList this.planDetailData.fPlanTimeReqList = val.setTimeNodeList
console.log('修改计划前的数据===>>>',this.planDetailData) console.log('修改计划前的数据===>>>',this.planDetailData)
createFollowPlan(this.planDetailData).then(res=>{ createFollowPlan(this.planDetailData).then(res=>{
...@@ -263,6 +297,25 @@ ...@@ -263,6 +297,25 @@
setTimeNodeListOnCom(val){ setTimeNodeListOnCom(val){
this.getTimeNodeList(val) this.getTimeNodeList(val)
}, },
closeAddPatientTime(isShow) {
this.showAddPatientTime = isShow
},
sendJoinTime(joinData) {
console.log('this.hasSelectedList new',this.hasSelectedList)
if(joinData) {
// alert(joinData)
this.planDetailData.joinTime =joinData;
console.log('新添加时间',this.planDetailData.joinTime)
this.selectPatients.forEach((item)=>{
if(!this.planDetailData.patientIdList.includes(item.patientId)){// 页面中数据存储所有选择的人,没有去重
this.hasSelectedList.push(item)
this.planDetailData.patientIdList.push(item.patientId);
}
})
this.planDetailData.hasSelectedNum = this.patientIdList.length;
}
},
}, },
watch: { watch: {
planDetail(val) { planDetail(val) {
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册