diff --git a/src/auto-imports.d.ts b/src/auto-imports.d.ts index 985f0e8..e69de29 100644 --- a/src/auto-imports.d.ts +++ b/src/auto-imports.d.ts @@ -1,78 +0,0 @@ -// Generated by 'unplugin-auto-import' -export {} -declare global { - const EffectScope: typeof import('vue')['EffectScope'] - const acceptHMRUpdate: typeof import('pinia')['acceptHMRUpdate'] - const computed: typeof import('vue')['computed'] - const createApp: typeof import('vue')['createApp'] - const createPinia: typeof import('pinia')['createPinia'] - const customRef: typeof import('vue')['customRef'] - const defineAsyncComponent: typeof import('vue')['defineAsyncComponent'] - const defineComponent: typeof import('vue')['defineComponent'] - const defineStore: typeof import('pinia')['defineStore'] - const effectScope: typeof import('vue')['effectScope'] - const getActivePinia: typeof import('pinia')['getActivePinia'] - const getCurrentInstance: typeof import('vue')['getCurrentInstance'] - const getCurrentScope: typeof import('vue')['getCurrentScope'] - const h: typeof import('vue')['h'] - const hasPermission: typeof import('./utils/composables/permission')['hasPermission'] - const inject: typeof import('vue')['inject'] - const isProxy: typeof import('vue')['isProxy'] - const isReactive: typeof import('vue')['isReactive'] - const isReadonly: typeof import('vue')['isReadonly'] - const isRef: typeof import('vue')['isRef'] - const mapActions: typeof import('pinia')['mapActions'] - const mapGetters: typeof import('pinia')['mapGetters'] - const mapState: typeof import('pinia')['mapState'] - const mapStores: typeof import('pinia')['mapStores'] - const mapWritableState: typeof import('pinia')['mapWritableState'] - const markRaw: typeof import('vue')['markRaw'] - const nextTick: typeof import('vue')['nextTick'] - const onActivated: typeof import('vue')['onActivated'] - const onBeforeMount: typeof import('vue')['onBeforeMount'] - const onBeforeRouteLeave: typeof import('vue-router')['onBeforeRouteLeave'] - const onBeforeRouteUpdate: typeof import('vue-router')['onBeforeRouteUpdate'] - const onBeforeUnmount: typeof import('vue')['onBeforeUnmount'] - const onBeforeUpdate: typeof import('vue')['onBeforeUpdate'] - const onDeactivated: typeof import('vue')['onDeactivated'] - const onErrorCaptured: typeof import('vue')['onErrorCaptured'] - const onMounted: typeof import('vue')['onMounted'] - const onRenderTracked: typeof import('vue')['onRenderTracked'] - const onRenderTriggered: typeof import('vue')['onRenderTriggered'] - const onScopeDispose: typeof import('vue')['onScopeDispose'] - const onServerPrefetch: typeof import('vue')['onServerPrefetch'] - const onUnmounted: typeof import('vue')['onUnmounted'] - const onUpdated: typeof import('vue')['onUpdated'] - const provide: typeof import('vue')['provide'] - const reactive: typeof import('vue')['reactive'] - const readonly: typeof import('vue')['readonly'] - const ref: typeof import('vue')['ref'] - const resolveComponent: typeof import('vue')['resolveComponent'] - const resolveDirective: typeof import('vue')['resolveDirective'] - const setActivePinia: typeof import('pinia')['setActivePinia'] - const setMapStoreSuffix: typeof import('pinia')['setMapStoreSuffix'] - const shallowReactive: typeof import('vue')['shallowReactive'] - const shallowReadonly: typeof import('vue')['shallowReadonly'] - const shallowRef: typeof import('vue')['shallowRef'] - const storeToRefs: typeof import('pinia')['storeToRefs'] - const toRaw: typeof import('vue')['toRaw'] - const toRef: typeof import('vue')['toRef'] - const toRefs: typeof import('vue')['toRefs'] - const triggerRef: typeof import('vue')['triggerRef'] - const unref: typeof import('vue')['unref'] - const useAttrs: typeof import('vue')['useAttrs'] - const useAuth: typeof import('./utils/composables/useAuth')['default'] - const useCssModule: typeof import('vue')['useCssModule'] - const useCssVars: typeof import('vue')['useCssVars'] - const useGlobalProperties: typeof import('./utils/composables/useGlobalProperties')['default'] - const useLink: typeof import('vue-router')['useLink'] - const useMainPage: typeof import('./utils/composables/useMainPage')['default'] - const useMenu: typeof import('./utils/composables/useMenu')['default'] - const useRoute: typeof import('vue-router')['useRoute'] - const useRouter: typeof import('vue-router')['useRouter'] - const useSlots: typeof import('vue')['useSlots'] - const watch: typeof import('vue')['watch'] - const watchEffect: typeof import('vue')['watchEffect'] - const watchPostEffect: typeof import('vue')['watchPostEffect'] - const watchSyncEffect: typeof import('vue')['watchSyncEffect'] -} diff --git a/src/auto-imports.d.ts b/src/auto-imports.d.ts index 985f0e8..e69de29 100644 --- a/src/auto-imports.d.ts +++ b/src/auto-imports.d.ts @@ -1,78 +0,0 @@ -// Generated by 'unplugin-auto-import' -export {} -declare global { - const EffectScope: typeof import('vue')['EffectScope'] - const acceptHMRUpdate: typeof import('pinia')['acceptHMRUpdate'] - const computed: typeof import('vue')['computed'] - const createApp: typeof import('vue')['createApp'] - const createPinia: typeof import('pinia')['createPinia'] - const customRef: typeof import('vue')['customRef'] - const defineAsyncComponent: typeof import('vue')['defineAsyncComponent'] - const defineComponent: typeof import('vue')['defineComponent'] - const defineStore: typeof import('pinia')['defineStore'] - const effectScope: typeof import('vue')['effectScope'] - const getActivePinia: typeof import('pinia')['getActivePinia'] - const getCurrentInstance: typeof import('vue')['getCurrentInstance'] - const getCurrentScope: typeof import('vue')['getCurrentScope'] - const h: typeof import('vue')['h'] - const hasPermission: typeof import('./utils/composables/permission')['hasPermission'] - const inject: typeof import('vue')['inject'] - const isProxy: typeof import('vue')['isProxy'] - const isReactive: typeof import('vue')['isReactive'] - const isReadonly: typeof import('vue')['isReadonly'] - const isRef: typeof import('vue')['isRef'] - const mapActions: typeof import('pinia')['mapActions'] - const mapGetters: typeof import('pinia')['mapGetters'] - const mapState: typeof import('pinia')['mapState'] - const mapStores: typeof import('pinia')['mapStores'] - const mapWritableState: typeof import('pinia')['mapWritableState'] - const markRaw: typeof import('vue')['markRaw'] - const nextTick: typeof import('vue')['nextTick'] - const onActivated: typeof import('vue')['onActivated'] - const onBeforeMount: typeof import('vue')['onBeforeMount'] - const onBeforeRouteLeave: typeof import('vue-router')['onBeforeRouteLeave'] - const onBeforeRouteUpdate: typeof import('vue-router')['onBeforeRouteUpdate'] - const onBeforeUnmount: typeof import('vue')['onBeforeUnmount'] - const onBeforeUpdate: typeof import('vue')['onBeforeUpdate'] - const onDeactivated: typeof import('vue')['onDeactivated'] - const onErrorCaptured: typeof import('vue')['onErrorCaptured'] - const onMounted: typeof import('vue')['onMounted'] - const onRenderTracked: typeof import('vue')['onRenderTracked'] - const onRenderTriggered: typeof import('vue')['onRenderTriggered'] - const onScopeDispose: typeof import('vue')['onScopeDispose'] - const onServerPrefetch: typeof import('vue')['onServerPrefetch'] - const onUnmounted: typeof import('vue')['onUnmounted'] - const onUpdated: typeof import('vue')['onUpdated'] - const provide: typeof import('vue')['provide'] - const reactive: typeof import('vue')['reactive'] - const readonly: typeof import('vue')['readonly'] - const ref: typeof import('vue')['ref'] - const resolveComponent: typeof import('vue')['resolveComponent'] - const resolveDirective: typeof import('vue')['resolveDirective'] - const setActivePinia: typeof import('pinia')['setActivePinia'] - const setMapStoreSuffix: typeof import('pinia')['setMapStoreSuffix'] - const shallowReactive: typeof import('vue')['shallowReactive'] - const shallowReadonly: typeof import('vue')['shallowReadonly'] - const shallowRef: typeof import('vue')['shallowRef'] - const storeToRefs: typeof import('pinia')['storeToRefs'] - const toRaw: typeof import('vue')['toRaw'] - const toRef: typeof import('vue')['toRef'] - const toRefs: typeof import('vue')['toRefs'] - const triggerRef: typeof import('vue')['triggerRef'] - const unref: typeof import('vue')['unref'] - const useAttrs: typeof import('vue')['useAttrs'] - const useAuth: typeof import('./utils/composables/useAuth')['default'] - const useCssModule: typeof import('vue')['useCssModule'] - const useCssVars: typeof import('vue')['useCssVars'] - const useGlobalProperties: typeof import('./utils/composables/useGlobalProperties')['default'] - const useLink: typeof import('vue-router')['useLink'] - const useMainPage: typeof import('./utils/composables/useMainPage')['default'] - const useMenu: typeof import('./utils/composables/useMenu')['default'] - const useRoute: typeof import('vue-router')['useRoute'] - const useRouter: typeof import('vue-router')['useRouter'] - const useSlots: typeof import('vue')['useSlots'] - const watch: typeof import('vue')['watch'] - const watchEffect: typeof import('vue')['watchEffect'] - const watchPostEffect: typeof import('vue')['watchPostEffect'] - const watchSyncEffect: typeof import('vue')['watchSyncEffect'] -} diff --git a/src/utils/valiateWork.ts b/src/utils/valiateWork.ts index 930a334..b94dd29 100644 --- a/src/utils/valiateWork.ts +++ b/src/utils/valiateWork.ts @@ -15,10 +15,10 @@ result = false ElMessage.warning('请先创建对应的内部审核工作') } - } + } else { // 管理评审 - const res = await getReviewWorkList({ offset: 1, limit: 9999, managementStatus: '0' }) + const res = await getReviewWorkList({ offset: 1, limit: 9999, managementStatus: '1' }) const data = res.data.rows const flag = data.some((item: any) => String(item.yearTime) === String(yearTime) && String(item.yearNum) === String(yearNum) && item.bizLabCode === bizLabCode) if (flag) { diff --git a/src/auto-imports.d.ts b/src/auto-imports.d.ts index 985f0e8..e69de29 100644 --- a/src/auto-imports.d.ts +++ b/src/auto-imports.d.ts @@ -1,78 +0,0 @@ -// Generated by 'unplugin-auto-import' -export {} -declare global { - const EffectScope: typeof import('vue')['EffectScope'] - const acceptHMRUpdate: typeof import('pinia')['acceptHMRUpdate'] - const computed: typeof import('vue')['computed'] - const createApp: typeof import('vue')['createApp'] - const createPinia: typeof import('pinia')['createPinia'] - const customRef: typeof import('vue')['customRef'] - const defineAsyncComponent: typeof import('vue')['defineAsyncComponent'] - const defineComponent: typeof import('vue')['defineComponent'] - const defineStore: typeof import('pinia')['defineStore'] - const effectScope: typeof import('vue')['effectScope'] - const getActivePinia: typeof import('pinia')['getActivePinia'] - const getCurrentInstance: typeof import('vue')['getCurrentInstance'] - const getCurrentScope: typeof import('vue')['getCurrentScope'] - const h: typeof import('vue')['h'] - const hasPermission: typeof import('./utils/composables/permission')['hasPermission'] - const inject: typeof import('vue')['inject'] - const isProxy: typeof import('vue')['isProxy'] - const isReactive: typeof import('vue')['isReactive'] - const isReadonly: typeof import('vue')['isReadonly'] - const isRef: typeof import('vue')['isRef'] - const mapActions: typeof import('pinia')['mapActions'] - const mapGetters: typeof import('pinia')['mapGetters'] - const mapState: typeof import('pinia')['mapState'] - const mapStores: typeof import('pinia')['mapStores'] - const mapWritableState: typeof import('pinia')['mapWritableState'] - const markRaw: typeof import('vue')['markRaw'] - const nextTick: typeof import('vue')['nextTick'] - const onActivated: typeof import('vue')['onActivated'] - const onBeforeMount: typeof import('vue')['onBeforeMount'] - const onBeforeRouteLeave: typeof import('vue-router')['onBeforeRouteLeave'] - const onBeforeRouteUpdate: typeof import('vue-router')['onBeforeRouteUpdate'] - const onBeforeUnmount: typeof import('vue')['onBeforeUnmount'] - const onBeforeUpdate: typeof import('vue')['onBeforeUpdate'] - const onDeactivated: typeof import('vue')['onDeactivated'] - const onErrorCaptured: typeof import('vue')['onErrorCaptured'] - const onMounted: typeof import('vue')['onMounted'] - const onRenderTracked: typeof import('vue')['onRenderTracked'] - const onRenderTriggered: typeof import('vue')['onRenderTriggered'] - const onScopeDispose: typeof import('vue')['onScopeDispose'] - const onServerPrefetch: typeof import('vue')['onServerPrefetch'] - const onUnmounted: typeof import('vue')['onUnmounted'] - const onUpdated: typeof import('vue')['onUpdated'] - const provide: typeof import('vue')['provide'] - const reactive: typeof import('vue')['reactive'] - const readonly: typeof import('vue')['readonly'] - const ref: typeof import('vue')['ref'] - const resolveComponent: typeof import('vue')['resolveComponent'] - const resolveDirective: typeof import('vue')['resolveDirective'] - const setActivePinia: typeof import('pinia')['setActivePinia'] - const setMapStoreSuffix: typeof import('pinia')['setMapStoreSuffix'] - const shallowReactive: typeof import('vue')['shallowReactive'] - const shallowReadonly: typeof import('vue')['shallowReadonly'] - const shallowRef: typeof import('vue')['shallowRef'] - const storeToRefs: typeof import('pinia')['storeToRefs'] - const toRaw: typeof import('vue')['toRaw'] - const toRef: typeof import('vue')['toRef'] - const toRefs: typeof import('vue')['toRefs'] - const triggerRef: typeof import('vue')['triggerRef'] - const unref: typeof import('vue')['unref'] - const useAttrs: typeof import('vue')['useAttrs'] - const useAuth: typeof import('./utils/composables/useAuth')['default'] - const useCssModule: typeof import('vue')['useCssModule'] - const useCssVars: typeof import('vue')['useCssVars'] - const useGlobalProperties: typeof import('./utils/composables/useGlobalProperties')['default'] - const useLink: typeof import('vue-router')['useLink'] - const useMainPage: typeof import('./utils/composables/useMainPage')['default'] - const useMenu: typeof import('./utils/composables/useMenu')['default'] - const useRoute: typeof import('vue-router')['useRoute'] - const useRouter: typeof import('vue-router')['useRouter'] - const useSlots: typeof import('vue')['useSlots'] - const watch: typeof import('vue')['watch'] - const watchEffect: typeof import('vue')['watchEffect'] - const watchPostEffect: typeof import('vue')['watchPostEffect'] - const watchSyncEffect: typeof import('vue')['watchSyncEffect'] -} diff --git a/src/utils/valiateWork.ts b/src/utils/valiateWork.ts index 930a334..b94dd29 100644 --- a/src/utils/valiateWork.ts +++ b/src/utils/valiateWork.ts @@ -15,10 +15,10 @@ result = false ElMessage.warning('请先创建对应的内部审核工作') } - } + } else { // 管理评审 - const res = await getReviewWorkList({ offset: 1, limit: 9999, managementStatus: '0' }) + const res = await getReviewWorkList({ offset: 1, limit: 9999, managementStatus: '1' }) const data = res.data.rows const flag = data.some((item: any) => String(item.yearTime) === String(yearTime) && String(item.yearNum) === String(yearNum) && item.bizLabCode === bizLabCode) if (flag) { diff --git a/src/views/quality/internal/dissatisfied/components/edit.vue b/src/views/quality/internal/dissatisfied/components/edit.vue index a90c208..044683b 100644 --- a/src/views/quality/internal/dissatisfied/components/edit.vue +++ b/src/views/quality/internal/dissatisfied/components/edit.vue @@ -13,6 +13,11 @@ import { UploadFile, getPhotoUrl } from '@/api/file' import { addQualityDissatisfied, approvalDelete, cancelApproval, delteQualityDissatisfied, detailQualityDissatisfied, draftDelete, refuseApproval, rejectApproval, submitQualityDissatisfied, updateQualityDissatisfied } from '@/api/quality/internal/dissatisfied' import selectUser from '@/views/quality/components/selectUser.vue' +import { getWorkList } from '@/api/quality/internal/workManage' +import { getUserList } from '@/api/system/user' +import { getStaffList } from '@/api/resource/register' +import { filterUser } from '@/views/quality/internal/workManage/components/filterUser' +import quality from '/public/config/quality.json' const $route = useRoute() const $router = useRouter() const userStore = useUserStore() @@ -81,7 +86,7 @@ const deptList = ref<{ deptName: string; deptId: string }[]>([]) // 部门列表 const deptAllList = ref<{ deptName: string; deptId: string }[]>([]) // 部门列表 const fetchDict = () => { -// 获取实验室字典 + // 获取实验室字典 getDictByCode('bizLabCode').then((res) => { labelList.value = res.data }) @@ -101,7 +106,7 @@ }) } else { - getSearchDept({ }).then((res) => { + getSearchDept({}).then((res) => { deptList.value = res.data }) } @@ -311,15 +316,47 @@ } // 确认 关联检查表 const confirmCheck = (data: any) => { - // checkRef.value.initDialog(ruleForm.value.bizLabCode) console.log(data, '需要限制实验室') ruleForm.value.reviewForm = data ruleForm.value.viewFormId = data.id ruleForm.value.bizLabCode = data.bizLabCode ruleForm.value.yearNum = data.yearNum ruleForm.value.yearTime = data.yearTime - ruleForm.value.deptManagerName = data.deptManagerName + // ruleForm.value.deptManagerName = data.deptManagerName + // 找到对应的 内部审核工作管理用来填充 部门负责人 deptManagerName 内审员 auditorName 内审组长 auditLeaderId + getWorkList({ + offset: 1, + limit: 1, + bizLabCode: data.bizLabCode, + yearNum: data.yearNum, + yearTime: data.yearTime, + status: '1' + }).then(res => { + console.log(res.data, '内部审核工作管理') + if (res.data.rows.length) { + const data = res.data.rows[0] + // console.log(data, 'data[0]') + // 组长 + ruleForm.value.auditLeaderId = internalAudit.value.filter(item => item.name === data.groupLeader)[0]?.id || '' + // 内审员 + // auditorName teamMembers + // 质量负责人 + // deptManagerName commanderId + ruleForm.value.deptManagerName = userList1.value.filter(item => item.id === data.commanderId)[0]?.name || '' + } + else { + ElMessage.warning('未找到对应的内审工作管理,请确认') + + ruleForm.value.reviewForm = { } + ruleForm.value.viewFormId = '' + ruleForm.value.bizLabCode = '' + ruleForm.value.yearNum = '' + ruleForm.value.yearTime = '' + ruleForm.value.auditLeaderId = '' + ruleForm.value.deptManagerName = '' + } + }) setTimeout(() => { ruleForm.value.deptId = data.deptId }, 500) @@ -354,44 +391,74 @@ ruleForm.value.nonReviewFiles.splice(index, 1) } const { proxy } = getCurrentInstance() as any +const userList1 = ref([]) // 用户列表 +const userList2 = ref([]) // 用户列表 +const userList3 = ref([]) // 用户列表 +const internalAudit = ref([]) // 内审员列表 +const loading = ref(true) + +const fetchDict1 = async () => { + loading.value = true + const res = await getUserList({ limit: 9999, offset: 1 }) + const allUserList = res.data.rows + // 获取内审员 + getStaffList({ limit: 9999, offset: 1 }).then((res) => { + internalAudit.value = res.data.rows.filter((item: any) => item.auditorCertificate === 1).map((item: any) => ({ + deptName: item.deptName, + name: item.staffName, + id: allUserList.filter(citem => citem.account === item.account)[0]?.id, + })) + }) + userList1.value = await filterUser(quality.roleTips['质量负责人']) + // userList2.value = await filterUser(quality.roleTips['内审组长']) + userList3.value = await filterUser(quality.roleTips['内审组员']) + loading.value = false +} +fetchDict1()