| | |
| | | <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" |
| | |
| | | :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 }"> |
| | |
| | | <span v-else class="no-data">--</span> |
| | | </div> |
| | | </template> |
| | | </ETable> <!-- 分页组件 --> |
| | | </ETable> |
| | | <!-- 分页组件 --> |
| | | <Pagination |
| | | :layout="'total, prev, pager, next, jumper'" |
| | | :total="total" |
| | |
| | | handleReset, |
| | | handlePageChange, |
| | | handleSelectionChange, |
| | | deleteSelected |
| | | deleteSelected, |
| | | } = useTableData(getProductionMasterList, {pageSize: 10}); |
| | | |
| | | // 使用对话框组合式函数 |
| | |
| | | dialogType, |
| | | dialogRef, |
| | | openDialog, |
| | | handleDialogSuccess: onDialogSuccess |
| | | viewRow, |
| | | handleDialogSuccess: onDialogSuccess, |
| | | } = useDialog(); |
| | | |
| | | // 使用煤种数据组合式函数 |
| | |
| | | |
| | | // 如果没有找到,尝试从 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; |
| | | } |
| | | |
| | |
| | | |
| | | // 处理生产数据更新 |
| | | 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}; |
| | | } |
| | |
| | | if (res.code === 200) { |
| | | coalInfoList.value = res.data; |
| | | } |
| | | })() |
| | | })(), |
| | | ]); |
| | | |
| | | // 加载表格数据 |
| | | getList(); |
| | | } catch (error) { |
| | | ElMessage.error('数据加载失败,请刷新页面重试'); |
| | | ElMessage.error("数据加载失败,请刷新页面重试"); |
| | | } |
| | | }); |
| | | </script> |