| | |
| | | @confirm="handleProcessFlowSelectConfirm" /> |
| | | <el-space wrap> |
| | | <el-button type="primary" |
| | | @click="handleAudit">审核</el-button> |
| | | @click="handleAudit" |
| | | :disabled="isBatchButtonDisabled('audit')">审核</el-button> |
| | | <el-button type="primary" |
| | | @click="handleReverseAudit">反审</el-button> |
| | | @click="handleReverseAudit" |
| | | :disabled="isBatchButtonDisabled('reverseAudit')">反审</el-button> |
| | | <el-button type="primary" |
| | | @click="handleSalesStock">入库</el-button> |
| | | @click="handleSalesStock" |
| | | :disabled="isBatchButtonDisabled('stock')">入库</el-button> |
| | | <el-button type="primary" |
| | | @click="openForm('add')">新增台账</el-button> |
| | | <el-button type="primary" |
| | | @click="handleBulkDelivery">发货</el-button> |
| | | @click="handleBulkDelivery" |
| | | :disabled="isBatchButtonDisabled('delivery')">发货</el-button> |
| | | <el-button type="primary" |
| | | plain |
| | | @click="handleImport">导入</el-button> |
| | |
| | | </el-dropdown-menu> |
| | | </template> |
| | | </el-dropdown> |
| | | <el-button @click="handleOut">导出</el-button> |
| | | <el-button @click="handleOut" |
| | | :disabled="isBatchButtonDisabled('export')">导出</el-button> |
| | | <el-button type="danger" |
| | | plain |
| | | @click="handleDelete">删除</el-button> |
| | | @click="handleDelete" |
| | | :disabled="isBatchButtonDisabled('delete')">删除</el-button> |
| | | <el-dropdown @command="handlePrintCommand"> |
| | | <el-button type="primary" |
| | | plain> |
| | | plain |
| | | :disabled="isBatchButtonDisabled('print')"> |
| | | 打印单据<el-icon class="el-icon--right"> |
| | | <ArrowDown /> |
| | | </el-icon> |
| | |
| | | </el-dropdown> |
| | | <el-button type="primary" |
| | | plain |
| | | @click="handlePrintLabel">打印标签</el-button> |
| | | @click="handlePrintLabel" |
| | | :disabled="isBatchButtonDisabled('print')">打印标签</el-button> |
| | | </el-space> |
| | | </div> |
| | | <el-table :data="tableData" |
| | |
| | | <el-button link |
| | | type="primary" |
| | | @click="openForm('edit', scope.row)" |
| | | :disabled="!scope.row.isEdit">编辑</el-button> |
| | | :disabled="Number(scope.row.reviewStatus) === 1">编辑</el-button> |
| | | <el-button link |
| | | type="primary" |
| | | @click="openProcessFlowSelect(scope.row)" |
| | |
| | | handleQuery(); |
| | | }; |
| | | |
| | | /** 批量按钮禁用判断:根据选中行的审核状态控制按钮可用性 |
| | | * 未审核(0):只能审核、删除、编辑 |
| | | * 已审核(1):可以反审、入库、发货、导出、打印、工艺路线 |
| | | * 未选中任何行时所有批量按钮禁用 |
| | | */ |
| | | const isBatchButtonDisabled = (action) => { |
| | | if (selectedRows.value.length === 0) return true; |
| | | const statuses = selectedRows.value.map(r => Number(r.reviewStatus)); |
| | | const allUnreviewed = statuses.every(s => s === 0); |
| | | const allReviewed = statuses.every(s => s === 1); |
| | | switch (action) { |
| | | case 'audit': |
| | | return !allUnreviewed; |
| | | case 'reverseAudit': |
| | | return !allReviewed; |
| | | case 'stock': |
| | | return !allReviewed; |
| | | case 'delivery': |
| | | return !allReviewed; |
| | | case 'export': |
| | | return !allReviewed; |
| | | case 'delete': |
| | | return !allUnreviewed; |
| | | case 'print': |
| | | return !allReviewed; |
| | | default: |
| | | return false; |
| | | } |
| | | }; |
| | | |
| | | // 查询列表 |
| | | /** 搜索按钮操作 */ |
| | | const handleQuery = () => { |