fix : 文件表格高度, 组织机构管理

This commit is contained in:
2024-07-14 15:55:55 +08:00
parent 925a8045f4
commit 04cc61047a
15 changed files with 521 additions and 112 deletions

View File

@@ -28,10 +28,10 @@
<el-form-item label="其他文件" label-width="125">
<file-upload @getFile="getOtherFile"/>
<!-- <el-card style="width: 100%;box-shadow: none">-->
<fvTable style="width: 100%;max-height: 300px;" v-if="showTable" height="300" :tableConfig="tableConfig"
<fvTable style="width: 100%;max-height: 162px;" v-if="showTable" height="162" :tableConfig="tableConfig"
:data="allFileList" :isSettingCol="false" :pagination="false">
<template #empty>
<el-empty :image-size="90" description="暂无数据" style="padding: 0"/>
<el-empty :image-size="55" description="暂无数据" style="padding: 0"/>
</template>
</fvTable>
<!-- </el-card>-->

View File

@@ -2,10 +2,10 @@
<el-form :label-position="labelAlign">
<el-form-item :label="title?'其他文件':''" v-if="fileListShow === 'READ' || fileListShow === 'EDIT'" :label-position="labelAlign" :label-width="title?95:''">
<file-upload @getFile="getOtherFile" v-if="fileListShow === 'EDIT'"/>
<fvTable style="width: 100%;max-height: 300px;" v-if="processViewer" height="300" :tableConfig="tableConfig"
<fvTable style="width: 100%;max-height: 162px;" v-if="processViewer" height="162" :tableConfig="tableConfig"
:data="_value" :isSettingCol="false" :pagination="false">
<template #empty>
<el-empty :image-size="90" description="暂无数据" style="padding: 0"/>
<el-empty :image-size="55" description="暂无数据" style="padding: 0"/>
</template>
</fvTable>
</el-form-item>

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" v-if="title==='apply'">
<el-form-item label="项目负责人" :required="true" prop="projectChargePerson"
<el-form-item label="项目负责人" :required="true" prop="projectChargePerson" :rules="projectChargePersonUserList.length !== 0 ?'1':rules.projectChargePerson"
label-width="125">
<el-button style="margin-right: 10px" color="#DED0B2" @click="handleShowProjectChargePersonTable">
<!-- {{ localFormData.projectChargePerson ? '更改' : '请选择' }}-->
@@ -32,13 +32,13 @@
</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 ? '更改' : '请选择' }}
</el-button>
<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>
</div>
<el-button color="#DED0B2" @click="handleShowPreTable">
{{ localFormData.preProcess ? '更改' : '请选择' }}
</el-button>
</el-form-item>
</el-col>
</el-row>
@@ -69,8 +69,8 @@
</div>
</div>
<div class="oper-page-btn">
<el-button color="#DED0B2" v-if="mode === 'submit'" @click="handleSubmit">提交</el-button>
<el-button color="#DED0B2" v-else-if="mode === 'resubmit'" @click="handleSubmit">重新提交</el-button>
<el-button color="#DED0B2" v-if="mode === 'submit'" @click="handleSubmit(formRef)">提交</el-button>
<el-button color="#DED0B2" v-else-if="mode === 'resubmit'" @click="handleSubmit(formRef)">重新提交</el-button>
<el-button @click="handleBack">返回</el-button>
</div>
<el-dialog title="前置流程" v-model="showPreTable" width="80%">
@@ -135,7 +135,7 @@ import UserPicker from "@/views/workflow/process/common/UserPicker.vue";
const router = useRouter()
const route = useRoute()
const changeDiagram = ref(false)
const preProcessTable = ref()
const formRef = ref()
const showSingleTable = ref(false)
const projectChargePersonUserList = ref([])
const projectChargePersonUserPicker = ref()
@@ -257,6 +257,8 @@ const handleShowProjectChargePersonTable = () => {
projectChargePersonUserPicker.value.showUserPicker()
}
const projectChargePersonUserPickerOk = (userList) => {
console.log('dsfsdfs',formRef.value,formRef.value?.validateField('projectChargePerson'))
projectChargePersonUserList.value = userList
}
const handleShowProjectPersonTable = () => {
@@ -374,93 +376,104 @@ const getFileParam = (item) => {
tag: item.tag
}
}
const handleSubmit = async () => {
if (deploymentData.value.deploymentName === '重大项目立项' || deploymentData.value.deploymentName === '重大项目验收') {
if (localFormData.value.preProcess === undefined) {
const handleSubmit = async (instance) => {
if (!instance) return
instance.validate(async (valid) => {
if (!valid) {
ElNotification({
title: '提示',
message: '请选择前置流程!',
message: '请完善数据,再提交!',
type: 'error'
})
return;
}
if (deploymentData.value.deploymentName === '重大项目立项' || deploymentData.value.deploymentName === '重大项目验收') {
if (localFormData.value.preProcess === undefined) {
ElNotification({
title: '提示',
message: '请选择前置流程!',
type: 'error'
})
}
}
let files = []
if (props.mode === 'resubmit') {
attachment.value.allFileList.forEach(item => {
files.push(getFileParam(item))
})
} else {
otherFileList.value.forEach(item => {
files.push(getFileParam(item))
})
}
if (attachment.value.singleFile == null) {
attachment.value.validate()
ElNotification({
title: '提示',
message: '请上传附件',
type: 'error'
})
return;
} else {
attachment.value.clearValidate()
}
let projectPersonIds = []
for (const item of projectPersonUserList.value) {
projectPersonIds.push(parseInt(item.id))
}
let params = {
deploymentId: deploymentId.value,
requirementId: route.query.id,
fileList: files,
singleFile: attachment.value.singleFile,
projectId: projectId.value,
preProcess: JSON.stringify(localFormData.value.preProcess)
}
console.log(params)
let res
if (props.step === '20') {
params.projectChargePerson = parseInt(projectChargePersonUserList.value[0].id)
params.projectPersonIds = projectPersonIds
if (props.mode === 'resubmit') {
res = await resubmitApply(params)
} else {
res = await projectApply(params)
}
} else if (props.step === '40') {
if (props.mode === 'resubmit') {
res = await resubmitCheck(params)
} else {
res = await projectCheck(params)
}
} else if (props.step === '50') {
if (props.mode === 'resubmit') {
res = await resubmitConclusion(params)
} else {
res = await projectConclusion(params)
}
}
}
let files = []
if (props.mode === 'resubmit') {
attachment.value.allFileList.forEach(item => {
files.push(getFileParam(item))
})
} else {
otherFileList.value.forEach(item => {
files.push(getFileParam(item))
})
}
if (attachment.value.singleFile == null) {
attachment.value.validate()
ElNotification({
title: '提示',
message: '请上传附件',
type: 'error'
message: res.msg,
type: res.code === 1000 ? 'success' : 'error'
})
return;
} else {
attachment.value.clearValidate()
}
let projectPersonIds = []
for (const item of projectPersonUserList.value) {
projectPersonIds.push(parseInt(item.id))
}
let params = {
deploymentId: deploymentId.value,
requirementId: route.query.id,
fileList: files,
singleFile: attachment.value.singleFile,
projectId: projectId.value,
preProcess: JSON.stringify(localFormData.value.preProcess)
}
console.log(params)
let res
if (props.step === '20') {
params.projectChargePerson = parseInt(projectChargePersonUserList.value[0].id)
params.projectPersonIds = projectPersonIds
if (props.mode === 'resubmit') {
res = await resubmitApply(params)
} else {
res = await projectApply(params)
if (res.code === 1000) {
tagsViewStore.delVisitedViews(router.currentRoute.value.path)
if (props.step === '20') {
await router.push({
name: 'Initiation'
})
} else if (props.step === '40') {
await router.push({
name: 'Implementation'
})
} else if (props.step === '50') {
await router.push({
name: 'Filing'
})
}
}
} else if (props.step === '40') {
if (props.mode === 'resubmit') {
res = await resubmitCheck(params)
} else {
res = await projectCheck(params)
}
} else if (props.step === '50') {
if (props.mode === 'resubmit') {
res = await resubmitConclusion(params)
} else {
res = await projectConclusion(params)
}
}
ElNotification({
title: '提示',
message: res.msg,
type: res.code === 1000 ? 'success' : 'error'
})
if (res.code === 1000) {
tagsViewStore.delVisitedViews(router.currentRoute.value.path)
if (props.step === '20') {
await router.push({
name: 'Initiation'
})
} else if (props.step === '40') {
await router.push({
name: 'Implementation'
})
} else if (props.step === '50') {
await router.push({
name: 'Filing'
})
}
}
}
const init = async () => {
let id = projectId.value

View File

@@ -30,10 +30,10 @@
<baseTitle title="关联项目"></baseTitle>
<el-col :span="24">
<el-form-item>
<fvTable style="width: 100%;max-height:300px" v-if="showTable" :tableConfig="projectTable"
<fvTable style="width: 100%;max-height:162px" height="162" v-if="showTable" :tableConfig="projectTable"
:data="formData.projects" :isSettingCol="false" :pagination="false">
<template #empty>
<el-empty :image-size="90" description="暂无数据" style="padding: 0"/>
<el-empty :image-size="55" description="暂无数据" style="padding: 0"/>
</template>
</fvTable>
</el-form-item>
@@ -41,10 +41,10 @@
<baseTitle title="附件列表"></baseTitle>
<el-col :span="24">
<el-form-item>
<fvTable style="width: 100%;max-height: 300px;" height="300" v-if="showTable" :tableConfig="fileTable"
<fvTable style="width: 100%;max-height: 162px;" height="162" v-if="showTable" :tableConfig="fileTable"
:data="formData.files" :isSettingCol="false" :pagination="false">
<template #empty>
<el-empty :image-size="90" description="暂无数据" style="padding: 0"/>
<el-empty :image-size="55" description="暂无数据" style="padding: 0"/>
</template>
</fvTable>
</el-form-item>

View File

@@ -21,10 +21,10 @@
</el-form-item>
</el-form>
<el-card style="width: 100%">
<fvTable style="width: 100%;max-height: 250px" v-if="showTable" height="250" :tableConfig="tableConfig"
<fvTable style="width: 100%;max-height: 162px" v-if="showTable" height="162" :tableConfig="tableConfig"
:data="fileList" :isSettingCol="false" :pagination="false">
<template #empty>
<el-empty :image-size="90" description="暂无数据" style="padding: 0"/>
<el-empty :image-size="55" description="暂无数据" style="padding: 0"/>
</template>
</fvTable>
</el-card>

View File

@@ -16,10 +16,10 @@
<baseTitle title="其他文件"></baseTitle>
<el-card style="width: 100%;margin: 15px 0">
<file-upload @getFile="getFiles"/>
<fvTable style="width: 100%;max-height: 250px;height: 250px" height="250" v-if="showTable" :tableConfig="tableConfig"
<fvTable style="width: 100%;max-height: 162px;height: 162px" height="162" v-if="showTable" :tableConfig="tableConfig"
:data="fileList" :isSettingCol="false" :pagination="false">
<template #empty>
<el-empty :image-size="90" description="暂无数据" style="padding: 0"/>
<el-empty :image-size="55" description="暂无数据" style="padding: 0"/>
</template>
</fvTable>
</el-card>

View File

@@ -0,0 +1,154 @@
<template>
<baseTitle title="基础信息"></baseTitle>
<fv-Form :schema="schema" @getInstance="(e)=>form = e"></fv-Form>
<UserPicker ref="usrPickershipIds" @ok="editshipIds"></UserPicker>
<UserPicker ref="usrPickerHeadIds" @ok="editheadIds"></UserPicker>
<UserPicker ref="usrPickerDeputyIds" @ok="editdeputyIds"></UserPicker>
</template>
<script setup lang="jsx">
import UserPicker from '@/views/workflow/process/common/UserPicker.vue';
import Ttsup from '@/views/system/department/components/ToolToShowUserPicker.vue'
import {getInfoById,setDeptInfo} from '@/views/system/department/api'
const props=defineProps({
value:{
type:String,
default:''
}
})
const form = ref()
const usrPickershipIds = ref()
const usrPickerHeadIds = ref()
const usrPickerDeputyIds = ref()
const departmentChargeLeadershipNames = ref()
const departmentHeadNames = ref()
const departmentalDeputyNames = ref()
const departmentChargeLeadershipIds = ref()
const departmentHeadIds = ref()
const departmentalDeputyIds = ref()
const schema = reactive([
{
label: '部门名字:',
prop: 'departmentName',
},
{
label: '部门标志:',
prop: 'departmentMark'
},
{
label: '部门分管领导:',
prop: 'departmentChargeLeadershipIds',
component: ()=><Ttsup modelValue={departmentChargeLeadershipNames.value} onClick={()=>{usrPickershipIds.value.showUserPicker()} } />
},
{
label: '部门负责人:',
prop: 'departmentHeadIds',
component: ()=><Ttsup modelValue={departmentHeadNames.value} onClick={()=>{usrPickerHeadIds.value.showUserPicker()} } />
},
{
label: '部门副职用户:',
prop: 'departmentalDeputyIds',
component: ()=><Ttsup modelValue={departmentalDeputyNames.value} onClick={()=>{departmentalDeputyIds.value.showUserPicker()} } />
},
{
label: '创建时间:',
prop: 'createTime'
}
])
const emit = defineEmits(['update:value'])
const _value = computed({
get() {
return props.value;
},
set(value) {
emit('update:value', value)
}
})
const getInfo = async () => {
const { data } = await getInfoById(_value.value)
const params = {
createTime: data.createTime,
departmentMark: data.departmentMark,
departmentName: data.departmentName
}
departmentChargeLeadershipIds.value = data.departmentChargeLeadershipIds
departmentHeadIds.value = data.departmentHeadIds
departmentalDeputyIds.value = data.departmentalDeputyIds
params.departmentChargeLeadershipIds = formatIdsToNames(data.departmentChargeLeadershipIds, data.departmentChargeLeadershipInfo, 'userId', 'nickName')
departmentChargeLeadershipNames.value = params.departmentChargeLeadershipIds
params.departmentHeadIds = formatIdsToNames(data.departmentHeadIds, data.departmentHeadInfo, 'userId', 'nickName')
departmentHeadNames.value = params.departmentHeadIds
params.departmentalDeputyIds = formatIdsToNames(data.departmentalDeputyIds, data.departmentalDeputyInfo, 'userId', 'nickName')
departmentalDeputyNames.value = params.departmentalDeputyIds
form.value.setValues(params)
}
getInfo()
const formatIdsToNames = (ids, infoList, key, viewKey) => {
const resArr = []
if(!ids?.length) return
ids.forEach(item=>{
infoList.forEach(v=>{
item == v[key] && resArr.push(v[viewKey])
})
})
return resArr.join(',')
}
const editshipIds = (list) => {
// console.log("🚀 ~ editshipIds ~ list:", list)
const arr = list.map(item=>item.name)
departmentChargeLeadershipIds.value = list.map(item=>item.id)
departmentChargeLeadershipNames.value = arr.join(',')
setDeptmentInfo({
departmentChargeLeadershipIds: departmentChargeLeadershipIds.value,
departmentalDeputyIds: departmentalDeputyIds.value,
departmentHeadIds: departmentHeadIds.value
})
}
const editheadIds = (list) => {
// console.log("🚀 ~ editshipIds ~ list:", list)
const arr = list.map(item=>item.name)
departmentHeadIds.value = list.map(item=>item.id)
departmentHeadNames.value = arr.join(',')
setDeptmentInfo({
departmentChargeLeadershipIds: departmentChargeLeadershipIds.value,
departmentalDeputyIds: departmentalDeputyIds.value,
departmentHeadIds: departmentHeadIds.value
})
}
const editdeputyIds = (list) => {
// console.log("🚀 ~ editshipIds ~ list:", list)
const arr = list.map(item=>item.name)
departmentalDeputyIds.value = list.map(item=>item.id)
departmentalDeputyNames.value = arr.join(',')
setDeptmentInfo({
departmentChargeLeadershipIds: departmentChargeLeadershipIds.value,
departmentalDeputyIds: departmentalDeputyIds.value,
departmentHeadIds: departmentHeadIds.value
})
}
const setDeptmentInfo = async ({ departmentChargeLeadershipIds = [], departmentHeadIds = [], departmentalDeputyIds = []}) => {
const params = {
departmentChargeLeadershipIds,
departmentHeadIds,
departmentalDeputyIds,
departmentId: _value.value
}
const res = await setDeptInfo(params)
// console.log(res.data);
}
</script>
<style lang="scss" scoped>
</style>