<template>
	<view class="mainBox">
		<uni-nav-bar fixed="true" statusBar="true" left-icon="back" title="基本信息" @clickLeft="back">
		</uni-nav-bar>
		<uni-section title="基本信息" type="line">
			<CellInfo label="固资编码" :value="info.fixAssetCode"></CellInfo>
			<CellInfo label="设备编码" :value="info.assetCode"></CellInfo>
			<CellInfo label="设备名称" :value="info.assetName"></CellInfo>
			<CellInfo label="型号" :value="info.information.modelType"></CellInfo>
			<CellInfo label="规格" :value="info.information.specification"></CellInfo>
			<CellInfo label="分类" :value="info.information.classificationUrl"></CellInfo>
			<CellInfo label="权属部门" :value="info.ownershipDeptName"></CellInfo>
			<CellInfo label="权属人" :value="info.ownershipUserName"></CellInfo>
			<CellInfo label="计量单位" :value="info.information.measuringUnit"></CellInfo>
			<CellInfo label="维护部门" :value="info.repairDeptName"></CellInfo>
			<CellInfo label="维护人" :value="info.repairUserName"></CellInfo>
			<CellInfo label="品牌" :value="info.brand"></CellInfo>
			<CellInfo label="设备位置" :value="initDetailLocation(info)"></CellInfo>
			<CellInfo label="供应商名称" :value="info.supplierName"></CellInfo>
			<CellInfo label="供应商电话" :value="info.supplierMobile"></CellInfo>
			<CellInfo label="设备用途" :value="info.purpose"></CellInfo>
			<CellInfo label="保修期至" :value="info.expirationTime"></CellInfo>
			<CellInfo label="投产日期" :value="info.startUpTime"></CellInfo>
			<CellInfo label="采购日期" :value="info.procurementTime"></CellInfo>
			<!-- <CellInfo label="生产日期" :value="info.e"></CellInfo> -->
			<CellInfo label="建档日期" :value="info.createTime"></CellInfo>
			<!-- <CellInfo label="购置金额" :value="info.e"></CellInfo> -->
			<CellInfo label="颜色" :value="info.color"></CellInfo>
			<CellInfo label="重量" :value="info.weight"></CellInfo>
			<!-- <CellInfo label="创建部门" :value="info.e"></CellInfo>
			<CellInfo label="创建人" :value="info.createUserName"></CellInfo> -->
			<CellInfo label="创建时间" :value="info.createTime"></CellInfo>
		</uni-section>
	</view>
</template>

<script>
	import CellInfo from '@/components/CellInfo.vue'
	import {
		post,
		get,
		postB
	} from '@/utils/api.js'
	export default {
		components: {
			CellInfo
		},
		data() {
			return {
				infoData: {
					deptName: '1234'
				},
				info: ''
			}
		},
		onLoad(option) {
			this.info = JSON.parse(decodeURIComponent(option.info))
		},
		methods: {
			// 设备位置
			initDetailLocation(info) {
				let val = `${info.factoryName}/${info.workshopName}/${info.lineName}/${info.detailLocation}`;
				let list = String(val).split('/').filter(n => {
					return n !== 'null'
				})
				return list.join('/')
			},
		}
	}
</script>

<style scoped lang="scss">

</style>