Commit 86929d31 authored by mengzixuan's avatar mengzixuan

feat: 年度工程资金计划列表接口对接

parent bb9ed3e8
import { ProjectParams, ProjectListGetResultModel, ProjectModel } from './model/projectModel';
import { defHttp } from '@/utils/http/axios';
import {ListItem} from "@/api/project/model/biddingPlanModel";
enum Api {
GetList = '/pro/fundPlanYear/page',
GetContent = '/pro/fundPlanYear/selectproBypan',
}
export const getAnnualPlanList = (params?: ProjectParams) =>
defHttp.post<ProjectModel>({ url: Api.GetList, data: params });
export const getContent = (params?: { investmentId: any }) =>
defHttp.get<ListItem[]>({ url: Api.GetContent, params });
......@@ -2,7 +2,7 @@ import { ProjectParams, ProjectListGetResultModel, ProjectModel } from './model/
import { defHttp } from '@/utils/http/axios';
enum Api {
GetList = '/statement/list/page',
GetList = '/pro/overdueFunds/getList',
}
export const getCompletedList = (params?: ProjectParams) =>
defHttp.post<ProjectModel>({ url: Api.GetList, data: params });
......@@ -3,7 +3,7 @@ import { defHttp } from '@/utils/http/axios';
enum Api {
GetList = '/pro/monthEngineer/page',
GetMonthlyPlanProjectList = '',
GetMonthlyPlanProjectList = '/pro/fundPlanYear/selectplan',
}
export const getMonthlyPlanList = (params?: ProjectParams) =>
defHttp.post<ProjectModel>({ url: Api.GetList, data: params });
......
......@@ -22,6 +22,11 @@
@register="item.table"
:beforeEditSubmit="beforeEditSubmit(item, index)"
/>
<BasicTable
:ref="(el) => setSwipeCellRefTwo(item, index)"
@register="item.tableTwo"
:beforeEditSubmit="beforeEditSubmitTwo(item, index)"
/>
</div>
</PageCard>
<a-button v-if="!disabled" type="dashed" @click="add" preIcon="ei:plus">
......@@ -36,7 +41,7 @@
</template>
<script lang="ts" setup>
import { BasicTable, useTable } from '@/components/Table';
import { getBasicColumns } from './tableData';
import { getBasicColumns, getBasicColumnsTwo } from './tableData';
import { ref, nextTick, onMounted, unref, computed, reactive } from 'vue';
import { demoListApi } from '@/api/demo/table';
......@@ -54,34 +59,27 @@
import { addItem, updateItem, getItem } from '@/api/project/engineeringProject';
import { editModel } from '@/api/project/model/engineeringprojectModel';
import { useModal } from '@/components/Modal';
import { getContent } from '@/api/project/annualPlan';
const getTitle = ref('');
const engineerId = ref('');
const investmentld = ref('');
let show = ref<Recordable[]>([]);
// function handleSummary(tableData: Recordable[]) {
// const totalNo = tableData.reduce((prev, next) => {
// prev += next.no;
// return prev;
// }, 0);
// return [
// {
// _row: '合计',
// _index: '平均值',
// no: totalNo,
// },
// {
// _row: '合计',
// _index: '平均值',
// no: totalNo,
// },
// ];
// }
let showTwo = ref<Recordable[]>([]);
// ref数组
const swipeCellRefList = ref<HTMLElement[]>([]);
const swipeCellRefListTwo = ref<HTMLElement[]>([]);
// 动态设置ref
function setSwipeCellRef(item, index) {
if (item) {
swipeCellRefList.value[index] = item;
swipeCellRefListTwo.value[index] = item;
}
}
function setSwipeCellRefTwo(item, index) {
if (item) {
swipeCellRefList.value[index] = item;
swipeCellRefListTwo.value[index] = item;
}
}
function beforeEditSubmit(item, index) {
......@@ -93,69 +91,69 @@
const res = getDataSource();
// console.log('res', res);
const totalNo = res.reduce((prev, next) => {
prev += Number(next.amount);
prev += Number(next.numericalValue);
return prev;
}, 0);
// console.log('totalNo', totalNo);
show.value = [
{
year: '合计',
// _row: '合计',
// _index: '合计',
amount: totalNo,
quarter: '合计',
numericalValue: totalNo,
},
];
return true;
});
}
// const [registerTable, { getDataSource, setTableData }] = useTable({
// title: '表尾行合计示例',
// // api: demoListApi,
// // rowSelection: { type: 'checkbox' },
// columns: getBasicColumns(),
// showSummary: true,
// summaryData: show,
// maxHeight: 180,
// maxWidth: 200,
// showIndexColumn: false,
// pagination: false,
// // scroll: { x: 2000 },
// // canResize: false,
// // showSelectionBar: true, // 显示多选状态栏
// });
};
function beforeEditSubmitTwo(item, index) {
swipeCellRefListTwo.value?.forEach((data: any) => {
console.log('data.tableTwo[1]' + index, data.tableTwo[1]);
let { getDataSource } = data.tableTwo[1];
const res = getDataSource();
// console.log('res', res);
const totalNo = res.reduce((prev, next) => {
prev += Number(next.specialFund);
return prev;
}, 0);
const totalNoTwo = res.reduce((prev, next) => {
prev += Number(next.bankFinancing);
return prev;
}, 0);
const totalNoThree = res.reduce((prev, next) => {
prev += Number(next.ownFunds);
return prev;
}, 0);
console.log('totalNo', totalNo);
showTwo.value = [
{
quarter: '合计',
specialFund: totalNo,
bankFinancing: totalNoTwo,
ownFunds: totalNoThree,
},
];
return true;
});
};
onMounted(async () => {
show.value = [
{
year: '合计',
// _row: '合计',
// _index: '合计',
amount: '-',
quarter: '合计',
numericalValue: '-',
},
];
showTwo.value = [
{
quarter: '合计',
specialFund: '-',
bankFinancing: '-',
ownFunds: '-',
},
];
// setTableData([
// {
// year: '2022',
// no: '',
// },
// {
// year: '2023',
// no: '',
// },
// {
// year: '2024',
// no: '',
// },
// ]);
});
const [registerDrawer, { openDrawer }] = useDrawer();
const [register, { openModal: openModal }] = useModal();
const { createMessage } = useMessage();
// const getTitle = computed(() =>
// !unref(isUpdate) ? '新增工程项目投资计划(工程)' : '编辑工程项目投资计划(工程)',
// );
getTitle.value = '新建年度工程资金计划';
const isUpdate = ref(false);
const loading = ref(false);
......@@ -165,10 +163,9 @@
const route = useRoute();
const id = route.query.id; // 获取名为id的参数
if (!id) {
formData.value.biddingQuarter = route.query.quarter;
formData.value.tenderYear = route.query.year;
// formData.value.biddingQuarter = route.query.quarter;
formData.value.year = route.query.year;
formData.value.investmentPlan = [];
// formData.value.data = [];
isUpdate.value = false;
console.log(formData);
} else {
......@@ -204,6 +201,21 @@
// canResize: false,
// showSelectionBar: true, // 显示多选状态栏
}),
tableTwo: useTable({
title: '表尾行合计示例',
// api: demoListApi,
// rowSelection: { type: 'checkbox' },
columns: getBasicColumns(),
showSummary: true,
summaryData: showTwo,
maxHeight: 180,
maxWidth: 200,
showIndexColumn: false,
pagination: false,
// scroll: { x: 2000 },
// canResize: false,
// showSelectionBar: true, // 显示多选状态栏
}),
};
const { setFieldsValue } = item.Form[1];
tabsFormSchema.push(item);
......@@ -216,37 +228,21 @@
formData.value.investmentPlan = [];
formData.value.investmentPlan.push(data);
console.log('info', info);
const { setTableData } = item.table[1];
setTable(item.table[1], info);
nextTick(() => {
setTableData(info.planYear);
setFieldsValue(
info,
// projectName: info.projectName,
// constructionSite: info.constructionSite,
// constructionMode: info.constructionMode,
// projectType: info.projectType,
// constructionScale: info.constructionScale,
// projectOverview: info.projectOverview,
// fundingSource: info.fundingSource,
// implementingEntity: info.implementingEntity,
// filingCycle: info.filingCycle,
// competentDepartment: info.competentDepartment,
// matchingFunds: info.matchingFunds,
// specialBondFunds: info.specialBondFunds,
// planFunds: info.planFunds,
// attribute: info.attribute,
// beginTime: info.time[0],
// endTime: info.time[1],
// schedule: info.schedule,
// completionRemarks: info.completionRemarks,
);
setFieldsValue(info);
});
}
console.log(res);
}
});
function setTable(table: any, record: any) {
const { setTableData } = table;
nextTick(() => {
setTableData(record);
});
}
type TabsFormType = {
name: string;
forceRender?: boolean;
......@@ -276,6 +272,10 @@
*
*/
async function handleNew(info: any) {
let res = await getContent({ investmentId: info.id });
console.log('res', res);
for (let i = 0; i < res.length; i++) {
investmentld.value = res[i].id;
const item = {
name: '序号' + (tabsFormSchema.length + 1),
forceRender: true,
......@@ -295,53 +295,91 @@
// canResize: false,
// showSelectionBar: true, // 显示多选状态栏
}),
tableTwo: useTable({
title: '表尾行合计示例',
// api: demoListApi,
// rowSelection: { type: 'checkbox' },
columns: getBasicColumnsTwo(),
showSummary: true,
summaryData: showTwo,
maxHeight: 180,
maxWidth: 200,
showIndexColumn: false,
pagination: false,
// scroll: { x: 2000 },
// canResize: false,
// showSelectionBar: true, // 显示多选状态栏
}),
};
const { setTableData } = item.table[1];
// console.log('item.table',setTableData)
const { setFieldsValue } = item.Form[1];
tabsFormSchema.push(item);
formData.value.investmentPlan.push({
proId: info.id,
});
nextTick(() => {
setTableData([
setTable(item.table[1], [
{
year: '2022',
amount: '',
quarter: '一季度',
numericalValue: '',
},
{
year: '2023',
amount: '',
quarter: '二季度',
numericalValue: '',
},
{
year: '2024',
amount: '',
quarter: '三季度',
numericalValue: '',
},
]);
setTable(item.tableTwo[1], [
{
quarter: '一季度',
numericalValue: '',
},
{
quarter: '二季度',
numericalValue: '',
},
{
quarter: '三季度',
numericalValue: '',
},
{
quarter: '四季度',
numericalValue: '',
},
]);
formData.value.investmentPlan.push({
proId: res[i].id,
});
nextTick(() => {
// setTableData([
// {
// quarter: '一季度',
// numericalValue: '',
// },
// {
// quarter: '二季度',
// numericalValue: '',
// },
// {
// quarter: '三季度',
// numericalValue: '',
// },
// ]);
setFieldsValue({
projectName: info.projectName,
constructionSite: info.constructionSite,
constructionMode: info.constructionMode,
projectType: info.projectType,
constructionScale: info.constructionScale,
projectOverview: info.projectOverview,
fundingSource: info.fundingSource,
implementingEntity: info.implementingEntity,
// filingCycle: info.filingCycle,
// competentDepartment: info.competentDepartment,
// matchingFunds: info.matchingFunds,
// specialBondFunds: info.specialBondFunds,
// planFunds: info.planFunds,
// attribute: info.attribute,
// beginTime: info.time[0],
// endTime: info.time[1],
// schedule: info.schedule,
// completionRemarks: info.completionRemarks,
projectName: res[i].projectName,
constructionSite: res[i].constructionSite,
totalInvestment: res[i].totalInvestment,
planFunds: res[i].planFunds,
attribute: res[i].attribute,
beginTime: res[i].beginTime,
schedule: res[i].schedule,
competentDepartment: res[i].competentDepartment,
projectType: res[i].projectType,
});
});
}
}
async function deleteItem(index: any) {
tabsFormSchema.splice(index, 1);
formData.value.investmentPlan.splice(index, 1);
......@@ -355,6 +393,10 @@
console.log(params);
handleNew(params);
}
function getData(table: any) {
const { getDataSource } = table;
return getDataSource();
}
async function handleSubmit() {
console.log('tabsFormSchema', tabsFormSchema);
loading.value = true;
......@@ -362,30 +404,27 @@
for (let i = 0; i < tabsFormSchema.length; i++) {
let item = tabsFormSchema[i];
const { validate, getFieldsValue } = item.Form[1];
const { getDataSource } = item.table[1];
let data = getData(item.table[1]);
let dataTwo = getData(item.tableTwo[1]);
// const { getDataSource } = item.table[1];
await validate();
let res = getFieldsValue();
let data = getDataSource();
// let data = getDataSource();
console.log(' getFieldsValue()', getFieldsValue());
console.log(' getDataSource()', getDataSource());
// console.log(' getDataSource()', getDataSource());
console.log(' data111', data);
data[0].amount = Number(data[0].amount);
data[1].amount = Number(data[1].amount);
data[2].amount = Number(data[2].amount);
data[0].numericalValue = Number(data[0].numericalValue);
data[1].numericalValue = Number(data[1].numericalValue);
data[2].numericalValue = Number(data[2].numericalValue);
// res.biddingPeriod = res.biddingPeriod.join(',');
// res.plannedPeriod = res.plannedPeriod.join(',');
console.log(' formData()', unref(formData));
console.log('engineerId', engineerId);
formData.value.investmentPlan[i] = deepMerge(formData.value.investmentPlan[i], res);
formData.value.investmentPlan[i].planYear = data;
formData.value.investmentPlan[i].beginTime = res.time[0];
formData.value.investmentPlan[i].endTime = res.time[1];
formData.value.planType = '工程';
formData.value.filingCycle = '2024';
formData.value.investmentPlan[i].totalInvestment = Number(
formData.value.investmentPlan[i].totalInvestment,
);
formData.value.id = engineerId.value;
formData.value.investmentPlan[i].plannedQuotaList = data;
formData.value.investmentPlan[i].fundingSourceList = dataTwo;
formData.value.investmentPlan[i].investmentld = investmentld;
}
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));
......
......@@ -7,13 +7,46 @@ import { Input } from 'ant-design-vue';
export function getBasicColumns(): BasicColumn[] {
return [
{
title: '年份',
dataIndex: 'year',
title: '季度',
dataIndex: 'quarter',
width: 80,
},
{
title: '金额(万元)',
dataIndex: 'amount',
title: '数值(万元)',
dataIndex: 'numericalValue',
width: 150,
// sorter: true,
// defaultHidden: true,
edit: true,
},
];
}
export function getBasicColumnsTwo(): BasicColumn[] {
return [
{
title: '季度',
dataIndex: 'quarter',
width: 80,
},
{
title: '专项债拨款',
dataIndex: 'specialFund',
width: 150,
// sorter: true,
// defaultHidden: true,
edit: true,
},
{
title: '银行融资',
dataIndex: 'bankFinancing',
width: 150,
// sorter: true,
// defaultHidden: true,
edit: true,
},
{
title: '自有资金',
dataIndex: 'ownFunds',
width: 150,
// sorter: true,
// defaultHidden: true,
......@@ -45,8 +78,8 @@ export const formSchema: ({ colProps: { offset: number; span: number }; componen
colProps: { span: 7, offset: 1 },
},
{
field: 'constructionMode',
label: '建设模式',
field: 'totalInvestment',
label: '立项总投资',
required: true,
component: 'Input',
componentProps: {
......@@ -56,8 +89,8 @@ export const formSchema: ({ colProps: { offset: number; span: number }; componen
colProps: { span: 7, offset: 1 },
},
{
field: 'projectType',
label: '项目类型',
field: 'planFunds',
label: '2024年计划投资',
required: true,
component: 'Input',
componentProps: {
......@@ -67,19 +100,24 @@ export const formSchema: ({ colProps: { offset: number; span: number }; componen
colProps: { span: 7, offset: 1 },
},
{
field: 'constructionScale',
label: '建设规模',
field: 'attribute',
label: '建设性质',
required: true,
component: 'Input',
component: 'Select',
componentProps: {
readonly: true,
style: { border: 'none' },
options: [
{ label: '新建', value: '0' },
{ label: '结转', value: '1' },
{ label: '缓建', value: '2' },
],
},
colProps: { span: 7, offset: 1 },
},
{
field: 'projectOverview',
label: '项目概况:',
field: 'beginTime',
label: '开工竣工时间:',
required: true,
component: 'Input',
componentProps: {
......@@ -89,8 +127,8 @@ export const formSchema: ({ colProps: { offset: number; span: number }; componen
colProps: { span: 7, offset: 1 },
},
{
field: 'fundingSource',
label: '资金来源:',
field: 'schedule',
label: '2024年底预计形象进度:',
required: true,
component: 'Input',
componentProps: {
......@@ -100,8 +138,8 @@ export const formSchema: ({ colProps: { offset: number; span: number }; componen
colProps: { span: 7, offset: 1 },
},
{
field: 'implementingEntity',
label: '实施主体:',
field: 'competentDepartment',
label: '项目主管部门:',
required: true,
component: 'Input',
componentProps: {
......@@ -111,8 +149,8 @@ export const formSchema: ({ colProps: { offset: number; span: number }; componen
colProps: { span: 7, offset: 1 },
},
{
field: 'projectOverview',
label: '项目概况:',
field: 'projectType',
label: '项目类型:',
required: true,
component: 'Input',
componentProps: {
......@@ -122,22 +160,8 @@ export const formSchema: ({ colProps: { offset: number; span: number }; componen
colProps: { span: 7, offset: 1 },
},
{
field: 'filingCycle',
label: '填报年度:',
required: true,
component: 'DatePicker',
componentProps: {
placeholder: '选择填报周期',
picker: 'year',
style: { width: '100%' },
valueFormat: 'YYYY',
format: 'YYYY',
},
colProps: { span: 7, offset: 1 },
},
{
field: 'totalInvestment',
label: '总投资',
field: 'situationPlanLimit',
label: '2023年资金执行情况-计划额:',
required: true,
component: 'Input',
componentProps: {
......@@ -146,16 +170,8 @@ export const formSchema: ({ colProps: { offset: number; span: number }; componen
colProps: { span: 7, offset: 1 },
},
{
field: 'competentDepartment',
label: '项目主管部门',
required: true,
component: 'Input',
colProps: { span: 7, offset: 1 },
},
{
field: 'matchingFunds',
label: '2024年财政预算匹配资金',
field: 'actualAmountSituation',
label: '2023年资金执行情况-实付额:',
required: true,
component: 'Input',
componentProps: {
......@@ -164,8 +180,8 @@ export const formSchema: ({ colProps: { offset: number; span: number }; componen
colProps: { span: 7, offset: 1 },
},
{
field: 'specialBondFunds',
label: '其中专项债项目2024年预计使用专项债资金',
field: 'cumulativeActualLimit',
label: '2023年底前累计实付额:',
required: true,
component: 'Input',
componentProps: {
......@@ -174,8 +190,8 @@ export const formSchema: ({ colProps: { offset: number; span: number }; componen
colProps: { span: 7, offset: 1 },
},
{
field: 'planFunds',
label: '2024年计划资金',
field: 'fundingGap',
label: '2024资金缺口:',
required: true,
component: 'Input',
componentProps: {
......@@ -183,48 +199,6 @@ export const formSchema: ({ colProps: { offset: number; span: number }; componen
},
colProps: { span: 7, offset: 1 },
},
{
field: 'attribute',
label: '建设性质',
required: true,
component: 'Select',
componentProps: {
options: [
{ label: '新建', value: '0' },
{ label: '结转', value: '1' },
{ label: '缓建', value: '2' },
],
},
colProps: { span: 7, offset: 1 },
},
{
field: 'time',
component: 'RangePicker',
label: '开竣工时间',
required: true,
icon: 'healthicons:i-schedule-school-date-time-outline',
colProps: { span: 7, offset: 1 },
componentProps: {
placeholder: ['开始日期', '结束日期'],
style: { width: '100%' },
valueFormat: 'YYYY-MM-DD',
format: 'YYYY-MM-DD',
},
},
{
field: 'schedule',
label: '2024年底预计形象进度',
required: true,
component: 'Select',
componentProps: {
options: [
{ label: 'A(已经立项实施的跨年工程)', value: '0' },
{ label: 'B(该年度必须建设的项目)', value: '1' },
{ label: 'C(该年度必须建设的项目)', value: '2' },
],
},
colProps: { span: 7, offset: 1 },
},
{
label: '备注',
field: 'remarks',
......
......@@ -23,7 +23,6 @@
<script lang="ts" setup>
import { BasicModal, useModalInner } from '@/components/Modal';
import { BasicTable, useTable, TableAction } from '@/components/Table';
import { getListByPage } from '@/api/project/project';
import { columns, searchFormSchema } from './data';
import { useMessage } from '@/hooks/web/useMessage';
import { getMonthlyPlanProjectList } from "@/api/project/monthlyPlan";
......@@ -36,7 +35,6 @@
labelWidth: 120,
schemas: searchFormSchema,
},
searchInfo: { type: 'engineering' },
useSearchForm: true,
showTableSetting: false,
bordered: true,
......
......@@ -16,62 +16,62 @@ export const columns: (
)[] = [
{
title: '年度',
dataIndex: 'projectName',
dataIndex: 'filingCycle',
width: 180,
},
{
title: '类型',
dataIndex: 'implementingEntity',
dataIndex: 'planType',
width: 180,
},
{
title: '项目数量',
dataIndex: 'constructionMode',
dataIndex: 'totalProject',
width: 200,
},
{
title: '总投资',
dataIndex: 'constructionSite',
dataIndex: 'totalInvestment',
width: 180,
},
{
title: '合同总额合计',
dataIndex: 'projectType',
dataIndex: 'totalContract',
width: 180,
},
{
title: '三年滚动投资计划合计',
dataIndex: 'fundingSource',
dataIndex: 'totalRollingInvestment',
width: 180,
},
{
title: '公司名称',
dataIndex: 'constructionPurpose',
dataIndex: 'company',
width: 180,
},
{
title: '最新更新人',
dataIndex: 'constructionScale',
dataIndex: 'updateBy',
width: 180,
},
{
title: '最新更新时间',
dataIndex: 'constructionScale',
dataIndex: 'updateTime',
width: 180,
},
{
title: '审核状态',
dataIndex: 'constructionScale',
dataIndex: 'planResult',
width: 180,
},
{
title: '审核人',
dataIndex: 'constructionScale',
dataIndex: 'auditingBy',
width: 180,
},
{
title: '审核时间',
dataIndex: 'constructionScale',
dataIndex: 'auditingTime',
width: 180,
},
];
......
......@@ -23,62 +23,62 @@ export const columns: (
},
{
title: '年度',
dataIndex: 'projectName',
dataIndex: 'filingCycle',
width: 200,
},
{
title: '类型',
dataIndex: 'implementingEntity',
dataIndex: 'planType',
width: 180,
},
{
title: '合同额合计',
dataIndex: 'constructionMode',
dataIndex: 'contractAmount',
width: 180,
},
{
title: '年资金计划额合计',
dataIndex: 'projectType',
dataIndex: 'annualFund',
width: 180,
},
{
title: '竣工结算额合计',
dataIndex: 'fundingSource',
dataIndex: 'completionSettlement',
width: 180,
},
{
title: '年资金缺口合计',
dataIndex: '国constructionScale',
dataIndex: 'fundingGap',
width: 180,
},
{
title: '公司名称',
dataIndex: '国constructionScale',
dataIndex: 'company',
width: 180,
},
{
title: '最新更新人',
dataIndex: '国constructionScale',
dataIndex: 'updateBy',
width: 180,
},
{
title: '最新更新时间',
dataIndex: '国constructionScale',
dataIndex: 'updateTime',
width: 180,
},
{
title: '审核状态',
dataIndex: '国constructionScale',
dataIndex: 'auditResult',
width: 180,
},
{
title: '审核人',
dataIndex: '国constructionScale',
dataIndex: 'auditingBy',
width: 180,
},
{
title: '审核时间',
dataIndex: '国constructionScale',
dataIndex: 'auditingTime',
width: 180,
},
];
......
......@@ -39,8 +39,6 @@
import { BasicTable, useTable, TableAction } from '@/components/Table';
import { getCompletedList } from '@/api/project/completed';
import { getListByPage } from '@/api/project/biddingPlan';
import { useDrawer } from '@/components/Drawer';
import { columns, searchFormSchema } from './data';
......@@ -49,7 +47,7 @@ defineOptions({ name: 'Performance' });
const [registerDrawer, { openDrawer }] = useDrawer();
const [registerTable, { reload }] = useTable({
api: getListByPage,
api: getCompletedList,
title: '123',
columns,
formConfig: {
......
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