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/digitalFileDep/manageType/qualityManual/index.vue | 54 +++++++++++++++++++++++++++++++++++++++---------------
1 files changed, 39 insertions(+), 15 deletions(-)
diff --git a/src/views/build/conpanyFunctionConsult/digitalFileDep/manageType/qualityManual/index.vue b/src/views/build/conpanyFunctionConsult/digitalFileDep/manageType/qualityManual/index.vue
index 745679e..ad53b94 100644
--- a/src/views/build/conpanyFunctionConsult/digitalFileDep/manageType/qualityManual/index.vue
+++ b/src/views/build/conpanyFunctionConsult/digitalFileDep/manageType/qualityManual/index.vue
@@ -23,7 +23,7 @@
<el-form-item >
<el-button v-if="isAdmin" type="primary" @click="getList">查询</el-button>
<el-button v-if="isAdmin" type="primary" plain @click="reset">重置</el-button>
- <el-button type="primary" @click="addFile">生成质量手册</el-button>
+ <el-button type="primary" @click="addFile" v-hasPermi="['qualityManage2:list:add']">生成质量手册</el-button>
</el-form-item>
</el-form>
</div>
@@ -38,8 +38,8 @@
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template #default="scope">
<el-button link type="primary" @click="initFile(scope.row)">下载</el-button>
- <el-button link type="primary" @click="openDialog('add',scope.row)">上传</el-button>
- <el-button link type="danger" @click="handleDelete(scope.row)">删除</el-button>
+ <el-button link type="primary" @click="openDialog('add',scope.row)" v-hasPermi="['qualityManage2:list:add']">上传</el-button>
+ <el-button link type="danger" @click="handleDelete(scope.row)" v-hasPermi="['qualityManage2:list:del']">删除</el-button>
</template>
</el-table-column>
</el-table>
@@ -80,7 +80,7 @@
getStandardDetail,
getStandardQuality
} from "@/api/standardSys/standardSys";
-import {getDepart, getDistribution, getSysClause} from "@/api/orgStructure/depart";
+import {getDepart, getDistribution, getFunctionalRemarkList, getSysClause} from "@/api/orgStructure/depart";
const userStore = useUserStore()
const { proxy } = getCurrentInstance();
@@ -183,7 +183,7 @@
const getDeptList = async (val) => {
const res = await getDepart({responsType: 1, companyId: val.companyId})
if(res.code == 200){
- data.originDeptList = res.data
+ data.originDeptList = JSON.parse(JSON.stringify(res.data))
data.deptList.deptName = val.companyName
data.deptList.children = proxy.handleTree(res.data, "deptId")
}else{
@@ -229,12 +229,13 @@
if(res.code === 200){
if(!res.data || (res.data.companyIndustryTemplates.length == 0 && res.data.companyQualityPolicies.length == 0 && res.data.companySummaries.length == 0 && res.data.sysFunctionalDistributions
.length == 0 && res.data.treeSelects.length == 0)){
- return Promise.reject(new Error('该企业暂无质量数据'));
+ loading.value = false
+ return Promise.reject(new Error('该企业暂无质量数据'))
}
data.companyInfo.summaries = res.data.companySummaries ? res.data.companySummaries[0]?.companySummary : []
data.companyInfo.policies = res.data.companyQualityPolicies ? res.data.companyQualityPolicies[0]?.policy : []
const duties = transToTableData(res.data.sysFunctionalDistributions,data.originDeptList)
- data.companyInfo.allDeptNames = duties.allDeptNames
+ data.companyInfo.allDepts = duties.allDepts
data.companyInfo.clauses = duties.clauses
data.companyInfo.temps = res.data.companyIndustryTemplates?.map((item,index)=>{
return {
@@ -247,25 +248,47 @@
}
}
+const getRemarksList = async (companyId)=> {
+ const res = await getFunctionalRemarkList({companyId: companyId})
+ if(res.code == 200){
+ const originRemark = res.data
+ for(let item of originRemark){
+ const foundObj = data.caluseList.find(i=>i.clauseNum == item.clauseNum)
+ if(foundObj){
+ foundObj.remark = item.remark
+ }
+ }
+ data.companyInfo.remarks = originRemark.map(i=>{
+ return `${i.clauseNum}:${i.remark}`
+ }).join(';')
+ }else{
+ ElMessage.warning(res.message)
+ }
+}
+
const transToTableData=(duties,deptList)=>{
// 步骤1:获取所有唯一的部门和条款编号
// const allDeptNames = [...new Set(duties.map(item => item.deptName))];
- const allDeptNames = deptList ? deptList.map(item => item.deptName) : [...new Set(duties.map(item => item.deptName))]
+ const allDepts = deptList
const allClauseNums = [...new Set([
...data.caluseList.map(c => c.clauseNum),
...duties.map(d => d.clauseNum)
])];
// 步骤2:为每个条款生成完整的部门数据(缺失数据默认 chooseLab: 0)
- const mergeValues = ['4','5','6','7','7.1','8','8.2','8.3','8.4','8.5','9','9.1','10']
+ const mergeValues = ['7.1','8.2','8.3','8.4','8.5','9.1']
const processedClauses = allClauseNums.map(clauseNum => {
const clauseContent = data.caluseList.find(c => c.clauseNum === clauseNum)?.content || "";
// 为当前条款生成所有部门的数据(确保每个部门都有值)
- const deptValues = allDeptNames.map(deptName => {
+ const deptValues = allDepts.map(dept => {
const matchedDept = duties.find(
- item => item.clauseNum === clauseNum && item.deptName === deptName
- );
- return matchedDept ? (matchedDept.chooseLab==1?'●':'○' ): '○'
+ item => item.clauseNum === clauseNum && item.deptId === dept.deptId
+ )
+ if(dept.deptType == '0'){
+ return matchedDept ? (matchedDept.chooseLab==1?'●':'○' ): '○'
+ }else{
+ return matchedDept ? (matchedDept.chooseLab==1?'▲':'○' ): '○'
+ }
});
return {
clauseNum,
@@ -276,7 +299,7 @@
// 最终数据结构
return {
clauses: processedClauses,
- allDeptNames // 用于生成表头
+ allDepts // 用于生成表头
};
}
@@ -289,6 +312,7 @@
try {
await getDeptList(val)
await getInfo(val)
+ await getRemarksList(val.companyId)
// 2. 等待DOM更新完成
await nextTick();
@@ -367,4 +391,4 @@
pointer-events: none; /* 禁止交互 */
z-index: -1;
}
-</style>
\ No newline at end of file
+</style>
--
Gitblit v1.9.2