|
|
|
@ -127,18 +127,18 @@ link type="danger" @click="handleDelete(scope.row.id)"
|
|
|
|
<el-descriptions-item label="设备状态">
|
|
|
|
<el-descriptions-item label="设备状态">
|
|
|
|
<dict-tag type="mes_tz_status" :value="detailData?.deviceStatus" />
|
|
|
|
<dict-tag type="mes_tz_status" :value="detailData?.deviceStatus" />
|
|
|
|
</el-descriptions-item>
|
|
|
|
</el-descriptions-item>
|
|
|
|
<el-descriptions-item label="设备品牌">{{ detailData?.deviceBrand ?? '' }}</el-descriptions-item>
|
|
|
|
<!-- <el-descriptions-item label="设备品牌">{{ detailData?.deviceBrand ?? '' }}</el-descriptions-item> -->
|
|
|
|
<el-descriptions-item label="设备型号">{{ detailData?.deviceModel ?? '' }}</el-descriptions-item>
|
|
|
|
<el-descriptions-item label="设备型号">{{ detailData?.deviceModel ?? '' }}</el-descriptions-item>
|
|
|
|
<el-descriptions-item label="设备规格">{{ detailData?.deviceSpec ?? '' }}</el-descriptions-item>
|
|
|
|
<el-descriptions-item label="设备规格">{{ detailData?.deviceSpec ?? '' }}</el-descriptions-item>
|
|
|
|
<el-descriptions-item label="设备类型">
|
|
|
|
<el-descriptions-item label="设备类型">
|
|
|
|
<el-tag effect="light">{{ getDeviceTypeName(detailData?.deviceTypeName ?? detailData?.deviceType)
|
|
|
|
<el-tag effect="light">{{ getDeviceTypeName(detailData?.deviceTypeName ?? detailData?.deviceType)
|
|
|
|
}}</el-tag>
|
|
|
|
}}</el-tag>
|
|
|
|
</el-descriptions-item>
|
|
|
|
</el-descriptions-item>
|
|
|
|
<el-descriptions-item label="供应商">{{ detailData?.supplier ?? '' }}</el-descriptions-item>
|
|
|
|
<!-- <el-descriptions-item label="供应商">{{ detailData?.supplier ?? '' }}</el-descriptions-item> -->
|
|
|
|
<el-descriptions-item label="所属车间">{{ detailData?.workshop ?? '' }}</el-descriptions-item>
|
|
|
|
<el-descriptions-item label="所属车间">{{ detailData?.workshop ?? '' }}</el-descriptions-item>
|
|
|
|
<el-descriptions-item label="所属系统组织">{{ detailData?.systemOrg ?? '' }}</el-descriptions-item>
|
|
|
|
<!-- <el-descriptions-item label="所属系统组织">{{ detailData?.systemOrg ?? '' }}</el-descriptions-item> -->
|
|
|
|
<el-descriptions-item label="设备位置">{{ detailData?.deviceLocation ?? '' }}</el-descriptions-item>
|
|
|
|
<el-descriptions-item label="设备位置">{{ detailData?.deviceLocation ?? '' }}</el-descriptions-item>
|
|
|
|
<el-descriptions-item label="设备负责人">{{ detailData?.deviceManager ?? '' }}</el-descriptions-item>
|
|
|
|
<el-descriptions-item label="设备负责人">{{ detailData?.deviceManagerName ?? '' }}</el-descriptions-item>
|
|
|
|
<el-descriptions-item label="设备生产日期">{{ formatDetailDate(detailData?.productionDate) }}</el-descriptions-item>
|
|
|
|
<el-descriptions-item label="设备生产日期">{{ formatDetailDate(detailData?.productionDate) }}</el-descriptions-item>
|
|
|
|
<el-descriptions-item label="设备入厂日期">{{ formatDetailDate(detailData?.factoryEntryDate)
|
|
|
|
<el-descriptions-item label="设备入厂日期">{{ formatDetailDate(detailData?.factoryEntryDate)
|
|
|
|
}}</el-descriptions-item>
|
|
|
|
}}</el-descriptions-item>
|
|
|
|
@ -334,35 +334,66 @@ link type="danger" @click="handleDelete(scope.row.id)"
|
|
|
|
</el-collapse>
|
|
|
|
</el-collapse>
|
|
|
|
</el-tab-pane>
|
|
|
|
</el-tab-pane>
|
|
|
|
<el-tab-pane label="关键件" name="criticalComponent">
|
|
|
|
<el-tab-pane label="关键件" name="criticalComponent">
|
|
|
|
<el-table v-loading="loading" :data="detailData?.componentList" :stripe="true" :show-overflow-tooltip="true">
|
|
|
|
<div class="device-ledger-tab-toolbar">
|
|
|
|
<el-table-column label="编码" align="center" prop="code" min-width="140" />
|
|
|
|
<el-button
|
|
|
|
<el-table-column label="名称" align="center" prop="name" min-width="140" />
|
|
|
|
type="success"
|
|
|
|
<el-table-column label="描述" align="center" prop="description" min-width="180" />
|
|
|
|
plain
|
|
|
|
<el-table-column label="备注" align="center" prop="remark" min-width="180" />
|
|
|
|
:loading="criticalExportLoading"
|
|
|
|
<el-table-column label="创建时间" align="center" prop="createTime" :formatter="dateFormatter" width="180" />
|
|
|
|
@click="handleExportCriticalComponent"
|
|
|
|
</el-table>
|
|
|
|
v-hasPermi="['mes:device-ledger:export']"
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
<Icon icon="ep:download" class="mr-5px" /> 导出
|
|
|
|
|
|
|
|
</el-button>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<el-table
|
|
|
|
|
|
|
|
v-loading="loading"
|
|
|
|
|
|
|
|
:data="detailData?.componentList"
|
|
|
|
|
|
|
|
:stripe="true"
|
|
|
|
|
|
|
|
:show-overflow-tooltip="true"
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
<el-table-column label="编码" align="center" prop="code" min-width="140" />
|
|
|
|
|
|
|
|
<el-table-column label="名称" align="center" prop="name" min-width="140" />
|
|
|
|
|
|
|
|
<el-table-column label="描述" align="center" prop="description" min-width="180" />
|
|
|
|
|
|
|
|
<el-table-column label="备注" align="center" prop="remark" min-width="180" />
|
|
|
|
|
|
|
|
<el-table-column
|
|
|
|
|
|
|
|
label="创建时间"
|
|
|
|
|
|
|
|
align="center"
|
|
|
|
|
|
|
|
prop="createTime"
|
|
|
|
|
|
|
|
:formatter="dateFormatter"
|
|
|
|
|
|
|
|
width="180"
|
|
|
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
</el-table>
|
|
|
|
</el-tab-pane>
|
|
|
|
</el-tab-pane>
|
|
|
|
<el-tab-pane label="备件" name="component">
|
|
|
|
<el-tab-pane label="备件" name="component">
|
|
|
|
<el-table v-loading="loading" :data="detailData?.beijianList" :stripe="true" :show-overflow-tooltip="true">
|
|
|
|
<div class="device-ledger-tab-toolbar">
|
|
|
|
<el-table-column label="备件编码" align="center" prop="barCode" />
|
|
|
|
<el-button
|
|
|
|
<el-table-column label="备件名称" align="left" prop="name" width="220px"/>
|
|
|
|
type="success"
|
|
|
|
<!-- <el-table-column v-if="checkPermi(['erp:component:standard'])" label="规格" align="center" prop="standard" /> -->
|
|
|
|
plain
|
|
|
|
<el-table-column label="分类" align="center" prop="categoryName" />
|
|
|
|
:loading="spareExportLoading"
|
|
|
|
<el-table-column label="单位" align="center" prop="unitName" />
|
|
|
|
@click="handleExportSpareBased"
|
|
|
|
<!-- <el-table-column label="预警库存" align="center" prop="safetyNumber" /> -->
|
|
|
|
v-hasPermi="['mes:device-ledger:export']"
|
|
|
|
<!-- <el-table-column label="状态" align="center" prop="status">
|
|
|
|
>
|
|
|
|
<template #default="scope">
|
|
|
|
<Icon icon="ep:download" class="mr-5px" /> 导出
|
|
|
|
<dict-tag :type="DICT_TYPE.COMMON_STATUS" :value="scope.row.status" />
|
|
|
|
</el-button>
|
|
|
|
</template>
|
|
|
|
</div>
|
|
|
|
</el-table-column> -->
|
|
|
|
<el-table
|
|
|
|
<el-table-column
|
|
|
|
v-loading="loading"
|
|
|
|
label="创建时间"
|
|
|
|
:data="detailData?.beijianList"
|
|
|
|
align="center"
|
|
|
|
:stripe="true"
|
|
|
|
prop="createTime"
|
|
|
|
:show-overflow-tooltip="true"
|
|
|
|
:formatter="dateFormatter"
|
|
|
|
>
|
|
|
|
width="180px"
|
|
|
|
<el-table-column label="备件编码" align="center" prop="barCode" />
|
|
|
|
/>
|
|
|
|
<el-table-column label="备件名称" align="left" prop="name" width="220px" />
|
|
|
|
</el-table>
|
|
|
|
<el-table-column label="分类" align="center" prop="categoryName" />
|
|
|
|
|
|
|
|
<el-table-column label="单位" align="center" prop="unitName" />
|
|
|
|
|
|
|
|
<el-table-column
|
|
|
|
|
|
|
|
label="创建时间"
|
|
|
|
|
|
|
|
align="center"
|
|
|
|
|
|
|
|
prop="createTime"
|
|
|
|
|
|
|
|
:formatter="dateFormatter"
|
|
|
|
|
|
|
|
width="180px"
|
|
|
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
</el-table>
|
|
|
|
</el-tab-pane>
|
|
|
|
</el-tab-pane>
|
|
|
|
<el-tab-pane label="模具" name="mold">
|
|
|
|
<el-tab-pane label="模具" name="mold">
|
|
|
|
<el-table v-loading="loading" :data="detailData?.moldList" :stripe="true" :show-overflow-tooltip="true">
|
|
|
|
<el-table v-loading="loading" :data="detailData?.moldList" :stripe="true" :show-overflow-tooltip="true">
|
|
|
|
@ -387,6 +418,7 @@ import { dateFormatter, dateFormatter2, formatDate } from '@/utils/formatTime'
|
|
|
|
import download from '@/utils/download'
|
|
|
|
import download from '@/utils/download'
|
|
|
|
import { DeviceLedgerApi, DeviceLedgerVO } from '@/api/mes/deviceledger'
|
|
|
|
import { DeviceLedgerApi, DeviceLedgerVO } from '@/api/mes/deviceledger'
|
|
|
|
import { DeviceTypeApi, DeviceTypeTreeVO } from '@/api/mes/devicetype'
|
|
|
|
import { DeviceTypeApi, DeviceTypeTreeVO } from '@/api/mes/devicetype'
|
|
|
|
|
|
|
|
import { CriticalComponentApi } from '@/api/mes/criticalComponent'
|
|
|
|
import DeviceLedgerForm from './DeviceLedgerForm.vue'
|
|
|
|
import DeviceLedgerForm from './DeviceLedgerForm.vue'
|
|
|
|
import { getIntDictOptions } from '@/utils/dict'
|
|
|
|
import { getIntDictOptions } from '@/utils/dict'
|
|
|
|
import { isHexColor } from '@/utils/color'
|
|
|
|
import { isHexColor } from '@/utils/color'
|
|
|
|
@ -411,6 +443,8 @@ const queryParams = reactive({
|
|
|
|
})
|
|
|
|
})
|
|
|
|
const queryFormRef = ref() // 搜索的表单
|
|
|
|
const queryFormRef = ref() // 搜索的表单
|
|
|
|
const exportLoading = ref(false) // 导出的加载中
|
|
|
|
const exportLoading = ref(false) // 导出的加载中
|
|
|
|
|
|
|
|
const criticalExportLoading = ref(false)
|
|
|
|
|
|
|
|
const spareExportLoading = ref(false)
|
|
|
|
|
|
|
|
|
|
|
|
const tableRef = ref()
|
|
|
|
const tableRef = ref()
|
|
|
|
const selectedIds = ref<number[]>([])
|
|
|
|
const selectedIds = ref<number[]>([])
|
|
|
|
@ -775,6 +809,38 @@ const handleExport = async () => {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const handleExportCriticalComponent = async () => {
|
|
|
|
|
|
|
|
if (!selectedDetailId.value) {
|
|
|
|
|
|
|
|
message.error('请先选择设备')
|
|
|
|
|
|
|
|
return
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
await message.exportConfirm()
|
|
|
|
|
|
|
|
criticalExportLoading.value = true
|
|
|
|
|
|
|
|
const data = await CriticalComponentApi.exportDeviceComponent({ id: selectedDetailId.value })
|
|
|
|
|
|
|
|
download.excel(data, '关键件.xls')
|
|
|
|
|
|
|
|
} catch {
|
|
|
|
|
|
|
|
} finally {
|
|
|
|
|
|
|
|
criticalExportLoading.value = false
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const handleExportSpareBased = async () => {
|
|
|
|
|
|
|
|
if (!selectedDetailId.value) {
|
|
|
|
|
|
|
|
message.error('请先选择设备')
|
|
|
|
|
|
|
|
return
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
await message.exportConfirm()
|
|
|
|
|
|
|
|
spareExportLoading.value = true
|
|
|
|
|
|
|
|
const data = await DeviceLedgerApi.exportSpareBased({ id: selectedDetailId.value })
|
|
|
|
|
|
|
|
download.excel(data, '备件.xls')
|
|
|
|
|
|
|
|
} catch {
|
|
|
|
|
|
|
|
} finally {
|
|
|
|
|
|
|
|
spareExportLoading.value = false
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/** 初始化 **/
|
|
|
|
/** 初始化 **/
|
|
|
|
onMounted(async () => {
|
|
|
|
onMounted(async () => {
|
|
|
|
await dictStore.setDictMap()
|
|
|
|
await dictStore.setDictMap()
|
|
|
|
@ -831,6 +897,11 @@ onMounted(async () => {
|
|
|
|
color: var(--el-text-color-secondary);
|
|
|
|
color: var(--el-text-color-secondary);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.device-ledger-tab-toolbar {
|
|
|
|
|
|
|
|
margin-bottom: 8px;
|
|
|
|
|
|
|
|
text-align: right;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.device-ledger-history-items {
|
|
|
|
.device-ledger-history-items {
|
|
|
|
display: flex;
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
flex-direction: column;
|
|
|
|
|