|
|
@@ -59,9 +59,11 @@
|
|
|
</van-search>
|
|
|
</div>
|
|
|
<div class="lineGrey"></div>
|
|
|
+ <div v-if="refreshTotal" class="refreshBtn" @click="onSearch">检测到 {{ refreshTotal }} 条更新,点击刷新</div>
|
|
|
+ <div v-if="refreshTotal" class="lineGrey"></div>
|
|
|
</div>
|
|
|
<!-- 主体内容-->
|
|
|
- <div class="container" style="margin-top: 262px">
|
|
|
+ <div class="container" :style="{ 'margin-top': refreshTotal ? '300px' : '262px' }">
|
|
|
<van-list
|
|
|
class="myList1"
|
|
|
v-model="loading"
|
|
|
@@ -198,13 +200,15 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { getVisits, getvisitDeptInfo } from '@/api/index';
|
|
|
+import { getVisits, getvisitDeptInfo, getListTotal } from '@/api/index';
|
|
|
import timeico from '@/assets/Icon/datatims.png';
|
|
|
|
|
|
export default {
|
|
|
name: 'index.vue',
|
|
|
data() {
|
|
|
return {
|
|
|
+ latestUpdateTime:null,
|
|
|
+ refreshTotal:0,
|
|
|
timeico: timeico,
|
|
|
defaultDate: new Date(),
|
|
|
searchValue: '',
|
|
|
@@ -260,14 +264,22 @@ export default {
|
|
|
StaffShow: false,
|
|
|
deptForm: { type: '', parentId: '' },
|
|
|
pageNum: 1, // 当前页码 int类型
|
|
|
- pageSize: 10, // 当前每页条数 int类型
|
|
|
+ pageSize: 20, // 当前每页条数 int类型
|
|
|
userDeptLevel: null,
|
|
|
};
|
|
|
},
|
|
|
activated() {
|
|
|
- setTimeout(() => {
|
|
|
- this.onSearch();
|
|
|
- }, 1000);
|
|
|
+ let typeQuery = localStorage.getItem('typeQuery');
|
|
|
+ if(this.latestUpdateTime!=null && typeQuery == 1){
|
|
|
+ this.getListTotalFn();
|
|
|
+ }else{
|
|
|
+ setTimeout(() => {
|
|
|
+ this.onSearch();
|
|
|
+ }, 1000);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ deactivated(){
|
|
|
+ localStorage.setItem('typeQuery', 1);
|
|
|
},
|
|
|
created() {
|
|
|
this.info();
|
|
|
@@ -305,6 +317,22 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+ getListTotalFn(){
|
|
|
+ getListTotal({
|
|
|
+ startTime: this.startTime + ' 00:00:00',
|
|
|
+ stopTime: this.endTime + ' 24:00:00',
|
|
|
+ storeRequest: this.storeName.trim(),
|
|
|
+ companyId: this.companyCode,
|
|
|
+ regionId: this.regionCode,
|
|
|
+ userId: this.userCode,
|
|
|
+ deptId: this.deptCode,
|
|
|
+ queryStartTime:this.latestUpdateTime
|
|
|
+ }).then((res) => {
|
|
|
+ if (res.code == 200) {
|
|
|
+ this.refreshTotal = res.data;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
onLoad() {
|
|
|
// this.loading = false;
|
|
|
this.getVisitsListFn();
|
|
|
@@ -377,9 +405,13 @@ export default {
|
|
|
this.onSearch();
|
|
|
},
|
|
|
onClickLeft() {
|
|
|
- this.$router.go(-1);
|
|
|
+ this.$router.push({
|
|
|
+ path: '/My/index',
|
|
|
+ });
|
|
|
},
|
|
|
onSearch() {
|
|
|
+ this.refreshTotal = 0;
|
|
|
+ window.scrollTo(0, 0);
|
|
|
this.pageNum = 1;
|
|
|
this.list = [];
|
|
|
this.getVisitsListFn();
|
|
|
@@ -408,6 +440,7 @@ export default {
|
|
|
loading1.clear();
|
|
|
if (res.code == 200) {
|
|
|
this.loading = false;
|
|
|
+ this.latestUpdateTime = res.dataTime;
|
|
|
this.list = this.list.concat(res.data);
|
|
|
if (this.list.length >= res.total) {
|
|
|
this.finished = true;
|
|
|
@@ -541,6 +574,17 @@ export default {
|
|
|
};
|
|
|
</script>
|
|
|
<style lang="scss">
|
|
|
+.refreshBtn{
|
|
|
+ display: flex;
|
|
|
+ justify-content: center;
|
|
|
+ align-items: center;
|
|
|
+ cursor: pointer;
|
|
|
+ width: 100%;
|
|
|
+ color: #ff976a;
|
|
|
+ padding: 5px;
|
|
|
+ font-size: 14px;
|
|
|
+ background-color: #fff;
|
|
|
+}
|
|
|
.searchDiv {
|
|
|
.van-search {
|
|
|
background: #fff;
|