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