lilei 4 anos atrás
pai
commit
6396c95183
2 arquivos alterados com 27 adições e 16 exclusões
  1. 2 0
      pages/index/index.vue
  2. 25 16
      pages/spotCheckCenter/spotChecking.vue

+ 2 - 0
pages/index/index.vue

@@ -98,6 +98,8 @@ export default {
 		this.gettoDoData()
 		// 获取周
 		this.getLookUpList('WEEK', 'vuex_weeks');
+		// 获取点检任务状态
+		this.getLookUpList('POINT_TASK_STATUS','vuex_spotCheckStatus')
 	},
 	methods: {
 		// 或某一项字典列表,参数code

+ 25 - 16
pages/spotCheckCenter/spotChecking.vue

@@ -40,7 +40,7 @@
 
 <script>
 import { getTasksList } from '@/api/task.js';
-import { getLookUpDatas } from '@/api/data';
+import { findStoreVsDevice } from '@/api/store.js'
 import { clzConfirm } from '@/libs/tools.js';
 export default {
 	data() {
@@ -59,7 +59,10 @@ export default {
 		};
 	},
 	onLoad() {
-		this.getLookUpData('POINT_TASK_STATUS')  // 获取任务状态
+		// 获取任务状态
+		this.tabList = this.$store.state.vuex_spotCheckStatus
+		this.tabList.unshift({dispName: '全部', code: ''})
+		// 加载列表
 		this.resetPage();
 		uni.$on("updatePointTaskList",()=>{
 			this.resetPage();
@@ -75,17 +78,6 @@ export default {
 				title: title
 			});
 		},
-		// 获取数据字典数据
-		getLookUpData(code) {
-			getLookUpDatas({ type: code }).then(res => {
-				if (res.status == 200) {
-					if(code == 'POINT_TASK_STATUS'){  //  状态
-						res.data.unshift({dispName: '全部', code: ''})
-						this.tabList = res.data
-					}
-				}
-			})
-		},
 		// tabs通知swiper切换
 		tabsChange(index) {
 			this.swiperCurrent = index;
@@ -165,8 +157,27 @@ export default {
 				_this.status = 'loadmore';
 			});
 		},
+		//  开始点检
+		toSpotCheck(item){
+			// 判断当前门店是否已绑定设备
+			findStoreVsDevice({storeCode:item.code}).then(res=>{
+				if(res.data.length){
+					// 门店下的设备
+					this.$u.vuex('vuex_storeVideoList',res.data)
+					uni.navigateTo({
+						url: '/pages/spotCheck/spotCheck?taskId=' + item.id + '&types=video&storeId='+item.storeId+'&storeName='+item.storeName
+					}); 
+				}else{
+					uni.showToast({
+						icon: 'none',
+						title: '当前门店没有绑定设备,暂时不能视频巡店'
+					})
+				}
+			})
+		},
 		//判断状态,待处理的跳转的开始点检页面,已完成的查看点检结果,已过期的不处理
 		viewRow(item) {
+			console.log(item)
 			// 已完成的
 			if(item.status == 'FINISHED'){
 				uni.navigateTo({
@@ -175,9 +186,7 @@ export default {
 			}
 			// 待处理,开始点检
 			if(item.status == 'PENDING'){
-				uni.navigateTo({
-					url: '/pages/spotCheck/spotCheck?taskId=' + item.id + '&types=video&storeId='+item.storeId+'&storeName='+item.storeName
-				});
+				this.toSpotCheck(item)
 			}
 		},
 		clsStatus(status){