<template>
	<view>
		<view>
			<hs-show label="申请人" :data="data.formData.apply_user_name"></hs-show>
			<hs-show label="部门" :data="data.formData.dept_id" mode="dept"></hs-show>
			<hs-show label="提交类型" :data="data.formData.submit_type" mode="dict" dictKey="device_repairs_submit_type">
			</hs-show>
			<hs-show label="紧急程度" :data="data.formData.urgency_level" mode="dict"
				dictKey="device_repairs_urgency_level">
			</hs-show>
			<hs-show label="设备位置" :data="data.formData.device_loca"></hs-show>
			<hs-show label="报修说明" :data="data.formData.remark"></hs-show>
			<view class="desc">
				设备图片
			</view>
			<view class="desc">
				<uni-file-picker :value="data.formData.photos" file-mediatype="image" readonly>
				</uni-file-picker>
			</view>
		</view>
		<u-gap height="10" bgColor="#f7f7f7"></u-gap>
		<view>
			<hs-photo label="维保人上传" limit="5" :value="JSON.parse(data.formData.maintenance_record)"
				@input="submitMaintenanceRecord" :readonly="data.pageType === 1?false:true"></hs-photo>
		</view>
		<ge></ge>
	</view>
</template>

<script>
	import ge from '../components/ge'
	export default {
		components: {
			ge
		},
		data() {
			return {
				data: uni.getStorageSync("approval")
			}
		},
		mounted() {
			this.data.formData.photos = JSON.parse(this.data.formData.photos)
		},
		methods: {
			submitMaintenanceRecord(e) {
				let data = {
					id: this.data.formData.id,
					maintenanceRecord: e
				}
				this.$httpRequest({
					url: '/app/submitMaintenanceRecord',
					method: 'post',
					data: data,
					urlType: this.$getUrlType()
				}).then(res => {

				})
			}
		}
	}
</script>

<style>
	.desc {
		padding: 10rpx 30rpx;
		color: #818181;
	}
</style>
