-
-
联系人名单
+
- {{ record.userRoleInfos?.[0].deptRoleInfoList }}
+ {{ record?.deptRoleInfoList || record.userRoleInfos?.[0].deptRoleInfoList }}
- 移除
+ 移除
@@ -85,12 +69,11 @@
+
\ No newline at end of file
diff --git a/hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionStatistics/energyConsumption/index.vue b/hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionStatistics/energyConsumption/index.vue
index 78ff753..33312db 100644
--- a/hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionStatistics/energyConsumption/index.vue
+++ b/hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionStatistics/energyConsumption/index.vue
@@ -1,6 +1,6 @@
-
-
-->
+
+
{
+ getDictList()
+ visible.value = true
+ },
+ },
+ {
+ label: '导入',
+ type: 'primary',
+ name: 'userImport',
+ handle: () => {},
+ },
+ {
+ label: '导出',
+ type: 'primary',
+ name: 'userExports',
+ },
+ {
+ label: '模板下载',
+ type: 'primary',
+ name: 'userExports',
+ },
+ {
+ label: '上传凭证',
+ type: 'primary',
+ handle: () => {
+ openUpload.value = true;
+ },
+ },
+ {
+ label: '凭证下载',
+ type: 'primary',
+ name: 'userExports',
+ },
+ ],
+ columns: [
+ {
+ title: '序号',
+ customRender: (text: any) => {
+ return text.index + 1;
+ },
+ },
+ {
+ title: '能源种类',
+ dataIndex: 'energyType',
+ },
+ {
+ title: '计量单位',
+ className: 'unit',
+ dataIndex: 'unit',
+ },
+ {
+ title: '全年',
+ dataIndex: 'yearly',
+ },
+ {
+ title: '1月',
+ dataIndex: 'jan',
+ // customRender: ({ text, record }) => ({
+ // children: text,
+ // attrs: {
+ // style: record.janFlag === 1 ? 'color: red' : 'color: blue'
+ // }
+ // })
+ },
+ {
+ title: '2月',
+ dataIndex: 'feb',
+ },
+ {
+ title: '3月',
+ dataIndex: 'mar',
+ },
+ {
+ title: '4月',
+ dataIndex: 'apr',
+ },
+ {
+ title: '5月',
+ dataIndex: 'may',
+ },
+ {
+ title: '6月',
+ dataIndex: 'jun',
+ },
+ {
+ title: '7月',
+ dataIndex: 'jul',
+ },
+ {
+ title: '8月',
+ dataIndex: 'aug',
+ },
+ {
+ title: '9月',
+ dataIndex: 'sep',
+ },
+ {
+ title: '10月',
+ dataIndex: 'oct',
+ },
+ {
+ title: '11月',
+ dataIndex: 'nov',
+ },
+ {
+ title: '12月',
+ dataIndex: 'dec',
+ },
+ ],
+ columnActions: {
+ title: '操作',
+ actions: [
+ {
+ label: '编辑',
+ name: 'userEdit',
+ handle: (record: any) => {
+ getDictList()
+ visible.value = true
+ fetch(energyConsumption.findById , {id : record.id }).then((res) => {
+ if(res.data.unit){
+ res.data.unit = res.data.unit.split(',')
+ }
+ formState.value = res.data
+ });
+ },
+ },
+ {
+ label: '删除',
+ name: 'userDelete',
+ dynamicParams: { id: 'id' },
+ confirm: true,
+ isReload: true,
+ api: energyConsumption.del,
+ },
+ ],
+ },
+
+ formConfig: {
+ schemas: [
+ {
+ field: 'year',
+ label: '年份',
+ component: 'NsDatePicker',
+ componentProps: {
+ picker: 'year',
+ valueFormat: 'YYYY',
+ defaultValue: selectYear.value.format('YYYY'),
+ },
+ },
+ ],
+ params: {},
+ },
+ rowKey: 'id',
+ });
// 获取表格数据
const getTableList = () => {
fetch(energyConsumption.pageList , queryParams.value).then((res) => {
data.value = res.data.records
- total.value = res.data.total
});
};
- getTableList()
// 分页器
const onChange = (pageNumber: number,size: number) => {
queryParams.value.pageNum = pageNumber;
queryParams.value.pageSize = size;
- getTableList()
+ mainRef.value?.nsTableRef.reload();
};
// 计算碳排切换
const changeRadio = (e) => {
@@ -263,23 +428,20 @@
if(formState.value.id){
fetch(energyConsumption.update , formState.value).then((res) => {
visible.value = false
+ formState.value = {}
message.success('操作成功!');
- getTableList()
+ mainRef.value?.nsTableRef.reload();
});
}else{
fetch(energyConsumption.creat , formState.value).then((res) => {
if(res.data === '新增数据已存在'){
visible.value = false
- queryParams.value = formState.value
- queryParams.value.pageNum = 1,
- queryParams.value.pageSize = 10,
- queryParams.value.orgId = orgId.value,
- queryParams.value.year = selectYear.value.format('YYYY')
- getTableList()
+ NsMessage.warning(res.data);
}else{
visible.value = false
+ formState.value = {}
message.success('操作成功!');
- getTableList()
+ mainRef.value?.nsTableRef.reload();
}
});
}
@@ -298,10 +460,10 @@
fetch(carbonEmissionFactorLibrary.dictionaryUnitManagement, { grp: 'MEASUREMENT_UNIT'}).then((res) => {
measurementUnit.value = res.data
measurementUnit.value = measurementUnit.value.map(item => ({
- value: item.cnValue,
+ value: item.id,
label: item.cnValue,
children: item.children ? item.children.map(child => ({
- value: child.cnValue,
+ value: child.id,
label: child.cnValue
})) : []
}));
@@ -310,10 +472,10 @@
fetch(group.queryDeviceGroupTree, { energyType: 'ELECTRICITY_USAGE',orgId: orgId.value }).then((res) => {
treeData.value = res.data
treeData.value = treeData.value.map(item => ({
- value: item.pointName,
+ value: item.id,
label: item.pointName,
children: item.children ? item.children.map(child => ({
- value: child.pointName,
+ value: child.id,
label: child.pointName
})) : []
}));
@@ -346,7 +508,7 @@
onOk() {
fetch(energyConsumption.del , {id : record.id }).then((res) => {
message.success('操作成功!');
- getTableList()
+ mainRef.value?.nsTableRef.reload();
});
},
onCancel() {
@@ -357,6 +519,7 @@
// 关闭新增抽屉
const onClose = () => {
visible.value = false;
+ formState.value = {}
formRef.value.resetFields();
};
// 点击上传凭证按钮
diff --git a/hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionStatistics/quickCalculation/index.vue b/hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionStatistics/quickCalculation/index.vue
index c45e65d..6f1a5d3 100644
--- a/hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionStatistics/quickCalculation/index.vue
+++ b/hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionStatistics/quickCalculation/index.vue
@@ -39,7 +39,7 @@