|
@ -70,6 +70,7 @@ |
|
|
:detailValidate="detailValidate" |
|
|
:detailValidate="detailValidate" |
|
|
@detailSubmitForm="detailSubmitForm" |
|
|
@detailSubmitForm="detailSubmitForm" |
|
|
:isSearchTableItem="true" |
|
|
:isSearchTableItem="true" |
|
|
|
|
|
@openFormCallBack="openFormCallBack" |
|
|
/> |
|
|
/> |
|
|
|
|
|
|
|
|
<!-- 导入 --> |
|
|
<!-- 导入 --> |
|
@ -84,6 +85,9 @@ import * as DeviceInspectionMainApi from '@/api/eam/device/deviceInspectionMain' |
|
|
import * as DeviceInspectionDetailApi from '@/api/eam/device/deviceInspectionDetail' |
|
|
import * as DeviceInspectionDetailApi from '@/api/eam/device/deviceInspectionDetail' |
|
|
import * as defaultButtons from '@/utils/disposition/defaultButtons' |
|
|
import * as defaultButtons from '@/utils/disposition/defaultButtons' |
|
|
import { useUserStore } from '@/store/modules/user' |
|
|
import { useUserStore } from '@/store/modules/user' |
|
|
|
|
|
import { selectAllFactoryArea } from '@/api/system/dept' |
|
|
|
|
|
import * as UserApi from '@/api/system/user' |
|
|
|
|
|
import * as DeviceAccountsApi from '@/api/eam/device/deviceAccounts' |
|
|
|
|
|
|
|
|
// 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' |
|
@ -159,8 +163,12 @@ const HeadButttondata = [ |
|
|
// 头部按钮事件 |
|
|
// 头部按钮事件 |
|
|
const buttonBaseClick = (val, item) => { |
|
|
const buttonBaseClick = (val, item) => { |
|
|
if (val == 'add') { // 新增 |
|
|
if (val == 'add') { // 新增 |
|
|
DeviceInspectionMain.allSchemas.formSchema[4].value = 'PROCCED'; |
|
|
DeviceInspectionMain.allSchemas.formSchema.find(item => { |
|
|
DeviceInspectionMain.allSchemas.formSchema[5].value = 'DEVICE'; |
|
|
return item.field == 'status' |
|
|
|
|
|
}).value = 'PROCCED' |
|
|
|
|
|
DeviceInspectionMain.allSchemas.formSchema.find(item => { |
|
|
|
|
|
return item.field == 'type' |
|
|
|
|
|
}).value = 'DEVICE' |
|
|
openForm('create') |
|
|
openForm('create') |
|
|
} else if (val == 'import') { // 导入 |
|
|
} else if (val == 'import') { // 导入 |
|
|
handleImport() |
|
|
handleImport() |
|
@ -198,7 +206,16 @@ const buttonTableClick = async (val, row) => { |
|
|
|
|
|
|
|
|
/** 添加/修改操作 */ |
|
|
/** 添加/修改操作 */ |
|
|
const basicFormRef = ref() |
|
|
const basicFormRef = ref() |
|
|
const openForm = (type: string, row?: any) => { |
|
|
const openForm = async (type: string, row?: any) => { |
|
|
|
|
|
const deviceListAll = await DeviceAccountsApi.getDeviceAccountsAllNoPage({}) |
|
|
|
|
|
const deviceList = await DeviceAccountsApi.getDeviceAccountsNoPage({}) |
|
|
|
|
|
if (type == 'update') { |
|
|
|
|
|
DeviceInspectionMain.allSchemas.formSchema.find(item => item.field == 'deviceNumber').componentProps.disabled = true |
|
|
|
|
|
DeviceInspectionMain.allSchemas.formSchema.find(item => item.field == 'deviceNumber').componentProps.options = deviceListAll |
|
|
|
|
|
} else { |
|
|
|
|
|
DeviceInspectionMain.allSchemas.formSchema.find(item => item.field == 'deviceNumber').componentProps.disabled = false |
|
|
|
|
|
DeviceInspectionMain.allSchemas.formSchema.find(item => item.field == 'deviceNumber').componentProps.options = deviceList |
|
|
|
|
|
} |
|
|
tableData.value = [] // 重置明细数据 |
|
|
tableData.value = [] // 重置明细数据 |
|
|
basicFormRef.value.open(type, row) |
|
|
basicFormRef.value.open(type, row) |
|
|
} |
|
|
} |
|
@ -229,7 +246,11 @@ const formsSuccess = async (formType, data) => { |
|
|
|
|
|
|
|
|
/** 详情操作 */ |
|
|
/** 详情操作 */ |
|
|
const detailRef = ref() |
|
|
const detailRef = ref() |
|
|
const openDetail = (row: any, titleName: any, titleValue: any) => { |
|
|
const openDetail = async (row: any, titleName: any, titleValue: any) => { |
|
|
|
|
|
const factoryList = await selectAllFactoryArea() |
|
|
|
|
|
const userListAll = await UserApi.getSimpleUserList() |
|
|
|
|
|
row.factoryAreaNumber1 = factoryList.find((account) => account.id == row.factoryAreaNumber)?.name |
|
|
|
|
|
row.maintenance1 = userListAll.find((account) => account.id == row.maintenance)?.nickname |
|
|
detailRef.value.openDetail(row, titleName, titleValue, 'basicDeviceInspectionMain') |
|
|
detailRef.value.openDetail(row, titleName, titleValue, 'basicDeviceInspectionMain') |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -297,13 +318,14 @@ function handleFinishOrder(row) { |
|
|
const onChange = (field, cur, item) => { |
|
|
const onChange = (field, cur, item) => { |
|
|
// 当有效天数 和 生效时间 发生变化 |
|
|
// 当有效天数 和 生效时间 发生变化 |
|
|
if (field == 'deviceNumber') { |
|
|
if (field == 'deviceNumber') { |
|
|
basicFormRef.value.formRef.formModel.factoryAreaNumber = Number(item.componentProps.options.find(element => element.number == cur).factoryAreaNumber) |
|
|
basicFormRef.value.formRef.formModel.factoryAreaNumber = String(item.componentProps.options.find(element => element.number == cur).factoryAreaNumber) |
|
|
basicFormRef.value.formRef.formModel.maintenance = String(userStore?.getUser?.id) |
|
|
basicFormRef.value.formRef.formModel.maintenance = Number(userStore?.getUser?.id) |
|
|
basicFormRef.value.formRef.formModel.maintenanceNumber = '' |
|
|
basicFormRef.value.formRef.formModel.maintenanceNumber = '' |
|
|
} else if (field == 'maintenanceNumber') { |
|
|
} else if (field == 'maintenanceNumber') { |
|
|
basicFormRef.value.formRef.formModel.deviceNumber = item.componentProps.options.find(element => element.number == cur).deviceNumber |
|
|
basicFormRef.value.formRef.formModel.deviceNumber = item.componentProps.options.find(element => element.number == cur).deviceNumber |
|
|
basicFormRef.value.formRef.formModel.factoryAreaNumber = Number(item.componentProps.options.find(element => element.number == cur).factoryAreaNumber) |
|
|
basicFormRef.value.formRef.formModel.factoryAreaNumber = String(item.componentProps.options.find(element => element.number == cur).factoryAreaNumber) |
|
|
basicFormRef.value.formRef.formModel.maintenance = String(userStore?.getUser?.id) |
|
|
basicFormRef.value.formRef.formModel.maintenance = Number(userStore?.getUser?.id) |
|
|
|
|
|
// basicFormRef.value.formRef.formModel.maintenancePhone = String(userStore?.getUser?.mobile) |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|