feat: 设置->合同设置->合同文档模板设置
This commit is contained in:
@@ -47,7 +47,7 @@
|
||||
@page-size-change="onPageSizeChange"
|
||||
>
|
||||
<template #type="{ record }">
|
||||
<a-tag checkable :color="getProjectTypeColor(record.type)">
|
||||
<a-tag checkable :color="record.color">
|
||||
{{ record.typeName }}
|
||||
</a-tag>
|
||||
</template>
|
||||
@@ -60,15 +60,8 @@
|
||||
</template>
|
||||
<template #operate="{ record }">
|
||||
<a-space>
|
||||
<a-button
|
||||
:loading="isLoadingDetail"
|
||||
@click="handleDetail(record.id)"
|
||||
>查看</a-button
|
||||
>
|
||||
<a-button
|
||||
:loading="isLoadingEdit"
|
||||
type="primary"
|
||||
@click="handleEditProject(record.id)"
|
||||
<a-button @click="handleDetail(record.id)">查看</a-button>
|
||||
<a-button type="primary" @click="handleEditProject(record.id)"
|
||||
>编辑</a-button
|
||||
>
|
||||
<a-popover trigger="click" position="bottom">
|
||||
@@ -114,7 +107,7 @@
|
||||
import useDataTable from '@/composables/useDataTable';
|
||||
import { ProjectItem } from '@/types/business';
|
||||
import { getProjectList, getProjectDetail } from '@/api/business';
|
||||
import { ProjectPaginationParams, ProjectType } from '@/types/comm';
|
||||
import { ProjectPaginationParams } from '@/types/comm';
|
||||
import projectFormDrawer from './drawer/project-form-drawer.vue';
|
||||
import projectInfoDrawer from './drawer/project-info-drawer.vue';
|
||||
import projectListFilterDrawer from './drawer/project-list-filter-drawer.vue';
|
||||
@@ -185,7 +178,12 @@
|
||||
setLoading(false);
|
||||
};
|
||||
const getProjectDetailData = async (id: number, edit: boolean) => {
|
||||
if (currentProjectInfo.value && currentProjectInfo.value?.id === id) return;
|
||||
if (
|
||||
currentProjectInfo.value &&
|
||||
currentProjectInfo.value?.id === id &&
|
||||
!edit
|
||||
)
|
||||
return;
|
||||
edit ? (isLoadingEdit.value = true) : (isLoadingDetail.value = true);
|
||||
const { code, data } = await getProjectDetail(id);
|
||||
if (code === 200 && data) {
|
||||
@@ -226,11 +224,13 @@
|
||||
showDrawer.value = true;
|
||||
};
|
||||
const handleEditProject = async (id: number) => {
|
||||
if (isLoadingEdit.value) return;
|
||||
isEdit.value = true;
|
||||
await getProjectDetailData(id, true);
|
||||
showDrawer.value = true;
|
||||
};
|
||||
const handleDetail = async (id: number) => {
|
||||
if (isLoadingDetail.value) return;
|
||||
await getProjectDetailData(id, false);
|
||||
showProjectInfoDrawer.value = true;
|
||||
};
|
||||
@@ -240,10 +240,6 @@
|
||||
const handleFilter = () => {
|
||||
showListFilterDrawer.value = true;
|
||||
};
|
||||
const getProjectTypeColor = (type: ProjectType) => {
|
||||
const typeMap = { 1: 'green', 2: 'red', 3: 'orange' };
|
||||
return typeMap[type];
|
||||
};
|
||||
onMounted(() => {
|
||||
setColumns(columns);
|
||||
getProjectListData();
|
||||
|
||||
Reference in New Issue
Block a user