zhouhaibin
4 months ago
7 changed files with 745 additions and 233 deletions
@ -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> |
@ -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> |
@ -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> |
Loading…
Reference in new issue