Commit b49fddef authored by mengzixuan's avatar mengzixuan

feat: (工程资金计划,年度资金计划,已竣工验收项目陈欠资金计划): 添加历史记录功能

parent c57b81b0
......@@ -3,6 +3,7 @@
<template #extra>
<!-- <a-button type="primary" v-if="!disabled" danger> 删除 </a-button>-->
<a-button type="primary" v-if="!disabled" @click="handleSubmit"> 提交 </a-button>
<a-button type="primary" @click="history" v-if="historyData">历史记录 </a-button>
<a-button type="default" @click="router.back()"> 返回 </a-button>
</template>
<template v-for="(item, index) in tabsFormSchema">
......@@ -59,9 +60,17 @@
<!-- </a-button>-->
<projectDrawer @register="registerDrawer" @success="handleSuccess" />
<annualPlanModel @register="register" @close="handleNewData" />
<Operations @register="registerDrawer2" />
</PageWrapper>
</template>
<script lang="ts" setup>
//历史记录相关
import {operateType,addItemApi,addItemData} from "@/api/operations/operations"
//历史记录
import Operations from "@/components/Operations/Operations.vue"
//历史记录是否可查
const historyData = ref(true);
import { router } from '@/router';
import { BasicTable, useTable } from '@/components/Table';
import { getBasicColumns, getBasicColumnsTwo, basicColumnsDisabled, basicColumnsTwoDisabled } from './tableData';
......@@ -88,6 +97,7 @@
const proId = ref('');
const totalId = ref('');
const filingCycle = ref('');
const routeId = ref('');
let show = ref<Recordable[]>([]);
let showTwo = ref<Recordable[]>([]);
// ref数组
......@@ -220,6 +230,7 @@
});
const [registerDrawer, { openDrawer }] = useDrawer();
const [registerDrawer2, { openDrawer: openDrawer2 }] = useDrawer();
const [register, { openModal: openModal }] = useModal();
const { createMessage } = useMessage();
const isUpdate = ref(false);
......@@ -232,6 +243,7 @@
const id = route.query.id; // 获取名为id的参数
totalId.value = route.query.id;
if (!id) {
historyData.value = false;
const ids = JSON.parse(route.query.source);
filingCycle.value = ids[0].filingCycle;
// console.log('ids', ids);
......@@ -366,6 +378,14 @@
let tabsFormSchema = reactive<TabsFormType[]>([]);
async function history() {
openDrawer2(true, {
businessId: totalId.value,
businessType: '年度工程资金计划',
});
console.log('历史记录');
}
async function add() {
openModal();
}
......@@ -558,7 +578,25 @@
formData.value.fundId = totalId;
}
}
let res = isUpdate.value ? await updateItem(unref(formData)) : await addItem(unref(formData));
if (isUpdate.value) {
await updateItem(unref(formData));
addItemData.operateType = operateType.update;
addItemData.businessId = totalId.value;
addItemData.businessType = '年度工程资金计划';
console.log('addItemData', addItemData);
await addItemApi(addItemData);
} else if (!isUpdate.value) {
const res = await addItem(unref(formData));
console.log('resresresresrse', res);
addItemData.operateType = operateType.add;
addItemData.businessId = res;
addItemData.businessType = '年度工程资金计划';
const showDatem = await addItemApi(addItemData);
console.log(showDatem,"记录添加成功");
}
// let res = isUpdate.value ? await updateItem(unref(formData)) : await addItem(unref(formData));
loading.value = true;
// console.log(res);
createMessage.success('提交成功!');
......
......@@ -3,6 +3,7 @@
<template #extra>
<!-- <a-button type="primary" v-if="!disabled" danger> 删除 </a-button>-->
<a-button type="primary" v-if="!disabled" @click="handleSubmit"> 提交 </a-button>
<a-button type="primary" @click="history" v-if="historyData">历史记录 </a-button>
<a-button type="default" @click="router.back()"> 返回 </a-button>
</template>
<template v-for="(item, index) in tabsFormSchema">
......@@ -67,9 +68,17 @@
</a-button>
<projectDrawer @register="registerDrawer" @success="handleSuccess" />
<completedModel @register="register" @close="handleNewData" />
<Operations @register="registerDrawer2" />
</PageWrapper>
</template>
<script lang="ts" setup>
//历史记录相关
import {operateType,addItemApi,addItemData} from "@/api/operations/operations"
//历史记录
import Operations from "@/components/Operations/Operations.vue"
//历史记录是否可查
const historyData = ref(true);
import { router } from '@/router';
import { BasicTable, useTable } from '@/components/Table';
import { getBasicColumns, getBasicColumnsTwo, basicColumnsDisabled, basicColumnsTwoDisabled } from './tableData';
......@@ -95,6 +104,7 @@
const getTitle = ref('');
const engineerId = ref('');
const investmentld = ref('');
const routeId = ref('');
let show = ref<Recordable[]>([]);
let showTwo = ref<Recordable[]>([]);
// ref数组
......@@ -181,6 +191,7 @@
});
const [registerDrawer, { openDrawer }] = useDrawer();
const [registerDrawer2, { openDrawer: openDrawer2 }] = useDrawer();
const [register, { openModal: openModal }] = useModal();
const { createMessage } = useMessage();
getTitle.value = '新建海泰集团2024年工程资金计划(已竣工验收项目)';
......@@ -192,8 +203,10 @@
onMounted(async () => {
const route = useRoute();
const id = route.query.id; // 获取名为id的参数
routeId.value = route.query.id; // 获取名为id的参数
year.value = route.query.year;
if (!id) {
historyData.value = false;
// formData.value.biddingQuarter = route.query.quarter;
formData.value.filingCycle = route.query.year;
formData.value.subList = [];
......@@ -317,6 +330,15 @@
const tabsFormSchema = reactive<TabsFormType[]>([]);
async function history() {
console.log('routeId.value',routeId.value);
openDrawer2(true, {
businessId: routeId.value,
businessType: '已竣工验收项目陈欠资金计划',
});
console.log('历史记录');
}
async function add() {
openModal();
}
......@@ -522,9 +544,28 @@
}
console.log(' formData()', unref(formData));
// console.log(' setTableData()', setTableData);
let res = isUpdate.value ? await updateItem(unref(formData)) : await addItem(unref(formData));
if (isUpdate.value) {
console.log('routeId.valu', routeId.valu)
await updateItem(unref(formData));
addItemData.operateType = operateType.update;
addItemData.businessId = routeId.value;
addItemData.businessType = '已竣工验收项目陈欠资金计划';
console.log('addItemData', addItemData);
await addItemApi(addItemData);
} else if (!isUpdate.value) {
const res = await addItem(unref(formData));
console.log('resresresresrse', res);
addItemData.operateType = operateType.add;
addItemData.businessId = res;
addItemData.businessType = '已竣工验收项目陈欠资金计划';
const showDatem = await addItemApi(addItemData);
console.log(showDatem,"记录添加成功");
}
// let res = isUpdate.value ? await updateItem(unref(formData)) : await addItem(unref(formData));
loading.value = true;
console.log(res);
// console.log(res);
createMessage.success('提交成功!');
router.back();
} catch (e) {
......
......@@ -3,6 +3,7 @@
<template #extra>
<!-- <a-button type="primary" v-if="!disabled" danger> 删除 </a-button>-->
<a-button type="primary" v-if="!disabled" @click="handleSubmit"> 提交 </a-button>
<a-button type="primary" @click="history" v-if="historyData">历史记录 </a-button>
<a-button type="default" @click="router.back()"> 返回 </a-button>
</template>
......@@ -43,9 +44,17 @@
</a-button>
<projectDrawer @register="registerDrawer" @success="handleSuccess" />
<engineeringprojectModel @register="register" @close="handleNewData" />
<Operations @register="registerDrawer2" />
</PageWrapper>
</template>
<script lang="ts" setup>
//历史记录相关
import {operateType,addItemApi,addItemData} from "@/api/operations/operations"
//历史记录
import Operations from "@/components/Operations/Operations.vue"
//历史记录是否可查
const historyData = ref(true);
import { router } from '@/router';
import { BasicTable, useTable } from '@/components/Table';
import { getBasicColumns, basicColumnsDisabled } from './tableData';
......@@ -70,6 +79,7 @@
const getTitle = ref('');
const engineerId = ref('');
const year = ref('');
const routeId = ref('');
let show = ref<Recordable[]>([]);
// function handleSummary(tableData: Recordable[]) {
// const totalNo = tableData.reduce((prev, next) => {
......@@ -159,6 +169,7 @@
});
const [registerDrawer, { openDrawer }] = useDrawer();
const [registerDrawer2, { openDrawer: openDrawer2 }] = useDrawer();
const [register, { openModal: openModal }] = useModal();
const { createMessage } = useMessage();
// const getTitle = computed(() =>
......@@ -172,7 +183,9 @@
onMounted(async () => {
const route = useRoute();
const id = route.query.id; // 获取名为id的参数
routeId.value = route.query.id; // 获取名为id的参数
if (!id) {
historyData.value = false;
formData.value.biddingQuarter = route.query.quarter;
formData.value.tenderYear = route.query.year;
year.value = route.query.year;
......@@ -288,6 +301,14 @@
let tabsFormSchema = reactive<TabsFormType[]>([]);
async function history() {
openDrawer2(true, {
businessId: routeId.value,
businessType: '工程项目投资计划',
});
console.log('历史记录');
}
async function add() {
openModal();
}
......@@ -429,9 +450,29 @@
formData.value.proNumber = formData.value.investmentPlan.Length;
console.log(' formData()', unref(formData));
// console.log(' setTableData()', setTableData);
let res = isUpdate.value ? await updateItem(unref(formData)) : await addItem(unref(formData));
console.log('isUpdate.value', isUpdate.value);
if (isUpdate.value) {
await updateItem(unref(formData));
addItemData.operateType = operateType.update;
addItemData.businessId = routeId.value;
addItemData.businessType = '工程项目投资计划';
console.log('addItemData', addItemData);
await addItemApi(addItemData);
} else if (!isUpdate.value) {
const res = await addItem(unref(formData));
addItemData.operateType = operateType.add;
addItemData.businessId = res;
addItemData.businessType = '工程项目投资计划';
const showDatem = await addItemApi(addItemData);
console.log(showDatem,"记录添加成功");
}
// let res = isUpdate.value ? await updateItem(unref(formData)) : await addItem(unref(formData));
loading.value = true;
console.log(res);
// console.log(res);
createMessage.success('提交成功!');
router.back();
} catch (e) {
......
......@@ -3,6 +3,7 @@
<template #extra>
<!-- <a-button type="primary" v-if="!disabled" danger> 删除 </a-button>-->
<a-button type="primary" v-if="!disabled" @click="handleSubmit"> 提交 </a-button>
<a-button type="primary" @click="history" v-if="historyData">历史记录 </a-button>
<a-button type="default" @click="router.back()"> 返回 </a-button>
</template>
<template v-for="(item, index) in tabsFormSchema">
......@@ -42,9 +43,17 @@
</a-button>
<projectDrawer @register="registerDrawer" @success="handleSuccess" />
<engineeringprojectModel @register="register" @close="handleNewData" />
<Operations @register="registerDrawer2" />
</PageWrapper>
</template>
<script lang="ts" setup>
//历史记录相关
import {operateType,addItemApi,addItemData} from "@/api/operations/operations"
//历史记录
import Operations from "@/components/Operations/Operations.vue"
//历史记录是否可查
const historyData = ref(true);
import { router } from '@/router';
import { BasicTable, useTable } from '@/components/Table';
import { getBasicColumns, basicColumnsDisabled } from './tableData';
......@@ -67,6 +76,7 @@
const getTitle = ref('');
const engineerId = ref('');
const year = ref('');
const routeId = ref('');
let show = ref<Recordable[]>([]);
// function handleSummary(tableData: Recordable[]) {
// const totalNo = tableData.reduce((prev, next) => {
......@@ -156,7 +166,8 @@
// ]);
});
const [registerDrawer, { openDrawer }] = useDrawer();
const [registerDrawer, { openDrawer: openDrawer }] = useDrawer();
const [registerDrawer2, { openDrawer: openDrawer2 }] = useDrawer();
const [register, { openModal: openModal }] = useModal();
const { createMessage } = useMessage();
// const getTitle = computed(() =>
......@@ -170,7 +181,10 @@
onMounted(async () => {
const route = useRoute();
const id = route.query.id; // 获取名为id的参数
routeId.value = route.query.id; // 获取名为id的参数
console.log('routeId.value', routeId.value);
if (!id) {
historyData.value = false;
formData.value.biddingQuarter = route.query.quarter;
formData.value.tenderYear = route.query.year;
year.value = route.query.year;
......@@ -283,6 +297,13 @@
let tabsFormSchema = reactive<TabsFormType[]>([]);
async function history() {
openDrawer2(true, {
businessId: routeId.value,
businessType: '工程项目投资计划',
});
console.log('历史记录');
}
async function add() {
openModal();
}
......@@ -421,7 +442,25 @@
}
}
formData.value.proNumber = formData.value.investmentPlan.Length;
let res = isUpdate.value ? await updateItem(unref(formData)) : await addItem(unref(formData));
console.log('isUpdate.value', isUpdate.value);
if (isUpdate.value) {
await updateItem(unref(formData));
addItemData.operateType = operateType.update;
addItemData.businessId = routeId.value;
addItemData.businessType = '工程项目投资计划';
console.log('addItemData', addItemData);
await addItemApi(addItemData);
} else if (!isUpdate.value) {
const res = await addItem(unref(formData));
addItemData.operateType = operateType.add;
addItemData.businessId = res;
addItemData.businessType = '工程项目投资计划';
const showDatem = await addItemApi(addItemData);
console.log(showDatem,"记录添加成功");
}
// let res = isUpdate.value ? await updateItem(unref(formData)) : await addItem(unref(formData));
loading.value = true;
createMessage.success('提交成功!');
router.back();
......
......@@ -3,6 +3,7 @@
<template #extra>
<!-- <a-button type="primary" v-if="!disabled" danger> 删除 </a-button>-->
<a-button type="primary" v-if="!disabled" @click="handleSubmit"> 提交 </a-button>
<a-button type="primary" @click="history" v-if="historyData">历史记录 </a-button>
<a-button type="default" @click="router.back()"> 返回 </a-button>
</template>
<template v-for="(item, index) in tabsFormSchema">
......@@ -42,9 +43,17 @@
</a-button>
<projectDrawer @register="registerDrawer" @success="handleSuccess" />
<engineeringprojectModel @register="register" @close="handleNewData" />
<Operations @register="registerDrawer2" />
</PageWrapper>
</template>
<script lang="ts" setup>
//历史记录相关
import {operateType,addItemApi,addItemData} from "@/api/operations/operations"
//历史记录
import Operations from "@/components/Operations/Operations.vue"
//历史记录是否可查
const historyData = ref(true);
import { router } from '@/router';
import { BasicTable, useTable } from '@/components/Table';
import { getBasicColumns, basicColumnsDisabled } from './tableData';
......@@ -69,6 +78,7 @@
const year = ref('');
const getTitle = ref('');
const engineerId = ref('');
const routeId = ref('');
let show = ref<Recordable[]>([]);
// function handleSummary(tableData: Recordable[]) {
// const totalNo = tableData.reduce((prev, next) => {
......@@ -158,6 +168,7 @@
});
const [registerDrawer, { openDrawer }] = useDrawer();
const [registerDrawer2, { openDrawer: openDrawer2 }] = useDrawer();
const [register, { openModal: openModal }] = useModal();
const { createMessage } = useMessage();
// const getTitle = computed(() =>
......@@ -171,7 +182,9 @@
onMounted(async () => {
const route = useRoute();
const id = route.query.id; // 获取名为id的参数
routeId.value = route.query.id; // 获取名为id的参数
if (!id) {
historyData.value = false;
formData.value.biddingQuarter = route.query.quarter;
formData.value.tenderYear = route.query.year;
year.value = route.query.year;
......@@ -287,6 +300,14 @@
let tabsFormSchema = reactive<TabsFormType[]>([]);
async function history() {
openDrawer2(true, {
businessId: routeId.value,
businessType: '工程项目投资计划',
});
console.log('历史记录');
}
async function add() {
openModal();
}
......@@ -428,9 +449,26 @@
formData.value.proNumber = formData.value.investmentPlan.Length;
console.log(' formData()', unref(formData));
// console.log(' setTableData()', setTableData);
let res = isUpdate.value ? await updateItem(unref(formData)) : await addItem(unref(formData));
if (isUpdate.value) {
await updateItem(unref(formData));
addItemData.operateType = operateType.update;
addItemData.businessId = routeId.value;
addItemData.businessType = '工程项目投资计划';
console.log('addItemData', addItemData);
await addItemApi(addItemData);
} else if (!isUpdate.value) {
const res = await addItem(unref(formData));
addItemData.operateType = operateType.add;
addItemData.businessId = res;
addItemData.businessType = '工程项目投资计划';
const showDatem = await addItemApi(addItemData);
console.log(showDatem,"记录添加成功");
}
// let res = isUpdate.value ? await updateItem(unref(formData)) : await addItem(unref(formData));
loading.value = true;
console.log(res);
// console.log(res);
createMessage.success('提交成功!');
router.back();
} catch (e) {
......
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