Commit 156e0307 authored by ccc2wdd's avatar ccc2wdd

变更签证,页面重写

parent 7699296d
<template> <template>
<PageWrapper :title="getTitle" :contentBackground="false" headerSticky> <PageWrapper
:title="getTitle"
:loadingRef="loadingRef"
loading-tip="加载中..."
:contentBackground="false"
headerSticky
>
<!-- page页的右上角操作(提交和返回)按钮 -->
<template #extra> <template #extra>
<a-button type="primary" @click="handleSubmit('0')" v-if="showSubmit">暂存</a-button> <a-button type="primary" v-if="!disabled" :disabled="loadingRef" @click="handleSubmit('0')">
<a-button type="primary" @click="handleSubmit('1')" v-if="showSubmit">提交</a-button> 暂存
</a-button>
<a-button type="primary" v-if="!disabled" :disabled="loadingRef" @click="handleSubmit('1')">
提交
</a-button>
<a-button type="primary" @click="history" v-if="historyData">历史记录 </a-button> <a-button type="primary" @click="history" v-if="historyData">历史记录 </a-button>
<a-button type="default" @click="router.back()"> 返回</a-button> <a-button type="default" @click="router.back()"> 返回 </a-button>
<!-- <a-button type="success" @click="examine" v-if="isUpdate == false && routerId >0"> 审核</a-button>-->
</template> </template>
<!-- page页 --> <!-- page页 -->
<CollapseContainer v-for="(item, index) in tabsFormSchema" :key="index"> <CollapseContainer v-for="(item, index) in tabsFormSchema" :key="index" v-show="item.show">
<template #title> <template #title>
<span class="projectName">{{ item.name }}</span> <span class="projectName">{{ item.name }}</span>
</template> </template>
<template #action> <template #action>
<a-popconfirm <a-button
title="是否确认删除"
ok-text="确定"
cancel-text="取消"
placement="left"
v-if="!disabled" v-if="!disabled"
type="text" type="text"
preIcon="ant-design:delete-outlined" preIcon="ant-design:delete-outlined"
danger danger
@confirm="deleteItemPro(index, item)" @click="deleteItemPro(index)"
><a-button
preIcon="ant-design:delete-outlined"
danger
v-if="!disabled"
type="text"
style="color: rgb(239, 124, 124); cursor: pointer"
>删除项目</a-button >删除项目</a-button
></a-popconfirm
> >
</template> </template>
<BasicForm :loading="loading" @register="item.Form[0]" /> <BasicForm :loading="loading" @register="item.Form[0]" />
<!-- 左上角为项目名 --> <!-- 左上角为项目名 -->
<CollapseContainer <CollapseContainer
v-for="(content, contentIndex) in item.ContentFormList" v-for="(content, key) in item.list"
:key="contentIndex" :key="key"
class="subCard" class="subCard"
:title="'合同:' + contractName[index].contractNameList[contentIndex]" :title="content.name"
v-show="content.show"
> >
<template #title> <template #title>
<span class="contractName">{{ <span class="contractName">{{ content.name }}</span>
'合同:' + contractName[index].contractNameList[contentIndex]
}}</span>
</template> </template>
<!-- 右上角的删除按钮 --> <!-- 右上角的删除按钮 -->
<template #action> <template #action>
<a-popconfirm
title="是否确认删除"
ok-text="确定"
cancel-text="取消"
placement="left"
v-if="!disabled"
@confirm="() => deleteItemCon(index, contentIndex)"
>
<a-button <a-button
preIcon="ant-design:delete-outlined"
danger
v-if="!disabled" v-if="!disabled"
type="text" type="text"
style="color: rgb(239, 124, 124); cursor: pointer" preIcon="ant-design:delete-outlined"
danger
@click="deleteItemCon(index, key)"
>删除合同</a-button >删除合同</a-button
> >
</a-popconfirm>
</template> </template>
<BasicForm :loading="loading" @register="content.ContentFormList" /> <BasicForm :loading="loading" @register="content.form" />
</CollapseContainer> </CollapseContainer>
</CollapseContainer> </CollapseContainer>
<a-button type="dashed" @click="add" preIcon="ei:plus" v-if="buttonShow"> <!--导入或新增按钮-->
从合同中导入</a-button <a-button type="dashed" @click="add" preIcon="ei:plus" v-if="!disabled">
> 从合同中导入
<a-button type="dashed" @click="handleAdd" class="ml-2" preIcon="ei:plus" v-if="buttonShow"> </a-button>
新建合同</a-button
> <a-button type="dashed" @click="handleAdd" class="ml-2" preIcon="ei:plus" v-if="!disabled">
新建合同
</a-button>
<!-- 新建合同的抽屉-->
<contractDrawer @register="registerDrawer" @success="handleSuccess" /> <contractDrawer @register="registerDrawer" @success="handleSuccess" />
<!-- 选择合同导入的弹窗-->
<projectlibraryModel @register="register" @close="handleNewData" /> <projectlibraryModel @register="register" @close="handleNewData" />
<Operations @register="registerDrawerOperations" /> <Operations @register="registerDrawerOperations" />
</PageWrapper> </PageWrapper>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { addItemApi, addItemData, operateType } from '@/api/operations/operations'; //历史记录相关
import { operateType, addItemApi, addItemData } from '@/api/operations/operations';
//历史记录
import Operations from '@/components/Operations/Operations.vue'; import Operations from '@/components/Operations/Operations.vue';
import { nextTick, onMounted, reactive, ref } from 'vue'; import { unref, onMounted, ref, reactive, nextTick } from 'vue';
import { router } from '@/router';
import contractDrawer from '@/views/contract/contractDrawer.vue';
import projectlibraryModel from '@/components/ContractModel/Contract.vue'; import projectlibraryModel from '@/components/ContractModel/Contract.vue';
import { useRoute } from 'vue-router'; import { useDrawer } from '@/components/Drawer';
import { PageWrapper } from '@/components/Page'; import { PageWrapper } from '@/components/Page';
import { BasicForm, FormProps, useForm, UseFormReturnType } from '@/components/Form'; import contractDrawer from '@/views/contract/contractDrawer.vue';
import { Content, formSchema } from './changeSignatrue.data'; import { BasicForm, useForm, FormProps, UseFormReturnType } from '@/components/Form';
// import { formSchema, subFormSchema } from './tableData';
import { formSchema, subFormSchema } from './changeSignatrue.data';
import { deepMerge } from '@/utils';
import { useMessage } from '@/hooks/web/useMessage'; import { useMessage } from '@/hooks/web/useMessage';
import { useDrawer } from '@/components/Drawer'; // import { addItem, updateItem, getItem } from '@/api/project/monthlyPlan';
import { useModal } from '@/components/Modal';
import { EditModel } from '@/api/project/model/changeSignatureModel';
import { addItem, getItem, updateItem } from '@/api/changeSignatrue/changeSignatrue'; import { addItem, getItem, updateItem } from '@/api/changeSignatrue/changeSignatrue';
import { editModel } from '@/api/project/model/changeSignatureModel';
import { useModal } from '@/components/Modal';
import { router } from '@/router';
import { useRoute } from 'vue-router';
import { monthListByMonthYear } from '@/api/project/detail/Amonth';
import { forEach } from '@/utils/helper/treeHelper';
import CollapseContainer from '@/components/Container/src/collapse/CollapseContainer.vue'; import CollapseContainer from '@/components/Container/src/collapse/CollapseContainer.vue';
import { Popconfirm } from 'ant-design-vue'; import { template } from 'xe-utils';
import { subFormSchema } from '@/views/monthlyPlan/monthlyPlanEdit/tableData'; //历史记录是否可查
const historyData = ref(true); const historyData = ref(true);
const getTitle = ref('');
const APopconfirm = Popconfirm; //页面传递过来了的id
const routeId = ref(null);
const [registerDrawer, { openDrawer }] = useDrawer(); const [registerDrawer, { openDrawer }] = useDrawer();
const [registerDrawerOperations, { openDrawer: openDrawer2 }] = useDrawer(); const [registerDrawerOperations, { openDrawer: openDrawer2 }] = useDrawer();
const loadingRef = ref(false);
const [register, { openModal: openModal }] = useModal(); const [register, { openModal: openModal }] = useModal();
const { createMessage } = useMessage(); const { createMessage } = useMessage();
const formData = ref<EditModel>({ management: [], proClosingQuarter: undefined });
const loadingRef = ref(false);
//删除id集合
const idList = ref([]);
const contractIdList = ref([]);
//列表对象
const tabsFormSchema = reactive<TabsFormType[]>([]);
//获取id
//合同名称
const contractName = ref([]);
const contractId = ref([]);
const isUpdate = ref(false); const isUpdate = ref(false);
const routerId = ref(null);
//提交按钮的显示
const showSubmit = ref(false);
// batton 显示
const buttonShow = ref(true);
//表单禁用
const disabled = ref(false);
const loading = ref(false); const loading = ref(false);
const formData = ref<editModel>({});
const tenderId = ref<any>('');
const disabled = ref(false);
const getTitle = ref('');
// 年份 & 季度
const quarter = ref('');
const givenYear = ref('');
onMounted(async () => { onMounted(async () => {
loadingRef.value = true;
const route = useRoute(); const route = useRoute();
var id = route.query.id; const id = route.query.id; // 获取名为id的参数
if (id) { console.log('route', route);
routerId.value = id; routeId.value = id;
const resData = await getItem({ id: id }); if (!id) {
if (route.query.isUpdate === 'true') { historyData.value = false;
getTitle.value = '编辑变更签证'; formData.value.quarter = route.query.quarter;
showSubmit.value = true; formData.value.givenYear = route.query.year;
isUpdate.value = true; quarter.value = formData.value.quarter;
givenYear.value = formData.value.givenYear;
formData.value.engineerConList = [];
isUpdate.value = false;
getTitle.value = '创建变更签证';
} else { } else {
isUpdate.value = true;
tenderId.value = id;
disabled.value = route.query.disabled != '0';
formData.value.quarter = route.query.quarter;
formData.value.givenYear = route.query.givenYear;
if (disabled.value) {
getTitle.value = '查看变更签证'; getTitle.value = '查看变更签证';
buttonShow.value = false; } else {
isUpdate.value = false; getTitle.value = '编辑变更签证';
disabled.value = true;
} }
//定义数据 let res = await getItem({ fundId: id });
formData.value.management = []; formData.value.engineerConList = [];
for (let i = 0; i < resData.length; i++) { for (let i = 0; i < res.length; i++) {
//构建id集合 const source = res[i];
const source = resData[i];
let Name = {
//项目id
projectId: source.projectId,
//合同名称
contractNameList: [],
};
const item = { const item = {
name: '项目:' + source.projectName, name: '项目:' + source.projectName,
projectId: source.projectId, projectId: source.projectId,
...@@ -164,76 +157,54 @@ ...@@ -164,76 +157,54 @@
Form: useForm( Form: useForm(
Object.assign({ schemas: formSchema, disabled }, baseFormConfig) as FormProps, Object.assign({ schemas: formSchema, disabled }, baseFormConfig) as FormProps,
), ),
ContentFormList: [], list: [],
show: true,
}; };
tabsFormSchema.push(item); tabsFormSchema.push(item);
contentAdd(item.Form[1], source, source.contractList[0].amountInvested); setFormData(item.Form[1], source);
//合同名称集合 for (let t = 0; t < source.engineerConList.length; t++) {
let contractList = []; const content = source.engineerConList[t];
for (let j = 0; j < source.contractList.length; j++) { let from = useForm(
const sourceItem = source.contractList[j]; Object.assign({ schemas: subFormSchema, disabled }, baseFormConfig) as FormProps,
console.log(sourceItem, '数据查看'); );
const contentItem = { item.list.push({
ContentFormList: useForm( contractId: content.contractId,
Object.assign({ schemas: Content, disabled }, baseFormConfig) as FormProps, show: true,
), name: '合同:' + content.contrcatName,
}; form: from,
item.ContentFormList.push(contentItem);
Name.contractNameList.push(sourceItem.contrcatName);
contentAdd(contentItem.ContentFormList[1], sourceItem, null);
const contract = {
contractId: sourceItem.contractId,
comtractName: sourceItem.contrcatName,
id: sourceItem.id,
proChngeVisaQuarterId: sourceItem.proChngeVisaQuarterId,
};
contractList.push(contract);
contractId.value.push(sourceItem.contractId);
setFormData(contentItem.ContentFormList[1], {
contractName: sourceItem.contrcatName,
}); });
setFormData(from[1], content);
console.log('content', content);
} }
formData.value.management.push({ console.log('tabsFormSchema', tabsFormSchema);
projectId: source.projectId, console.log('formData', formData);
projectName: source.projectName,
fundingSource: source.fundingSource,
contract: contractList,
});
contractName.value.push(Name);
} }
} else {
historyData.value = false;
isUpdate.value = true;
showSubmit.value = true;
formData.value.proClosingQuarter = {};
formData.value.proClosingQuarter.companyName = 'sdfh';
formData.value.proClosingQuarter.status = '0';
formData.value.proClosingQuarter.quarter = route.query.quarter;
formData.value.proClosingQuarter.givenYear = route.query.year;
formData.value.proClosingQuarter.yearQuarter = route.query.year + '年' + route.query.quarter;
getTitle.value = '新建变更签证';
} }
loadingRef.value = false;
}); });
type TabsFormType = { type TabsFormType = {
name: string; name: string;
forceRender?: boolean; forceRender?: boolean;
projectId: string | number;
Form: UseFormReturnType; Form: UseFormReturnType;
ContentFormList: Array<UseFormReturnType>; list: UseFormReturnType[];
show?: boolean;
projectId: string;
}; };
//配置
const baseFormConfig: Partial<FormProps> = { const baseFormConfig: Partial<FormProps> = {
showActionButtonGroup: false, showActionButtonGroup: false,
labelWidth: 100, labelWidth: 260,
layout: 'vertical', layout: 'vertical',
}; };
function setFormData(form: any, record: any) {
const { setFieldsValue } = form; const tabsFormSchema = reactive<TabsFormType[]>([]);
nextTick(() => {
setFieldsValue(record); async function add() {
}); openModal();
} }
//导入合同的确认 async function handleSuccess(params: any) {
handleNew(params);
}
async function handleNewData(info: any) { async function handleNewData(info: any) {
if (info) { if (info) {
info.map((i) => { info.map((i) => {
...@@ -241,127 +212,104 @@ ...@@ -241,127 +212,104 @@
}); });
} }
} }
/* 往表单page页里带入新建合同的数据*/
// 构建表单
async function handleNew(info: any) { async function handleNew(info: any) {
//判断项目id是否相同 let item = {};
if (formData.value.management.some((obj) => obj.projectId === info.projectId)) { let res = tabsFormSchema.filter((item) => item.projectId == info.projectId);
const item = { if (res.length) {
ContentFormList: useForm( item = res[0];
Object.assign({ schemas: Content, disabled }, baseFormConfig) as FormProps, let from = useForm(Object.assign({ schemas: subFormSchema }, baseFormConfig) as FormProps);
), item.list.push({
}; show: true,
console.log('item1111111111111111111111',item);
const index = tabsFormSchema.findIndex((obj) => obj.projectId === info.projectId);
const contractList = formData.value.management[index].contract;
if (contractList.some((obj) => obj.contractId === info.id)) {
console.log('id相同', contractList[index]);
} else {
for (let i = 0; i < contractList.length; i++) {
if (contractList[i].contractId !== info.id) {
console.log('id不相同', contractList[i]);
contractName.value[index].contractNameList.push(info.contrcatName);
tabsFormSchema[index].ContentFormList.push(item);
if (isUpdate.value) {
formData.value.management[index].contract.push({
contractId: info.id,
proChngeVisaQuarterId: routerId.value,
});
} else {
formData.value.management[index].contract.push({
contractId: info.id, contractId: info.id,
name: '合同:' + info.contrcatName,
form: from,
}); });
} let index = tabsFormSchema.findIndex((item) => item.projectId == info.projectId);
break; setFormData(from[1], {
}
}
}
setFormData(item.ContentFormList[1], {
contractName: info.contrcatName, contractName: info.contrcatName,
// collectingUnit: info.collectingUnit,
contractAmount: info.contractAmount,
// investmentAmount: info.investmentAmount,
}); });
} else { } else {
const contentItem = { item = {
ContentFormList: useForm(
Object.assign({ schemas: Content, disabled }, baseFormConfig) as FormProps,
),
};
//合同名称集合
const contractNameList = [];
console.log('合同名称', info);
contractNameList.push(info.contrcatName);
//构建合同名称
let Name = {
//项目id
projectId: info.projectId,
//合同名称
contractNameList: contractNameList,
};
contractName.value.push(Name);
const list = [];
list.push(contentItem);
const item = {
name: '项目:' + info.projectName, name: '项目:' + info.projectName,
projectId: info.projectId, projectId: info.projectId,
forceRender: true, forceRender: true,
Form: useForm( Form: useForm(Object.assign({ schemas: formSchema }, baseFormConfig) as FormProps),
Object.assign({ schemas: formSchema, disabled }, baseFormConfig) as FormProps, list: [],
), show: true,
ContentFormList: list,
}; };
const { setFieldsValue } = item.Form[1]; item.list.push({
tabsFormSchema.push(item); show: true,
const contractList = []; name: '合同:' + info.contrcatName,
const contract = { form: useForm(Object.assign({ schemas: subFormSchema }, baseFormConfig) as FormProps),
contractId: info.id, contractId: info.id,
//合同名称 });
proChngeVisaQuarterId: null, tabsFormSchema.push(item);
}; setFormData(item.Form[1], {
if (isUpdate.value) {
//proChngeVisaQuarterId
contract.proChngeVisaQuarterId = parseInt(routerId.value);
}
contractList.push(contract);
formData.value.management.push({
projectId: info.projectId, projectId: info.projectId,
projectName: info.projectName, projectName: info.projectName,
fundingSource: info.fundingSource, fundingSource: info.fundingSource,
contract: contractList,
}); });
nextTick(() => { setFormData(item.list[0].form[1], {
setFieldsValue({ contractId: info.id,
projectName: info.projectName, contractName: info.contrcatName,
fundingSource: info.fundingSource, contractAmount: info.contractAmount,
}); });
}
}
function setFormData(form: any, record: any) {
const { setFieldsValue } = form;
nextTick(() => {
setFieldsValue(record);
}); });
setFormData(contentItem.ContentFormList[1], { }
contractName: info.contrcatName, /*新建合同*/
async function handleAdd() {
openDrawer(true, {
isUpdate: false,
}); });
} }
/*删除合同表单*/
async function deleteItemCon(index: any, key: any) {
// delete formData.value.engineerConList[index].conList[key];
tabsFormSchema[index].list[key].show = false;
loadingRef.value = false;
}
/*删除项目表单*/
async function deleteItemPro(index: any) {
// delete formData.value.engineerConList[index];
tabsFormSchema[index].show = false;
loadingRef.value = false;
// }
}
/*获取表单数据(用于提交表单用)*/
async function getFormData(form: any) {
const { validate, getFieldsValue } = form;
await validate();
let res = getFieldsValue();
return res;
} }
//提交 /*提交表单*/
async function handleSubmit(isSubmit) { async function handleSubmit(isSubmit) {
for (let i = 0; i < tabsFormSchema.length; i++) { for (let i = 0; i < tabsFormSchema.length; i++) {
let formProjectSchema = tabsFormSchema[i].Form[1]; let formProjectSchema = tabsFormSchema[i].Form[1];
const { updateSchema } = formProjectSchema; const { updateSchema } = formProjectSchema;
if (isSubmit === '0') { if (isSubmit == '0' || tabsFormSchema[i].show == false) {
updateSchema([ updateSchema([
{ field: 'projectName', required: false }, { field: 'projectName', required: false },
{ field: 'fundingSource', required: false }, { field: 'fundingSource', required: false },
{ field: 'amountInvested', required: false }, { field: 'amountInvested', required: false },
]); ]);
} else {
updateSchema([
{ field: 'projectName', required: true },
{ field: 'fundingSource', required: true },
{ field: 'amountInvested', required: true },
]);
} }
for (let j = 0; j < tabsFormSchema[i].ContentFormList.length; j++) { for (let j = 0; j < tabsFormSchema[i].list.length; j++) {
let formSchema = tabsFormSchema[i].ContentFormList[j].ContentFormList[1]; let formSchema = tabsFormSchema[i].list[j].form[1];
const { updateSchema } = formSchema; const { updateSchema } = formSchema;
nextTick(() => { nextTick(() => {
if (isSubmit === '0') { if (isSubmit == '0' || tabsFormSchema[i].show == false) {
updateSchema([ updateSchema([
{ field: 'contractName', required: false }, { field: 'contractName', required: false },
{ field: 'biddingMethod', required: false }, { field: 'biddingMethod', required: false },
...@@ -384,12 +332,7 @@ ...@@ -384,12 +332,7 @@
{ field: 'visaAmount', required: false }, { field: 'visaAmount', required: false },
{ field: 'estimatedAmountRatio', required: false }, { field: 'estimatedAmountRatio', required: false },
{ field: 'meetingMinutes', required: false }, { field: 'meetingMinutes', required: false },
{ { field: 'remark', required: false },
field: 'remark',
dynamicRules: ({ values }) => {
return [{ required: false }];
},
},
]); ]);
} else { } else {
updateSchema([ updateSchema([
...@@ -417,139 +360,65 @@ ...@@ -417,139 +360,65 @@
}); });
} }
} }
//构建数据
const data = {
management: [],
id: routerId.value,
idList: idList.value,
contractIdList: contractIdList.value,
proClosingQuarter: formData.value.proClosingQuarter,
isSubmit: isSubmit,
};
const management = [];
loadingRef.value = true; loadingRef.value = true;
console.log('表单', tabsFormSchema);
formData.value.engineerConList = [];
try {
let engineerConListIndex = 0;
for (let i = 0; i < tabsFormSchema.length; i++) { for (let i = 0; i < tabsFormSchema.length; i++) {
//数据构建
const contrantData = {
projectId: '',
contractList: [],
};
let item = tabsFormSchema[i]; let item = tabsFormSchema[i];
const { validate } = item.Form[1]; if (item.show) {
await validate(); let res = await getFormData(item.Form[1]);
await handleNewContent(item.Form[1]); let obj = {
const { getFieldsValue } = item.Form[1]; projectId: item.projectId,
contrantData.projectId = tabsFormSchema[i].projectId; conList: [],
var projectInvoice = getFieldsValue().amountInvested; };
for (let j = 0; j < item.ContentFormList.length; j++) { obj = deepMerge(obj, res);
let content = item.ContentFormList[j]; formData.value.engineerConList.push(obj);
const { getFieldsValue } = content.ContentFormList[1]; console.log('项目', formData.value.engineerConList);
await handleNewContent(content.ContentFormList[1]); for (let t = 0; t < item.list.length; t++) {
let res = getFieldsValue(); let content = tabsFormSchema[i].list[t];
if (!isUpdate.value) { if (content.show) {
let itemConetnt = Object.assign(res, { let objCon = {
amountInvested: projectInvoice, contractId: content.contractId,
contractId: formData.value.management[i].contract[j].contractId, };
}); let contentRes = await getFormData(content.form[1]);
contrantData.contractList.push(itemConetnt);
} else { objCon = deepMerge(objCon, contentRes);
let itemConetnt = Object.assign(res, { console.log('表格', formData.value.engineerConList);
id: formData.value.management[i].contract[j].id, console.log('索引', engineerConListIndex);
amountInvested: projectInvoice, formData.value.engineerConList[engineerConListIndex].conList.push(objCon);
contractId: formData.value.management[i].contract[j].contractId,
proChngeVisaQuarterId: formData.value.management[i].contract[j].proChngeVisaQuarterId,
});
contrantData.contractList.push(itemConetnt);
} }
} }
management.push(contrantData); engineerConListIndex = engineerConListIndex + 1;
} }
data.management = management;
if (routerId.value) {
const res = updateItem(data);
addItemData.operateType = operateType.update;
addItemData.businessId = routerId.value;
addItemData.businessType = '变更签证管理';
const showDatem = await addItemApi(addItemData);
if (isSubmit === '0'){
createMessage.success('暂存成功!');
} else {
createMessage.success('提交成功!');
} }
// router.go(-1); formData.value.proNumber = formData.value.engineerConList.length;
} else { formData.value.fundId = tenderId.value;
const res = await addItem(data); formData.value.isSubmit = isSubmit;
console.log('res',res) console.log('最后的结果', formData.value);
addItemData.operateType = operateType.add; isUpdate.value ? await updateItem(unref(formData)) : await addItem(unref(formData));
addItemData.businessId = res; addItemData.operateType = operateType.update;
addItemData.businessId = routeId.value;
addItemData.businessType = '变更签证管理'; addItemData.businessType = '变更签证管理';
const showDatem = await addItemApi(addItemData);
if (isSubmit === '0'){
createMessage.success('暂存成功!');
} else {
createMessage.success('提交成功!');
}
// router.go(-1);
}
}
async function add() {
openModal(true, {
isContent: true,
});
}
function contentAdd(contentItem, sourceItem, amountInvested) { await addItemApi(addItemData);
console.log('contentItem', contentItem, 'sourceItem', sourceItem); loadingRef.value = true;
const { setFieldsValue } = contentItem;
if (amountInvested) {
sourceItem = Object.assign(sourceItem, { amountInvested: amountInvested });
}
nextTick(() => {
setFieldsValue({
...sourceItem,
});
});
}
/*删除合同表单*/ createMessage.success('提交成功!');
async function deleteItemCon(index: any, key: any) { } catch (e) {
contractName.value[index].contractNameList.splice(key, 1); if (e.values.projectName) {
contractIdList.value.push(contractId.value[key]); createMessage.error('请将项目' + e.values.projectName + '信息填写完整!');
contractId.value.splice(key, 1); } else {
formData.value.management[index].contract.splice(key, 1); createMessage.error('请将合同' + e.values.contrcatName + '信息填写完整!');
tabsFormSchema[index].ContentFormList.splice(key, 1);
loadingRef.value = false;
// }
} }
} finally {
/*删除项目表单*/
async function deleteItemPro(index: any, item) {
idList.value.push(item.projectId);
formData.value.management.splice(index, 1);
tabsFormSchema.splice(index, 1);
contractName.value.splice(index, 1);
loadingRef.value = false; loadingRef.value = false;
// }
} }
async function handleAdd() {
openDrawer(true, {
isUpdate: false,
});
}
// 校验方法
function handleNewContent(params) {
const { validate } = params;
return validate();
}
async function handleSuccess(params: any) {
handleNew(params);
} }
function history() { function history() {
openDrawer2(true, { openDrawer2(true, {
businessId: routerId.value, businessId: routeId.value,
businessType: '变更签证管理', businessType: '变更签证管理',
}); });
console.log('历史记录'); console.log('历史记录');
......
...@@ -52,7 +52,7 @@ export const searchFormSchema: FormSchema[] = [ ...@@ -52,7 +52,7 @@ export const searchFormSchema: FormSchema[] = [
label: '', label: '',
component: 'DatePicker', component: 'DatePicker',
componentProps: { componentProps: {
placeholder: '选择填报周期', placeholder: '年份',
picker: 'year', picker: 'year',
style: { width: '100%' }, style: { width: '100%' },
valueFormat: 'YYYY', valueFormat: 'YYYY',
...@@ -97,7 +97,7 @@ export const searchFormSchema: FormSchema[] = [ ...@@ -97,7 +97,7 @@ export const searchFormSchema: FormSchema[] = [
colProps: { span: 4 }, colProps: { span: 4 },
}, },
]; ];
// 前半部分
export const formSchema: FormSchema[] = [ export const formSchema: FormSchema[] = [
{ {
field: 'projectName', field: 'projectName',
...@@ -134,7 +134,8 @@ export const formSchema: FormSchema[] = [ ...@@ -134,7 +134,8 @@ export const formSchema: FormSchema[] = [
colProps: { span: 7, offset: 1 }, colProps: { span: 7, offset: 1 },
}, },
]; ];
export const Content: FormSchema[] = [ // 后半部分
export const subFormSchema: FormSchema[] = [
{ {
field: 'contractName', field: 'contractName',
label: ' 合同名称', label: ' 合同名称',
...@@ -213,7 +214,7 @@ export const Content: FormSchema[] = [ ...@@ -213,7 +214,7 @@ export const Content: FormSchema[] = [
required: true, required: true,
component: 'InputNumber', component: 'InputNumber',
componentProps: ({ formModel, formActionType }) => ({ componentProps: ({ formModel, formActionType }) => ({
addonAfter: '元', addonAfter: '元',
onChange: (value) => { onChange: (value) => {
formModel.contractAmount = value; formModel.contractAmount = value;
updateAmountRatio(formModel, formActionType); updateAmountRatio(formModel, formActionType);
...@@ -230,7 +231,7 @@ export const Content: FormSchema[] = [ ...@@ -230,7 +231,7 @@ export const Content: FormSchema[] = [
required: true, required: true,
component: 'InputNumber', component: 'InputNumber',
componentProps: ({ formModel, formActionType }) => ({ componentProps: ({ formModel, formActionType }) => ({
addonAfter: '元', addonAfter: '元',
onChange: (value) => { onChange: (value) => {
formModel.changeAmount = value; formModel.changeAmount = value;
updateAmountRatio(formModel, formActionType); updateAmountRatio(formModel, formActionType);
...@@ -293,7 +294,7 @@ export const Content: FormSchema[] = [ ...@@ -293,7 +294,7 @@ export const Content: FormSchema[] = [
required: true, required: true,
component: 'InputNumber', component: 'InputNumber',
componentProps: ({ formModel, formActionType }) => ({ componentProps: ({ formModel, formActionType }) => ({
addonAfter: '元', addonAfter: '元',
onChange: (value) => { onChange: (value) => {
formModel.updateAmount = value; formModel.updateAmount = value;
updateContractValueRatio(formModel, formActionType); updateContractValueRatio(formModel, formActionType);
...@@ -341,7 +342,7 @@ export const Content: FormSchema[] = [ ...@@ -341,7 +342,7 @@ export const Content: FormSchema[] = [
required: true, required: true,
component: 'InputNumber', component: 'InputNumber',
componentProps: ({ formModel, formActionType }) => ({ componentProps: ({ formModel, formActionType }) => ({
addonAfter: '元', addonAfter: '元',
onChange: (value) => { onChange: (value) => {
formModel.visaAmount = value; formModel.visaAmount = value;
updateEstimatedAmountRatio(formModel, formActionType); updateEstimatedAmountRatio(formModel, formActionType);
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
:actions="[ :actions="[
{ {
label: '修改', label: '修改',
onClick: handleEdit.bind(null, record, true), onClick: handleEdit.bind(null, record, 0),
}, },
{ {
label: '审核', label: '审核',
...@@ -49,11 +49,11 @@ ...@@ -49,11 +49,11 @@
:actions="[ :actions="[
{ {
label: '修改', label: '修改',
onClick: handleEdit.bind(null, record, true), onClick: handleEdit.bind(null, record, 0),
}, },
{ {
label: '详情', label: '详情',
onClick: handleEdit.bind(null, record, false), onClick: handleEdit.bind(null, record, 1),
}, },
{ {
label: '删除', label: '删除',
...@@ -89,7 +89,7 @@ ...@@ -89,7 +89,7 @@
import { getDepartmentList } from '@/api/project/settlementManage'; import { getDepartmentList } from '@/api/project/settlementManage';
import { useMessage } from '@/hooks/web/useMessage'; import { useMessage } from '@/hooks/web/useMessage';
import yearModal from '@/components/yearModal/yearModal.vue'; import yearModal from '@/components/yearModal/yearModal.vue';
import {useUserStore} from "@/store/modules/user"; import { useUserStore } from '@/store/modules/user';
const { createMessage } = useMessage(); const { createMessage } = useMessage();
const { push } = useRouter(); const { push } = useRouter();
...@@ -125,7 +125,7 @@ ...@@ -125,7 +125,7 @@
} }
}); });
const data = await getDepartmentList(); const data = await getDepartmentList();
console.log('data',data) console.log('data', data);
searchFormSchema[2].componentProps.options = data; searchFormSchema[2].componentProps.options = data;
}); });
...@@ -143,13 +143,14 @@ ...@@ -143,13 +143,14 @@
}; };
//修改 //修改
function handleEdit(record: Recordable, isUpdate: boolean) { function handleEdit(record: Recordable, disabled: number) {
push({ push({
path: '/changeSignature/edit', path: '/changeSignature/edit',
query: { query: {
id: record.id, id: record.id,
statusResult: record.statusResult, givenYear: record.givenYear,
isUpdate: isUpdate, quarter: record.quarter,
disabled: String(disabled),
}, },
}); });
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment