Commit 61eb75a4 authored by 高滢's avatar 高滢

Merge remote-tracking branch 'origin/develop' into develop

parents 8857f8c4 1db6fb5f
......@@ -21,7 +21,11 @@ enum Api {
getProject = '/pro/completion/getProject',
statisticCompletion = '/pro/completion/statisticCompletion',
statisticCompletionDetails = '/pro/completion/statisticCompletionDetails',
ExportCount = '/pro/export/completionStatistic'
ExportCount = '/pro/export/completionStatistic',
GetCycelDetails = '/pro/completion/cycle/details',
EditCycel = '/pro/completion/cycle/edit',
EditStatus = '/pro/completion/cycle/editStatus',
BusinessComDetails = '/pro/completion/cycle/businessComDetails',
}
export const getListByPage = (params?: ProjectParams) =>
defHttp.post<ProjectModel>({ url: Api.GetList, data: params });
......@@ -77,25 +81,48 @@ export const getPerformanceDetail = (params?: any) =>
export const getProject = (params?: any) =>
defHttp.post<ProjectModel>({ url: Api.getProject, params });
export const getStatisticCompletionProject = (params?: any) =>
defHttp.post<any>({
url: Api.statisticCompletion,
params,
});
defHttp.post<any>({
url: Api.statisticCompletion,
params,
});
export const getStatisticCompletionDetails = (params?: any) =>
defHttp.post<any>({
url: Api.statisticCompletionDetails,
params,
});
export const getStatisticCompletionDetails = (params?: any) =>
defHttp.post<any>({
url: Api.statisticCompletionDetails,
params,
});
export const exportStatisticList = (params?: any) =>
defHttp.post<any>(
{
url: Api.ExportCount,
data: params,
responseType: 'blob',
},
{ errorMessageMode: 'none', isTransformResponse: false },
);
defHttp.post<any>(
{
url: Api.ExportCount,
data: params,
responseType: 'blob',
},
{ errorMessageMode: 'none', isTransformResponse: false },
);
export const getCycel = (params?: any) =>
defHttp.post<any>({
url: Api.GetCycelDetails,
params,
});
export const setCycel = (params?: any) =>
defHttp.post<any>({
url: Api.EditCycel,
params,
});
export const setEditStatus = (params?: any) =>
defHttp.post<any>({
url: Api.EditStatus,
params,
});
export const getFillComDetails = (params?: any) =>
defHttp.post<any>({
url: Api.BusinessComDetails,
params,
});
......@@ -165,7 +165,7 @@
bordered: true,
showIndexColumn: false,
actionColumn: {
width: 140,
width: 220,
title: '操作',
dataIndex: 'action',
// slots: { customRender: 'action' },
......
......@@ -114,7 +114,7 @@
confirm: examine.bind(null, record, true),
},
ifShow: (_action) => {
return deptId !== 100 && isExamine === true && record.isSubmit === '1';
return record.status === '0' && deptId !== '100' && isExamine === true && record.isSubmit === '1';
},
},
{
......
<template>
<BasicModal
v-bind="$attrs"
@register="register"
title="设置填报周期"
:minHeight="30"
okText="保存"
@ok="handleSubmit"
>
<BasicForm @register="registerForm" :model="modelRef" />
</BasicModal>
</template>
<script lang="ts" setup>
import { ref } from 'vue';
import { BasicModal, useModalInner } from '@/components/Modal';
import { BasicForm, useForm } from '@/components/Form';
import { setCycel } from '@/api/project/performance';
const props = defineProps({
userData: { type: Object },
});
const emit = defineEmits(['getCycle', 'register']);
const modelRef = ref({});
const [registerForm, { getFieldsValue, validate }] = useForm({
labelWidth: 100,
schemas: [
{
field: 'year',
label: '填报年份',
required: true,
component: 'DatePicker',
componentProps: {
placeholder: '年份',
picker: 'year',
style: { width: '100%' },
valueFormat: 'YYYY',
format: 'YYYY',
},
colProps: { span: 12 },
},
],
showActionButtonGroup: false,
actionColOptions: {
span: 24,
},
});
const cycleData = ref({
beginTime: '2024-07-01',
endTime: '2024-09-02',
fillCycle: '2026',
isEdit: '0',
deptNum: 8,
noNum: 6,
});
const [register, { closeModal }] = useModalInner((data) => {
cycleData.value = data.data;
});
function handleSubmit() {
validate().then(() => {
const value = getFieldsValue();
cycleData.value.fillCycle = value.year;
setCycel(cycleData.value).then(() => {
emit('getCycle');
});
closeModal();
});
}
</script>
<template>
<BasicModal v-bind="$attrs" width="80%" @register="register" :title="getTitle" :showOkBtn="false">
<Table
:pagination="false"
:dataSource="dataSource"
:columns="columns"
bordered
:sticky="true"
:loading="loadingRef"
>
<template #bodyCell="{ column, record }">
<template v-if="column.dataIndex === 'comStatus'">
<Tag color="green" v-if="record.comStatus === '1'"> 已完成 </Tag>
<Tag color="red" v-else> 未完成 </Tag>
</template>
</template>
</Table>
</BasicModal>
</template>
<script setup lang="ts">
import { useModalInner } from '@/components/Modal';
import BasicModal from '@/components/Modal/src/BasicModal.vue';
import { ref } from 'vue';
import { Table, Tag } from 'ant-design-vue';
import { getFillComDetails } from '@/api/project/performance';
const loadingRef = ref(false);
// 列表
const dataSource = ref([]);
// 表头
const columns = [
{
title: '公司名称',
dataIndex: 'company',
width: 200,
},
{
title: '完成状态',
dataIndex: 'comStatus',
width: 180,
},
{
title: '上报时间',
dataIndex: 'updateTime',
width: 150,
},
];
const getTitle = ref('');
const params = ref({ mothCycle: '' });
const [register, { closeModal }] = useModalInner(async (data) => {
params.value.mothCycle = data.data.fillCycle;
dataSource.value = await getFillComDetails(params.value);
});
</script>
<style scoped lang="less"></style>
<template>
<div>
<BasicTable @register="registerTable" :title="'工程项目投资计划完成情况填报'">
<template #toolbar>
<a-button class="btn" type="primary" @click="handleCreate"> 新建完成情况 </a-button>
</template>
<template #bodyCell="{ column, text, record, index }">
<!-- 当前列是序号列时,显示序号 -->
<span v-if="column.dataIndex === 'serialNumber'">{{ index + 1 }}</span>
<template v-if="column.key === 'completionResult'">
<Tag color="processing">
{{ record.completionResult == 1 ? '已审核' : '未审核' }}
</Tag>
<div style="margin: 16px">
<div v-if="deptId === '100' || deptId === '0'" style="margin: 16px">
<PageCard title="数据填报周期">
<Row>
<Col :span="20">
<div class="cycleFrame">
<div class="card">
<div class="cycleIcon">
<img src="@/assets/icons/tianbaoriqi.png" />
</div>
<div class="characte">
<div class="top">填报周期</div>
<div
@click="selectCycle"
class="bottom"
style="color: #0d84ff; text-decoration: underline; cursor: pointer"
>{{ mothCycle.fillCycle }}</div
>
</div>
</div>
<Divider
type="vertical"
style="height: 36px; border-color: rgba(22, 106, 203, 0.3)"
dashed
/>
<div class="card">
<div class="cycleIcon">
<img src="@/assets/icons/shenyutianshu.png" />
</div>
<div class="characte">
<div class="top">剩余天数</div>
<div class="bottom" style="color: #dfaa21">{{ daysReturn() + '天' }}</div>
</div>
</div>
<Divider
type="vertical"
style="height: 36px; border-color: rgba(22, 106, 203, 0.3)"
dashed
/>
<div class="card">
<div class="cycleIcon">
<img src="@/assets/icons/weiwancheng.png" />
</div>
<div class="characte">
<div class="top">企业未完成</div>
<div class="bottom" style="color: #db4343">{{ mothCycle.noNum + '家' }}</div>
</div>
</div>
<Divider
type="vertical"
style="height: 36px; border-color: rgba(22, 106, 203, 0.3)"
dashed
/>
<div class="card">
<div class="cycleIcon">
<img src="@/assets/icons/yiwancheng.png" />
</div>
<div class="characte">
<div class="top">企业已完成</div>
<div class="bottom" style="color: #16cb28">{{
mothCycle.deptNum - mothCycle.noNum + '家'
}}</div>
</div>
</div>
</div>
</Col>
<Col :span="4">
<a-button class="btn" @click="getFillDetails"> 查看填报详情 </a-button>
<a-button class="btn" type="primary" @click="returnEdit">
{{ mothCycle.isEdit === '1' ? '开启本轮填报' : '结束本轮填报' }}
</a-button>
</Col>
</Row>
</PageCard>
</div>
<div>
<BasicTable @register="registerTable" :title="'工程项目投资计划完成情况填报'">
<template #toolbar>
<a-button class="btn" type="primary" @click="handleCreate"> 新建完成情况 </a-button>
</template>
<template v-if="column.key === 'action'">
<TableAction
:actions="[
{
label: '详情',
onClick: handleEdit.bind(null, record, 1),
ifShow:true
},
{
label: '修改',
onClick: handleEdit.bind(null, record, 0),
ifShow: (_action) => {
return true;
},
},
{
label: '删除',
color: 'error',
popConfirm: {
title: '是否确认删除',
placement: 'left',
confirm: handleDelete.bind(null, record),
<template #bodyCell="{ column, text, record, index }">
<!-- 当前列是序号列时,显示序号 -->
<span v-if="column.dataIndex === 'serialNumber'">{{ index + 1 }}</span>
<template v-if="column.key === 'completionResult'">
<Tag color="processing">
{{ record.completionResult == 1 ? '已审核' : '未审核' }}
</Tag>
</template>
<template v-if="column.key === 'action'">
<TableAction
:actions="[
{
label: '详情',
onClick: handleEdit.bind(null, record, 1),
ifShow: true,
},
ifShow: (_action) => {
return true;
{
label: '修改',
onClick: handleEdit.bind(null, record, 0),
ifShow: () => {
return record.reviewStatus === '0';
},
},
},
{
label: '审核',
color: 'success',
popConfirm: {
title: '是否确认审核',
placement: 'left',
confirm: examine.bind(null, record, true),
{
label: '删除',
color: 'error',
popConfirm: {
title: '是否确认删除',
placement: 'left',
confirm: handleDelete.bind(null, record),
},
ifShow: () => {
return record.reviewStatus === '0';
},
},
ifShow: (_action) => {
return (
record.completionResult == 0 && isExamine === true && record.isSubmit == '1'
);
{
label: '审核',
color: 'success',
popConfirm: {
title: '是否确认审核',
placement: 'left',
confirm: examine.bind(null, record, true),
},
ifShow: (_action) => {
return (
record.completionResult === 0 && isExamine === true && record.isSubmit == '1'
);
},
},
},
]"
/>
]"
/>
</template>
</template>
</template>
</BasicTable>
<performanceModel @register="register" @close="handleNew" />
</BasicTable>
<performanceModel @register="register" @close="handleNew" />
<CycleModel @register="registerCycleModel" :user-data="mothCycle" @get-cycle="getSetCycle" />
<FillDetailsModel @register="registerFillDetail" />
</div>
</div>
</template>
<script lang="ts" setup>
//审核相关操作
import { operateType, addItemApi, addItemData } from '@/api/operations/operations';
import { BasicTable, useTable, TableAction } from '@/components/Table';
import { getListByPage, auditItem, deleteItem } from '@/api/project/performance';
import PageCard from '@/components/Page/src/PageCard.vue';
import {
getListByPage,
auditItem,
deleteItem,
getCycel,
setEditStatus,
} from '@/api/project/performance';
import { columns, searchFormSchema } from './data';
import { useModal } from '@/components/Modal';
import { useRouter } from 'vue-router';
import performanceModel from './performanceModel.vue';
import { Tag } from 'ant-design-vue';
import { Col, Divider, Row, Tag } from 'ant-design-vue';
import { onMounted, ref } from 'vue';
import { getDepartmentList } from '@/api/project/settlementManage';
import { useMessage } from '@/hooks/web/useMessage';
import { useUserStore } from '@/store/modules/user';
import CycleModel from '@/views/performance/cycleModel/cycleModel.vue';
import FillDetailsModel from '@/views/performance/fillDetailsModel/fillDetailsModel.vue';
const { createMessage } = useMessage();
const { push } = useRouter();
const [register, { openModal: openModal, closeModal: closeModel }] = useModal();
const [registerCycleModel, { openModal: openCycleModel }] = useModal();
const [registerFillDetail, { openModal: openFillDetailModel }] = useModal();
defineOptions({ name: 'Performance' });
const [registerTable, { reload }] = useTable({
api: getListByPage,
......@@ -100,9 +191,18 @@
fixed: undefined,
},
});
const deptId = '' + useUserStore().userInfo.deptParentId;
const mothCycle = ref({
beginTime: '2024-07-01',
endTime: '2024-09-02',
fillCycle: '2020年第一季度',
isEdit: '0',
deptNum: 12,
noNum: 6,
});
function handleEdit(record: Recordable, disabled: number) {
console.log(record)
console.log(record);
push({
path: '/engineeringProject/performanceEdit',
query: {
......@@ -124,6 +224,7 @@
}
});
const data = await getDepartmentList();
mothCycle.value = await getCycel();
searchFormSchema[2].componentProps.options = data;
});
......@@ -158,9 +259,74 @@
console.log(res);
reload();
}
function daysReturn() {
// 获取今天的日期
const today = new Date();
// 获取目标年份和月份
let year = Number.parseInt(mothCycle.value.fillCycle);
const targetDate = new Date(year, 12, 0); // 得到当前年最后一天
// 计算时间差(毫秒)
const timeDifference = targetDate - today;
// 计算天数差(天数 = 毫秒差 / 每天的毫秒数)
return Math.max(0, Math.ceil(timeDifference / (1000 * 60 * 60 * 24)));
}
function getFillDetails() {
openFillDetailModel(true, {
data: mothCycle.value,
});
}
function selectCycle() {
openCycleModel(true, {
data: mothCycle.value,
});
}
function returnEdit() {
if (mothCycle.value.isEdit == '1') {
mothCycle.value.isEdit = '0';
setEditStatus(mothCycle.value);
} else {
mothCycle.value.isEdit = '1';
setEditStatus(mothCycle.value);
}
reload();
}
async function getSetCycle() {
mothCycle.value = await getCycel();
}
</script>
<style scoped>
<style scoped lang="less">
.btn {
margin-right: 10px;
margin-top: 8px;
}
.cycleFrame {
border: 1px solid rgba(22, 106, 203, 0.1);
border-radius: 6px;
padding: 20px 50px;
margin-right: 20px;
display: flex;
justify-content: space-between;
.card {
display: flex;
.cycleIcon {
margin-right: 10px;
}
.characte {
display: flex;
flex-direction: column;
justify-content: space-around;
.top {
}
.bottom {
}
}
}
}
</style>
......@@ -105,7 +105,7 @@
{
label: '删除',
color: 'error',
popConfirm: {
popConfirm: {
title: '是否确认删除',
placement: 'left',
confirm: handleDelete.bind(null, record),
......@@ -137,6 +137,9 @@
placement: 'left',
confirm: handleDelete.bind(null, record),
},
ifShow: (_action) => {
return record.isEdit === '0';
},
},
]"
/>
......
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