From 0c5fd22a20dae1c6a54384185cdca4e0b93360f2 Mon Sep 17 00:00:00 2001
From: 祖安之光 <11848914+light-of-zuan@user.noreply.gitee.com>
Date: Wed, 02 Jul 2025 13:33:34 +0800
Subject: [PATCH] 修改新增
---
src/views/build/conpanyFunctionConsult/qualityObjectives/objective/index.vue | 30 ++++++++++++++++++++++++++----
1 files changed, 26 insertions(+), 4 deletions(-)
diff --git a/src/views/build/conpanyFunctionConsult/qualityObjectives/objective/index.vue b/src/views/build/conpanyFunctionConsult/qualityObjectives/objective/index.vue
index f663890..8897cfa 100644
--- a/src/views/build/conpanyFunctionConsult/qualityObjectives/objective/index.vue
+++ b/src/views/build/conpanyFunctionConsult/qualityObjectives/objective/index.vue
@@ -2,7 +2,7 @@
<div class="app-container">
<div style="margin-bottom: 10px">
<el-form style="display: flex;flex-wrap: wrap;">
- <el-form-item v-if="!data.isAdmin">
+ <el-form-item>
<el-button
type="primary"
plain
@@ -192,8 +192,15 @@
const userInfo = JSON.parse(Cookies.get('userInfo'))
console.log("userInfo",userInfo)
data.isAdmin = userInfo.userType === 0;
- data.queryParams.companyId = userInfo.companyId
+ if(data.isAdmin){
+ data.queryParams.companyId = null
+ }else {
+ data.queryParams.companyId = userInfo.companyId
+ }
getList();
+ if(data.isAdmin){
+ getCompanyList()
+ }
});
const getList = async () => {
loading.value = true;
@@ -223,10 +230,24 @@
}
const getCompanyList = async (val)=>{
- if(val != ""){
+ if(val){
loadingCompany.value = true;
const queryParams = {
name: val
+ }
+ const res = await getCompany(queryParams)
+ if (res.code == 200) {
+ loadingCompany.value = false;
+ data.companyList = res.data.list
+
+ } else {
+ ElMessage.warning(res.message)
+ }
+ }else{
+ loadingCompany.value = true;
+ const queryParams = {
+ pageSize: 10,
+ pageNum: 1,
}
const res = await getCompany(queryParams)
if (res.code == 200) {
@@ -270,6 +291,7 @@
}
}
getList();
+ getCompanyList()
}
const exportData = () => {
if(choosedData.value && choosedData.value.length === 0){
@@ -339,7 +361,7 @@
if (!/^\d+$/.test(value)) { // 验证是否为数字
ElMessage.warning('只能输入数字')
data.queryParams.year = '' // 重置选择,避免非法值被添加到options中
- } else if (!data.yearList.some(option => option.value === value)) { // 确保不是已存在的选项
+ } else if (!data.yearList.some(option => option.label == value)) { // 确保不是已存在的选项
data.yearList.push({ value, label: value }); // 添加新选项(这里简单地将值和标签设为相同)
}
}
--
Gitblit v1.9.2