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