Browse Source

新增我的工单

huang_an 2 years ago
parent
commit
61f4249512

+ 95 - 0
api/myTicket/index.js

@@ -0,0 +1,95 @@
+import { postJ, post, get } from '@/utils/request'
+import Vue from 'vue'
+
+// 我的工单列表(巡点检,保养,量具送检)
+export async function getWorkOrderList(params) {
+	const data = await get(Vue.prototype.apiUrl + `/eam/PdaWorkOrder/list`, params)
+	if (data.code == 0) {
+		return data.data
+	}
+	return Promise.reject(new Error(data.message))
+}
+
+// 设备列表(巡点检,保养,量具送检)
+export async function getDeviceList(params) {
+	const data = await get(Vue.prototype.apiUrl + `/eam/PdaWorkOrder/deviceList`, params)
+	if (data.code == 0) {
+		return data.data
+	}
+	return Promise.reject(new Error(data.message))
+}
+
+// 我的工单详情(巡点检,保养,量具送检)
+export async function getWorkOrderDetail(params) {
+	const data = await get(Vue.prototype.apiUrl + `/eam/PdaWorkOrder/info`, params)
+	if (data.code == 0) {
+		return data.data
+	}
+	return Promise.reject(new Error(data.message))
+}
+
+// 设备事项检查(巡点检,保养,量具送检)
+export async function mattersChecked(params) {
+	const data = await postJ(Vue.prototype.apiUrl + `/eam/PdaWorkOrder/mattersChecked`, params)
+	if (data.code == 0) {
+		return data.data
+	}
+	return Promise.reject(new Error(data.message))
+}
+
+// 获取机构列表
+export async function listOrganizations(id) {
+	console.log(Vue.prototype.apiUrl)
+	console.log('id-----------------------------', id)
+	const data = await get(Vue.prototype.apiUrl + `/main/group/getGroupTree`, { parentId: id })
+	console.log(data)
+	if (data.code == 0) {
+		return data.data
+	}
+	return Promise.reject(new Error(data.message))
+}
+
+// 获取设备事项详情
+export async function getDeviceInfo(params) {
+	const data = await get(Vue.prototype.apiUrl + `/eam/PdaWorkOrder/deviceInfo`, params)
+	if (data.code == 0) {
+		return data.data
+	}
+	return Promise.reject(new Error(data.message))
+}
+
+// 开始执行
+export async function startExecuting(params) {
+	const data = await postJ(Vue.prototype.apiUrl + `/eam/PdaWorkOrder/startExecuting`, params)
+	if (data.code == 0) {
+		return data.data
+	}
+	return Promise.reject(new Error(data.message))
+}
+
+// 报工
+export async function signingWork(params) {
+	const data = await postJ(Vue.prototype.apiUrl + `/eam/PdaWorkOrder/signingWork`, params)
+	if (data.code == 0) {
+		return data.data
+	}
+	return Promise.reject(new Error(data.message))
+}
+
+// 根据条件查询人员列表
+export async function getUserPage(params) {
+	const data = await get(Vue.prototype.apiUrl + `/main/user/getUserPage`, params)
+	if (data.code == 0) {
+		return data.data
+	}
+	return Promise.reject(new Error(data.message))
+}
+
+// 转派
+export async function workOrderRotate(params) {
+	const data = await get(Vue.prototype.apiUrl + `/eam/workordermaintenance/rotate`, params)
+	if (data.code == 0) {
+		return data.data
+	}
+	return Promise.reject(new Error(data.message))
+}

+ 480 - 0
pages/home/myTicket/myTicket.vue

@@ -0,0 +1,480 @@
+<template>
+	<view class="kd-work-container">
+		<uni-nav-bar fixed="true" statusBar="true" left-icon="back" title="我的工单" @clickLeft="back"></uni-nav-bar>
+		<view class="top-wrapper">
+			<view class="top-tabs">
+				<u-tabs
+					:list="tabList"
+					@change="handleTabChange"
+					lineWidth="0"
+					:activeStyle="{
+						color: '#157a2c',
+						fontWeight: 'bold'
+					}"></u-tabs>
+			</view>
+			<image src="~@/static/moreSearch.svg" mode="" @click="moreSearch = !moreSearch"></image>
+			<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 class="cell">
+						<view class="label">状态</view>
+						<uni-data-select :key="activeType" :localdata="statusRange[activeType]" v-model="searchFrom.orderStatus"></uni-data-select>
+					</view>
+					<view class="cell" v-if="activeType == 'repair'">
+						<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">
+						<button @click="reset">重置</button>
+						<button class="primary" @click="doSearch">搜索</button>
+					</view>
+				</view>
+			</view>
+		</view>
+		<view class="work-list">
+			<u-list @scrolltolower="scrolltolower" :key="activeType" :preLoadScreen="page * 10">
+				<u-list-item v-for="(item, index) in dataList" :key="index">
+					<CardTime :time="item.createTime" />
+					<KdCard :orderTitle="orderTitle" :title="item.code" @handleDetail="handleDetail" :status="true" :item="item" :type="activeType" />
+				</u-list-item>
+				<u-list-item v-if="dataList.length === 0">
+					<view class="nodata">暂无数据</view>
+				</u-list-item>
+			</u-list>
+		</view>
+	</view>
+</template>
+
+<script>
+	import { getWorkOrderList } from '@/api/myTicket'
+	import KdCard from '../components/KdCard/index.vue'
+	import CardTime from '../components/CardTime.vue'
+	// import { postJ } from '@/utils/api'
+	let [isEnd] = [false]
+	export default {
+		components: {
+			KdCard,
+			CardTime
+		},
+		data() {
+			return {
+				orderTitle: '',
+				doneRange: [
+					{
+						value: 1,
+						text: '普通'
+					},
+					{
+						value: 2,
+						text: '紧急'
+					},
+					{
+						value: 3,
+						text: '重要'
+					}
+				],
+				tabList: [
+					{
+						name: '维修工单',
+						type: 'repair',
+						workOrderType: 3,
+						url: `/pages/maintain_service/detail/detail?`,
+						badge: {
+							value: 0
+						}
+					},
+					{
+						name: '计划维修工单',
+						type: 'repair',
+						workOrderType: 4,
+						url: `/pages/maintain_service/detail/detail?`,
+						badge: {
+							value: 0
+						}
+					},
+					{
+						name: '保养工单',
+						type: 'maintenance',
+						workOrderType: 2,
+						url: `/pages/maintenance/detail/detail?`,
+						badge: {
+							value: 0
+						}
+					},
+					{
+						name: '巡点检工单',
+						type: 'patrol',
+						workOrderType: 1,
+						url: `/pages/tour_tally/detail/detail?`,
+						badge: {
+							value: 0
+						}
+					},
+					{
+						name: '量具送检工单',
+						type: 'check',
+						workOrderType: 5,
+						url: `/pages/quantity/detail/detail?`,
+						badge: {
+							value: 0
+						}
+					}
+				],
+				activeType: 'repair',
+				activeIndex: 0,
+				dataList: [],
+				moreSearch: false,
+				statusRange: {
+					repair: [
+						// {
+						// 	value: 0,
+						// 	text: '待接收'
+						// },
+
+						// {
+						// 	value: 2,
+						// 	text: '待审核'
+						// },
+						// {
+						// 	value: 4,
+						// 	text: '已撤回'
+						// },
+
+						// {
+						// 	value: 6,
+						// 	text: '已驳回'
+						// },
+						{
+							value: 8,
+							text: '已派单'
+						},
+						{
+							value: 1,
+							text: '执行中'
+						},
+						{
+							value: 5,
+							text: '待验收'
+						},
+						{
+							value: 3,
+							text: '已完成'
+						},
+						{
+							value: 7,
+							text: '未修复'
+						}
+					],
+					maintenance: [
+						{
+							value: 0,
+							text: '待接收'
+						},
+						{
+							value: 1,
+							text: '执行中'
+						},
+						{
+							value: 3,
+							text: '完成'
+						}
+					],
+					patrol: [
+						{
+							value: 0,
+							text: '待接收'
+						},
+						{
+							value: 1,
+							text: '执行中'
+						},
+						{
+							value: 3,
+							text: '完成'
+						}
+					],
+					check: [
+						{
+							value: 0,
+							text: '待接收'
+						},
+						{
+							value: 1,
+							text: '执行中'
+						},
+						{
+							value: 2,
+							text: '待审核'
+						},
+						{
+							value: 3,
+							text: '完成'
+						},
+						{
+							value: 4,
+							text: '已撤回'
+						},
+						{
+							value: 5,
+							text: '待验收'
+						},
+						{
+							value: 6,
+							text: '已驳回'
+						},
+						{
+							value: 7,
+							text: '未修复'
+						},
+						{
+							value: 8,
+							text: '已派单'
+						}
+					]
+				},
+				searchFrom: {
+					code: '',
+					status: ''
+				},
+				page: 1
+			}
+		},
+		onShow() {
+			this.getList()
+			// this.getCount()
+		},
+		methods: {
+			// 紧急度选择
+			doneChange(id) {},
+			doSearch() {
+				this.page = 1
+				this.getList()
+				this.moreSearch = false
+			},
+			reset() {
+				this.searchFrom = {
+					code: '',
+					orderStatus: ''
+				}
+				this.doSearch()
+			},
+			statusChange(value) {
+				this.searchFrom.orderStatus = value
+			},
+			handleDetail(item) {
+				let url = this.tabList[this.activeIndex]?.url
+				if (!url) return
+
+				// url += `id=${item.id}&workOrderCode=${item.workOrderCode}&BizType=${item.bizType}`
+				url += `id=${item.id}&planId=${item.planId}`
+				console.log(url)
+				uni.navigateTo({
+					url
+				})
+			},
+			scrolltolower() {
+				if (isEnd) return
+				this.page++
+				this.getList()
+			},
+			handleTabChange(item) {
+				this.activeType = item.type
+				this.activeIndex = item.index
+				this.page = 1
+				this.reset()
+				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
+						// }
+					})
+				})
+			},
+			getList() {
+				uni.showLoading({
+					title: '加载中'
+				})
+				const params = {
+					type: this.tabList[this.activeIndex].workOrderType,
+					pageNum: this.page,
+					size: 8,
+					...this.searchFrom
+				}
+				isEnd = false
+				getWorkOrderList(params)
+					.then(res => {
+						if (res.list?.length > 0 && params.type === this.tabList[this.activeIndex].workOrderType) {
+							// if (params.page === 1) {
+							// 	this.dataList = []
+							// }
+							// this.dataList.push(...res.data.list.records)
+							this.dataList = res.list
+							isEnd = this.dataList.length >= res.count
+						} else {
+							this.dataList = []
+						}
+						uni.hideLoading()
+					})
+					.catch(() => {
+						uni.hideLoading()
+					})
+			}
+			//(1:巡点检;2:保养;3:维修;4:盘点)
+			// _getMyWorkOrderList(params, loading = true) {
+			// 	let str = ''
+			// 	for (let key in params) {
+			// 		str += '&' + key + '=' + params[key]
+			// 	}
+			// 	return postJ(this.apiUrl + `/eam/PdaWorkOrder/list?${str.substr(1)}`, {}, loading)
+			// }
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	scroll-view ::v-deep ::-webkit-scrollbar {
+		width: 0;
+		height: 0;
+		color: transparent;
+	}
+	.kd-work-container {
+		height: 100vh;
+		overflow: hidden;
+		display: flex;
+		flex-direction: column;
+
+		.work-list {
+			flex: 1;
+			overflow: hidden;
+			padding: 16rpx 24rpx;
+			background-color: $page-bg;
+
+			.u-list {
+				height: 100% !important;
+			}
+		}
+
+		.nodata {
+			font-size: 40rpx;
+			text-align: center;
+			padding-top: 30rpx;
+		}
+	}
+
+	.top-wrapper {
+		display: flex;
+		align-items: center;
+		background-color: #fff;
+		position: relative;
+
+		.slide-search {
+			position: absolute;
+			top: 100%;
+			left: 0;
+			right: 0;
+			z-index: 10;
+			background-color: #fff;
+
+			.timerange {
+				width: 90%;
+				margin: 0 auto 10rpx;
+			}
+
+			.select-box {
+				display: flex;
+				padding: 0 10rpx;
+
+				.uni-stat__select + .uni-stat__select {
+					margin-left: 10rpx;
+				}
+			}
+
+			.more-search {
+				padding-bottom: 20rpx;
+
+				.cell {
+					display: flex;
+					align-items: center;
+					padding-right: 20rpx;
+
+					& + .cell {
+						margin-top: 10rpx;
+					}
+
+					/deep/uni-input {
+						flex: 1;
+						height: 70rpx;
+						border: 1rpx solid #e5e5e5;
+						border-radius: 8rpx;
+						font-size: 28rpx;
+						padding-left: 20rpx;
+						box-sizing: border-box;
+					}
+
+					.label {
+						width: 180rpx;
+						text-align: right;
+						padding-right: 20rpx;
+					}
+				}
+
+				/deep/.uni-date__x-input {
+					height: 70rpx !important;
+				}
+
+				.btn-search {
+					text-align: right;
+					padding: 10rpx 10rpx 0;
+
+					button {
+						display: inline-block;
+						width: 200rpx;
+						height: 60rpx;
+						line-height: 58rpx;
+						font-size: 28rpx;
+						margin-left: 20rpx;
+
+						&.primary {
+							background-color: $j-primary-border-green;
+							color: #fff;
+						}
+					}
+				}
+			}
+		}
+
+		.top-tabs {
+			flex: 1;
+		}
+
+		/deep/.u-input {
+			border: 1rpx solid #ccc;
+
+			.u-input__content__field-wrapper__field {
+				height: 40rpx !important;
+			}
+		}
+
+		image {
+			width: 52rpx;
+			height: 52rpx;
+			margin-left: 10rpx;
+		}
+	}
+</style>

+ 693 - 0
pages/maintenance/detail/detail copy.vue

@@ -0,0 +1,693 @@
+<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>
+		<view class="maintenance-wrapper">
+			<view class="maintenance-content">
+				<KdTabs v-model="active" @change="handleTabChange" :list="['基本信息', '保养设备']" />
+				<view class="kd-baseInfo" v-show="active === 0">
+					<view class="kd-cell">
+						<text class="kd-label">工单编号</text>
+						<text class="kd-content">{{ worksheetInfo.workOrderCode }}</text>
+					</view>
+					<view class="kd-cell">
+						<text class="kd-label">计划名称</text>
+						<text class="kd-content">{{ worksheetInfo.planName }}</text>
+					</view>
+					<view class="kd-cell">
+						<text class="kd-label">设备分类</text>
+						<text class="kd-content">{{ worksheetInfo.equiTypeName }}</text>
+					</view>
+					<view class="kd-cell">
+						<text class="kd-label">保养设备总数</text>
+						<text class="kd-content text-warning">{{ worksheetInfo.equipCount - worksheetInfo.awaitInspectSum || 0 }}/{{ worksheetInfo.equipCount }}</text>
+					</view>
+					<view class="kd-cell">
+						<text class="kd-label">计划完成时长</text>
+						<text class="kd-content">{{ worksheetInfo.duration }}分钟</text>
+					</view>
+					<view class="kd-cell">
+						<text class="kd-label">实际完成时长</text>
+						<text class="kd-content">{{ finishTime(worksheetInfo.acceptTime, worksheetInfo.finishTime) }}</text>
+					</view>
+					<view class="kd-cell">
+						<text class="kd-label">实际开始时间</text>
+						<text class="kd-content">{{ worksheetInfo.acceptTime }}</text>
+					</view>
+					<view class="kd-cell">
+						<text class="kd-label">实际完成时间</text>
+						<text class="kd-content">{{ worksheetInfo.finishTime }}</text>
+					</view>
+
+					<!-- <u-button type="primary" size="large" text="开始执行"></u-button> -->
+					<template v-if="worksheetInfo.status">
+						<template v-if="worksheetInfo.status.code === 0">
+							<button class="btn-execute" type="primary" @click="handleExecute">开始执行</button>
+							<div class="apply-box">
+								<!-- <button
+                  class="btn-reassignment"
+                  type="primary"
+                  @click="sparepartApply"
+                >
+                  申请备品备件
+                </button> -->
+							</div>
+						</template>
+						<template v-else-if="worksheetInfo.status.code === 1">
+							<button class="btn-execute" type="primary" @click="handleReport">报工</button>
+						</template>
+						<button v-else-if="worksheetInfo.status.code === 3" :disabled="true" class="btn-execute" type="primary">已报工</button>
+						<div class="apply-box">
+							<button v-if="worksheetInfo.status.code !== 3" class="btn-reassignment" type="primary" @click="sparepartApply">申请备品备件</button>
+							<button v-if="worksheetInfo.status.code === 0" class="btn-reassignment" type="primary" @click="handleAssign">转派</button>
+						</div>
+					</template>
+				</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>
+					<view class="kd-list-container">
+						<u-list @scrolltolower="scrolltolower">
+							<u-list-item v-for="(item, index) in euqiList" :key="index">
+								<view class="kd-card">
+									<view class="kd-card-wrapper">
+										<view class="kd-cell">
+											<text class="kd-label">设备编码</text>
+											<text class="kd-content">{{ item.equiCode }}</text>
+										</view>
+										<view class="kd-cell">
+											<text class="kd-label">设备名称</text>
+											<text class="kd-content">{{ item.equiName }}</text>
+										</view>
+										<view class="kd-cell">
+											<text class="kd-label">设备型号</text>
+											<text class="kd-content">{{ item.equiModel }}</text>
+										</view>
+										<view class="kd-cell">
+											<text class="kd-label">设备位置</text>
+											<text class="kd-content">{{ item.equiLocation }}</text>
+										</view>
+										<view class="kd-cell">
+											<text class="kd-label">执行结果</text>
+
+											<text class="kd-content">
+												<text class="status-box text-warning" v-if="item.resultStatus === 0">待保养</text>
+												<text class="status-box text-primary" v-else-if="item.resultStatus === 1">完成保养</text>
+												<text class="status-box text-danger" v-else-if="item.resultStatus === 2">缺陷</text>
+												<text class="status-box text-primary" v-else-if="item.resultStatus === 3">已报修</text>
+											</text>
+										</view>
+									</view>
+									<view class="card-footer">
+										<button type="primary" class="primary-btn" @click="handleCheck(item)" v-if="worksheetInfo.status && worksheetInfo.status.code === 1">执行</button>
+										<template v-if="worksheetInfo.status && worksheetInfo.status.code === 3">
+											<button type="default" v-if="item.resultStatus === 2" @click="handLbx(item)">报修</button>
+											<button type="default" v-else-if="item.resultStatus === 3" @click="handLbxDetail(item)">报修详情</button>
+										</template>
+										<button type="default" v-if="[0, 3].includes(worksheetInfo.status && worksheetInfo.status.code)" @click="checkDetail(item)">保养详情</button>
+									</view>
+								</view>
+							</u-list-item>
+						</u-list>
+					</view>
+				</view>
+			</view>
+		</view>
+		<uni-popup ref="inputDialog" type="dialog">
+			<uni-popup-dialog
+				ref="inputClose"
+				mode="input"
+				title="您当前已超出计划完成时间,请填写原因"
+				placeholder="请输入内容"
+				:before-close="true"
+				@close="handleClose"
+				@confirm="timeoutCauseConfirm"></uni-popup-dialog>
+		</uni-popup>
+		<u-modal :show="modalShow" title="提示" @confirm="modalShow = false">
+			<view>
+				您还有
+				<text class="text-warning">{{ worksheetInfo.awaitInspectSum }}</text>
+				台设备待检,不可报工
+			</view>
+		</u-modal>
+		<Assign ref="assignRef" @success="assignSuccess" />
+
+		<!-- <ScanCode @scancodedate="scancodedate" :model="'uni'"></ScanCode> -->
+	</view>
+</template>
+
+<script>
+	import { get, post, postJ } from '@/utils/api.js'
+	import Assign from '@/components/Assign.vue'
+	import CellInfo from '@/components/CellInfo.vue'
+	import KdTabs from '@/components/KdTabs.vue'
+	import dayjs from 'dayjs'
+	import ScanCode from '@/components/ScanCode.vue'
+	export default {
+		components: {
+			CellInfo,
+			KdTabs,
+			Assign,
+			ScanCode
+		},
+		data() {
+			return {
+				modalShow: false,
+				active: 0,
+				typeActive: 0,
+				statusList: {
+					0: '待接收',
+					1: '执行中',
+					3: '已完成'
+				},
+				pageId: '',
+				workOrderCode: '',
+				worksheetInfo: {
+					equiList: [],
+					workOrder: {}
+				},
+				equpStatus: [
+					// {
+					//   name: '全部',
+					//   value: []
+					// },
+					{
+						name: '待执行',
+						value: [0]
+					},
+					{
+						name: '已执行',
+						value: [1, 2, 3]
+					},
+					{
+						name: '缺陷',
+						value: [2]
+					},
+					{
+						name: '全部',
+						value: []
+					}
+				],
+				euqiList: [],
+				equipPage: 1,
+				isEnd: false,
+				barType: 0,
+				qrContent: null
+			}
+		},
+		async onLoad(options) {
+			this.workOrderCode = options.workOrderCode
+			this.pageId = options.id
+			// 设备台账跳转详情
+			if (options.qrContent) {
+				this.qrContent = options.qrContent
+				await this.getInfo()
+				this.cbScancodedate({ code: this.qrContent })
+			}
+		},
+		onShow() {
+			this.getInfo()
+			this.typeChange(0)
+			let _this = this
+			uni.$off('scancodedate') // 每次进来先 移除全局自定义事件监听器
+			uni.$on('scancodedate', function (data) {
+				_this.cbScancodedate(data)
+			})
+		},
+		onHide() {
+			uni.$off('scancodedate')
+		},
+		onUnload() {
+			uni.$off('scancodedate')
+		},
+		methods: {
+			// 扫码枪扫码
+			cbScancodedate(data) {
+				this.Scancodedate(data.code)
+			},
+			// 相机扫码
+			HandlScanCode() {
+				let _this = this
+				uni.scanCode({
+					onlyFromCamera: true,
+					success: function (res) {
+						_this.Scancodedate(res.result)
+					}
+				})
+			},
+			Scancodedate(code) {
+				let _this = this
+				if (this.worksheetInfo.status.code === 0) {
+					uni.showModal({
+						title: '提示',
+						content: '工单未开启执行,不可进行保养操作,请先点击“开始执行”!',
+						confirmText: '开始执行', //这块是确定按钮的文字
+						cancelText: '取消', //这块是取消的文字
+						success: function (res) {
+							if (res.confirm) {
+								_this.handleExecute() // 执行确认后的操作
+							} else {
+								// 执行取消后的操作
+							}
+						}
+					})
+					return
+				}
+				this.qrContent = code.trim()
+				this.barType = this.setBarType(this.qrContent)
+				_this.getData()
+			},
+			// 设置barType
+			setBarType(val) {
+				let index = val.indexOf('@_@')
+				let result = 0
+				if (index !== -1) {
+					let item = val.substr(index + 3, 1)
+					if (item) {
+						result = Number(item)
+					}
+				}
+				return result
+			},
+			// 根据条码请求设备数据
+			getData() {
+				let par = {
+					barType: this.barType,
+					qrContent: this.qrContent
+				}
+				uni.showLoading({
+					title: '加载中',
+					mask: true
+				})
+				postJ(this.apiUrl + '/scan/getAssetInfo', par)
+					.then(res => {
+						console.log('扫码接口返回', res)
+						let data = res.data
+						this.matchEquipment(data)
+					})
+					.finally(() => {
+						uni.hideLoading()
+					})
+			},
+
+			matchEquipment(data) {
+				let par = {
+					assetCode: data.assetCode,
+					workOrderId: this.worksheetInfo.id
+				}
+				console.log('par', par)
+				post(this.apiUrl + '/workOrder/scanMatching', par).then(res => {
+					let data = res.data
+					if (!data) {
+						uni.showModal({
+							title: '提示',
+							content: '本工单中,无此设备!',
+							confirmText: '好的', //这块是确定按钮的文字
+							showCancel: false,
+							success: function (res) {
+								if (res.confirm) {
+									// 执行确认后的操作
+								} else {
+									// 执行取消后的操作
+								}
+							}
+						})
+					} else {
+						// 未报工
+						if (this.worksheetInfo.status.code === 1) {
+							this.handleCheck(data)
+						}
+						// 已报工
+						if (this.worksheetInfo.status.code === 3) {
+							this.checkDetail(data)
+						}
+					}
+				})
+			},
+
+			back() {
+				uni.navigateBack({
+					delta: 1
+				})
+			},
+			handleAssign() {
+				this.$refs.assignRef.open(this.pageId)
+			},
+			assignSuccess() {
+				this.back()
+			},
+			finishTime(start, end) {
+				if (!end) return ''
+				let dur = new Date(end).getTime() - new Date(start).getTime()
+				return Math.ceil(dur / 1000 / 60) + '分钟'
+			},
+			// 申请备品备件
+			sparepartApply() {
+				uni.navigateTo({
+					url: `/pages/maintenance/sparepart/sparepart?planCode=${this.worksheetInfo.planCode}&sourceId=${this.worksheetInfo.id}&sourceCode=${this.worksheetInfo.workOrderCode}`
+				})
+			},
+			// 申请备品备件详情
+			sparepartDetail() {
+				uni.navigateTo({
+					url: `/pages/maintenance/sparepart/sparepartDetail?applyOrder=${this.worksheetInfo.applyOrder}`
+				})
+			},
+			// 报工
+			handleReport() {
+				// if (
+				//   new Date(this.worksheetInfo.planFinishTime).getTime() <
+				//   new Date().getTime()
+				// ) {
+				//   this.$refs.inputDialog.open()
+				//   return
+				// }
+				this._report()
+			},
+			handleClose() {
+				this.$refs.inputDialog.close()
+			},
+			timeoutCauseConfirm(value) {
+				if (!value) {
+					uni.showToast({
+						title: '请输入超时原因',
+						icon: 'none'
+					})
+					return
+				}
+				this.$refs.inputDialog.close()
+				this._report(value)
+			},
+			_report(timeoutCause = '') {
+				post(
+					this.apiUrl + '/workOrder/reportWork',
+					{
+						workOrderId: this.pageId,
+						timeoutCause
+					},
+					true,
+					false
+				)
+					.then(res => {
+						let _this = this
+						if (res?.success) {
+							let data = res.data
+							if (data.length) {
+								uni.showModal({
+									title: '提示',
+									content: `有${data.length}台设备被标记为缺陷,是否要报修?`,
+									cancelText: '取消', // 取消按钮的文字
+									confirmText: '报修', // 确认按钮的文字
+									showCancel: true, // 是否显示取消按钮,默认为 true
+									success: res => {
+										if (res.confirm) {
+											if (data.length > 1) {
+												uni.navigateTo({
+													url: `/pages/maintenance/detail/detail?workOrderCode=${this.workOrderCode}&id=${this.pageId}&chooseTab=true`
+												})
+											} else {
+												uni.navigateTo({
+													url: `/pages/repair/repair/index?source=5&workOrderCode=${this.workOrderCode}&equiCode=${data[0].equiCode}&equiId=${data[0].equiId}&workOrderId=${this.pageId}&equiName=${data[0].equiName}&equiModel=${data[0].equiModel}&equiLocation=${data[0].equiLocation}`
+												})
+											}
+										} else {
+											_this.getInfo()
+										}
+									}
+								})
+							} else {
+								uni.showToast({
+									icon: 'success',
+									title: '操作成功!',
+									duration: 2000
+								})
+								this.getInfo()
+							}
+						}
+					})
+					.catch(res => {
+						if (res.code === '4444') {
+							this.$refs.inputDialog.open()
+						} else if (res.code === '5555') {
+							this.modalShow = true
+							// uni.showModal({
+							//   title: '提示',
+							//   content: `您还有 ${this.worksheetInfo.awaitInspectSum} 台设备待检,不可报工`,
+							//   success: function (res) {},
+							//   showCancel: false
+							// })
+						}
+					})
+			},
+			// 执行工单
+			handleExecute() {
+				post(this.apiUrl + '/workOrder/execute', {
+					workOrderCode: this.workOrderCode
+				}).then(res => {
+					if (res?.success && res.data) {
+						uni.showToast({
+							icon: 'success',
+							title: '操作成功!',
+							duration: 2000
+						})
+						this.active = 1
+						this.getInfo()
+					}
+				})
+			},
+			//巡点检设备加载更多
+			scrolltolower() {
+				if (this.isEnd) return
+				this.equipPage++
+				this.getEquipList()
+			},
+			// 巡点检设备列表
+			getEquipList() {
+				const params = {
+					workOrderId: this.pageId,
+					resultStatus: this.equpStatus[this.typeActive].value
+				}
+
+				post(this.apiUrl + `/workOrder/getEquipmentListApp?page=${this.equipPage}&size=10`, params, true).then(res => {
+					if (res?.success) {
+						if (this.equipPage === 1) {
+							this.euqiList = res.data.records
+						} else {
+							this.euqiList.push(...res.data.records)
+						}
+
+						this.isEnd = this.euqiList.length >= res.data.total
+					}
+				})
+			},
+
+			handleTabChange(value) {
+				if (value === 1) {
+					this.typeChange(0)
+				}
+			},
+			// 设备状态切换
+			typeChange(type) {
+				this.typeActive = type
+				this.equipPage = 1
+				this.getEquipList()
+			},
+			handleCheck({ id, equiName, equiCode, sparePartsJson }) {
+				this.$store.commit('maintenance/SET_SPAREPARTSJSON', sparePartsJson)
+				uni.navigateTo({
+					url: `/pages/maintenance/check/index?workOrderId=${this.pageId}&id=${id}&equiName=${equiName}&equiCode=${equiCode}&applyOrder=${this.worksheetInfo.applyOrder}&workOrderCode=${this.worksheetInfo.workOrderCode}`
+				})
+			},
+			checkDetail({ id, equiName, equiCode, sparePartsJson }) {
+				this.$store.commit('maintenance/SET_SPAREPARTSJSON', sparePartsJson)
+				uni.navigateTo({
+					url: `/pages/maintenance/check/detail?workOrderId=${this.pageId}&id=${id}&equiName=${equiName}&equiCode=${equiCode}&applyOrder=${this.worksheetInfo.applyOrder}&workOrderCode=${this.worksheetInfo.workOrderCode}`
+				})
+			},
+			getInfo() {
+				post(this.apiUrl + '/workOrder/getDetailsApp', {
+					workOrderCode: this.workOrderCode
+				}).then(res => {
+					if (res?.success) {
+						this.worksheetInfo = res.data
+					}
+				})
+			},
+			// 报修
+			handLbx(item) {
+				uni.navigateTo({
+					url: `/pages/repair/repair/index?source=4&workOrderCode=${this.workOrderCode}&equiCode=${item.equiCode}&equiId=${item.equiId}&workOrderId=${this.pageId}&equiName=${item.equiName}&equiModel=${item.equiModel}&equiLocation=${item.equiLocation}`
+				})
+			},
+			// 报修详情
+			handLbxDetail(item) {
+				uni.navigateTo({
+					url: `/pages/repair/detail/detail?id=${item.repairId}`
+				})
+			}
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	@import '@/components/submitted.scss';
+
+	.list-cell {
+		display: flex;
+		align-items: center;
+		justify-content: space-between;
+		color: $uni-text-color-grey;
+		padding: 5rpx 20rpx;
+	}
+
+	.font-sm {
+		font-size: $uni-font-size-sm;
+	}
+
+	.font-text {
+		color: $uni-text-color;
+	}
+
+	.btn-execute {
+		background-color: $j-primary-border-green;
+		width: 450rpx;
+		margin-top: 10vh;
+	}
+
+	.btn-reassignment {
+		color: $uni-color-primary;
+		background-color: transparent;
+		border: none;
+		box-shadow: none;
+
+		&::after {
+			display: none;
+		}
+	}
+
+	.maintenance-container {
+		position: fixed;
+		top: 0;
+		bottom: 0;
+		width: 100vw;
+		display: flex;
+		flex-direction: column;
+		/deep/.u-popup {
+			flex: none !important;
+		}
+	}
+	.maintenance-wrapper {
+		position: relative;
+		flex: 1;
+	}
+	.maintenance-content {
+		padding-top: 40rpx;
+		box-sizing: border-box;
+		// height: calc(100vh - 88rpx);
+		position: absolute;
+		top: 0;
+		bottom: 0;
+		left: 0;
+		right: 0;
+		display: flex;
+		flex-direction: column;
+	}
+
+	.kd-cell {
+		line-height: 90rpx;
+		border-bottom: 1px dashed #dadada;
+		display: flex;
+		justify-content: space-between;
+		.kd-label {
+			display: inline-block;
+			width: 7em;
+			font-weight: bold;
+		}
+		.kd-content {
+			flex: 1;
+			text-align: left;
+			word-break: break-all;
+		}
+	}
+	.kd-baseInfo {
+		padding: 0 32rpx;
+		font-size: 28rpx;
+	}
+	.kd-equipment {
+		flex: 1;
+		display: flex;
+		flex-direction: column;
+		overflow: hidden;
+		.kd-type-box {
+			text-align: center;
+			padding: 26rpx 0;
+			text {
+				display: inline-block;
+				width: 120rpx;
+				padding: 4rpx 0;
+				color: #333;
+				margin: 0 8rpx;
+				&.type—active {
+					background-color: rgba(215, 215, 215, 1);
+				}
+			}
+		}
+		.kd-list-container {
+			flex: 1;
+			display: flex;
+			flex-direction: column;
+			overflow: hidden;
+			padding: 12rpx 18rpx;
+			background-color: $page-bg;
+
+			.u-list {
+				flex: 1;
+				height: 100% !important;
+			}
+		}
+	}
+
+	.kd-card {
+		background-color: #fff;
+		margin-bottom: 20rpx;
+		padding: 8rpx 0;
+		font-size: 28rpx;
+		word-break: break-all;
+		.kd-card-wrapper {
+			padding: 0 30rpx;
+			border-bottom: 1px solid #dadada;
+		}
+		.kd-cell {
+			line-height: 60rpx;
+		}
+		.kd-cell:last-of-type {
+			border-bottom: none;
+		}
+		.status-box {
+			margin-right: 16rpx;
+		}
+		.card-footer {
+			display: flex;
+			justify-content: flex-end;
+			align-items: center;
+			padding: 8rpx 0 20rpx;
+			button {
+				width: 180rpx;
+				height: 56rpx;
+				line-height: 56rpx;
+				font-size: 28rpx;
+				margin: 0 8rpx;
+			}
+			.primary-btn {
+				background-color: $j-primary-border-green;
+			}
+		}
+	}
+	.apply-box {
+		width: 70%;
+		margin: 0 auto;
+		display: flex;
+		align-items: center;
+		justify-content: space-around;
+	}
+</style>

+ 172 - 0
pages/quantity/check/components/CheckCard copy.vue

@@ -0,0 +1,172 @@
+<template>
+  <view class="kd-check-card">
+    <view class="title">
+      <text class="label">{{ index + 1 }}</text>
+      <text>{{ item.name }}</text>
+    </view>
+    <view class="card-cell">
+      <text class="label">内容</text>
+      <text class="cell-content">{{ item.content }}</text>
+    </view>
+    <view class="card-cell">
+      <text class="label">标准</text>
+      <text class="cell-content">{{ item.norm }}</text>
+    </view>
+    <view class="card-cell">
+      <text class="label">结果</text>
+      <view class="cell-content">
+        <view class="content-status" v-if="type == 'view'">
+          <!-- {{ item.isNormal?'正常':'缺陷' }} -->
+          <div v-if="item.isNormal" style="color: green">正常</div>
+          <div v-else-if="item.isNormal === 0" style="color: red">缺陷</div>
+        </view>
+        <textarea
+          v-if="type !== 'view'"
+          placeholder="请输入"
+          v-model="item.resultText"
+        />
+        <view class="result-text" v-else>{{ item.resultText }}</view>
+        <view class="radio-wrapper">
+          <div
+            v-for="(it, ind) in statusList"
+            :key="ind"
+            v-if="type !== 'view'"
+            class="wrapper-box"
+            @click="changeStatus(item, it)"
+            :style="
+              item.isNormal == it.isNormal && item.isNormal == 0
+                ? 'color:red;border: 1rpx solid red'
+                : item.isNormal == it.isNormal && item.isNormal == 1
+                ? 'color:green;border: 1rpx solid green'
+                : ''
+            "
+          >
+            {{ it.label }}
+          </div>
+          <!-- <u-radio-group
+            v-model="item.isNormal"
+            placement="row"
+            v-if="type !== 'view'"
+            :size="28"
+          >
+            <u-radio
+              :customStyle="{ marginRight: '20px' }"
+              :labelSize="30"
+              label="正常"
+              :name="1"
+            >
+            </u-radio>
+            <u-radio :customStyle="{}" :labelSize="30" label="缺陷" :name="0">
+            </u-radio>
+          </u-radio-group> -->
+          <!-- <view
+            :class="item.isNormal === 0 ? 'text-danger' : ''"
+            v-else
+            style="min-height: 1em"
+          >
+            {{ ['缺陷', '正常'][item.isNormal] }}
+          </view> -->
+        </view>
+      </view>
+    </view>
+  </view>
+</template>
+
+<script>
+export default {
+  props: {
+    item: {
+      type: Object,
+      default: () => ({})
+    },
+    index: Number,
+    type: {
+      type: String,
+      default: 'edit'
+    }
+  },
+  data () {
+    return {
+      statusList: [
+        { label: '正常', isNormal: 1 },
+        { label: '缺陷', isNormal: 0 }
+      ]
+    }
+  },
+  methods: {
+    changeStatus (item, it) {
+      item.isNormal = it.isNormal
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+$border-color: #f2f2f2;
+.kd-check-card {
+  font-size: 28rpx;
+  border: 1rpx solid $border-color;
+  .label {
+    display: inline-block;
+    width: 80rpx;
+    text-align: center;
+    border-right: 1px solid $border-color;
+    justify-content: center;
+  }
+  .title {
+    line-height: 72rpx;
+    font-weight: bold;
+    background-color: #f2f2f2;
+  }
+  .card-cell {
+    min-height: 72rpx;
+    display: flex;
+    align-items: stretch;
+    border: 1px solid $border-color;
+    text {
+      display: flex;
+      align-items: center;
+    }
+  }
+  .cell-content {
+    flex: 1;
+    .content-status {
+      width: 100%;
+      height: 50rpx;
+      line-height: 50rpx;
+      text-indent: 10rpx;
+      border-bottom: 1rpx solid #f2f2f2;
+    }
+  }
+  .radio-wrapper {
+    padding: 10rpx 20rpx;
+    border-bottom: 1px solid $border-color;
+    margin-left: -8rpx;
+  }
+  /deep/uni-textarea {
+    width: 100%;
+    box-sizing: border-box;
+  }
+  .result-text {
+    min-height: 100rpx;
+    padding: 10rpx;
+  }
+  .cell-content {
+    padding-left: 8rpx;
+  }
+  .radio-wrapper {
+    display: flex;
+    align-items: center;
+    justify-content: space-around;
+  }
+  .wrapper-box {
+    width: 45%;
+    height: 80rpx;
+    line-height: 80rpx;
+    text-align: center;
+    border: 1rpx solid #000;
+    color: #000;
+    border-radius: 15rpx;
+  }
+}
+</style>

+ 175 - 0
pages/quantity/check/components/CheckCard.vue

@@ -0,0 +1,175 @@
+<template>
+	<view class="kd-check-card">
+		<view class="title">
+			<text class="label">{{ index + 1 }}</text>
+			<text>{{ item.name }}</text>
+		</view>
+		<view class="card-cell">
+			<text class="label">内容</text>
+			<text class="cell-content">{{ item.content }}</text>
+		</view>
+		<view class="card-cell">
+			<text class="label">标准</text>
+			<text class="cell-content">{{ item.norm }}</text>
+		</view>
+		<view class="card-cell">
+			<text class="label">工具</text>
+			<view class="cell-content" v-if="item.operationGuide && item.operationGuide.toolList.length > 0">
+				<view v-for="(item, index) in item.operationGuide.toolList">{{ index + 1 }}、{{ item.categoryLevelName }}</view>
+			</view>
+			<view class="cell-content" v-else>无</view>
+		</view>
+		<view class="card-cell">
+			<text class="label">指导</text>
+			<view class="cell-content" v-if="item.operationGuide && item.operationGuide.procedureList.length > 0">
+				<view v-for="(item, index) in item.operationGuide.procedureList">{{ index + 1 }}、{{ item.content }}</view>
+			</view>
+			<view class="cell-content" v-else>无</view>
+		</view>
+		<view class="card-cell">
+			<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>
+				</view>
+				<textarea v-if="type !== 'view'" placeholder="请输入" v-model="item.result" />
+				<view class="result-text" v-else>{{ item.result }}</view>
+				<view class="radio-wrapper">
+					<div
+						v-for="(it, ind) in statusList"
+						:key="ind"
+						v-if="type !== 'view'"
+						class="wrapper-box"
+						@click="changeStatus(item, it)"
+						:style="item.status == it.status && item.status == -1 ? 'color:red;border: 1rpx solid red' : item.status == it.status && item.status == 0 ? 'color:green;border: 1rpx solid green' : ''">
+						{{ it.label }}
+					</div>
+					<!-- <u-radio-group
+            v-model="item.executeStatus"
+            placement="row"
+            v-if="type !== 'view'"
+            :size="28"
+          >
+            <u-radio
+              :customStyle="{ marginRight: '20px' }"
+              :labelSize="30"
+              label="正常"
+              :name="1"
+            >
+            </u-radio>
+            <u-radio :customStyle="{}" :labelSize="30" label="缺陷" :name="0">
+            </u-radio>
+          </u-radio-group> -->
+					<!-- <view
+            :class="item.executeStatus === 0 ? 'text-danger' : ''"
+            v-else
+            style="min-height: 1em"
+          >
+            {{ ['缺陷', '正常'][item.executeStatus] }}
+          </view> -->
+				</view>
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	export default {
+		props: {
+			item: {
+				type: Object,
+				default: () => ({})
+			},
+			index: Number,
+			type: {
+				type: String,
+				default: 'edit'
+			}
+		},
+		data() {
+			return {
+				statusList: [
+					{ label: '正常', status: 0 },
+					{ label: '缺陷', status: -1 }
+				]
+			}
+		},
+		methods: {
+			changeStatus(item, it) {
+				item.status = it.status
+			}
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	$border-color: #f2f2f2;
+	.kd-check-card {
+		font-size: 28rpx;
+		border: 1rpx solid $border-color;
+		.label {
+			display: inline-block;
+			width: 80rpx;
+			text-align: center;
+			border-right: 1px solid $border-color;
+			justify-content: center;
+		}
+		.title {
+			line-height: 72rpx;
+			font-weight: bold;
+			background-color: #f2f2f2;
+		}
+		.card-cell {
+			min-height: 72rpx;
+			display: flex;
+			align-items: stretch;
+			border: 1px solid $border-color;
+			text {
+				display: flex;
+				align-items: center;
+			}
+		}
+		.cell-content {
+			flex: 1;
+			.content-status {
+				width: 100%;
+				height: 50rpx;
+				line-height: 50rpx;
+				text-indent: 10rpx;
+				border-bottom: 1rpx solid #f2f2f2;
+			}
+		}
+		.radio-wrapper {
+			padding: 10rpx 20rpx;
+			border-bottom: 1px solid $border-color;
+			margin-left: -8rpx;
+		}
+		/deep/uni-textarea {
+			width: 100%;
+			box-sizing: border-box;
+		}
+		.result-text {
+			min-height: 100rpx;
+			padding: 10rpx;
+		}
+		.cell-content {
+			padding-left: 8rpx;
+		}
+		.radio-wrapper {
+			display: flex;
+			align-items: center;
+			justify-content: space-around;
+		}
+		.wrapper-box {
+			width: 45%;
+			height: 80rpx;
+			line-height: 80rpx;
+			text-align: center;
+			border: 1rpx solid #000;
+			color: #000;
+			border-radius: 15rpx;
+		}
+	}
+</style>

+ 119 - 0
pages/quantity/check/detail.vue

@@ -0,0 +1,119 @@
+<template>
+	<view>
+		<uni-nav-bar fixed="true" statusBar="true" left-icon="back" title="检查详情" @clickLeft="back"></uni-nav-bar>
+		<view class="check-content">
+			<view class="title">
+				{{ equiName }}
+				<text>{{ equiCode }}</text>
+			</view>
+			<view class="check-list">
+				<CheckCard v-for="(item, index) in equipList" :item="item" class="mb20" :index="index" type="view"></CheckCard>
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	import { getDeviceInfo, mattersChecked } from '@/api/myTicket/index.js'
+	import { post } from '@/utils/api.js'
+	import CheckCard from './components/CheckCard.vue'
+	export default {
+		components: { CheckCard },
+		data() {
+			return {
+				id: '',
+				pageId: '',
+				page: 1,
+				equipList: [],
+				isEnd: false,
+				equiName: '',
+				equiCode: '',
+				workOrderId: ''
+			}
+		},
+		onLoad(options) {
+			this.id = options.id
+			// this.equiName = options.equiName
+			// this.equiCode = options.equiCode
+			// this.workOrderId = +options.workOrderId
+			this.getList()
+		},
+		onReachBottom() {
+			if (this.isEnd) return
+			this.page++
+			this.getList()
+		},
+		methods: {
+			getList() {
+				getDeviceInfo({ id: this.id }).then(data => {
+					this.equiName = data.name
+					this.equiCode = data.code
+					this.equipList = data.workItems.map(item => {
+						return {
+							...item,
+							id: data.id,
+							executeStatus: 1
+						}
+					})
+				})
+				// const { page } = this
+				// post(
+				//   this.apiUrl +
+				//     `/workOrder/getEquipmentItemsListApp?size=10&page=${page}`,
+				//   { planEquiId: +this.pageId, workOrderId: this.workOrderId },
+				//   true
+				// ).then(res => {
+				//   if (res?.success) {
+				//     if (page === 1) {
+				//       this.equipList = res.data.records
+				//     } else {
+				//       this.equipList.push(...res.data.records)
+				//     }
+
+				//     this.isEnd = this.equipList.length >= res.data.total
+				//   }
+				// })
+			}
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	.check-content {
+		box-sizing: border-box;
+		// height: calc(100vh - 88rpx);
+		display: flex;
+		flex-direction: column;
+		.title {
+			line-height: 80rpx;
+			display: flex;
+			justify-content: space-between;
+			padding: 0 30rpx;
+		}
+		.check-list {
+			flex: 1;
+			overflow: auto;
+			padding: 0 30rpx 30rpx;
+		}
+		.footer {
+			height: 100rpx;
+			display: flex;
+			border: 1rpx solid $j-primary-border-green;
+			.btn {
+				display: flex;
+				flex: 1;
+				justify-content: center;
+				align-items: center;
+				border-radius: 0;
+				&.primary {
+					background-color: $j-primary-border-green;
+					color: #fff;
+				}
+			}
+		}
+
+		.mb20 {
+			margin-bottom: 20rpx;
+		}
+	}
+</style>

+ 273 - 0
pages/quantity/check/index.vue

@@ -0,0 +1,273 @@
+<template>
+	<view>
+		<uni-nav-bar fixed="true" statusBar="true" left-icon="back" title="检查中" @clickLeft="back"></uni-nav-bar>
+		<view class="check-content">
+			<view class="title">
+				{{ equiName }}
+				<text>{{ equiCode }}</text>
+			</view>
+			<view class="check-list">
+				<CheckCard v-for="(item, index) in equipList" :item="item" class="mb20" :index="index"></CheckCard>
+			</view>
+			<view class="footer">
+				<view class="btn" @click="back">返回</view>
+				<view class="btn primary" @click="handleSave">保存</view>
+			</view>
+		</view>
+
+		<uni-popup ref="inputDialog" type="dialog">
+			<uni-popup-dialog
+				ref="inputClose"
+				mode="input"
+				title="您当前已超出计划完成时间,请填写原因"
+				placeholder="请输入内容"
+				:before-close="true"
+				@close="handleClose"
+				@confirm="timeoutCauseConfirm"></uni-popup-dialog>
+		</uni-popup>
+	</view>
+</template>
+
+<script>
+	import { getDeviceInfo, mattersChecked } from '@/api/myTicket/index.js'
+	import { post, postJ } from '@/utils/api.js'
+	import CheckCard from './components/CheckCard.vue'
+	export default {
+		components: { CheckCard },
+		data() {
+			return {
+				id: '',
+				pageId: '',
+				page: 1,
+				equipList: [],
+				isEnd: false,
+				equiName: '',
+				equiCode: '',
+				workOrderId: '',
+				workOrderCode: ''
+			}
+		},
+		onLoad(options) {
+			this.id = options.id
+			//   this.pageId = options.id
+			//   this.equiName = options.equiName
+			//   this.equiCode = options.equiCode
+			//   this.workOrderId = +options.workOrderId
+			// this.workOrderCode = options.workOrderCode
+			this.getList()
+		},
+		// onReachBottom() {
+		// 	if (this.isEnd) return
+		// 	this.page++
+		// 	this.getList()
+		// },
+		methods: {
+			back() {
+				uni.navigateBack({
+					delta: 1
+				})
+			},
+			handleSave() {
+				console.log(this.equipList)
+				let isAllPass = true
+				isAllPass = this.equipList.every(item => item.status > -1)
+				let params = {
+					id: this.equipList[0].id,
+					executeStatus: isAllPass ? 1 : 2,
+					workItems: this.equipList.map(item => {
+						return {
+							content: item.content,
+							name: item.name,
+							norm: item.norm,
+							operationGuide: item.operationGuide,
+							result: item.result,
+							serialNum: item.serialNum,
+							status: item.status
+						}
+					})
+				}
+				mattersChecked(params).then(data => {
+					uni.showToast({
+						duration: 2000,
+						title: '保存成功!'
+					})
+					this.back()
+				})
+				// let _this = this
+				// const params = {
+				// 	itemList: this.equipList,
+				// 	planEquiId: this.pageId,
+				// 	workOrderId: +this.workOrderId,
+				// 	workOrderType: 1
+				// }
+				// postJ(this.apiUrl + `/workOrder/itemsInspect`, params, true).then(res => {
+				// 	if (res?.success) {
+				// 		if (res.data) {
+				// 			uni.showModal({
+				// 				title: '提示',
+				// 				content: '所有设备已执行完,是否报工?',
+				// 				cancelText: '取消', // 取消按钮的文字
+				// 				confirmText: '报工', // 确认按钮的文字
+				// 				showCancel: true, // 是否显示取消按钮,默认为 true
+				// 				success: res => {
+				// 					if (res.confirm) {
+				// 						_this._report()
+				// 					} else {
+				// 						_this.back()
+				// 					}
+				// 				}
+				// 			})
+				// 		} else {
+				// 			uni.showToast({
+				// 				duration: 2000,
+				// 				title: '保存成功!'
+				// 			})
+				// 			this.back()
+				// 		}
+				// 	}
+				// })
+			},
+
+			handleClose() {
+				this.$refs.inputDialog.close()
+			},
+			timeoutCauseConfirm(value) {
+				if (!value) {
+					uni.showToast({
+						title: '请输入超时原因',
+						icon: 'none'
+					})
+					return
+				}
+				this.$refs.inputDialog.close()
+				this._report(value)
+			},
+			_report(timeoutCause = '') {
+				let _this = this
+				post(
+					this.apiUrl + '/workOrder/reportWork',
+					{
+						workOrderId: this.workOrderId,
+						timeoutCause
+					},
+					true,
+					false
+				)
+					.then(res => {
+						if (res?.success) {
+							let data = res.data
+							if (data.length) {
+								uni.showModal({
+									title: '提示',
+									content: `有${data.length}台设备被标记为缺陷,是否要报修?`,
+									cancelText: '取消', // 取消按钮的文字
+									confirmText: '报修', // 确认按钮的文字
+									showCancel: true, // 是否显示取消按钮,默认为 true
+									success: res => {
+										if (res.confirm) {
+											if (data.length > 1) {
+												uni.navigateTo({
+													url: `/pages/tour_tally/detail/detail?workOrderCode=${this.workOrderCode}&id=${this.workOrderId}&chooseTab=true`
+												})
+											} else {
+												uni.navigateTo({
+													url: `/pages/repair/repair/index?source=5&workOrderCode=${this.workOrderCode}&equiCode=${data[0].equiCode}&equiId=${data[0].equiId}&workOrderId=${this.pageId}&equiName=${data[0].equiName}&equiModel=${data[0].equiModel}&equiLocation=${data[0].equiLocation}`
+												})
+											}
+										} else {
+											_this.back()
+										}
+									}
+								})
+							} else {
+								uni.showToast({
+									icon: 'success',
+									title: '操作成功!',
+									duration: 2000
+								})
+								_this.back()
+							}
+						}
+					})
+					.catch(res => {
+						if (res.code === '4444') {
+							this.$refs.inputDialog.open()
+						}
+					})
+			},
+			getList() {
+				getDeviceInfo({ id: this.id }).then(data => {
+					this.equiName = data.name
+					this.equiCode = data.code
+					this.equipList = data.workItems.map(item => {
+						return {
+							...item,
+							id: data.id,
+							executeStatus: 1
+						}
+					})
+				})
+				// const { page } = this
+				// post(this.apiUrl + `/workOrder/getEquipmentItemsListApp?size=10&page=${page}`, { planEquiId: +this.pageId, workOrderId: this.workOrderId }, true).then(res => {
+				// 	if (res?.success) {
+				// 		res.data.records.forEach(item => {
+				// 			item.isNormal = item.isNormal === null || item.isNormal === undefined ? 1 : item.isNormal
+				// 		})
+				// 		if (page === 1) {
+				// 			this.equipList = res.data.records
+				// 		} else {
+				// 			this.equipList.push(...res.data.records)
+				// 		}
+
+				// 		this.isEnd = this.equipList.length >= res.data.total
+				// 	}
+				// })
+			}
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	.check-content {
+		box-sizing: border-box;
+		// height: calc(100vh - 88rpx);
+		display: flex;
+		flex-direction: column;
+		padding-bottom: 100rpx;
+		.title {
+			line-height: 80rpx;
+			display: flex;
+			justify-content: space-between;
+			padding: 0 30rpx;
+		}
+		.check-list {
+			flex: 1;
+			overflow: auto;
+			padding: 0 30rpx 30rpx;
+		}
+		.footer {
+			height: 100rpx;
+			display: flex;
+			border: 1rpx solid $j-primary-border-green;
+			position: fixed;
+			bottom: 0;
+			width: 100vw;
+			background: #fff;
+			.btn {
+				display: flex;
+				flex: 1;
+				justify-content: center;
+				align-items: center;
+				border-radius: 0;
+				&.primary {
+					background-color: $j-primary-border-green;
+					color: #fff;
+				}
+			}
+		}
+
+		.mb20 {
+			margin-bottom: 20rpx;
+		}
+	}
+</style>

+ 216 - 0
pages/quantity/detail/detail - 副本.vue

@@ -0,0 +1,216 @@
+<template>
+	<view>
+		<uni-nav-bar fixed="true" statusBar="true" left-icon="back" title="巡点检工单详情" @clickLeft="back">
+			<!--  -->
+			<template slot="float" v-if="status!==2">
+				<view class="nav-icon-caozuo iconfont icon-caozuo" @click="setOptionShow"></view>
+			</template>
+		</uni-nav-bar>
+		<!-- 进度组件 根据状态显示不同列表  -->
+		<popupOper :optionShow="optionShow" @operate="operate" :operationList="operationList"></popupOper>
+		<view class="page-bottom-padding" v-if="worksheetInfo">
+			<uni-collapse ref="collapse">
+				<!-- <uni-collapse-item :open="(worksheetInfo && worksheetInfo.status.id == '99') ? false : true" -->
+				<uni-collapse-item :typeOpen="1" title="基本信息" open>
+					<view class="bg">
+						<DetailMain :detailsInfo="tourTallyDetailFn(worksheetInfo)"></DetailMain>
+					</view>
+				</uni-collapse-item>
+			</uni-collapse>
+			<!-- 巡检点设备 -->
+			<template>
+				<CellTip title="巡检点设备"> </CellTip>
+				<OrderDetail v-for="(item,idx) in worksheetInfo.equiList" :key="idx" :border="true"
+					:value1="'设备编码:'+item.equiCode" :value2="'设备型号:' + item.equiModel" :value3="'设备名称:'+item.equiName">
+					<template slot="custSlot">
+						<view class="" v-for="(el,idx) in item.ruleItems">
+							<view class="list-cell">
+								<text class="font-text">检测事项:{{el.itemName}}</text>
+
+							</view>
+							<view class="list-cell font-sm">
+								<text>检测标准:{{el.itemStandard}}</text>
+								<text>检测内容:{{el.itemContent}}</text>
+							</view>
+							<view class="list-cell font-sm">
+								<text>状态:{{el.status === null?'未处理':el.status===1?"正常":"缺陷"}}</text>
+							</view>
+						</view>
+					</template>
+				</OrderDetail>
+			</template>
+			<!-- 执行信息 -->
+			<!-- <template v-if="worksheetInfo && worksheetInfo.status.id == '99'"> -->
+			<template>
+				<CellTip title="执行信息"> </CellTip>
+				<CellInfo label="报工结果" :value="statusList[worksheetInfo.workOrder.status]"></CellInfo>
+				<CellInfo label="实际开始时间" :value="worksheetInfo.workOrder.startTime"></CellInfo>
+				<CellInfo label="实际结束时间" :value="worksheetInfo.workOrder.endTime"></CellInfo>
+			</template>
+			<!-- 执行处理结果 -->
+			<!--<template v-if="worksheetInfo && worksheetInfo.status.id == '99'">
+				<CellTip title="执行处理结果"> </CellTip>
+				<uni-collapse ref="collapse" v-for="item in worksheetInfo.details" :key="'zxcl'+item.id">
+					<uni-collapse-item :open="false" :typeOpen="false" titleStyle="background-color: #ffffff">
+						<OrderDetail slot="typeOpenShow" :value1="item.name" :value2="item.spec"
+							:value3="'通用设备-' + item.name" :value4="item.code" :value5="item.address"
+							:value6="'x' + (item.num || 1)">
+						</OrderDetail>
+						<view class="content-status" @click.stop>
+							<view class="cell-box border-bottom" v-for="(items,indexs) in item.contentDetails"
+								:key="indexs" @click="goDetail(items.id, items.status)">
+								<view class="cell">
+									{{items.content}}
+								</view>
+								<view class="cell">
+									检测内容:{{items.kpi}}
+								</view>
+								<view class="cell">
+									检测标准:{{items.paramRange}}
+								</view>
+								<view class="btn  cell-box-right"
+									:class="items.status.id == '1' ? 'btn-primary' : 'btn-warning'">
+									{{items.status.name}}
+								</view>
+							</view>
+						</view>
+					</uni-collapse-item>
+				</uni-collapse>
+			</template> -->
+
+		</view>
+	</view>
+</template>
+
+<script>
+	import {
+		get,
+		postJ
+	} from "@/utils/api.js"
+	import {
+		tourTallyDetailFn
+	} from '@/utils/common.js'
+	import DetailMain from '@/components/DetailMain.vue'
+	import CellTip from '@/components/CellTip.vue'
+	import CellInfo from '@/components/CellInfo.vue'
+	import OrderDetail from '../components/OrderDetail.vue'
+	import popupOper from '@/components/PopupOper.vue'
+	export default {
+		components: {
+			DetailMain,
+			popupOper,
+			OrderDetail,
+			CellTip,
+			CellInfo
+		},
+		data() {
+			return {
+				statusList: {
+					0: "待接收",
+					1: "执行中",
+					3: "已完成",
+				},
+				pageId: "",
+				worksheetInfo: {
+					equiList:[],
+					workOrder:{}
+				},
+				tourTallyDetailFn,
+				optionShow: false,
+				status: "",
+				operationList: [{
+					title: '执行',
+					class: 'iconfont icon-zhuanpai',
+					type: 1
+				}],
+			}
+		},
+		onLoad(options) {
+			this.pageId = options.id;
+			this.getInfo();
+		},
+		onShow() {
+			this.optionShow = false;
+			if (this.worksheetInfo) {
+				this.getInfo();
+			}
+		},
+		methods: {
+
+			getInfo() {
+				get(this.apiUrl + "/patrol/order/getDetail/" + this.pageId).then(res => {
+					if(res?.success){
+						this.worksheetInfo = res.data;
+						let status = res.data.workOrder.status;
+						this.status = status
+						//只有已指派和暂停可以转派
+						if (status === 0) {
+							this.operationList = [{
+								title: '受理',
+								class: 'iconfont icon-zhuanpai',
+								type: 3
+							}, {
+								title: '转派',
+								class: 'iconfont icon-zhuanpai',
+								type: 2
+							}]
+						} else if (status == 2) {
+							this.operationList = []
+						}
+					}
+				});
+			},
+			//选择对应的操作
+			operate(type) {
+				if (type === 2) { //转派
+					uni.navigateTo({
+						url: "../turn_send/turn_send?id=" + this.pageId
+					})
+				} else if (type === 1) { //报工
+					uni.navigateTo({
+						url: "../submitted_ministry/submitted_ministry?id=" + this.pageId
+					})
+
+				} else if (type === 3) {
+
+					uni.navigateTo({
+						url: "../accept/index?id=" + this.pageId
+					})
+				}
+			},
+			//点击显示弹窗
+			setOptionShow() {
+				this.optionShow = !this.optionShow;
+			},
+			goDetail(id, status) {
+				//已报修
+				// if (status.id == '2') {
+				// 	uni.navigateTo({
+				// 		url: '../defects/defects?id=' + id + "&type=details" + "&parentsId=" + this.pageId
+				// 	})
+				// }
+			}
+
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	@import "@/components/submitted.scss";
+
+	.list-cell {
+		display: flex;
+		align-items: center;
+		justify-content: space-between;
+		color: $uni-text-color-grey;
+		padding: 5rpx 20rpx;
+	}
+
+	.font-sm {
+		font-size: $uni-font-size-sm;
+	}
+
+	.font-text {
+		color: $uni-text-color;
+	}
+</style>

+ 806 - 0
pages/quantity/detail/detail copy.vue

@@ -0,0 +1,806 @@
+<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>
+    <view class="tour-wrapper">
+      <view class="tour_tally-content">
+        <KdTabs
+          v-model="active"
+          @change="handleTabChange"
+          :list="['基本信息', '巡点检设备']"
+        />
+        <view class="kd-baseInfo" v-show="active === 0">
+          <view class="kd-cell">
+            <text class="kd-label">工单编号</text
+            >{{ worksheetInfo.workOrderCode }}
+          </view>
+          <view class="kd-cell">
+            <text class="kd-label">计划名称</text>
+            <text class="kd-content">{{ worksheetInfo.planName }}</text>
+          </view>
+          <!-- <view class="kd-cell">
+            <text class="kd-label">巡点检周期</text>
+            <text class="kd-content"
+              >{{ worksheetInfo.cycleValue
+              }}{{ cycleOptObj[worksheetInfo.cycleType] }}</text
+            >
+          </view> -->
+          <view class="kd-cell">
+            <text class="kd-label">设备分类</text>
+            <text class="kd-content">{{ worksheetInfo.equiTypeName }}</text>
+          </view>
+          <view class="kd-cell">
+            <text class="kd-label">巡检设备总数</text>
+            <text class="kd-content text-warning"
+              >{{
+                worksheetInfo.equipCount - worksheetInfo.awaitInspectSum || 0
+              }}/{{ worksheetInfo.equipCount }}</text
+            >
+          </view>
+          <view class="kd-cell">
+            <text class="kd-label">计划完成时长</text
+            >{{ worksheetInfo.duration }}分钟
+          </view>
+          <view class="kd-cell">
+            <text class="kd-label">实际完成时长</text
+            >{{
+              finishTime(worksheetInfo.acceptTime, worksheetInfo.finishTime)
+            }}
+          </view>
+          <view class="kd-cell">
+            <text class="kd-label">实际开始时间</text
+            >{{ worksheetInfo.acceptTime }}
+          </view>
+          <view class="kd-cell">
+            <text class="kd-label">实际完成时间</text
+            >{{ worksheetInfo.finishTime }}
+          </view>
+
+          <!-- <u-button type="primary" size="large" text="开始执行"></u-button> -->
+          <template v-if="worksheetInfo.status">
+            <template v-if="worksheetInfo.status.code === 0">
+              <button class="btn-execute" type="primary" @click="handleExecute">
+                开始执行
+              </button>
+              <button
+                class="btn-reassignment"
+                type="primary"
+                @click="handleAssign"
+              >
+                转派
+              </button>
+            </template>
+            <button
+              v-else-if="worksheetInfo.status.code === 1"
+              class="btn-execute"
+              type="primary"
+              @click="handleReport"
+            >
+              报工
+            </button>
+            <button
+              v-else-if="worksheetInfo.status.code === 3"
+              :disabled="true"
+              class="btn-execute"
+              type="primary"
+            >
+              已报工
+            </button>
+          </template>
+        </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>
+          <view class="kd-list-container">
+            <u-list @scrolltolower="scrolltolower">
+              <u-list-item v-for="(item, index) in euqiList" :key="index">
+                <view class="kd-card">
+                  <view class="kd-card-wrapper">
+                    <view class="kd-cell">
+                      <text class="kd-label">设备编码</text>{{ item.equiCode }}
+                    </view>
+                    <view class="kd-cell">
+                      <text class="kd-label">设备名称</text>{{ item.equiName }}
+                    </view>
+                    <view class="kd-cell">
+                      <text class="kd-label">设备型号</text>{{ item.equiModel }}
+                    </view>
+                    <view class="kd-cell">
+                      <text class="kd-label">设备位置</text
+                      >{{ item.equiLocation }}
+                    </view>
+                    <view class="kd-cell">
+                      <text class="kd-label">执行结果</text>
+                      <text
+                        class="status-box text-warning"
+                        v-if="item.resultStatus === 0"
+                        >待检</text
+                      >
+                      <text
+                        class="status-box text-primary"
+                        v-else-if="item.resultStatus === 1"
+                        >正常</text
+                      >
+                      <text
+                        class="status-box text-danger"
+                        v-else-if="item.resultStatus === 2"
+                        >缺陷</text
+                      >
+                      <text
+                        class="status-box text-primary"
+                        v-else-if="item.resultStatus === 3"
+                        >已报修</text
+                      >
+                    </view>
+                  </view>
+                  <view class="card-footer">
+                    <button
+                      type="primary"
+                      class="primary-btn"
+                      @click="handleCheck(item)"
+                      v-if="
+                        worksheetInfo.status && worksheetInfo.status.code === 1
+                      "
+                    >
+                      检查
+                    </button>
+                    <template
+                      v-if="
+                        worksheetInfo.status && worksheetInfo.status.code === 3
+                      "
+                    >
+                      <button
+                        type="default"
+                        v-if="item.resultStatus === 3"
+                        @click="handLbxDetail(item)"
+                      >
+                        报修详情
+                      </button>
+                      <button
+                        type="default"
+                        v-else-if="item.resultStatus === 2"
+                        @click="handLbx(item)"
+                      >
+                        报修
+                      </button>
+                    </template>
+                    <button
+                      type="default"
+                      v-if="
+                        [0, 3].includes(
+                          worksheetInfo.status && worksheetInfo.status.code
+                        )
+                      "
+                      @click="checkDetail(item)"
+                    >
+                      检查详情
+                    </button>
+                  </view>
+                </view>
+              </u-list-item>
+            </u-list>
+          </view>
+        </view>
+      </view>
+      <uni-popup ref="inputDialog" type="dialog">
+        <uni-popup-dialog
+          ref="inputClose"
+          mode="input"
+          title="您当前已超出计划完成时间,请填写原因"
+          placeholder="请输入内容"
+          :before-close="true"
+          @close="handleClose"
+          @confirm="timeoutCauseConfirm"
+        ></uni-popup-dialog>
+      </uni-popup>
+    </view>
+    <u-modal :show="modalShow" title="提示" @confirm="modalShow = false">
+      <view
+        >您还有
+        <text class="text-warning">{{ worksheetInfo.awaitInspectSum }}</text>
+        台设备待检,不可报工
+      </view>
+    </u-modal>
+    <Assign ref="assignRef" @success="assignSuccess" />
+
+    <!-- <ScanCode @scancodedate="scancodedate"></ScanCode> -->
+  </view>
+</template>
+
+<script>
+import { get, post, postJ } from '@/utils/api.js'
+import Assign from '@/components/Assign.vue'
+import CellInfo from '@/components/CellInfo.vue'
+import KdTabs from '@/components/KdTabs.vue'
+import ScanCode from '@/components/ScanCode.vue'
+export default {
+  components: {
+    CellInfo,
+    KdTabs,
+    Assign,
+    ScanCode
+  },
+  data () {
+    return {
+      modalShow: false,
+      active: 0,
+      typeActive: 0,
+      statusList: {
+        0: '待接收',
+        1: '执行中',
+        3: '已完成'
+      },
+      pageId: '',
+      workOrderCode: '',
+      worksheetInfo: {
+        equiList: [],
+        workOrder: {}
+      },
+      equpStatus: [
+        // {
+        //   name: '全部',
+        //   value: []
+        // },
+        {
+          name: '待检',
+          value: [0]
+        },
+        {
+          name: '已检',
+          value: [1, 2, 3]
+        },
+        {
+          name: '缺陷',
+          value: [2]
+        },
+        {
+          name: '全部',
+          value: []
+        }
+      ],
+      euqiList: [],
+      equipPage: 1,
+      isEnd: false,
+      cycleOptObj: {
+        1: '时/次',
+        2: '天/次',
+        3: '周/次',
+        4: '月/次',
+        5: '年/次',
+        11: '次/天',
+        12: '次/周',
+        13: '次/月',
+        14: '次/年'
+      },
+      barType: 0,
+      qrContent: null,
+      chooseTab: false
+    }
+  },
+  async onLoad (options) {
+    console.log('options------------', options)
+    this.workOrderCode = options.workOrderCode
+    this.pageId = options.id
+    this.chooseTab = options.chooseTab
+    // 设备台账跳转详情
+    if (options.qrContent) {
+      this.qrContent = options.qrContent
+      await this.getInfo()
+      this.cbScancodedate({
+        code: this.qrContent
+      })
+    }
+  },
+  onShow () {
+    this.getInfo()
+    if (this.chooseTab) {
+      this.active = 1
+      this.typeChange(2)
+    } else {
+      this.typeChange(0)
+    }
+    let _this = this
+    uni.$off('scancodedate') // 每次进来先 移除全局自定义事件监听器
+    uni.$on('scancodedate', function (data) {
+      _this.cbScancodedate(data)
+    })
+  },
+  onUnload () {
+    uni.$off('scancodedate')
+  },
+  onHide () {
+    uni.$off('scancodedate')
+  },
+  methods: {
+    // 扫码枪扫码
+    cbScancodedate (data) {
+      this.Scancodedate(data.code)
+    },
+    // 相机扫码
+    HandlScanCode () {
+      let _this = this
+
+      uni.scanCode({
+        onlyFromCamera: true,
+        success: function (res) {
+          _this.Scancodedate(res.result)
+        }
+      })
+    },
+    Scancodedate (code) {
+      let _this = this
+      if (this.worksheetInfo.status.code === 0) {
+        uni.showModal({
+          title: '提示',
+          content: '工单未开启执行,不可进行巡点检操作,请先点击“开始执行”!',
+          confirmText: '开始执行', //这块是确定按钮的文字
+          cancelText: '取消', //这块是取消的文字
+          success: function (res) {
+            if (res.confirm) {
+              _this.handleExecute() // 执行确认后的操作
+            } else {
+              // 执行取消后的操作
+            }
+          }
+        })
+        return
+      }
+      this.qrContent = code.trim()
+      this.barType = this.setBarType(this.qrContent)
+      _this.getData()
+    },
+    // 设置barType
+    setBarType (val) {
+      let index = val.indexOf('@_@')
+      let result = 0
+      if (index !== -1) {
+        let item = val.substr(index + 3, 1)
+        if (item) {
+          result = Number(item)
+        }
+      }
+      return result
+    },
+    // 根据条码请求设备数据
+    getData () {
+      let par = {
+        barType: this.barType,
+        qrContent: this.qrContent
+      }
+      uni.showLoading({
+        title: '加载中',
+        mask: true
+      })
+      getWorkOrderDetail()
+      postJ(this.apiUrl + '/scan/getAssetInfo', par)
+        .then(res => {
+          let data = res.data
+          this.matchEquipment(data)
+        })
+        .finally(() => {
+          uni.hideLoading()
+        })
+    },
+
+    matchEquipment (data) {
+      let par = {
+        assetCode: data.assetCode,
+        workOrderId: this.worksheetInfo.id
+      }
+      console.log('par', par)
+      post(this.apiUrl + '/workOrder/scanMatching', par).then(res => {
+        let data = res.data
+        if (!data) {
+          uni.showModal({
+            title: '提示',
+            content: '本工单中,无此设备!',
+            confirmText: '好的', //这块是确定按钮的文字
+            showCancel: false,
+            success: function (res) {
+              if (res.confirm) {
+                // 执行确认后的操作
+              } else {
+                // 执行取消后的操作
+              }
+            }
+          })
+        } else {
+          // 未报工
+          if (this.worksheetInfo.status.code === 1) {
+            this.handleCheck(data)
+          }
+          // 已报工
+          if (this.worksheetInfo.status.code === 3) {
+            this.checkDetail(data)
+          }
+        }
+      })
+    },
+
+    handleAssign () {
+      this.$refs.assignRef.open(this.pageId)
+    },
+    assignSuccess () {
+      this.back()
+    },
+    // 报工
+    handleReport () {
+      // if (
+      //   new Date(this.worksheetInfo.planFinishTime).getTime() <
+      //   new Date().getTime()
+      // ) {
+      //   this.$refs.inputDialog.open()
+      //   return
+      // }
+      this._report()
+    },
+    handleClose () {
+      this.$refs.inputDialog.close()
+    },
+    timeoutCauseConfirm (value) {
+      if (!value) {
+        uni.showToast({
+          title: '请输入超时原因',
+          icon: 'none'
+        })
+        return
+      }
+      this.$refs.inputDialog.close()
+      this._report(value)
+    },
+    _report (timeoutCause = '') {
+      post(
+        this.apiUrl + '/workOrder/reportWork',
+        {
+          workOrderId: this.pageId,
+          timeoutCause
+        },
+        true,
+        false
+      )
+        .then(res => {
+          let _this = this
+          if (res?.success) {
+            let data = res.data
+            if (data.length) {
+              uni.showModal({
+                title: '提示',
+                content: `有${data.length}台设备被标记为缺陷,是否要报修?`,
+                cancelText: '取消', // 取消按钮的文字
+                confirmText: '报修', // 确认按钮的文字
+                showCancel: true, // 是否显示取消按钮,默认为 true
+                success: res => {
+                  if (res.confirm) {
+                    if (data.length > 1) {
+                      uni.navigateTo({
+                        url: `/pages/tour_tally/detail/detail?workOrderCode=${this.workOrderCode}&id=${this.pageId}&chooseTab=true`
+                      })
+                    } else {
+                      uni.navigateTo({
+                        url: `/pages/repair/repair/index?source=5&workOrderCode=${this.workOrderCode}&equiCode=${data[0].equiCode}&equiId=${data[0].equiId}&workOrderId=${this.pageId}&equiName=${data[0].equiName}&equiModel=${data[0].equiModel}&equiLocation=${data[0].equiLocation}`
+                      })
+                    }
+                  } else {
+                    _this.getInfo()
+                  }
+                }
+              })
+            } else {
+              uni.showToast({
+                icon: 'success',
+                title: '操作成功!',
+                duration: 2000
+              })
+              this.getInfo()
+            }
+          }
+
+          /* if (res?.success) {
+						  uni.showToast({
+						    icon: "success",
+						    title: "操作成功!",
+						    duration: 2000,
+						  });
+						  this.getInfo();
+						} */
+        })
+        .catch(res => {
+          if (res.code === '4444') {
+            this.$refs.inputDialog.open()
+          } else if (res.code === '5555') {
+            this.modalShow = true
+            // uni.showModal({
+            //   title: '提示',
+            //   content: `您还有 ${this.worksheetInfo.awaitInspectSum} 台设备待检,不可报工`,
+            //   success: function (res) {},
+            //   showCancel: false
+            // })
+          }
+        })
+    },
+    // 执行工单
+    handleExecute () {
+      post(this.apiUrl + '/workOrder/execute', {
+        workOrderCode: this.workOrderCode
+      }).then(res => {
+        if (res?.success) {
+          uni.showToast({
+            icon: 'success',
+            title: '操作成功!',
+            duration: 2000
+          })
+          this.getInfo()
+        }
+      })
+    },
+    //巡点检设备加载更多
+    scrolltolower () {
+      if (this.isEnd) return
+      this.equipPage++
+      this.getEquipList()
+    },
+    // 巡点检设备列表
+    getEquipList () {
+      const params = {
+        workOrderId: this.pageId,
+        resultStatus: this.equpStatus[this.typeActive].value
+      }
+
+      post(
+        this.apiUrl +
+          `/workOrder/getEquipmentListApp?page=${this.equipPage}&size=10`,
+        params,
+        true
+      ).then(res => {
+        if (res?.success) {
+          if (this.equipPage === 1) {
+            this.euqiList = res.data.records
+          } else {
+            this.euqiList.push(...res.data.records)
+          }
+
+          this.isEnd = this.euqiList.length >= res.data.total
+        }
+      })
+    },
+
+    handleTabChange (value) {
+      if (value === 1) {
+        this.typeChange(0)
+      }
+    },
+
+    finishTime (start, end) {
+      if (!end) return ''
+      let dur = new Date(end).getTime() - new Date(start).getTime()
+      return Math.ceil(dur / 1000 / 60) + '分钟'
+    },
+    // 设备状态切换
+    typeChange (type) {
+      this.typeActive = type
+      this.equipPage = 1
+      this.getEquipList()
+    },
+    handleCheck ({ id, equiName, equiCode }) {
+      uni.navigateTo({
+        url: `/pages/tour_tally/check/index?id=${id}&equiName=${equiName}&equiCode=${equiCode}&workOrderId=${this.pageId}&workOrderCode=${this.workOrderCode}`
+      })
+    },
+    checkDetail ({ id, equiName, equiCode }) {
+      uni.navigateTo({
+        url: `/pages/tour_tally/check/detail?id=${id}&equiName=${equiName}&equiCode=${equiCode}&workOrderId=${this.pageId}`
+      })
+    },
+    getInfo () {
+      return post(this.apiUrl + '/workOrder/getDetailsApp', {
+        workOrderCode: this.workOrderCode
+      }).then(res => {
+        if (res?.success) {
+          this.worksheetInfo = res.data
+        }
+      })
+    },
+    // 报修
+    handLbx (item) {
+      console.log('item', item)
+      uni.navigateTo({
+        url: `/pages/repair/repair/index?source=5&workOrderCode=${this.workOrderCode}&equiCode=${item.equiCode}&equiId=${item.equiId}&workOrderId=${this.pageId}&equiName=${item.equiName}&equiModel=${item.equiModel}&equiLocation=${item.equiLocation}`
+      })
+    },
+    // 报修详情
+    handLbxDetail (item) {
+      uni.navigateTo({
+        url: `/pages/repair/detail/detail?id=${item.repairId}`
+      })
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+@import '@/components/submitted.scss';
+
+.list-cell {
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+  color: $uni-text-color-grey;
+  padding: 5rpx 20rpx;
+}
+
+.font-sm {
+  font-size: $uni-font-size-sm;
+}
+
+.font-text {
+  color: $uni-text-color;
+}
+
+.btn-execute {
+  background-color: $j-primary-border-green;
+  width: 450rpx;
+  margin-top: 5vh;
+}
+
+.btn-reassignment {
+  color: $uni-color-primary;
+  background-color: transparent;
+  border: none;
+  box-shadow: none;
+
+  &::after {
+    display: none;
+  }
+}
+
+.tour-container {
+  position: fixed;
+  top: 0;
+  bottom: 0;
+  width: 100vw;
+  display: flex;
+  flex-direction: column;
+
+  /deep/.u-popup {
+    flex: none !important;
+  }
+}
+
+.tour-wrapper {
+  position: relative;
+  flex: 1;
+}
+
+.tour_tally-content {
+  padding-top: 40rpx;
+  box-sizing: border-box;
+  // height: calc(100vh - 88rpx);
+  position: absolute;
+  top: 0;
+  bottom: 0;
+  left: 0;
+  right: 0;
+  display: flex;
+  flex-direction: column;
+}
+
+.kd-cell {
+  min-height: 90rpx;
+  border-bottom: 1px dashed #dadada;
+  display: flex;
+  align-items: center;
+
+  .kd-label {
+    display: inline-block;
+    width: 7em;
+    font-weight: bold;
+  }
+
+  .kd-content {
+    flex: 1;
+    word-break: break-all;
+  }
+}
+
+.kd-baseInfo {
+  padding: 0 32rpx;
+  font-size: 28rpx;
+}
+
+.kd-equipment {
+  flex: 1;
+  display: flex;
+  flex-direction: column;
+  overflow: hidden;
+
+  .kd-type-box {
+    text-align: center;
+    padding: 26rpx 0;
+
+    text {
+      display: inline-block;
+      width: 120rpx;
+      padding: 4rpx 0;
+      color: #333;
+      margin: 0 8rpx;
+
+      &.type—active {
+        background-color: rgba(215, 215, 215, 1);
+      }
+    }
+  }
+
+  .kd-list-container {
+    flex: 1;
+    display: flex;
+    flex-direction: column;
+    overflow: hidden;
+    padding: 12rpx 18rpx;
+    background-color: $page-bg;
+
+    .u-list {
+      flex: 1;
+      height: 100% !important;
+    }
+  }
+}
+
+.kd-card {
+  background-color: #fff;
+  margin-bottom: 20rpx;
+  padding: 8rpx 0;
+  font-size: 28rpx;
+  word-break: break-all;
+
+  .kd-card-wrapper {
+    padding: 0 30rpx;
+    border-bottom: 1px solid #dadada;
+  }
+
+  .kd-cell {
+    line-height: 60rpx;
+  }
+
+  .kd-cell:last-of-type {
+    border-bottom: none;
+  }
+
+  .status-box {
+    margin-right: 16rpx;
+  }
+
+  .card-footer {
+    display: flex;
+    justify-content: flex-end;
+    align-items: center;
+    padding: 8rpx 0 20rpx;
+
+    button {
+      width: 180rpx;
+      height: 56rpx;
+      line-height: 56rpx;
+      font-size: 28rpx;
+      margin: 0 8rpx;
+    }
+
+    .primary-btn {
+      background-color: $j-primary-border-green;
+    }
+  }
+}
+</style>

+ 746 - 0
pages/quantity/detail/detail.vue

@@ -0,0 +1,746 @@
+<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>
+		<view class="tour-wrapper">
+			<view class="tour_tally-content">
+				<KdTabs v-model="active" @change="handleTabChange" :list="['基本信息', '量具送检设备']" />
+				<view class="kd-baseInfo" v-show="active === 0">
+					<view class="kd-cell">
+						<text class="kd-label">工单编号</text>
+						{{ worksheetInfo.code }}
+					</view>
+					<view class="kd-cell">
+						<text class="kd-label">计划名称</text>
+						<text class="kd-content">{{ worksheetInfo.planName }}</text>
+					</view>
+					<!-- <view class="kd-cell">
+            <text class="kd-label">巡点检周期</text>
+            <text class="kd-content"
+              >{{ worksheetInfo.cycleValue
+              }}{{ cycleOptObj[worksheetInfo.cycleType] }}</text
+            >
+          </view> -->
+					<view class="kd-cell">
+						<text class="kd-label">设备分类</text>
+						<text class="kd-content">{{ worksheetInfo.categoryName }}</text>
+					</view>
+					<view class="kd-cell">
+						<text class="kd-label">巡检设备总数</text>
+						<text class="kd-content text-warning">{{ worksheetInfo.finishNum }}/{{ worksheetInfo.total }}</text>
+					</view>
+					<view class="kd-cell">
+						<text class="kd-label">计划完成时长</text>
+						{{ worksheetInfo.duration }}分钟
+					</view>
+					<view class="kd-cell">
+						<text class="kd-label">实际完成时长</text>
+						{{ finishTime(worksheetInfo.acceptTime, worksheetInfo.finishTime) }}
+					</view>
+					<view class="kd-cell">
+						<text class="kd-label">实际开始时间</text>
+						{{ worksheetInfo.acceptTime }}
+					</view>
+					<view class="kd-cell">
+						<text class="kd-label">实际完成时间</text>
+						{{ worksheetInfo.finishTime }}
+					</view>
+
+					<!-- <u-button type="primary" size="large" text="开始执行"></u-button> -->
+					<template>
+						<template v-if="worksheetInfo.orderStatus === 0">
+							<button class="btn-execute" type="primary" @click="handleExecute">开始执行</button>
+							<button class="btn-reassignment" type="primary" @click="handleAssign">转派</button>
+						</template>
+						<button v-else-if="worksheetInfo.orderStatus === 2" class="btn-execute" type="primary" @click="handleReport">报工</button>
+						<button v-else-if="worksheetInfo.orderStatus === 3" :disabled="true" class="btn-execute" type="primary">已报工</button>
+					</template>
+				</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>
+					<view class="kd-list-container">
+						<u-list @scrolltolower="scrolltolower">
+							<u-list-item v-for="(item, index) in euqiList" :key="index">
+								<view class="kd-card">
+									<view class="kd-card-wrapper">
+										<view class="kd-cell">
+											<text class="kd-label">设备编码</text>
+											{{ item.code }}
+										</view>
+										<view class="kd-cell">
+											<text class="kd-label">设备名称</text>
+											{{ item.name }}
+										</view>
+										<view class="kd-cell">
+											<text class="kd-label">设备型号</text>
+											{{ item.model }}
+										</view>
+										<view class="kd-cell">
+											<text class="kd-label">设备位置</text>
+											{{ item.deviceLocationName.pathName }}
+										</view>
+										<view class="kd-cell">
+											<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-primary" v-else-if="item.executeStatus === 3">已报修</text>
+										</view>
+									</view>
+									<view class="card-footer">
+										<button v-if="item.orderStatus == 2 && item.executeStatus == 0" type="primary" class="primary-btn" @click="handleCheck(item)">检查</button>
+										<template v-if="item.orderStatus && item.orderStatus === 3">
+											<button type="default" v-if="item.resultStatus === 3" @click="handLbxDetail(item)">报修详情</button>
+											<button type="default" v-else-if="item.resultStatus === 2" @click="handLbx(item)">报修</button>
+										</template>
+										<button type="default" v-if="[0, 2, 3].includes(item.orderStatus) && item.executeStatus != 0" @click="checkDetail(item)">检查详情</button>
+									</view>
+								</view>
+							</u-list-item>
+						</u-list>
+					</view>
+				</view>
+			</view>
+			<uni-popup ref="inputDialog" type="dialog">
+				<uni-popup-dialog
+					ref="inputClose"
+					mode="input"
+					title="您当前已超出计划完成时间,请填写原因"
+					placeholder="请输入内容"
+					:before-close="true"
+					@close="handleClose"
+					@confirm="timeoutCauseConfirm"></uni-popup-dialog>
+			</uni-popup>
+		</view>
+		<u-modal :show="modalShow" title="提示" @confirm="modalShow = false">
+			<view>
+				您还有
+				<text class="text-warning">{{ worksheetInfo.awaitInspectSum }}</text>
+				台设备待检,不可报工
+			</view>
+		</u-modal>
+		<Assign ref="assignRef" @success="assignSuccess" />
+
+		<!-- <ScanCode @scancodedate="scancodedate"></ScanCode> -->
+	</view>
+</template>
+
+<script>
+	import { getWorkOrderDetail, getDeviceList, startExecuting, signingWork } 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'
+	import KdTabs from '@/components/KdTabs.vue'
+	import ScanCode from '@/components/ScanCode.vue'
+	export default {
+		components: {
+			CellInfo,
+			KdTabs,
+			Assign,
+			ScanCode
+		},
+		data() {
+			return {
+				modalShow: false,
+				active: 0,
+				typeActive: 0,
+				statusList: {
+					0: '待接收',
+					1: '执行中',
+					3: '已完成'
+				},
+				pageId: '',
+				planId: '',
+				workOrderCode: '',
+				worksheetInfo: {
+					equiList: [],
+					workOrder: {}
+				},
+				equpStatus: [
+					// {
+					//   name: '全部',
+					//   value: []
+					// },
+					{
+						name: '全部',
+						value: -1
+					},
+					{
+						name: '待检',
+						value: 0
+					},
+					{
+						name: '已检',
+						value: 1
+					},
+					{
+						name: '缺陷',
+						value: 2
+					}
+				],
+				euqiList: [],
+				equipPage: 1,
+				isEnd: false,
+				cycleOptObj: {
+					1: '时/次',
+					2: '天/次',
+					3: '周/次',
+					4: '月/次',
+					5: '年/次',
+					11: '次/天',
+					12: '次/周',
+					13: '次/月',
+					14: '次/年'
+				},
+				barType: 0,
+				qrContent: null,
+				chooseTab: false
+			}
+		},
+		async onLoad(options) {
+			console.log('onLoad--------')
+			console.log('options------------', options)
+			// this.workOrderCode = options.workOrderCode
+			this.pageId = options.id
+			this.planId = options.planId
+			// this.chooseTab = options.chooseTab
+			this.getInfo()
+			// 设备台账跳转详情
+			// if (options.qrContent) {
+			// 	this.qrContent = options.qrContent
+			// 	await this.getInfo()
+			// 	this.cbScancodedate({
+			// 		code: this.qrContent
+			// 	})
+			// }
+		},
+		onShow() {
+			console.log('onShow--------')
+			this.getInfo()
+			if (this.chooseTab) {
+				this.active = 1
+				this.typeChange(2)
+			} else {
+				this.typeChange(0)
+			}
+			// let _this = this
+			// uni.$off('scancodedate') // 每次进来先 移除全局自定义事件监听器
+			// uni.$on('scancodedate', function (data) {
+			// 	_this.cbScancodedate(data)
+			// })
+		},
+		onUnload() {
+			uni.$off('scancodedate')
+		},
+		onHide() {
+			uni.$off('scancodedate')
+		},
+		methods: {
+			// 扫码枪扫码
+			cbScancodedate(data) {
+				this.Scancodedate(data.code)
+			},
+			// 相机扫码
+			HandlScanCode() {
+				let _this = this
+
+				uni.scanCode({
+					onlyFromCamera: true,
+					success: function (res) {
+						_this.Scancodedate(res.result)
+					}
+				})
+			},
+			Scancodedate(code) {
+				let _this = this
+				if (this.worksheetInfo.status.code === 0) {
+					uni.showModal({
+						title: '提示',
+						content: '工单未开启执行,不可进行巡点检操作,请先点击“开始执行”!',
+						confirmText: '开始执行', //这块是确定按钮的文字
+						cancelText: '取消', //这块是取消的文字
+						success: function (res) {
+							if (res.confirm) {
+								_this.handleExecute() // 执行确认后的操作
+							} else {
+								// 执行取消后的操作
+							}
+						}
+					})
+					return
+				}
+				this.qrContent = code.trim()
+				this.barType = this.setBarType(this.qrContent)
+				_this.getData()
+			},
+			// 设置barType
+			setBarType(val) {
+				let index = val.indexOf('@_@')
+				let result = 0
+				if (index !== -1) {
+					let item = val.substr(index + 3, 1)
+					if (item) {
+						result = Number(item)
+					}
+				}
+				return result
+			},
+			// 根据条码请求设备数据
+			getData() {
+				let par = {
+					barType: this.barType,
+					qrContent: this.qrContent
+				}
+				uni.showLoading({
+					title: '加载中',
+					mask: true
+				})
+				postJ(this.apiUrl + '/scan/getAssetInfo', par)
+					.then(res => {
+						let data = res.data
+						this.matchEquipment(data)
+					})
+					.finally(() => {
+						uni.hideLoading()
+					})
+			},
+
+			matchEquipment(data) {
+				let par = {
+					assetCode: data.assetCode,
+					workOrderId: this.worksheetInfo.id
+				}
+				console.log('par', par)
+				post(this.apiUrl + '/workOrder/scanMatching', par).then(res => {
+					let data = res.data
+					if (!data) {
+						uni.showModal({
+							title: '提示',
+							content: '本工单中,无此设备!',
+							confirmText: '好的', //这块是确定按钮的文字
+							showCancel: false,
+							success: function (res) {
+								if (res.confirm) {
+									// 执行确认后的操作
+								} else {
+									// 执行取消后的操作
+								}
+							}
+						})
+					} else {
+						// 未报工
+						if (this.worksheetInfo.status.code === 1) {
+							this.handleCheck(data)
+						}
+						// 已报工
+						if (this.worksheetInfo.status.code === 3) {
+							this.checkDetail(data)
+						}
+					}
+				})
+			},
+
+			handleAssign() {
+				console.log(this.worksheetInfo)
+				this.$refs.assignRef.open(this.worksheetInfo.id)
+			},
+			assignSuccess() {
+				this.back()
+			},
+			// 报工
+			handleReport() {
+				if (this.worksheetInfo.finishNum !== this.worksheetInfo.total) {
+					uni.showToast({
+						title: '请完成巡检设备检查',
+						icon: 'none'
+					})
+				} else {
+					if (new Date(this.worksheetInfo.acceptTime).getTime() + this.worksheetInfo.duration * 60 * 1000 < new Date().getTime()) {
+						this.$refs.inputDialog.open()
+						return
+					}
+					this._report()
+				}
+			},
+			handleClose() {
+				this.$refs.inputDialog.close()
+			},
+			timeoutCauseConfirm(value) {
+				if (!value) {
+					uni.showToast({
+						title: '请输入超时原因',
+						icon: 'none'
+					})
+					return
+				}
+				this.$refs.inputDialog.close()
+				this._report(value)
+			},
+			_report(timeoutCause = '') {
+				signingWork({ id: this.pageId, timeoutCause: timeoutCause }).then(() => {
+					uni.showToast({
+						icon: 'success',
+						title: '操作成功!',
+						duration: 2000
+					})
+					this.getInfo()
+				})
+
+				// post(
+				// 	this.apiUrl + '/workOrder/reportWork',
+				// 	{
+				// 		workOrderId: this.pageId,
+				// 		timeoutCause
+				// 	},
+				// 	true,
+				// 	false
+				// )
+				// 	.then(res => {
+				// 		let _this = this
+				// 		if (res?.success) {
+				// 			let data = res.data
+				// 			if (data.length) {
+				// 				uni.showModal({
+				// 					title: '提示',
+				// 					content: `有${data.length}台设备被标记为缺陷,是否要报修?`,
+				// 					cancelText: '取消', // 取消按钮的文字
+				// 					confirmText: '报修', // 确认按钮的文字
+				// 					showCancel: true, // 是否显示取消按钮,默认为 true
+				// 					success: res => {
+				// 						if (res.confirm) {
+				// 							if (data.length > 1) {
+				// 								uni.navigateTo({
+				// 									url: `/pages/tour_tally/detail/detail?workOrderCode=${this.workOrderCode}&id=${this.pageId}&chooseTab=true`
+				// 								})
+				// 							} else {
+				// 								uni.navigateTo({
+				// 									url: `/pages/repair/repair/index?source=5&workOrderCode=${this.workOrderCode}&equiCode=${data[0].equiCode}&equiId=${data[0].equiId}&workOrderId=${this.pageId}&equiName=${data[0].equiName}&equiModel=${data[0].equiModel}&equiLocation=${data[0].equiLocation}`
+				// 								})
+				// 							}
+				// 						} else {
+				// 							_this.getInfo()
+				// 						}
+				// 					}
+				// 				})
+				// 			} else {
+				// 				uni.showToast({
+				// 					icon: 'success',
+				// 					title: '操作成功!',
+				// 					duration: 2000
+				// 				})
+				// 				this.getInfo()
+				// 			}
+				// 		}
+
+				// 		/* if (res?.success) {
+				// 		  uni.showToast({
+				// 		    icon: "success",
+				// 		    title: "操作成功!",
+				// 		    duration: 2000,
+				// 		  });
+				// 		  this.getInfo();
+				// 		} */
+				// 	})
+				// 	.catch(res => {
+				// 		if (res.code === '4444') {
+				// 			this.$refs.inputDialog.open()
+				// 		} else if (res.code === '5555') {
+				// 			this.modalShow = true
+				// 			// uni.showModal({
+				// 			//   title: '提示',
+				// 			//   content: `您还有 ${this.worksheetInfo.awaitInspectSum} 台设备待检,不可报工`,
+				// 			//   success: function (res) {},
+				// 			//   showCancel: false
+				// 			// })
+				// 		}
+				// 	})
+			},
+			// 执行工单
+			handleExecute() {
+				startExecuting({ id: this.pageId }).then(() => {
+					uni.showToast({
+						icon: 'success',
+						title: '操作成功!',
+						duration: 2000
+					})
+					this.getInfo()
+				})
+				// post(this.apiUrl + '/workOrder/execute', {
+				// 	workOrderCode: this.workOrderCode
+				// }).then(res => {
+				// 	if (res?.success) {
+				// 		uni.showToast({
+				// 			icon: 'success',
+				// 			title: '操作成功!',
+				// 			duration: 2000
+				// 		})
+				// 		this.getInfo()
+				// 	}
+				// })
+			},
+			//巡点检设备加载更多
+			scrolltolower() {
+				if (this.isEnd) return
+				this.equipPage++
+				this.getEquipList()
+			},
+			// 巡点检设备列表
+			getEquipList() {
+				const params = {
+					planId: this.planId,
+					status: this.equpStatus[this.typeActive].value,
+					pageNum: 1,
+					size: 9999
+				}
+				getDeviceList(params).then(data => {
+					if (this.equipPage === 1) {
+						this.euqiList = data.list
+					} else {
+						this.euqiList.push(...data.list)
+					}
+					this.isEnd = this.euqiList.length >= data.count
+				})
+				// post(this.apiUrl + `/workOrder/getEquipmentListApp?page=${this.equipPage}&size=10`, params, true).then(res => {
+				// 	if (res?.success) {
+				// 		if (this.equipPage === 1) {
+				// 			this.euqiList = res.data.records
+				// 		} else {
+				// 			this.euqiList.push(...res.data.records)
+				// 		}
+				// 		this.isEnd = this.euqiList.length >= res.data.total
+				// 	}
+				// })
+			},
+
+			handleTabChange(value) {
+				if (value === 1) {
+					this.typeChange(0)
+				}
+			},
+
+			finishTime(start, end) {
+				if (!end) return ''
+				let dur = new Date(end).getTime() - new Date(start).getTime()
+				return Math.ceil(dur / 1000 / 60) + '分钟'
+			},
+			// 设备状态切换
+			typeChange(type) {
+				this.typeActive = type
+				this.equipPage = 1
+				this.getEquipList()
+			},
+			handleCheck({ id }) {
+				// uni.navigateTo({
+				// 	url: `/pages/tour_tally/check/index?id=${id}&equiName=${equiName}&equiCode=${equiCode}&workOrderId=${this.pageId}&workOrderCode=${this.workOrderCode}`
+				// })
+				uni.navigateTo({
+					url: `/pages/tour_tally/check/index?id=${id}`
+				})
+			},
+			checkDetail({ id }) {
+				uni.navigateTo({
+					url: `/pages/tour_tally/check/detail?id=${id}`
+				})
+			},
+			getInfo() {
+				getWorkOrderDetail({ workId: this.pageId }).then(data => {
+					this.worksheetInfo = data
+				})
+				// return post(this.apiUrl + '/workOrder/getDetailsApp', {
+				// 	workOrderCode: this.workOrderCode
+				// }).then(res => {
+				// 	if (res?.success) {
+				// 		this.worksheetInfo = res.data
+				// 	}
+				// })
+			},
+			// 报修
+			handLbx(item) {
+				console.log('item', item)
+				uni.navigateTo({
+					url: `/pages/repair/repair/index?source=5&workOrderCode=${this.workOrderCode}&equiCode=${item.equiCode}&equiId=${item.equiId}&workOrderId=${this.pageId}&equiName=${item.equiName}&equiModel=${item.equiModel}&equiLocation=${item.equiLocation}`
+				})
+			},
+			// 报修详情
+			handLbxDetail(item) {
+				uni.navigateTo({
+					url: `/pages/repair/detail/detail?id=${item.repairId}`
+				})
+			}
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	@import '@/components/submitted.scss';
+
+	.list-cell {
+		display: flex;
+		align-items: center;
+		justify-content: space-between;
+		color: $uni-text-color-grey;
+		padding: 5rpx 20rpx;
+	}
+
+	.font-sm {
+		font-size: $uni-font-size-sm;
+	}
+
+	.font-text {
+		color: $uni-text-color;
+	}
+
+	.btn-execute {
+		background-color: $j-primary-border-green;
+		width: 450rpx;
+		margin-top: 5vh;
+	}
+
+	.btn-reassignment {
+		color: $uni-color-primary;
+		background-color: transparent;
+		border: none;
+		box-shadow: none;
+
+		&::after {
+			display: none;
+		}
+	}
+
+	.tour-container {
+		position: fixed;
+		top: 0;
+		bottom: 0;
+		width: 100vw;
+		display: flex;
+		flex-direction: column;
+
+		/deep/.u-popup {
+			flex: none !important;
+		}
+	}
+
+	.tour-wrapper {
+		position: relative;
+		flex: 1;
+	}
+
+	.tour_tally-content {
+		padding-top: 40rpx;
+		box-sizing: border-box;
+		// height: calc(100vh - 88rpx);
+		position: absolute;
+		top: 0;
+		bottom: 0;
+		left: 0;
+		right: 0;
+		display: flex;
+		flex-direction: column;
+	}
+
+	.kd-cell {
+		min-height: 90rpx;
+		border-bottom: 1px dashed #dadada;
+		display: flex;
+		align-items: center;
+
+		.kd-label {
+			display: inline-block;
+			width: 7em;
+			font-weight: bold;
+		}
+
+		.kd-content {
+			flex: 1;
+			word-break: break-all;
+		}
+	}
+
+	.kd-baseInfo {
+		padding: 0 32rpx;
+		font-size: 28rpx;
+	}
+
+	.kd-equipment {
+		flex: 1;
+		display: flex;
+		flex-direction: column;
+		overflow: hidden;
+
+		.kd-type-box {
+			text-align: center;
+			padding: 26rpx 0;
+
+			text {
+				display: inline-block;
+				width: 120rpx;
+				padding: 4rpx 0;
+				color: #333;
+				margin: 0 8rpx;
+
+				&.type—active {
+					background-color: rgba(215, 215, 215, 1);
+				}
+			}
+		}
+
+		.kd-list-container {
+			flex: 1;
+			display: flex;
+			flex-direction: column;
+			overflow: hidden;
+			padding: 12rpx 18rpx;
+			background-color: $page-bg;
+
+			.u-list {
+				flex: 1;
+				height: 100% !important;
+			}
+		}
+	}
+
+	.kd-card {
+		background-color: #fff;
+		margin-bottom: 20rpx;
+		padding: 8rpx 0;
+		font-size: 28rpx;
+		word-break: break-all;
+
+		.kd-card-wrapper {
+			padding: 0 30rpx;
+			border-bottom: 1px solid #dadada;
+		}
+
+		.kd-cell {
+			line-height: 60rpx;
+		}
+
+		.kd-cell:last-of-type {
+			border-bottom: none;
+		}
+
+		.status-box {
+			margin-right: 16rpx;
+		}
+
+		.card-footer {
+			display: flex;
+			justify-content: flex-end;
+			align-items: center;
+			padding: 8rpx 0 20rpx;
+
+			button {
+				width: 180rpx;
+				height: 56rpx;
+				line-height: 56rpx;
+				font-size: 28rpx;
+				margin: 0 8rpx;
+			}
+
+			.primary-btn {
+				background-color: $j-primary-border-green;
+			}
+		}
+	}
+</style>

+ 172 - 0
pages/tour_tally/check/components/CheckCard copy.vue

@@ -0,0 +1,172 @@
+<template>
+  <view class="kd-check-card">
+    <view class="title">
+      <text class="label">{{ index + 1 }}</text>
+      <text>{{ item.name }}</text>
+    </view>
+    <view class="card-cell">
+      <text class="label">内容</text>
+      <text class="cell-content">{{ item.content }}</text>
+    </view>
+    <view class="card-cell">
+      <text class="label">标准</text>
+      <text class="cell-content">{{ item.norm }}</text>
+    </view>
+    <view class="card-cell">
+      <text class="label">结果</text>
+      <view class="cell-content">
+        <view class="content-status" v-if="type == 'view'">
+          <!-- {{ item.isNormal?'正常':'缺陷' }} -->
+          <div v-if="item.isNormal" style="color: green">正常</div>
+          <div v-else-if="item.isNormal === 0" style="color: red">缺陷</div>
+        </view>
+        <textarea
+          v-if="type !== 'view'"
+          placeholder="请输入"
+          v-model="item.resultText"
+        />
+        <view class="result-text" v-else>{{ item.resultText }}</view>
+        <view class="radio-wrapper">
+          <div
+            v-for="(it, ind) in statusList"
+            :key="ind"
+            v-if="type !== 'view'"
+            class="wrapper-box"
+            @click="changeStatus(item, it)"
+            :style="
+              item.isNormal == it.isNormal && item.isNormal == 0
+                ? 'color:red;border: 1rpx solid red'
+                : item.isNormal == it.isNormal && item.isNormal == 1
+                ? 'color:green;border: 1rpx solid green'
+                : ''
+            "
+          >
+            {{ it.label }}
+          </div>
+          <!-- <u-radio-group
+            v-model="item.isNormal"
+            placement="row"
+            v-if="type !== 'view'"
+            :size="28"
+          >
+            <u-radio
+              :customStyle="{ marginRight: '20px' }"
+              :labelSize="30"
+              label="正常"
+              :name="1"
+            >
+            </u-radio>
+            <u-radio :customStyle="{}" :labelSize="30" label="缺陷" :name="0">
+            </u-radio>
+          </u-radio-group> -->
+          <!-- <view
+            :class="item.isNormal === 0 ? 'text-danger' : ''"
+            v-else
+            style="min-height: 1em"
+          >
+            {{ ['缺陷', '正常'][item.isNormal] }}
+          </view> -->
+        </view>
+      </view>
+    </view>
+  </view>
+</template>
+
+<script>
+export default {
+  props: {
+    item: {
+      type: Object,
+      default: () => ({})
+    },
+    index: Number,
+    type: {
+      type: String,
+      default: 'edit'
+    }
+  },
+  data () {
+    return {
+      statusList: [
+        { label: '正常', isNormal: 1 },
+        { label: '缺陷', isNormal: 0 }
+      ]
+    }
+  },
+  methods: {
+    changeStatus (item, it) {
+      item.isNormal = it.isNormal
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+$border-color: #f2f2f2;
+.kd-check-card {
+  font-size: 28rpx;
+  border: 1rpx solid $border-color;
+  .label {
+    display: inline-block;
+    width: 80rpx;
+    text-align: center;
+    border-right: 1px solid $border-color;
+    justify-content: center;
+  }
+  .title {
+    line-height: 72rpx;
+    font-weight: bold;
+    background-color: #f2f2f2;
+  }
+  .card-cell {
+    min-height: 72rpx;
+    display: flex;
+    align-items: stretch;
+    border: 1px solid $border-color;
+    text {
+      display: flex;
+      align-items: center;
+    }
+  }
+  .cell-content {
+    flex: 1;
+    .content-status {
+      width: 100%;
+      height: 50rpx;
+      line-height: 50rpx;
+      text-indent: 10rpx;
+      border-bottom: 1rpx solid #f2f2f2;
+    }
+  }
+  .radio-wrapper {
+    padding: 10rpx 20rpx;
+    border-bottom: 1px solid $border-color;
+    margin-left: -8rpx;
+  }
+  /deep/uni-textarea {
+    width: 100%;
+    box-sizing: border-box;
+  }
+  .result-text {
+    min-height: 100rpx;
+    padding: 10rpx;
+  }
+  .cell-content {
+    padding-left: 8rpx;
+  }
+  .radio-wrapper {
+    display: flex;
+    align-items: center;
+    justify-content: space-around;
+  }
+  .wrapper-box {
+    width: 45%;
+    height: 80rpx;
+    line-height: 80rpx;
+    text-align: center;
+    border: 1rpx solid #000;
+    color: #000;
+    border-radius: 15rpx;
+  }
+}
+</style>

+ 806 - 0
pages/tour_tally/detail/detail copy.vue

@@ -0,0 +1,806 @@
+<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>
+    <view class="tour-wrapper">
+      <view class="tour_tally-content">
+        <KdTabs
+          v-model="active"
+          @change="handleTabChange"
+          :list="['基本信息', '巡点检设备']"
+        />
+        <view class="kd-baseInfo" v-show="active === 0">
+          <view class="kd-cell">
+            <text class="kd-label">工单编号</text
+            >{{ worksheetInfo.workOrderCode }}
+          </view>
+          <view class="kd-cell">
+            <text class="kd-label">计划名称</text>
+            <text class="kd-content">{{ worksheetInfo.planName }}</text>
+          </view>
+          <!-- <view class="kd-cell">
+            <text class="kd-label">巡点检周期</text>
+            <text class="kd-content"
+              >{{ worksheetInfo.cycleValue
+              }}{{ cycleOptObj[worksheetInfo.cycleType] }}</text
+            >
+          </view> -->
+          <view class="kd-cell">
+            <text class="kd-label">设备分类</text>
+            <text class="kd-content">{{ worksheetInfo.equiTypeName }}</text>
+          </view>
+          <view class="kd-cell">
+            <text class="kd-label">巡检设备总数</text>
+            <text class="kd-content text-warning"
+              >{{
+                worksheetInfo.equipCount - worksheetInfo.awaitInspectSum || 0
+              }}/{{ worksheetInfo.equipCount }}</text
+            >
+          </view>
+          <view class="kd-cell">
+            <text class="kd-label">计划完成时长</text
+            >{{ worksheetInfo.duration }}分钟
+          </view>
+          <view class="kd-cell">
+            <text class="kd-label">实际完成时长</text
+            >{{
+              finishTime(worksheetInfo.acceptTime, worksheetInfo.finishTime)
+            }}
+          </view>
+          <view class="kd-cell">
+            <text class="kd-label">实际开始时间</text
+            >{{ worksheetInfo.acceptTime }}
+          </view>
+          <view class="kd-cell">
+            <text class="kd-label">实际完成时间</text
+            >{{ worksheetInfo.finishTime }}
+          </view>
+
+          <!-- <u-button type="primary" size="large" text="开始执行"></u-button> -->
+          <template v-if="worksheetInfo.status">
+            <template v-if="worksheetInfo.status.code === 0">
+              <button class="btn-execute" type="primary" @click="handleExecute">
+                开始执行
+              </button>
+              <button
+                class="btn-reassignment"
+                type="primary"
+                @click="handleAssign"
+              >
+                转派
+              </button>
+            </template>
+            <button
+              v-else-if="worksheetInfo.status.code === 1"
+              class="btn-execute"
+              type="primary"
+              @click="handleReport"
+            >
+              报工
+            </button>
+            <button
+              v-else-if="worksheetInfo.status.code === 3"
+              :disabled="true"
+              class="btn-execute"
+              type="primary"
+            >
+              已报工
+            </button>
+          </template>
+        </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>
+          <view class="kd-list-container">
+            <u-list @scrolltolower="scrolltolower">
+              <u-list-item v-for="(item, index) in euqiList" :key="index">
+                <view class="kd-card">
+                  <view class="kd-card-wrapper">
+                    <view class="kd-cell">
+                      <text class="kd-label">设备编码</text>{{ item.equiCode }}
+                    </view>
+                    <view class="kd-cell">
+                      <text class="kd-label">设备名称</text>{{ item.equiName }}
+                    </view>
+                    <view class="kd-cell">
+                      <text class="kd-label">设备型号</text>{{ item.equiModel }}
+                    </view>
+                    <view class="kd-cell">
+                      <text class="kd-label">设备位置</text
+                      >{{ item.equiLocation }}
+                    </view>
+                    <view class="kd-cell">
+                      <text class="kd-label">执行结果</text>
+                      <text
+                        class="status-box text-warning"
+                        v-if="item.resultStatus === 0"
+                        >待检</text
+                      >
+                      <text
+                        class="status-box text-primary"
+                        v-else-if="item.resultStatus === 1"
+                        >正常</text
+                      >
+                      <text
+                        class="status-box text-danger"
+                        v-else-if="item.resultStatus === 2"
+                        >缺陷</text
+                      >
+                      <text
+                        class="status-box text-primary"
+                        v-else-if="item.resultStatus === 3"
+                        >已报修</text
+                      >
+                    </view>
+                  </view>
+                  <view class="card-footer">
+                    <button
+                      type="primary"
+                      class="primary-btn"
+                      @click="handleCheck(item)"
+                      v-if="
+                        worksheetInfo.status && worksheetInfo.status.code === 1
+                      "
+                    >
+                      检查
+                    </button>
+                    <template
+                      v-if="
+                        worksheetInfo.status && worksheetInfo.status.code === 3
+                      "
+                    >
+                      <button
+                        type="default"
+                        v-if="item.resultStatus === 3"
+                        @click="handLbxDetail(item)"
+                      >
+                        报修详情
+                      </button>
+                      <button
+                        type="default"
+                        v-else-if="item.resultStatus === 2"
+                        @click="handLbx(item)"
+                      >
+                        报修
+                      </button>
+                    </template>
+                    <button
+                      type="default"
+                      v-if="
+                        [0, 3].includes(
+                          worksheetInfo.status && worksheetInfo.status.code
+                        )
+                      "
+                      @click="checkDetail(item)"
+                    >
+                      检查详情
+                    </button>
+                  </view>
+                </view>
+              </u-list-item>
+            </u-list>
+          </view>
+        </view>
+      </view>
+      <uni-popup ref="inputDialog" type="dialog">
+        <uni-popup-dialog
+          ref="inputClose"
+          mode="input"
+          title="您当前已超出计划完成时间,请填写原因"
+          placeholder="请输入内容"
+          :before-close="true"
+          @close="handleClose"
+          @confirm="timeoutCauseConfirm"
+        ></uni-popup-dialog>
+      </uni-popup>
+    </view>
+    <u-modal :show="modalShow" title="提示" @confirm="modalShow = false">
+      <view
+        >您还有
+        <text class="text-warning">{{ worksheetInfo.awaitInspectSum }}</text>
+        台设备待检,不可报工
+      </view>
+    </u-modal>
+    <Assign ref="assignRef" @success="assignSuccess" />
+
+    <!-- <ScanCode @scancodedate="scancodedate"></ScanCode> -->
+  </view>
+</template>
+
+<script>
+import { get, post, postJ } from '@/utils/api.js'
+import Assign from '@/components/Assign.vue'
+import CellInfo from '@/components/CellInfo.vue'
+import KdTabs from '@/components/KdTabs.vue'
+import ScanCode from '@/components/ScanCode.vue'
+export default {
+  components: {
+    CellInfo,
+    KdTabs,
+    Assign,
+    ScanCode
+  },
+  data () {
+    return {
+      modalShow: false,
+      active: 0,
+      typeActive: 0,
+      statusList: {
+        0: '待接收',
+        1: '执行中',
+        3: '已完成'
+      },
+      pageId: '',
+      workOrderCode: '',
+      worksheetInfo: {
+        equiList: [],
+        workOrder: {}
+      },
+      equpStatus: [
+        // {
+        //   name: '全部',
+        //   value: []
+        // },
+        {
+          name: '待检',
+          value: [0]
+        },
+        {
+          name: '已检',
+          value: [1, 2, 3]
+        },
+        {
+          name: '缺陷',
+          value: [2]
+        },
+        {
+          name: '全部',
+          value: []
+        }
+      ],
+      euqiList: [],
+      equipPage: 1,
+      isEnd: false,
+      cycleOptObj: {
+        1: '时/次',
+        2: '天/次',
+        3: '周/次',
+        4: '月/次',
+        5: '年/次',
+        11: '次/天',
+        12: '次/周',
+        13: '次/月',
+        14: '次/年'
+      },
+      barType: 0,
+      qrContent: null,
+      chooseTab: false
+    }
+  },
+  async onLoad (options) {
+    console.log('options------------', options)
+    this.workOrderCode = options.workOrderCode
+    this.pageId = options.id
+    this.chooseTab = options.chooseTab
+    // 设备台账跳转详情
+    if (options.qrContent) {
+      this.qrContent = options.qrContent
+      await this.getInfo()
+      this.cbScancodedate({
+        code: this.qrContent
+      })
+    }
+  },
+  onShow () {
+    this.getInfo()
+    if (this.chooseTab) {
+      this.active = 1
+      this.typeChange(2)
+    } else {
+      this.typeChange(0)
+    }
+    let _this = this
+    uni.$off('scancodedate') // 每次进来先 移除全局自定义事件监听器
+    uni.$on('scancodedate', function (data) {
+      _this.cbScancodedate(data)
+    })
+  },
+  onUnload () {
+    uni.$off('scancodedate')
+  },
+  onHide () {
+    uni.$off('scancodedate')
+  },
+  methods: {
+    // 扫码枪扫码
+    cbScancodedate (data) {
+      this.Scancodedate(data.code)
+    },
+    // 相机扫码
+    HandlScanCode () {
+      let _this = this
+
+      uni.scanCode({
+        onlyFromCamera: true,
+        success: function (res) {
+          _this.Scancodedate(res.result)
+        }
+      })
+    },
+    Scancodedate (code) {
+      let _this = this
+      if (this.worksheetInfo.status.code === 0) {
+        uni.showModal({
+          title: '提示',
+          content: '工单未开启执行,不可进行巡点检操作,请先点击“开始执行”!',
+          confirmText: '开始执行', //这块是确定按钮的文字
+          cancelText: '取消', //这块是取消的文字
+          success: function (res) {
+            if (res.confirm) {
+              _this.handleExecute() // 执行确认后的操作
+            } else {
+              // 执行取消后的操作
+            }
+          }
+        })
+        return
+      }
+      this.qrContent = code.trim()
+      this.barType = this.setBarType(this.qrContent)
+      _this.getData()
+    },
+    // 设置barType
+    setBarType (val) {
+      let index = val.indexOf('@_@')
+      let result = 0
+      if (index !== -1) {
+        let item = val.substr(index + 3, 1)
+        if (item) {
+          result = Number(item)
+        }
+      }
+      return result
+    },
+    // 根据条码请求设备数据
+    getData () {
+      let par = {
+        barType: this.barType,
+        qrContent: this.qrContent
+      }
+      uni.showLoading({
+        title: '加载中',
+        mask: true
+      })
+      getWorkOrderDetail()
+      postJ(this.apiUrl + '/scan/getAssetInfo', par)
+        .then(res => {
+          let data = res.data
+          this.matchEquipment(data)
+        })
+        .finally(() => {
+          uni.hideLoading()
+        })
+    },
+
+    matchEquipment (data) {
+      let par = {
+        assetCode: data.assetCode,
+        workOrderId: this.worksheetInfo.id
+      }
+      console.log('par', par)
+      post(this.apiUrl + '/workOrder/scanMatching', par).then(res => {
+        let data = res.data
+        if (!data) {
+          uni.showModal({
+            title: '提示',
+            content: '本工单中,无此设备!',
+            confirmText: '好的', //这块是确定按钮的文字
+            showCancel: false,
+            success: function (res) {
+              if (res.confirm) {
+                // 执行确认后的操作
+              } else {
+                // 执行取消后的操作
+              }
+            }
+          })
+        } else {
+          // 未报工
+          if (this.worksheetInfo.status.code === 1) {
+            this.handleCheck(data)
+          }
+          // 已报工
+          if (this.worksheetInfo.status.code === 3) {
+            this.checkDetail(data)
+          }
+        }
+      })
+    },
+
+    handleAssign () {
+      this.$refs.assignRef.open(this.pageId)
+    },
+    assignSuccess () {
+      this.back()
+    },
+    // 报工
+    handleReport () {
+      // if (
+      //   new Date(this.worksheetInfo.planFinishTime).getTime() <
+      //   new Date().getTime()
+      // ) {
+      //   this.$refs.inputDialog.open()
+      //   return
+      // }
+      this._report()
+    },
+    handleClose () {
+      this.$refs.inputDialog.close()
+    },
+    timeoutCauseConfirm (value) {
+      if (!value) {
+        uni.showToast({
+          title: '请输入超时原因',
+          icon: 'none'
+        })
+        return
+      }
+      this.$refs.inputDialog.close()
+      this._report(value)
+    },
+    _report (timeoutCause = '') {
+      post(
+        this.apiUrl + '/workOrder/reportWork',
+        {
+          workOrderId: this.pageId,
+          timeoutCause
+        },
+        true,
+        false
+      )
+        .then(res => {
+          let _this = this
+          if (res?.success) {
+            let data = res.data
+            if (data.length) {
+              uni.showModal({
+                title: '提示',
+                content: `有${data.length}台设备被标记为缺陷,是否要报修?`,
+                cancelText: '取消', // 取消按钮的文字
+                confirmText: '报修', // 确认按钮的文字
+                showCancel: true, // 是否显示取消按钮,默认为 true
+                success: res => {
+                  if (res.confirm) {
+                    if (data.length > 1) {
+                      uni.navigateTo({
+                        url: `/pages/tour_tally/detail/detail?workOrderCode=${this.workOrderCode}&id=${this.pageId}&chooseTab=true`
+                      })
+                    } else {
+                      uni.navigateTo({
+                        url: `/pages/repair/repair/index?source=5&workOrderCode=${this.workOrderCode}&equiCode=${data[0].equiCode}&equiId=${data[0].equiId}&workOrderId=${this.pageId}&equiName=${data[0].equiName}&equiModel=${data[0].equiModel}&equiLocation=${data[0].equiLocation}`
+                      })
+                    }
+                  } else {
+                    _this.getInfo()
+                  }
+                }
+              })
+            } else {
+              uni.showToast({
+                icon: 'success',
+                title: '操作成功!',
+                duration: 2000
+              })
+              this.getInfo()
+            }
+          }
+
+          /* if (res?.success) {
+						  uni.showToast({
+						    icon: "success",
+						    title: "操作成功!",
+						    duration: 2000,
+						  });
+						  this.getInfo();
+						} */
+        })
+        .catch(res => {
+          if (res.code === '4444') {
+            this.$refs.inputDialog.open()
+          } else if (res.code === '5555') {
+            this.modalShow = true
+            // uni.showModal({
+            //   title: '提示',
+            //   content: `您还有 ${this.worksheetInfo.awaitInspectSum} 台设备待检,不可报工`,
+            //   success: function (res) {},
+            //   showCancel: false
+            // })
+          }
+        })
+    },
+    // 执行工单
+    handleExecute () {
+      post(this.apiUrl + '/workOrder/execute', {
+        workOrderCode: this.workOrderCode
+      }).then(res => {
+        if (res?.success) {
+          uni.showToast({
+            icon: 'success',
+            title: '操作成功!',
+            duration: 2000
+          })
+          this.getInfo()
+        }
+      })
+    },
+    //巡点检设备加载更多
+    scrolltolower () {
+      if (this.isEnd) return
+      this.equipPage++
+      this.getEquipList()
+    },
+    // 巡点检设备列表
+    getEquipList () {
+      const params = {
+        workOrderId: this.pageId,
+        resultStatus: this.equpStatus[this.typeActive].value
+      }
+
+      post(
+        this.apiUrl +
+          `/workOrder/getEquipmentListApp?page=${this.equipPage}&size=10`,
+        params,
+        true
+      ).then(res => {
+        if (res?.success) {
+          if (this.equipPage === 1) {
+            this.euqiList = res.data.records
+          } else {
+            this.euqiList.push(...res.data.records)
+          }
+
+          this.isEnd = this.euqiList.length >= res.data.total
+        }
+      })
+    },
+
+    handleTabChange (value) {
+      if (value === 1) {
+        this.typeChange(0)
+      }
+    },
+
+    finishTime (start, end) {
+      if (!end) return ''
+      let dur = new Date(end).getTime() - new Date(start).getTime()
+      return Math.ceil(dur / 1000 / 60) + '分钟'
+    },
+    // 设备状态切换
+    typeChange (type) {
+      this.typeActive = type
+      this.equipPage = 1
+      this.getEquipList()
+    },
+    handleCheck ({ id, equiName, equiCode }) {
+      uni.navigateTo({
+        url: `/pages/tour_tally/check/index?id=${id}&equiName=${equiName}&equiCode=${equiCode}&workOrderId=${this.pageId}&workOrderCode=${this.workOrderCode}`
+      })
+    },
+    checkDetail ({ id, equiName, equiCode }) {
+      uni.navigateTo({
+        url: `/pages/tour_tally/check/detail?id=${id}&equiName=${equiName}&equiCode=${equiCode}&workOrderId=${this.pageId}`
+      })
+    },
+    getInfo () {
+      return post(this.apiUrl + '/workOrder/getDetailsApp', {
+        workOrderCode: this.workOrderCode
+      }).then(res => {
+        if (res?.success) {
+          this.worksheetInfo = res.data
+        }
+      })
+    },
+    // 报修
+    handLbx (item) {
+      console.log('item', item)
+      uni.navigateTo({
+        url: `/pages/repair/repair/index?source=5&workOrderCode=${this.workOrderCode}&equiCode=${item.equiCode}&equiId=${item.equiId}&workOrderId=${this.pageId}&equiName=${item.equiName}&equiModel=${item.equiModel}&equiLocation=${item.equiLocation}`
+      })
+    },
+    // 报修详情
+    handLbxDetail (item) {
+      uni.navigateTo({
+        url: `/pages/repair/detail/detail?id=${item.repairId}`
+      })
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+@import '@/components/submitted.scss';
+
+.list-cell {
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+  color: $uni-text-color-grey;
+  padding: 5rpx 20rpx;
+}
+
+.font-sm {
+  font-size: $uni-font-size-sm;
+}
+
+.font-text {
+  color: $uni-text-color;
+}
+
+.btn-execute {
+  background-color: $j-primary-border-green;
+  width: 450rpx;
+  margin-top: 5vh;
+}
+
+.btn-reassignment {
+  color: $uni-color-primary;
+  background-color: transparent;
+  border: none;
+  box-shadow: none;
+
+  &::after {
+    display: none;
+  }
+}
+
+.tour-container {
+  position: fixed;
+  top: 0;
+  bottom: 0;
+  width: 100vw;
+  display: flex;
+  flex-direction: column;
+
+  /deep/.u-popup {
+    flex: none !important;
+  }
+}
+
+.tour-wrapper {
+  position: relative;
+  flex: 1;
+}
+
+.tour_tally-content {
+  padding-top: 40rpx;
+  box-sizing: border-box;
+  // height: calc(100vh - 88rpx);
+  position: absolute;
+  top: 0;
+  bottom: 0;
+  left: 0;
+  right: 0;
+  display: flex;
+  flex-direction: column;
+}
+
+.kd-cell {
+  min-height: 90rpx;
+  border-bottom: 1px dashed #dadada;
+  display: flex;
+  align-items: center;
+
+  .kd-label {
+    display: inline-block;
+    width: 7em;
+    font-weight: bold;
+  }
+
+  .kd-content {
+    flex: 1;
+    word-break: break-all;
+  }
+}
+
+.kd-baseInfo {
+  padding: 0 32rpx;
+  font-size: 28rpx;
+}
+
+.kd-equipment {
+  flex: 1;
+  display: flex;
+  flex-direction: column;
+  overflow: hidden;
+
+  .kd-type-box {
+    text-align: center;
+    padding: 26rpx 0;
+
+    text {
+      display: inline-block;
+      width: 120rpx;
+      padding: 4rpx 0;
+      color: #333;
+      margin: 0 8rpx;
+
+      &.type—active {
+        background-color: rgba(215, 215, 215, 1);
+      }
+    }
+  }
+
+  .kd-list-container {
+    flex: 1;
+    display: flex;
+    flex-direction: column;
+    overflow: hidden;
+    padding: 12rpx 18rpx;
+    background-color: $page-bg;
+
+    .u-list {
+      flex: 1;
+      height: 100% !important;
+    }
+  }
+}
+
+.kd-card {
+  background-color: #fff;
+  margin-bottom: 20rpx;
+  padding: 8rpx 0;
+  font-size: 28rpx;
+  word-break: break-all;
+
+  .kd-card-wrapper {
+    padding: 0 30rpx;
+    border-bottom: 1px solid #dadada;
+  }
+
+  .kd-cell {
+    line-height: 60rpx;
+  }
+
+  .kd-cell:last-of-type {
+    border-bottom: none;
+  }
+
+  .status-box {
+    margin-right: 16rpx;
+  }
+
+  .card-footer {
+    display: flex;
+    justify-content: flex-end;
+    align-items: center;
+    padding: 8rpx 0 20rpx;
+
+    button {
+      width: 180rpx;
+      height: 56rpx;
+      line-height: 56rpx;
+      font-size: 28rpx;
+      margin: 0 8rpx;
+    }
+
+    .primary-btn {
+      background-color: $j-primary-border-green;
+    }
+  }
+}
+</style>