|
@@ -0,0 +1,253 @@
|
|
|
+<template>
|
|
|
+ <a-row class="device-dtl-baseinfo-wrapper" :gutter="20">
|
|
|
+ <a-col :span="10" class="device-dtl-baseinfo-col">
|
|
|
+ <div class="device-dtl-wrapper">
|
|
|
+ <div class="title">基本信息</div>
|
|
|
+ <a-descriptions bordered size="small">
|
|
|
+ <a-descriptions-item label="设备编号">{{ info.deviceNumber }}</a-descriptions-item>
|
|
|
+ <a-descriptions-item label="资产编号">{{ info.assetNumber }}</a-descriptions-item>
|
|
|
+ <a-descriptions-item label="序列号">{{ info.serialNumber }}</a-descriptions-item>
|
|
|
+ <a-descriptions-item label="设备名称">{{ info.deviceName }}</a-descriptions-item>
|
|
|
+ <a-descriptions-item label="电子标签码">{{ info.electronicTag }}</a-descriptions-item>
|
|
|
+ <a-descriptions-item label="单位">{{ info.unit_dictText }}</a-descriptions-item>
|
|
|
+ <a-descriptions-item label="类别">{{ info.categoryName }}</a-descriptions-item>
|
|
|
+ <a-descriptions-item label="规格型号">{{ info.specificationModel }}</a-descriptions-item>
|
|
|
+ <a-descriptions-item label="品牌">{{ info.brand_dictText }}</a-descriptions-item>
|
|
|
+ <a-descriptions-item label="入账方式">{{ info.entryMethod_dictText }}</a-descriptions-item>
|
|
|
+ <a-descriptions-item label="创建人">{{ info.createBy }}</a-descriptions-item>
|
|
|
+ <a-descriptions-item label="创建时间">
|
|
|
+ {{ !info.createTime ? '' : info.createTime.length > 10 ? info.createTime.substr(0, 10) : info.createTime }}
|
|
|
+ </a-descriptions-item>
|
|
|
+ <a-descriptions-item label="设备来源">{{ info.source_dictText }}</a-descriptions-item>
|
|
|
+ <a-descriptions-item label="供应商" :span="2">{{ info.supplier }}</a-descriptions-item>
|
|
|
+ <a-descriptions-item label="采购金额">{{ info.purchaseAmount }}</a-descriptions-item>
|
|
|
+ <a-descriptions-item label="购置日期">{{ info.purchaseDate }}</a-descriptions-item>
|
|
|
+ <a-descriptions-item label="保修期至">{{ info.warrantyExpiry }}</a-descriptions-item>
|
|
|
+ <a-descriptions-item label="启用日期">{{ info.启用日期 }}</a-descriptions-item>
|
|
|
+ <a-descriptions-item label="预计报废日期" :span="2">{{ info.expectedDiscardDate }}</a-descriptions-item>
|
|
|
+ <a-descriptions-item label="设备状态"><component :is="renderDictTag(info.deviceStatus, 'device_status')" /></a-descriptions-item>
|
|
|
+ <a-descriptions-item label="使用状态"><component :is="renderDictTag(info.usageStatus, 'use_status')" /></a-descriptions-item>
|
|
|
+ <a-descriptions-item label="设备等级"><component :is="renderDictTag(info.deviceLevel, 'device_level')" /></a-descriptions-item>
|
|
|
+ <a-descriptions-item label="负责人" :span="3">{{ info.personInCharge }}</a-descriptions-item>
|
|
|
+ <a-descriptions-item label="所属部门" :span="3">{{ info.departmentName }}</a-descriptions-item>
|
|
|
+ <a-descriptions-item label="功能位置" :span="3">{{ info.positionName }}</a-descriptions-item>
|
|
|
+ <a-descriptions-item label="特种设备">
|
|
|
+ <Icon icon="ant-design:check-outlined" class="zgztel-check-icon checked" v-if="info.isSpecialEquip === true" />
|
|
|
+ <Icon icon="ant-design:close-outlined" class="zgztel-check-icon no-checked" v-else />
|
|
|
+ </a-descriptions-item>
|
|
|
+ <a-descriptions-item label="是否计量设备">
|
|
|
+ <Icon icon="ant-design:check-outlined" class="zgztel-check-icon checked" v-if="info.isMeteringDevice === true" />
|
|
|
+ <Icon icon="ant-design:close-outlined" class="zgztel-check-icon no-checked" v-else />
|
|
|
+ </a-descriptions-item>
|
|
|
+ <a-descriptions-item label="是否开启折旧">
|
|
|
+ <Icon icon="ant-design:check-outlined" class="zgztel-check-icon checked" v-if="info.isDepreciation === true" />
|
|
|
+ <Icon icon="ant-design:close-outlined" class="zgztel-check-icon no-checked" v-else />
|
|
|
+ </a-descriptions-item>
|
|
|
+ <a-descriptions-item label="技术参数" :span="3">{{ info.technicalParameters }}</a-descriptions-item>
|
|
|
+ <a-descriptions-item label="备注" :span="3">{{ info.remarks }}</a-descriptions-item>
|
|
|
+ </a-descriptions>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="device-dtl-wrapper">
|
|
|
+ <div class="title">扩展属性</div>
|
|
|
+ <a-descriptions bordered size="small">
|
|
|
+ <!-- 扩展属性 -->
|
|
|
+ </a-descriptions>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="device-dtl-wrapper">
|
|
|
+ <div class="title">专有属性</div>
|
|
|
+ <a-descriptions bordered size="small">
|
|
|
+ <!-- 专有属性 -->
|
|
|
+ </a-descriptions>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="device-dtl-wrapper">
|
|
|
+ <div class="title">设备图片</div>
|
|
|
+ <a-card style="width: 100%" :bodyStyle="{ padding: '10px', minHeight: '40px' }">
|
|
|
+ <a-image-preview-group v-if="info.imageUrl">
|
|
|
+ <a-image :width="200" v-for="(img, index) in handleImage" :key="index" :src="img" />
|
|
|
+ </a-image-preview-group>
|
|
|
+ </a-card>
|
|
|
+ </div>
|
|
|
+ </a-col>
|
|
|
+ <a-col :span="14" class="device-dtl-baseinfo-col right-col">
|
|
|
+ <div class="device-dtl-wrapper">
|
|
|
+ <div class="title">验收信息</div>
|
|
|
+ <a-card style="width: 80%">
|
|
|
+ <a-steps
|
|
|
+ :current="4"
|
|
|
+ size="small"
|
|
|
+ label-placement="vertical"
|
|
|
+ :items="[
|
|
|
+ {
|
|
|
+ title: '到货验收',
|
|
|
+ subTitle: 'SBYS2020000118',
|
|
|
+ description: '2020-11-24',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '试运行验收',
|
|
|
+ subTitle: 'SBYS2020000119',
|
|
|
+ description: '2020-11-24',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '到货验收',
|
|
|
+ subTitle: 'SBYS2020000120',
|
|
|
+ description: '2020-11-24',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '到货验收',
|
|
|
+ subTitle: 'SBYS2020000121',
|
|
|
+ description: '2020-11-24',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '试运行验收',
|
|
|
+ subTitle: 'SBYS2020000122',
|
|
|
+ description: '2020-11-24',
|
|
|
+ },
|
|
|
+ ]"
|
|
|
+ />
|
|
|
+ </a-card>
|
|
|
+ </div>
|
|
|
+ <div class="device-dtl-wrapper">
|
|
|
+ <div class="title">子设备</div>
|
|
|
+ <BasicTable @register="registerSubTable" />
|
|
|
+ </div>
|
|
|
+ <div class="device-dtl-wrapper">
|
|
|
+ <div class="title">父设备</div>
|
|
|
+ <BasicTable @register="registerParentTable" />
|
|
|
+ </div>
|
|
|
+ <div class="device-dtl-wrapper">
|
|
|
+ <div class="title">设备关联备件</div>
|
|
|
+ <BasicTable @register="registerMaterialTable" />
|
|
|
+ </div>
|
|
|
+ </a-col>
|
|
|
+ </a-row>
|
|
|
+</template>
|
|
|
+<script lang="ts">
|
|
|
+ import { defineComponent } from 'vue';
|
|
|
+ import { Image as AImage } from 'ant-design-vue';
|
|
|
+ import { render } from '/@/utils/common/renderUtils';
|
|
|
+ import { getFileAccessHttpUrl } from '/@/utils/common/compUtils';
|
|
|
+ import { BasicTable } from '/@/components/Table';
|
|
|
+ import { useListPage } from '/@/hooks/system/useListPage';
|
|
|
+ import { dtlColumns, spareColumns } from '../../DeviceBaseInfo.data';
|
|
|
+ import { queryDeviceBaseInfoByParentId, materialList } from '../../DeviceBaseInfo.api';
|
|
|
+ export default defineComponent({
|
|
|
+ components: { AImage, AImagePreviewGroup: AImage.PreviewGroup, BasicTable },
|
|
|
+ props: {
|
|
|
+ info: {
|
|
|
+ type: Object,
|
|
|
+ default: () => {},
|
|
|
+ },
|
|
|
+ },
|
|
|
+ setup(props) {
|
|
|
+ // 注册子设备table数据
|
|
|
+ const { tableContext: tableSubContext } = useListPage({
|
|
|
+ tableProps: {
|
|
|
+ title: '',
|
|
|
+ api: queryDeviceBaseInfoByParentId,
|
|
|
+ columns: dtlColumns,
|
|
|
+ size: 'small',
|
|
|
+ canResize: false,
|
|
|
+ showTableSetting: false,
|
|
|
+ showActionColumn: false,
|
|
|
+ beforeFetch: (params) => {
|
|
|
+ return Object.assign(params, { deviceId: props.info.id, queryType: 2 });
|
|
|
+ },
|
|
|
+ },
|
|
|
+ });
|
|
|
+
|
|
|
+ const [registerSubTable] = tableSubContext;
|
|
|
+
|
|
|
+ // 注册父设备table数据
|
|
|
+ const { tableContext: tableParentContext } = useListPage({
|
|
|
+ tableProps: {
|
|
|
+ title: '',
|
|
|
+ api: queryDeviceBaseInfoByParentId,
|
|
|
+ size: 'small',
|
|
|
+ columns: dtlColumns,
|
|
|
+ canResize: false,
|
|
|
+ showTableSetting: false,
|
|
|
+ showActionColumn: false,
|
|
|
+ beforeFetch: (params) => {
|
|
|
+ return Object.assign(params, { deviceId: props.info.id, queryType: 1 });
|
|
|
+ },
|
|
|
+ },
|
|
|
+ });
|
|
|
+ const [registerParentTable] = tableParentContext;
|
|
|
+
|
|
|
+ // 注册材料table数据
|
|
|
+ const { tableContext: tableMaterialContext } = useListPage({
|
|
|
+ tableProps: {
|
|
|
+ title: '',
|
|
|
+ api: materialList,
|
|
|
+ size: 'small',
|
|
|
+ columns: spareColumns,
|
|
|
+ canResize: false,
|
|
|
+ showTableSetting: false,
|
|
|
+ showActionColumn: false,
|
|
|
+ beforeFetch: (params) => {
|
|
|
+ return Object.assign(params, { deviceId: props.info.id });
|
|
|
+ },
|
|
|
+ },
|
|
|
+ });
|
|
|
+ const [registerMaterialTable] = tableMaterialContext;
|
|
|
+
|
|
|
+ // 渲染字典标签
|
|
|
+ const renderDictTag = (value: string, dictCode: string) => {
|
|
|
+ return render.renderDictTag(value, dictCode);
|
|
|
+ };
|
|
|
+
|
|
|
+ return { renderDictTag, registerSubTable, registerParentTable, registerMaterialTable };
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ // 处理图片
|
|
|
+ handleImage() {
|
|
|
+ const { info } = this;
|
|
|
+ if (!info || !info.imageUrl) return [];
|
|
|
+ return info.imageUrl.split(',').map((item) => {
|
|
|
+ return getFileAccessHttpUrl(item);
|
|
|
+ });
|
|
|
+ },
|
|
|
+ },
|
|
|
+ });
|
|
|
+</script>
|
|
|
+<style scoped lang="less">
|
|
|
+ .device-dtl-baseinfo-wrapper {
|
|
|
+ overflow: hidden;
|
|
|
+ height: 100%;
|
|
|
+
|
|
|
+ .device-dtl-baseinfo-col {
|
|
|
+ height: 100%;
|
|
|
+ overflow: auto;
|
|
|
+ }
|
|
|
+
|
|
|
+ .ant-descriptions {
|
|
|
+ :deep(.ant-descriptions-view) {
|
|
|
+ min-height: 40px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ :deep(.ant-descriptions-item-label) {
|
|
|
+ min-width: 101px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .device-dtl-wrapper {
|
|
|
+ margin-bottom: 10px;
|
|
|
+
|
|
|
+ .title {
|
|
|
+ font-size: 14px;
|
|
|
+ font-weight: bold;
|
|
|
+ margin-bottom: 10px;
|
|
|
+ color: var(--vxe-primary-color);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .right-col {
|
|
|
+ .jeecg-basic-table {
|
|
|
+ padding: 0;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+</style>
|