feat : 项目管理表单缓存,文件回显,个人中心icon排版
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<div class="apply-block">
|
||||
<el-row>
|
||||
<el-col :span="24" v-if="title==='check'">
|
||||
<el-row v-if="title==='check'">
|
||||
<el-col :span="24">
|
||||
<baseTitle :title="'附件信息'"></baseTitle>
|
||||
</el-col>
|
||||
<el-form :model="attachmentParam" inline style="margin-top: 15px">
|
||||
@@ -20,7 +20,7 @@
|
||||
<el-button v-if="uploadState" color="#DED0B2" @click="handleUpload">上传附件</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<fvTable style="width: 100%;max-height: 162px" v-if="showAttachmentTable" height="162" :tableConfig="tableConfig"
|
||||
<fvTable style="width: 100%;min-height:162px;max-height: 162px" v-if="showAttachmentTable" height="162" :tableConfig="tableConfig"
|
||||
:data="otherAttachmentList" :isSettingCol="false" :pagination="false">
|
||||
<template #empty>
|
||||
<el-empty :image-size="55" description="暂无数据" style="padding: 0"/>
|
||||
@@ -49,34 +49,35 @@
|
||||
label-width="125">
|
||||
<el-button color="#DED0B2" style="margin-right: 10px" @click="handleShowProjectPersonTable">
|
||||
<!-- {{ localFormData.projectPersonIds ? '更改' : '请选择' }}-->
|
||||
{{ projectPersonUserList.length !== 0 ? '更改' : '请选择' }}
|
||||
{{ projectPersonUserList.length !== 0 ? '更改' :getProjectPerson(projectPersonUserList)?'更改': '请选择' }}
|
||||
</el-button>
|
||||
<div v-for="item in projectPersonUserList" :key="item.id" style="margin-right: 5px">
|
||||
<div v-for="item in getProjectPerson(projectPersonUserList)" :key="item.id" style="margin-right: 5px">
|
||||
{{ item.name }}
|
||||
</div>
|
||||
<user-picker :multiple="true" ref="projectPersonUserPicker" title="请选择项目成员"
|
||||
v-model:value="projectPersonUserList" @ok="projectPersonUserPickerOk"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="24">
|
||||
<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&&localFormData.preProcess.length>0 ? '更改' :sessionParams.preProcess&&sessionParams.preProcess.length>0 ? '更改' : '请选择' }}
|
||||
</el-button>
|
||||
<div v-for="item in localFormData.preProcess" :key="item.requestId">
|
||||
<div v-for="item in getRequestName(localFormData.preProcess)" :key="item.requestId">
|
||||
<a :href="item.baseUrl" target="_blank"
|
||||
style="color: #2a99ff;margin-right: 10px;cursor: pointer">{{ item.requestName }}</a>
|
||||
style="color: #2a99ff;margin-right: 10px;cursor: pointer">{{item.requestName}}
|
||||
</a>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<AttachmentUpload ref="attachment" :label="getTitleName(title)+'附件'" :showTable="showTable"
|
||||
:otherFileList="otherFileList" :tag="getTitleName(props.title)"
|
||||
@getAttachment="getAttachment" :singleList="singleList" :showSingleTable="showSingleTable"
|
||||
<!-- v-if="showAttachment"-->
|
||||
<AttachmentUpload ref="attachment" :label="getTitleName(title)+'附件'" :showTable="showTable"
|
||||
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'"/>
|
||||
:preview="mode == 'resubmit'||mode == 'submit'"/>
|
||||
<div>
|
||||
<div class="approval-record">
|
||||
<div class="approval-title">
|
||||
@@ -102,7 +103,7 @@
|
||||
<el-button color="#DED0B2" v-else-if="mode === 'resubmit'" @click="handleSubmit">重新提交</el-button>
|
||||
<el-button @click="handleBack">返回</el-button>
|
||||
</div>
|
||||
<el-dialog title="前置流程" v-model="showPreTable" width="80%">
|
||||
<el-dialog v-if="showPreTable" title="前置流程" v-model="showPreTable" width="80%">
|
||||
<el-form :model="preProcessForm" inline @submit.prevent="searchPreProcess">
|
||||
<el-form-item label="请求名称">
|
||||
<el-input v-model="preProcessForm.requestName" placeholder="请输入请求名称" clearable>
|
||||
@@ -113,7 +114,7 @@
|
||||
<el-button @click="handleReset">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-table :data="preProcessList" stripe v-loading="loading"
|
||||
<el-table :data="preProcessList" v-loading="loading"
|
||||
@select="handleSelect" @select-all="handleSelect" row-key="requestId" ref="preProcessTable">
|
||||
<el-table-column type="selection" width="55" :reserve-selection="true"/>
|
||||
<el-table-column prop="requestId" label="请求id"></el-table-column>
|
||||
@@ -266,6 +267,7 @@ const rules = reactive({
|
||||
})
|
||||
const tagsViewStore = useTagsView()
|
||||
const processStore = useProcessStore()
|
||||
const localProjectPerson = ref([])
|
||||
const otherFileList = ref([])
|
||||
const localFormData = ref({
|
||||
projectPersonIds: [],
|
||||
@@ -288,6 +290,71 @@ const name = ref(router.currentRoute.value.name)
|
||||
const deploymentId = ref()
|
||||
const selectRows = ref([])
|
||||
const projectId = ref(route.query.projectId)
|
||||
const sessionParams=ref({})
|
||||
|
||||
if(localStorage.getItem('preProcess')){
|
||||
let param=JSON.parse(localStorage.getItem('preProcess'))
|
||||
localFormData.value.preProcess=param
|
||||
sessionParams.value.preProcess=param
|
||||
localStorage.setItem('preProcess', JSON.stringify(param))
|
||||
}
|
||||
if(localStorage.getItem('singleFile')){
|
||||
let param=JSON.parse(localStorage.getItem('singleFile'))
|
||||
localFormData.value.singleFile=param
|
||||
singleList.value=[param]
|
||||
localStorage.setItem('singleFile', JSON.stringify(param))
|
||||
}
|
||||
if(localStorage.getItem('otherFileList')){
|
||||
let param=JSON.parse(localStorage.getItem('otherFileList'))
|
||||
localFormData.value.otherFileList=param
|
||||
otherFileList.value=param
|
||||
localStorage.setItem('otherFileList', JSON.stringify(param))
|
||||
}
|
||||
// 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
|
||||
localStorage.setItem('projectChargePersonUserList', JSON.stringify(param))
|
||||
}
|
||||
if(localStorage.getItem('projectPersonUserList')){
|
||||
let param=JSON.parse(localStorage.getItem('projectPersonUserList'))
|
||||
projectPersonUserList.value= param
|
||||
localProjectPerson.value=param
|
||||
localStorage.setItem('projectPersonUserList', JSON.stringify(param))
|
||||
}
|
||||
const getProjectPerson=(list)=>{
|
||||
if(!list||list&&list.length===0){
|
||||
if(localStorage.getItem('projectPersonUserList')){
|
||||
let param=JSON.parse(localStorage.getItem('projectPersonUserList'))
|
||||
projectPersonUserList.value=param
|
||||
return projectPersonUserList.value
|
||||
}
|
||||
}else {
|
||||
return list
|
||||
}
|
||||
}
|
||||
const getRequestName=(list)=>{
|
||||
if(!list||(list&&list.length===0)){
|
||||
if(sessionParams.value.preProcess){
|
||||
return sessionParams.value.preProcess
|
||||
}
|
||||
}else {
|
||||
return list
|
||||
}
|
||||
}
|
||||
const getTagsOption = () => {
|
||||
if (!route.query.projectId) return
|
||||
getTags(route.query.projectId).then(res => {
|
||||
@@ -332,9 +399,10 @@ const handleSearch = () => {
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
handleSearch()
|
||||
getTagsOption()
|
||||
if(props.title&&props.title==='check'){
|
||||
handleSearch()
|
||||
getTagsOption()
|
||||
}
|
||||
const handleUpload = () => {
|
||||
router.push({
|
||||
name: 'Implementation/upload',
|
||||
@@ -347,29 +415,9 @@ const handleUpload = () => {
|
||||
})
|
||||
}
|
||||
const getProjectChargePersonUser = () => {
|
||||
console.log('list', projectChargePersonUserList.value)
|
||||
if (projectChargePersonUserList.value.length !== 0) {
|
||||
return projectChargePersonUserList.value.map(item => item.name).join()
|
||||
}
|
||||
// if(list[0]!==null){
|
||||
// return list.map(item=>item.name).join()
|
||||
// }
|
||||
}
|
||||
const getProjectPersonUser = (list) => {
|
||||
console.log('list2', projectPersonUserList.value)
|
||||
// if(list!=null){
|
||||
// return list.map(item=>item.name).join()
|
||||
// }
|
||||
}
|
||||
const getPreProcessUrl = (list) => {
|
||||
// list.map(item => {
|
||||
// item.baseUrl = getPreProcessUrl(item.preProcess)
|
||||
// })
|
||||
// let baseUrl=
|
||||
// list.forEach(item => {
|
||||
// baseUrl=item.baseUrl
|
||||
// })
|
||||
// return baseUrl
|
||||
}
|
||||
const handleSelect = async (selection) => {
|
||||
selectRows.value = selection
|
||||
@@ -394,6 +442,7 @@ const handleShowProjectChargePersonTable = () => {
|
||||
}
|
||||
const projectChargePersonUserPickerOk = (userList) => {
|
||||
projectChargePersonUserList.value = userList
|
||||
localStorage.setItem('projectChargePersonUserList', JSON.stringify(projectChargePersonUserList.value))
|
||||
}
|
||||
const handleShowProjectPersonTable = () => {
|
||||
projectPersonUserPicker.value.showUserPicker()
|
||||
@@ -401,10 +450,11 @@ const handleShowProjectPersonTable = () => {
|
||||
|
||||
const projectPersonUserPickerOk = (userList) => {
|
||||
projectPersonUserList.value = userList
|
||||
let userIds = []
|
||||
for (const user of userList) {
|
||||
userIds.push(user.id)
|
||||
}
|
||||
localStorage.setItem('projectPersonUserList', JSON.stringify(userList))
|
||||
// let userIds = []
|
||||
// for (const user of userList) {
|
||||
// userIds.push(user.id)
|
||||
// }
|
||||
}
|
||||
const getPreProcessList = () => {
|
||||
loading.value = true
|
||||
@@ -443,6 +493,7 @@ const choosePreProcess = () => {
|
||||
})
|
||||
localFormData.value.preProcess = preProcessArray
|
||||
showPreTable.value = false
|
||||
localStorage.setItem('preProcess', JSON.stringify(preProcessArray))
|
||||
}
|
||||
|
||||
//切换每页显示条数
|
||||
@@ -481,13 +532,14 @@ const compositeParam = (item) => {
|
||||
}
|
||||
}
|
||||
const getAttachment = (val) => {
|
||||
// console.log('上传文件getAttachment', val)
|
||||
console.log('上传文件getAttachment', val)
|
||||
showSingleTable.value = false
|
||||
localFormData.value.singleFile = compositeParam(val)
|
||||
singleList.value.push(compositeParam(val))
|
||||
nextTick(() => {
|
||||
showSingleTable.value = true
|
||||
})
|
||||
localStorage.setItem('singleFile', JSON.stringify(compositeParam(val)))
|
||||
}
|
||||
watch(() => singleList.value, (newVal) => {
|
||||
showSingleTable.value = newVal.length !== 0;
|
||||
@@ -500,6 +552,9 @@ const getOtherFile = (val) => {
|
||||
nextTick(() => {
|
||||
showTable.value = true
|
||||
})
|
||||
|
||||
// localFormData.value.otherFileList = otherFileList.value
|
||||
localStorage.setItem('otherFileList', JSON.stringify(otherFileList.value))
|
||||
}
|
||||
const getFileParam = (item) => {
|
||||
return {
|
||||
@@ -509,7 +564,7 @@ const getFileParam = (item) => {
|
||||
}
|
||||
const handleSubmit = async () => {
|
||||
if (deploymentData.value.deploymentName === '重大项目立项' || deploymentData.value.deploymentName === '重大项目验收') {
|
||||
if (localFormData.value.preProcess === undefined) {
|
||||
if (localFormData.value.preProcess == undefined) {
|
||||
ElNotification({
|
||||
title: '提示',
|
||||
message: '请选择前置流程!',
|
||||
@@ -518,22 +573,7 @@ const handleSubmit = async () => {
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (projectChargePersonUserList.value && projectChargePersonUserList.value.length === 0) {
|
||||
ElNotification({
|
||||
title: '提示',
|
||||
message: '请选择项目负责人!',
|
||||
type: 'error'
|
||||
})
|
||||
return;
|
||||
}
|
||||
if (projectPersonUserList.value && projectPersonUserList.value.length === 0) {
|
||||
ElNotification({
|
||||
title: '提示',
|
||||
message: '请选择项目成员!',
|
||||
type: 'error'
|
||||
})
|
||||
return;
|
||||
}
|
||||
|
||||
let files = []
|
||||
if (props.mode === 'resubmit') {
|
||||
attachment.value.allFileList.forEach(item => {
|
||||
@@ -567,9 +607,28 @@ const handleSubmit = async () => {
|
||||
projectId: projectId.value,
|
||||
preProcess: JSON.stringify(localFormData.value.preProcess)
|
||||
}
|
||||
console.log(params)
|
||||
if(sessionParams.value.preProcess&&!localFormData.value.preProcess){
|
||||
params.preProcess=JSON.stringify(sessionParams.value.preProcess)
|
||||
}
|
||||
console.log(params.preProcess)
|
||||
let res
|
||||
if (props.step === '20') {
|
||||
if (projectChargePersonUserList.value && projectChargePersonUserList.value.length === 0) {
|
||||
ElNotification({
|
||||
title: '提示',
|
||||
message: '请选择项目负责人!',
|
||||
type: 'error'
|
||||
})
|
||||
return;
|
||||
}
|
||||
if (projectPersonUserList.value && projectPersonUserList.value.length === 0) {
|
||||
ElNotification({
|
||||
title: '提示',
|
||||
message: '请选择项目成员!',
|
||||
type: 'error'
|
||||
})
|
||||
return;
|
||||
}
|
||||
params.projectChargePerson = parseInt(projectChargePersonUserList.value[0].id)
|
||||
params.projectPersonIds = projectPersonIds
|
||||
if (props.mode === 'resubmit') {
|
||||
@@ -659,6 +718,9 @@ watchEffect(() => {
|
||||
if (props.formData.projectChargePerson != null) {
|
||||
localFormData.value.projectChargePerson = props.formData.projectChargePerson.id
|
||||
}
|
||||
// if(props.formData.fileList&&props.formData.fileList.length>0){
|
||||
// otherFileList.value=props.formData.fileList
|
||||
// }
|
||||
// localFormData.value.projectPersonIds = []
|
||||
// if (projectPersonUserList.value){
|
||||
// projectPersonUserList.value.forEach(item => {
|
||||
|
||||
Reference in New Issue
Block a user