10 changed files with 363 additions and 4 deletions
@ -0,0 +1,97 @@ |
|||||
|
<template> |
||||
|
<!-- 自定义表单 --> |
||||
|
<MergeProjectDetail :row="mergeDetailList" :form="fromData" v-if="fromData"/> |
||||
|
<ApprovalDetails :processInstanceId="processInstanceId" /> |
||||
|
<ApprovalFromPage :showApprovalForm="showApprovalForm" :buttons="resButton.buttons" ref="ApprovalFromPageRef" |
||||
|
@submit="handleSubmit" @exit="exit" /> |
||||
|
</template> |
||||
|
<script lang="ts" name="fieldChangeApproval" setup> |
||||
|
import { onMounted, ref, reactive } from 'vue' |
||||
|
import { approvalMergeProject, getActionParam } from '../myWork/inComplete/inComplete.api'; |
||||
|
import { ElMessage } from 'element-plus' |
||||
|
import { getMergeDetailList,getSplitDetailList,getFromDataFromMerge} from '../projectLib/projectInfo/projectInfo.api' |
||||
|
|
||||
|
import MergeProjectDetail from "../ProcessApprovalSubPage/component/MergeProjectDetail.vue" |
||||
|
import ApprovalDetails from "../ProcessApprovalSubPage/component/ApprovalDetails.vue"; |
||||
|
import ApprovalFromPage from "../ProcessApprovalSubPage/component/ApprovalFromPage.vue" |
||||
|
let dataTo = defineProps(["record"]) |
||||
|
const emit = defineEmits(['close']); |
||||
|
let mergeDetailList = ref() |
||||
|
let projectId = dataTo.record.projectId as string |
||||
|
let processInstanceId = dataTo.record.processInstanceId |
||||
|
let taskid = dataTo.record.taskId as string |
||||
|
let fromData = ref() |
||||
|
let showApprovalForm = ref() |
||||
|
let ApprovalFromPageRef = ref() |
||||
|
let resButton = reactive({ |
||||
|
showApprovalForm: false, |
||||
|
isEdit: false, |
||||
|
buttons: [] |
||||
|
}) |
||||
|
let fileList = reactive<Array<any>>([]); |
||||
|
onMounted(async () => { |
||||
|
resButton = await getActionParam({ processInstanceId: processInstanceId, taskId: taskid, procesType: dataTo.record.procesType }) |
||||
|
showApprovalForm.value = resButton.showApprovalForm |
||||
|
mergeDetailList.value=await getMergeDetailList({ projectid: projectId}) |
||||
|
let template=await getFromDataFromMerge({ projectid: projectId}) |
||||
|
fromData.value=template[0] |
||||
|
}) |
||||
|
function removeFile(option) { |
||||
|
for (let i = 0; i < fileList.length; i++) { |
||||
|
if (fileList[i].file.name == option.name) { |
||||
|
fileList.splice(i, 1) |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
function httpRequest(option) { |
||||
|
fileList.push(option) |
||||
|
|
||||
|
} |
||||
|
|
||||
|
// 上传前处理 |
||||
|
async function beforeUpload(file) { |
||||
|
let fileSize = file.size |
||||
|
const FIVE_M = 500 * 1024 * 1024; |
||||
|
//大于5M,不允许上传 |
||||
|
if (fileSize > FIVE_M) { |
||||
|
ElMessage.error("最大上传500M") |
||||
|
return false |
||||
|
} |
||||
|
return true |
||||
|
} |
||||
|
// 文件数量过多时提醒 |
||||
|
function handleExceed() { |
||||
|
ElMessage.warning("最多只能上传一个文件") |
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
async function handleSubmit() { |
||||
|
let approvalform = await ApprovalFromPageRef.value.getFieldsValueApprovalForm(); |
||||
|
const params = new FormData() |
||||
|
params.append("flag", approvalform.flag) |
||||
|
params.append("projectid", projectId) |
||||
|
params.append("comment", approvalform.comment) |
||||
|
params.append("taskId", taskid) |
||||
|
if (fileList.length > 0) { |
||||
|
fileList.forEach((x) => { |
||||
|
params.append("file", x.file) |
||||
|
}); |
||||
|
} |
||||
|
console.log("param", params, "approvalform", approvalform) |
||||
|
if (await ApprovalFromPageRef.value.validateApprovalForm()) { |
||||
|
|
||||
|
let res = await approvalMergeProject(params) |
||||
|
console.log("提交成功!", res) |
||||
|
emit("close") |
||||
|
|
||||
|
|
||||
|
} |
||||
|
} |
||||
|
async function exit() { |
||||
|
emit("close") |
||||
|
|
||||
|
} |
||||
|
</script> |
||||
|
<style></style> |
@ -0,0 +1,97 @@ |
|||||
|
<template> |
||||
|
<!-- 自定义表单 --> |
||||
|
<SplitProjectDetail :row="splitDetailList" :form="fromData" v-if="fromData"/> |
||||
|
<ApprovalDetails :processInstanceId="processInstanceId" /> |
||||
|
<ApprovalFromPage :showApprovalForm="showApprovalForm" :buttons="resButton.buttons" ref="ApprovalFromPageRef" |
||||
|
@submit="handleSubmit" @exit="exit" /> |
||||
|
</template> |
||||
|
<script lang="ts" name="fieldChangeApproval" setup> |
||||
|
import { onMounted, ref, reactive } from 'vue' |
||||
|
import { approvalSplitProject, getActionParam } from '../myWork/inComplete/inComplete.api'; |
||||
|
import { ElMessage } from 'element-plus' |
||||
|
import { approvalFieldchange ,getSplitDetailList,getFromDataFromSplit} from '../projectLib/projectInfo/projectInfo.api' |
||||
|
|
||||
|
import SplitProjectDetail from "../ProcessApprovalSubPage/component/SplitProjectDetail.vue" |
||||
|
import ApprovalDetails from "../ProcessApprovalSubPage/component/ApprovalDetails.vue"; |
||||
|
import ApprovalFromPage from "../ProcessApprovalSubPage/component/ApprovalFromPage.vue" |
||||
|
let dataTo = defineProps(["record"]) |
||||
|
const emit = defineEmits(['close']); |
||||
|
let splitDetailList = ref() |
||||
|
let projectId = dataTo.record.projectId as string |
||||
|
let processInstanceId = dataTo.record.processInstanceId |
||||
|
let taskid = dataTo.record.taskId as string |
||||
|
let fromData = ref() |
||||
|
let showApprovalForm = ref() |
||||
|
let ApprovalFromPageRef = ref() |
||||
|
let resButton = reactive({ |
||||
|
showApprovalForm: false, |
||||
|
isEdit: false, |
||||
|
buttons: [] |
||||
|
}) |
||||
|
let fileList = reactive<Array<any>>([]); |
||||
|
onMounted(async () => { |
||||
|
resButton = await getActionParam({ processInstanceId: processInstanceId, taskId: taskid, procesType: dataTo.record.procesType }) |
||||
|
showApprovalForm.value = resButton.showApprovalForm |
||||
|
splitDetailList.value=await getSplitDetailList({ projectid: projectId}) |
||||
|
let template=await getFromDataFromSplit({ projectid: projectId}) |
||||
|
fromData.value=template |
||||
|
}) |
||||
|
function removeFile(option) { |
||||
|
for (let i = 0; i < fileList.length; i++) { |
||||
|
if (fileList[i].file.name == option.name) { |
||||
|
fileList.splice(i, 1) |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
function httpRequest(option) { |
||||
|
fileList.push(option) |
||||
|
|
||||
|
} |
||||
|
|
||||
|
// 上传前处理 |
||||
|
async function beforeUpload(file) { |
||||
|
let fileSize = file.size |
||||
|
const FIVE_M = 500 * 1024 * 1024; |
||||
|
//大于5M,不允许上传 |
||||
|
if (fileSize > FIVE_M) { |
||||
|
ElMessage.error("最大上传500M") |
||||
|
return false |
||||
|
} |
||||
|
return true |
||||
|
} |
||||
|
// 文件数量过多时提醒 |
||||
|
function handleExceed() { |
||||
|
ElMessage.warning("最多只能上传一个文件") |
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
async function handleSubmit() { |
||||
|
let approvalform = await ApprovalFromPageRef.value.getFieldsValueApprovalForm(); |
||||
|
const params = new FormData() |
||||
|
params.append("flag", approvalform.flag) |
||||
|
params.append("projectid", projectId) |
||||
|
params.append("comment", approvalform.comment) |
||||
|
params.append("taskId", taskid) |
||||
|
if (fileList.length > 0) { |
||||
|
fileList.forEach((x) => { |
||||
|
params.append("file", x.file) |
||||
|
}); |
||||
|
} |
||||
|
console.log("param", params, "approvalform", approvalform) |
||||
|
if (await ApprovalFromPageRef.value.validateApprovalForm() ) { |
||||
|
|
||||
|
let res = await approvalSplitProject(params) |
||||
|
console.log("提交成功!", res) |
||||
|
emit("close") |
||||
|
|
||||
|
|
||||
|
} |
||||
|
} |
||||
|
async function exit() { |
||||
|
emit("close") |
||||
|
|
||||
|
} |
||||
|
</script> |
||||
|
<style></style> |
@ -0,0 +1,59 @@ |
|||||
|
<template> |
||||
|
<!-- <BasicTable @register="registerTable"> |
||||
|
|
||||
|
</BasicTable> --> |
||||
|
<ProjectTable :row="dataTo.row"/> |
||||
|
<el-divider content-position="left">合并项目</el-divider> |
||||
|
<BasicForm @register="registerchangeFieldForm" /> |
||||
|
</template> |
||||
|
<script lang="ts" name="MergeProjectDetail" setup> |
||||
|
import { defineProps, onMounted, ref, reactive } from 'vue'; |
||||
|
|
||||
|
import { useForm, BasicForm } from '@/components/Form'; |
||||
|
import { formSchemas } from '@/views/projectLib/projectInfo/projectInfo.data'; |
||||
|
import { cloneDeep } from 'lodash-es'; |
||||
|
import ProjectTable from "@/views/ProcessApprovalSubPage/component/ProjectTable.vue" |
||||
|
let dataTo = defineProps(['row', 'form']); |
||||
|
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 = true; |
||||
|
SchemaList.push(item); |
||||
|
} |
||||
|
}); |
||||
|
}); |
||||
|
resetSchema(SchemaList); |
||||
|
setFieldsValue(dataTo.form); |
||||
|
}); |
||||
|
// |
||||
|
const [ |
||||
|
registerchangeFieldForm, |
||||
|
{ setFieldsValue, resetSchema }, |
||||
|
] = useForm({ |
||||
|
resetButtonOptions: { text: '取消' }, |
||||
|
|
||||
|
submitButtonOptions: { text: '提交' }, |
||||
|
//查询列占比 24代表一行 取值范围 0-24 |
||||
|
actionColOptions: { span: 14 }, |
||||
|
|
||||
|
showResetButton:false, |
||||
|
showSubmitButton:false, |
||||
|
labelCol: { style: { width: '120px' } }, |
||||
|
wrapperCol: { style: { width: 'auto' } }, |
||||
|
// disabled:true |
||||
|
}); |
||||
|
</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="registerchangeFieldForm1" /> |
||||
|
<el-divider content-position="left">拆分为第二个项目</el-divider> |
||||
|
<BasicForm @register="registerchangeFieldForm2" /> |
||||
|
</template> |
||||
|
<script lang="ts" name="SplitProject" setup> |
||||
|
import { defineProps, onMounted, ref, reactive } from 'vue'; |
||||
|
|
||||
|
import { useForm, BasicForm } from '@/components/Form'; |
||||
|
import { formSchemas } from '@/views/projectLib/projectInfo/projectInfo.data'; |
||||
|
import { cloneDeep } from 'lodash-es'; |
||||
|
import ProjectTable from "@/views/ProcessApprovalSubPage/component/ProjectTable.vue" |
||||
|
let dataTo = defineProps(['row', 'form']); |
||||
|
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 = true; |
||||
|
SchemaList.push(item); |
||||
|
} |
||||
|
}); |
||||
|
}); |
||||
|
resetSchema1(SchemaList); |
||||
|
resetSchema2(SchemaList); |
||||
|
setFieldsValue1(dataTo.form[0]); |
||||
|
setFieldsValue2(dataTo.form[1]); |
||||
|
}); |
||||
|
// |
||||
|
const [ |
||||
|
registerchangeFieldForm1, |
||||
|
{ setFieldsValue: setFieldsValue1, resetSchema:resetSchema1 }, |
||||
|
] = useForm({ |
||||
|
//查询列占比 24代表一行 取值范围 0-24 |
||||
|
actionColOptions: { span: 14 }, |
||||
|
showResetButton:false, |
||||
|
showSubmitButton:false, |
||||
|
labelCol: { style: { width: '120px' } }, |
||||
|
wrapperCol: { style: { width: 'auto' } }, |
||||
|
// disabled:true |
||||
|
}); |
||||
|
const [ |
||||
|
registerchangeFieldForm2, |
||||
|
{ setFieldsValue: setFieldsValue2, resetSchema:resetSchema2 }, |
||||
|
] = useForm({ |
||||
|
resetButtonOptions: { text: '取消' }, |
||||
|
|
||||
|
submitButtonOptions: { text: '提交' }, |
||||
|
//查询列占比 24代表一行 取值范围 0-24 |
||||
|
actionColOptions: { span: 14 }, |
||||
|
|
||||
|
showResetButton:false, |
||||
|
showSubmitButton:false, |
||||
|
labelCol: { style: { width: '120px' } }, |
||||
|
wrapperCol: { style: { width: 'auto' } }, |
||||
|
// disabled:true |
||||
|
}); |
||||
|
</script> |
||||
|
<style></style> |
Loading…
Reference in new issue