|
|
|
|
@ -47,6 +47,27 @@
|
|
|
|
|
</el-col>
|
|
|
|
|
</el-row>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-row :gutter="20">
|
|
|
|
|
<el-col :span="12">
|
|
|
|
|
<el-form-item
|
|
|
|
|
:label="t('EquipmentManagement.EquipmentLedger.lineCategory')"
|
|
|
|
|
prop="deviceLine"
|
|
|
|
|
required
|
|
|
|
|
>
|
|
|
|
|
<el-tree-select
|
|
|
|
|
v-model="formData.deviceLine"
|
|
|
|
|
:data="deviceLineTree"
|
|
|
|
|
:props="treeSelectProps"
|
|
|
|
|
check-strictly
|
|
|
|
|
default-expand-all
|
|
|
|
|
value-key="id"
|
|
|
|
|
clearable
|
|
|
|
|
:placeholder="t('EquipmentManagement.EquipmentLedger.placeholderLineCategory')"
|
|
|
|
|
class="!w-full"
|
|
|
|
|
/>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
</el-row>
|
|
|
|
|
|
|
|
|
|
<el-row :gutter="20">
|
|
|
|
|
<el-col :span="12">
|
|
|
|
|
@ -765,6 +786,7 @@
|
|
|
|
|
import { DeviceLedgerApi, DeviceLedgerVO } from '@/api/mes/deviceledger'
|
|
|
|
|
import { CriticalComponentApi, CriticalComponentVO } from '@/api/mes/criticalComponent'
|
|
|
|
|
import { DeviceTypeApi, DeviceTypeTreeVO } from '@/api/mes/devicetype'
|
|
|
|
|
import { DeviceLineApi, DeviceLineTreeVO } from '@/api/mes/deviceline'
|
|
|
|
|
import { getSimpleUserList, UserVO } from '@/api/system/user'
|
|
|
|
|
import { formatDate } from '@/utils/formatTime'
|
|
|
|
|
import type { FormRules } from 'element-plus'
|
|
|
|
|
@ -980,6 +1002,13 @@ const formRules = reactive<FormRules>({
|
|
|
|
|
trigger: 'change'
|
|
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
deviceLine: [
|
|
|
|
|
{
|
|
|
|
|
required: true,
|
|
|
|
|
message: t('EquipmentManagement.EquipmentLedger.placeholderLineCategory'),
|
|
|
|
|
trigger: 'change'
|
|
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
ratedCapacity: [
|
|
|
|
|
{ validator: validateScheduledRequired('棰濆畾浜ц兘'), trigger: ['blur', 'change'] }
|
|
|
|
|
]
|
|
|
|
|
@ -999,6 +1028,7 @@ watch(
|
|
|
|
|
|
|
|
|
|
const treeSelectProps = { label: 'name', children: 'children' }
|
|
|
|
|
const deviceTypeTree = ref<DeviceTypeTreeVO[]>([])
|
|
|
|
|
const deviceLineTree = ref<DeviceLineTreeVO[]>([])
|
|
|
|
|
const findDeviceTypeName = (id: string | number): string | undefined => {
|
|
|
|
|
const stack = [...deviceTypeTree.value]
|
|
|
|
|
while (stack.length) {
|
|
|
|
|
@ -1287,13 +1317,15 @@ const handleQrcodeRefreshSuccess = async (data: any) => {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const ensureOptionsLoaded = async () => {
|
|
|
|
|
const [deviceTypeRes, userRes, criticalRes, beijianRes] = await Promise.all([
|
|
|
|
|
const [deviceTypeRes, deviceLineRes, userRes, criticalRes, beijianRes] = await Promise.all([
|
|
|
|
|
DeviceTypeApi.getDeviceTypeTree({ pageNo: 1, pageSize: 10 }),
|
|
|
|
|
DeviceLineApi.getDeviceLineTree(),
|
|
|
|
|
getSimpleUserList(),
|
|
|
|
|
CriticalComponentApi.getCriticalComponentList(),
|
|
|
|
|
ProductApi.getProductPage({ pageNo: 1, pageSize: 10, categoryType: SPARE_PART_CATEGORY_TYPE })
|
|
|
|
|
])
|
|
|
|
|
deviceTypeTree.value = deviceTypeRes
|
|
|
|
|
deviceLineTree.value = deviceLineRes ?? []
|
|
|
|
|
users.value = userRes ?? []
|
|
|
|
|
criticalComponentOptions.value = buildCriticalComponentOptions(criticalRes ?? [])
|
|
|
|
|
beijianOptions.value = buildBeijianOptions(beijianRes?.list ?? [])
|
|
|
|
|
|