fix : 征集公司校验,单文件显示改为表格,手机端审批后刷新,需求征集回车触发搜索,组织机构管理搜索

This commit is contained in:
2024-07-22 20:39:26 +08:00
parent ae6da83a1a
commit 3c1fcc327c
17 changed files with 470 additions and 169 deletions

View File

@@ -65,8 +65,7 @@ import {useProcessStore} from '@/stores/processStore.js';
import {getAllocationDetail} from "@/api/expense-manage";
import AllocationSummaryDetailMoblie from './AllocationSummaryDetailMoblie.vue'
import ExpenseDetailMoblie from './ExpenseDetailMoblie.vue'
import OpinionMoblie from "@/views/project-demand/requirement/moblieDetail/OpinionMoblie.vue";
import OpinionMoblie from '@/views/project-management/mobledetail/OpinionMoblie.vue'
const changeDiagram = ref(false)
const processStore = useProcessStore()
const route = useRoute()

View File

@@ -54,7 +54,7 @@
</el-form-item>
</el-col>
<el-col :span="24" style="margin-bottom: -25px">
<el-form-item label="征集公司" prop="companyIds" class="tree-select" label-width="96">
<el-form-item label="征集公司" :required="true" prop="" class="tree-select" label-width="96">
<div style="width: 100%">
<el-button color="#DED0B2" @click="showCompany">{{ selectedCompanyList.length === 0 ? '请选择征集公司' : '更改' }}
</el-button>
@@ -170,11 +170,11 @@ const processInstanceData = ref()
const formPermMap = ref(new Map());
const companyNameArray = ref([])
const rules = reactive({
requirementName: [{required: true, message: '请输入征集名称', trigger: 'blur'}],
companyIds: [{required: true, message: '请选择征集公司', trigger: 'blur'}],
collectType: [{required: true, message: '请选择征集类型', trigger: 'blur'}],
deadline: [{required: true, message: '请选择截止时间', trigger: 'blur'}],
specialFundId: [{required: true, message: '请选择专项资金名称', trigger: 'blur'}],
requirementName: [{required: true, message: '请输入征集名称', trigger: ['blur','change']}],
// companyIds: [{required: true, message: '请选择征集公司', trigger: ['blur','change']}],
collectType: [{required: true, message: '请选择征集类型', trigger: ['blur','change']}],
deadline: [{required: true, message: '请选择截止时间', trigger: ['blur','change']}],
specialFundId: [{required: true, message: '请选择专项资金名称', trigger: ['blur','change']}],
})
const tableConfig = reactive({
@@ -344,14 +344,6 @@ const init = async () => {
})
}
const submitParam = (item) => {
if (item.companyIds.length === 0) {
ElNotification({
title: '提示',
message: '请选择征集公司',
type: 'error'
})
return;
}
let files = []
item.fileList.forEach(item => {
let obj = {
@@ -385,6 +377,14 @@ const handleSubmit = async (instance) => {
})
return;
}
if (formData.value.companyIds.length === 0) {
ElNotification({
title: '提示',
message: '请选择征集公司',
type: 'error'
})
return;
}
const {msg, code} = await addRequirement(submitParam(formData.value))
ElNotification({
title: '提示',

View File

@@ -117,7 +117,7 @@ onMounted(async () => {
}
:deep(.el-table--fit ) {
height: 300px !important;
height: 162px !important;
}
.detail-block {

View File

@@ -3,12 +3,13 @@
<el-row gutter="20">
<el-col :span="5">
<el-form-item prop="requirementName" label="征集名称">
<el-input v-model="selectForm.requirementName" placeholder="请输入征集名称" clearable/>
<el-input v-model="selectForm.requirementName" placeholder="请输入征集名称" clearable @keyup.enter.native="getList"/>
</el-form-item>
</el-col>
<el-col :span="5" :offset="1">
<el-form-item prop="collectType" label="征集类型">
<el-select v-model="selectForm.collectType" placeholder="请选择征集类型" clearable filterable>
<el-select v-model="selectForm.collectType" ref="collectTypeSelectRef" placeholder="请选择征集类型" clearable filterable
@change="getList">
<el-option
v-for="item in cacheStore.getDict('collect_type')"
:key="item.value"
@@ -20,7 +21,7 @@
</el-col>
<el-col :span="5" :offset="1">
<el-form-item prop="state" label="状态">
<el-select v-model="selectForm.state" placeholder="请选择状态" clearable filterable>
<el-select v-model="selectForm.state" placeholder="请选择状态" clearable filterable @change="getList">
<el-option
v-for="item in stateOption"
:key="item.value"
@@ -59,6 +60,7 @@ import {getRequirementStatePerm} from "@/api/project-demand";
const cacheStore = useCacheStore()
const authStore = useAuthStore()
const router = useRouter()
const collectTypeSelectRef=ref()
const searchConfig = reactive([
{
label: '征集名称',
@@ -201,6 +203,7 @@ const tableConfig = reactive({
],
params: {}
})
const getStatePerm = () => {
getRequirementStatePerm().then(res => {
stateOption.value=res.data

View File

@@ -17,7 +17,7 @@ import {getFundOption} from "@/api/special-fund";
import {getSubCompOpt} from "@/api/user/user";
import {matterTree} from "@/utils/matterTree";
import CollectionDetailMoblie from './CollectionDetailMoblie.vue'
import OpinionMoblie from './OpinionMoblie.vue'
import OpinionMoblie from '@/views/project-management/mobledetail/OpinionMoblie.vue'
const tagsViewStore = useTagsView()
const router = useRouter()
@@ -67,7 +67,11 @@ const init = async () => {
}
loading.value = false
let data = res.data
data.formData.companyIds = getCompanyOptionItem(data.formData.companyIds)
if (data.formData.companyIds[0] == -1) {
data.formData.companyIds = ['所有公司']
} else {
data.formData.companyIds = getCompanyOptionItem(data.formData.companyIds)
}
collectData.value = data
formData.value = data.formData;
if (data.formData.specialFund) {

View File

@@ -261,7 +261,7 @@
<div class="oper-page-btn">
<!-- <el-button type="info" @click="staging">存为草稿</el-button>-->
<el-button color="#DED0B2" v-if="name==='Summary/add'" @click="handleSubmit(summaryForm)">发布</el-button>
<el-button color="#DED0B2" v-else @click="handleResubmit">重新发布</el-button>
<el-button color="#DED0B2" v-else @click="handleResubmit(summaryForm)">重新发布</el-button>
<el-button @click="handleBack">返回</el-button>
</div>
</div>
@@ -472,47 +472,58 @@ const handleSubmit = debounce(async (instance) => {
}
})
})
const handleResubmit = debounce(() => {
let otherFiles = []
if (name.value === 'Summary/edit') {
attachment.value.allFileList.forEach(item => {
otherFiles.push(getFileParam(item))
})
}
if (attachment.value.singleFile == null) {
attachment.value.validate()
ElNotification({
title: '提示',
message: '请上传附件',
type: 'error'
})
return;
} else {
// formData.value.resultForm=JSON.stringify(formData.value.resultForm)
attachment.value.clearValidate()
}
if (formData.value.isSpecialFund && formData.value.specialFund === null) {
formData.value.specialFund = getFundName(formData.value.specialFundId)
}
let params = {
...formData.value,
deploymentId: deploymentId.value,
fileList: otherFiles,
requirementId: route.query.id ? route.query.id : '-1'
}
// console.log('重新提交params', params, formData.value.specialFund, formData.value.specialFundId)
resubmitReported(params).then(res => {
ElNotification({
title: '提示',
message: res.msg,
type: res.code === 1000 ? 'success' : 'error'
})
if (res.code === 1000) {
tagsViewStore.delVisitedViews(router.currentRoute.value.path)
router.push({
name: 'Summary'
const handleResubmit = debounce((instance) => {
if (!instance) return
instance.validate(async (valid, fields) => {
if (!valid) {
ElNotification({
title: '提示',
message: '请完善数据,再提交!',
type: 'error'
})
return;
}
let otherFiles = []
if (name.value === 'Summary/edit') {
attachment.value.allFileList.forEach(item => {
otherFiles.push(getFileParam(item))
})
}
if (formData.value.isSpecialFund && formData.value.specialFund === null) {
formData.value.specialFund = getFundName(formData.value.specialFundId)
}
if (attachment.value.singleFile == null) {
attachment.value.validate()
ElNotification({
title: '提示',
message: '请上传附件',
type: 'error'
})
return;
} else {
// formData.value.resultForm=JSON.stringify(formData.value.resultForm)
attachment.value.clearValidate()
}
let params = {
...formData.value,
deploymentId: deploymentId.value,
fileList: otherFiles,
requirementId: route.query.id ? route.query.id : '-1'
}
// console.log('重新提交params', params, formData.value.specialFund, formData.value.specialFundId)
resubmitReported(params).then(res => {
ElNotification({
title: '提示',
message: res.msg,
type: res.code === 1000 ? 'success' : 'error'
})
if (res.code === 1000) {
tagsViewStore.delVisitedViews(router.currentRoute.value.path)
router.push({
name: 'Summary'
})
}
})
})
})

View File

@@ -348,13 +348,25 @@ const handleEdit = (row) => {
}
})
}
// const handleDetail = (row) => {
// router.push({
// name: 'Summary/detail',
// query: {
// id: row.requirementId == null ? '-1' : row.requirementId,
// projectId: row.projectId,
// state: row.state
// }
// })
// }
const handleDetail = (row) => {
router.push({
name: 'Summary/detail',
name: 'Implementation/detail',
query: {
id: row.requirementId == null ? '-1' : row.requirementId,
projectId: row.projectId,
state: row.state
state: row.state,
step: '10'
}
})
}

View File

@@ -60,7 +60,7 @@ import Opinion from "@/components/DetailComponent/Opinion.vue";
const route = useRoute()
const editShow = ref(false)
const applyTitle = ref('apply')
const applyTitle = ref('filing')
const loading = ref(false)
const processStore = useProcessStore()
const fileListShow = ref('READ')
@@ -83,6 +83,9 @@ localStorage.removeItem('projectChargePersonUserList')
localStorage.removeItem('projectPersonUserList')
const getAllInfo = async (state) => {
const loading = ElLoading.service({fullscreen: true})
detailData.value = {
state: "0"
}
try {
detailShow.value = false
fileListShow.value = 'READ'
@@ -125,14 +128,16 @@ const getAllInfo = async (state) => {
}
}
const changeModel = (active, mode) => {
// console.log('active, mode',active, mode)
editShow.value = false
nextTick(() => {
editShow.value = mode === 'submit' || mode === 'resubmit';
if (route.query.step === '20' && active === '20') {
// route.query.step === '20' &&
if (active === '20') {
applyTitle.value = 'apply'
} else if (route.query.step === '40' && active === '40') {
} else if (active === '40') {
applyTitle.value = 'check'
} else if (route.query.step === '50' && active === '50') {
}else if ( active === '50') {
applyTitle.value = 'filing'
}
})
@@ -146,14 +151,9 @@ const stepChange = (data) => {
showActive.value = data.active
getAllInfo(data.active)
}
</script>
<style scoped lang="scss">
//.detail-block{
// padding-top: 15px;
//}
:deep(.el-tabs__nav-scroll) {
width: 100%;
@@ -167,11 +167,6 @@ const stepChange = (data) => {
flex: 1;
font-size: 16px;
}
//.is-active {
// color: black;
// //background-color: #DED0B2;
//}
}
}
</style>

View File

@@ -1,5 +1,6 @@
<template>
<div class="detail-block" v-loading="loading">
<baseTitle title="需求上报信息" style="margin-top: -15px"></baseTitle>
<el-form :model="localFormData" ref="summaryForm" :rules="rules">
<el-row gutter="50">
<el-col :span="24">
@@ -80,6 +81,10 @@
}}</span>
</el-form-item>
</el-col>
<el-col :span="24" style="margin-top: -15px">
<baseTitle title="预期知识产权"></baseTitle>
</el-col>
<el-col :span="24">
<el-form-item label="发明专利(项)" prop="inventionPatent">
<span>{{ localFormData.inventionPatent }}</span>
@@ -126,26 +131,35 @@
<span>{{ localFormData.contentDescription }}</span>
</el-form-item>
</el-col>
<el-col :span="24" style="margin-top: -15px">
<baseTitle title="需求上报申请书"></baseTitle>
</el-col>
<el-col :span="24">
<el-form-item label="需求上报申请书" label-position="top" style="display:block;">
<!-- style="font-size: 16px"-->
<el-button type="primary" link @click="handleDownload(localFormData.singleFile)">
{{ localFormData.singleFile?.originalFileName }}
</el-button>
</el-form-item>
<single-file-component tag="需求上报" :fileNameTableWidth="200"
v-model:value="localFormData.singleFile" :processViewer="processViewer"
labelAlign="top"
:file-list-show="fileListShow"/>
<!-- <el-form-item label="需求上报申请书" label-position="top" style="display:block;">-->
<!-- &lt;!&ndash; style="font-size: 16px"&ndash;&gt;-->
<!-- <el-button type="primary" link @click="handleDownload(localFormData.singleFile)">-->
<!-- {{ localFormData.singleFile?.originalFileName }}-->
<!-- </el-button>-->
<!-- </el-form-item>-->
</el-col>
<el-col :span="24" style="margin-top: -15px">
<baseTitle title="附件列表"></baseTitle>
</el-col>
<el-col :span="24">
<file-component
title="需求上报附件"
tag="需求上报"
tag="需求上报" :fileNameTableWidth="200"
v-model:value="localFormData.fileList"
:processViewer="processViewer"
:file-list-show="fileListShow"
labelAlign="top"
/>
</el-col>
<el-col :span="24">
<div v-if="data.taskId">
<el-col :span="24" style="margin-top: -15px">
<div v-if="data.taskId||data.state==='4'">
<baseTitle title="审核意见"></baseTitle>
<el-form-item prop="_value">
<el-input
@@ -159,7 +173,7 @@
</el-col>
</el-row>
<div class="approval-record">
<div class="approval-title">
<div class="approval-title" style="margin-top: -15px">
<baseTitle title="审批记录"></baseTitle>
<div class="diagram">
<div class="base-title">流程图</div>
@@ -350,6 +364,7 @@ watch(() => props.loading, (newVal) => {
}, {deep: true})
watchEffect(() => {
props.formData.singleFile=[props.formData.singleFile]
return Object.keys(props.formData).length && (localFormData.value = props.formData)
})

View File

@@ -17,8 +17,10 @@
type="textarea"
placeholder="请输入介绍"
/>
<baseTitle title="申请文件"></baseTitle>
<file-upload @getFile="getFile"/>
<div style="display: flex;align-items: center">
<baseTitle title="申请文件" style="margin-right: 10px"></baseTitle>
<file-upload @getFile="getFile"/>
</div>
<fvTable style="width: 100%;max-height: 162px;" v-if="showTable"
:tableConfig="tableConfig" height="162" :data="formData.files"
:isSettingCol="false" :pagination="false">

View File

@@ -2,22 +2,14 @@
<div class="organization-layout">
<div class="layout-left">
<div class="candidate" v-loading="loading">
<el-form :model="queryType" @submit.prevent="getList">
<el-form-item prop="dictName">
<el-input v-model="queryType.chooseName" @change="getList"
clearable placeholder="输入公司或部门名称进行搜索">
<template #append>
<el-button @click="getList">搜索</el-button>
</template>
</el-input>
</el-form-item>
</el-form>
<el-input v-model="filterText" clearable placeholder="输入公司或部门名称进行搜索" @input="searchOrganizateData" style="margin-bottom: 15px">
</el-input>
<el-scrollbar>
<div class="tree scrollbar-dict">
<el-tree :data="dataList" ref="tree" :props="defaultProps" empty-text="" node-key="value"
:default-expanded-keys="expandedKeys" :lazy="true" :load="handleLoad"
@node-expand="handleNodeExpand" @node-click="handleClick"
>
<el-tree :data="dataList" ref="treeRef" :props="defaultProps" empty-text="" node-key="value"
:default-expanded-keys="expandedKeys"
:filter-node-method="filterNode"
@node-click="handleClick">
<template #default="{ node, data }">
<div class="tree-node">
<div style="display: flex;align-items: center;padding: 3px 0;"
@@ -48,7 +40,7 @@
<script setup>
import SvgIcon from '@/components/svgIcon/index.vue'
import {ElNotification} from "element-plus";
import {getOrganizationStructure} from "@/api/workflow/process-user";
import {getOrganizationStructure, getOrganizationStructureTree} from "@/api/workflow/process-user";
import DepartComponent from "@/components/organizationalStructure/Department.vue";
import CompanyDetail from "@/components/organizationalStructure/CompanyDetail.vue";
@@ -58,6 +50,7 @@ const queryType = reactive({
const deptId = ref(0);
const companyId = ref(0);
const showDept = ref(false);
const filterText = ref('')
const showCompany = ref(false);
let selectItem = reactive({
type: -1,
@@ -65,7 +58,7 @@ let selectItem = reactive({
});
const loading = ref(false);
const dataList = ref([]);
const tree = ref([]);
const treeRef = ref()
const selectNodeKey = ref("")
const expandedKeys = ref([]);
const defaultProps = {
@@ -96,7 +89,7 @@ const getList = () => {
type: -1,
value: "0"
};
getOrganizationStructure(params).then(res => {
getOrganizationStructureTree(params).then(res => {
dataList.value = res.data;
});
};
@@ -108,26 +101,38 @@ const init = () => {
dataList.value = [];
expandedKeys.value = [];
queryType.chooseName = ""
getList();
};
watch(filterText.value, (val) => {
treeRef.value.filter(val)
})
const searchOrganizateData=(val)=>{
treeRef.value.filter(val)
}
const filterNode = (value, data) => {
if (!value) return true
return data.organizationalStructureName.includes(value);
}
async function handleLoad(node, resolve, reject) {
let data = node.data
let params
if (data.organizationalStructureId) {
params = {
chooseId: data.organizationalStructureId,
type: data.type
}
} else {
params = {
chooseId: 0,
type: 0,
}
}
let result = await getOrganizationStructure(params).then(res => {
return res.data
})
resolve(result)
// let data = node.data
// let params
// if (data.organizationalStructureId) {
// params = {
// chooseId: data.organizationalStructureId,
// type: data.type
// }
// } else {
// params = {
// chooseId: 0,
// type: 0,
// }
// }
// let result = await getOrganizationStructure(params).then(res => {
// return res.data
// })
// resolve(result)
}
const handleClick = (item, data) => {