feat:部门选择

This commit is contained in:
houjunxiang
2025-12-01 17:02:40 +08:00
parent 298503fec8
commit b7a94c91fe
3 changed files with 12 additions and 3 deletions

View File

@@ -149,6 +149,7 @@ http.interceptors.response.use(
if (companyDeptList.length === 1) { if (companyDeptList.length === 1) {
const item = companyDeptList[0] const item = companyDeptList[0]
if (!config.header[COMPANY_DEPT_RETRY_HEADER]) { if (!config.header[COMPANY_DEPT_RETRY_HEADER]) {
$store('company-dept').showSelectDept = false
applyCompanyDeptSelection(item, config) applyCompanyDeptSelection(item, config)
return http.request(config) return http.request(config)
} }
@@ -159,6 +160,7 @@ http.interceptors.response.use(
}) })
return Promise.resolve(data) return Promise.resolve(data)
} else if (companyDeptList.length > 1) { } else if (companyDeptList.length > 1) {
$store('company-dept').showSelectDept = true
const groupedList = normalizeCompanyDeptList(companyDeptList) const groupedList = normalizeCompanyDeptList(companyDeptList)
const companyDeptDialogStore = $store('company-dept') const companyDeptDialogStore = $store('company-dept')
return new Promise(resolve => { return new Promise(resolve => {

View File

@@ -8,7 +8,8 @@ const defaultState = () => ({
selectedCompanyId: null, selectedCompanyId: null,
selectedDeptId: null, selectedDeptId: null,
onConfirm: null, onConfirm: null,
onCancel: null onCancel: null,
showSelectDept: false
}) })
const companyDeptStore = defineStore({ const companyDeptStore = defineStore({

View File

@@ -11,7 +11,13 @@
</view> </view>
<u-cell-group> <u-cell-group>
<u-cell icon="grid-fill" title="公司部门选择" :is-link="true" @click="handleSelectCompany" /> <u-cell
icon="grid-fill"
v-if="showSelectDept"
title="公司部门选择"
:is-link="true"
@click="handleSelectCompany"
/>
<u-cell icon="grid-fill" title="模块选择" :is-link="true" @click="handleTo('/pages/index/index')" /> <u-cell icon="grid-fill" title="模块选择" :is-link="true" @click="handleTo('/pages/index/index')" />
<u-cell icon="order" title="打印设置" :isLink="true" @click="handleTo('/pages/setting/print')"></u-cell> <u-cell icon="order" title="打印设置" :isLink="true" @click="handleTo('/pages/setting/print')"></u-cell>
@@ -55,7 +61,7 @@ const emit = defineEmits(['update:show', 'open', 'close'])
// 响应式数据 // 响应式数据
const modalShow = ref(false) const modalShow = ref(false)
const dialogStore = nx.$store('company-dept') const dialogStore = nx.$store('company-dept')
const { companyList, selectedCompanyId, selectedDeptId } = storeToRefs(dialogStore) const { companyList, selectedCompanyId, selectedDeptId, showSelectDept } = storeToRefs(dialogStore)
// 计算属性 // 计算属性
const userInfo = computed(() => nx.$store('user').userInfo) const userInfo = computed(() => nx.$store('user').userInfo)
const deptName = computed(() => { const deptName = computed(() => {