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