Browse Source

新增项目合并和拆分

master
zhouhaibin 4 months ago
parent
commit
bb73a2a300
  1. 2
      src/views/ProcessApprovalSubPage/component/ProjectDetails.vue
  2. 111
      src/views/ProcessApprovalSubPage/component/ProjectTable.vue
  3. 24
      src/views/projectLib/projectInfo/Detailpage.vue
  4. 95
      src/views/projectLib/projectInfo/SplitProject.vue
  5. 655
      src/views/projectLib/projectInfo/index.vue
  6. 75
      src/views/projectLib/projectInfo/mergeProject.vue
  7. 14
      src/views/projectLib/projectInfo/projectInfo.api.ts

2
src/views/ProcessApprovalSubPage/component/ProjectDetails.vue

@ -10,7 +10,7 @@
import { defineProps, defineExpose,watchEffect } from 'vue';
import { useForm, BasicForm } from '@/components/Form';
import { queryProjectInfoById } from '@/views/projectLib/projectInfo/projectInfo.api'
import { formSchemas } from '../../projectLib/projectInfo/projectInfo.data';
import { formSchemas } from '@/views/projectLib/projectInfo/projectInfo.data';
import { onMounted } from 'vue';
let dataTo = defineProps(["projectid", "isEdit"])

111
src/views/ProcessApprovalSubPage/component/ProjectTable.vue

@ -0,0 +1,111 @@
<template>
<PageWrapper dense>
<!--引用表格-->
<BasicTable @register="registerTable">
<!--插槽:table标题-->
<!--操作栏-->
<template #action="{ record }">
<!-- <TableAction :actions="getTableAction(record)" /> -->
<TableAction
:actions="getTableAction(record)"
/>
</template>
</BasicTable>
<BasicModal
@register="registeProjectrModal"
title="项目信息详情"
width="1200px"
:showOkBtn="false"
>
<Detailpage
:projectid="proid"
:stage="ProjectStage"
:IsModify="IsModify"
:showUploadfileDetail="showUploadfileDetail"
:showApprovalDetails="showApprovalDetails"
/>
</BasicModal>
</PageWrapper>
</template>
<script lang="ts" name="ProjectTable" setup>
//ts
import { ref } from 'vue';
import { ActionItem, BasicTable, TableAction, useTable } from '@/components/Table';
import { PageWrapper } from '@/components/Page';
import { BasicModal, useModal } from '@/components/Modal';
import { columns } from '@/views/projectLib/projectInfo/projectInfo.data';
import Detailpage from '@/views/projectLib/projectInfo/Detailpage.vue';
import {
getProjectInfoAndChildPageList,
batchdownloadProject,
isShowByRoles,
uploacFilePageList,
} from '@/views/projectLib/projectInfo/projectInfo.api';
let proid = ref();
let ProjectStage = ref();
let IsModify = ref();
let showUploadfileDetail = ref();
let showApprovalDetails = ref(true);
let dataTo = defineProps(['row']);
const [registeProjectrModal, { openModal: openModalProjectr }] = useModal(); //
console.log('isShowByRoles', isShowByRoles('manage,sys:admin'));
const [registerTable] = useTable({
title: '项目信息',
dataSource:dataTo.row,
useSearchForm: false,
columns: columns,
rowKey: 'id',
showIndexColumn: false,
actionColumn: {
width: 140,
title: '操作',
dataIndex: 'action',
slots: { customRender: 'action' },
},
});
function getTableAction(record): ActionItem[] {
//,
return [
{
label: '详情',
onClick: handleDetailpage.bind(null, record),
},]
}
async function handleDetailpage(record) {
ProjectStage.value = record.stage;
proid.value = record.id;
IsModify.value = record.ismodify;
let data = await uploacFilePageList({ stage: '1', projectid: record.id });
if (data.total > 0) {
showUploadfileDetail.value = true;
} else {
showUploadfileDetail.value = false;
}
if (record.stage == 0) {
showApprovalDetails.value = false;
}
if (record.stage == 1) {
showApprovalDetails.value = true;
}
// if(record.projectId != undefined||record.projectId!=null){
// showApprovalDetails.value = false
// }
openModalProjectr();
}
</script>
<style scoped></style>

24
src/views/projectLib/projectInfo/Detailpage.vue

@ -14,37 +14,37 @@
<el-tab-pane label="项目变更信息详情" name="3" v-if="fieldChangeDetailList?.length > 0">
<fieldChangeDetail v-for=" (item, index) in fieldChangeDetailList" :fieldChangeGroupid="item.groupId" :isEdit="false" />
</el-tab-pane>
<el-tab-pane label="由以下项目合并" name="4" v-if="mergeDetailList?.length > 0">
<ProjectTable :row="mergeDetailList"/>
</el-tab-pane>
<el-tab-pane label="由以下项目拆分" name="5" v-if="splitDetailList?.length > 0">
<ProjectTable :row="splitDetailList"/>
</el-tab-pane>
</el-tabs>
<!-- <ProjectDetails :isEdit="false" :projectid="projectid" />
<div v-if="stage >= 3&&IsModify==2">
<el-divider content-position="left">项目资料详情</el-divider>
<BasicTable @register="registerResourceTable">
<template #action="{ record }">
<TableAction :actions="getTableAction(record)" />
</template>
</BasicTable>
</div> -->
<ApprovalDetails :projectid="projectid" :stage="'creatProjectinfo'" v-if="showApprovalDetails==true"/>
</template>
<script lang="ts" name="Detailpage" setup>
import { defineProps, ref, onMounted } from 'vue'
import { resourcetableColumns } from './projectInfo.data';
import { uploacFilePageList, getFieldchangeListByprojectid } from './projectInfo.api'
import { uploacFilePageList, getFieldchangeListByprojectid,getMergeDetailList,getSplitDetailList } from './projectInfo.api'
import { ActionItem, BasicTable, TableAction, useTable } from '@/components/Table';
import { downloadFile } from "@/api/common/api"
import ProjectDetails from "../../ProcessApprovalSubPage/component/ProjectDetails.vue"
import ApprovalDetails from "../../ProcessApprovalSubPage/component/ApprovalDetails.vue"
import UploadfileDetail from '../../ProcessApprovalSubPage/component/UploadfileDetail.vue'
import fieldChangeDetail from '../../ProcessApprovalSubPage/component/fieldChangeDetail.vue'
import ProjectTable from "@/views/ProcessApprovalSubPage/component/projectTable.vue"
let dataTo = defineProps(["projectid", "stage", "IsModify","showUploadfileDetail","showApprovalDetails"])
let fieldChangeDetailList = ref<Array<Object>>()
let mergeDetailList = ref<Array<Object>>()
let splitDetailList = ref<Array<Object>>()
console.log("dataTodataTodataTo", dataTo)
onMounted(async () => {
fieldChangeDetailList.value = await getFieldchangeListByprojectid({ projectid: dataTo.projectid })
mergeDetailList.value=await getMergeDetailList({ projectid: dataTo.projectid })
splitDetailList.value=await getSplitDetailList({ projectid: dataTo.projectid })
})
let activeName = ref("1")
function getTableAction(record): ActionItem[] {

95
src/views/projectLib/projectInfo/SplitProject.vue

@ -0,0 +1,95 @@
<template>
<!-- <BasicTable @register="registerTable">
</BasicTable> -->
<ProjectTable :row="dataTo.row"/>
<el-divider content-position="left">拆分为第一个项目</el-divider>
<BasicForm @register="registerchangeFieldForm1" />
<el-divider content-position="left">拆分为第二个项目</el-divider>
<BasicForm @register="registerchangeFieldForm2" @submit="handleSubmit" />
</template>
<script lang="ts" name="SplitProject" setup>
import { defineProps, onMounted, ref, reactive } from 'vue';
import { submitSplitProject } from './projectInfo.api';
import { useForm, BasicForm } from '@/components/Form';
import { formSchemas } from './projectInfo.data';
import { cloneDeep } from 'lodash-es';
import ProjectTable from "@/views/ProcessApprovalSubPage/component/projectTable.vue"
let dataTo = defineProps(['row', 'stage', 'IsModify', 'fatherid']);
let emit = defineEmits(['close']);
console.log('dataTo11111', dataTo);
onMounted(async () => {
let formSchemasTemp = cloneDeep(formSchemas);
let schemas = [
'projectName',
'adminDivision',
'dutyWorkplace',
'workplaceProperties',
'reformName',
'superLeader',
];
let SchemaList = [];
schemas.forEach((schemasitem) => {
formSchemasTemp.forEach((item) => {
if (item.field == schemasitem) {
item.dynamicDisabled = false;
SchemaList.push(item);
}
});
});
resetSchema1(SchemaList);
resetSchema2(SchemaList);
});
//
const [
registerchangeFieldForm1,
{ getFieldsValue: getFieldsValue1, validate: validate1, resetSchema:resetSchema1 },
] = useForm({
// 24 0-24
actionColOptions: { span: 14 },
showResetButton:false,
showSubmitButton:false,
resetFunc: customResetFunc,
labelCol: { style: { width: '120px' } },
wrapperCol: { style: { width: 'auto' } },
// disabled:true
});
const [
registerchangeFieldForm2,
{ getFieldsValue: getFieldsValue2, validate: validate2, resetSchema:resetSchema2 },
] = useForm({
resetButtonOptions: { text: '取消' },
submitButtonOptions: { text: '提交' },
// 24 0-24
actionColOptions: { span: 14 },
resetFunc: customResetFunc,
labelCol: { style: { width: '120px' } },
wrapperCol: { style: { width: 'auto' } },
// disabled:true
});
async function handleSubmit() {
let projectids=[]
projectids.push(dataTo.row[0].id)
if (await validate1 && await validate2) {
let fields1=await getFieldsValue1()
let fields2=await getFieldsValue2()
fields1['projectids']=projectids
fields1['phone']=dataTo.row[0].phone
fields1['projectContacts']=dataTo.row[0].projectContacts
fields2['projectids']=projectids
fields2['phone']=dataTo.row[0].phone
fields2['projectContacts']=dataTo.row[0].projectContacts
let fields=[fields1,fields2]
await submitSplitProject(fields);
emit('close');
}
}
async function customResetFunc() {
emit('close');
}
</script>
<style></style>

655
src/views/projectLib/projectInfo/index.vue

@ -6,281 +6,498 @@
<!--操作栏-->
<template #action="{ record }">
<!-- <TableAction :actions="getTableAction(record)" /> -->
<TableAction :actions="getTableAction(record)" :dropDownActions="getDropDownAction(record)" />
<TableAction
:actions="getTableAction(record)"
:dropDownActions="getDropDownAction(record)"
/>
</template>
<template #projectName="{ record }">
{{ record.projectName }}
<Tooltip placement='bottom' title='缺失子项目,子项目总金额和主项目不一致' v-if="record.missingSubprojects">
<Tooltip
placement="bottom"
title="缺失子项目,子项目总金额和主项目不一致"
v-if="record.missingSubprojects"
>
<InfoCircleOutlined style="color: red" />
</Tooltip>
</template>
<template #tableTitle>
<!--关闭新增申报-->
<el-button type="primary" round @click="handleCreate" v-if="isShowByRoles('')"> 新增申报项目</el-button>
<el-button type="primary" round @click="handleBatchImport" v-if="isShowByRoles('manageOrg')">
批量导入申报项目</el-button>
<el-button type="primary" round @click="handleCreate" v-if="isShowByRoles('')">
新增申报项目</el-button
>
<el-button
type="primary"
round
@click="handleBatchImport"
v-if="isShowByRoles('manageOrg')"
>
批量导入申报项目</el-button
>
<el-button type="primary" round @click="handleBatchdownload"> 导出项目</el-button>
</template>
<template #toolbar>
<el-button type="primary" round @click="handleumodifyinfo()" v-if="isShowByRoles('projectContact')">
变更项目信息</el-button>
<el-button type="primary" round @click="handleAddSubProject()" v-if="isShowByRoles('projectContact')">
新增子项目</el-button>
<el-button color="#626aef" round :dark="true" @click="openModfiyInfoPage()">项目修改记录</el-button>
<el-button
style="background-color: #ff7f24; color: aliceblue"
round
@click="handlesplitinfo()"
v-if="isShowByRoles('projectContact')"
>
拆分项目</el-button
>
<el-button
style="background-color: #ff7f24; color: aliceblue"
round
@click="handlemergeinfo()"
v-if="isShowByRoles('projectContact')"
>
合并项目</el-button
>
<el-button
type="primary"
round
@click="handleumodifyinfo()"
v-if="isShowByRoles('projectContact')"
>
变更项目信息</el-button
>
<el-button
type="primary"
round
@click="handleAddSubProject()"
v-if="isShowByRoles('projectContact')"
>
新增子项目</el-button
>
<el-button color="#626aef" round :dark="true" @click="openModfiyInfoPage()"
>项目修改记录</el-button
>
</template>
</BasicTable>
<BasicModal @register="registeinitiatesModal" title="发起项目申报申请" width="1200px" :showOkBtn="false">
<BasicModal
@register="registeinitiatesModal"
title="发起项目申报申请"
width="1200px"
:showOkBtn="false"
>
<initiatesProjects @close="closeinitiatesModal()" :projectid="proid" />
</BasicModal>
<BasicModal @register="registeProjectrModal" title="项目信息详情" width="1200px" :showOkBtn="false">
<Detailpage :projectid="proid" :stage="ProjectStage" :IsModify="IsModify"
:showUploadfileDetail="showUploadfileDetail" :showApprovalDetails="showApprovalDetails" />
<BasicModal
@register="registeProjectrModal"
title="项目信息详情"
width="1200px"
:showOkBtn="false"
>
<Detailpage
:projectid="proid"
:stage="ProjectStage"
:IsModify="IsModify"
:showUploadfileDetail="showUploadfileDetail"
:showApprovalDetails="showApprovalDetails"
/>
</BasicModal>
<BasicModal @register="registerModalUploadFiles" title="申报项目资料" width="1200px" :showOkBtn="false"
:showCancelBtn="false">
<BasicModal
@register="registerModalUploadFiles"
title="申报项目资料"
width="1200px"
:showOkBtn="false"
:showCancelBtn="false"
>
<uploadFile :projectid="proid" @close="closeUploadFilesModal()" />
</BasicModal>
<BasicModal @register="registerModalBatchImport" title="批量导入申报项目" width="1200px" :showOkBtn="false"
:showCancelBtn="false">
<BasicModal
@register="registerModalBatchImport"
title="批量导入申报项目"
width="1200px"
:showOkBtn="false"
:showCancelBtn="false"
>
<batchImportProjects :projectid="proid" @close="closeBatchImportModal()" />
</BasicModal>
<BasicModal @register="registeProjectrModalModify" title="修改项目信息" width="1200px" :showOkBtn="false">
<modifyfieldInfo :projectid="proid" :isEdit="true" @close="closeProjectrModal" :IsApproval="true"
:fatherid="fatherid" />
<BasicModal
@register="registeProjectrModalModify"
title="修改项目信息"
width="1200px"
:showOkBtn="false"
>
<modifyfieldInfo
:projectid="proid"
:isEdit="true"
@close="closeProjectrModal"
:IsApproval="true"
:fatherid="fatherid"
/>
</BasicModal>
<BasicModal
@register="registeMergeProject"
title="合并项目信息"
width="1200px"
:showOkBtn="false"
>
<mergeProject :row="rowData" @close="closeMergeProject" />
</BasicModal>
<BasicModal
@register="registeSplitProject"
title="合并项目信息"
width="1200px"
:showOkBtn="false"
>
<SplitProject :row="rowData" @close="closeSplitProject" />
</BasicModal>
<BasicModal @register="registeSubProject" title="新增子项目" width="1200px" :showOkBtn="false">
<addOrModifySubProject :projectid="proid" @exit="closeSubProjectModal()" />
</BasicModal>
</PageWrapper>
</template>
<script lang="ts" name="index" setup>
//ts
import { ref } from 'vue';
import { ActionItem, BasicTable, TableAction, useTable } from '@/components/Table';
import { PageWrapper } from '@/components/Page';
import { BasicModal, useModal } from '@/components/Modal';
import { columns, searchFormSchema } from './projectInfo.data';
// import { list } from './address.api';
import Detailpage from './Detailpage.vue';
import uploadFile from './uploadFile.vue';
import initiatesProjects from '../initiatesProjects/initiatesProjects.vue'
import batchImportProjects from './batchImportProjects.vue'
import modifyfieldInfo from './modifyfieldInfo.vue'
import addOrModifySubProject from './SubProject/addOrModifySubProject.vue'
import addModifyWorkreport from '../workReport/addModifyWorkreport.vue'
import { getProjectInfoAndChildPageList, batchdownloadProject, isShowByRoles, uploacFilePageList } from './projectInfo.api';
import { useUserStore } from '@/store/modules/user';
import { message } from 'ant-design-vue';
import { InfoCircleOutlined } from '@ant-design/icons-vue';
import { useRouter } from 'vue-router'; // useRouter
const router = useRouter();
const userStore = useUserStore();
let proid = ref();
let ProjectStage = ref()
let IsModify = ref()
let showUploadfileDetail = ref()
let showApprovalDetails = ref(true)
let fatherid = ref()
const [registeProjectrModal, { openModal: openModalProjectr }] = useModal();//
const [registerModalUploadFiles, { openModal: openUploadFiles, closeModal: closeUploadFiles }] = useModal();//
const [registeinitiatesModal, { openModal: openinitiate, closeModal: closeinitiates }] = useModal();//
const [registerModalBatchImport, { openModal: openBatchImport, closeModal: closeBatchImport }] = useModal();//
const [registeProjectrModalModify, { openModal: openModelModfiy, closeModal: closeModelModfiy }] = useModal();//
const [registeSubProject, { openModal: openModelSubProject, closeModal: closeSubProject }] = useModal();//
//ts
import { ref } from 'vue';
import { ActionItem, BasicTable, TableAction, useTable } from '@/components/Table';
import { PageWrapper } from '@/components/Page';
console.log("isShowByRoles", isShowByRoles('manage,sys:admin'))
import { BasicModal, useModal } from '@/components/Modal';
import { columns, searchFormSchema } from './projectInfo.data';
// import { list } from './address.api';
import Detailpage from './Detailpage.vue';
import uploadFile from './uploadFile.vue';
import initiatesProjects from '../initiatesProjects/initiatesProjects.vue';
import batchImportProjects from './batchImportProjects.vue';
import modifyfieldInfo from './modifyfieldInfo.vue';
import mergeProject from './mergeProject.vue';
import addOrModifySubProject from './SubProject/addOrModifySubProject.vue';
import SplitProject from './SplitProject.vue';
import addModifyWorkreport from '../workReport/addModifyWorkreport.vue';
import {
getProjectInfoAndChildPageList,
batchdownloadProject,
isShowByRoles,
uploacFilePageList,
} from './projectInfo.api';
import { useUserStore } from '@/store/modules/user';
import { message } from 'ant-design-vue';
import { InfoCircleOutlined } from '@ant-design/icons-vue';
import { useRouter } from 'vue-router'; // useRouter
import { queryPlanInfoMainTimeline } from '@/views/projectLib/projectPlan/projectPlan.api';
const [registerTable, { reload, getForm, getSelectRows, clearSelectedRowKeys }] = useTable({
title: '项目信息',
api: getProjectInfoAndChildPageList,
useSearchForm: true,
columns: columns,
rowKey: "id",
showIndexColumn: false,
actionColumn: {
width: 140,
title: '操作',
dataIndex: 'action',
slots: { customRender: 'action' },
},
beforeFetch(param) {
clearSelectedRowKeys()
if(param.stage == undefined||param.stage == null){
param.stage = "0"
}else{
param.newStage=param.stage
param.stage = "0"
}
},
const router = useRouter();
const userStore = useUserStore();
let proid = ref();
let ProjectStage = ref();
let IsModify = ref();
let showUploadfileDetail = ref();
let showApprovalDetails = ref(true);
let fatherid = ref();
let rowData = ref();
const [registeProjectrModal, { openModal: openModalProjectr }] = useModal(); //
const [registerModalUploadFiles, { openModal: openUploadFiles, closeModal: closeUploadFiles }] =
useModal(); //
const [registeinitiatesModal, { openModal: openinitiate, closeModal: closeinitiates }] =
useModal(); //
const [registerModalBatchImport, { openModal: openBatchImport, closeModal: closeBatchImport }] =
useModal(); //
const [registeProjectrModalModify, { openModal: openModelModfiy, closeModal: closeModelModfiy }] =
useModal(); //
rowSelection: { type: 'radio' },
//
formConfig: {
schemas: searchFormSchema,
}
});
const [registeSubProject, { openModal: openModelSubProject, closeModal: closeSubProject }] =
useModal(); //
const [
registeMergeProject,
{ openModal: openModelMergeProject, closeModal: closeModelMergeProject },
] = useModal(); //
const [
registeSplitProject,
{ openModal: openModelSplitProject, closeModal: closeModelSplitProject },
] = useModal(); //
console.log('isShowByRoles', isShowByRoles('manage,sys:admin'));
function getTableAction(record): ActionItem[] {
//,
const [registerTable, { reload, getForm, getSelectRows, clearSelectedRowKeys }] = useTable({
title: '项目信息',
api: getProjectInfoAndChildPageList,
useSearchForm: true,
columns: columns,
rowKey: 'id',
showIndexColumn: false,
actionColumn: {
width: 140,
title: '操作',
dataIndex: 'action',
slots: { customRender: 'action' },
},
beforeFetch(param) {
clearSelectedRowKeys();
if (param.stage == undefined || param.stage == null) {
param.stage = '0';
} else {
param.newStage = param.stage;
param.stage = '0';
}
},
return [
{
label: '详情',
onClick: handleDetailpage.bind(null, record),
rowSelection: { type: 'checkbox' },
//
formConfig: {
schemas: searchFormSchema,
},
{
label: '申报申请',
ifShow: () => {
return record.stage == 0 && isShowByRoles("projectContact")
});
function getTableAction(record): ActionItem[] {
//,
return [
{
label: '详情',
onClick: handleDetailpage.bind(null, record),
},
onClick: handleadd.bind(null, record)
},
];
}
/**
* 下拉操作栏
*/
function getDropDownAction(record): ActionItem[] {
return [
{
label: '上传项目资料',
ifShow: () => {
return record.stage >= 2 && isShowByRoles("projectContact") && record.projectId == null
{
label: '申报申请',
ifShow: () => {
return record.stage == 0 && isShowByRoles('projectContact');
},
onClick: handleadd.bind(null, record),
},
onClick: handleuploadFile.bind(null, record)
},
];
}
];
}
/**
* 下拉操作栏
*/
function getDropDownAction(record): ActionItem[] {
return [
{
label: '上传项目资料',
ifShow: () => {
return record.stage >= 2 && isShowByRoles('projectContact') && record.projectId == null;
},
onClick: handleuploadFile.bind(null, record),
},
];
}
async function handleDetailpage(record) {
ProjectStage.value = record.stage
proid.value = record.id
IsModify.value = record.ismodify
let data = await uploacFilePageList({ stage: "1", projectid: record.id })
if (data.total > 0) {
showUploadfileDetail.value = true
} else {
showUploadfileDetail.value = false
async function handleDetailpage(record) {
ProjectStage.value = record.stage;
proid.value = record.id;
IsModify.value = record.ismodify;
let data = await uploacFilePageList({ stage: '1', projectid: record.id });
if (data.total > 0) {
showUploadfileDetail.value = true;
} else {
showUploadfileDetail.value = false;
}
if (record.stage == 0) {
showApprovalDetails.value = false;
}
if (record.stage == 1) {
showApprovalDetails.value = true;
}
// if(record.projectId != undefined||record.projectId!=null){
// showApprovalDetails.value = false
// }
openModalProjectr();
}
function handleuploadFile(record) {
proid.value = record.id;
openUploadFiles();
}
if(record.stage == 0){
showApprovalDetails.value=false
function closeUploadFilesModal() {
closeUploadFiles();
reload();
}
if (record.stage == 1) {
showApprovalDetails.value = true
function handleadd(record) {
proid.value = record.id;
openinitiate();
}
// if(record.projectId != undefined||record.projectId!=null){
// showApprovalDetails.value = false
// }
openModalProjectr()
function handleCreate() {
proid.value = undefined;
openinitiate();
}
function closeinitiatesModal() {
closeinitiates();
reload();
}
function handleBatchImport() {
openBatchImport();
}
function closeBatchImportModal() {
closeBatchImport();
reload();
}
function closeSubProjectModal() {
closeSubProject();
reload();
}
function handleBatchdownload() {
let { getFieldsValue } = getForm();
let fromData = getFieldsValue();
batchdownloadProject(fromData);
console.log('getFieldsValue', getFieldsValue());
}
function handleumodifyinfo() {
let row = getSelectRows();
if (row.length == 0) {
message.error('请选择项目!');
return;
}
let index = row.length - 1;
if (row[index].projectId != undefined) {
fatherid.value = row[index].projectId;
}
}
function handleuploadFile(record) {
proid.value = record.id
openUploadFiles()
if (
row[index].projectContacts != userStore.getUserInfo.id &&
!isShowByRoles('projectContact')
) {
message.error('不是当前项目的联系人无法修改此项目!');
return;
}
if (row[index].stage <= 1 && !isShowByRoles('sys:admin')) {
message.error('此项目申报流程未完成,无法进行变更!');
return;
}
proid.value = row[index].id;
console.log('selectedRows', getSelectRows());
openModelModfiy();
reload();
}
}
function closeUploadFilesModal() {
closeUploadFiles()
reload()
}
function handleadd(record) {
proid.value = record.id
openinitiate()
}
function handleCreate() {
proid.value = undefined
openinitiate()
}
function closeinitiatesModal() {
closeinitiates()
reload()
async function handlemergeinfo() {
let row = getSelectRows();
console.log('row', row);
if (row.length == 0) {
message.error('请选择项目!');
return;
}
if (row.length != 2) {
message.error('请2个需要合并的项目!');
return;
}
// if (row[0].projectId != undefined) {
// fatherid.value = row[0].projectId
// }
for (let i = 0; i < row.length; i++) {
let record = row[i];
if (record.projectContacts != userStore.getUserInfo.id && !isShowByRoles('projectContact')) {
message.error('不是当前' + record.projectName + '的联系人无法修改此项目!');
return;
}
if (record.stage <= 1 && !isShowByRoles('sys:admin')) {
message.error(record.projectName + '申报流程未完成,无法进行变更!');
return;
}
if (record.stage == 0.1) {
message.error(record.projectName + '已停止,无法进行变更!');
return;
}
let plan = await queryPlanInfoMainTimeline({ projectid: record.id });
if (plan.length > 0) {
for (let i = 0; i < plan[0].children.length; i++) {
if (
plan[0].children[i].taskName == '联合技术审查' &&
plan[0].children[i].isfinish != '0'
) {
message.error(record.projectName + '联合技术审查阶段审批中或已完成,无法进行变更!');
return
}
}
}
console.log('plan', plan);
}
}
function handleBatchImport() {
openBatchImport()
}
function closeBatchImportModal() {
closeBatchImport()
reload()
}
function closeSubProjectModal() {
closeSubProject()
reload()
}
function handleBatchdownload() {
let { getFieldsValue } = getForm()
let fromData = getFieldsValue()
batchdownloadProject(fromData)
console.log("getFieldsValue", getFieldsValue())
}
function handleumodifyinfo() {
let row = getSelectRows()
if (row.length == 0) {
message.error("请选择项目!")
return
}
if (row[0].projectId != undefined) {
fatherid.value = row[0].projectId
rowData.value = row;
console.log('selectedRows', getSelectRows());
openModelMergeProject();
reload();
}
async function handlesplitinfo() {
let row = getSelectRows();
console.log('row', row);
if (row.length == 0) {
message.error('请选择项目!');
return;
}
if (row.length >= 2) {
message.error('请1个需要拆分的项目!');
return;
}
// if (row[0].projectId != undefined) {
// fatherid.value = row[0].projectId
// }
for (let i = 0; i < row.length; i++) {
let record = row[i];
if (record.projectContacts != userStore.getUserInfo.id && !isShowByRoles('projectContact')) {
message.error('不是当前' + record.projectName + '的联系人无法修改此项目!');
return;
}
if (record.stage <= 1 && !isShowByRoles('sys:admin')) {
message.error(record.projectName + '申报流程未完成,无法进行变更!');
return;
}
if (record.stage == 0.1) {
message.error(record.projectName + '已停止,无法进行变更!');
return;
}
let plan = await queryPlanInfoMainTimeline({ projectid: record.id });
if (plan.length > 0) {
for (let i = 0; i < plan[0].children.length; i++) {
if (
plan[0].children[i].taskName == '联合技术审查' &&
plan[0].children[i].isfinish != '0'
) {
message.error(record.projectName + '联合技术审查阶段审批中或已完成,无法进行变更!');
return
}
}
}
console.log('plan', plan);
}
if (row[0].projectContacts != userStore.getUserInfo.id && !isShowByRoles("projectContact")) {
message.error("不是当前项目的联系人无法修改此项目!")
return
rowData.value = row;
console.log('selectedRows', getSelectRows());
openModelSplitProject();
reload();
}
if (row[0].stage <= 1 && !isShowByRoles("sys:admin")) {
message.error("此项目申报流程未完成,无法进行变更!")
return
function closeSplitProject() {
closeModelSplitProject();
reload();
}
proid.value = row[0].id
console.log("selectedRows", getSelectRows())
openModelModfiy()
reload()
}
function closeProjectrModal() {
closeModelModfiy()
reload()
}
function handleAddSubProject() {
let row = getSelectRows()
if (row.length == 0) {
message.error("请选择项目!")
return
function closeMergeProject() {
closeModelMergeProject();
reload();
}
if (row[0].projectId != undefined) {
message.error("请选择主项目!")
return
function closeProjectrModal() {
closeModelModfiy();
reload();
}
function handleAddSubProject() {
let row = getSelectRows();
if (row.length == 0) {
message.error('请选择项目!');
return;
}
if (row[0].projectId != undefined) {
message.error('请选择主项目!');
return;
}
if (row[0].projectContacts != userStore.getUserInfo.id && !isShowByRoles("projectContact")) {
message.error("不是当前项目的联系人无法新增子项目!")
return
if (row[0].projectContacts != userStore.getUserInfo.id && !isShowByRoles('projectContact')) {
message.error('不是当前项目的联系人无法新增子项目!');
return;
}
if (row[0].stage == 1) {
message.error('此项目申报流程未完成,无法进行新增子项目!');
return;
}
proid.value = row[0].id;
console.log('selectedRows', getSelectRows());
openModelSubProject();
}
if (row[0].stage == 1) {
message.error("此项目申报流程未完成,无法进行新增子项目!")
return
function openModfiyInfoPage() {
router.push({ path: '/projectLib/projectInfoHistory/index' });
}
proid.value = row[0].id
console.log("selectedRows", getSelectRows())
openModelSubProject()
}
function openModfiyInfoPage() {
router.push({ path: '/projectLib/projectInfoHistory/index' })
}
</script>
<style scoped></style>

75
src/views/projectLib/projectInfo/mergeProject.vue

@ -0,0 +1,75 @@
<template>
<!-- <BasicTable @register="registerTable">
</BasicTable> -->
<ProjectTable :row="dataTo.row"/>
<el-divider content-position="left">合并项目</el-divider>
<BasicForm @register="registerchangeFieldForm" @submit="handleSubmit" />
</template>
<script lang="ts" name="Detailpage" setup>
import { defineProps, onMounted, ref, reactive } from 'vue';
import { submitMergeProject } from './projectInfo.api';
import { useForm, BasicForm } from '@/components/Form';
import { formSchemas } from './projectInfo.data';
import { cloneDeep } from 'lodash-es';
import ProjectTable from "@/views/ProcessApprovalSubPage/component/projectTable.vue"
let dataTo = defineProps(['row', 'stage', 'IsModify', 'fatherid']);
let emit = defineEmits(['close']);
console.log('dataTo11111', dataTo);
onMounted(async () => {
let formSchemasTemp = cloneDeep(formSchemas);
let schemas = [
'projectName',
'adminDivision',
'dutyWorkplace',
'workplaceProperties',
'reformName',
'superLeader',
];
let SchemaList = [];
schemas.forEach((schemasitem) => {
formSchemasTemp.forEach((item) => {
if (item.field == schemasitem) {
item.dynamicDisabled = false;
SchemaList.push(item);
}
});
});
resetSchema(SchemaList);
});
//
const [
registerchangeFieldForm,
{ getFieldsValue, validate, setFieldsValue, resetSchema, appendSchemaByField },
] = useForm({
resetButtonOptions: { text: '取消' },
submitButtonOptions: { text: '提交' },
// 24 0-24
actionColOptions: { span: 14 },
resetFunc: customResetFunc,
labelCol: { style: { width: '120px' } },
wrapperCol: { style: { width: 'auto' } },
// disabled:true
});
async function handleSubmit() {
let projectids=[]
projectids.push(dataTo.row[0].id)
projectids.push(dataTo.row[1].id)
if (await validate) {
let fields=await getFieldsValue()
fields['projectids']=projectids
fields['phone']=dataTo.row[0].phone
fields['projectContacts']=dataTo.row[0].projectContacts
await submitMergeProject(fields);
emit('close');
}
}
async function customResetFunc() {
emit('close');
}
</script>
<style></style>

14
src/views/projectLib/projectInfo/projectInfo.api.ts

@ -26,6 +26,11 @@ export enum Api {
getRemainingMoneyinfo = '/huzhouSubProjectinfo/getRemainingMoneyinfo',
count = '/huzhouProject/count',
submitMergeProject = '/huzhouMergesplitinfo/submitMergeProject',
submitSplitProject = '/huzhouMergesplitinfo/submitSplitProject',
getMergeDetailList = '/huzhouMergesplitinfo/getMergeDetailList',
getSplitDetailList = '/huzhouMergesplitinfo/getSplitDetailList',
}
/**
*
@ -46,6 +51,10 @@ export const getProjectInfoAndChildPageList = (params?) =>
defHttp.get({ url: Api.getProjectInfoAndChildPageList, params });
export const getProjectInfoPageList = (params?) =>
defHttp.get({ url: Api.getProjectInfoPageList, params });
export const getMergeDetailList = (params?) =>
defHttp.get({ url: Api.getMergeDetailList, params });
export const getSplitDetailList = (params?) =>
defHttp.get({ url: Api.getSplitDetailList, params });
/**
* list
@ -105,3 +114,8 @@ export const isShowByRoles = (roles: string) => {
});
return isShow;
};
export const submitMergeProject = (params?) =>
defHttp.post({ url: Api.submitMergeProject, params });
export const submitSplitProject = (params?) =>
defHttp.post({ url: Api.submitSplitProject, params });
Loading…
Cancel
Save