feat(stocking): 备货单列表为特权用户增加「全部/我的」视图切换
Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -7,6 +7,15 @@
|
|||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
<div class="toolbar-right">
|
<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
|
<el-input
|
||||||
v-model="keyword"
|
v-model="keyword"
|
||||||
placeholder="请输入客户名称"
|
placeholder="请输入客户名称"
|
||||||
@@ -272,6 +281,7 @@
|
|||||||
import FilePreview from '@/components/custom/FilePreview.vue'
|
import FilePreview from '@/components/custom/FilePreview.vue'
|
||||||
import { usePdfPreview } from '@/composables/usePdfPreview'
|
import { usePdfPreview } from '@/composables/usePdfPreview'
|
||||||
import { manageService } from '@/api/adminApi'
|
import { manageService } from '@/api/adminApi'
|
||||||
|
import { useUserStore } from '@/store/modules/user'
|
||||||
const nqCurrency = ref('')
|
const nqCurrency = ref('')
|
||||||
const nqData = ref<any[]>([])
|
const nqData = ref<any[]>([])
|
||||||
const timelineDialogVisible = ref(false)
|
const timelineDialogVisible = ref(false)
|
||||||
@@ -279,6 +289,14 @@
|
|||||||
const isFinites = ref(false)
|
const isFinites = ref(false)
|
||||||
import { useAuth } from '@/composables/useAuth'
|
import { useAuth } from '@/composables/useAuth'
|
||||||
const { hasAuth } = 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 缓存控制
|
defineOptions({ name: 'CrmStockingList' }) // 定义组件名称,用于 KeepAlive 缓存控制
|
||||||
|
|
||||||
@@ -340,7 +358,8 @@
|
|||||||
current: currentPage,
|
current: currentPage,
|
||||||
size: pageSize,
|
size: pageSize,
|
||||||
is_final: 0, // 只获取备货单,非终版
|
is_final: 0, // 只获取备货单,非终版
|
||||||
keyword: keyword.value
|
keyword: keyword.value,
|
||||||
|
view_scope: viewScope.value
|
||||||
}
|
}
|
||||||
|
|
||||||
const { records, current, size, total } = await CrmService.getStockList(params)
|
const { records, current, size, total } = await CrmService.getStockList(params)
|
||||||
|
|||||||
Reference in New Issue
Block a user