From 127a179707577cc1419e1dcf721380ffca57fdf1 Mon Sep 17 00:00:00 2001
From: zhouwx <1175765986@qq.com>
Date: 星期三, 12 十一月 2025 13:11:14 +0800
Subject: [PATCH] 修改
---
src/views/build/conpanyFunctionConsult/qualityObjectives/reportsituation/index.vue | 70 +++++++++++++++++------------------
1 files changed, 34 insertions(+), 36 deletions(-)
diff --git a/src/views/build/conpanyFunctionConsult/qualityObjectives/reportsituation/index.vue b/src/views/build/conpanyFunctionConsult/qualityObjectives/reportsituation/index.vue
index 1d6162e..86864dd 100644
--- a/src/views/build/conpanyFunctionConsult/qualityObjectives/reportsituation/index.vue
+++ b/src/views/build/conpanyFunctionConsult/qualityObjectives/reportsituation/index.vue
@@ -2,33 +2,23 @@
<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
icon="Plus"
@click="openAddDialog"
+ v-hasPermi="['qualityReportSituation:list:add']"
>新增</el-button>
</el-form-item>
- <el-form-item label="企业名称:" v-if="data.isAdmin" style="margin-left: 20px">
- <el-select
- v-model="data.queryParams.companyName"
- filterable
- remote
- @change="selectValue"
- reserve-keyword
- placeholder="请输入企业名称"
- remote-show-suffix
- :remote-method="getCompanyList"
- :loading="loadingCompany"
- style="width: 240px"
- >
+ <el-form-item label="单位名称:" v-if="data.isAdmin" style="margin-left: 20px">
+ <el-select v-model="data.queryParams.companyId" placeholder="请选择" filterable clearable>
<el-option
v-for="item in data.companyList"
:key="item.id"
:label="item.name"
- :value="item.name"
- />
+ :value="item.id">
+ </el-option>
</el-select>
</el-form-item>
<el-form-item label="年份:" style="margin-left: 20px">
@@ -81,7 +71,7 @@
<el-table v-loading="loading" :data="dataList" :border="true" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" />
<el-table-column type="index" label="序号" width="80" align="center"></el-table-column>
- <el-table-column label="企业名称" prop="companyName" align="center" />
+ <el-table-column label="单位名称" prop="companyName" align="center" />
<el-table-column label="年份" prop="year" align="center" />
<el-table-column label="质量目标级别" prop="type" align="center" >
<template #default="scope">
@@ -107,9 +97,9 @@
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="160">
<template #default="scope">
- <el-button link type="primary" @click="scope.row.type == 1?openDialog('review','company',scope.row):openDialog('review','dept',scope.row) " >查看</el-button>
- <el-button link type="primary" @click="scope.row.type == 1?openDialog('edit','company',scope.row):openDialog('edit','dept',scope.row) " >编辑</el-button>
- <el-button link type="danger" @click="handleDelete(scope.row)" >删除</el-button>
+ <el-button link type="primary" @click="scope.row.type == 1?openDialog('review','company',scope.row):openDialog('review','dept',scope.row)">查看</el-button>
+ <el-button link type="primary" @click="scope.row.type == 1?openDialog('edit','company',scope.row):openDialog('edit','dept',scope.row)" v-hasPermi="['qualityReportSituation:list:edit']">编辑</el-button>
+ <el-button link type="danger" @click="handleDelete(scope.row)" v-hasPermi="['qualityReportSituation:list:del']">删除</el-button>
</template>
</el-table-column>
</el-table>
@@ -231,8 +221,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;
@@ -263,7 +260,7 @@
data.dialogVisible = true
}
const openDialog = (type,isCom, value) => {
- noticeRef.value.openDialog(type, isCom,value);
+ noticeRef.value.openDialog(type, isCom,value,data.companyList);
}
const openDeptDialog = (type, value) => {
deptRef.value.openDialog(type, value);
@@ -277,22 +274,21 @@
})
}
-const getCompanyList = async (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)
- }
+const getCompanyList = async ()=>{
+ const queryParams = {
+ pageNum: 1,
+ pageSize: 999
+ }
+ const res = await getCompany(queryParams)
+ if (res.code == 200) {
+ data.companyList = res.data.list?res.data.list:[]
+ // data.queryParams.companyId = data.companyList[0].id
+ } else {
+ ElMessage.warning(res.message)
}
}
+
const handleSizeChange = (val) => {
data.queryParams.pageSize = val
@@ -318,6 +314,7 @@
}
choosedData.value = []
data.companyList = [];
+ getCompanyList()
}else {
data.queryParams = {
companyId: data.queryParams.companyId,
@@ -328,6 +325,7 @@
}
}
getList();
+
}
const exportData = () => {
if(choosedData.value && choosedData.value.length === 0){
@@ -406,7 +404,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