|
@ -27,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 #number="{row}"> |
|
|
<el-button type="primary" link @click="openDetail(row, '代码', row.code)"> |
|
|
<el-button type="primary" link @click="openDetail(row, '代码', row.number)"> |
|
|
<span>{{ row.code }}</span> |
|
|
<span>{{ row.number }}</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> |
|
@ -48,10 +48,18 @@ |
|
|
:apiCreate="EquipmentMaintenanceMainApi.createEquipmentMaintenanceMain" |
|
|
:apiCreate="EquipmentMaintenanceMainApi.createEquipmentMaintenanceMain" |
|
|
@searchTableSuccess="searchTableSuccess" |
|
|
@searchTableSuccess="searchTableSuccess" |
|
|
:isBusiness="false" |
|
|
:isBusiness="false" |
|
|
|
|
|
@onChange="onChange" |
|
|
/> |
|
|
/> |
|
|
|
|
|
|
|
|
<!-- 详情 --> |
|
|
<!-- 详情 --> |
|
|
<Detail ref="detailRef" :isBasic="true" :allSchemas="EquipmentMaintenanceMain.allSchemas" /> |
|
|
<Detail ref="detailRef" |
|
|
|
|
|
:isBasic="false" |
|
|
|
|
|
:allSchemas="EquipmentMaintenanceMain.allSchemas" |
|
|
|
|
|
:detailAllSchemas="EquipmentMaintenanceDetail.allSchemas" |
|
|
|
|
|
:apiPage="EquipmentMaintenanceDetailApi.getEquipmentMaintenanceDetailPage" |
|
|
|
|
|
@searchTableSuccessDetail="searchTableSuccessDetail" |
|
|
|
|
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
|
<!-- 导入 --> |
|
|
<!-- 导入 --> |
|
|
<ImportForm ref="importFormRef" url="/eam/equipment-maintenance-main/import" :importTemplateData="importTemplateData" @success="importSuccess" /> |
|
|
<ImportForm ref="importFormRef" url="/eam/equipment-maintenance-main/import" :importTemplateData="importTemplateData" @success="importSuccess" /> |
|
@ -59,12 +67,18 @@ |
|
|
|
|
|
|
|
|
<script setup lang="ts"> |
|
|
<script setup lang="ts"> |
|
|
import download from '@/utils/download' |
|
|
import download from '@/utils/download' |
|
|
import { EquipmentMaintenanceMain,EquipmentMaintenanceMainRules } from './equipmentMaintenanceMain.data' |
|
|
import { EquipmentMaintenanceMain,EquipmentMaintenanceMainRules,EquipmentMaintenanceDetail } from './equipmentMaintenanceMain.data' |
|
|
import * as EquipmentMaintenanceMainApi from '@/api/eam/equipmentMaintenanceMain' |
|
|
import * as EquipmentMaintenanceMainApi from '@/api/eam/equipmentMaintenanceMain' |
|
|
|
|
|
import * as EquipmentMaintenanceDetailApi from '@/api/eam/equipmentMaintenanceDetail' |
|
|
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 Detail from '@/components/Detail/src/Detail.vue' |
|
|
import Detail from '@/components/Detail/src/Detail.vue' |
|
|
|
|
|
import {Maintenance} from "@/views/eam/maintenance/maintenance.data"; |
|
|
|
|
|
import {EquipmentAccounts} from "@/views/eam/equipmentAccounts/equipmentAccounts.data"; |
|
|
|
|
|
import * as EquipmentItemApi from "@/api/eam/equipmentAccounts"; |
|
|
|
|
|
import {ToolAccounts} from "@/views/eam/toolAccounts/toolAccounts.data"; |
|
|
|
|
|
import * as ToolItemApi from "@/api/eam/toolAccounts"; |
|
|
|
|
|
|
|
|
defineOptions({ name: 'EquipmentMaintenanceMain' }) |
|
|
defineOptions({ name: 'EquipmentMaintenanceMain' }) |
|
|
|
|
|
|
|
@ -131,11 +145,23 @@ const buttonBaseClick = (val, item) => { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const isShowMainButton = (row,val) => { |
|
|
|
|
|
if (val.indexOf(row.available) > -1) { |
|
|
|
|
|
return false |
|
|
|
|
|
} else { |
|
|
|
|
|
return true |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
// 列表-操作按钮 |
|
|
// 列表-操作按钮 |
|
|
const butttondata = [ |
|
|
const butttondata = (row) => { |
|
|
|
|
|
return [ |
|
|
defaultButtons.mainListEditBtn({hasPermi:'eam:equipmentMaintenanceMain:update'}), // 编辑 |
|
|
defaultButtons.mainListEditBtn({hasPermi:'eam:equipmentMaintenanceMain:update'}), // 编辑 |
|
|
defaultButtons.mainListDeleteBtn({hasPermi:'eam:equipmentMaintenanceMain:delete'}), // 删除 |
|
|
//defaultButtons.mainListDeleteBtn({hasPermi:'eam:equipmentMaintenanceMain:delete'}), // 删除 |
|
|
] |
|
|
defaultButtons.mainListEnableBtn({hide:isShowMainButton(row,['FALSE']),hasPermi:'eam:maintenance:update'}), |
|
|
|
|
|
defaultButtons.mainListDisableBtn({hide:isShowMainButton(row,['TRUE']),hasPermi:'eam:maintenance:update'}), |
|
|
|
|
|
] |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
// 列表-操作按钮事件 |
|
|
// 列表-操作按钮事件 |
|
|
const buttonTableClick = async (val, row) => { |
|
|
const buttonTableClick = async (val, row) => { |
|
@ -149,6 +175,20 @@ const buttonTableClick = async (val, row) => { |
|
|
/** 添加/修改操作 */ |
|
|
/** 添加/修改操作 */ |
|
|
const basicFormRef = ref() |
|
|
const basicFormRef = ref() |
|
|
const openForm = (type: string, row?: any) => { |
|
|
const openForm = (type: string, row?: any) => { |
|
|
|
|
|
if(type == "create"){ |
|
|
|
|
|
EquipmentMaintenanceMain.allSchemas.formSchema.forEach((item) => { |
|
|
|
|
|
if(item.field == 'status'){ |
|
|
|
|
|
item.value = '0'; |
|
|
|
|
|
item.componentProps.disabled = true |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
}else{ |
|
|
|
|
|
EquipmentMaintenanceMain.allSchemas.formSchema.forEach((item) => { |
|
|
|
|
|
if(item.field == 'status'){ |
|
|
|
|
|
item.componentProps.disabled = true |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
basicFormRef.value.open(type, row) |
|
|
basicFormRef.value.open(type, row) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -195,6 +235,66 @@ const handleDelete = async (id: number) => { |
|
|
} catch {} |
|
|
} catch {} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** 启用 */ |
|
|
|
|
|
const handleEnable = async (id: number) => { |
|
|
|
|
|
try { |
|
|
|
|
|
const params = ref({ |
|
|
|
|
|
id: '', |
|
|
|
|
|
available:'', |
|
|
|
|
|
}) |
|
|
|
|
|
params.value.id = id |
|
|
|
|
|
params.value.available = 'TRUE' |
|
|
|
|
|
await EquipmentMaintenanceMainApi.updateEnableCode(params.value) |
|
|
|
|
|
message.success(t('common.updateSuccess')) |
|
|
|
|
|
// 刷新列表 |
|
|
|
|
|
await getList() |
|
|
|
|
|
} catch {} |
|
|
|
|
|
} |
|
|
|
|
|
/** 禁用 */ |
|
|
|
|
|
const handleDisable = async (id: number) => { |
|
|
|
|
|
try { |
|
|
|
|
|
const params = ref({ |
|
|
|
|
|
id: '', |
|
|
|
|
|
available:'', |
|
|
|
|
|
}) |
|
|
|
|
|
params.value.id = id |
|
|
|
|
|
params.value.available = 'FALSE' |
|
|
|
|
|
await EquipmentMaintenanceMainApi.updateEnableCode(params.value) |
|
|
|
|
|
message.success(t('common.updateSuccess')) |
|
|
|
|
|
// 刷新列表 |
|
|
|
|
|
await getList() |
|
|
|
|
|
} catch {} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const onChange = (field, item) => { |
|
|
|
|
|
console.log(field) |
|
|
|
|
|
console.log(item) |
|
|
|
|
|
//设备 |
|
|
|
|
|
if(field == 'type' && item == 'DEVICE'){ |
|
|
|
|
|
Maintenance.allSchemas.formSchema.forEach((items) => { |
|
|
|
|
|
if (items.field == 'equipmentCode') { |
|
|
|
|
|
basicFormRef.value.formRef.setValues({ |
|
|
|
|
|
equipmentCode:'' |
|
|
|
|
|
}) |
|
|
|
|
|
items.componentProps.searchAllSchemas = EquipmentAccounts.allSchemas |
|
|
|
|
|
items.componentProps.searchPage = EquipmentItemApi.getEquipmentAccountsPage |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
//工装 |
|
|
|
|
|
if(field == 'type' && item == 'EQUIPMENT'){ |
|
|
|
|
|
Maintenance.allSchemas.formSchema.forEach((items) => { |
|
|
|
|
|
if (items.field == 'equipmentCode') { |
|
|
|
|
|
basicFormRef.value.formRef.setValues({ |
|
|
|
|
|
equipmentCode:'' |
|
|
|
|
|
}) |
|
|
|
|
|
items.componentProps.searchAllSchemas = ToolAccounts.allSchemas |
|
|
|
|
|
items.componentProps.searchPage = ToolItemApi.getToolAccountsPage |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
/** 导出按钮操作 */ |
|
|
/** 导出按钮操作 */ |
|
|
const exportLoading = ref(false) // 导出的加载中 |
|
|
const exportLoading = ref(false) // 导出的加载中 |
|
|
const handleExport = async () => { |
|
|
const handleExport = async () => { |
|
|