lilei 4 år sedan
förälder
incheckning
ff19d18e30
1 ändrade filer med 20 tillägg och 4 borttagningar
  1. 20 4
      pages/organization/organization.vue

+ 20 - 4
pages/organization/organization.vue

@@ -36,7 +36,7 @@
 
 <script>
 	import { clzConfirm } from '@/libs/tools.js'
-	import { findStoreList } from '@/api/store.js'
+	import { findStoreList,findStoreVsDevice } from '@/api/store.js'
 	import { queryCurrentTaskUsing } from '@/api/task.js'
 	import { findUserInfo } from '@/api/atorg.js'
 	export default{
@@ -123,10 +123,26 @@
 					this.getStoreList(code)
 				}
 			},
-			//  选择门
+			//  开始巡
 			goPage(item){
-				//  校验是否有历史巡店记录
-				//  type  VIDEO_INSPECTION:视频巡店、SPOT_INSPECTION:现场巡店、POINT_INSPECTION:点检任务
+				// 判断当前门店是否已绑定设备
+				findStoreVsDevice({storeCode:item.code}).then(res=>{
+					if(res.data.length){
+						// 门店下的设备
+						this.$u.vuex('vuex_storeVideoList',res.data)
+						//  校验是否有历史巡店记录
+						this.queryHasTaskUsing(item)
+					}else{
+						uni.showToast({
+							icon: 'none',
+							title: '当前门店没有绑定设备,暂时不能视频巡店'
+						})
+					}
+				})
+			},
+			// 判断当前门店是否已绑定设备
+			// type  VIDEO_INSPECTION:视频巡店、SPOT_INSPECTION:现场巡店、POINT_INSPECTION:点检任务
+			queryHasTaskUsing(item){
 				queryCurrentTaskUsing({ storeId: item.id, type: 'VIDEO_INSPECTION' }).then(res => {
 					if(res.status == 200){
 						if(res.data){  //  为true有历史巡店记录