|
@@ -1,140 +1,166 @@
|
|
|
<template>
|
|
<template>
|
|
|
<div>
|
|
<div>
|
|
|
- <van-nav-bar title="关爱服务" @click-left="$router.back()" left-arrow fixed placeholder safe-area-inset-top />
|
|
|
|
|
|
|
+ <van-nav-bar
|
|
|
|
|
+ title="关爱服务"
|
|
|
|
|
+ @click-left="$router.back()"
|
|
|
|
|
+ left-arrow
|
|
|
|
|
+ fixed
|
|
|
|
|
+ placeholder
|
|
|
|
|
+ safe-area-inset-top
|
|
|
|
|
+ />
|
|
|
<div class="box">
|
|
<div class="box">
|
|
|
<van-tabs v-model="active" @change="changeonLoad">
|
|
<van-tabs v-model="active" @change="changeonLoad">
|
|
|
<van-tab title="随访计划"></van-tab>
|
|
<van-tab title="随访计划"></van-tab>
|
|
|
<van-tab title="历史随访"></van-tab>
|
|
<van-tab title="历史随访"></van-tab>
|
|
|
</van-tabs>
|
|
</van-tabs>
|
|
|
<div class="search_bg">
|
|
<div class="search_bg">
|
|
|
- <van-search v-if="roleId ==21 || roleId ==11" v-show="active==0" v-model="followUpform.name" shape="round" show-action placeholder="儿童姓名" @search="onSearchPlan">
|
|
|
|
|
|
|
+ <van-search
|
|
|
|
|
+ v-if="roleId == 21 || roleId == 11"
|
|
|
|
|
+ v-show="active == 0"
|
|
|
|
|
+ v-model="followUpform.name"
|
|
|
|
|
+ shape="round"
|
|
|
|
|
+ show-action
|
|
|
|
|
+ placeholder="儿童姓名"
|
|
|
|
|
+ @search="onSearchPlan"
|
|
|
|
|
+ >
|
|
|
<template #action>
|
|
<template #action>
|
|
|
<div @click="onSearchPlan">搜索</div>
|
|
<div @click="onSearchPlan">搜索</div>
|
|
|
</template>
|
|
</template>
|
|
|
</van-search>
|
|
</van-search>
|
|
|
- <van-search v-show="active==1" v-model="historyform.name" shape="round" show-action placeholder="儿童姓名" @search="onSearch">
|
|
|
|
|
|
|
+ <van-search
|
|
|
|
|
+ v-show="active == 1"
|
|
|
|
|
+ v-model="historyform.name"
|
|
|
|
|
+ shape="round"
|
|
|
|
|
+ show-action
|
|
|
|
|
+ placeholder="儿童姓名"
|
|
|
|
|
+ @search="onSearch"
|
|
|
|
|
+ >
|
|
|
<template #action>
|
|
<template #action>
|
|
|
<div @click="onSearch">搜索</div>
|
|
<div @click="onSearch">搜索</div>
|
|
|
</template>
|
|
</template>
|
|
|
</van-search>
|
|
</van-search>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
-
|
|
|
|
|
- <van-list v-model="loading" :immediate-check="false" :finished="finished" finished-text="没有更多了" @load="onLoad">
|
|
|
|
|
- <plan v-show="active==0" :planList="planList"></plan>
|
|
|
|
|
- <history v-show="active==1" :historyList="historyList"></history>
|
|
|
|
|
|
|
+
|
|
|
|
|
+ <van-list
|
|
|
|
|
+ v-model="loading"
|
|
|
|
|
+ :immediate-check="false"
|
|
|
|
|
+ :finished="finished"
|
|
|
|
|
+ finished-text="没有更多了"
|
|
|
|
|
+ @load="onLoad"
|
|
|
|
|
+ >
|
|
|
|
|
+ <plan v-show="active == 0" :planList="planList"></plan>
|
|
|
|
|
+ <history v-show="active == 1" :historyList="historyList"></history>
|
|
|
</van-list>
|
|
</van-list>
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
<script>
|
|
<script>
|
|
|
-import { followUpPage, historyFollowUp } from '../../api/index.js'
|
|
|
|
|
-import plan from './plan.vue'
|
|
|
|
|
-import history from './history.vue'
|
|
|
|
|
|
|
+import { followUpPage, historyFollowUp } from "../../api/index.js";
|
|
|
|
|
+import plan from "./plan.vue";
|
|
|
|
|
+import history from "./history.vue";
|
|
|
export default {
|
|
export default {
|
|
|
components: { plan, history },
|
|
components: { plan, history },
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
|
- value: '',
|
|
|
|
|
|
|
+ value: "",
|
|
|
active: 0,
|
|
active: 0,
|
|
|
loading: false,
|
|
loading: false,
|
|
|
finished: false,
|
|
finished: false,
|
|
|
planList: [],
|
|
planList: [],
|
|
|
historyList: [],
|
|
historyList: [],
|
|
|
- roleId:JSON.parse(sessionStorage.getItem('userInfo')).roleIdStr,
|
|
|
|
|
|
|
+ roleId: JSON.parse(sessionStorage.getItem("userInfo")).roleIdStr,
|
|
|
followUpform: {
|
|
followUpform: {
|
|
|
pageNum: 1,
|
|
pageNum: 1,
|
|
|
pageSize: 20,
|
|
pageSize: 20,
|
|
|
- name: ''
|
|
|
|
|
|
|
+ name: "",
|
|
|
},
|
|
},
|
|
|
historyform: {
|
|
historyform: {
|
|
|
pageNum: 1,
|
|
pageNum: 1,
|
|
|
pageSize: 20,
|
|
pageSize: 20,
|
|
|
isSupervise:
|
|
isSupervise:
|
|
|
- JSON.parse(sessionStorage.getItem('userInfo')).roleIdStr == 14
|
|
|
|
|
- ? 2
|
|
|
|
|
- : 1,
|
|
|
|
|
- name: '',
|
|
|
|
|
|
|
+ JSON.parse(sessionStorage.getItem("userInfo")).roleIdStr == 14 ? 2 : 1,
|
|
|
|
|
+ name: "",
|
|
|
},
|
|
},
|
|
|
- }
|
|
|
|
|
|
|
+ };
|
|
|
},
|
|
},
|
|
|
activated() {
|
|
activated() {
|
|
|
- this.loading = true
|
|
|
|
|
- this.followUpPage()
|
|
|
|
|
- this.historyFollowUp()
|
|
|
|
|
- console.log('1')
|
|
|
|
|
|
|
+ this.loading = true;
|
|
|
|
|
+ this.followUpPage();
|
|
|
|
|
+ this.historyFollowUp();
|
|
|
|
|
+ console.log("1");
|
|
|
},
|
|
},
|
|
|
beforeRouteEnter(to, from, next) {
|
|
beforeRouteEnter(to, from, next) {
|
|
|
next((vm) => {
|
|
next((vm) => {
|
|
|
// 这里的vm指的就是vue实例,可以用来当做this使用
|
|
// 这里的vm指的就是vue实例,可以用来当做this使用
|
|
|
- console.log(to, 'to')
|
|
|
|
|
- console.log(from, 'from')
|
|
|
|
|
- if (from.name == 'Home') {
|
|
|
|
|
- vm.active = 0
|
|
|
|
|
- vm.followUpform.pageNum = 1
|
|
|
|
|
- vm.historyform.pageNum = 1
|
|
|
|
|
|
|
+ console.log(to, "to");
|
|
|
|
|
+ console.log(from, "from");
|
|
|
|
|
+ if (from.name == "Home") {
|
|
|
|
|
+ vm.active = 0;
|
|
|
|
|
+ vm.followUpform.pageNum = 1;
|
|
|
|
|
+ vm.historyform.pageNum = 1;
|
|
|
}
|
|
}
|
|
|
- })
|
|
|
|
|
|
|
+ });
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
async followUpPage() {
|
|
async followUpPage() {
|
|
|
- const res = await followUpPage(this.followUpform)
|
|
|
|
|
- this.loading = false
|
|
|
|
|
|
|
+ const res = await followUpPage(this.followUpform);
|
|
|
|
|
+ this.loading = false;
|
|
|
// this.$toast(this.followUpform.pageNum)
|
|
// this.$toast(this.followUpform.pageNum)
|
|
|
if (this.followUpform.pageNum == 1) {
|
|
if (this.followUpform.pageNum == 1) {
|
|
|
- this.planList = res.data.records
|
|
|
|
|
|
|
+ this.planList = res.data.records;
|
|
|
} else {
|
|
} else {
|
|
|
- this.planList = this.planList.concat(res.data.records)
|
|
|
|
|
- console.log(this.planList)
|
|
|
|
|
|
|
+ this.planList = this.planList.concat(res.data.records);
|
|
|
|
|
+ console.log(this.planList);
|
|
|
}
|
|
}
|
|
|
if (this.planList.length == res.data.total) {
|
|
if (this.planList.length == res.data.total) {
|
|
|
- this.finished = true
|
|
|
|
|
|
|
+ this.finished = true;
|
|
|
} else {
|
|
} else {
|
|
|
- this.finished = false
|
|
|
|
|
|
|
+ this.finished = false;
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
async historyFollowUp() {
|
|
async historyFollowUp() {
|
|
|
- const res = await historyFollowUp(this.historyform)
|
|
|
|
|
- this.loading = false
|
|
|
|
|
|
|
+ const res = await historyFollowUp(this.historyform);
|
|
|
|
|
+ this.loading = false;
|
|
|
if (this.historyform.pageNum == 1) {
|
|
if (this.historyform.pageNum == 1) {
|
|
|
- this.historyList = res.data.records
|
|
|
|
|
|
|
+ this.historyList = res.data.records;
|
|
|
} else {
|
|
} else {
|
|
|
- this.historyList = this.historyList.concat(res.data.records)
|
|
|
|
|
|
|
+ this.historyList = this.historyList.concat(res.data.records);
|
|
|
}
|
|
}
|
|
|
if (this.historyList.length == res.data.total) {
|
|
if (this.historyList.length == res.data.total) {
|
|
|
- this.finished = true
|
|
|
|
|
|
|
+ this.finished = true;
|
|
|
} else {
|
|
} else {
|
|
|
- this.finished = false
|
|
|
|
|
|
|
+ this.finished = false;
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
onLoad() {
|
|
onLoad() {
|
|
|
if (this.active == 0) {
|
|
if (this.active == 0) {
|
|
|
- this.followUpform.pageNum = this.followUpform.pageNum + 1
|
|
|
|
|
- this.followUpPage()
|
|
|
|
|
|
|
+ this.followUpform.pageNum = this.followUpform.pageNum + 1;
|
|
|
|
|
+ this.followUpPage();
|
|
|
} else {
|
|
} else {
|
|
|
- this.historyform.pageNum = this.historyform.pageNum + 1
|
|
|
|
|
- this.historyFollowUp()
|
|
|
|
|
|
|
+ this.historyform.pageNum = this.historyform.pageNum + 1;
|
|
|
|
|
+ this.historyFollowUp();
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
changeonLoad() {
|
|
changeonLoad() {
|
|
|
- this.loading = true
|
|
|
|
|
|
|
+ this.loading = true;
|
|
|
if (this.active == 0) {
|
|
if (this.active == 0) {
|
|
|
- this.followUpform.pageNum = 1
|
|
|
|
|
- this.followUpPage()
|
|
|
|
|
|
|
+ this.followUpform.pageNum = 1;
|
|
|
|
|
+ this.followUpPage();
|
|
|
} else {
|
|
} else {
|
|
|
- this.historyform.pageNum = 1
|
|
|
|
|
- this.historyFollowUp()
|
|
|
|
|
|
|
+ this.historyform.pageNum = 1;
|
|
|
|
|
+ this.historyFollowUp();
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
onSearchPlan() {
|
|
onSearchPlan() {
|
|
|
- this.followUpform.pageNum = 1
|
|
|
|
|
- this.followUpPage()
|
|
|
|
|
|
|
+ this.followUpform.pageNum = 1;
|
|
|
|
|
+ this.followUpPage();
|
|
|
},
|
|
},
|
|
|
onSearch() {
|
|
onSearch() {
|
|
|
- this.historyform.pageNum = 1
|
|
|
|
|
- this.historyFollowUp()
|
|
|
|
|
|
|
+ this.historyform.pageNum = 1;
|
|
|
|
|
+ this.historyFollowUp();
|
|
|
},
|
|
},
|
|
|
},
|
|
},
|
|
|
-}
|
|
|
|
|
|
|
+};
|
|
|
</script>
|
|
</script>
|
|
|
<style lang="scss" scoped>
|
|
<style lang="scss" scoped>
|
|
|
.van-list {
|
|
.van-list {
|
|
@@ -148,4 +174,4 @@ export default {
|
|
|
width: 100%;
|
|
width: 100%;
|
|
|
z-index: 9999;
|
|
z-index: 9999;
|
|
|
}
|
|
}
|
|
|
-</style>
|
|
|
|
|
|
|
+</style>
|