repairRecord-detail.vue 5.36 KB
<template>
	<view class="device-detail-page">
		<!-- 公共组件-每个页面必须引入 -->
		<public-module></public-module>
		<view class="mt-3">
			<view class="basic-header">
				<view class="u-flex">
					<view class="basic-text text-clip ml-2">
						{{ listDetail.code }}
					</view>
					<!-- <view v-if="listDetail.status" class="basic-text-status ml-2" :style="{ color: faultDevice[listDetail.status].color}">
						{{ listDetail.status ? faultDevice[listDetail.status].name : ''}}
					</view> -->
				</view>
			</view>
			<view class="detail">
				<view class="detail-item">
					<view class="detail-label">{{ $t('deviceRepair.code') }}</view>
					<view class="detail-value">{{ listDetail.code}}</view>
				</view>
				<u-line length="90%" margin="0 auto"></u-line>
				<view class="detail-item">
					<view class="detail-label">{{ $t('deviceRepair.orderCodeName') }}</view>
					<view class="detail-value">{{ listDetail.tkRepairOrderDTO ? listDetail.tkRepairOrderDTO.orderCode : '' }}</view>
				</view>
				<u-line length="90%" margin="0 auto"></u-line>
				<view class="detail-item">
					<view class="detail-label">{{ $t('deviceRepair.repairDevice') }}</view>
					<view class="detail-value">{{ listDetail.deviceAccountName }}</view>
				</view>
				<u-line length="90%" margin="0 auto"></u-line>
				<view class="detail-item">
					<view class="detail-label">{{ $t('deviceRepair.reportDate') }}</view>
					<view class="detail-value">{{ listDetail.tkRepairOrderDTO ? listDetail.tkRepairOrderDTO.reportDate : '' }}</view>
				</view>
				<u-line length="90%" margin="0 auto"></u-line>
				<view class="detail-item">
					<view class="detail-label">{{ $t('deviceRepair.reportByName') }}</view>
					<view class="detail-value">{{ listDetail.tkRepairOrderDTO ? listDetail.tkRepairOrderDTO.reportByName :'' }}</view>
				</view>
				<u-line length="90%" margin="0 auto"></u-line>
				<view class="detail-item">
					<view class="detail-label">{{ $t('deviceRepair.situationImg') }}</view>
					<view class="detail-value">
					    <image class="detail-img" v-if="listDetail.tkRepairOrderDTO" :src="formatImage(listDetail.tkRepairOrderDTO.situationImg)"/>
					</view>
				</view>
				<u-line length="90%" margin="0 auto"></u-line>
				<view class="detail-item">
					<view class="detail-label">{{ $t('deviceRepair.description') }}</view>
					<view class="detail-value">{{ listDetail.tkRepairOrderDTO ? listDetail.tkRepairOrderDTO.description : ''}}</view>
				</view>
				<u-line length="90%" margin="0 auto"></u-line>
				<view class="detail-item">
					<view class="detail-label">{{ $t('deviceRepair.repairDate') }}</view>
					<view class="detail-value">{{ listDetail.repairDate }}</view>
				</view>
				<u-line length="90%" margin="0 auto"></u-line>
				<view class="detail-item">
					<view class="detail-label">{{ $t('deviceRepair.repairName') }}</view>
					<view class="detail-value">{{ listDetail.repairName }}</view>
				</view>
				<u-line length="90%" margin="0 auto"></u-line>
				<view class="detail-item">
					<view class="detail-label">{{ $t('deviceRepair.malfunctionReasonName') }}</view>
					<view class="detail-value">{{ listDetail.malfunctionReasonName }}</view>
				</view>
				<u-line length="90%" margin="0 auto"></u-line>
				<view class="detail-item">
					<view class="detail-label">{{ $t('deviceRepair.repairDescription') }}</view>
					<view class="detail-value">{{ listDetail.description }}</view>
				</view>
				
			</view>
		</view>
	</view>
</template>

<script>
import fTabbar from "@/components/module/f-tabbar/f-tabbar";
import api from '@/api/index.js'
import {faultDevice} from '@/pages/deviceManagement/enum/index.js'
import baseUrl from '@/config/baseUrl.js'


export default {
	components: {
		fTabbar,
		
	},
	data() {
		return {
			listDetail:{},
			faultDevice	
		};
	},
	onUnload() {
		
	},
	async onLoad(options) {
		// 隐藏原生的tabbar
		uni.hideTabBar();
		if (getApp().getBindNot()) {
			return
		}
		let id = options.id
		const res =	await api.deviceRepairApi.getRepairRecordDetail(id)	
		if (!res) return
		this.listDetail = {...res}
	
	},
	onShow(){
		this.$nextTick(()=>{
			uni.setNavigationBarTitle({
				title:this.$t('menu.repairRecordDetail')
			})
		})
		
	},
	
	methods: {
		formatImage(url) {
			// return baseUrl.baseImgUrl + url
			return window.location.origin + url
		},
		
		
	},
};
</script>

<style lang="scss" scoped>
.device-detail-page {
	min-height: 100vh;
	background-color: #f8f9fa;
	padding: 0 30rpx;
	.basic-header {
		display: flex;
		justify-content: space-between;
		align-items: center;
		height: 140rpx;
		background-color: #fff;
		border-radius: 20rpx;
		padding-left: 40rpx;
		padding-right:20rpx;
	
		.basic-text {
			width: 370rpx;
		}
	
		.cu-item {
			background: #3388ff;
			border-radius: 12px;
			width: 120rpx;
			height: 48rpx;
			text-align: center;
			line-height: 40rpx;
	
			text {
				font-size: 12px;
				font-family: PingFangSC-Regular, PingFang SC;
				font-weight: 400;
				color: #ffffff;
			}
		}
	
		.basic-text-status {
			font-size: 14px;
		}
	}
	.detail {
		background-color: #fff;
		margin-top: 30rpx;
		border-radius: 20rpx;
		width: 690rpx;
	
		.detail-item {
			padding: 30rpx;
			display: flex;
			align-items: center;
	
			.detail-label {
				color: #333;
				font-size: 15px;
			}
	
			.detail-value {
				color: #666;
				font-size: 14px;
				margin-left: 30rpx;
				.detail-img{
					width: 60rpx;
					height: 60rpx;
				}
			}
		}
	}
}
</style>