zhang_12370
6 天以前 0ce559e6195a189ccc777b0fa439906bffb12b55
src/views/production/index.vue
@@ -22,10 +22,16 @@
        <el-button type="success" :icon="Plus" @click="openDialog('add')">
          新增加工
        </el-button>
        <el-button type="danger" :icon="Delete" :disabled="!selectedRows.length" @click="() => deleteSelected(delPM)">
        <el-button
          type="danger"
          :icon="Delete"
          :disabled="!selectedRows.length"
          @click="() => deleteSelected(delPM)"
        >
          删除
        </el-button>
      </div>      <!-- 数据表格 -->
      </div>
      <!-- 数据表格 -->
      <ETable
          :showOverflowTooltip="false"
          :loading="loading"
@@ -34,9 +40,13 @@
          :current-page="queryParams.current"
          :page-size="queryParams.size"
          @selection-change="handleSelectionChange"
          @edit="row => openDialog('edit', row)"
        @edit="(row) => openDialog('edit', row)"
          :show-selection="true"
          :border="true"
        @viewRow="(row) => (viewRow('viewRow', row))"
        :operations="['edit', 'viewRow']"
        :operationsWidth="200"
        :show-overflow-tooltip="false"
          style="width: 100%;height: calc(100vh - 26em)"
      >
        <template #coalId="{ row }">
@@ -55,7 +65,8 @@
            <span v-else class="no-data">--</span>
          </div>
        </template>
      </ETable>      <!-- 分页组件 -->
      </ETable>
      <!-- 分页组件 -->
      <Pagination
          :layout="'total, prev, pager, next, jumper'"
          :total="total"
@@ -116,7 +127,7 @@
  handleReset,
  handlePageChange,
  handleSelectionChange,
  deleteSelected
  deleteSelected,
} = useTableData(getProductionMasterList, {pageSize: 10});
// 使用对话框组合式函数
@@ -125,7 +136,8 @@
  dialogType,
  dialogRef,
  openDialog,
  handleDialogSuccess: onDialogSuccess
  viewRow,
  handleDialogSuccess: onDialogSuccess,
} = useDialog();
// 使用煤种数据组合式函数
@@ -138,7 +150,7 @@
  
  // 如果没有找到,尝试从 coalInfoList 中查找
  if (name === coalId && coalInfoList.value.length > 0) {
    const found = coalInfoList.value.find(item => item.id == coalId);
    const found = coalInfoList.value.find((item) => item.id == coalId);
    name = found ? found.coal : coalId;
  }
  
@@ -147,7 +159,7 @@
// 处理生产数据更新
const handleProductionAndProcessing = (row, rows) => {
  const index = tableData.value.findIndex(item => item.id === rows.id);
  const index = tableData.value.findIndex((item) => item.id === rows.id);
  if (index !== -1) {
    tableData.value[index] = {...tableData.value[index], ...row};
  }
@@ -172,13 +184,13 @@
        if (res.code === 200) {
          coalInfoList.value = res.data;
        }
      })()
      })(),
    ]);
    
    // 加载表格数据
    getList();
  } catch (error) {
    ElMessage.error('数据加载失败,请刷新页面重试');
    ElMessage.error("数据加载失败,请刷新页面重试");
  }
});
</script>