|
@@ -16,6 +16,10 @@
|
|
|
<span class="info-label">{{ t('iotDevice.name') }}:</span>
|
|
|
<span class="info-value">{{ deviceInfo.deviceName }}</span>
|
|
|
</div>
|
|
|
+ <div class="info-item" v-if="deviceInfo.model">
|
|
|
+ <span class="info-label">{{ t('deviceForm.model') }}:</span>
|
|
|
+ <span class="info-value">{{ deviceInfo.model }}</span>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
|
|
|
<div class="table-container">
|
|
@@ -126,6 +130,9 @@ const total = ref(0) // 列表的总页数
|
|
|
// 分页重置标志
|
|
|
const shouldResetPagination = ref(false)
|
|
|
|
|
|
+// 添加外部传入的设备信息
|
|
|
+const externalDeviceInfo = ref(null)
|
|
|
+
|
|
|
const dialogWidth = '1500px';
|
|
|
|
|
|
const tableRef = ref(null) // 表格实例引用
|
|
@@ -283,7 +290,7 @@ const paginatedList = computed(() => {
|
|
|
return list.value.slice(start, end);
|
|
|
});
|
|
|
|
|
|
-const open = async (id?: number, flag?: string, deviceId?: number) => {
|
|
|
+const open = async (id?: number, flag?: string, deviceInfo?: any) => {
|
|
|
// 重置分页参数
|
|
|
queryParams.pageNo = 1
|
|
|
queryParams.pageSize = 10
|
|
@@ -291,7 +298,10 @@ const open = async (id?: number, flag?: string, deviceId?: number) => {
|
|
|
total.value = 0
|
|
|
|
|
|
await nextTick() // 确保DOM更新完成
|
|
|
- queryParams.deviceId = deviceId
|
|
|
+ if (deviceInfo) {
|
|
|
+ externalDeviceInfo.value = deviceInfo
|
|
|
+ queryParams.deviceId = deviceInfo.id // 如果需要的话
|
|
|
+ }
|
|
|
if('workOrder' === flag) {
|
|
|
// 加载保养工单 BOM
|
|
|
queryParams.workOrderId = id
|
|
@@ -365,11 +375,16 @@ const getPlanList = async () => {
|
|
|
|
|
|
// 添加设备信息计算属性
|
|
|
const deviceInfo = computed(() => {
|
|
|
+ // 优先使用外部传入的设备信息
|
|
|
+ if (externalDeviceInfo.value) {
|
|
|
+ return externalDeviceInfo.value;
|
|
|
+ }
|
|
|
if (list.value.length > 0) {
|
|
|
const firstRecord = list.value[0];
|
|
|
return {
|
|
|
deviceCode: firstRecord.deviceCode,
|
|
|
- deviceName: firstRecord.deviceName
|
|
|
+ deviceName: firstRecord.deviceName,
|
|
|
+ model: firstRecord.model // 确保列表数据中也有 model
|
|
|
};
|
|
|
}
|
|
|
return null;
|