|
|
@ -33,7 +33,7 @@ |
|
|
|
</el-button> |
|
|
|
</template> |
|
|
|
<template #action="{ row }"> |
|
|
|
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event,row)" /> |
|
|
|
<ButtonBase :Butttondata="butttondata(row)" @button-base-click="buttonTableClick($event,row)" /> |
|
|
|
</template> |
|
|
|
</Table> |
|
|
|
</ContentWrap> |
|
|
@ -62,6 +62,8 @@ 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' |
|
|
@ -73,6 +75,7 @@ const { t } = useI18n() // 国际化 |
|
|
|
|
|
|
|
const route = useRoute() // 路由信息 |
|
|
|
const routeName = ref() |
|
|
|
const factoryAreaList = ref([]) |
|
|
|
routeName.value = route.name |
|
|
|
const tableColumns = ref(DeviceRepair.allSchemas.tableColumns) |
|
|
|
|
|
|
@ -99,9 +102,12 @@ const { getList, setSearchParams } = tableMethods |
|
|
|
|
|
|
|
// 列表头部按钮 |
|
|
|
const HeadButttondata = [ |
|
|
|
defaultButtons.defaultAddBtn({hasPermi:'eam:deviceRepair:create'}), // 新增 |
|
|
|
defaultButtons.defaultImportBtn({hasPermi:'eam:deviceRepair:import'}), // 导入 |
|
|
|
defaultButtons.defaultExportBtn({hasPermi:'eam:deviceRepair:export'}), // 导出 |
|
|
|
// defaultButtons.defaultAddBtn({hasPermi:'eam:deviceRepair:create'}), // 新增 |
|
|
|
// defaultButtons.defaultImportBtn({hasPermi:'eam:deviceRepair:import'}), // 导入 |
|
|
|
// defaultButtons.defaultExportBtn({ hasPermi: 'eam:deviceRepair:export' }), // 导出 |
|
|
|
defaultButtons.defaultAddBtn(null), // 新增 |
|
|
|
// defaultButtons.defaultImportBtn(null), // 导入 |
|
|
|
// defaultButtons.defaultExportBtn(null), // 导出 |
|
|
|
defaultButtons.defaultFreshBtn(null), // 刷新 |
|
|
|
defaultButtons.defaultFilterBtn(null), // 筛选 |
|
|
|
defaultButtons.defaultSetBtn(null), // 设置 |
|
|
@ -132,10 +138,13 @@ const buttonBaseClick = (val, item) => { |
|
|
|
} |
|
|
|
|
|
|
|
// 列表-操作按钮 |
|
|
|
const butttondata = [ |
|
|
|
defaultButtons.mainListEditBtn({hasPermi:'eam:deviceRepair:update'}), // 编辑 |
|
|
|
defaultButtons.mainListDeleteBtn({hasPermi:'eam:deviceRepair:delete'}), // 删除 |
|
|
|
] |
|
|
|
const butttondata = (row) => { |
|
|
|
return [ |
|
|
|
// defaultButtons.mainListEditBtn({hasPermi:'eam:deviceRepair:update'}), // 编辑 |
|
|
|
// defaultButtons.mainListDeleteBtn({ hasPermi: 'eam:deviceRepair:delete' }), // 删除 |
|
|
|
defaultButtons.backoutBtn({ hide: row.result != 'PENDING' }), // 撤销 |
|
|
|
] |
|
|
|
} |
|
|
|
|
|
|
|
// 列表-操作按钮事件 |
|
|
|
const buttonTableClick = async (val, row) => { |
|
|
@ -143,6 +152,8 @@ const buttonTableClick = async (val, row) => { |
|
|
|
openForm('update', row) |
|
|
|
} else if (val == 'delete') { // 删除 |
|
|
|
handleDelete(row.id) |
|
|
|
} else if (val == 'backout') { //撤销 |
|
|
|
handleBackout(row) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
@ -164,7 +175,9 @@ const formsSuccess = async (formType,data) => { |
|
|
|
} |
|
|
|
} |
|
|
|
if(data.activeTime==0)data.activeTime = null; |
|
|
|
if(data.expireTime==0)data.expireTime = null; |
|
|
|
if (data.expireTime == 0) data.expireTime = null; |
|
|
|
data.type = 'DEVICE'; |
|
|
|
data.result = 'PENDING'; |
|
|
|
if (formType === 'create') { |
|
|
|
await DeviceRepairApi.createDeviceRepair(data) |
|
|
|
message.success(t('common.createSuccess')) |
|
|
@ -235,6 +248,23 @@ const searchFormClick = (searchData) => { |
|
|
|
getList() // 刷新当前列表 |
|
|
|
} |
|
|
|
|
|
|
|
// function getAllFactoryAreaList() { |
|
|
|
// selectAllFactoryArea().then(res => { |
|
|
|
// factoryAreaList.value = res.data |
|
|
|
// }) |
|
|
|
// } |
|
|
|
|
|
|
|
function handleBackout(row) { |
|
|
|
if (row.result != 'PENDING') { |
|
|
|
message.error('该报修单正在处理中,不能撤销!') |
|
|
|
} |
|
|
|
DeviceRepairApi.rejected(row.id).then(res => { |
|
|
|
console.log("撤销成功!") |
|
|
|
getList() // 刷新当前列表 |
|
|
|
}) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
/** 初始化 **/ |
|
|
|
onMounted(async () => { |
|
|
|
getList() |
|
|
|