From f3c73a86f00061125e1946125c2f7499064a5708 Mon Sep 17 00:00:00 2001
From: 祖安之光 <11848914+light-of-zuan@user.noreply.gitee.com>
Date: 星期二, 21 十月 2025 14:51:05 +0800
Subject: [PATCH] 修改新增
---
src/views/build/conpanyFunctionConsult/qualityObjectives/objective/index.vue | 56 ++++++++++++++++++++++++--------------------------------
1 files changed, 24 insertions(+), 32 deletions(-)
diff --git a/src/views/build/conpanyFunctionConsult/qualityObjectives/objective/index.vue b/src/views/build/conpanyFunctionConsult/qualityObjectives/objective/index.vue
index 8170a0c..1af3b39 100644
--- a/src/views/build/conpanyFunctionConsult/qualityObjectives/objective/index.vue
+++ b/src/views/build/conpanyFunctionConsult/qualityObjectives/objective/index.vue
@@ -8,27 +8,17 @@
plain
icon="Plus"
@click="openDialog('add',{})"
+ v-hasPermi="['qualityGoal: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-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">
@@ -105,9 +95,9 @@
<el-table-column label="目标测量方法" prop="method" align="center" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="160" >
<template #default="scope">
- <el-button link type="primary" @click="openDialog('review',scope.row)" >查看</el-button>
- <el-button link type="primary" @click="openDialog('edit',scope.row)" >编辑</el-button>
- <el-button link type="danger" @click="handleDelete(scope.row)" >删除</el-button>
+ <el-button link type="primary" @click="openDialog('review',scope.row)">查看</el-button>
+ <el-button link type="primary" @click="openDialog('edit',scope.row)" v-hasPermi="['qualityGoal:list:edit']">编辑</el-button>
+ <el-button link type="danger" @click="handleDelete(scope.row)" v-hasPermi="['qualityGoal:list:del']">删除</el-button>
</template>
</el-table-column>
</el-table>
@@ -198,6 +188,9 @@
data.queryParams.companyId = userInfo.companyId
}
getList();
+ if(data.isAdmin){
+ getCompanyList()
+ }
});
const getList = async () => {
loading.value = true;
@@ -216,7 +209,7 @@
getList();
}
const openDialog = (type, value) => {
- noticeRef.value.openDialog(type, value);
+ noticeRef.value.openDialog(type, value,data.companyList);
}
const selectValue = (val) => {
data.companyList.forEach(item => {
@@ -226,20 +219,17 @@
})
}
-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)
}
}
@@ -264,6 +254,7 @@
}
choosedData.value = []
data.companyList = [];
+ getCompanyList()
}else {
data.queryParams = {
companyId: data.queryParams.companyId,
@@ -274,6 +265,7 @@
}
}
getList();
+
}
const exportData = () => {
if(choosedData.value && choosedData.value.length === 0){
--
Gitblit v1.9.2