|
|
|
@ -74,6 +74,7 @@
|
|
|
|
t('EquipmentManagement.EquipmentLedger.placeholderDeviceType')
|
|
|
|
t('EquipmentManagement.EquipmentLedger.placeholderDeviceType')
|
|
|
|
"
|
|
|
|
"
|
|
|
|
class="!w-full"
|
|
|
|
class="!w-full"
|
|
|
|
|
|
|
|
@change="() => { formData.typeName = findDeviceTypeName(formData.deviceType) }"
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
</el-form-item>
|
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
</el-col>
|
|
|
|
@ -1186,6 +1187,7 @@ const initFormData = () => ({
|
|
|
|
isScheduled: 0,
|
|
|
|
isScheduled: 0,
|
|
|
|
ratedCapacity: undefined,
|
|
|
|
ratedCapacity: undefined,
|
|
|
|
deviceType: undefined as string | undefined,
|
|
|
|
deviceType: undefined as string | undefined,
|
|
|
|
|
|
|
|
typeName: undefined as string | undefined,
|
|
|
|
deviceLine: undefined as string | undefined,
|
|
|
|
deviceLine: undefined as string | undefined,
|
|
|
|
supplier: undefined,
|
|
|
|
supplier: undefined,
|
|
|
|
workshop: undefined,
|
|
|
|
workshop: undefined,
|
|
|
|
@ -1284,6 +1286,15 @@ const formRules = reactive<FormRules>({
|
|
|
|
})
|
|
|
|
})
|
|
|
|
const treeSelectProps = { label: 'name', children: 'children' }
|
|
|
|
const treeSelectProps = { label: 'name', children: 'children' }
|
|
|
|
const deviceTypeTree = ref<DeviceTypeTreeVO[]>([])
|
|
|
|
const deviceTypeTree = ref<DeviceTypeTreeVO[]>([])
|
|
|
|
|
|
|
|
const findDeviceTypeName = (id: string | number): string | undefined => {
|
|
|
|
|
|
|
|
const stack = [...deviceTypeTree.value]
|
|
|
|
|
|
|
|
while (stack.length) {
|
|
|
|
|
|
|
|
const node = stack.pop()!
|
|
|
|
|
|
|
|
if (String(node.id) === String(id)) return node.name
|
|
|
|
|
|
|
|
if (Array.isArray(node.children) && node.children.length) stack.push(...node.children)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return undefined
|
|
|
|
|
|
|
|
}
|
|
|
|
const users = ref<UserVO[]>([])
|
|
|
|
const users = ref<UserVO[]>([])
|
|
|
|
type SelectionOption = { label: string; value: number }
|
|
|
|
type SelectionOption = { label: string; value: number }
|
|
|
|
const criticalComponentOptions = ref<SelectionOption[]>([])
|
|
|
|
const criticalComponentOptions = ref<SelectionOption[]>([])
|
|
|
|
@ -1676,6 +1687,7 @@ const buildSubmitData = () => {
|
|
|
|
isScheduled: normalizeNumberish((formData.value as any).isScheduled) ?? 0,
|
|
|
|
isScheduled: normalizeNumberish((formData.value as any).isScheduled) ?? 0,
|
|
|
|
ratedCapacity: normalizeNumberish((formData.value as any).ratedCapacity),
|
|
|
|
ratedCapacity: normalizeNumberish((formData.value as any).ratedCapacity),
|
|
|
|
deviceType: (formData.value as any).deviceType ?? undefined,
|
|
|
|
deviceType: (formData.value as any).deviceType ?? undefined,
|
|
|
|
|
|
|
|
typeName: (formData.value as any).typeName ?? findDeviceTypeName((formData.value as any).deviceType),
|
|
|
|
deviceLine: (formData.value as any).deviceLine ?? undefined,
|
|
|
|
deviceLine: (formData.value as any).deviceLine ?? undefined,
|
|
|
|
productionDate: normalizeYmd(formData.value.productionDate),
|
|
|
|
productionDate: normalizeYmd(formData.value.productionDate),
|
|
|
|
outgoingTime: normalizeYmd((formData.value as any).outgoingTime),
|
|
|
|
outgoingTime: normalizeYmd((formData.value as any).outgoingTime),
|
|
|
|
|