|
@ -1,7 +1,11 @@ |
|
|
<template> |
|
|
<template> |
|
|
<ContentWrap> |
|
|
<ContentWrap> |
|
|
<!-- 搜索工作栏 --> |
|
|
<!-- 搜索工作栏 --> |
|
|
<Search :schema="ToolAccounts.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" /> |
|
|
<Search |
|
|
|
|
|
:schema="ToolAccounts.allSchemas.searchSchema" |
|
|
|
|
|
@search="setSearchParams" |
|
|
|
|
|
@reset="setSearchParams" |
|
|
|
|
|
/> |
|
|
</ContentWrap> |
|
|
</ContentWrap> |
|
|
|
|
|
|
|
|
<!-- 列表头部 --> |
|
|
<!-- 列表头部 --> |
|
@ -71,7 +75,12 @@ |
|
|
<!-- 备件 --> |
|
|
<!-- 备件 --> |
|
|
<SearchTable ref="searchSparePartTableRef" @searchTableSuccess="submitSparePartRelation" /> |
|
|
<SearchTable ref="searchSparePartTableRef" @searchTableSuccess="submitSparePartRelation" /> |
|
|
<!-- 导入 --> |
|
|
<!-- 导入 --> |
|
|
<ImportForm ref="importFormRef" url="/eam/tool/tool-accounts/import" :importTemplateData="importTemplateData" @success="importSuccess" /> |
|
|
<ImportForm |
|
|
|
|
|
ref="importFormRef" |
|
|
|
|
|
url="/eam/tool/tool-accounts/import" |
|
|
|
|
|
:importTemplateData="importTemplateData" |
|
|
|
|
|
@success="importSuccess" |
|
|
|
|
|
/> |
|
|
</template> |
|
|
</template> |
|
|
|
|
|
|
|
|
<script setup lang="ts"> |
|
|
<script setup lang="ts"> |
|
@ -83,28 +92,58 @@ import TableHead from '@/components/TableHead/src/TableHead.vue' |
|
|
import ImportForm from '@/components/ImportForm/src/ImportForm.vue' |
|
|
import ImportForm from '@/components/ImportForm/src/ImportForm.vue' |
|
|
import Detail from '@/components/Detail/src/Detail.vue' |
|
|
import Detail from '@/components/Detail/src/Detail.vue' |
|
|
import * as RelationMainPartApi from '@/api/eam/relationMainPart' |
|
|
import * as RelationMainPartApi from '@/api/eam/relationMainPart' |
|
|
import { EquipmentMainPart,EquipmentMainPartRules } from '../equipmentMainPart/equipmentMainPart.data' |
|
|
import { |
|
|
|
|
|
EquipmentMainPart, |
|
|
|
|
|
EquipmentMainPartRules |
|
|
|
|
|
} from '../equipmentMainPart/equipmentMainPart.data' |
|
|
import * as EquipmentMainPartApi from '@/api/eam/equipmentMainPart' |
|
|
import * as EquipmentMainPartApi from '@/api/eam/equipmentMainPart' |
|
|
import { SparePart,SparePartRules } from '../sparePart/sparePart.data' |
|
|
import { Item, ItemRules } from '../item/item.data' |
|
|
import * as SparePartApi from '@/api/eam/sparePart' |
|
|
import * as ItemApi from '@/api/eam/item' |
|
|
import * as EquipmentToolSparePartApi from '@/api/eam/equipmentToolSparePart' |
|
|
import * as EquipmentToolSparePartApi from '@/api/eam/equipmentToolSparePart' |
|
|
import { EquipmentReportRepairRequest,EquipmentReportRepairRequestRules } from '../equipmentReportRepairRequest/equipmentReportRepairRequest.data' |
|
|
import { |
|
|
|
|
|
EquipmentReportRepairRequest, |
|
|
|
|
|
EquipmentReportRepairRequestRules |
|
|
|
|
|
} from '../equipmentReportRepairRequest/equipmentReportRepairRequest.data' |
|
|
import * as EquipmentReportRepairRequestApi from '@/api/eam/equipmentReportRepairRequest' |
|
|
import * as EquipmentReportRepairRequestApi from '@/api/eam/equipmentReportRepairRequest' |
|
|
import { EquipmentSpotCheckRecordMain,EquipmentSpotCheckRecordMainRules } from '../equipmentSpotCheckRecordMain/equipmentSpotCheckRecordMain.data' |
|
|
import { |
|
|
|
|
|
EquipmentSpotCheckRecordMain, |
|
|
|
|
|
EquipmentSpotCheckRecordMainRules |
|
|
|
|
|
} from '../equipmentSpotCheckRecordMain/equipmentSpotCheckRecordMain.data' |
|
|
import * as EquipmentSpotCheckRecordMainApi from '@/api/eam/equipmentSpotCheckRecordMain' |
|
|
import * as EquipmentSpotCheckRecordMainApi from '@/api/eam/equipmentSpotCheckRecordMain' |
|
|
import { EquipmentSpotCheckRecordDetail,EquipmentSpotCheckRecordDetailRules } from '../equipmentSpotCheckRecordDetail/equipmentSpotCheckRecordDetail.data' |
|
|
import { |
|
|
|
|
|
EquipmentSpotCheckRecordDetail, |
|
|
|
|
|
EquipmentSpotCheckRecordDetailRules |
|
|
|
|
|
} from '../equipmentSpotCheckRecordDetail/equipmentSpotCheckRecordDetail.data' |
|
|
import * as EquipmentSpotCheckRecordDetailApi from '@/api/eam/equipmentSpotCheckRecordDetail' |
|
|
import * as EquipmentSpotCheckRecordDetailApi from '@/api/eam/equipmentSpotCheckRecordDetail' |
|
|
import { EquipmentInspectionRecordMain,EquipmentInspectionRecordMainRules } from '../equipmentInspectionRecordMain/equipmentInspectionRecordMain.data' |
|
|
import { |
|
|
|
|
|
EquipmentInspectionRecordMain, |
|
|
|
|
|
EquipmentInspectionRecordMainRules |
|
|
|
|
|
} from '../equipmentInspectionRecordMain/equipmentInspectionRecordMain.data' |
|
|
import * as EquipmentInspectionRecordMainApi from '@/api/eam/equipmentInspectionRecordMain' |
|
|
import * as EquipmentInspectionRecordMainApi from '@/api/eam/equipmentInspectionRecordMain' |
|
|
import { EquipmentInspectionRecordDetail,EquipmentInspectionRecordDetailRules } from '../equipmentInspectionRecordDetail/equipmentInspectionRecordDetail.data' |
|
|
import { |
|
|
|
|
|
EquipmentInspectionRecordDetail, |
|
|
|
|
|
EquipmentInspectionRecordDetailRules |
|
|
|
|
|
} from '../equipmentInspectionRecordDetail/equipmentInspectionRecordDetail.data' |
|
|
import * as EquipmentInspectionRecordDetailApi from '@/api/eam/equipmentInspectionRecordDetail' |
|
|
import * as EquipmentInspectionRecordDetailApi from '@/api/eam/equipmentInspectionRecordDetail' |
|
|
import { EquipmentRepairRecordMain,EquipmentRepairRecordMainRules } from '../equipmentRepairRecordMain/equipmentRepairRecordMain.data' |
|
|
import { |
|
|
|
|
|
EquipmentRepairRecordMain, |
|
|
|
|
|
EquipmentRepairRecordMainRules |
|
|
|
|
|
} from '../equipmentRepairRecordMain/equipmentRepairRecordMain.data' |
|
|
import * as EquipmentRepairRecordMainApi from '@/api/eam/equipmentRepairRecordMain' |
|
|
import * as EquipmentRepairRecordMainApi from '@/api/eam/equipmentRepairRecordMain' |
|
|
import { EquipmentRepairRecordDetail,EquipmentRepairRecordDetailRules } from '../equipmentRepairRecordDetail/equipmentRepairRecordDetail.data' |
|
|
import { |
|
|
|
|
|
EquipmentRepairRecordDetail, |
|
|
|
|
|
EquipmentRepairRecordDetailRules |
|
|
|
|
|
} from '../equipmentRepairRecordDetail/equipmentRepairRecordDetail.data' |
|
|
import * as EquipmentRepairRecordDetailApi from '@/api/eam/equipmentRepairRecordDetail' |
|
|
import * as EquipmentRepairRecordDetailApi from '@/api/eam/equipmentRepairRecordDetail' |
|
|
import { EquipmentMaintenanceRecordMain,EquipmentMaintenanceRecordMainRules } from '../equipmentMaintenanceRecordMain/equipmentMaintenanceRecordMain.data' |
|
|
import { |
|
|
|
|
|
EquipmentMaintenanceRecordMain, |
|
|
|
|
|
EquipmentMaintenanceRecordMainRules |
|
|
|
|
|
} from '../equipmentMaintenanceRecordMain/equipmentMaintenanceRecordMain.data' |
|
|
import * as EquipmentMaintenanceRecordMainApi from '@/api/eam/equipmentMaintenanceRecordMain' |
|
|
import * as EquipmentMaintenanceRecordMainApi from '@/api/eam/equipmentMaintenanceRecordMain' |
|
|
import { EquipmentMaintenanceRecordDetail,EquipmentMaintenanceRecordDetailRules } from '../equipmentMaintenanceRecordDetail/equipmentMaintenanceRecordDetail.data' |
|
|
import { |
|
|
|
|
|
EquipmentMaintenanceRecordDetail, |
|
|
|
|
|
EquipmentMaintenanceRecordDetailRules |
|
|
|
|
|
} from '../equipmentMaintenanceRecordDetail/equipmentMaintenanceRecordDetail.data' |
|
|
import * as EquipmentMaintenanceRecordDetailApi from '@/api/eam/equipmentMaintenanceRecordDetail' |
|
|
import * as EquipmentMaintenanceRecordDetailApi from '@/api/eam/equipmentMaintenanceRecordDetail' |
|
|
import * as WorkshopApi from '@/api/wms/workshop' |
|
|
import * as WorkshopApi from '@/api/wms/workshop' |
|
|
import * as ProductionlineApi from '@/api/wms/productionline' |
|
|
import * as ProductionlineApi from '@/api/wms/productionline' |
|
@ -120,8 +159,8 @@ const route = useRoute() // 路由信息 |
|
|
const routeName = ref() |
|
|
const routeName = ref() |
|
|
routeName.value = route.name |
|
|
routeName.value = route.name |
|
|
const tableColumns = ref(ToolAccounts.allSchemas.tableColumns) |
|
|
const tableColumns = ref(ToolAccounts.allSchemas.tableColumns) |
|
|
const tabs = ref<{ label: string; prop: string; }[]>([]) |
|
|
const tabs = ref<{ label: string; prop: string }[]>([]) |
|
|
const subTabList = ref([]); |
|
|
const subTabList = ref([]) |
|
|
const detailAllSchemas = ref() |
|
|
const detailAllSchemas = ref() |
|
|
const apiPage = ref() |
|
|
const apiPage = ref() |
|
|
const dialogApiPage = ref() |
|
|
const dialogApiPage = ref() |
|
@ -131,7 +170,7 @@ const operationRecordList = ref([ |
|
|
{ label: '维修记录', value: 'repair' }, |
|
|
{ label: '维修记录', value: 'repair' }, |
|
|
{ label: '保养记录', value: 'maintenance' }, |
|
|
{ label: '保养记录', value: 'maintenance' }, |
|
|
{ label: '巡检记录', value: 'inspection' }, |
|
|
{ label: '巡检记录', value: 'inspection' }, |
|
|
{label:'点检记录',value:'spot_check'}, |
|
|
{ label: '点检记录', value: 'spot_check' } |
|
|
]) |
|
|
]) |
|
|
|
|
|
|
|
|
// 查询页面返回 |
|
|
// 查询页面返回 |
|
@ -175,7 +214,7 @@ const HeadButttondata = [ |
|
|
defaultButtons.defaultExportBtn({ hasPermi: 'eam:tool-accounts:export' }), // 导出 |
|
|
defaultButtons.defaultExportBtn({ hasPermi: 'eam:tool-accounts:export' }), // 导出 |
|
|
defaultButtons.defaultFreshBtn(null), // 刷新 |
|
|
defaultButtons.defaultFreshBtn(null), // 刷新 |
|
|
defaultButtons.defaultFilterBtn(null), // 筛选 |
|
|
defaultButtons.defaultFilterBtn(null), // 筛选 |
|
|
defaultButtons.defaultSetBtn(null), // 设置 |
|
|
defaultButtons.defaultSetBtn(null) // 设置 |
|
|
// { |
|
|
// { |
|
|
// label: '自定义扩展按钮', |
|
|
// label: '自定义扩展按钮', |
|
|
// name: 'zdy', |
|
|
// name: 'zdy', |
|
@ -188,16 +227,22 @@ const HeadButttondata = [ |
|
|
|
|
|
|
|
|
// 头部按钮事件 |
|
|
// 头部按钮事件 |
|
|
const buttonBaseClick = (val, item) => { |
|
|
const buttonBaseClick = (val, item) => { |
|
|
if (val == 'add') { // 新增 |
|
|
if (val == 'add') { |
|
|
|
|
|
// 新增 |
|
|
openForm('create') |
|
|
openForm('create') |
|
|
} else if (val == 'import') { // 导入 |
|
|
} else if (val == 'import') { |
|
|
|
|
|
// 导入 |
|
|
handleImport() |
|
|
handleImport() |
|
|
} else if (val == 'export') { // 导出 |
|
|
} else if (val == 'export') { |
|
|
|
|
|
// 导出 |
|
|
handleExport() |
|
|
handleExport() |
|
|
} else if (val == 'refresh') { // 刷新 |
|
|
} else if (val == 'refresh') { |
|
|
|
|
|
// 刷新 |
|
|
getList() |
|
|
getList() |
|
|
} else if (val == 'filtrate') { // 筛选 |
|
|
} else if (val == 'filtrate') { |
|
|
} else { // 其他按钮 |
|
|
// 筛选 |
|
|
|
|
|
} else { |
|
|
|
|
|
// 其他按钮 |
|
|
console.log('其他按钮', item) |
|
|
console.log('其他按钮', item) |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
@ -206,19 +251,23 @@ const buttonBaseClick = (val, item) => { |
|
|
const butttondata = [ |
|
|
const butttondata = [ |
|
|
defaultButtons.mainListEditBtn({ hasPermi: 'eam:tool-accounts:update' }), // 编辑 |
|
|
defaultButtons.mainListEditBtn({ hasPermi: 'eam:tool-accounts:update' }), // 编辑 |
|
|
defaultButtons.componentBtn({ hasPermi: 'eam:tool-accounts:component' }), // 部件 |
|
|
defaultButtons.componentBtn({ hasPermi: 'eam:tool-accounts:component' }), // 部件 |
|
|
defaultButtons.sparePartBtn({hasPermi:'eam:tool-accounts:item'}), // 备件 |
|
|
defaultButtons.sparePartBtn({ hasPermi: 'eam:tool-accounts:item' }) // 备件 |
|
|
// defaultButtons.mainListDeleteBtn({hasPermi:'eam:tool-accounts:delete'}), // 删除 |
|
|
// defaultButtons.mainListDeleteBtn({hasPermi:'eam:tool-accounts:delete'}), // 删除 |
|
|
] |
|
|
] |
|
|
|
|
|
|
|
|
// 列表-操作按钮事件 |
|
|
// 列表-操作按钮事件 |
|
|
const buttonTableClick = async (val, row) => { |
|
|
const buttonTableClick = async (val, row) => { |
|
|
if (val == 'edit') { // 编辑 |
|
|
if (val == 'edit') { |
|
|
|
|
|
// 编辑 |
|
|
openForm('update', row) |
|
|
openForm('update', row) |
|
|
} else if (val == 'delete') { // 删除 |
|
|
} else if (val == 'delete') { |
|
|
|
|
|
// 删除 |
|
|
handleDelete(row.id) |
|
|
handleDelete(row.id) |
|
|
} else if (val == 'component') { // 部件 |
|
|
} else if (val == 'component') { |
|
|
|
|
|
// 部件 |
|
|
openComponent(row) |
|
|
openComponent(row) |
|
|
} else if (val == 'sparePart') { // 备件 |
|
|
} else if (val == 'sparePart') { |
|
|
|
|
|
// 备件 |
|
|
openSparePart(row) |
|
|
openSparePart(row) |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
@ -227,14 +276,19 @@ const buttonTableClick = async (val, row) => { |
|
|
const basicFormRef = ref() |
|
|
const basicFormRef = ref() |
|
|
const openForm = async (type: string, row?: any) => { |
|
|
const openForm = async (type: string, row?: any) => { |
|
|
if (type == 'update') { |
|
|
if (type == 'update') { |
|
|
const equipmentManufacturerNoPage = await EquipmentManufacturerApi.getEquipmentManufacturerNoPage({}) |
|
|
const equipmentManufacturerNoPage = |
|
|
|
|
|
await EquipmentManufacturerApi.getEquipmentManufacturerNoPage({}) |
|
|
const equipmentSupplierNoPage = await EquipmentSupplierApi.getEquipmentSupplierNoPage({}) |
|
|
const equipmentSupplierNoPage = await EquipmentSupplierApi.getEquipmentSupplierNoPage({}) |
|
|
const workshopNoPage = await WorkshopApi.getWorkshopNoPage({}) |
|
|
const workshopNoPage = await WorkshopApi.getWorkshopNoPage({}) |
|
|
const productionlineNoPage = await ProductionlineApi.getProductionlineNoPage({}); |
|
|
const productionlineNoPage = await ProductionlineApi.getProductionlineNoPage({}) |
|
|
row.workshopName = workshopNoPage?.find(item=>item.code == row.workshopCode)?.name |
|
|
row.workshopName = workshopNoPage?.find((item) => item.code == row.workshopCode)?.name |
|
|
row.lineName = productionlineNoPage?.find(item=>item.code == row.lineCode)?.name |
|
|
row.lineName = productionlineNoPage?.find((item) => item.code == row.lineCode)?.name |
|
|
row.manufactureName = equipmentManufacturerNoPage?.find(item=>item.number == row.manufactureCode)?.name |
|
|
row.manufactureName = equipmentManufacturerNoPage?.find( |
|
|
row.supplierName = equipmentSupplierNoPage?.find(item=>item.number == row.supplierCode)?.name |
|
|
(item) => item.number == row.manufactureCode |
|
|
|
|
|
)?.name |
|
|
|
|
|
row.supplierName = equipmentSupplierNoPage?.find( |
|
|
|
|
|
(item) => item.number == row.supplierCode |
|
|
|
|
|
)?.name |
|
|
} |
|
|
} |
|
|
basicFormRef.value.open(type, row) |
|
|
basicFormRef.value.open(type, row) |
|
|
} |
|
|
} |
|
@ -242,16 +296,16 @@ const openForm = async (type: string, row?: any) => { |
|
|
// form表单提交 |
|
|
// form表单提交 |
|
|
const formsSuccess = async (formType, data) => { |
|
|
const formsSuccess = async (formType, data) => { |
|
|
var isHave = ToolAccounts.allSchemas.formSchema.some(function (item) { |
|
|
var isHave = ToolAccounts.allSchemas.formSchema.some(function (item) { |
|
|
return item.field === 'activeTime' || item.field === 'expireTime'; |
|
|
return item.field === 'activeTime' || item.field === 'expireTime' |
|
|
}); |
|
|
}) |
|
|
if (isHave) { |
|
|
if (isHave) { |
|
|
if (data.activeTime && data.expireTime && data.activeTime >= data.expireTime) { |
|
|
if (data.activeTime && data.expireTime && data.activeTime >= data.expireTime) { |
|
|
message.error('失效时间要大于生效时间') |
|
|
message.error('失效时间要大于生效时间') |
|
|
return; |
|
|
return |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
if(data.activeTime==0)data.activeTime = null; |
|
|
if (data.activeTime == 0) data.activeTime = null |
|
|
if(data.expireTime==0)data.expireTime = null; |
|
|
if (data.expireTime == 0) data.expireTime = null |
|
|
if (formType === 'create') { |
|
|
if (formType === 'create') { |
|
|
await ToolAccountsApi.createToolAccounts(data) |
|
|
await ToolAccountsApi.createToolAccounts(data) |
|
|
message.success(t('common.createSuccess')) |
|
|
message.success(t('common.createSuccess')) |
|
@ -266,14 +320,14 @@ const formsSuccess = async (formType,data) => { |
|
|
/** 详情操作 */ |
|
|
/** 详情操作 */ |
|
|
const detailRef = ref() |
|
|
const detailRef = ref() |
|
|
const dynamicInfoFields = ref([ |
|
|
const dynamicInfoFields = ref([ |
|
|
"totalRunningTime", |
|
|
'totalRunningTime', |
|
|
"maintenanceRunningTime", |
|
|
'maintenanceRunningTime', |
|
|
"usageTimes", |
|
|
'usageTimes', |
|
|
"lastInspectionDate", |
|
|
'lastInspectionDate', |
|
|
"outageRate", |
|
|
'outageRate', |
|
|
"breakdownRecover", |
|
|
'breakdownRecover', |
|
|
"purchaseInterval" |
|
|
'purchaseInterval' |
|
|
]); |
|
|
]) |
|
|
|
|
|
|
|
|
const openDetail = (row: any, titleName: any, titleValue: any) => { |
|
|
const openDetail = (row: any, titleName: any, titleValue: any) => { |
|
|
detailRef.value.openDetail(row, titleName, titleValue, 'basicToolAccounts') |
|
|
detailRef.value.openDetail(row, titleName, titleValue, 'basicToolAccounts') |
|
@ -332,7 +386,6 @@ const searchFormClick = (searchData) => { |
|
|
getList() // 刷新当前列表 |
|
|
getList() // 刷新当前列表 |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const handleOperationTabsChange = (val) => { |
|
|
const handleOperationTabsChange = (val) => { |
|
|
if (val == 'report') { |
|
|
if (val == 'report') { |
|
|
apiPage.value = EquipmentReportRepairRequestApi.getEquipmentReportRepairRequestPage |
|
|
apiPage.value = EquipmentReportRepairRequestApi.getEquipmentReportRepairRequestPage |
|
@ -345,7 +398,8 @@ const handleOperationTabsChange = (val) => { |
|
|
} else if (val == 'maintenance') { |
|
|
} else if (val == 'maintenance') { |
|
|
apiPage.value = EquipmentMaintenanceRecordMainApi.getEquipmentMaintenanceRecordMainPage |
|
|
apiPage.value = EquipmentMaintenanceRecordMainApi.getEquipmentMaintenanceRecordMainPage |
|
|
detailAllSchemas.value = EquipmentMaintenanceRecordMain.allSchemas |
|
|
detailAllSchemas.value = EquipmentMaintenanceRecordMain.allSchemas |
|
|
dialogApiPage.value = EquipmentMaintenanceRecordDetailApi.getEquipmentMaintenanceRecordDetailPage |
|
|
dialogApiPage.value = |
|
|
|
|
|
EquipmentMaintenanceRecordDetailApi.getEquipmentMaintenanceRecordDetailPage |
|
|
dialogAllSchemas.value = EquipmentMaintenanceRecordDetail.allSchemas |
|
|
dialogAllSchemas.value = EquipmentMaintenanceRecordDetail.allSchemas |
|
|
} else if (val == 'inspection') { |
|
|
} else if (val == 'inspection') { |
|
|
apiPage.value = EquipmentInspectionRecordMainApi.getEquipmentInspectionRecordMainPage |
|
|
apiPage.value = EquipmentInspectionRecordMainApi.getEquipmentInspectionRecordMainPage |
|
@ -366,36 +420,43 @@ const searchTableSelections = ref([]) |
|
|
const searchTableSparePartSelections = ref([]) |
|
|
const searchTableSparePartSelections = ref([]) |
|
|
const syncData = async (row) => { |
|
|
const syncData = async (row) => { |
|
|
searchTableSparePartSelections.value = [] |
|
|
searchTableSparePartSelections.value = [] |
|
|
await RelationMainPartApi.getRelationMainPartNoPage({ equipmentCode: row.code,type: 'EQUIPMENT' }).then(async (res) => { |
|
|
await RelationMainPartApi.getRelationMainPartNoPage({ |
|
|
await EquipmentMainPartApi.getEquipmentMainPartNoPage({type: 'EQUIPMENT'}).then(response => { |
|
|
equipmentCode: row.code, |
|
|
searchTableSelections.value = response.filter(element => { |
|
|
type: 'EQUIPMENT' |
|
|
let flag = false; |
|
|
}).then(async (res) => { |
|
|
res.forEach(item => { |
|
|
await EquipmentMainPartApi.getEquipmentMainPartNoPage({ type: 'EQUIPMENT' }).then( |
|
|
|
|
|
(response) => { |
|
|
|
|
|
searchTableSelections.value = response.filter((element) => { |
|
|
|
|
|
let flag = false |
|
|
|
|
|
res.forEach((item) => { |
|
|
if (element.code == item.mainPartCode) { |
|
|
if (element.code == item.mainPartCode) { |
|
|
flag = true; |
|
|
flag = true |
|
|
} |
|
|
} |
|
|
}); |
|
|
}) |
|
|
return flag; |
|
|
return flag |
|
|
}); |
|
|
}) |
|
|
}); |
|
|
} |
|
|
}); |
|
|
) |
|
|
}; |
|
|
}) |
|
|
|
|
|
} |
|
|
const syncSparePartData = async (row) => { |
|
|
const syncSparePartData = async (row) => { |
|
|
searchTableSparePartSelections.value = [] |
|
|
searchTableSparePartSelections.value = [] |
|
|
await EquipmentToolSparePartApi.getEquipmentToolSparePartNoPage({ equipmentToolCode: row.code}).then(async (res) => { |
|
|
await EquipmentToolSparePartApi.getEquipmentToolSparePartNoPage({ |
|
|
await SparePartApi.getSparePartNoPage({}).then(response => { |
|
|
equipmentToolCode: row.code |
|
|
searchTableSparePartSelections.value = response.filter(element => { |
|
|
}).then(async (res) => { |
|
|
let flag = false; |
|
|
await ItemApi.getItemNoPage({}).then((response) => { |
|
|
res.forEach(item => { |
|
|
searchTableSparePartSelections.value = response.filter((element) => { |
|
|
if (element.code == item.sparePartCode) { |
|
|
let flag = false |
|
|
flag = true; |
|
|
res.forEach((item) => { |
|
|
} |
|
|
if (element.number == item.sparePartCode) { |
|
|
}); |
|
|
flag = true |
|
|
return flag; |
|
|
} |
|
|
}); |
|
|
}) |
|
|
}); |
|
|
return flag |
|
|
}); |
|
|
}) |
|
|
}; |
|
|
}) |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
/** 绑定备件操作 */ |
|
|
/** 绑定备件操作 */ |
|
|
const openComponent = async (row: any) => { |
|
|
const openComponent = async (row: any) => { |
|
|
await syncData(row) |
|
|
await syncData(row) |
|
@ -420,10 +481,10 @@ const openSparePart = async (row : any) => { |
|
|
await syncSparePartData(row) |
|
|
await syncSparePartData(row) |
|
|
searchSparePartTableRef.value.open( |
|
|
searchSparePartTableRef.value.open( |
|
|
'选择备件', |
|
|
'选择备件', |
|
|
SparePart.allSchemas, |
|
|
Item.allSchemas, |
|
|
SparePartApi.getSparePartPage, |
|
|
ItemApi.getItemPage, |
|
|
'sparePartPart', |
|
|
'item', |
|
|
SparePart.allSchemas.searchSchema, |
|
|
Item.allSchemas.searchSchema, |
|
|
true, |
|
|
true, |
|
|
null, //type |
|
|
null, //type |
|
|
row, |
|
|
row, |
|
@ -437,11 +498,11 @@ const openSparePart = async (row : any) => { |
|
|
|
|
|
|
|
|
const submitEquipmentMainPartRelation = (formField, searchField, val, formRef, rowRef) => { |
|
|
const submitEquipmentMainPartRelation = (formField, searchField, val, formRef, rowRef) => { |
|
|
const deviceMainPartRelList = val.map((element) => ({ |
|
|
const deviceMainPartRelList = val.map((element) => ({ |
|
|
mainPartCode: element.code, |
|
|
mainPartCode: element.number, |
|
|
equipmentCode: rowRef.code, |
|
|
equipmentCode: rowRef.code, |
|
|
type: 'EQUIPMENT' |
|
|
type: 'EQUIPMENT' |
|
|
})) |
|
|
})) |
|
|
RelationMainPartApi.createRelationMainPartBatch(deviceMainPartRelList).then(res => { |
|
|
RelationMainPartApi.createRelationMainPartBatch(deviceMainPartRelList).then((res) => { |
|
|
message.success(t('common.createSuccess')) |
|
|
message.success(t('common.createSuccess')) |
|
|
getList() |
|
|
getList() |
|
|
}) |
|
|
}) |
|
@ -449,19 +510,20 @@ const submitEquipmentMainPartRelation = (formField, searchField, val, formRef, r |
|
|
|
|
|
|
|
|
const submitSparePartRelation = (formField, searchField, val, formRef, rowRef) => { |
|
|
const submitSparePartRelation = (formField, searchField, val, formRef, rowRef) => { |
|
|
const equipmentToolSparePartRelList = val.map((element) => ({ |
|
|
const equipmentToolSparePartRelList = val.map((element) => ({ |
|
|
sparePartCode: element.code, |
|
|
sparePartCode: element.number, |
|
|
equipmentToolCode: rowRef.code, |
|
|
equipmentToolCode: rowRef.code, |
|
|
type: 'EQUIPMENT' |
|
|
type: 'EQUIPMENT' |
|
|
})) |
|
|
})) |
|
|
EquipmentToolSparePartApi.createEquipmentToolSparePartBatch(equipmentToolSparePartRelList).then(res => { |
|
|
EquipmentToolSparePartApi.createEquipmentToolSparePartBatch(equipmentToolSparePartRelList).then( |
|
|
|
|
|
(res) => { |
|
|
message.success(t('common.createSuccess')) |
|
|
message.success(t('common.createSuccess')) |
|
|
getList() |
|
|
getList() |
|
|
}) |
|
|
} |
|
|
|
|
|
) |
|
|
} |
|
|
} |
|
|
/** 初始化 **/ |
|
|
/** 初始化 **/ |
|
|
onMounted(async () => { |
|
|
onMounted(async () => { |
|
|
getList() |
|
|
getList() |
|
|
importTemplateData.templateUrl = await ToolAccountsApi.importTemplate() |
|
|
importTemplateData.templateUrl = await ToolAccountsApi.importTemplate() |
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
</script> |
|
|
</script> |
|
|