|
|
@ -19,9 +19,13 @@ |
|
|
|
<span>{{ row.code }}</span> |
|
|
|
</el-button> |
|
|
|
</template> |
|
|
|
<template #upload="{ row }"> |
|
|
|
<ButtonBase v-if="row.filePathList != null && row.filePathList.length != 0" :Butttondata="butttondataView(row)" @button-base-click="buttonTableClick($event, row)" /> |
|
|
|
</template> |
|
|
|
<template #action="{ row }"> |
|
|
|
<ButtonBase :Butttondata="butttondata(row)" @button-base-click="buttonTableClick($event, row)" /> |
|
|
|
</template> |
|
|
|
|
|
|
|
</Table> |
|
|
|
</ContentWrap> |
|
|
|
|
|
|
@ -33,6 +37,16 @@ |
|
|
|
<!-- 详情 --> |
|
|
|
<Detail ref="detailRef" :isBasic="true" :allSchemas="DeviceRepair.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> |
|
|
|
|
|
|
|
<!-- 导入 --> |
|
|
|
<ImportForm ref="importFormRef" url="/eam/device-repair/import" :importTemplateData="importTemplateData" |
|
|
|
@success="importSuccess" /> |
|
|
@ -43,8 +57,6 @@ import download from '@/utils/download' |
|
|
|
import { DeviceRepair, DeviceRepairRules } from './deviceRepair.data' |
|
|
|
import * as DeviceRepairApi from '@/api/eam/device/deviceRepair' |
|
|
|
import * as defaultButtons from '@/utils/disposition/defaultButtons' |
|
|
|
import { selectAllFactoryArea } from '@/api/system/dept' |
|
|
|
import { getRowIdentity } from 'element-plus/es/components/table/src/util' |
|
|
|
// import TableHead from '@/components/TableHead/src/TableHead.vue' |
|
|
|
// import ImportForm from '@/components/ImportForm/src/ImportForm.vue' |
|
|
|
// import Detail from '@/components/Detail/src/Detail.vue' |
|
|
@ -56,7 +68,10 @@ const { t } = useI18n() // 国际化 |
|
|
|
|
|
|
|
const route = useRoute() // 路由信息 |
|
|
|
const routeName = ref() |
|
|
|
const factoryAreaList = ref([]) |
|
|
|
const showView = ref(false) |
|
|
|
const viewTitle = ref('图片预览') |
|
|
|
const urls = ref([]) |
|
|
|
const viewKey = ref(0) |
|
|
|
routeName.value = route.name |
|
|
|
const tableColumns = ref(DeviceRepair.allSchemas.tableColumns) |
|
|
|
|
|
|
@ -124,6 +139,15 @@ const butttondata = (row) => { |
|
|
|
// defaultButtons.mainListEditBtn({hasPermi:'eam:deviceRepair:update'}), // 编辑 |
|
|
|
// defaultButtons.mainListDeleteBtn({ hasPermi: 'eam:deviceRepair:delete' }), // 删除 |
|
|
|
defaultButtons.backoutBtn({ hide: row.result != 'PENDING' }), // 撤销 |
|
|
|
|
|
|
|
] |
|
|
|
} |
|
|
|
|
|
|
|
// 列表-操作按钮 |
|
|
|
const butttondataView = (row) => { |
|
|
|
return [ |
|
|
|
defaultButtons.viewBtn(null), |
|
|
|
|
|
|
|
] |
|
|
|
} |
|
|
|
|
|
|
@ -135,13 +159,23 @@ const buttonTableClick = async (val, row) => { |
|
|
|
handleDelete(row.id) |
|
|
|
} else if (val == 'backout') { //撤销 |
|
|
|
handleBackout(row) |
|
|
|
} else if (val == 'view') { //预览 |
|
|
|
openForm('view', row) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/** 添加/修改操作 */ |
|
|
|
const basicFormRef = ref() |
|
|
|
const basicFormViewRef = ref() |
|
|
|
const openForm = (type: string, row?: any) => { |
|
|
|
basicFormRef.value.open(type, row) |
|
|
|
if (type == 'view') { |
|
|
|
showView.value = true |
|
|
|
urls.value = row.filePathList |
|
|
|
viewKey.value += 1 |
|
|
|
} else { |
|
|
|
basicFormRef.value.open(type, row) |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
// form表单提交 |
|
|
@ -159,6 +193,9 @@ const formsSuccess = async (formType, data) => { |
|
|
|
if (data.expireTime == 0) data.expireTime = null; |
|
|
|
data.type = 'DEVICE'; |
|
|
|
data.result = 'PENDING'; |
|
|
|
data.filePathList = data.upload.map((item: any) => { |
|
|
|
return item.url |
|
|
|
}) |
|
|
|
if (formType === 'create') { |
|
|
|
await DeviceRepairApi.createDeviceRepair(data) |
|
|
|
message.success(t('common.createSuccess')) |
|
|
@ -253,3 +290,5 @@ onMounted(async () => { |
|
|
|
}) |
|
|
|
|
|
|
|
</script> |
|
|
|
|
|
|
|
|
|
|
|