Explorar el Código

修改我的工单

huang_an hace 2 años
padre
commit
1dc2a71a29

+ 19 - 0
api/myTicket/index.js

@@ -93,3 +93,22 @@ export async function workOrderRotate(params) {
 	}
 	return Promise.reject(new Error(data.message))
 }
+
+// 我的工单统计
+export async function statistics(params) {
+	const data = await get(Vue.prototype.apiUrl + `/eam/PdaWorkOrder/statistics`, params)
+	if (data.code == 0) {
+		return data.data
+	}
+	return Promise.reject(new Error(data.message))
+}
+
+// 我的工单设备状态统计
+export async function devicestatistics(params) {
+	const data = await get(Vue.prototype.apiUrl + `/eam/PdaWorkOrder/deviceStatistics`, params)
+	console.log(data)
+	if (data.code == 0) {
+		return data.data
+	}
+	return Promise.reject(new Error(data.message))
+}

+ 21 - 0
pages/home/components/KdCard/config.js

@@ -7,6 +7,12 @@ const urgent = {
 	2: '紧急',
 	3: '重要'
 }
+// 状态
+const status = {
+	0: '待接收',
+	2: '执行中',
+	3: '完成'
+}
 
 export default {
 	// 维修工单
@@ -54,6 +60,11 @@ export default {
 		{
 			label: '计划完成时间',
 			key: 'planFinishTime'
+		},
+		{
+			label: '状态',
+			key: 'orderStatus',
+			formatter: val => status[val]
 		}
 	],
 	// 巡点检
@@ -73,6 +84,11 @@ export default {
 		{
 			label: '计划完成时间',
 			key: 'planFinishTime'
+		},
+		{
+			label: '状态',
+			key: 'orderStatus',
+			formatter: val => status[val]
 		}
 	],
 	// 量具送检
@@ -92,6 +108,11 @@ export default {
 		{
 			label: '计划完成时间',
 			key: 'planFinishTime'
+		},
+		{
+			label: '状态',
+			key: 'orderStatus',
+			formatter: val => status[val]
 		}
 	],
 	// 盘点

+ 9 - 9
pages/home/components/navigation.vue

@@ -17,20 +17,20 @@
 					{
 						class: 'iconfont icon-bianji',
 						title: '我的工单',
-						link_url: '/pages/home/work/work',
+						link_url: '/pages/home/myTicket/myTicket',
 						badge: 0
 					},
-					{
-						class: 'iconfont icon-dangqiangaojing',
-						title: '我的消息',
-						link_url: '/pages/home/msg/msg',
-						badge: 0
-						// "num": 1
-					},
+					// {
+					// 	class: 'iconfont icon-dangqiangaojing',
+					// 	title: '我的消息',
+					// 	link_url: '/pages/home/msg/msg',
+					// 	badge: 0
+					// 	// "num": 1
+					// },
 					{
 						class: 'iconfont icon-kuneipandian ',
 						title: '我的待办',
-						link_url: '/pages/home/backlog/backlog',
+						link_url: '/pages/home/wt/todo/todo',
 						badge: 0
 						// "num": 1
 					},

+ 47 - 19
pages/home/myTicket/myTicket.vue

@@ -49,7 +49,7 @@
 </template>
 
 <script>
-	import { getWorkOrderList } from '@/api/myTicket'
+	import { getWorkOrderList, statistics } from '@/api/myTicket'
 	import KdCard from '../components/KdCard/index.vue'
 	import CardTime from '../components/CardTime.vue'
 	// import { postJ } from '@/utils/api'
@@ -174,7 +174,7 @@
 							text: '待接收'
 						},
 						{
-							value: 1,
+							value: 2,
 							text: '执行中'
 						},
 						{
@@ -188,7 +188,21 @@
 							text: '待接收'
 						},
 						{
-							value: 1,
+							value: 2,
+							text: '执行中'
+						},
+						{
+							value: 3,
+							text: '完成'
+						}
+					],
+					quantity: [
+						{
+							value: 0,
+							text: '待接收'
+						},
+						{
+							value: 2,
 							text: '执行中'
 						},
 						{
@@ -244,7 +258,7 @@
 		},
 		onShow() {
 			this.getList()
-			// this.getCount()
+			this.getCount()
 		},
 		methods: {
 			// 紧急度选择
@@ -288,23 +302,37 @@
 				this.moreSearch = false
 			},
 			getCount() {
-				Promise.all(
-					this.tabList.map(item =>
-						getWorkOrderList(
-							{
-								type: item.workOrderType
-							},
-							false
-						)
-					)
-				).then(res => {
-					res.forEach((item, index) => {
-						console.log(item)
-						// if (item?.success) {
-						// 	this.tabList[index].badge.value = item.data.count
-						// }
+				statistics().then(data => {
+					console.log('onsole.log(data)-----------')
+					console.log(data)
+					this.tabList = this.tabList.map(item => {
+						switch (item.type) {
+							case 'maintenance':
+								return { ...item, badge: { value: data.maintenanceNum } }
+							case 'patrol':
+								return { ...item, badge: { value: data.patrolInspection } }
+							case 'quantity':
+								return { ...item, badge: { value: data.quantityNum } }
+						}
 					})
 				})
+				// Promise.all(
+				// 	this.tabList.map(item =>
+				// 		getWorkOrderList(
+				// 			{
+				// 				type: item.workOrderType
+				// 			},
+				// 			false
+				// 		)
+				// 	)
+				// ).then(res => {
+				// 	res.forEach((item, index) => {
+				// 		console.log(item)
+				// 		// if (item?.success) {
+				// 		// 	this.tabList[index].badge.value = item.data.count
+				// 		// }
+				// 	})
+				// })
 			},
 			getList() {
 				uni.showLoading({

+ 50 - 75
pages/login/login.vue

@@ -1,17 +1,13 @@
 <template>
 	<view class="content">
 		<uni-icons class="setting" type="gear" @click="handleServerSettings" size="50" color="#fff"></uni-icons>
-	  <view class="login_logo">
-	
-		  	<image  :src="logo || 'https://img.picgo.net/2024/04/18/login_logo45cb6a5eb95c8c1c.png'"></image>
-	  </view>
+		<view class="login_logo">
+			<image :src="logo || 'https://img.picgo.net/2024/04/18/login_logo45cb6a5eb95c8c1c.png'"></image>
+		</view>
 		<view class="login-title">
-			
 			<label>智慧工厂信息化系统</label>
 
-			<text>{{ companyName}}</text>
-
-
+			<text>{{ companyName }}</text>
 		</view>
 		<view>
 			<view class="login-content">
@@ -43,25 +39,12 @@
 </template>
 
 <script>
-	import {
-		postJ
-	} from "@/utils/api.js";
-	import {
-		login,
-		usName
-	} from "@/api/common.js";
-	import {
-		getResourcesTree
-	} from '@/api/pda/common.js'
+	import { postJ } from '@/utils/api.js'
+	import { login, usName } from '@/api/common.js'
+	import { getResourcesTree } from '@/api/pda/common.js'
 
-	import {
-		setMemo,
-		isMemo,
-		removeMemo,
-		setPassword,
-		getPassword,
-	} from "@/utils/passwordMemo.js";
-	import ServerSetting from "@/components/ServerSetting/index";
+	import { setMemo, isMemo, removeMemo, setPassword, getPassword } from '@/utils/passwordMemo.js'
+	import ServerSetting from '@/components/ServerSetting/index'
 
 	export default {
 		components: {
@@ -70,20 +53,20 @@
 		data() {
 			return {
 				userInfo: {
-					username: "",
-					passwd: "",
+					username: '',
+					passwd: ''
 				},
 				isMemo: isMemo(),
 				loginDisabled: false,
-				
+
 				companyName: null,
-				 logo: null,
-			};
+				logo: null
+			}
 		},
 		onLoad() {
 			if (this.isMemo) {
-				const userInfo = getPassword();
-				if (userInfo?.username) this.userInfo = userInfo;
+				const userInfo = getPassword()
+				if (userInfo?.username) this.userInfo = userInfo
 			}
 
 			this.getUsName()
@@ -91,16 +74,14 @@
 		mounted() {
 			// #ifdef APP-PLUS
 			this.$nextTick(() => {
-				this.$refs.serverSettingRef && this.$refs.serverSettingRef.serverCheck();
-			});
+				this.$refs.serverSettingRef && this.$refs.serverSettingRef.serverCheck()
+			})
 			// #endif
 			// uni.reLaunch({
 			//           url: "/pages/home/home",
 			//         });
-
 		},
 		methods: {
-
 			getUsName() {
 				usName().then(res => {
 					this.companyName = res.companyName
@@ -108,7 +89,7 @@
 				})
 			},
 			setServerStatus(val) {
-				this.loginDisabled = !val;
+				this.loginDisabled = !val
 			},
 			//登录
 			// submit() {
@@ -156,8 +137,8 @@
 			submit() {
 				// #ifdef APP-PLUS
 				if (!this.apiUrl) {
-					this.$refs.serverSettingRef.open();
-					return;
+					this.$refs.serverSettingRef.open()
+					return
 				}
 				// #endif
 
@@ -166,47 +147,45 @@
 					loginPwd: this.userInfo.passwd
 				}
 
-
-				postJ(this.apiUrl + "/main/user/login", param)
-					.then((res) => {
-
+				postJ(this.apiUrl + '/main/user/login', param)
+					.then(res => {
 						if (this.isMemo) {
-							setPassword(this.userInfo);
+							setPassword(this.userInfo)
 						}
 
-						console.log(res);
-						let data = res.data;
-						uni.setStorageSync("token", data.token);
-						uni.setStorageSync("userInfo", data);
+						console.log(res)
+						let data = res.data
+						uni.setStorageSync('token', data.token)
+
 						uni.showToast({
-							title: "登录成功",
-							icon: "success",
-							duration: 2000,
-						});
+							title: '登录成功',
+							icon: 'success',
+							duration: 2000
+						})
 						this.getTree()
 						setTimeout(() => {
 							uni.reLaunch({
-								url: "/pages/home/home",
-							});
-						}, 2000);
+								url: '/pages/home/home'
+							})
+						}, 2000)
 					})
-					.catch((err) => {
+					.catch(err => {
 						uni.showToast({
 							title: err.message,
-							icon: "none",
-							duration: 2000,
-						});
-					});
+							icon: 'none',
+							duration: 2000
+						})
+					})
 			},
 			handleServerSettings() {
-				this.$refs.serverSettingRef.open();
+				this.$refs.serverSettingRef.open()
 			},
 			checkboxChange(e) {
-				this.isMemo = e.detail.value[0] === "1";
+				this.isMemo = e.detail.value[0] === '1'
 				if (this.isMemo) {
-					setMemo();
+					setMemo()
 				} else {
-					removeMemo();
+					removeMemo()
 				}
 			},
 
@@ -220,17 +199,13 @@
 						})
 					}
 					let List = JSON.stringify(res || [])
-					uni.setStorageSync("treeList", List);
-
-
-
-
+					uni.setStorageSync('treeList', List)
 				})
-			},
-		},
-	};
+			}
+		}
+	}
 </script>
 
 <style lang="scss" scoped>
-	@import "login.scss";
-</style>
+	@import 'login.scss';
+</style>

+ 6 - 6
pages/maintenance/check/components/CheckCard.vue

@@ -30,9 +30,9 @@
 			<text class="label">结果</text>
 			<view class="cell-content">
 				<view class="content-status" v-if="type == 'view'">
-					<!-- {{ item.isNormal?'正常':'缺陷' }} -->
-					<div v-if="item.status === 0" style="color: green">正常</div>
-					<div v-else-if="item.status === -1" style="color: red">缺陷</div>
+					<!-- {{ item.isNormal?'正常':'异常' }} -->
+					<div v-if="item.status == 0" style="color: green">正常</div>
+					<div v-else-if="item.status == -1" style="color: red">异常</div>
 				</view>
 				<textarea v-if="type !== 'view'" placeholder="请输入" v-model="item.result" />
 				<view class="result-text" v-else>{{ item.result }}</view>
@@ -58,7 +58,7 @@
               :name="1"
             >
             </u-radio>
-            <u-radio :customStyle="{}" :labelSize="30" label="缺陷" :name="0">
+            <u-radio :customStyle="{}" :labelSize="30" label="异常" :name="0">
             </u-radio>
           </u-radio-group>
           <view
@@ -66,7 +66,7 @@
             v-else
             style="min-height: 1em"
           >
-            {{ ['缺陷', '正常'][item.isNormal] }}
+            {{ ['异常', '正常'][item.isNormal] }}
           </view> -->
 				</view>
 			</view>
@@ -91,7 +91,7 @@
 			return {
 				statusList: [
 					{ label: '正常', status: 0 },
-					{ label: '缺陷', status: -1 }
+					{ label: '异常', status: -1 }
 				]
 			}
 		},

+ 45 - 9
pages/maintenance/detail/detail.vue

@@ -1,6 +1,6 @@
 <template>
 	<view class="maintenance-container">
-		<uni-nav-bar fixed="true" statusBar="true" left-icon="back" title="保养工单详情" @clickLeft="back" right-icon="scan" @clickRight="HandlScanCode"></uni-nav-bar>
+		<uni-nav-bar fixed="true" statusBar="true" left-icon="back" title="保养工单详情" @clickLeft="back" @clickRight="HandlScanCode"></uni-nav-bar>
 		<view class="maintenance-wrapper">
 			<view class="maintenance-content">
 				<KdTabs v-model="active" @change="handleTabChange" :list="['基本信息', '保养设备']" />
@@ -79,7 +79,10 @@
 				</view>
 				<view class="kd-equipment" v-show="active === 1">
 					<view class="kd-type-box">
-						<text :class="{ 'type—active': typeActive === index }" v-for="(item, index) in equpStatus" :key="index" @click="typeChange(index)">{{ item.name }}</text>
+						<view :class="{ 'type—active': typeActive === index }" v-for="(item, index) in equpStatus" :key="index" @click="typeChange(index)">
+							{{ item.name }}
+							<text v-if="item.count > 0" class="count">{{ item.count }}</text>
+						</view>
 					</view>
 					<view class="kd-list-container">
 						<u-list @scrolltolower="scrolltolower">
@@ -107,7 +110,7 @@
 											<text class="kd-content">
 												<text class="status-box text-warning" v-if="item.executeStatus === 0">待检</text>
 												<text class="status-box text-primary" v-else-if="item.executeStatus === 1">已检</text>
-												<text class="status-box text-danger" v-else-if="item.executeStatus === 2">缺陷</text>
+												<text class="status-box text-danger" v-else-if="item.executeStatus === 2">异常</text>
 												<text class="status-box text-primary" v-else-if="item.executeStatus === 3">已报修</text>
 											</text>
 										</view>
@@ -151,7 +154,7 @@
 </template>
 
 <script>
-	import { getWorkOrderDetail, getDeviceList, startExecuting, signingWork } from '@/api/myTicket/index.js'
+	import { getWorkOrderDetail, getDeviceList, startExecuting, signingWork, devicestatistics } from '@/api/myTicket/index.js'
 	import { get, post, postJ } from '@/utils/api.js'
 	import Assign from '@/components/Assign.vue'
 	import CellInfo from '@/components/CellInfo.vue'
@@ -199,7 +202,7 @@
 						value: 1
 					},
 					{
-						name: '缺陷',
+						name: '异常',
 						value: 2
 					}
 				],
@@ -218,6 +221,7 @@
 		},
 		onShow() {
 			this.getInfo()
+			this.getCount()
 			if (this.chooseTab) {
 				this.active = 1
 				this.typeChange(2)
@@ -232,6 +236,22 @@
 			uni.$off('scancodedate')
 		},
 		methods: {
+			getCount() {
+				devicestatistics({ planId: this.planId }).then(data => {
+					this.equpStatus = this.equpStatus.map(item => {
+						switch (item.name) {
+							case '全部':
+								return { ...item, count: data.total }
+							case '待检':
+								return { ...item, count: data.isInspectedNum }
+							case '已检':
+								return { ...item, count: data.checkedNum }
+							case '异常':
+								return { ...item, count: data.abnormalNum }
+						}
+					})
+				})
+			},
 			// 扫码枪扫码
 			cbScancodedate(data) {
 				this.Scancodedate(data.code)
@@ -584,14 +604,30 @@
 		.kd-type-box {
 			text-align: center;
 			padding: 26rpx 0;
-			text {
+
+			view {
+				position: relative;
 				display: inline-block;
 				width: 120rpx;
 				padding: 4rpx 0;
-				color: #333;
-				margin: 0 8rpx;
+				color: #747474;
+				margin: 0 20rpx;
+				background-color: rgba(215, 215, 215, 0.5);
+
 				&.type—active {
-					background-color: rgba(215, 215, 215, 1);
+					background-color: #1e7f35;
+					color: #fff;
+				}
+				.count {
+					position: absolute;
+					top: -9px;
+					right: -9px;
+					width: 18px;
+					height: 18px;
+					border-radius: 50%;
+					font-size: 12px;
+					background-color: red;
+					color: #fff;
 				}
 			}
 		}

+ 6 - 6
pages/quantity/check/components/CheckCard.vue

@@ -30,9 +30,9 @@
 			<text class="label">结果</text>
 			<view class="cell-content">
 				<view class="content-status" v-if="type == 'view'">
-					<!-- {{ item.executeStatus?'正常':'缺陷' }} -->
-					<div v-if="item.status === 0" style="color: green">正常</div>
-					<div v-else-if="item.status === -1" style="color: red">缺陷</div>
+					<!-- {{ item.executeStatus?'正常':'异常' }} -->
+					<div v-if="item.status == 0" style="color: green">正常</div>
+					<div v-else-if="item.status == -1" style="color: red">异常</div>
 				</view>
 				<textarea v-if="type !== 'view'" placeholder="请输入" v-model="item.result" />
 				<view class="result-text" v-else>{{ item.result }}</view>
@@ -59,7 +59,7 @@
               :name="1"
             >
             </u-radio>
-            <u-radio :customStyle="{}" :labelSize="30" label="缺陷" :name="0">
+            <u-radio :customStyle="{}" :labelSize="30" label="异常" :name="0">
             </u-radio>
           </u-radio-group> -->
 					<!-- <view
@@ -67,7 +67,7 @@
             v-else
             style="min-height: 1em"
           >
-            {{ ['缺陷', '正常'][item.executeStatus] }}
+            {{ ['异常', '正常'][item.executeStatus] }}
           </view> -->
 				</view>
 			</view>
@@ -92,7 +92,7 @@
 			return {
 				statusList: [
 					{ label: '正常', status: 0 },
-					{ label: '缺陷', status: -1 }
+					{ label: '异常', status: -1 }
 				]
 			}
 		},

+ 43 - 9
pages/quantity/detail/detail.vue

@@ -1,6 +1,6 @@
 <template>
 	<view class="tour-container">
-		<uni-nav-bar fixed="true" statusBar="true" left-icon="back" title="量具送检工单详情" @clickLeft="back" right-icon="scan" @clickRight="HandlScanCode"></uni-nav-bar>
+		<uni-nav-bar fixed="true" statusBar="true" left-icon="back" title="量具送检工单详情" @clickLeft="back" @clickRight="HandlScanCode"></uni-nav-bar>
 		<view class="tour-wrapper">
 			<view class="tour_tally-content">
 				<KdTabs v-model="active" @change="handleTabChange" :list="['基本信息', '量具送检设备']" />
@@ -57,7 +57,10 @@
 				</view>
 				<view class="kd-equipment" v-show="active === 1">
 					<view class="kd-type-box">
-						<text :class="{ 'type—active': typeActive === index }" v-for="(item, index) in equpStatus" :key="index" @click="typeChange(index)">{{ item.name }}</text>
+						<view :class="{ 'type—active': typeActive === index }" v-for="(item, index) in equpStatus" :key="index" @click="typeChange(index)">
+							{{ item.name }}
+							<text v-if="item.count > 0" class="count">{{ item.count }}</text>
+						</view>
 					</view>
 					<view class="kd-list-container">
 						<u-list @scrolltolower="scrolltolower">
@@ -84,7 +87,7 @@
 											<text class="kd-label">执行结果</text>
 											<text class="status-box text-warning" v-if="item.executeStatus === 0">待检</text>
 											<text class="status-box text-primary" v-else-if="item.executeStatus === 1">已检</text>
-											<text class="status-box text-danger" v-else-if="item.executeStatus === 2">缺陷</text>
+											<text class="status-box text-danger" v-else-if="item.executeStatus === 2">异常</text>
 											<text class="status-box text-primary" v-else-if="item.executeStatus === 3">已报修</text>
 										</view>
 									</view>
@@ -127,7 +130,7 @@
 </template>
 
 <script>
-	import { getWorkOrderDetail, getDeviceList, startExecuting, signingWork } from '@/api/myTicket/index.js'
+	import { getWorkOrderDetail, getDeviceList, startExecuting, signingWork, devicestatistics } from '@/api/myTicket/index.js'
 	import { get, post, postJ } from '@/utils/api.js'
 	import Assign from '@/components/Assign.vue'
 	import CellInfo from '@/components/CellInfo.vue'
@@ -175,7 +178,7 @@
 						value: 1
 					},
 					{
-						name: '缺陷',
+						name: '异常',
 						value: 2
 					}
 				],
@@ -218,6 +221,7 @@
 		onShow() {
 			console.log('onShow--------')
 			this.getInfo()
+			this.getCount()
 			if (this.chooseTab) {
 				this.active = 1
 				this.typeChange(2)
@@ -237,6 +241,22 @@
 			uni.$off('scancodedate')
 		},
 		methods: {
+			getCount() {
+				devicestatistics({ planId: this.planId }).then(data => {
+					this.equpStatus = this.equpStatus.map(item => {
+						switch (item.name) {
+							case '全部':
+								return { ...item, count: data.total }
+							case '待检':
+								return { ...item, count: data.isInspectedNum }
+							case '已检':
+								return { ...item, count: data.checkedNum }
+							case '异常':
+								return { ...item, count: data.abnormalNum }
+						}
+					})
+				})
+			},
 			// 扫码枪扫码
 			cbScancodedate(data) {
 				this.Scancodedate(data.code)
@@ -672,15 +692,29 @@
 			text-align: center;
 			padding: 26rpx 0;
 
-			text {
+			view {
+				position: relative;
 				display: inline-block;
 				width: 120rpx;
 				padding: 4rpx 0;
-				color: #333;
-				margin: 0 8rpx;
+				color: #747474;
+				margin: 0 20rpx;
+				background-color: rgba(215, 215, 215, 0.5);
 
 				&.type—active {
-					background-color: rgba(215, 215, 215, 1);
+					background-color: #1e7f35;
+					color: #fff;
+				}
+				.count {
+					position: absolute;
+					top: -9px;
+					right: -9px;
+					width: 18px;
+					height: 18px;
+					border-radius: 50%;
+					font-size: 12px;
+					background-color: red;
+					color: #fff;
 				}
 			}
 		}

+ 6 - 6
pages/tour_tally/check/components/CheckCard.vue

@@ -30,9 +30,9 @@
 			<text class="label">结果</text>
 			<view class="cell-content">
 				<view class="content-status" v-if="type == 'view'">
-					<!-- {{ item.executeStatus?'正常':'缺陷' }} -->
-					<div v-if="item.status === 0" style="color: green">正常</div>
-					<div v-else-if="item.status === -1" style="color: red">缺陷</div>
+					<!-- {{ item.executeStatus?'正常':'异常' }} -->
+					<div v-if="item.status == 0" style="color: green">正常</div>
+					<div v-else-if="item.status == -1" style="color: red">异常</div>
 				</view>
 				<textarea v-if="type !== 'view'" placeholder="请输入" v-model="item.result" />
 				<view class="result-text" v-else>{{ item.result }}</view>
@@ -59,7 +59,7 @@
               :name="1"
             >
             </u-radio>
-            <u-radio :customStyle="{}" :labelSize="30" label="缺陷" :name="0">
+            <u-radio :customStyle="{}" :labelSize="30" label="异常" :name="0">
             </u-radio>
           </u-radio-group> -->
 					<!-- <view
@@ -67,7 +67,7 @@
             v-else
             style="min-height: 1em"
           >
-            {{ ['缺陷', '正常'][item.executeStatus] }}
+            {{ ['异常', '正常'][item.executeStatus] }}
           </view> -->
 				</view>
 			</view>
@@ -92,7 +92,7 @@
 			return {
 				statusList: [
 					{ label: '正常', status: 0 },
-					{ label: '缺陷', status: -1 }
+					{ label: '异常', status: -1 }
 				]
 			}
 		},

+ 43 - 9
pages/tour_tally/detail/detail.vue

@@ -1,6 +1,6 @@
 <template>
 	<view class="tour-container">
-		<uni-nav-bar fixed="true" statusBar="true" left-icon="back" title="巡点检工单详情" @clickLeft="back" right-icon="scan" @clickRight="HandlScanCode"></uni-nav-bar>
+		<uni-nav-bar fixed="true" statusBar="true" left-icon="back" title="巡点检工单详情" @clickLeft="back" @clickRight="HandlScanCode"></uni-nav-bar>
 		<view class="tour-wrapper">
 			<view class="tour_tally-content">
 				<KdTabs v-model="active" @change="handleTabChange" :list="['基本信息', '巡点检设备']" />
@@ -57,7 +57,10 @@
 				</view>
 				<view class="kd-equipment" v-show="active === 1">
 					<view class="kd-type-box">
-						<text :class="{ 'type—active': typeActive === index }" v-for="(item, index) in equpStatus" :key="index" @click="typeChange(index)">{{ item.name }}</text>
+						<view :class="{ 'type—active': typeActive === index }" v-for="(item, index) in equpStatus" :key="index" @click="typeChange(index)">
+							{{ item.name }}
+							<text v-if="item.count > 0" class="count">{{ item.count }}</text>
+						</view>
 					</view>
 					<view class="kd-list-container">
 						<u-list @scrolltolower="scrolltolower">
@@ -84,7 +87,7 @@
 											<text class="kd-label">执行结果</text>
 											<text class="status-box text-warning" v-if="item.executeStatus === 0">待检</text>
 											<text class="status-box text-primary" v-else-if="item.executeStatus === 1">已检</text>
-											<text class="status-box text-danger" v-else-if="item.executeStatus === 2">缺陷</text>
+											<text class="status-box text-danger" v-else-if="item.executeStatus === 2">异常</text>
 											<text class="status-box text-primary" v-else-if="item.executeStatus === 3">已报修</text>
 										</view>
 									</view>
@@ -127,7 +130,7 @@
 </template>
 
 <script>
-	import { getWorkOrderDetail, getDeviceList, startExecuting, signingWork } from '@/api/myTicket/index.js'
+	import { getWorkOrderDetail, getDeviceList, startExecuting, signingWork, devicestatistics } from '@/api/myTicket/index.js'
 	import { get, post, postJ } from '@/utils/api.js'
 	import Assign from '@/components/Assign.vue'
 	import CellInfo from '@/components/CellInfo.vue'
@@ -175,7 +178,7 @@
 						value: 1
 					},
 					{
-						name: '缺陷',
+						name: '异常',
 						value: 2
 					}
 				],
@@ -218,6 +221,7 @@
 		onShow() {
 			console.log('onShow--------')
 			this.getInfo()
+			this.getCount()
 			if (this.chooseTab) {
 				this.active = 1
 				this.typeChange(2)
@@ -237,6 +241,22 @@
 			uni.$off('scancodedate')
 		},
 		methods: {
+			getCount() {
+				devicestatistics({ planId: this.planId }).then(data => {
+					this.equpStatus = this.equpStatus.map(item => {
+						switch (item.name) {
+							case '全部':
+								return { ...item, count: data.total }
+							case '待检':
+								return { ...item, count: data.isInspectedNum }
+							case '已检':
+								return { ...item, count: data.checkedNum }
+							case '异常':
+								return { ...item, count: data.abnormalNum }
+						}
+					})
+				})
+			},
 			// 扫码枪扫码
 			cbScancodedate(data) {
 				this.Scancodedate(data.code)
@@ -672,15 +692,29 @@
 			text-align: center;
 			padding: 26rpx 0;
 
-			text {
+			view {
+				position: relative;
 				display: inline-block;
 				width: 120rpx;
 				padding: 4rpx 0;
-				color: #333;
-				margin: 0 8rpx;
+				color: #747474;
+				margin: 0 20rpx;
+				background-color: rgba(215, 215, 215, 0.5);
 
 				&.type—active {
-					background-color: rgba(215, 215, 215, 1);
+					background-color: #1e7f35;
+					color: #fff;
+				}
+				.count {
+					position: absolute;
+					top: -9px;
+					right: -9px;
+					width: 18px;
+					height: 18px;
+					border-radius: 50%;
+					font-size: 12px;
+					background-color: red;
+					color: #fff;
 				}
 			}
 		}