feat: add RBAC controls for outbound selection module
Co-authored-by: aider (openai/DeepSeek-V3.2-Thinking) <aider@aider.chat>
This commit is contained in:
@ -8,14 +8,14 @@
|
||||
<span class="subtitle">(请添加需要出库的物品)</span>
|
||||
</div>
|
||||
<div>
|
||||
<el-button type="primary" :icon="Plus" @click="openManualSelect">
|
||||
<el-button v-if="userStore.hasPermission('outbound_selection:operation')" type="primary" :icon="Plus" @click="openManualSelect">
|
||||
手动添加库存
|
||||
</el-button>
|
||||
<el-button type="warning" :icon="List" @click="openBomSelect">
|
||||
<el-button v-if="userStore.hasPermission('outbound_selection:operation')" type="warning" :icon="List" @click="openBomSelect">
|
||||
按 BOM 套餐添加
|
||||
</el-button>
|
||||
<el-divider direction="vertical" />
|
||||
<el-button type="success" :icon="Printer" :disabled="selectedItems.length === 0" @click="handlePreview">
|
||||
<el-button v-if="userStore.hasPermission('outbound_selection:operation')" type="success" :icon="Printer" :disabled="selectedItems.length === 0" @click="handlePreview">
|
||||
生成预览 & 打印
|
||||
</el-button>
|
||||
</div>
|
||||
@ -71,6 +71,7 @@
|
||||
size="small"
|
||||
style="width: 100%"
|
||||
controls-position="right"
|
||||
:disabled="!userStore.hasPermission('outbound_selection:operation')"
|
||||
@change="(val) => handleMainQuantityChange(val, row)"
|
||||
/>
|
||||
</template>
|
||||
@ -78,7 +79,7 @@
|
||||
|
||||
<el-table-column label="操作" width="80" align="center" fixed="right">
|
||||
<template #default="{ $index }">
|
||||
<el-button type="danger" link @click="removeRow($index)">移除</el-button>
|
||||
<el-button v-if="userStore.hasPermission('outbound_selection:operation')" type="danger" link @click="removeRow($index)">移除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@ -133,6 +134,7 @@
|
||||
size="small"
|
||||
style="width: 100%"
|
||||
placeholder="0"
|
||||
:disabled="!userStore.hasPermission('outbound_selection:operation')"
|
||||
@click.stop
|
||||
@change="(val) => handleManualQuantityChange(val, row)"
|
||||
/>
|
||||
@ -144,7 +146,7 @@
|
||||
已勾选 {{ tempSelection.length }} 项
|
||||
</span>
|
||||
<el-button @click="manualDialogVisible = false">取消</el-button>
|
||||
<el-button type="primary" @click="confirmManualAdd">确认添加</el-button>
|
||||
<el-button v-if="userStore.hasPermission('outbound_selection:operation')" type="primary" @click="confirmManualAdd">确认添加</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
@ -161,7 +163,7 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="生产套数">
|
||||
<el-input-number v-model="bomSets" :min="1" label="套" style="width: 200px;" />
|
||||
<el-input-number v-model="bomSets" :min="1" label="套" style="width: 200px;" :disabled="!userStore.hasPermission('outbound_selection:operation')" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div style="margin-left: 100px; color: #909399; font-size: 12px;">
|
||||
@ -169,7 +171,7 @@
|
||||
</div>
|
||||
<template #footer>
|
||||
<el-button @click="bomSelectVisible = false">取消</el-button>
|
||||
<el-button type="primary" @click="confirmBomAdd">一键计算并添加</el-button>
|
||||
<el-button v-if="userStore.hasPermission('outbound_selection:operation')" type="primary" @click="confirmBomAdd">一键计算并添加</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
@ -204,11 +206,11 @@
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="previewVisible = false">取消</el-button>
|
||||
|
||||
<el-button type="warning" :icon="Download" :loading="exportLoading" @click="confirmExport">
|
||||
<el-button v-if="userStore.hasPermission('outbound_selection:operation')" type="warning" :icon="Download" :loading="exportLoading" @click="confirmExport">
|
||||
导出 Excel
|
||||
</el-button>
|
||||
|
||||
<el-button type="primary" :icon="Printer" :loading="printLoading" @click="confirmPrint">
|
||||
<el-button v-if="userStore.hasPermission('outbound_selection:operation')" type="primary" :icon="Printer" :loading="printLoading" @click="confirmPrint">
|
||||
确认打印 (A4)
|
||||
</el-button>
|
||||
</span>
|
||||
@ -283,6 +285,9 @@ import { Printer, Search, Plus, Download, List } from '@element-plus/icons-vue'
|
||||
import { ElMessage, ElTable, ElMessageBox } from 'element-plus'
|
||||
import { getAllStock, printSelectionList } from '@/api/inbound/stock'
|
||||
import { getBomList, getBomDetail } from '@/api/bom'
|
||||
import { useUserStore } from '@/stores/user'
|
||||
|
||||
const userStore = useUserStore()
|
||||
|
||||
// --- 状态变量 ---
|
||||
const selectedItems = ref<any[]>([])
|
||||
@ -598,4 +603,4 @@ const confirmExport = () => {
|
||||
.sig-label { font-size: 14px; margin-bottom: 40px; text-align: left; width: 100%; }
|
||||
.sig-line { border-bottom: 1px solid #000; width: 100%; height: 1px; display: block; }
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user