|
@ -1,11 +1,7 @@ |
|
|
<template> |
|
|
<template> |
|
|
<ContentWrap> |
|
|
<ContentWrap> |
|
|
<!-- 搜索工作栏 --> |
|
|
<!-- 搜索工作栏 --> |
|
|
<Search |
|
|
<Search :schema="EquipmentAccounts.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" /> |
|
|
:schema="EquipmentAccounts.allSchemas.searchSchema" |
|
|
|
|
|
@search="setSearchParams" |
|
|
|
|
|
@reset="setSearchParams" |
|
|
|
|
|
/> |
|
|
|
|
|
</ContentWrap> |
|
|
</ContentWrap> |
|
|
|
|
|
|
|
|
<!-- 列表头部 --> |
|
|
<!-- 列表头部 --> |
|
@ -31,13 +27,13 @@ |
|
|
v-model:currentPage="tableObject.currentPage" |
|
|
v-model:currentPage="tableObject.currentPage" |
|
|
v-model:sort="tableObject.sort" |
|
|
v-model:sort="tableObject.sort" |
|
|
> |
|
|
> |
|
|
<template #code="{ row }"> |
|
|
<template #code="{row}"> |
|
|
<el-button type="primary" link @click="openDetail(row, '代码', row.code)"> |
|
|
<el-button type="primary" link @click="openDetail(row, '代码', row.code)"> |
|
|
<span>{{ row.code }}</span> |
|
|
<span>{{ row.code }}</span> |
|
|
</el-button> |
|
|
</el-button> |
|
|
</template> |
|
|
</template> |
|
|
<template #action="{ row }"> |
|
|
<template #action="{ row }"> |
|
|
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event, row)" /> |
|
|
<ButtonBase :Butttondata="butttondata(row)" @button-base-click="buttonTableClick($event,row)"/> |
|
|
</template> |
|
|
</template> |
|
|
</Table> |
|
|
</Table> |
|
|
</ContentWrap> |
|
|
</ContentWrap> |
|
@ -54,6 +50,8 @@ |
|
|
:isBusiness="false" |
|
|
:isBusiness="false" |
|
|
/> |
|
|
/> |
|
|
|
|
|
|
|
|
|
|
|
<AblesForm ref="ablesFormRef" @success="getData" @close="getClosed"/> |
|
|
|
|
|
|
|
|
<!-- 详情 --> |
|
|
<!-- 详情 --> |
|
|
<DetailLedger |
|
|
<DetailLedger |
|
|
ref="detailRef" |
|
|
ref="detailRef" |
|
@ -74,86 +72,48 @@ |
|
|
<!-- 备件 --> |
|
|
<!-- 备件 --> |
|
|
<SearchTable ref="searchSparePartTableRef" @searchTableSuccess="submitSparePartRelation" /> |
|
|
<SearchTable ref="searchSparePartTableRef" @searchTableSuccess="submitSparePartRelation" /> |
|
|
<!-- 导入 --> |
|
|
<!-- 导入 --> |
|
|
<ImportForm |
|
|
<ImportForm ref="importFormRef" url="/eam/device/equipment-accounts/import" :importTemplateData="importTemplateData" @success="importSuccess" /> |
|
|
ref="importFormRef" |
|
|
|
|
|
url="/eam/device/equipment-accounts/import" |
|
|
|
|
|
:importTemplateData="importTemplateData" |
|
|
|
|
|
@success="importSuccess" |
|
|
|
|
|
/> |
|
|
|
|
|
</template> |
|
|
</template> |
|
|
|
|
|
|
|
|
<script setup lang="ts"> |
|
|
<script setup lang="ts"> |
|
|
import download from '@/utils/download' |
|
|
import download from '@/utils/download' |
|
|
import { EquipmentAccounts, EquipmentAccountsRules } from './equipmentAccounts.data' |
|
|
import { EquipmentAccounts,EquipmentAccountsRules } from './equipmentAccounts.data' |
|
|
import * as EquipmentAccountsApi from '@/api/eam/equipmentAccounts' |
|
|
import * as EquipmentAccountsApi from '@/api/eam/equipmentAccounts' |
|
|
import * as defaultButtons from '@/utils/disposition/defaultButtons' |
|
|
import * as defaultButtons from '@/utils/disposition/defaultButtons' |
|
|
import TableHead from '@/components/TableHead/src/TableHead.vue' |
|
|
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 AblesForm from '@/views/eam/equipmentAccounts/ablesForm.vue' |
|
|
import DetailLedger from '@/components/Detail/src/DetailLedger.vue' |
|
|
import DetailLedger from '@/components/Detail/src/DetailLedger.vue' |
|
|
import { RelationMainPart, RelationMainPartRules } from '../relationMainPart/relationMainPart.data' |
|
|
|
|
|
import * as RelationMainPartApi from '@/api/eam/relationMainPart' |
|
|
import * as RelationMainPartApi from '@/api/eam/relationMainPart' |
|
|
import { |
|
|
import { EquipmentMainPart,EquipmentMainPartRules } from '../equipmentMainPart/equipmentMainPart.data' |
|
|
EquipmentMainPart, |
|
|
|
|
|
EquipmentMainPartRules |
|
|
|
|
|
} from '../equipmentMainPart/equipmentMainPart.data' |
|
|
|
|
|
import * as EquipmentMainPartApi from '@/api/eam/equipmentMainPart' |
|
|
import * as EquipmentMainPartApi from '@/api/eam/equipmentMainPart' |
|
|
import { Item, ItemRules } from '../item/item.data' |
|
|
import { SparePart,SparePartRules } from '../sparePart/sparePart.data' |
|
|
import * as ItemApi from '@/api/eam/item' |
|
|
import * as SparePartApi from '@/api/eam/sparePart' |
|
|
import { |
|
|
|
|
|
EquipmentToolSparePart, |
|
|
|
|
|
EquipmentToolSparePartRules |
|
|
|
|
|
} from '../equipmentToolSparePart/equipmentToolSparePart.data' |
|
|
|
|
|
import * as EquipmentToolSparePartApi from '@/api/eam/equipmentToolSparePart' |
|
|
import * as EquipmentToolSparePartApi from '@/api/eam/equipmentToolSparePart' |
|
|
import { |
|
|
import { EquipmentReportRepairRequest,EquipmentReportRepairRequestRules } from '../equipmentReportRepairRequest/equipmentReportRepairRequest.data' |
|
|
EquipmentReportRepairRequest, |
|
|
|
|
|
EquipmentReportRepairRequestRules |
|
|
|
|
|
} from '../equipmentReportRepairRequest/equipmentReportRepairRequest.data' |
|
|
|
|
|
import * as EquipmentReportRepairRequestApi from '@/api/eam/equipmentReportRepairRequest' |
|
|
import * as EquipmentReportRepairRequestApi from '@/api/eam/equipmentReportRepairRequest' |
|
|
import { |
|
|
import { EquipmentSpotCheckRecordMain,EquipmentSpotCheckRecordMainRules } from '../equipmentSpotCheckRecordMain/equipmentSpotCheckRecordMain.data' |
|
|
EquipmentSpotCheckRecordMain, |
|
|
|
|
|
EquipmentSpotCheckRecordMainRules |
|
|
|
|
|
} from '../equipmentSpotCheckRecordMain/equipmentSpotCheckRecordMain.data' |
|
|
|
|
|
import * as EquipmentSpotCheckRecordMainApi from '@/api/eam/equipmentSpotCheckRecordMain' |
|
|
import * as EquipmentSpotCheckRecordMainApi from '@/api/eam/equipmentSpotCheckRecordMain' |
|
|
import { |
|
|
import { EquipmentSpotCheckRecordDetail,EquipmentSpotCheckRecordDetailRules } from '../equipmentSpotCheckRecordDetail/equipmentSpotCheckRecordDetail.data' |
|
|
EquipmentSpotCheckRecordDetail, |
|
|
|
|
|
EquipmentSpotCheckRecordDetailRules |
|
|
|
|
|
} from '../equipmentSpotCheckRecordDetail/equipmentSpotCheckRecordDetail.data' |
|
|
|
|
|
import * as EquipmentSpotCheckRecordDetailApi from '@/api/eam/equipmentSpotCheckRecordDetail' |
|
|
import * as EquipmentSpotCheckRecordDetailApi from '@/api/eam/equipmentSpotCheckRecordDetail' |
|
|
import { |
|
|
import { EquipmentInspectionRecordMain,EquipmentInspectionRecordMainRules } from '../equipmentInspectionRecordMain/equipmentInspectionRecordMain.data' |
|
|
EquipmentInspectionRecordMain, |
|
|
|
|
|
EquipmentInspectionRecordMainRules |
|
|
|
|
|
} from '../equipmentInspectionRecordMain/equipmentInspectionRecordMain.data' |
|
|
|
|
|
import * as EquipmentInspectionRecordMainApi from '@/api/eam/equipmentInspectionRecordMain' |
|
|
import * as EquipmentInspectionRecordMainApi from '@/api/eam/equipmentInspectionRecordMain' |
|
|
import { |
|
|
import { EquipmentInspectionRecordDetail,EquipmentInspectionRecordDetailRules } from '../equipmentInspectionRecordDetail/equipmentInspectionRecordDetail.data' |
|
|
EquipmentInspectionRecordDetail, |
|
|
|
|
|
EquipmentInspectionRecordDetailRules |
|
|
|
|
|
} from '../equipmentInspectionRecordDetail/equipmentInspectionRecordDetail.data' |
|
|
|
|
|
import * as EquipmentInspectionRecordDetailApi from '@/api/eam/equipmentInspectionRecordDetail' |
|
|
import * as EquipmentInspectionRecordDetailApi from '@/api/eam/equipmentInspectionRecordDetail' |
|
|
import { |
|
|
import { EquipmentRepairRecordMain,EquipmentRepairRecordMainRules } from '../equipmentRepairRecordMain/equipmentRepairRecordMain.data' |
|
|
EquipmentRepairRecordMain, |
|
|
|
|
|
EquipmentRepairRecordMainRules |
|
|
|
|
|
} from '../equipmentRepairRecordMain/equipmentRepairRecordMain.data' |
|
|
|
|
|
import * as EquipmentRepairRecordMainApi from '@/api/eam/equipmentRepairRecordMain' |
|
|
import * as EquipmentRepairRecordMainApi from '@/api/eam/equipmentRepairRecordMain' |
|
|
import { |
|
|
import { EquipmentRepairRecordDetail,EquipmentRepairRecordDetailRules } from '../equipmentRepairRecordDetail/equipmentRepairRecordDetail.data' |
|
|
EquipmentRepairRecordDetail, |
|
|
|
|
|
EquipmentRepairRecordDetailRules |
|
|
|
|
|
} from '../equipmentRepairRecordDetail/equipmentRepairRecordDetail.data' |
|
|
|
|
|
import * as EquipmentRepairRecordDetailApi from '@/api/eam/equipmentRepairRecordDetail' |
|
|
import * as EquipmentRepairRecordDetailApi from '@/api/eam/equipmentRepairRecordDetail' |
|
|
import { |
|
|
import { EquipmentMaintenanceRecordMain,EquipmentMaintenanceRecordMainRules } from '../equipmentMaintenanceRecordMain/equipmentMaintenanceRecordMain.data' |
|
|
EquipmentMaintenanceRecordMain, |
|
|
|
|
|
EquipmentMaintenanceRecordMainRules |
|
|
|
|
|
} from '../equipmentMaintenanceRecordMain/equipmentMaintenanceRecordMain.data' |
|
|
|
|
|
import * as EquipmentMaintenanceRecordMainApi from '@/api/eam/equipmentMaintenanceRecordMain' |
|
|
import * as EquipmentMaintenanceRecordMainApi from '@/api/eam/equipmentMaintenanceRecordMain' |
|
|
import { |
|
|
import { EquipmentMaintenanceRecordDetail,EquipmentMaintenanceRecordDetailRules } from '../equipmentMaintenanceRecordDetail/equipmentMaintenanceRecordDetail.data' |
|
|
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' |
|
|
import * as EquipmentSupplierApi from '@/api/eam/equipmentSupplier' |
|
|
import * as EquipmentSupplierApi from '@/api/eam/equipmentSupplier' |
|
|
import * as EquipmentManufacturerApi from '@/api/eam/equipmentManufacturer' |
|
|
import * as EquipmentManufacturerApi from '@/api/eam/equipmentManufacturer' |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
defineOptions({ name: 'EquipmentAccounts' }) |
|
|
defineOptions({ name: 'EquipmentAccounts' }) |
|
|
|
|
|
|
|
|
const message = useMessage() // 消息弹窗 |
|
|
const message = useMessage() // 消息弹窗 |
|
@ -164,27 +124,28 @@ const routeName = ref() |
|
|
const deviceNumber = ref() |
|
|
const deviceNumber = ref() |
|
|
routeName.value = route.name |
|
|
routeName.value = route.name |
|
|
const tableColumns = ref(EquipmentAccounts.allSchemas.tableColumns) |
|
|
const tableColumns = ref(EquipmentAccounts.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() |
|
|
const dialogAllSchemas = ref() |
|
|
const dialogAllSchemas = ref() |
|
|
|
|
|
|
|
|
// 查询页面返回 |
|
|
// 查询页面返回 |
|
|
const searchTableSuccess = (formField, searchField, val, formRef) => { |
|
|
const searchTableSuccess = (formField, searchField, val, formRef) => { |
|
|
nextTick(() => { |
|
|
nextTick(() => { |
|
|
const setV = {} |
|
|
const setV = {} |
|
|
setV[formField] = val[0][searchField] |
|
|
setV[formField] = val[0][searchField] |
|
|
if (formField == 'workshopName') { |
|
|
if(formField == 'workshopName'){ |
|
|
setV['workshopCode'] = val[0]['code'] |
|
|
setV['workshopCode'] = val[0]['code'] |
|
|
setV['workshopName'] = val[0]['name'] |
|
|
setV['workshopName'] = val[0]['name'] |
|
|
} else if (formField == 'lineName') { |
|
|
}else if(formField == 'lineName'){ |
|
|
setV['lineCode'] = val[0]['code'] |
|
|
setV['lineCode'] = val[0]['code'] |
|
|
setV['lineName'] = val[0]['name'] |
|
|
setV['lineName'] = val[0]['name'] |
|
|
} else if (formField == 'manufactureName') { |
|
|
}else if(formField == 'manufactureName'){ |
|
|
setV['manufactureCode'] = val[0]['number'] |
|
|
setV['manufactureCode'] = val[0]['number'] |
|
|
setV['manufactureName'] = val[0]['name'] |
|
|
setV['manufactureName'] = val[0]['name'] |
|
|
} else if (formField == 'supplierName') { |
|
|
}else if(formField == 'supplierName'){ |
|
|
setV['supplierCode'] = val[0]['number'] |
|
|
setV['supplierCode'] = val[0]['number'] |
|
|
setV['supplierName'] = val[0]['name'] |
|
|
setV['supplierName'] = val[0]['name'] |
|
|
} |
|
|
} |
|
@ -193,22 +154,24 @@ const searchTableSuccess = (formField, searchField, val, formRef) => { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
const operationRecordList = ref([ |
|
|
const operationRecordList = ref([ |
|
|
{ label: '报修记录', value: 'report' }, |
|
|
{label:'报修记录',value:'report'}, |
|
|
{ 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'}, |
|
|
|
|
|
|
|
|
]) |
|
|
]) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const dynamicInfoFields = ref([ |
|
|
const dynamicInfoFields = ref([ |
|
|
'totalRunningTime', |
|
|
"totalRunningTime", |
|
|
'maintenanceRunningTime', |
|
|
"maintenanceRunningTime", |
|
|
'usageTimes', |
|
|
"usageTimes", |
|
|
'lastInspectionDate', |
|
|
"lastInspectionDate", |
|
|
'outageRate', |
|
|
"outageRate", |
|
|
'breakdownRecover', |
|
|
"breakdownRecover", |
|
|
'purchaseInterval' |
|
|
"purchaseInterval" |
|
|
]) |
|
|
]); |
|
|
|
|
|
|
|
|
// 字段设置 更新主列表字段 |
|
|
// 字段设置 更新主列表字段 |
|
|
const updataTableColumns = (val) => { |
|
|
const updataTableColumns = (val) => { |
|
@ -224,12 +187,12 @@ const { getList, setSearchParams } = tableMethods |
|
|
|
|
|
|
|
|
// 列表头部按钮 |
|
|
// 列表头部按钮 |
|
|
const HeadButttondata = [ |
|
|
const HeadButttondata = [ |
|
|
defaultButtons.defaultAddBtn({ hasPermi: 'eam:equipment-accounts:create' }), // 新增 |
|
|
defaultButtons.defaultAddBtn({hasPermi:'eam:equipment-accounts:create'}), // 新增 |
|
|
defaultButtons.defaultImportBtn({ hasPermi: 'eam:equipment-accounts:import' }), // 导入 |
|
|
defaultButtons.defaultImportBtn({hasPermi:'eam:equipment-accounts:import'}), // 导入 |
|
|
defaultButtons.defaultExportBtn({ hasPermi: 'eam:equipment-accounts:export' }), // 导出 |
|
|
defaultButtons.defaultExportBtn({hasPermi:'eam:equipment-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', |
|
@ -242,85 +205,105 @@ 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) |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const isShowMainButton = (row,val) => { |
|
|
|
|
|
if (val.indexOf(row.available) > -1) { |
|
|
|
|
|
return false |
|
|
|
|
|
} else { |
|
|
|
|
|
return true |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
// 列表-操作按钮 |
|
|
// 列表-操作按钮 |
|
|
const butttondata = [ |
|
|
const butttondata = (row) => { |
|
|
defaultButtons.mainListEditBtn({ hasPermi: 'eam:equipment-accounts:update' }), // 编辑 |
|
|
return [ |
|
|
defaultButtons.componentBtn({ hasPermi: 'eam:equipment-accounts:component' }), // 部件 |
|
|
defaultButtons.mainListEditBtn({hasPermi:'eam:equipment-accounts:update'}), // 编辑 |
|
|
defaultButtons.sparePartBtn({ hasPermi: 'eam:equipment-accounts:item' }) // 备件 |
|
|
defaultButtons.componentBtn({hasPermi:'eam:equipment-accounts:component'}), // 部件 |
|
|
// defaultButtons.mainListDeleteBtn({hasPermi:'eam:equipment-accounts:delete'}), // 删除 |
|
|
defaultButtons.sparePartBtn({hasPermi:'eam:equipment-accounts:item'}), // 备件 |
|
|
] |
|
|
defaultButtons.mainListEnableBtn({hide:isShowMainButton(row,['FALSE']),hasPermi:'eam:basicFaultType:update'}), |
|
|
|
|
|
defaultButtons.mainListDisableBtn({hide:isShowMainButton(row,['TRUE']),hasPermi:'eam:basicFaultType:update'}), |
|
|
|
|
|
] |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//启用禁用 |
|
|
|
|
|
const ablesFormRef = ref() |
|
|
|
|
|
function openables(row, val) { |
|
|
|
|
|
ablesFormRef.value.open(val,row); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
// 列表-操作按钮事件 |
|
|
// 列表-操作按钮事件 |
|
|
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) |
|
|
|
|
|
} else if (val == 'enable') { // 启用/禁用 |
|
|
|
|
|
openables(row,val) |
|
|
|
|
|
} else if (val == 'disable') { // 启用/禁用 |
|
|
|
|
|
openables(row,val) |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** 添加/修改操作 */ |
|
|
/** 添加/修改操作 */ |
|
|
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 = |
|
|
const equipmentManufacturerNoPage = await EquipmentManufacturerApi.getEquipmentManufacturerNoPage({}) |
|
|
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( |
|
|
row.manufactureName = equipmentManufacturerNoPage?.find(item=>item.number == row.manufactureCode)?.name |
|
|
(item) => item.number == row.manufactureCode |
|
|
row.supplierName = equipmentSupplierNoPage?.find(item=>item.number == row.supplierCode)?.name |
|
|
)?.name |
|
|
|
|
|
row.supplierName = equipmentSupplierNoPage?.find( |
|
|
EquipmentAccounts.allSchemas.formSchema.forEach((item) => { |
|
|
(item) => item.number == row.supplierCode |
|
|
if (item.field == 'status') { |
|
|
)?.name |
|
|
item.componentProps.disabled = false |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
}else{ |
|
|
|
|
|
EquipmentAccounts.allSchemas.formSchema.forEach((item) => { |
|
|
|
|
|
if (item.field == 'status') { |
|
|
|
|
|
item.componentProps.disabled = true |
|
|
|
|
|
item.value = 'TOACCEPT' |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
} |
|
|
} |
|
|
basicFormRef.value.open(type, row) |
|
|
basicFormRef.value.open(type, row) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// form表单提交 |
|
|
// form表单提交 |
|
|
const formsSuccess = async (formType, data) => { |
|
|
const formsSuccess = async (formType,data) => { |
|
|
var isHave = EquipmentAccounts.allSchemas.formSchema.some(function (item) { |
|
|
var isHave =EquipmentAccounts.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 EquipmentAccountsApi.createEquipmentAccounts(data) |
|
|
await EquipmentAccountsApi.createEquipmentAccounts(data) |
|
|
message.success(t('common.createSuccess')) |
|
|
message.success(t('common.createSuccess')) |
|
@ -391,49 +374,60 @@ const searchFormClick = (searchData) => { |
|
|
getList() // 刷新当前列表 |
|
|
getList() // 刷新当前列表 |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//ablesForm 提交按钮回传 |
|
|
|
|
|
const getData=(val)=> { |
|
|
|
|
|
nextTick?.(async () => { |
|
|
|
|
|
await getList() |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//ablesForm 关闭按钮回传 |
|
|
|
|
|
const getClosed=(val)=> { |
|
|
|
|
|
nextTick?.(() => { |
|
|
|
|
|
console.log(val) |
|
|
|
|
|
getList() |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const searchTableRef = ref() |
|
|
const searchTableRef = ref() |
|
|
const searchSparePartTableRef = ref() |
|
|
const searchSparePartTableRef = ref() |
|
|
const searchTableSelections = ref([]) |
|
|
const searchTableSelections = ref([]) |
|
|
const searchTableSparePartSelections = ref([]) |
|
|
const searchTableSparePartSelections = ref([]) |
|
|
const syncData = async (row) => { |
|
|
const syncData = async (row) => { |
|
|
searchTableSparePartSelections.value = [] |
|
|
searchTableSparePartSelections.value = [] |
|
|
await RelationMainPartApi.getRelationMainPartNoPage({ |
|
|
await RelationMainPartApi.getRelationMainPartNoPage({ equipmentCode: row.code,type: 'DEVICE' }).then(async (res) => { |
|
|
equipmentCode: row.code, |
|
|
await EquipmentMainPartApi.getEquipmentMainPartNoPage({type: 'DEVICE' }).then(response => { |
|
|
type: 'DEVICE' |
|
|
searchTableSelections.value = response.filter(element => { |
|
|
}).then(async (res) => { |
|
|
let flag = false; |
|
|
await EquipmentMainPartApi.getEquipmentMainPartNoPage({ type: 'DEVICE' }).then((response) => { |
|
|
res.forEach(item => { |
|
|
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({ |
|
|
await EquipmentToolSparePartApi.getEquipmentToolSparePartNoPage({ equipmentToolCode: row.code}).then(async (res) => { |
|
|
equipmentToolCode: row.code |
|
|
await SparePartApi.getSparePartNoPage({}).then(response => { |
|
|
}).then(async (res) => { |
|
|
searchTableSparePartSelections.value = response.filter(element => { |
|
|
await SparePartApi.getSparePartNoPage({}).then((response) => { |
|
|
let flag = false; |
|
|
searchTableSparePartSelections.value = response.filter((element) => { |
|
|
res.forEach(item => { |
|
|
let flag = false |
|
|
|
|
|
res.forEach((item) => { |
|
|
|
|
|
if (element.code == item.sparePartCode) { |
|
|
if (element.code == item.sparePartCode) { |
|
|
flag = true |
|
|
flag = true; |
|
|
} |
|
|
} |
|
|
}) |
|
|
}); |
|
|
return flag |
|
|
return flag; |
|
|
}) |
|
|
}); |
|
|
}) |
|
|
}); |
|
|
}) |
|
|
}); |
|
|
} |
|
|
}; |
|
|
/** 绑定备件操作 */ |
|
|
/** 绑定备件操作 */ |
|
|
const openComponent = async (row: any) => { |
|
|
const openComponent = async (row : any) => { |
|
|
await syncData(row) |
|
|
await syncData(row) |
|
|
searchTableRef.value.open( |
|
|
searchTableRef.value.open( |
|
|
'选择部件', |
|
|
'选择部件', |
|
@ -442,9 +436,9 @@ const openComponent = async (row: any) => { |
|
|
'equipmentMainPart', |
|
|
'equipmentMainPart', |
|
|
EquipmentMainPart.allSchemas.searchSchema, |
|
|
EquipmentMainPart.allSchemas.searchSchema, |
|
|
true, |
|
|
true, |
|
|
null, //type |
|
|
null,//type |
|
|
row, |
|
|
row, |
|
|
{ type: 'DEVICE' }, |
|
|
{type: 'DEVICE'}, |
|
|
null, |
|
|
null, |
|
|
null, |
|
|
null, |
|
|
null, |
|
|
null, |
|
@ -452,16 +446,16 @@ const openComponent = async (row: any) => { |
|
|
) |
|
|
) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
const openSparePart = async (row: any) => { |
|
|
const openSparePart = async (row : any) => { |
|
|
await syncSparePartData(row) |
|
|
await syncSparePartData(row) |
|
|
searchSparePartTableRef.value.open( |
|
|
searchSparePartTableRef.value.open( |
|
|
'选择备件', |
|
|
'选择备件', |
|
|
Item.allSchemas, |
|
|
SparePart.allSchemas, |
|
|
ItemApi.getItemPage, |
|
|
SparePartApi.getSparePartPage, |
|
|
'item', |
|
|
'sparePartPart', |
|
|
Item.allSchemas.searchSchema, |
|
|
SparePart.allSchemas.searchSchema, |
|
|
true, |
|
|
true, |
|
|
null, //type |
|
|
null,//type |
|
|
row, |
|
|
row, |
|
|
null, |
|
|
null, |
|
|
null, |
|
|
null, |
|
@ -473,36 +467,35 @@ 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.number, |
|
|
mainPartCode: element.code, |
|
|
equipmentCode: rowRef.code, |
|
|
equipmentCode: rowRef.code, |
|
|
type: 'DEVICE' |
|
|
type: 'DEVICE' |
|
|
})) |
|
|
})) |
|
|
RelationMainPartApi.createRelationMainPartBatch(deviceMainPartRelList).then((res) => { |
|
|
RelationMainPartApi.createRelationMainPartBatch(deviceMainPartRelList).then(res => { |
|
|
message.success(t('common.createSuccess')) |
|
|
message.success(t('common.createSuccess')) |
|
|
getList() |
|
|
getList() |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
const handleOperationTabsChange = (val) => { |
|
|
const handleOperationTabsChange = (val) => { |
|
|
if (val == 'report') { |
|
|
if(val == 'report'){ |
|
|
apiPage.value = EquipmentReportRepairRequestApi.getEquipmentReportRepairRequestPage |
|
|
apiPage.value = EquipmentReportRepairRequestApi.getEquipmentReportRepairRequestPage |
|
|
detailAllSchemas.value = EquipmentReportRepairRequest.allSchemas |
|
|
detailAllSchemas.value = EquipmentReportRepairRequest.allSchemas |
|
|
} else if (val == 'repair') { |
|
|
}else if(val == 'repair'){ |
|
|
apiPage.value = EquipmentRepairRecordMainApi.getEquipmentRepairRecordMainPage |
|
|
apiPage.value = EquipmentRepairRecordMainApi.getEquipmentRepairRecordMainPage |
|
|
detailAllSchemas.value = EquipmentRepairRecordMain.allSchemas |
|
|
detailAllSchemas.value = EquipmentRepairRecordMain.allSchemas |
|
|
dialogApiPage.value = EquipmentRepairRecordDetailApi.getEquipmentRepairRecordDetailPage |
|
|
dialogApiPage.value = EquipmentRepairRecordDetailApi.getEquipmentRepairRecordDetailPage |
|
|
dialogAllSchemas.value = EquipmentRepairRecordDetail.allSchemas |
|
|
dialogAllSchemas.value = EquipmentRepairRecordDetail.allSchemas |
|
|
} 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 = |
|
|
dialogApiPage.value = EquipmentMaintenanceRecordDetailApi.getEquipmentMaintenanceRecordDetailPage |
|
|
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 |
|
|
detailAllSchemas.value = EquipmentInspectionRecordMain.allSchemas |
|
|
detailAllSchemas.value = EquipmentInspectionRecordMain.allSchemas |
|
|
dialogApiPage.value = EquipmentInspectionRecordDetailApi.getEquipmentInspectionRecordDetailPage |
|
|
dialogApiPage.value = EquipmentInspectionRecordDetailApi.getEquipmentInspectionRecordDetailPage |
|
|
dialogAllSchemas.value = EquipmentInspectionRecordDetail.allSchemas |
|
|
dialogAllSchemas.value = EquipmentInspectionRecordDetail.allSchemas |
|
|
} else if (val == 'spot_check') { |
|
|
}else if(val == 'spot_check'){ |
|
|
apiPage.value = EquipmentSpotCheckRecordMainApi.getEquipmentSpotCheckRecordMainPage |
|
|
apiPage.value = EquipmentSpotCheckRecordMainApi.getEquipmentSpotCheckRecordMainPage |
|
|
detailAllSchemas.value = EquipmentSpotCheckRecordMain.allSchemas |
|
|
detailAllSchemas.value = EquipmentSpotCheckRecordMain.allSchemas |
|
|
dialogApiPage.value = EquipmentSpotCheckRecordDetailApi.getEquipmentSpotCheckRecordDetailPage |
|
|
dialogApiPage.value = EquipmentSpotCheckRecordDetailApi.getEquipmentSpotCheckRecordDetailPage |
|
@ -512,16 +505,14 @@ const handleOperationTabsChange = (val) => { |
|
|
|
|
|
|
|
|
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.number, |
|
|
sparePartCode: element.code, |
|
|
equipmentToolCode: rowRef.code, |
|
|
equipmentToolCode: rowRef.code, |
|
|
type: 'DEVICE' |
|
|
type: 'DEVICE' |
|
|
})) |
|
|
})) |
|
|
EquipmentToolSparePartApi.createEquipmentToolSparePartBatch(equipmentToolSparePartRelList).then( |
|
|
EquipmentToolSparePartApi.createEquipmentToolSparePartBatch(equipmentToolSparePartRelList).then(res => { |
|
|
(res) => { |
|
|
|
|
|
message.success(t('common.createSuccess')) |
|
|
message.success(t('common.createSuccess')) |
|
|
getList() |
|
|
getList() |
|
|
} |
|
|
}) |
|
|
) |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** 初始化 **/ |
|
|
/** 初始化 **/ |
|
@ -529,4 +520,5 @@ onMounted(async () => { |
|
|
getList() |
|
|
getList() |
|
|
importTemplateData.templateUrl = await EquipmentAccountsApi.importTemplate() |
|
|
importTemplateData.templateUrl = await EquipmentAccountsApi.importTemplate() |
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
</script> |
|
|
</script> |
|
|