feat(stocking): 备货单列表为特权用户增加「全部/我的」视图切换

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
mzl
2026-08-06 11:40:19 +08:00
parent aa23d0949b
commit 1d9ef001c1
+20 -1
View File
@@ -7,6 +7,15 @@
>
</div>
<div class="toolbar-right">
<el-radio-group
v-if="canViewAll"
v-model="viewScope"
@change="onScopeChange"
style="margin-right: 12px"
>
<el-radio-button value="self">我的</el-radio-button>
<el-radio-button value="all">全部</el-radio-button>
</el-radio-group>
<el-input
v-model="keyword"
placeholder="请输入客户名称"
@@ -272,6 +281,7 @@
import FilePreview from '@/components/custom/FilePreview.vue'
import { usePdfPreview } from '@/composables/usePdfPreview'
import { manageService } from '@/api/adminApi'
import { useUserStore } from '@/store/modules/user'
const nqCurrency = ref('')
const nqData = ref<any[]>([])
const timelineDialogVisible = ref(false)
@@ -279,6 +289,14 @@
const isFinites = ref(false)
import { useAuth } from '@/composables/useAuth'
const { hasAuth } = useAuth()
const userStore = useUserStore()
// 仅 userId=73 的特权用户可切换「全部/我的」
const canViewAll = computed(() => userStore.getUserInfo.userId === 73)
const viewScope = ref<'all' | 'self'>('self')
const onScopeChange = () => {
pagination.currentPage = 1
getList()
}
defineOptions({ name: 'CrmStockingList' }) // 定义组件名称,用于 KeepAlive 缓存控制
@@ -340,7 +358,8 @@
current: currentPage,
size: pageSize,
is_final: 0, // 只获取备货单,非终版
keyword: keyword.value
keyword: keyword.value,
view_scope: viewScope.value
}
const { records, current, size, total } = await CrmService.getStockList(params)