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

store初始化&居民列表页fixed

上级 af2e5356
import Vue from 'vue' import Vue from 'vue'
import Vuex from 'vuex' import Vuex from 'vuex'
import common from './modules/common' import common from './modules/common'
//随访
import followModules from './modules/followup/index'
import getters from './getters' import getters from './getters'
...@@ -8,7 +11,8 @@ Vue.use(Vuex) ...@@ -8,7 +11,8 @@ Vue.use(Vuex)
export default new Vuex.Store({ export default new Vuex.Store({
modules: { modules: {
common common,
...followModules
}, },
getters getters
}) })
......
import planManage from './planManage'
const followModules = {
planManage
}
export default followModules
import followApi from '../../../utils/followup/followapis'
export default {
namespaced: true,
state: {
residentList: { //居民列表
pageNum: 1, //当前页码
pageSize: 10, //每页数据大小
total: null, //总数
},
groupList: [], //分组列表
},
mutations: {
GET_RESIDENT_LIST(state, payload) {
state.residentList = payload
},
GET_GROUP_LIST(state, payload) {
state.groupList = payload.labelDtoList
}
},
actions: {
getResidentList(context, payload) {
const { pageSize, pageNum } = context.state.residentList;
followApi.getResidentList({
pageSize,
pageNum,
...payload
}).then(({data}) => {
context.commit('GET_RESIDENT_LIST', data);
});
},
getGroupList(context, payload) {
followApi.getGroupList({}).then(({data}) => {
context.commit('GET_GROUP_LIST', data);
});
}
},
}
...@@ -14,6 +14,13 @@ const planManageApi = [ ...@@ -14,6 +14,13 @@ const planManageApi = [
name: 'getResidentList', name: 'getResidentList',
description: '获取居民列表', description: '获取居民列表',
}, },
{
url: '/followup/planPatient/group',
method: 'get',
params: 'params',
name: 'getGroupList',
description: '获取分组列表',
},
] ]
......
...@@ -10,48 +10,47 @@ ...@@ -10,48 +10,47 @@
<p class="page-title">随访计划名称</p> <p class="page-title">随访计划名称</p>
<div class="search-div"> <div class="search-div">
<div class="search-input"> <div class="search-input">
<el-form :model="searchData" :inline="true" :label-width="labelWidth"> <el-form :model="searchData" ref="searchData" :inline="true" :label-width="labelWidth">
<el-form-item label="姓名:"> <el-form-item label="姓名:" prop="patientName">
<el-input v-model="searchData.residentName" placeholder="请输入姓名"></el-input> <el-input v-model="searchData.patientName" placeholder="请输入姓名"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="手机号:"> <el-form-item label="手机号:" prop="mobile">
<el-input v-model="searchData.phoneNumber" placeholder="请输入手机号"></el-input> <el-input v-model="searchData.mobile" placeholder="请输入手机号"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="分组:"> <el-form-item label="分组:" prop="labelId">
<el-select v-model="searchData.group" > <el-select v-model="searchData.labelId" >
<el-option <el-option
v-for="item in groupOption" v-for="item in groupList"
:key="item.value" :key="item.labelId"
:label="item.label" :label="item.labelName"
:value="item.value"> :value="item.labelId">
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="随访开始时间:"> <el-form-item label="随访开始时间:" prop="startDate">
<el-select v-model="searchData.startTime"> <el-date-picker
<el-option v-model="searchData.startDate"
v-for="item in groupOption" type="datetime"
:key="item.value" format="yyyy-MM-dd hh:mm:ss"
:label="item.label" value-format="yyyy-MM-dd hh:mm:ss"
:value="item.value"> placeholder="选择随访开始时间">
</el-option> </el-date-picker>
</el-select>
</el-form-item> </el-form-item>
</el-form> </el-form>
</div> </div>
<div class="search-btn"> <div class="search-btn">
<el-button class="button-green" type="primary">查询</el-button> <el-button class="button-green" type="primary" @click="searchResidentList">查询</el-button>
<el-button class="button-white" plain>重置</el-button> <el-button class="button-white" plain @click="resetSearchData('searchData')">重置</el-button>
</div> </div>
</div> </div>
<div class="resident-table table-content"> <div class="resident-table table-content">
<el-radio-group v-model="tableType"> <el-radio-group v-model="status">
<el-radio-button label="0">未完成({{typeNums.notCount}})</el-radio-button> <el-radio-button label="0">未完成({{residentList.notCount}})</el-radio-button>
<el-radio-button label="1">进行中({{typeNums.handCount}})</el-radio-button> <el-radio-button label="1">进行中({{residentList.handCount}})</el-radio-button>
<el-radio-button label="2">已结束({{typeNums.yesCount}})</el-radio-button> <el-radio-button label="2">已结束({{residentList.yesCount}})</el-radio-button>
</el-radio-group> </el-radio-group>
<el-table <el-table
:data="residentData" :data="residentList.fPlanPatientInfoDtoList"
center center
style="width: 100%;margin-top: 20px;"> style="width: 100%;margin-top: 20px;">
<el-table-column <el-table-column
...@@ -98,14 +97,14 @@ ...@@ -98,14 +97,14 @@
</el-table> </el-table>
<el-pagination <el-pagination
background background
v-if="residentData.length" v-if="residentList.fPlanPatientInfoDtoList"
@size-change="handleSizeChangePre" @size-change="handleSizeChangePre"
@current-change="handleCurrentChangePre" @current-change="handleCurrentChangePre"
layout="total, sizes, prev, pager, next, jumper" layout="total, sizes, prev, pager, next, jumper"
:current-page="pageNum" :current-page="residentList.pageNum"
:page-sizes="[10, 20, 50, 100]" :page-sizes="[10, 20, 50, 100]"
:page-size="pageSize" :page-size="residentList.pageSize"
:total="total"> :total="residentList.total">
</el-pagination> </el-pagination>
</div> </div>
</div> </div>
...@@ -113,8 +112,9 @@ ...@@ -113,8 +112,9 @@
</template> </template>
<script> <script>
import api from '../../../utils/followup/followapis';
import BreadCrumb from '@/components/breadcrumb' import BreadCrumb from '@/components/breadcrumb'
import { mapState, mapActions } from 'vuex'
export default { export default {
name: "residentList", name: "residentList",
components: { components: {
...@@ -134,64 +134,55 @@ ...@@ -134,64 +134,55 @@
value: '全部', value: '全部',
label: '全部' label: '全部'
}], }],
tableType: 0, //列表筛选条件 status: 0, //列表筛选条件
typeNums: {
},
residentData: [], //居民列表
pageNum: 1,
pageSize: 10,
total: '',
} }
}, },
created() { created() {
}, },
mounted() { mounted() {
this.getResidentList({ this.getResidentList();
pageNum: 1, this.getGroupList(); //获取分组列表
pageSize: 10, },
status: 0, computed: {
...mapState('planManage',{
residentList: state => state.residentList,
groupList: state => state.groupList
}) })
}, },
methods: { methods: {
handleSizeChangePre() { ...mapActions('planManage', ['getResidentList', 'getGroupList']),
handleSizeChangePre(pageSize) {
this.getResidentList({ this.getResidentList({
pageNum: 1, pageSize,
pageSize: 10, status: this.status
status: 0,
}) })
}, },
handleCurrentChangePre() { handleCurrentChangePre(pageNum) {
this.getResidentList({
pageNum,
status: this.status
})
}, },
goPatientDetail(patientId) { //居民详情页 goPatientDetail(patientId) { //居民详情页
this.$router.push('/followup/plan-manage/resident-detail') this.$router.push('/followup/plan-manage/resident-detail')
}, },
getResidentList(param) { //获取居民列表 searchResidentList() { //查询居民列表
api.getResidentList({ this.getResidentList({
...param, ...this.searchData,
planId: 123//从路由里获取 status: this.status
})
}).then(({data}) => { },
this.residentData = data.fPlanPatientInfoDtoList; resetSearchData(formName) {
this.total = data.total this.$refs[formName].resetFields();
this.typeNums = {
notCount: data.notCount,
handCount: data.handCount,
yesCount: data.yesCount,
}
});
} }
}, },
watch: { watch: {
tableType(val) { status(val) {
this.getResidentList({ this.getResidentList({
pageNum: 1,
pageSize: 10,
status: val, status: val,
...this.searchData
}) })
} }
} }
...@@ -202,10 +193,4 @@ ...@@ -202,10 +193,4 @@
@import '../../../style/followup/followup-common'; @import '../../../style/followup/followup-common';
@import '../../../style/followup/element-reset.css'; @import '../../../style/followup/element-reset.css';
.resident-list {
.resident-content {
}
}
</style> </style>
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册