Merge pull request 'master' (#588) from master into prod

Reviewed-on: http://git.feashow.cn/clay/mosr-web/pulls/588
This commit is contained in:
2024-07-18 04:27:58 +00:00
6 changed files with 87 additions and 34 deletions

View File

@@ -5,7 +5,7 @@
<el-form-item :label="label" prop="attachment" label-width="125">
<template v-if="preview&&JSON.stringify(singleFile) !== '{}'&&JSON.stringify(singleFile)!=='null'">
<el-button type="primary" link @click="handleDownload(singleFile)" style="font-size: 16px">
{{ singleFile ? singleFile?.originalFileName : formData.singleFile?.originalFileName?formData.singleFile?.originalFileName:_singleFileValue[0]?.originalFileName }}
{{ singleFile ? singleFile?.originalFileName : formData.singleFile?.originalFileName }}
</el-button>
<el-button type="danger" link @click="deleteSingleFile(singleFile?singleFile:formData.singleFile,1)">删除
</el-button>

View File

@@ -31,7 +31,7 @@
<el-form :model="localFormData" ref="formRef" label-width="auto" v-if="step!=='50'">
<el-row>
<el-col :span="24" v-if="title==='apply'">
<el-form-item label="项目负责人" :required="true" prop="projectChargePerson"
<el-form-item label="项目负责人" :required="true" prop=""
label-width="125">
<el-button style="margin-right: 10px" color="#DED0B2" @click="handleShowProjectChargePersonTable">
<!-- {{ localFormData.projectChargePerson ? '更改' : '请选择' }}-->
@@ -45,7 +45,7 @@
</el-form-item>
</el-col>
<el-col :span="24" v-if="title==='apply'">
<el-form-item label="项目成员" :required="true" prop="projectPerson"
<el-form-item label="项目成员" :required="true" prop=""
label-width="125">
<el-button color="#DED0B2" style="margin-right: 10px" @click="handleShowProjectPersonTable">
<!-- {{ localFormData.projectPersonIds ? '更改' : '请选择' }}-->
@@ -59,7 +59,7 @@
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="前置流程" :required="preProcessRequired" prop="preProcess" label-width="125">
<el-form-item label="前置流程" :required="preProcessRequired" prop="preProcess" label-width="125">
<el-button color="#DED0B2" @click="handleShowPreTable" style="margin-right: 10px">
{{ localFormData.preProcess&&localFormData.preProcess.length>0 ? '更改' :sessionParams.preProcess&&sessionParams.preProcess.length>0 ? '更改' : '请选择' }}
</el-button>
@@ -77,7 +77,7 @@
v-model:otherFileList="otherFileList" :tag="getTitleName(props.title)"
@getAttachment="getAttachment" v-model:singleList="singleList" :showSingleTable="showSingleTable"
@getOtherFile="getOtherFile" :showFileList="true" :formData="localFormData"
:preview="mode == 'resubmit'||mode == 'submit'"/>
:preview="mode == 'resubmit'"/>
<div>
<div class="approval-record">
<div class="approval-title">
@@ -260,11 +260,11 @@ const pageInfo = reactive({
pageNum: 1,
pageSize: 10,
})
const rules = reactive({
preProcess: [{required: true, message: '请选择前置流程', trigger: 'blur'}],
projectChargePerson: [{required: true, message: '请选择项目负责人', trigger: 'blur'}],
projectPerson: [{required: true, message: '请选择项目成员', trigger: 'blur'}],
})
// const rules = reactive({
// preProcess: [{required: true, message: '请选择前置流程', trigger: 'blur'}],
// projectChargePerson: [{required: true, message: '请选择项目负责人', trigger: 'blur'}],
// projectPerson: [{required: true, message: '请选择项目成员', trigger: 'blur'}],
// })
const tagsViewStore = useTagsView()
const processStore = useProcessStore()
const localProjectPerson = ref([])
@@ -303,27 +303,22 @@ if(localStorage.getItem('singleFile')){
localFormData.value.singleFile=param
singleList.value=[param]
localStorage.setItem('singleFile', JSON.stringify(param))
showSingleTable.value=false
nextTick(()=>{
showSingleTable.value=true
})
}
if(localStorage.getItem('otherFileList')){
let param=JSON.parse(localStorage.getItem('otherFileList'))
localFormData.value.otherFileList=param
otherFileList.value=param
localStorage.setItem('otherFileList', JSON.stringify(param))
showTable.value=false
nextTick(()=>{
showTable.value=true
})
}
// if(localStorage.getItem('sessionParams')){
// let param=JSON.parse(localStorage.getItem('sessionParams'))
// if(param.otherFileList){
// localFormData.value.otherFileList = param.otherFileList
// // localStorage.setItem('sessionParams', JSON.stringify(localFormData.value))
// otherFileList.value=param.otherFileList
// // showTable.value=false
// // nextTick(()=>{
// // showTable.value=true
// // })
// }
//
// localStorage.setItem('sessionParams', JSON.stringify(localFormData.value))
// }
if(localStorage.getItem('projectChargePersonUserList')){
let param=JSON.parse(localStorage.getItem('projectChargePersonUserList'))
projectChargePersonUserList.value=param
@@ -538,7 +533,19 @@ const getAttachment = (val) => {
singleList.value.push(compositeParam(val))
nextTick(() => {
showSingleTable.value = true
if (attachment.value.singleFile == null) {
attachment.value.validate()
ElNotification({
title: '提示',
message: '请上传附件',
type: 'error'
})
return;
} else {
attachment.value.clearValidate()
}
})
localStorage.setItem('singleFile', JSON.stringify(compositeParam(val)))
}
watch(() => singleList.value, (newVal) => {
@@ -565,12 +572,17 @@ const getFileParam = (item) => {
const handleSubmit = async () => {
if (deploymentData.value.deploymentName === '重大项目立项' || deploymentData.value.deploymentName === '重大项目验收') {
if (localFormData.value.preProcess == undefined) {
ElNotification({
title: '提示',
message: '请选择前置流程!',
type: 'error'
})
return;
if(JSON.parse(localStorage.getItem('preProcess'))?.length>0){
}else {
ElNotification({
title: '提示',
message: '请选择前置流程!',
type: 'error'
})
return;
}
}
}

View File

@@ -383,6 +383,17 @@ const getAttachment = (val) => {
singleList.value.push(compositeParam(val))
nextTick(() => {
showSingleTable.value = true
if (attachment.value.singleFile == null) {
attachment.value.validate()
ElNotification({
title: '提示',
message: '请上传附件',
type: 'error'
})
return;
} else {
attachment.value.clearValidate()
}
})
}
const getOtherFile = (val) => {

View File

@@ -123,6 +123,17 @@ const getAttachment = (val) => {
singleList.value.push( compositeParam(val))
nextTick(() => {
showSingleTable.value = true
if (attachment.value.singleFile == null) {
attachment.value.validate()
ElNotification({
title: '提示',
message: '请上传附件',
type: 'error'
})
return;
} else {
attachment.value.clearValidate()
}
})
}
watch(() => singleList.value, (newVal) => {

View File

@@ -3,7 +3,7 @@
<el-form :model="localFormData" ref="formRef" label-width="auto" :rules="rules" v-if="step!=='50'">
<el-row>
<el-col :span="24">
<el-form-item label="前置流程" :required="preProcessRequired" prop="requestName">
<el-form-item label="前置流程" prop="requestName">
<div v-for="item in localFormData.preProcess" :key="item.requestId">
<a :href="item.baseUrl" target="_blank"
style="color: #2a99ff;margin-right: 10px;cursor: pointer">{{ item.requestName }}</a>
@@ -270,6 +270,17 @@ const compositeParam = (item) => {
const getAttachment = (val) => {
// console.log('上传文件getAttachment', val)
localFormData.value.singleFile = compositeParam(val)
if (attachment.value.singleFile == null) {
attachment.value.validate()
ElNotification({
title: '提示',
message: '请上传附件',
type: 'error'
})
return;
} else {
attachment.value.clearValidate()
}
}
const getOtherFile = (val) => {
// console.log('上传文件getOtherFile', val)

View File

@@ -222,10 +222,18 @@ const handleClick = (item, data) => {
const noSelected = (selectItem) => {
//右侧的x
for (let i = 0; i < selectList.value.length; i++) {
if (selectList.value[i].value === selectItem.value) {
selectList.value.splice(i, 1);
break;
if(selectItem.value){
if (selectList.value[i].value === selectItem.value) {
selectList.value.splice(i, 1);
break;
}
}else{
if (selectList.value[i].id === selectItem.id) {
selectList.value.splice(i, 1);
break;
}
}
}
selectItem.selected = false;
};