gaoluyang
2025-06-04 b66453b8b4a7ba6dc94127bb5c9a6647519e447a
src/views/production/index.vue
@@ -8,11 +8,10 @@
    </div>
    <div class="operation-bar">
      <el-button type="primary" @click="handleAdd">新增配项</el-button>
      <el-button type="success" @click="handleAddBatch">新增加工</el-button>
      <el-button type="warning">修改</el-button>
      <el-button type="danger">删除</el-button>
      <el-button type="info">导出</el-button>
      <!-- <el-button type="primary" @click="handleAdd">新增配项</el-button> -->
      <el-button type="success" :icon="Plus" @click="handleAddBatch">新增加工</el-button>
      <el-button type="danger" :icon="Delete">删除</el-button>
      <el-button type="info" :icon="Download">导出</el-button>
    </div>
    <el-table :data="tableData" border style="width: 100%" @selection-change="handleSelectionChange">
@@ -52,7 +51,7 @@
    </div>
    <!-- 弹窗组件 -->
    <ProductionDialog-dialog
    <ProductionDialog
      v-model:visible="dialogVisible"
      :type="dialogType"
      :row-data="currentRow"
@@ -64,7 +63,7 @@
<script setup>
import { ref, reactive, onMounted } from 'vue'
import { ElMessage, ElMessageBox } from 'element-plus'
import { getProductionList, addProduction, updateProduction, deleteProduction, exportProduction } from '@/api/production'
import { Plus, Delete, Download } from "@element-plus/icons-vue";
import ProductionDialog from './components/ProductionDialog.vue'
// 搜索表单数据
@@ -127,7 +126,6 @@
    tableData.value = res.data.list
    pagination.total = res.data.total
  } catch (error) {
    console.error('获取数据失败:', error)
    ElMessage.error('获取数据失败')
  } finally {
    loading.value = false
@@ -186,7 +184,6 @@
    }
    getList()
  } catch (error) {
    console.error(dialogType.value === 'add' ? '新增失败:' : '更新失败:', error)
    ElMessage.error(dialogType.value === 'add' ? '新增失败' : '更新失败')
  }
}
@@ -230,7 +227,6 @@
      navigator.msSaveBlob(blob, fileName)
    }
  } catch (error) {
    console.error('导出失败:', error)
    ElMessage.error('导出失败')
  }
}