浏览代码

模拟检点中心

lilei 4 年之前
父节点
当前提交
295598daac
共有 1 个文件被更改,包括 38 次插入28 次删除
  1. 38 28
      pages/spotCheckCenter/spotChecking.vue

+ 38 - 28
pages/spotCheckCenter/spotChecking.vue

@@ -8,7 +8,7 @@
 						<view class="check-order-list" v-for="(item, index) in list" :key="item.id">
 							<view class="check-row" @click="viewRow(item)">
 								<view class="createDate">{{ item.createDate }}</view>
-								<view>{{ item.status }}</view>
+								<view :class="clsStatus(item.status)">{{ item.status }}</view>
 							</view>
 							<view class="check-row" @click="viewRow(item)">
 								<view>
@@ -16,8 +16,9 @@
 									<view style="color: #666666;">{{ item.storeName }}</view>
 								</view>
 								<view>
-									<text style="color: #007AFF;">开始点检</text>
-									<u-icon name="icon-xian-11" custom-prefix="xd-icon" size="28" color="#888888"></u-icon>
+									<text v-if="item.status=='待处理'" style="color: #007AFF;">开始点检</text>
+									<text v-if="item.status=='已完成'" style="color: #007AFF;">查看结果</text>
+									<u-icon v-if="item.status!='已过期'" name="icon-xian-11" custom-prefix="xd-icon" size="28" color="#888888"></u-icon>
 								</view>
 							</view>
 						</view>
@@ -42,21 +43,22 @@ export default {
 			tabList: [
 				{
 					dispName: '待处理',
-					typeId: 4
+					code: 4
 				},
 				{
 					dispName: '已完成',
-					typeId: 3
+					code: 3
 				},
 				{
 					dispName: '已过期',
-					typeId: 2
+					code: 2
 				},
 				{
 					dispName: '全部',
-					typeId: 1
+					code: 1
 				}
 			],
+			typeId:'1',
 			current: 0,
 			swiperCurrent: 0,
 			pageNo: 1,
@@ -78,8 +80,6 @@ export default {
 		// tabs通知swiper切换
 		tabsChange(index) {
 			this.swiperCurrent = index;
-			this.list = [];
-			this.status = 'loading';
 		},
 		swiperChange(event) {
 			console.log(event.detail);
@@ -118,11 +118,12 @@ export default {
 			if (pageNo) {
 				this.pageNo = pageNo;
 			}
+			this.typeId = this.tabList[this.swiperCurrent].code
 			let params = {
 				pageNo: this.pageNo,
 				pageSize: this.pageSize,
 				type: '点检任务', // 任务类型
-				status: this.typeId == 1 ? '' : this.typeId // 任务状态
+				status: this.typeId=='1'?'':this.typeId // 任务状态
 			};
 			this.status = 'loading';
 			getTaskList(params).then(res => {
@@ -141,14 +142,29 @@ export default {
 				_this.status = 'loadmore';
 			});
 		},
-		// 详细页
+		//判断状态,待处理的跳转的开始点检页面,已完成的查看点检结果,已过期的不处理
 		viewRow(item) {
-			// 判断状态,待处理的跳转的开始点检页面,已完成的查看点检结果,已过期的不处理
 			// 已完成的
-			uni.navigateTo({
-				url: '/pages/spotCheckCenter/spotCheckResult?id=' + item.id
-			});
-			// 待处理
+			if(item.status == '已完成'){
+				uni.navigateTo({
+					url: '/pages/spotCheckCenter/spotCheckResult?id=' + item.id
+				});
+			}
+			// 待处理,开始点检
+			if(item.status == '待处理'){
+				
+			}
+		},
+		clsStatus(status){
+			if(status == '待处理'){
+				return 'dcl'
+			}
+			if(status == '已完成'){
+				return 'ywc'
+			}
+			if(status == '已过期'){
+				return 'ygq'
+			}
 		}
 	}
 };
@@ -194,20 +210,14 @@ page {
 					padding: 0 20rpx;
 					color: #fff;
 				}
-				.edit {
-					background-color: #f9ba09;
-				}
-				.view {
-					background-color: #ff7801;
-				}
-				.del {
-					background-color: #f72525;
+				.dcl {
+					color: #f72525;
 				}
-				.finish {
-					background-color: #2d8cf0;
+				.ygq {
+					color: #999;
 				}
-				.pay {
-					background-color: #10c71e;
+				.ywc {
+					color: #10c71e;
 				}
 				.check-btns {
 					width: '50%';