|
@ -106,8 +106,13 @@ |
|
|
<span>{{ data.emissionSource }}</span> |
|
|
<span>{{ data.emissionSource }}</span> |
|
|
</div> |
|
|
</div> |
|
|
<div class="actionMore"> |
|
|
<div class="actionMore"> |
|
|
<EditOutlined @click="editUnit(data)" /> |
|
|
<EditOutlined |
|
|
<MinusCircleOutlined style="margin-left: 6px" @click="delUnit(data)" /> |
|
|
@click="editUnit(data)" |
|
|
|
|
|
v-if="data.emissionSource !== '全部'" /> |
|
|
|
|
|
<MinusCircleOutlined |
|
|
|
|
|
v-if="data.emissionSource !== '全部'" |
|
|
|
|
|
style="margin-left: 6px" |
|
|
|
|
|
@click="delUnit(data)" /> |
|
|
<PlusCircleOutlined |
|
|
<PlusCircleOutlined |
|
|
v-if="data.emissionSource === '全部'" |
|
|
v-if="data.emissionSource === '全部'" |
|
|
style="margin-left: 6px" |
|
|
style="margin-left: 6px" |
|
@ -131,7 +136,7 @@ |
|
|
:pagination="false" |
|
|
:pagination="false" |
|
|
bordered |
|
|
bordered |
|
|
size="middle" |
|
|
size="middle" |
|
|
:scroll="{ y: 380 }"> |
|
|
:scroll="{ x: 660, y: 380 }"> |
|
|
<template #title> |
|
|
<template #title> |
|
|
<a-button type="primary" @click="downLoadVoucher">凭证</a-button> |
|
|
<a-button type="primary" @click="downLoadVoucher">凭证</a-button> |
|
|
</template> |
|
|
</template> |
|
@ -373,20 +378,21 @@ |
|
|
@keydown="handleKeyDown" /> |
|
|
@keydown="handleKeyDown" /> |
|
|
</a-form-item> |
|
|
</a-form-item> |
|
|
</a-col> |
|
|
</a-col> |
|
|
<a-col :span="24"> |
|
|
<!-- <a-col :span="24"> |
|
|
<a-form-item ref="name" label="关键字" name="key"> |
|
|
<a-form-item ref="name" label="关键字" name="key"> |
|
|
<a-input-search |
|
|
<a-input-search |
|
|
v-model:value="editFormState.key" |
|
|
v-model:value="editFormState.key" |
|
|
@search="searchKey" |
|
|
@search="searchKey" |
|
|
placeholder="请输入关键字" /> |
|
|
placeholder="请输入关键字" /> |
|
|
</a-form-item> |
|
|
</a-form-item> |
|
|
</a-col> |
|
|
</a-col> --> |
|
|
</a-row> |
|
|
</a-row> |
|
|
</a-form> |
|
|
</a-form> |
|
|
</a-spin> |
|
|
</a-spin> |
|
|
<div class="ns-form-title-edit" style="display: flex"> |
|
|
<!-- <div class="ns-form-title-edit" style="display: flex"> |
|
|
<div class="titleEdit">因子列表</div> |
|
|
<div class="titleEdit">因子列表</div> |
|
|
</div> |
|
|
</div> --> |
|
|
|
|
|
<a-button type="primary" style="margin-bottom: 10px" @click="selectFactor">选择因子</a-button> |
|
|
<a-table |
|
|
<a-table |
|
|
:columns="drawerColumns" |
|
|
:columns="drawerColumns" |
|
|
:data-source="newTableData" |
|
|
:data-source="newTableData" |
|
@ -430,14 +436,23 @@ |
|
|
<inbox-outlined></inbox-outlined> |
|
|
<inbox-outlined></inbox-outlined> |
|
|
</p> |
|
|
</p> |
|
|
<p class="ant-upload-hint">1.仅支持pdf格式文件或文件夹</p> |
|
|
<p class="ant-upload-hint">1.仅支持pdf格式文件或文件夹</p> |
|
|
<p class="ant-upload-hint">2.文件名命名规则为【能源种类_年份】</p> |
|
|
<p class="ant-upload-hint">2.每次上传自动覆盖</p> |
|
|
<p class="ant-upload-hint">3.每次上传自动覆盖</p> |
|
|
|
|
|
</a-upload-dragger> |
|
|
</a-upload-dragger> |
|
|
<template #footer> |
|
|
<template #footer> |
|
|
<a-button style="margin-right: 8px" @click="onCloseEditData">取消</a-button> |
|
|
<a-button style="margin-right: 8px" @click="onCloseEditData">取消</a-button> |
|
|
<a-button type="primary" @click="submitEditData">确定</a-button> |
|
|
<a-button type="primary" @click="submitEditData">确定</a-button> |
|
|
</template> |
|
|
</template> |
|
|
</a-drawer> |
|
|
</a-drawer> |
|
|
|
|
|
<!-- 选择因子 --> |
|
|
|
|
|
<a-modal |
|
|
|
|
|
v-model:visible="openVisible" |
|
|
|
|
|
v-if="openVisible" |
|
|
|
|
|
width="60%" |
|
|
|
|
|
title="选择因子" |
|
|
|
|
|
@ok="btnClick" |
|
|
|
|
|
@cancel="onCloseClick"> |
|
|
|
|
|
<ns-view-list-table v-bind="config" ref="setFactorRef" style="height: 500px" /> |
|
|
|
|
|
</a-modal> |
|
|
</div> |
|
|
</div> |
|
|
</template> |
|
|
</template> |
|
|
|
|
|
|
|
@ -464,6 +479,8 @@ |
|
|
import { group } from '/@/api/deviceManage'; |
|
|
import { group } from '/@/api/deviceManage'; |
|
|
import { debug, log } from 'node:console'; |
|
|
import { debug, log } from 'node:console'; |
|
|
import { dict } from '/@/api'; |
|
|
import { dict } from '/@/api'; |
|
|
|
|
|
import { NsMessage } from '/nerv-lib/saas'; |
|
|
|
|
|
import { setFactorConfig } from '../config'; |
|
|
defineOptions({ |
|
|
defineOptions({ |
|
|
energyType: 'fillInPage', // 与页面路由name一致缓存才可生效 |
|
|
energyType: 'fillInPage', // 与页面路由name一致缓存才可生效 |
|
|
components: { |
|
|
components: { |
|
@ -673,12 +690,14 @@ |
|
|
} |
|
|
} |
|
|
}; |
|
|
}; |
|
|
// 获取表头单位 |
|
|
// 获取表头单位 |
|
|
|
|
|
const carbonEmission = ref(); |
|
|
const getTableHeardUnit = (id) => { |
|
|
const getTableHeardUnit = (id) => { |
|
|
fetch(carbonInventoryCheck.findUnitById, { id: id }).then((res) => { |
|
|
fetch(carbonInventoryCheck.findUnitById, { id: id }).then((res) => { |
|
|
if (res.data) { |
|
|
if (res.data) { |
|
|
columns.value[1].title = '消耗量【' + res.data.unit + '】'; |
|
|
columns.value[1].title = '消耗量【' + res.data.unit + '】'; |
|
|
columns.value[2].title = '碳排因子【' + res.data.carbonEmission + '】'; |
|
|
columns.value[2].title = '碳排因子【' + res.data.carbonEmission + '】'; |
|
|
columns.value[3].title = '排放量【' + res.data.carbonUnits + '】'; |
|
|
columns.value[3].title = '排放量【' + res.data.carbonUnits + '】'; |
|
|
|
|
|
carbonEmission.value = res.data.carbonEmission; |
|
|
} |
|
|
} |
|
|
}); |
|
|
}); |
|
|
}; |
|
|
}; |
|
@ -879,6 +898,7 @@ |
|
|
{ |
|
|
{ |
|
|
title: '日期', |
|
|
title: '日期', |
|
|
dataIndex: 'acquisitionDate', |
|
|
dataIndex: 'acquisitionDate', |
|
|
|
|
|
width: 80, |
|
|
key: 'acquisitionDate', |
|
|
key: 'acquisitionDate', |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
@ -887,11 +907,13 @@ |
|
|
{ |
|
|
{ |
|
|
title: '数据来源', |
|
|
title: '数据来源', |
|
|
dataIndex: 'dataSources', |
|
|
dataIndex: 'dataSources', |
|
|
|
|
|
width: 100, |
|
|
key: 'dataSources', |
|
|
key: 'dataSources', |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
title: '数值', |
|
|
title: '数值', |
|
|
dataIndex: 'consumption', |
|
|
dataIndex: 'consumption', |
|
|
|
|
|
width: 100, |
|
|
key: 'consumption', |
|
|
key: 'consumption', |
|
|
}, |
|
|
}, |
|
|
], |
|
|
], |
|
@ -902,11 +924,13 @@ |
|
|
{ |
|
|
{ |
|
|
title: '数据来源', |
|
|
title: '数据来源', |
|
|
dataIndex: 'carbonSource', |
|
|
dataIndex: 'carbonSource', |
|
|
|
|
|
width: 100, |
|
|
key: 'carbonSource', |
|
|
key: 'carbonSource', |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
title: '数值', |
|
|
title: '数值', |
|
|
dataIndex: 'emissionFactors', |
|
|
dataIndex: 'emissionFactors', |
|
|
|
|
|
width: 100, |
|
|
key: 'emissionFactors', |
|
|
key: 'emissionFactors', |
|
|
}, |
|
|
}, |
|
|
], |
|
|
], |
|
@ -914,6 +938,7 @@ |
|
|
{ |
|
|
{ |
|
|
title: '排放量', |
|
|
title: '排放量', |
|
|
dataIndex: 'emissions', |
|
|
dataIndex: 'emissions', |
|
|
|
|
|
width: 100, |
|
|
key: 'emissions', |
|
|
key: 'emissions', |
|
|
fixed: 'right', |
|
|
fixed: 'right', |
|
|
}, |
|
|
}, |
|
@ -1069,12 +1094,23 @@ |
|
|
// 获取能耗类型 |
|
|
// 获取能耗类型 |
|
|
const options = await dict({ params: { dicKey: 'ENERGY_TYPE' } }); |
|
|
const options = await dict({ params: { dicKey: 'ENERGY_TYPE' } }); |
|
|
energyTypeOptions.value = options.data.data; |
|
|
energyTypeOptions.value = options.data.data; |
|
|
editFormState.value.key = record.factorName; |
|
|
editFormState.value.key = record.factorId; |
|
|
searchKey(); |
|
|
searchKey(); |
|
|
editFormState.value.id = record.id; |
|
|
editFormState.value.id = record.id; |
|
|
editFormState.value.dataSources = record.dataSources; |
|
|
editFormState.value.dataSources = record.dataSources; |
|
|
|
|
|
if (record.dataSources !== undefined) { |
|
|
|
|
|
if (record.dataSources.value === 3) { |
|
|
|
|
|
canEdit.value = true; |
|
|
|
|
|
automatic.value = true; |
|
|
|
|
|
} else { |
|
|
|
|
|
canEdit.value = false; |
|
|
|
|
|
automatic.value = false; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
editFormState.value.consumption = record.consumption; |
|
|
editFormState.value.consumption = record.consumption; |
|
|
editFormState.value.collectionNode = record.carbonSource; |
|
|
editFormState.value.energyConsumptionType = record.energyConsumptionType; |
|
|
|
|
|
changeEnergyType(record.energyConsumptionType); |
|
|
|
|
|
editFormState.value.collectionNode = record.collectionNode; |
|
|
editFormState.value.factorId = record.factorId; |
|
|
editFormState.value.factorId = record.factorId; |
|
|
editFormState.value.emissionFactors = record.emissionFactors; |
|
|
editFormState.value.emissionFactors = record.emissionFactors; |
|
|
selectedRowKeysEdit.value = [record.factorId]; |
|
|
selectedRowKeysEdit.value = [record.factorId]; |
|
@ -1097,9 +1133,9 @@ |
|
|
}; |
|
|
}; |
|
|
const searchKey = () => { |
|
|
const searchKey = () => { |
|
|
if (editFormState.value.key) { |
|
|
if (editFormState.value.key) { |
|
|
queryData.value.emissionSources = editFormState.value.key; |
|
|
queryData.value.factorId = editFormState.value.key; |
|
|
} else { |
|
|
} else { |
|
|
queryData.value.emissionSources = ''; |
|
|
queryData.value.factorId = 0; |
|
|
} |
|
|
} |
|
|
getNewTable(); |
|
|
getNewTable(); |
|
|
}; |
|
|
}; |
|
@ -1137,6 +1173,7 @@ |
|
|
}; |
|
|
}; |
|
|
const spinning = ref(false); |
|
|
const spinning = ref(false); |
|
|
const selectNode = (value) => { |
|
|
const selectNode = (value) => { |
|
|
|
|
|
editFormState.value.collectionNode = value; |
|
|
spinning.value = true; |
|
|
spinning.value = true; |
|
|
const getConsumeData = ref({ |
|
|
const getConsumeData = ref({ |
|
|
acquisitionDate: acquisitionDate.value, |
|
|
acquisitionDate: acquisitionDate.value, |
|
@ -1198,9 +1235,9 @@ |
|
|
if (editFormState.value.dataSources.value) { |
|
|
if (editFormState.value.dataSources.value) { |
|
|
editFormState.value.dataSources = editFormState.value.dataSources.value; |
|
|
editFormState.value.dataSources = editFormState.value.dataSources.value; |
|
|
} |
|
|
} |
|
|
if (editFormState.value.collectionNode) { |
|
|
// if (editFormState.value.collectionNode) { |
|
|
editFormState.value.collectionNode = editFormState.value.collectionNode.value; |
|
|
// editFormState.value.collectionNode = editFormState.value.collectionNode.value; |
|
|
} |
|
|
// } |
|
|
fetch(carbonInventoryCheck.updateTable, editFormState.value).then((res) => { |
|
|
fetch(carbonInventoryCheck.updateTable, editFormState.value).then((res) => { |
|
|
if (fileList.value.length !== 0) { |
|
|
if (fileList.value.length !== 0) { |
|
|
const formData = ref(new FormData()); |
|
|
const formData = ref(new FormData()); |
|
@ -1235,6 +1272,32 @@ |
|
|
console.log('error', error); |
|
|
console.log('error', error); |
|
|
}); |
|
|
}); |
|
|
}; |
|
|
}; |
|
|
|
|
|
const openVisible = ref(false); |
|
|
|
|
|
const setFactorRef = ref(); |
|
|
|
|
|
const config = setFactorConfig(orgId.value); |
|
|
|
|
|
const selectFactor = () => { |
|
|
|
|
|
openVisible.value = true; |
|
|
|
|
|
}; |
|
|
|
|
|
const btnClick = () => { |
|
|
|
|
|
let selectRowKeys = setFactorRef.value?.nsTableRef.tableState.selectedRowKeys; |
|
|
|
|
|
if (selectRowKeys.length === 0) { |
|
|
|
|
|
NsMessage.warn('请选择因子'); |
|
|
|
|
|
return; |
|
|
|
|
|
} else { |
|
|
|
|
|
if (newTableData.value.emissionFactorUnits === carbonEmission.value) { |
|
|
|
|
|
newTableData.value = setFactorRef.value?.nsTableRef.tableState.selectedRows; |
|
|
|
|
|
selectedRowKeysEdit.value = setFactorRef.value?.nsTableRef.tableState.selectedRowKeys; |
|
|
|
|
|
editFormState.value.emissionFactors = newTableData.value[0].emissionFactors; |
|
|
|
|
|
editFormState.value.factorId = selectedRowKeysEdit.value[0]; |
|
|
|
|
|
openVisible.value = false; |
|
|
|
|
|
} else { |
|
|
|
|
|
NsMessage.warn('因子值单位不统一,请重新选择!'); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
}; |
|
|
|
|
|
const onCloseClick = () => { |
|
|
|
|
|
openVisible.value = false; |
|
|
|
|
|
}; |
|
|
const onCloseEditData = () => { |
|
|
const onCloseEditData = () => { |
|
|
editData.value = false; |
|
|
editData.value = false; |
|
|
delIds.value = []; |
|
|
delIds.value = []; |
|
@ -1249,7 +1312,7 @@ |
|
|
const onChange = (pageNumber: number, size: number) => { |
|
|
const onChange = (pageNumber: number, size: number) => { |
|
|
queryData.value.pageNum = pageNumber; |
|
|
queryData.value.pageNum = pageNumber; |
|
|
queryData.value.pageSize = size; |
|
|
queryData.value.pageSize = size; |
|
|
getNewTable(); |
|
|
// getNewTable(); |
|
|
}; |
|
|
}; |
|
|
// 点击切换排放统计/碳排流向 |
|
|
// 点击切换排放统计/碳排流向 |
|
|
const fillInPage = ref(true); |
|
|
const fillInPage = ref(true); |
|
@ -1730,9 +1793,11 @@ |
|
|
.mainLeft { |
|
|
.mainLeft { |
|
|
width: 19%; |
|
|
width: 19%; |
|
|
margin-right: 1%; |
|
|
margin-right: 1%; |
|
|
border-right: 1px solid #f2f2f2; |
|
|
|
|
|
position: relative; |
|
|
position: relative; |
|
|
height: 96%; |
|
|
height: 100%; |
|
|
|
|
|
border: 1px solid #f2f2f2; |
|
|
|
|
|
border-radius: 8px; |
|
|
|
|
|
padding: 4px; |
|
|
.treeRow { |
|
|
.treeRow { |
|
|
display: flex; |
|
|
display: flex; |
|
|
justify-content: space-between; |
|
|
justify-content: space-between; |
|
@ -1757,6 +1822,7 @@ |
|
|
} |
|
|
} |
|
|
.mainRight { |
|
|
.mainRight { |
|
|
width: 80%; |
|
|
width: 80%; |
|
|
|
|
|
border-left: 1px solid #f2f2f2; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|