Browse Source

EAM ——> 报修图片上传 图片预览 前后端

master_hella_20240701
gaojs 6 months ago
parent
commit
a4f2a1a25d
  1. 1
      src/api/eam/equipmentRepairJobMain/index.ts
  2. 5
      src/api/eam/equipmentReportRepairRequest/index.ts
  3. 12
      src/utils/disposition/defaultButtons.ts
  4. 67
      src/views/eam/equipmentRepairJobMain/equipmentRepairJobMain.data.ts
  5. 4
      src/views/eam/equipmentRepairJobMain/finishForm1.vue
  6. 74
      src/views/eam/equipmentRepairJobMain/index.vue
  7. 2
      src/views/eam/equipmentRepairRecordMain/equipmentRepairRecordMain.data.ts
  8. 13
      src/views/eam/equipmentReportRepairRequest/equipmentReportRepairRequest.data.ts
  9. 70
      src/views/eam/equipmentReportRepairRequest/index.vue

1
src/api/eam/equipmentRepairJobMain/index.ts

@ -79,6 +79,7 @@ export const updateEquipmentRepairMain = async (data: EquipmentRepairJobMainVO)
return await request.post({ url: `/eam/equipment-repair-job-main/updateRepair`, data }) return await request.post({ url: `/eam/equipment-repair-job-main/updateRepair`, data })
} }
// 完成维修工单主 // 完成维修工单主
export const executeEquipmentRepairJobMain = async (data: EquipmentRepairJobMainVO) => { export const executeEquipmentRepairJobMain = async (data: EquipmentRepairJobMainVO) => {
return await request.post({ url: `/eam/equipment-repair-job-main/execute`, data }) return await request.post({ url: `/eam/equipment-repair-job-main/execute`, data })

5
src/api/eam/equipmentReportRepairRequest/index.ts

@ -81,3 +81,8 @@ export const updateEquipmentReportRepairOrder = async (data: EquipmentReportRepa
export const createEquipmentWeixiuOrder = async (data: EquipmentReportRepairRequestVO) => { export const createEquipmentWeixiuOrder = async (data: EquipmentReportRepairRequestVO) => {
return await request.post({ url: `/eam/equipment-report-repair-request/updateCreateOrder`, data }) return await request.post({ url: `/eam/equipment-report-repair-request/updateCreateOrder`, data })
} }
// 查询报修工单文件附件
export const getEquipmentReportFileInfo = async (data) => {
return await request.post({ url: `/eam/equipment-report-repair-request/fileListInfo`, data })
}

12
src/utils/disposition/defaultButtons.ts

@ -440,6 +440,18 @@ export function mainListValidateRepairBtn(option:any) {
hasPermi: '' hasPermi: ''
}) })
} }
// 主列表-预览按钮
export function viewBtn(option:any) {
return __defaultBtnOption(option,{
label: '预览',
name: 'view',
hide: false,
type: 'success',
color: '',
link: true, // 文本展现按钮
hasPermi: ''
})
}
// 主列表-审核按钮 // 主列表-审核按钮
export function mainListAuditingBtn(option:any) { export function mainListAuditingBtn(option:any) {

67
src/views/eam/equipmentRepairJobMain/equipmentRepairJobMain.data.ts

@ -4,7 +4,6 @@ import {EquipmentAccounts} from "@/views/eam/equipmentAccounts/equipmentAccounts
import * as EquipmentItemApi from "@/api/eam/equipmentAccounts"; import * as EquipmentItemApi from "@/api/eam/equipmentAccounts";
import {BasicFaultCause} from "@/views/eam/basicFaultCause/basicFaultCause.data"; import {BasicFaultCause} from "@/views/eam/basicFaultCause/basicFaultCause.data";
import * as ItemApi from "@/api/eam/basicFaultCause"; import * as ItemApi from "@/api/eam/basicFaultCause";
import {getBasicFaultCausePage} from "@/api/eam/basicFaultCause";
// 表单校验 // 表单校验
export const EquipmentRepairJobMainRules = reactive({ export const EquipmentRepairJobMainRules = reactive({
@ -14,9 +13,9 @@ export const EquipmentRepairJobMainRules = reactive({
urgency: [required], urgency: [required],
level: [required], level: [required],
equipmentCode: [required], equipmentCode: [required],
totalMinutes: [required],
faultType: [required], faultType: [required],
status: [required], status: [required],
shutDown:[required],
}) })
export const EquipmentRepairJobMain = useCrudSchemas(reactive<CrudSchema[]>([ export const EquipmentRepairJobMain = useCrudSchemas(reactive<CrudSchema[]>([
@ -34,6 +33,9 @@ export const EquipmentRepairJobMain = useCrudSchemas(reactive<CrudSchema[]>([
field: 'number', field: 'number',
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: true,
isTable: true,
isForm: false,
isDetail:true,
}, },
{ {
label: '设备类别', label: '设备类别',
@ -48,20 +50,30 @@ export const EquipmentRepairJobMain = useCrudSchemas(reactive<CrudSchema[]>([
field: 'repairNumber', field: 'repairNumber',
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: true,
isTable: true,
isForm: false,
isDetail:true,
}, },
{ {
label: '来源字典', label: '来源',
field: 'sources', field: 'sources',
sort: 'custom', sort: 'custom',
dictType: DICT_TYPE.EAM_MAINTENANCE_SOURCES, dictType: DICT_TYPE.EAM_MAINTENANCE_SOURCES,
dictClass: 'string', dictClass: 'string',
isSearch: false, isSearch: false,
isForm: true,
form:{
value:'1'
}
}, },
{ {
label: '维修描述', label: '维修描述',
field: 'maintenanceDesc', field: 'maintenanceDesc',
sort: 'custom', sort: 'custom',
isSearch: false, isSearch: true,
isTable: true,
isForm: false,
isDetail:true,
}, },
{ {
label: '紧急程度', label: '紧急程度',
@ -121,6 +133,9 @@ export const EquipmentRepairJobMain = useCrudSchemas(reactive<CrudSchema[]>([
sort: 'custom', sort: 'custom',
formatter: dateFormatter, formatter: dateFormatter,
isSearch: false, isSearch: false,
isTable: true,
isForm: false,
isDetail:true,
search: { search: {
component: 'DatePicker', component: 'DatePicker',
componentProps: { componentProps: {
@ -143,6 +158,9 @@ export const EquipmentRepairJobMain = useCrudSchemas(reactive<CrudSchema[]>([
sort: 'custom', sort: 'custom',
formatter: dateFormatter, formatter: dateFormatter,
isSearch: false, isSearch: false,
isTable: true,
isForm: false,
isDetail:true,
search: { search: {
component: 'DatePicker', component: 'DatePicker',
componentProps: { componentProps: {
@ -164,18 +182,27 @@ export const EquipmentRepairJobMain = useCrudSchemas(reactive<CrudSchema[]>([
field: 'totalMinutes', field: 'totalMinutes',
sort: 'custom', sort: 'custom',
isSearch: false, isSearch: false,
isTable: true,
isForm: false,
isDetail:true,
}, },
{ {
label: '维修验证人', label: '维修验证人',
field: 'verifyerRepair', field: 'verifyerRepair',
sort: 'custom', sort: 'custom',
isSearch: false, isSearch: false,
isTable: true,
isForm: false,
isDetail:true,
}, },
{ {
label: '维修验证内容', label: '维修验证内容',
field: 'verifyContentRepair', field: 'verifyContentRepair',
sort: 'custom', sort: 'custom',
isSearch: false, isSearch: false,
isTable: true,
isForm: false,
isDetail:true,
}, },
{ {
label: '维修验证时间', label: '维修验证时间',
@ -183,6 +210,9 @@ export const EquipmentRepairJobMain = useCrudSchemas(reactive<CrudSchema[]>([
sort: 'custom', sort: 'custom',
formatter: dateFormatter, formatter: dateFormatter,
isSearch: false, isSearch: false,
isTable: true,
isForm: false,
isDetail:true,
search: { search: {
component: 'DatePicker', component: 'DatePicker',
componentProps: { componentProps: {
@ -204,12 +234,18 @@ export const EquipmentRepairJobMain = useCrudSchemas(reactive<CrudSchema[]>([
field: 'verifyerReport', field: 'verifyerReport',
sort: 'custom', sort: 'custom',
isSearch: false, isSearch: false,
isTable: true,
isForm: false,
isDetail:true,
}, },
{ {
label: '报修验证内容', label: '报修验证内容',
field: 'verifyContentReport', field: 'verifyContentReport',
sort: 'custom', sort: 'custom',
isSearch: false, isSearch: false,
isTable: true,
isForm: false,
isDetail:true,
}, },
{ {
label: '报修验证时间', label: '报修验证时间',
@ -217,6 +253,9 @@ export const EquipmentRepairJobMain = useCrudSchemas(reactive<CrudSchema[]>([
sort: 'custom', sort: 'custom',
formatter: dateFormatter, formatter: dateFormatter,
isSearch: false, isSearch: false,
isTable: true,
isForm: false,
isDetail:true,
search: { search: {
component: 'DatePicker', component: 'DatePicker',
componentProps: { componentProps: {
@ -238,12 +277,18 @@ export const EquipmentRepairJobMain = useCrudSchemas(reactive<CrudSchema[]>([
field: 'maintenancer', field: 'maintenancer',
sort: 'custom', sort: 'custom',
isSearch: false, isSearch: false,
isTable: true,
isForm: false,
isDetail:true,
}, },
{ {
label: '维修人联系电话', label: '维修人联系电话',
field: 'maintenancePhone', field: 'maintenancePhone',
sort: 'custom', sort: 'custom',
isSearch: false, isSearch: false,
isTable: true,
isForm: false,
isDetail:true,
}, },
{ {
label: '结果', label: '结果',
@ -251,7 +296,10 @@ export const EquipmentRepairJobMain = useCrudSchemas(reactive<CrudSchema[]>([
sort: 'custom', sort: 'custom',
dictType: DICT_TYPE.EAM_COMPLETE_RESULT, dictType: DICT_TYPE.EAM_COMPLETE_RESULT,
dictClass: 'string', dictClass: 'string',
isSearch: true, isSearch: false,
isTable: true,
isForm: false,
isDetail:true,
}, },
{ {
label: '完成时间', label: '完成时间',
@ -259,6 +307,9 @@ export const EquipmentRepairJobMain = useCrudSchemas(reactive<CrudSchema[]>([
sort: 'custom', sort: 'custom',
formatter: dateFormatter, formatter: dateFormatter,
isSearch: false, isSearch: false,
isTable: true,
isForm: false,
isDetail:true,
search: { search: {
component: 'DatePicker', component: 'DatePicker',
componentProps: { componentProps: {
@ -306,6 +357,9 @@ export const EquipmentRepairJobMain = useCrudSchemas(reactive<CrudSchema[]>([
sort: 'custom', sort: 'custom',
formatter: dateFormatter, formatter: dateFormatter,
isSearch: false, isSearch: false,
isTable: true,
isForm: false,
isDetail:true,
search: { search: {
component: 'DatePicker', component: 'DatePicker',
componentProps: { componentProps: {
@ -327,6 +381,9 @@ export const EquipmentRepairJobMain = useCrudSchemas(reactive<CrudSchema[]>([
field: 'repairer', field: 'repairer',
sort: 'custom', sort: 'custom',
isSearch: false, isSearch: false,
isTable: true,
isForm: false,
isDetail:true,
}, },
{ {
label: '故障类型', label: '故障类型',

4
src/views/eam/equipmentRepairJobMain/finishForm1.vue

@ -63,6 +63,7 @@ const InputRef = ref<InstanceType<typeof ElInput>>()
const formData = ref({ const formData = ref({
id:'', id:'',
number:'', number:'',
sources:'',
verifyerRepair: '', verifyerRepair: '',
verifyContentRepair: '', verifyContentRepair: '',
verifyTimeRepair: '', verifyTimeRepair: '',
@ -158,6 +159,7 @@ const open = async (type: string, row?: object) => {
// //
formData.value.id = row.id formData.value.id = row.id
formData.value.number = row.number formData.value.number = row.number
formData.value.sources = row.sources
} }
defineExpose({ open }) // open defineExpose({ open }) // open
@ -172,7 +174,7 @@ const submitForm = async (val) => {
// //
await EquipmentRepairJobMainApi.updateEquipmentRepairJobMain(formData.value) await EquipmentRepairJobMainApi.updateEquipmentRepairJobMain(formData.value)
//success //success
emit('success',formData.value.id) emit('success',formData.value.id,formData.value.sources)
dialogVisible.value = false dialogVisible.value = false
} }

74
src/views/eam/equipmentRepairJobMain/index.vue

@ -48,6 +48,7 @@
:apiCreate="EquipmentRepairJobMainApi.createEquipmentRepairJobMain" :apiCreate="EquipmentRepairJobMainApi.createEquipmentRepairJobMain"
@searchTableSuccess="searchTableSuccess" @searchTableSuccess="searchTableSuccess"
:isBusiness="false" :isBusiness="false"
@onChange="onChange"
/> />
<FinishForm1 ref="finishForm1Ref" @success="getData1" @close="getClosed1"/> <FinishForm1 ref="finishForm1Ref" @success="getData1" @close="getClosed1"/>
@ -88,6 +89,10 @@ import Detail from '@/views/eam/equipmentRepairJobMain/EquipmentRepairJobDetail.
import FinishForm1 from '@/views/eam/equipmentRepairJobMain/finishForm1.vue' import FinishForm1 from '@/views/eam/equipmentRepairJobMain/finishForm1.vue'
import FinishForm2 from '@/views/eam/equipmentRepairJobMain/finishForm2.vue' import FinishForm2 from '@/views/eam/equipmentRepairJobMain/finishForm2.vue'
import FinishForm3 from '@/views/eam/equipmentRepairJobMain/finishForm3.vue' import FinishForm3 from '@/views/eam/equipmentRepairJobMain/finishForm3.vue'
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: 'EquipmentRepairJobMain' }) defineOptions({ name: 'EquipmentRepairJobMain' })
@ -163,6 +168,15 @@ const isShowStatusButton = (row,val) => {
} }
} }
//true
const isShowBaoXiuButton = (row) => {
if(row.sources =='0' && row.status == '7'){
return false
}else{
return true
}
}
// - // -
const butttondata = (row) => { const butttondata = (row) => {
@ -172,7 +186,7 @@ const butttondata = (row) => {
defaultButtons.mainListExecuteBtn({hide: isShowStatusButton(row,['4']),hasPermi:'eam:equipmentRepairJobMain:update'}), // defaultButtons.mainListExecuteBtn({hide: isShowStatusButton(row,['4']),hasPermi:'eam:equipmentRepairJobMain:update'}), //
defaultButtons.mainListFinishBtn({hide: isShowStatusButton(row,['5']),hasPermi:'eam:equipmentRepairJobMain:update'}), // defaultButtons.mainListFinishBtn({hide: isShowStatusButton(row,['5']),hasPermi:'eam:equipmentRepairJobMain:update'}), //
defaultButtons.mainListValidateRepairBtn({hide: isShowStatusButton(row,['6']),hasPermi:'eam:equipmentRepairJobMain:update'}), // defaultButtons.mainListValidateRepairBtn({hide: isShowStatusButton(row,['6']),hasPermi:'eam:equipmentRepairJobMain:update'}), //
defaultButtons.mainListValidateReportBtn({hide: isShowStatusButton(row,['7']),hasPermi:'eam:equipmentRepairJobMain:update'}), // defaultButtons.mainListValidateReportBtn({hide: isShowBaoXiuButton(row),hasPermi:'eam:equipmentRepairJobMain:update'}), //
] ]
} }
@ -200,6 +214,27 @@ 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"){
EquipmentRepairJobMain.allSchemas.formSchema.forEach((item) => {
if(item.field == 'sources'){
item.value = '1'
item.componentProps.disabled = true
}
if(item.field == 'status'){
item.value = '3'
item.componentProps.disabled = true
}
})
}else{
EquipmentRepairJobMain.allSchemas.formSchema.forEach((item) => {
if(item.field == 'sources'){
item.componentProps.disabled = true
}
if(item.field == 'status'){
item.componentProps.disabled = true
}
})
}
basicFormRef.value.open(type, row) basicFormRef.value.open(type, row)
} }
@ -384,16 +419,20 @@ const getClosed1=(val)=> {
} }
//finishForm1 //finishForm1
const getData1=(val)=> { const getData1=(val1,val2)=> {
nextTick?.(async () => { nextTick?.(async () => {
console.log(val)
try { try {
const params = ref({ const params = ref({
id: '', id: '',
status:'', status:'',
}) })
params.value.id = val params.value.id = val1
if(val2 == '1'){
params.value.status = '8'
}
if(val2 == '0'){
params.value.status = '7' params.value.status = '7'
}
await EquipmentRepairJobMainApi.updateEquipmentRepairOrder(params.value) await EquipmentRepairJobMainApi.updateEquipmentRepairOrder(params.value)
message.success(t('工单已流转')) message.success(t('工单已流转'))
// //
@ -461,6 +500,33 @@ const getData3=(val)=> {
) )
} }
const onChange = (field, item) => {
//
if(field == 'type' && item == 'DEVICE'){
EquipmentRepairJobMain.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'){
EquipmentRepairJobMain.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 () => {

2
src/views/eam/equipmentRepairRecordMain/equipmentRepairRecordMain.data.ts

@ -42,7 +42,7 @@ export const EquipmentRepairRecordMain = useCrudSchemas(reactive<CrudSchema[]>([
sort: 'custom', sort: 'custom',
dictType: DICT_TYPE.EAM_MAINTENANCE_SOURCES, dictType: DICT_TYPE.EAM_MAINTENANCE_SOURCES,
dictClass: 'string', // 默认都是字符串类型其他暂不考虑 dictClass: 'string', // 默认都是字符串类型其他暂不考虑
isSearch: false isSearch: false,
}, },
{ {
label: '维修描述', label: '维修描述',

13
src/views/eam/equipmentReportRepairRequest/equipmentReportRepairRequest.data.ts

@ -98,6 +98,19 @@ export const EquipmentReportRepairRequest = useCrudSchemas(reactive<CrudSchema[]
field: 'images', field: 'images',
sort: 'custom', sort: 'custom',
isSearch: false, isSearch: false,
isForm: true,
isTable: true,
isDetail: false,
form: {
component: 'UploadImgs',
componentProps: {
limit:3,
upData:{
tableId:'1',
tableName:'request_equipment_report_repair'
}
}
}
}, },
// { // {
// label: '所属厂区编号', // label: '所属厂区编号',

70
src/views/eam/equipmentReportRepairRequest/index.vue

@ -35,6 +35,9 @@
<template #action="{ row }"> <template #action="{ row }">
<ButtonBase :Butttondata="butttondata(row)" @button-base-click="buttonTableClick($event,row)" /> <ButtonBase :Butttondata="butttondata(row)" @button-base-click="buttonTableClick($event,row)" />
</template> </template>
<template #images="{ row }">
<ButtonBase v-if="row.images === 'TRUE' ":Butttondata="butttondataView(row)" @button-base-click="buttonTableClick($event, row)" />
</template>
</Table> </Table>
</ContentWrap> </ContentWrap>
@ -54,6 +57,16 @@
<!-- 详情 --> <!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="EquipmentReportRepairRequest.allSchemas" /> <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"/> <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" /> <ImportForm ref="importFormRef" url="/eam/equipment-report-repair-request/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 { EquipmentReportRepairRequest,EquipmentReportRepairRequestRules } from './equipmentReportRepairRequest.data' 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 * as EquipmentItemApi from "@/api/eam/equipmentAccounts";
import {ToolAccounts} from "@/views/eam/toolAccounts/toolAccounts.data"; import {ToolAccounts} from "@/views/eam/toolAccounts/toolAccounts.data";
import * as ToolItemApi from "@/api/eam/toolAccounts"; import * as ToolItemApi from "@/api/eam/toolAccounts";
import {createEquipmentWeixiuOrder} from "@/api/eam/equipmentReportRepairRequest"; import * as EquipmentReportRepairApi from "@/api/eam/equipmentReportRepairRequest";
defineOptions({ name: 'EquipmentReportRepairRequest' }) defineOptions({ name: 'EquipmentReportRepairRequest' })
@ -84,6 +98,10 @@ const { t } = useI18n() // 国际化
const route = useRoute() // const route = useRoute() //
const routeName = ref() const routeName = ref()
routeName.value = route.name routeName.value = route.name
const showView = ref(false)
const urls = ref([])
const viewKey = ref(0)
const viewTitle = ref('图片预览')
const tableColumns = ref(EquipmentReportRepairRequest.allSchemas.tableColumns) const tableColumns = ref(EquipmentReportRepairRequest.allSchemas.tableColumns)
// //
@ -125,6 +143,13 @@ const HeadButttondata = [
// }, // },
] ]
// -
const butttondataView = (row) => {
return [
defaultButtons.viewBtn(null),
]
}
// //
const buttonBaseClick = (val, item) => { const buttonBaseClick = (val, item) => {
if (val == 'add') { // if (val == 'add') { //
@ -153,7 +178,7 @@ const isShowStatusButton = (row,val) => {
// - // -
const butttondata = (row) => { const butttondata = (row) => {
return [ 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.mainListAuditingBtn({hide: isShowStatusButton(row, ['0']), hasPermi: 'eam:equipmentReportRepairRequest:update'}), //
defaultButtons.mainListAuditedBtn({hide: isShowStatusButton(row, ['2']), hasPermi: 'eam:equipmentReportRepairRequest:update'}), // defaultButtons.mainListAuditedBtn({hide: isShowStatusButton(row, ['2']), hasPermi: 'eam:equipmentReportRepairRequest:update'}), //
defaultButtons.mainListRevokeBtn({hide: isShowStatusButton(row, ['0']), hasPermi: 'eam:equipmentReportRepairRequest:update'}), // defaultButtons.mainListRevokeBtn({hide: isShowStatusButton(row, ['0']), hasPermi: 'eam:equipmentReportRepairRequest:update'}), //
@ -176,12 +201,16 @@ const buttonTableClick = async (val, row) => {
handleAudited(row) handleAudited(row)
} else if (val == 'finish') { // } else if (val == 'finish') { //
handleFinish(row.id) handleFinish(row.id)
} else if (val == 'view') { //
openForm('view', row)
} }
} }
/** 添加/修改操作 */ /** 添加/修改操作 */
const basicFormRef = ref() const basicFormRef = ref()
const openForm = (type: string, row?: any) => { //
const basicFormViewRef = ref()
const openForm = async (type: string, row?: any) => {
if (type == "create") { if (type == "create") {
EquipmentReportRepairRequest.allSchemas.formSchema.forEach((item) => { EquipmentReportRepairRequest.allSchemas.formSchema.forEach((item) => {
if (item.field == 'status') { if (item.field == 'status') {
@ -193,8 +222,23 @@ const openForm = (type: string, row?: any) => {
} }
}) })
} }
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) basicFormRef.value.open(type, row)
} }
}
// form // form
const formsSuccess = async (formType,data) => { const formsSuccess = async (formType,data) => {
@ -209,6 +253,18 @@ const formsSuccess = async (formType,data) => {
} }
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;
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') { if (formType === 'create') {
await EquipmentReportRepairRequestApi.createEquipmentReportRepairRequest(data) await EquipmentReportRepairRequestApi.createEquipmentReportRepairRequest(data)
message.success(t('common.createSuccess')) 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);
}
})
}
} }
// //

Loading…
Cancel
Save