|
|
@ -64,7 +64,8 @@ import download from '@/utils/download' |
|
|
|
import { MoldRepair, MoldRepairRules } from './moldRepair.data' |
|
|
|
import * as MoldRepairApi from '@/api/eam/mold/moldRepair' |
|
|
|
import * as defaultButtons from '@/utils/disposition/defaultButtons' |
|
|
|
import * as MoldAccountApi from '@/api/eam/mold/moldAccount' |
|
|
|
import * as MoldAccountApi from '@/api/eam/mold/moldAccounts' |
|
|
|
import * as DeviceAccountApi from '@/api/eam/device/deviceAccounts' |
|
|
|
|
|
|
|
defineOptions({ name: 'MoldRepair' }) |
|
|
|
|
|
|
@ -80,6 +81,8 @@ const viewKey = ref(0) |
|
|
|
routeName.value = route.name |
|
|
|
const tableColumns = ref(MoldRepair.allSchemas.tableColumns) |
|
|
|
|
|
|
|
const factoryAreaNumber = ref(''); |
|
|
|
const type = ref(''); |
|
|
|
// 查询页面返回 |
|
|
|
const searchTableSuccess = (formField, searchField, val, formRef) => { |
|
|
|
nextTick(() => { |
|
|
@ -182,7 +185,6 @@ const formsSuccess = async (formType, data) => { |
|
|
|
} |
|
|
|
if (data.activeTime == 0) data.activeTime = null; |
|
|
|
if (data.expireTime == 0) data.expireTime = null; |
|
|
|
data.type = 'MOLD'; |
|
|
|
data.result = 'PENDING'; |
|
|
|
if (data.upload != null && data.upload != "") { |
|
|
|
data.filePathList = data?.upload?.map((item: any) => { |
|
|
@ -289,6 +291,7 @@ onMounted(async () => { |
|
|
|
importTemplateData.templateUrl = await MoldRepairApi.importTemplate() |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
const onChange = (field, cur, item,formRef) => { |
|
|
|
if (field == 'factoryAreaNumber') { |
|
|
|
nextTick(() => { |
|
|
@ -296,6 +299,60 @@ const onChange = (field, cur, item, formRef) => { |
|
|
|
setV['deviceNumber'] = '' |
|
|
|
formRef.setValues(setV) |
|
|
|
}) |
|
|
|
factoryAreaNumber.value = cur |
|
|
|
if(type.value != 'MOLD'){ |
|
|
|
DeviceAccountApi.getDeviceAccountsAllNoPage({ |
|
|
|
factoryAreaNumber: cur, |
|
|
|
type: type.value, |
|
|
|
status: '0' |
|
|
|
}).then((res) => { |
|
|
|
MoldRepair.allSchemas.formSchema.find(item => { |
|
|
|
return item.field == 'deviceNumber' |
|
|
|
}).componentProps.options = res |
|
|
|
}) |
|
|
|
}else{ |
|
|
|
MoldAccountApi.getMoldAccountsAllNoPage({ |
|
|
|
factoryAreaNumber: cur, |
|
|
|
type: type.value, |
|
|
|
status: '0' |
|
|
|
}).then((res) => { |
|
|
|
MoldRepair.allSchemas.formSchema.find(item => { |
|
|
|
return item.field == 'deviceNumber' |
|
|
|
}).componentProps.options = res |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if (field == 'type') { |
|
|
|
nextTick(() => { |
|
|
|
const setV = {} |
|
|
|
setV['deviceNumber'] = '' |
|
|
|
formRef.setValues(setV) |
|
|
|
}) |
|
|
|
|
|
|
|
if(cur != 'MOLD'){ |
|
|
|
type.value = 'DEVICE' |
|
|
|
DeviceAccountApi.getDeviceAccountsAllNoPage({ |
|
|
|
factoryAreaNumber: factoryAreaNumber.value, |
|
|
|
type: 'DEVICE', |
|
|
|
status: '0' |
|
|
|
}).then((res) => { |
|
|
|
MoldRepair.allSchemas.formSchema.find(item => { |
|
|
|
return item.field == 'deviceNumber' |
|
|
|
}).componentProps.options = res |
|
|
|
}) |
|
|
|
}else{ |
|
|
|
type.value = 'MOLD' |
|
|
|
MoldAccountApi.getMoldAccountsAllNoPage({ |
|
|
|
factoryAreaNumber: factoryAreaNumber.value, |
|
|
|
type: 'MOLD', |
|
|
|
status: '0' |
|
|
|
}).then((res) => { |
|
|
|
MoldRepair.allSchemas.formSchema.find(item => { |
|
|
|
return item.field == 'deviceNumber' |
|
|
|
}).componentProps.options = res |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|