From 3dc3d79e10232c821db66a952341b2daae80e0e1 Mon Sep 17 00:00:00 2001
From: zhouwx <1175765986@qq.com>
Date: 星期二, 16 十二月 2025 17:17:47 +0800
Subject: [PATCH] 修改
---
src/views/build/conpanyFunctionConsult/digitalFileDep/project/projectReview/components/editDialog.vue | 75 +++++++++++++++++++++++++++++++------
1 files changed, 62 insertions(+), 13 deletions(-)
diff --git a/src/views/build/conpanyFunctionConsult/digitalFileDep/project/projectReview/components/editDialog.vue b/src/views/build/conpanyFunctionConsult/digitalFileDep/project/projectReview/components/editDialog.vue
index b45f82a..fa1cc75 100644
--- a/src/views/build/conpanyFunctionConsult/digitalFileDep/project/projectReview/components/editDialog.vue
+++ b/src/views/build/conpanyFunctionConsult/digitalFileDep/project/projectReview/components/editDialog.vue
@@ -10,7 +10,7 @@
:close-on-click-modal="false"
>
<el-form :model="state.form" size="default" ref="superRef" :rules="state.formRules" label-width="150px" >
- <el-form-item label="企业名称:" prop="companyId" v-if="state.isAdmin">
+ <el-form-item label="单位名称:" prop="companyId" v-if="state.isAdmin">
<el-select v-model="state.form.companyId" filterable placeholder="请选择" @change="changeCom" clearable style="width: 100%" :disabled="state.title == '查看' || state.title == '编辑' || !state.isAdmin">
<el-option
v-for="item in state.companyList"
@@ -92,13 +92,15 @@
</el-row>
<el-row :gutter="24">
<el-col :span="12">
- <el-form-item label="评审文件:" prop="productItemIds">
+ <el-form-item label="评审文件:" required>
<el-select
clearable
multiple
v-model="state.productItems"
:disabled="state.title =='查看'"
filterable
+ @change="changeFile"
+ value-key="id"
style="width: 100%">
<el-option
v-for="item in state.itemFileList"
@@ -279,7 +281,13 @@
import {getToken} from "@/utils/auth";
import {delPic} from "@/api/onlineEducation/banner";
import {addFile, editFile} from "@/api/qualityManage/range";
-import {addProductFile, editProductFile, getProductFilePage, getProductSet} from "@/api/selfProblems/productFile";
+import {
+ addProductFile,
+ editProductFile,
+ getProductFileList,
+ getProductFilePage,
+ getProductSet
+} from "@/api/selfProblems/productFile";
import Cookies from "js-cookie";
import {addReview, editReview} from "@/api/selfProblems/projectReview";
import {getStudent} from "@/api/onlineEducation/student";
@@ -309,6 +317,7 @@
leaderId: null,
leaderTime: "",
productItemIds: null,
+ processItemIds:null
},
formRules:{
companyId: [{ required: true, message: '请选择企业', trigger: 'blur' }],
@@ -327,7 +336,7 @@
groupTime: [{ required: true, message: '请选择时间', trigger: 'blur' }],
leaderId: [{ required: true, message: '请选择评审领导', trigger: 'blur' }],
leaderTime: [{ required: true, message: '请选择时间', trigger: 'blur' }],
- productItemIds: [{ required: true, message: '请选择项目文件', trigger: 'blur' }],
+ // productItemIds: [{ required: true, message: '请选择项目文件', trigger: 'blur' }],
},
rules:{
reviewUserId: [{ required: true, message: '', trigger: 'blur' }],
@@ -357,7 +366,9 @@
name: '评审组员'
},
],
- productItems:[]
+ productItems:[],
+ paojectDocuments:[],
+ processInspections:[]
})
onMounted(() => {
@@ -380,7 +391,11 @@
}
})
await nextTick();
- state.productItems = state.form.productItemIds.split(',').map(item => Number(item))
+
+
+ const productItemIdList = state.form.productItemIds ?state.form.productItemIds.split(',').map(item => Number(item)):[]
+ const processItemIdList = state.form.processItemIds?state.form.processItemIds.split(',').map(item => Number(item)):[]
+ state.productItems = productItemIdList.concat(processItemIdList)
if(value.filePath) {
const obj = {
url: value.filePath,
@@ -452,9 +467,13 @@
};
const onSubmit = async () => {
- state.form.productItemIds = state.productItems.join(',')
+ // state.form.productItemIds = state.productItems.join(',')
const valid = await superRef.value.validate();
if(valid){
+ if(!state.form.processItemIds && !state.form.productItemIds){
+ ElMessage.warning('请选择评审文件')
+ return
+ }
if(state.form.type == 1 && state.form.reviewUsers && state.form.reviewUsers.length == 0){
ElMessage.warning('请填写合同评审人员签署表')
return
@@ -556,10 +575,13 @@
leaderId: null,
leaderTime: "",
productItemIds: null,
+ processItemIds:null
}
state.fileList = []
state.peopleList = []
state.productItems = []
+ state.paojectDocuments=[]
+ state.processInspections=[]
superRef.value.clearValidate();
superRef.value.resetFields()
dialogVisible.value = false;
@@ -567,6 +589,7 @@
const changeCom = () => {
state.form.itemId = null
state.form.productItemIds = null
+ state.form.processItemIds = null
state.productItems = []
state.form.reviewUsers.forEach(item => {
item.reviewUserId = null
@@ -581,6 +604,7 @@
const changeItem = () => {
state.form.productItemIds = null
+ state.form.processItemIds = null
state.productItems = []
getFileList()
}
@@ -590,19 +614,29 @@
}
const queryParams = {
companyId: state.form.companyId,
- type: 2,
itemId: state.form.itemId,
- pageSize:9999,
- pageNum: 1
}
- const res = await getProductFilePage(queryParams)
+ const res = await getProductFileList(queryParams)
if (res.code == 200) {
- state.itemFileList = res.data.list.map(item => {
+ state.paojectDocuments = res.data.data.paojectDocuments.map(item => {
return {
...item,
- fileNameSimple: item.fileName.split('.')[0]
+ flag:1
}
})
+ state.processInspections = res.data.data.processInspections.map(item => {
+ return {
+ ...item,
+ flag:2
+ }
+ })
+ state.itemFileList = state.paojectDocuments.concat(state.processInspections)
+ // state.itemFileList = res.data.list.map(item => {
+ // return {
+ // ...item,
+ // fileNameSimple: item.fileName.split('.')[0]
+ // }
+ // })
} else {
ElMessage.warning(res.message)
}
@@ -622,6 +656,8 @@
state.form.leaderId = null
state.form.leaderTime = null
state.form.productItemIds = null
+ state.form.processItemIds = null
+
state.productItems = []
}else if(state.form.type == 1){
state.form.stage = ''
@@ -645,6 +681,19 @@
state.form.reviewUsers[index].userDuty = obj[0].duty
}
+const changeFile = (ids) => {
+ state.form.productItemIds = ids.filter(id => {
+ const item = state.itemFileList.find(i => i.id === id);
+ return item?.flag === 1;
+ });
+ state.form.productItemIds = state.form.productItemIds.join(',')
+
+ state.form.processItemIds = ids.filter(id => {
+ const item = state.itemFileList.find(i => i.id === id);
+ return item?.flag === 2;
+ });
+ state.form.processItemIds = state.form.processItemIds.join(',')
+}
defineExpose({
openDialog
--
Gitblit v1.9.2