@ -423,17 +423,87 @@
< el -tab -pane :label ="t('EquipmentManagement.EquipmentLedger.criticalComponent')" name = "criticalComponent" >
< div class = "device-ledger-tab-toolbar" >
< el -button
type = "success"
plain
: loading = "criticalExportLoading"
@ click = "handleExportCriticalComponent"
v - hasPermi = "['mes:device-ledger:export']"
< el -form
ref = "criticalComponentQueryFormRef"
: model = "criticalComponentQueryParams"
: inline = "true"
class = "device-ledger-critical-component-query"
>
< Icon icon = "ep:download" class = "mr-5px" / > { { t ( 'action.export' ) } }
< / e l - b u t t o n >
< el -form -item :label ="t('EquipmentManagement.EquipmentKeyItems.code')" prop = "code" >
< el -input
v - model = "criticalComponentQueryParams.code"
: placeholder = "t('EquipmentManagement.EquipmentKeyItems.placeholderCode')"
clearable
class = "!w-240px"
@ keyup . enter = "handleQueryCriticalComponent"
/ >
< / e l - f o r m - i t e m >
< el -form -item :label ="t('EquipmentManagement.EquipmentKeyItems.name')" prop = "name" >
< el -input
v - model = "criticalComponentQueryParams.name"
: placeholder = "t('EquipmentManagement.EquipmentKeyItems.placeholderName')"
clearable
class = "!w-240px"
@ keyup . enter = "handleQueryCriticalComponent"
/ >
< / e l - f o r m - i t e m >
< el -form -item
: label = "t('EquipmentManagement.EquipmentKeyItems.description')"
prop = "description"
>
< el -input
v - model = "criticalComponentQueryParams.description"
: placeholder = "t('EquipmentManagement.EquipmentKeyItems.placeholderDescription')"
clearable
class = "!w-240px"
@ keyup . enter = "handleQueryCriticalComponent"
/ >
< / e l - f o r m - i t e m >
< el -form -item :label ="t('EquipmentManagement.EquipmentKeyItems.remark')" prop = "remark" >
< el -input
v - model = "criticalComponentQueryParams.remark"
: placeholder = "t('EquipmentManagement.EquipmentKeyItems.placeholderRemark')"
clearable
class = "!w-240px"
@ keyup . enter = "handleQueryCriticalComponent"
/ >
< / e l - f o r m - i t e m >
< el -form -item :label ="t('EquipmentManagement.EquipmentKeyItems.createTime')" prop = "createTime" >
< el -date -picker
v - model = "criticalComponentQueryParams.createTime"
type = "daterange"
value - format = "YYYY-MM-DD HH:mm:ss"
: start - placeholder = "t('common.startTimeText')"
: end - placeholder = "t('common.endTimeText')"
: default - time = "[new Date('1 00:00:00'), new Date('1 23:59:59')]"
class = "!w-220px"
/ >
< / e l - f o r m - i t e m >
< el -form -item >
< el -button type = "primary" plain @click ="handleQueryCriticalComponent" >
< Icon icon = "ep:search" class = "mr-5px" / > { { t ( 'common.query' ) } }
< / e l - b u t t o n >
< el -button @click ="resetCriticalComponentQuery" >
< Icon icon = "ep:refresh" class = "mr-5px" / > { { t ( 'common.reset' ) } }
< / e l - b u t t o n >
< el -button
type = "success"
plain
: loading = "criticalExportLoading"
@ click = "handleExportCriticalComponent"
v - hasPermi = "['mes:device-ledger:export']"
>
< Icon icon = "ep:download" class = "mr-5px" / > { { t ( 'action.export' ) } }
< / e l - b u t t o n >
< / e l - f o r m - i t e m >
< / e l - f o r m >
< / div >
< el -table v-loading ="tableLoading" :data="detailData?.componentList" :stripe="true" :show-overflow-tooltip="true" >
< el -table
v - loading = "criticalComponentLoading"
: data = "criticalComponentList"
: stripe = "true"
: show - overflow - tooltip = "true"
>
< el -table -column :label ="t('EquipmentManagement.EquipmentLedger.componentCode')" align = "center" prop = "code" min -width = " 140 " sortable / >
< el -table -column :label ="t('EquipmentManagement.EquipmentLedger.componentName')" align = "center" prop = "name" min -width = " 140 " sortable / >
< el -table -column :label ="t('EquipmentManagement.EquipmentKeyItems.count')" align = "center" prop = "count" min -width = " 180 " / >
@ -441,6 +511,12 @@
< el -table -column :label ="t('EquipmentManagement.EquipmentLedger.remark')" align = "center" prop = "remark" min -width = " 180 " / >
< el -table -column :label ="t('EquipmentManagement.EquipmentLedger.createTime')" align = "center" prop = "createTime" :formatter ="dateFormatter" width = "180" sortable / >
< / e l - t a b l e >
< Pagination
: total = "criticalComponentTotal"
v - model : page = "criticalComponentQueryParams.pageNo"
v - model : limit = "criticalComponentQueryParams.pageSize"
@ pagination = "getCriticalComponentList"
/ >
< / e l - t a b - p a n e >
< el -tab -pane :label ="t('EquipmentManagement.EquipmentLedger.sparePart')" name = "component" >
@ -455,13 +531,19 @@
< Icon icon = "ep:download" class = "mr-5px" / > { { t ( 'action.export' ) } }
< / e l - b u t t o n >
< / div >
< el -table v-loading =" tableLoading" :data="detailData?.beijian List" :stripe="true" :show-overflow-tooltip="true">
< el -table v-loading =" spareLoading" :data="spare List" :stripe="true" :show-overflow-tooltip="true">
< el -table -column :label ="t('EquipmentManagement.EquipmentLedger.spareCode')" align = "center" prop = "barCode" sortable / >
< el -table -column :label ="t('EquipmentManagement.EquipmentLedger.spareName')" align = "left" prop = "name" width = "220px" sortable / >
< el -table -column :label ="t('EquipmentManagement.EquipmentLedger.category')" align = "center" prop = " c ategoryName" sortable / >
< el -table -column :label ="t('EquipmentManagement.EquipmentLedger.category')" align = "center" prop = " subC ategoryName" sortable / >
< el -table -column :label ="t('EquipmentManagement.EquipmentLedger.unit')" align = "center" prop = "unitName" sortable / >
< el -table -column :label ="t('EquipmentManagement.EquipmentLedger.createTime')" align = "center" prop = "createTime" :formatter ="dateFormatter" width = "180px" sortable / >
< / e l - t a b l e >
< Pagination
: total = "spareTotal"
v - model : page = "spareQueryParams.pageNo"
v - model : limit = "spareQueryParams.pageSize"
@ pagination = "getSpareList"
/ >
< / e l - t a b - p a n e >
< el -tab -pane :label ="t('EquipmentManagement.EquipmentLedger.mold')" name = "mold" >
@ -497,7 +579,8 @@ import { dateFormatter, formatDate } from '@/utils/formatTime'
import download from '@/utils/download'
import { DeviceLedgerApi , DeviceLedgerVO } from '@/api/mes/deviceledger'
import { DeviceTypeApi , DeviceTypeTreeVO } from '@/api/mes/devicetype'
import { CriticalComponentApi } from '@/api/mes/criticalComponent'
import { CriticalComponentApi , CriticalComponentVO } from '@/api/mes/criticalComponent'
import { ProductVO } from '@/api/erp/product/product'
import { TicketManagementApi } from '@/api/mes/ticketManagement'
import { DvRepairApi } from '@/api/mes/dvrepair'
import QrcodeActionCard from '@/components/QrcodeActionCard/index.vue'
@ -522,6 +605,67 @@ const detailLoading = ref(false)
const tableLoading = ref ( false )
const detailData = ref < DeviceLedgerDetailVO | undefined > ( )
const detailActiveTab = ref ( 'check' )
const criticalComponentLoading = ref ( false )
const criticalComponentList = ref < CriticalComponentVO [ ] > ( [ ] )
const criticalComponentTotal = ref ( 0 )
const criticalComponentQueryFormRef = ref ( )
const criticalComponentQueryParams = reactive ( {
pageNo : 1 ,
pageSize : 10 ,
deviceLedgerId : undefined as string | undefined ,
code : undefined as string | undefined ,
name : undefined as string | undefined ,
description : undefined as string | undefined ,
remark : undefined as string | undefined ,
createTime : [ ] as string [ ]
} )
const spareLoading = ref ( false )
const spareList = ref < ProductVO [ ] > ( [ ] )
const spareTotal = ref ( 0 )
const spareQueryParams = reactive ( {
pageNo : 1 ,
pageSize : 10
} )
const getCriticalComponentList = async ( ) => {
if ( ! deviceId . value ) return
criticalComponentLoading . value = true
try {
const data = await CriticalComponentApi . getCriticalComponentPage ( {
... criticalComponentQueryParams ,
deviceLedgerId : deviceId . value
} )
criticalComponentList . value = data . list ? ? [ ]
criticalComponentTotal . value = data . total ? ? 0
} finally {
criticalComponentLoading . value = false
}
}
const handleQueryCriticalComponent = async ( ) => {
criticalComponentQueryParams . pageNo = 1
await getCriticalComponentList ( )
}
const resetCriticalComponentQuery = async ( ) => {
criticalComponentQueryFormRef . value ? . resetFields ( )
await handleQueryCriticalComponent ( )
}
const getSpareList = async ( ) => {
if ( ! deviceId . value ) return
spareLoading . value = true
try {
const data = await DeviceLedgerApi . getDeviceLedgerSparePage ( {
... spareQueryParams ,
deviceLedgerId : deviceId . value
} )
spareList . value = data . list ? ? [ ]
spareTotal . value = data . total ? ? 0
} finally {
spareLoading . value = false
}
}
const deviceTypeNameMap = ref < Record < string , string > > ( { } )
@ -965,7 +1109,7 @@ const handleExportSpareBased = async () => {
try {
await message . exportConfirm ( )
spareExportLoading . value = true
const data = await DeviceLedgerApi . export SpareBased ( { id: deviceId . value } )
const data = await DeviceLedgerApi . export DeviceLedger Spare( { dev iceLedgerI d: deviceId . value } )
download . excel ( data , '备件.xls' )
} catch {
} finally {
@ -999,6 +1143,8 @@ const getDetail = async () => {
onMounted ( async ( ) => {
await getTypeTreeForNameMap ( )
await getDetail ( )
await getCriticalComponentList ( )
await getSpareList ( )
} )
< / script >
@ -1203,6 +1349,10 @@ onMounted(async () => {
text - align : right ;
}
. device - ledger - critical - component - query {
text - align : left ;
}
. device - ledger - history - items {
display : flex ;
flex - direction : column ;