From 79f2fd7d49d3316278c2a33aa5d0fc14a1fddf7f Mon Sep 17 00:00:00 2001
From: zhouwx <1175765986@qq.com>
Date: Mon, 30 Jun 2025 09:41:59 +0800
Subject: [PATCH] 修改
---
src/views/build/conpanyFunctionConsult/qualityObjectives/objective/components/objectiveDialog.vue | 53 ++++++++++++++++++++++++++++++++++++++++++++++++-----
1 files changed, 48 insertions(+), 5 deletions(-)
diff --git a/src/views/build/conpanyFunctionConsult/qualityObjectives/objective/components/objectiveDialog.vue b/src/views/build/conpanyFunctionConsult/qualityObjectives/objective/components/objectiveDialog.vue
index fc2b1cf..6125513 100644
--- a/src/views/build/conpanyFunctionConsult/qualityObjectives/objective/components/objectiveDialog.vue
+++ b/src/views/build/conpanyFunctionConsult/qualityObjectives/objective/components/objectiveDialog.vue
@@ -345,7 +345,6 @@
state.isAdmin = userInfo.userType === 0;
state.form.companyName = userInfo.companyName
state.form.companyId = userInfo.companyId
- await getDeptList()
title.value = type === 'add' ? '新增' : type ==='edit' ? '编辑' : '查看' ;
if(type === 'edit' || type === 'review') {
state.form = JSON.parse(JSON.stringify(value));
@@ -354,13 +353,23 @@
state.form.companyName = value.companyName
}
}
+ await getDeptList()
+ if(state.isAdmin){
+ await getCompanyList()
+ }
+ await getPeopleList()
dialogVisible.value = true;
}
const addObject = () => {
state.form.qualityTargets.push({})
}
const getDeptList = async () => {
- const res = await getDept()
+ const param = {
+ pageNum: 1,
+ pageSize: 999,
+ companyId: state.form.companyId
+ }
+ const res = await getDept(param)
if(res.code === 200){
state.deptList = res.data
}
@@ -434,9 +443,10 @@
state.form.qualityTargets = state.form.qualityTargets.filter(item=> item != val)
}
const getPeopleList = async (val)=>{
- if(val != ""){
+ if(val){
const queryParams = {
- name: val
+ name: val,
+ companyId: state.form.companyId == 0 ? null : state.form.companyId
}
const res = await getUser(queryParams)
if (res.code == 200) {
@@ -445,6 +455,20 @@
} else {
ElMessage.warning(res.message)
}
+ }else {
+ const queryParams = {
+ pageNum: 1,
+ pageSize: 10,
+ companyId: state.form.companyId == 0 ? null : state.form.companyId
+ }
+ const res = await getUser(queryParams)
+ if (res.code == 200) {
+ state.peopleList = res.data.list
+
+ } else {
+ ElMessage.warning(res.message)
+ }
+
}
}
const selectValue = (val) => {
@@ -477,19 +501,27 @@
}
}
const selectValueCom = (val) => {
+ state.form.leadBy = null
+ state.form.qualityBy = null
+ state.form.compilationBy = null
+ state.form.leadName = null
+ state.form.qualityName = null
+ state.form.compilationName = null
+ state.form.departId = null
state.companyList.forEach(item => {
if(item.name === val){
state.form.companyId = item.id
}
})
getDeptList()
+ getPeopleList()
}
const changeLevel = () => {
// state.form.companyName = ''
state.form.departId = null
}
const getCompanyList = async (val)=>{
- if(val != ""){
+ if(val){
const queryParams = {
name: val
}
@@ -500,6 +532,17 @@
} else {
ElMessage.warning(res.message)
}
+ }else {
+ const queryParams = {
+ pageSize: 10,
+ pageNum: 1,
+ }
+ const res = await getCompany(queryParams)
+ if (res.code == 200) {
+ state.companyList = res.data.list
+ } else {
+ ElMessage.warning(res.message)
+ }
}
}
--
Gitblit v1.9.2