feat:部门选择
This commit is contained in:
196
components/company-dept-dialog/company-dept-dialog.vue
Normal file
196
components/company-dept-dialog/company-dept-dialog.vue
Normal file
File diff suppressed because it is too large
Load Diff
10
components/n-layout/n-layout.vue
Normal file
10
components/n-layout/n-layout.vue
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
<template>
|
||||||
|
<view>
|
||||||
|
<slot />
|
||||||
|
<company-dept-dialog />
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup></script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped></style>
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
// 在此不用配置接口前缀
|
// 在此不用配置接口前缀
|
||||||
const isDev = process.env.NODE_ENV === 'development'
|
const isDev = process.env.NODE_ENV === 'development'
|
||||||
// const BaseUrl = isDev ? 'http://192.168.26.116:888/admin-api' : 'http://192.168.26.116:888/admin-api'
|
const BaseUrl = isDev ? 'http://192.168.26.116:888/admin-api' : 'http://192.168.26.116:888/admin-api'
|
||||||
const BaseUrl = isDev ? 'http://192.168.26.163:48080/admin-api' : 'http://192.168.26.116:888/admin-api'
|
// const BaseUrl = isDev ? 'http://192.168.26.163:48080/admin-api' : 'http://192.168.26.116:888/admin-api'
|
||||||
//
|
//
|
||||||
// const BaseUrl = isDev ? 'http://localhost:9999' : ''
|
// const BaseUrl = isDev ? 'http://localhost:9999' : ''
|
||||||
const upgradeBaseUrl = 'http://192.168.26.116:888'
|
const upgradeBaseUrl = 'http://192.168.26.116:888'
|
||||||
|
|
||||||
|
|||||||
@@ -63,6 +63,7 @@ export default {
|
|||||||
method: 'GET',
|
method: 'GET',
|
||||||
params
|
params
|
||||||
}),
|
}),
|
||||||
|
|
||||||
//调拨归还执行
|
//调拨归还执行
|
||||||
execGiveback: data =>
|
execGiveback: data =>
|
||||||
request({
|
request({
|
||||||
|
|||||||
@@ -25,6 +25,11 @@ export const apiCrypto = {
|
|||||||
export const clientSecret = ' 2E1TFEkR8YaOcLhp'
|
export const clientSecret = ' 2E1TFEkR8YaOcLhp'
|
||||||
// 附件前缀
|
// 附件前缀
|
||||||
export const attachmentKey = 'lims_attachment'
|
export const attachmentKey = 'lims_attachment'
|
||||||
|
// 公司部门重试请求头
|
||||||
|
export const COMPANY_DEPT_RETRY_HEADER = '__companyDeptRetried'
|
||||||
|
export const VISIT_COMPANY_STORAGE_KEY = 'visit-company-info'
|
||||||
|
export const VISIT_DEPT_STORAGE_KEY = 'visit-dept-info'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
apiPath,
|
apiPath,
|
||||||
apiCrypto,
|
apiCrypto,
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import Request from 'luch-request'
|
|||||||
import { getBaseUrl, getTenantId } from '@/defaultBaseUrl'
|
import { getBaseUrl, getTenantId } from '@/defaultBaseUrl'
|
||||||
import $store from '@/nx/store'
|
import $store from '@/nx/store'
|
||||||
import qs from 'qs'
|
import qs from 'qs'
|
||||||
|
import { COMPANY_DEPT_RETRY_HEADER, VISIT_COMPANY_STORAGE_KEY, VISIT_DEPT_STORAGE_KEY } from '@/nx/config'
|
||||||
|
|
||||||
const options = {
|
const options = {
|
||||||
// 显示操作成功消息 默认不显示
|
// 显示操作成功消息 默认不显示
|
||||||
@@ -27,9 +28,6 @@ const options = {
|
|||||||
isTransformResponse: true
|
isTransformResponse: true
|
||||||
}
|
}
|
||||||
|
|
||||||
const COMPANY_DEPT_RETRY_HEADER = '__companyDeptRetried'
|
|
||||||
const VISIT_COMPANY_STORAGE_KEY = 'visit-company-info'
|
|
||||||
const VISIT_DEPT_STORAGE_KEY = 'visit-dept-info'
|
|
||||||
// Loading全局实例
|
// Loading全局实例
|
||||||
let LoadingInstance = {
|
let LoadingInstance = {
|
||||||
target: null,
|
target: null,
|
||||||
@@ -99,27 +97,19 @@ http.interceptors.request.use(
|
|||||||
config.header['Pragma'] = 'no-cache'
|
config.header['Pragma'] = 'no-cache'
|
||||||
}
|
}
|
||||||
|
|
||||||
let params = config.params || {}
|
const visitCompanyId = getVisitCompanyId()
|
||||||
let data = config.data || false
|
|
||||||
// if (process.env.NODE_ENV == 'development') console.log('development--params', params)
|
|
||||||
// if (process.env.NODE_ENV == 'development') console.log('development--data', data)
|
|
||||||
|
|
||||||
// const visitCompanyId = getVisitCompanyId()
|
|
||||||
const visitCompanyId = '101'
|
|
||||||
if (visitCompanyId !== undefined && visitCompanyId !== null && visitCompanyId !== '') {
|
if (visitCompanyId !== undefined && visitCompanyId !== null && visitCompanyId !== '') {
|
||||||
config.header['visit-company-id'] = visitCompanyId
|
config.header['visit-company-id'] = visitCompanyId
|
||||||
// const visitCompanyName = getVisitCompanyName()
|
const visitCompanyName = getVisitCompanyName()
|
||||||
const visitCompanyName = '"深圳总公司'
|
|
||||||
if (visitCompanyName !== undefined && visitCompanyName !== null) {
|
if (visitCompanyName !== undefined && visitCompanyName !== null) {
|
||||||
config.header['visit-company-name'] = encodeURIComponent(visitCompanyName || '')
|
config.header['visit-company-name'] = encodeURIComponent(visitCompanyName || '')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// const visitDeptId = getVisitDeptId()
|
const visitDeptId = getVisitDeptId()
|
||||||
const visitDeptId = '103'
|
|
||||||
if (visitDeptId !== undefined && visitDeptId !== null && visitDeptId !== '') {
|
if (visitDeptId !== undefined && visitDeptId !== null && visitDeptId !== '') {
|
||||||
config.header['visit-dept-id'] = visitDeptId
|
config.header['visit-dept-id'] = visitDeptId
|
||||||
// const visitDeptName = getVisitDeptName()
|
const visitDeptName = getVisitDeptName()
|
||||||
const visitDeptName = '研发部门'
|
|
||||||
if (visitDeptName !== undefined && visitDeptName !== null) {
|
if (visitDeptName !== undefined && visitDeptName !== null) {
|
||||||
config.header['visit-dept-name'] = encodeURIComponent(visitDeptName || '')
|
config.header['visit-dept-name'] = encodeURIComponent(visitDeptName || '')
|
||||||
}
|
}
|
||||||
@@ -153,7 +143,6 @@ http.interceptors.response.use(
|
|||||||
|
|
||||||
// 统一处理【公司/部门二次选择】:参考 PC 端逻辑,自动补全或提示选择后重试
|
// 统一处理【公司/部门二次选择】:参考 PC 端逻辑,自动补全或提示选择后重试
|
||||||
if (code === 400 && Array.isArray(data)) {
|
if (code === 400 && Array.isArray(data)) {
|
||||||
debugger
|
|
||||||
const companyDeptList = data
|
const companyDeptList = data
|
||||||
const config = response.config
|
const config = response.config
|
||||||
config.header = config.header || {}
|
config.header = config.header || {}
|
||||||
@@ -161,7 +150,7 @@ http.interceptors.response.use(
|
|||||||
const item = companyDeptList[0]
|
const item = companyDeptList[0]
|
||||||
if (!config.header[COMPANY_DEPT_RETRY_HEADER]) {
|
if (!config.header[COMPANY_DEPT_RETRY_HEADER]) {
|
||||||
applyCompanyDeptSelection(item, config)
|
applyCompanyDeptSelection(item, config)
|
||||||
return request(config)
|
return http.request(config)
|
||||||
}
|
}
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '公司/部门信息缺失,且自动补全失败,请联系管理员',
|
title: '公司/部门信息缺失,且自动补全失败,请联系管理员',
|
||||||
@@ -187,7 +176,7 @@ http.interceptors.response.use(
|
|||||||
},
|
},
|
||||||
config
|
config
|
||||||
)
|
)
|
||||||
resolve(request(config))
|
resolve(http.request(config))
|
||||||
},
|
},
|
||||||
onCancel: () => {
|
onCancel: () => {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -3,6 +3,7 @@ import userApi from '@/nx/api/user'
|
|||||||
import { getSysParameterBizByName } from '@/nx/api/sys'
|
import { getSysParameterBizByName } from '@/nx/api/sys'
|
||||||
import md5 from 'md5'
|
import md5 from 'md5'
|
||||||
import nx from '@/nx'
|
import nx from '@/nx'
|
||||||
|
import { COMPANY_DEPT_RETRY_HEADER, VISIT_COMPANY_STORAGE_KEY, VISIT_DEPT_STORAGE_KEY } from '@/nx/config'
|
||||||
// 默认用户信息
|
// 默认用户信息
|
||||||
const defaultUserInfo = {
|
const defaultUserInfo = {
|
||||||
avatar: '', // 头像
|
avatar: '', // 头像
|
||||||
@@ -128,6 +129,10 @@ const user = defineStore({
|
|||||||
this.roleMenus = []
|
this.roleMenus = []
|
||||||
uni.setStorageSync('roleMenus', [])
|
uni.setStorageSync('roleMenus', [])
|
||||||
this.setToken()
|
this.setToken()
|
||||||
|
// 清空部门信息
|
||||||
|
uni.removeStorageSync(COMPANY_DEPT_RETRY_HEADER)
|
||||||
|
uni.removeStorageSync(VISIT_COMPANY_STORAGE_KEY)
|
||||||
|
uni.removeStorageSync(VISIT_DEPT_STORAGE_KEY)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ const goTo = url => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 生命周期
|
// 生命周期
|
||||||
onMounted(() => {})
|
|
||||||
// 动态设置 grid 列数
|
// 动态设置 grid 列数
|
||||||
const { gridCol } = useGridCol([400], [2, 3])
|
const { gridCol } = useGridCol([400], [2, 3])
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -96,7 +96,6 @@ import SampleDetailPopup from '@/components/sample/sample-detail-popup.vue'
|
|||||||
import TaskItem from './components/task-item.vue'
|
import TaskItem from './components/task-item.vue'
|
||||||
import nx from '@/nx'
|
import nx from '@/nx'
|
||||||
import { useListData } from '@/nx/hooks/usePageListData'
|
import { useListData } from '@/nx/hooks/usePageListData'
|
||||||
import { getDataSourceTypeShow } from '../common'
|
|
||||||
|
|
||||||
// 响应式数据
|
// 响应式数据
|
||||||
const scrollTop = ref(0)
|
const scrollTop = ref(0)
|
||||||
@@ -136,7 +135,8 @@ const showSampleDetail = (id, index) => {
|
|||||||
}
|
}
|
||||||
const searchParams = computed(() => ({
|
const searchParams = computed(() => ({
|
||||||
taskAssignStatus: 'submitted',
|
taskAssignStatus: 'submitted',
|
||||||
taskAssayStatus: 'submitted'
|
taskAssayStatus: 'submitted',
|
||||||
|
assayOperator: userInfo.value.nickname
|
||||||
}))
|
}))
|
||||||
|
|
||||||
const { listData, scrollToLower, loadStatus, getInitData } = useListData({
|
const { listData, scrollToLower, loadStatus, getInitData } = useListData({
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user