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

添加居民

上级 ad94b0bb
......@@ -8,7 +8,8 @@ import {getPlanList,
getBasicData,
getFormOptions,
getFollowupTemplate,
createFollowPlan} from '../../utils/followup/followapis'
createFollowPlan,
getFollowStartTimeList} from '../../utils/followup/followapis'
export default {
namespaced: true,
......@@ -40,6 +41,7 @@ export default {
name: '目前请选择自定义模板作为测试'
}
],
followStartTimeList: [], //随访时间
},
mutations: {
GET_RESIDENT_LIST(state, payload) {
......@@ -48,6 +50,9 @@ export default {
GET_GROUP_LIST(state, payload) {
state.groupList = payload
},
GET_FOLLOW_START_TIME_LIST(state, payload) {
state.followStartTimeList = payload
},
GET_RESIDENT_DETAIL(state, payload) {
state.residentDetail = payload
state.timeNodeList = payload.fPlanDto.fPlanTimeReqList
......@@ -118,6 +123,11 @@ export default {
context.commit('GET_GROUP_LIST', data);
});
},
getFollowStartTimeList(context, payload) {
getFollowStartTimeList(payload).then(({data}) => {
context.commit('GET_FOLLOW_START_TIME_LIST', data);
});
},
getResidentDetail(context, payload) {
getResidentDetail(
payload.planId,
......
......@@ -100,6 +100,14 @@ export const getGroupList = (params) => {
description: '获取分组列表',
})
};
export const getFollowStartTimeList = (planId) => {
return fetch({
headers,
url: getFollowUpSC(`/followup/planPatient/${planId}/times`),
method: 'get',
description: '获取随访开始时间列表(居民相关)',
})
};
export const getResidentDetail = (planId,patientId) => {
return fetch({
headers,
......
<template>
<div class="finish-followup" v-if="showThisPage">
<el-dialog
title="选择随访开始时间"
:visible.sync="showAddPatientTime"
v-if="showThisPage"
:before-close="clickClose"
width="30%"
center>
<div class="finish-content">
<el-form
:model="addPatientData"
:rules="rules"
label-width="100px">
<el-form-item label="已选居民:">
{{addPatientData.patientNames}}
</el-form-item>
<el-form-item label="随访开始时间:" prop="finishReason">
<el-select v-model="addPatientData.joinTime" size="small">
<el-option
v-for="(item, index) in followStartTimeList"
:key="item+index"
:label="item"
:value="item">
</el-option>
</el-select>
</el-form-item>
</el-form>
</div>
<span slot="footer" class="dialog-footer">
<el-button class="button-green" @click="clickClose" size="small" type="primary">取 消</el-button>
<el-button class="button-white" @click="addPatient" size="small" plain>确 定</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import { createFollowPlan } from '../../../../utils/followup/followapis'
import { mapState, mapActions} from 'vuex';
export default {
name: "add-patient-time",
props: {
showThisPage: { //是否显示model
type: Boolean,
default: function () {
return false;
}
},
addPatientData: {
type: Object,
default: function () {
return {};
}
},
},
data() {
return {
showAddPatientTime: true,
rules: {
finishReason: [
{ required: true, message: '请输入结束原因', trigger: 'blur' },
{ min: 1, max: 30, message: '长度在30个字符内', trigger: 'blur' }
],
}
}
},
mounted() {
this.getFollowStartTimeList(this.$route.query.planId);
// 获取随访时间列表
},
computed: {
...mapState('planManage', {
followStartTimeList: state => state.followStartTimeList,
})
},
methods: {
...mapActions('planManage', ['getFollowStartTimeList', 'getResidentList']),
clickClose() {
this.$emit('closeAddPatientTime',false)
},
addPatient() {
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 {
this.$message({
message: `${data.message}`,
type: 'error'
});
}
}).then((err) => {
this.$message({
message: `${err.message}`,
type: 'error'
});
});
}
}
}
</script>
<style scoped>
.el-input__inner:disabled {
background-color: #ffffff!important;
}
</style>
<style lang="scss" scoped>
@import '../../../../style/followup/followup-common';
@import '../../../../style/followup/element-reset.css';
</style>
......@@ -33,14 +33,13 @@
</el-select>
</el-form-item>
<el-form-item label="随访开始时间:">
<el-select v-model="planChangeData.startDate" size="small">
<el-option
v-for="item in nodeTimeList"
:key="item.id"
:label="item.timeStr"
:value="item.id">
</el-option>
</el-select>
<el-date-picker
v-model="planChangeData.startDate"
type="date"
format="yyyy-MM-dd"
value-format="yyyy-MM-dd"
placeholder="选择随访开始时间">
</el-date-picker>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
......@@ -90,7 +89,6 @@
},
mounted() {
this.getPlanOptions();
this.getNodeTimeList(this.$route.query.planId);
// 获取随访时间列表
},
computed: {
......@@ -101,7 +99,7 @@
})
},
methods: {
...mapActions('planManage', ['getPlanOptions', 'getNodeTimeList']),
...mapActions('planManage', ['getPlanOptions']),
selectGroup(val) {
const _this = this
_this.selectedGroup = []
......@@ -115,7 +113,6 @@
}
_this.selectedGroup.push(pushItem)
})
console.log('this.selectedGroup',_this.selectedGroup)
},
clickClose() {
this.$emit('closeChangePlan',false);
......@@ -155,7 +152,17 @@
},
watch: {
planChangeData(val) {
this.getNodeTimeList(val.planId);
let labelList = val.yLabelList
labelList.forEach(function (item, index) {
let nodeItem = this.groupList.filter(function(item1){
return item1.labelId == item;
});
let pushItem = {
labelId: nodeItem[0].labelId,
label: nodeItem[0].labelName,
}
this.selectedGroup.push(pushItem)
})
}
}
}
......
......@@ -46,9 +46,9 @@
<div class="resident-table table-content">
<div class="btn-div">
<el-radio-group v-model="status" size="small">
<el-radio-button label="0">未完成({{residentList.notCount}})</el-radio-button>
<el-radio-button label="1">进行中({{residentList.handCount}})</el-radio-button>
<el-radio-button label="2">已结束({{residentList.yesCount}})</el-radio-button>
<el-radio-button label="1">未完成({{residentList.notCount}})</el-radio-button>
<el-radio-button label="2">进行中({{residentList.handCount}})</el-radio-button>
<el-radio-button label="3">已结束({{residentList.yesCount}})</el-radio-button>
</el-radio-group>
<div class="btn-left">
<el-button class="button-green" type="primary" size="small" v-if="status==2" @click="recoverFollowup('all')">恢复随访</el-button>
......@@ -126,9 +126,14 @@
<recover-followup :showThisPage="showRecoverFollowup" :finishData="recoverData" @closeFinishFollowup="closeRecoverFollowup"></recover-followup>
<select-patient
:isShowSelectPatient="isShowSelectPatient"
:patientIdList="initialPatientIdList"
@closeSelectPatient="closeSelectPatient"
@sureSelectPatient="sureSelectPatient(arguments)">
</select-patient>
<add-patient-time
:showThisPage="showAddPatientTime"
:addPatientData="addPatientData"
@closeAddPatientTime="closeAddPatientTime"></add-patient-time>
</div>
</template>
......@@ -142,6 +147,8 @@
import RecoverFollowup from '@/views/followup/plan-manage/dialog/finish-followup';
//添加居民
import SelectPatient from '@/views/followup/plan-manage/dialog/select-patient';
//添加居民选择随访时间
import addPatientTime from '@/views/followup/plan-manage/dialog/add-patient-time';
import { mapState, mapActions } from 'vuex'
export default {
......@@ -151,7 +158,8 @@
ChangePlan,
FinishFollowup,
SelectPatient,
RecoverFollowup
RecoverFollowup,
addPatientTime
},
data() {
return {
......@@ -167,7 +175,7 @@
value: '全部',
label: '全部'
}],
status: 0, //列表筛选条件
status: 1, //列表筛选条件
showChangePlan: false,//是否展示变更计划
planChangeData: {}, //变更计划数据
showFinishFollowup: false, //是否展示结束随访
......@@ -177,6 +185,9 @@
isShowSelectPatient: false, //显示居民选择框
hasSelectedList: [], //已选居民
finishPatientList: [], //结束随访居民(多选)
initialPatientIdList: [], //初始居民
showAddPatientTime: false,//是否展示添加居民选择时间
addPatientData: {}, //选择时间数据
}
},
created() {
......@@ -184,7 +195,8 @@
},
mounted() {
this.getResidentList({
planId: this.$route.query.planId
planId: this.$route.query.planId,
status: this.status
});
this.getPlanStatusOption()
this.getGroupList(); //获取分组列表
......@@ -296,11 +308,31 @@
closeSelectPatient(val) {
this.isShowSelectPatient = val;
},
closeAddPatientTime(isShow) {
this.showAddPatientTime = isShow
},
sureSelectPatient() {
console.log('arguments',arguments)
let getArguments = arguments[0];
this.isShowSelectPatient = getArguments[0];
this.hasSelectedList = getArguments[1];
this.modifyInfo.hasSelectedNum = getArguments[1].length;
const selectPatients = getArguments[1]; // 每次选中获取的人
// this.hasSelectedList = selectPatients;
console.log(selectPatients)
let patientIds = []
let patientNames = []
selectPatients.forEach((item)=>{
patientIds.push(item.patientId)
patientNames.push(item.nickname)
})
this.addPatientData = {
id: this.$route.query.planId,
addPatients: true,
patientIdList: patientIds,
patientNames: patientNames.join('、'),
status: this.status
}
this.showAddPatientTime = true
// this.baseInfo.hasSelectedNum = this.baseInfo.patientIdList.length;
},
handleSelectionChange(val) {
console.log('已选居民',val)
......@@ -314,6 +346,12 @@
...this.searchData,
planId: this.$route.query.planId
})
},
residentList(val) {
const _this = this
val.fPlanPatientInfoDtoList.forEach(function (item,index) {
_this.initialPatientIdList.push(item.patientId)
})
}
}
}
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册