Просмотр исходного кода

Merge branch 'master' of http://110.41.163.243:9980/kd-aiot/aiot-app

ysy 1 год назад
Родитель
Сommit
1619bed085

+ 2 - 0
pages/home/components/KdCard/index.vue

@@ -154,6 +154,7 @@
 
 				// line-height: ;
 				.label {
+					padding: 10rpx 0;
 					display: inline-block;
 					width: 6em;
 					color: #555;
@@ -161,6 +162,7 @@
 					margin-right: 14rpx;
 				}
 				.content {
+					padding: 10rpx 0;
 					flex: 1;
 				}
 			}

+ 15 - 0
pages/home/myTicket/detail.vue

@@ -37,6 +37,10 @@
 											<text class="kd-label">工单生成时间</text>
 											{{ item.createTime }}
 										</view>
+										<view class="kd-cell">
+											<text class="kd-label">班次</text>
+											{{ getCurrentClasses(item.createTime) }}
+										</view>
 										<view class="kd-cell">
 											<text class="kd-label">执行结果</text>
 											<text class="status-box text-warning" v-if="item.executeStatus === 0">待检</text>
@@ -202,6 +206,17 @@
 			uni.$off('scancodedate')
 		},
 		methods: {
+			// 获取当前班次
+			getCurrentClasses(date) {
+				console.log(new Date(date).getHours())
+				if (new Date(date).getHours() >= 7 && new Date(date).getHours() < 16) {
+					return '白班'
+				} else if (new Date(date).getHours() >= 16 && new Date(date).getHours() < 23) {
+					return '晚班'
+				} else {
+					return '零点班'
+				}
+			},
 			// 备件使用明细
 			handlbjsymx(title, list) {
 				this.$refs.PopSparePart.open(title, list)

+ 79 - 23
pages/home/myTicket/myTicket.vue

@@ -1,14 +1,8 @@
 <template>
 	<view class="kd-work-container">
-		<uni-nav-bar fixed="true" statusBar="true" left-icon="back" :title="orderType == 1 ? '工单待办' : '工单已办'" right-icon="scan" @clickLeft="back" @clickRight="HandlScanCode">
+		<uni-nav-bar fixed="true" statusBar="true" left-icon="back" :title="orderType == 1 ? '工单待办' : '工单已办'" right-icon="scan" @clickLeft="back">
 			<view slot="right">
-				<u-icon
-					name="scan"
-					color="#fff"
-					size="60"
-					:custom-style="{
-						backgroundColor: '#157A2C'
-					}"></u-icon>
+				<view @click="HandlScanCode" class="scan_btn"></view>
 			</view>
 		</uni-nav-bar>
 		<view class="top-wrapper">
@@ -23,17 +17,19 @@
 						fontWeight: 'bold'
 					}"></u-tabs>
 			</view>
-			<image src="~@/static/moreSearch.svg" mode="" @click="moreSearch = !moreSearch"></image>
-			<view class="slide-search">
+			<view class="more_search">
+				<image src="~@/static/moreSearch.svg" mode="" @click="searchShow = true"></image>
+			</view>
+			<!-- <view class="slide-search">
 				<view class="more-search" v-show="moreSearch">
 					<view class="cell">
 						<view class="label">编号</view>
 						<input type="text" placeholder="请输入" v-model="searchFrom.code" />
 					</view>
 					<view v-if="orderType == 1" class="cell">
-						<view class="label">状态</view>
-						<!-- <uni-data-select :key="activeType" :localdata="statusRange[activeType]" v-model="searchFrom.orderStatus"></uni-data-select> -->
-						<u-checkbox-group v-model="searchFrom.orderStatus" placement="row" size="30" @change="statusChange">
+						<view class="label">状态</view> -->
+			<!-- <uni-data-select :key="activeType" :localdata="statusRange[activeType]" v-model="searchFrom.orderStatus"></uni-data-select> -->
+			<!-- <u-checkbox-group v-model="searchFrom.orderStatus" placement="row" size="30" @change="statusChange">
 							<u-checkbox
 								v-for="(item, index) in statusRange[activeType]"
 								:customStyle="{ marginRight: '8px' }"
@@ -43,17 +39,17 @@
 								iconSize="30"
 								activeColor="#157A2C"></u-checkbox>
 						</u-checkbox-group>
-					</view>
-					<!-- <view class="cell">
+					</view> -->
+			<!-- <view class="cell">
 						<view class="label">紧急程度</view>
 						<uni-data-select :localdata="doneRange" @change="doneChange" v-model="searchFrom.urgent" :clear="false"></uni-data-select>
 					</view> -->
-					<view class="btn-search">
+			<!-- <view class="btn-search">
 						<button @click="reset">重置</button>
 						<button class="primary" @click="doSearch">搜索</button>
 					</view>
 				</view>
-			</view>
+			</view> -->
 		</view>
 		<view class="work-list">
 			<u-list @scrolltolower="scrolltolower" :key="activeType" :preLoadScreen="page * 10">
@@ -66,10 +62,41 @@
 				</u-list-item>
 			</u-list>
 		</view>
+		<SearchPopup mode="top" v-if="searchShow">
+			<template v-slot:list>
+				<view class="search_list">
+					<u-form labelPosition="left" :model="formData" labelWidth="180" labelAlign="left" class="baseForm">
+						<u-form-item v-if="orderType == 1" label="类型:" class="required-form" borderBottom prop="assetType">
+							<u-checkbox-group v-model="searchFrom.orderStatus" placement="row" size="30" @change="statusChange">
+								<u-checkbox
+									v-for="(item, index) in statusRange[activeType]"
+									:customStyle="{ marginRight: '8px' }"
+									:label="item.text"
+									:name="item.value"
+									labelSize="30"
+									iconSize="30"
+									activeColor="#157A2C"></u-checkbox>
+							</u-checkbox-group>
+						</u-form-item>
+						<u-form-item label="编号:" class="required-form" borderBottom prop="assetType">
+							<input type="text" placeholder="请输入编号" v-model="searchFrom.code" />
+						</u-form-item>
+					</u-form>
+				</view>
+			</template>
+			<template v-slot:operate>
+				<view class="operate_box rx-bc">
+					<u-button size="small" class="u-reset-button mg-20" @click="searchShow = false">取消</u-button>
+					<u-button type="warning" size="small" class="u-reset-button mg-20" @click="reset">重置</u-button>
+					<u-button type="success" size="small" class="u-reset-button" @click="doSearch">确定</u-button>
+				</view>
+			</template>
+		</SearchPopup>
 	</view>
 </template>
 
 <script>
+	import SearchPopup from '@/pages/pda/components/searchPopup.vue'
 	import { getWorkOrderList, statistics } from '@/api/myTicket'
 	import KdCard from '../components/KdCard/index.vue'
 	import CardTime from '../components/CardTime.vue'
@@ -80,10 +107,12 @@
 	export default {
 		components: {
 			KdCard,
-			CardTime
+			CardTime,
+			SearchPopup
 		},
 		data() {
 			return {
+				formData: {},
 				orderTitle: '',
 				tabsCurrent: 0, // tabs初始位置
 				doneRange: [
@@ -155,7 +184,7 @@
 				activeType: 'maintenance',
 				activeIndex: 0,
 				dataList: [],
-				moreSearch: false,
+				searchShow: false,
 				statusRange: {
 					repair: [
 						{
@@ -312,6 +341,7 @@
 		},
 		onShow(e) {
 			if (this.isInstall) return
+			this.dataList = []
 			this.getList()
 			this.getCount()
 		},
@@ -346,9 +376,10 @@
 			// 紧急度选择
 			doneChange(id) {},
 			doSearch() {
+				this.dataList = []
 				this.page = 1
 				this.getList()
-				this.moreSearch = false
+				this.searchShow = false
 			},
 			reset() {
 				this.searchFrom = {
@@ -387,9 +418,10 @@
 				console.log(item)
 				this.activeType = item.type
 				this.activeIndex = item.index
+				this.dataList = []
 				this.page = 1
 				this.reset()
-				this.moreSearch = false
+				this.searchShow = false
 			},
 			getCount() {
 				statistics().then(data => {
@@ -435,7 +467,7 @@
 				const params = {
 					type: this.tabList[this.activeIndex].workOrderType,
 					pageNum: this.page,
-					size: 8,
+					size: 10,
 					...this.searchFrom
 				}
 				// 维修
@@ -466,7 +498,7 @@
 							// 	this.dataList = []
 							// }
 							// this.dataList.push(...res.data.list.records)
-							this.dataList = res.list
+							this.dataList = this.dataList.concat(res.list)
 							isEnd = this.dataList.length >= res.count
 						} else {
 							this.dataList = []
@@ -496,6 +528,13 @@
 		height: 0;
 		color: transparent;
 	}
+	.scan_btn {
+		background: url('../../../static/scan.png');
+		background-size: 100% 100%;
+		background-repeat: no-repeat;
+		width: 50rpx;
+		height: 50rpx;
+	}
 	.kd-work-container {
 		height: 100vh;
 		overflow: hidden;
@@ -606,6 +645,10 @@
 			flex: 1;
 		}
 
+		.more_search {
+			padding: 0 20rpx;
+		}
+
 		/deep/.u-input {
 			border: 1rpx solid #ccc;
 
@@ -620,4 +663,17 @@
 			margin-left: 10rpx;
 		}
 	}
+	.search_list {
+		min-height: 100rpx;
+		/deep/ .baseForm {
+			padding: 10rpx 20rpx;
+		}
+	}
+	.operate_box {
+		padding: 10rpx;
+		box-sizing: border-box;
+	}
+	.mg-20 {
+		margin-right: 20rpx;
+	}
 </style>

BIN
static/scan.png