|
|
@ -35,6 +35,9 @@ |
|
|
|
<template #action="{ row }"> |
|
|
|
<ButtonBase :Butttondata="butttondata(row)" @button-base-click="buttonTableClick($event,row)" /> |
|
|
|
</template> |
|
|
|
<template #images="{ row }"> |
|
|
|
<ButtonBase v-if="row.images === 'TRUE' ":Butttondata="butttondataView(row)" @button-base-click="buttonTableClick($event, row)" /> |
|
|
|
</template> |
|
|
|
</Table> |
|
|
|
</ContentWrap> |
|
|
|
|
|
|
@ -54,6 +57,16 @@ |
|
|
|
<!-- 详情 --> |
|
|
|
<Detail ref="detailRef" :isBasic="true" :allSchemas="EquipmentReportRepairRequest.allSchemas" /> |
|
|
|
|
|
|
|
<Dialog |
|
|
|
ref="basicFormViewRef" |
|
|
|
v-model="showView" |
|
|
|
:key="viewKey" |
|
|
|
:closeOnClickModal="true" |
|
|
|
:title="viewTitle" |
|
|
|
> |
|
|
|
<el-image v-for="url in urls" :key="url" :src="url" lazy /> |
|
|
|
</Dialog> |
|
|
|
|
|
|
|
<!-- 审核页面 --> |
|
|
|
<AudiForm ref="audiFormRef" @success="getData" @close="getClosed"/> |
|
|
|
|
|
|
@ -61,6 +74,7 @@ |
|
|
|
<ImportForm ref="importFormRef" url="/eam/equipment-report-repair-request/import" :importTemplateData="importTemplateData" @success="importSuccess" /> |
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
|
|
<script setup lang="ts"> |
|
|
|
import download from '@/utils/download' |
|
|
|
import { EquipmentReportRepairRequest,EquipmentReportRepairRequestRules } from './equipmentReportRepairRequest.data' |
|
|
@ -74,7 +88,7 @@ import {EquipmentAccounts} from "@/views/eam/equipmentAccounts/equipmentAccounts |
|
|
|
import * as EquipmentItemApi from "@/api/eam/equipmentAccounts"; |
|
|
|
import {ToolAccounts} from "@/views/eam/toolAccounts/toolAccounts.data"; |
|
|
|
import * as ToolItemApi from "@/api/eam/toolAccounts"; |
|
|
|
import {createEquipmentWeixiuOrder} from "@/api/eam/equipmentReportRepairRequest"; |
|
|
|
import * as EquipmentReportRepairApi from "@/api/eam/equipmentReportRepairRequest"; |
|
|
|
|
|
|
|
defineOptions({ name: 'EquipmentReportRepairRequest' }) |
|
|
|
|
|
|
@ -84,6 +98,10 @@ const { t } = useI18n() // 国际化 |
|
|
|
const route = useRoute() // 路由信息 |
|
|
|
const routeName = ref() |
|
|
|
routeName.value = route.name |
|
|
|
const showView = ref(false) |
|
|
|
const urls = ref([]) |
|
|
|
const viewKey = ref(0) |
|
|
|
const viewTitle = ref('图片预览') |
|
|
|
const tableColumns = ref(EquipmentReportRepairRequest.allSchemas.tableColumns) |
|
|
|
|
|
|
|
// 查询页面返回 |
|
|
@ -125,6 +143,13 @@ const HeadButttondata = [ |
|
|
|
// }, |
|
|
|
] |
|
|
|
|
|
|
|
// 列表-操作按钮 |
|
|
|
const butttondataView = (row) => { |
|
|
|
return [ |
|
|
|
defaultButtons.viewBtn(null), |
|
|
|
] |
|
|
|
} |
|
|
|
|
|
|
|
// 头部按钮事件 |
|
|
|
const buttonBaseClick = (val, item) => { |
|
|
|
if (val == 'add') { // 新增 |
|
|
@ -153,7 +178,7 @@ const isShowStatusButton = (row,val) => { |
|
|
|
// 列表-操作按钮 |
|
|
|
const butttondata = (row) => { |
|
|
|
return [ |
|
|
|
defaultButtons.mainListEditBtn({hide: isShowStatusButton(row, ['0']),hasPermi: 'eam:equipmentReportRepairRequest:update'}), // 编辑 |
|
|
|
//defaultButtons.mainListEditBtn({hide: isShowStatusButton(row, ['0']),hasPermi: 'eam:equipmentReportRepairRequest:update'}), // 编辑 |
|
|
|
defaultButtons.mainListAuditingBtn({hide: isShowStatusButton(row, ['0']), hasPermi: 'eam:equipmentReportRepairRequest:update'}), // 审核 |
|
|
|
defaultButtons.mainListAuditedBtn({hide: isShowStatusButton(row, ['2']), hasPermi: 'eam:equipmentReportRepairRequest:update'}), // 审核完成 |
|
|
|
defaultButtons.mainListRevokeBtn({hide: isShowStatusButton(row, ['0']), hasPermi: 'eam:equipmentReportRepairRequest:update'}), // 撤回 |
|
|
@ -176,24 +201,43 @@ const buttonTableClick = async (val, row) => { |
|
|
|
handleAudited(row) |
|
|
|
} else if (val == 'finish') { // 完成 |
|
|
|
handleFinish(row.id) |
|
|
|
} else if (val == 'view') { //预览 |
|
|
|
openForm('view', row) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/** 添加/修改操作 */ |
|
|
|
const basicFormRef = ref() |
|
|
|
const openForm = (type: string, row?: any) => { |
|
|
|
if(type == "create"){ |
|
|
|
//图片展示 |
|
|
|
const basicFormViewRef = ref() |
|
|
|
const openForm = async (type: string, row?: any) => { |
|
|
|
if (type == "create") { |
|
|
|
EquipmentReportRepairRequest.allSchemas.formSchema.forEach((item) => { |
|
|
|
if(item.field == 'status'){ |
|
|
|
if (item.field == 'status') { |
|
|
|
} |
|
|
|
}) |
|
|
|
}else{ |
|
|
|
} else { |
|
|
|
EquipmentReportRepairRequest.allSchemas.formSchema.forEach((item) => { |
|
|
|
if(item.field == 'status'){ |
|
|
|
if (item.field == 'status') { |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
basicFormRef.value.open(type, row) |
|
|
|
if (type == 'view') { |
|
|
|
const formData = ref({ |
|
|
|
number: row.number, |
|
|
|
funcCode: 'equipment_report', |
|
|
|
fileBusiType: 'EAM', |
|
|
|
}) |
|
|
|
urls.value = [] |
|
|
|
let newVar = await EquipmentReportRepairApi.getEquipmentReportFileInfo(formData.value); |
|
|
|
newVar.forEach((item: any) => { |
|
|
|
urls.value.push(item.url); |
|
|
|
}) |
|
|
|
showView.value = true |
|
|
|
viewKey.value += 1 |
|
|
|
} else { |
|
|
|
basicFormRef.value.open(type, row) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// form表单提交 |
|
|
@ -209,6 +253,18 @@ const formsSuccess = async (formType,data) => { |
|
|
|
} |
|
|
|
if(data.activeTime==0)data.activeTime = null; |
|
|
|
if(data.expireTime==0)data.expireTime = null; |
|
|
|
const tags=ref([]) |
|
|
|
if (data.images != null && data.images != "") { |
|
|
|
data.images.forEach((item: any) => { |
|
|
|
const newItem = {}; |
|
|
|
newItem['name'] = item.name; |
|
|
|
newItem['size'] = item.size; |
|
|
|
newItem['uid'] = item.uid; |
|
|
|
newItem['url'] = item.url; |
|
|
|
tags.value.push(newItem); |
|
|
|
}) |
|
|
|
} |
|
|
|
data.fileInfoList = tags.value |
|
|
|
if (formType === 'create') { |
|
|
|
await EquipmentReportRepairRequestApi.createEquipmentReportRepairRequest(data) |
|
|
|
message.success(t('common.createSuccess')) |
|
|
@ -397,6 +453,14 @@ const onChange = (field, item) => { |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
//图片上传 |
|
|
|
if(field == 'images'){ |
|
|
|
EquipmentReportRepairRequest.allSchemas.formSchema.forEach((items) => { |
|
|
|
if (items.field == 'images') { |
|
|
|
console.log(items.value); |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// 筛选提交 |
|
|
|