From 86db377d296a1386a324081b979935528b6c21d4 Mon Sep 17 00:00:00 2001 From: fks-xuxinyue <2822784518@qq.com> Date: Thu, 18 Jul 2024 15:14:25 +0800 Subject: [PATCH] =?UTF-8?q?taskid=EF=BC=9A099=20remark:"commit"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../carbonEmissions/index.vue | 2 +- .../energyConsumption/index.vue | 32 +++++--- .../quickCalculation/index.vue | 10 +-- .../carbonInventoryCheck/fillInPage/index.vue | 10 +++ .../carbonInventoryCheck/index.vue | 88 +++++++++++++++++++++- 5 files changed, 121 insertions(+), 21 deletions(-) create mode 100644 hx-ai-intelligent/src/view/carbonEmissionManage/carbonInventoryCheck/fillInPage/index.vue diff --git a/hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionStatistics/carbonEmissions/index.vue b/hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionStatistics/carbonEmissions/index.vue index 9298666..d792f11 100644 --- a/hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionStatistics/carbonEmissions/index.vue +++ b/hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionStatistics/carbonEmissions/index.vue @@ -83,7 +83,7 @@ }, { title: '计量单位', - dataIndex: 'unit', + dataIndex: 'unitName', }, { title: '加权平均', 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 33312db..c4a1582 100644 --- a/hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionStatistics/energyConsumption/index.vue +++ b/hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionStatistics/energyConsumption/index.vue @@ -214,7 +214,9 @@ const wrapperCol = { span: 19 }; const switchLabelCol = { span: 10 }; const switchWrapperCol = { span: 14 }; - const formState = ref({}) + const formState = ref({ + orgId: orgId.value, + }) // 定义form表单的必填 const rules: Record = { energyType: [{ required: true, message: '请输入能源种类', trigger: 'change' }], @@ -289,8 +291,8 @@ }, { title: '计量单位', - className: 'unit', - dataIndex: 'unit', + className: 'unitName', + dataIndex: 'unitName', }, { title: '全年', @@ -361,9 +363,9 @@ getDictList() visible.value = true fetch(energyConsumption.findById , {id : record.id }).then((res) => { - if(res.data.unit){ - res.data.unit = res.data.unit.split(',') - } + // if(res.data.unit){ + // res.data.unit = res.data.unit.split(',') + // } formState.value = res.data }); }, @@ -423,12 +425,14 @@ .then(() => { console.log('values', formState, toRaw(formState)); if(formState.value.unit){ - formState.value.unit = formState.value.unit.join(',') + formState.value.unit = formState.value.unit.join(',').split(',')[1] } if(formState.value.id){ fetch(energyConsumption.update , formState.value).then((res) => { visible.value = false - formState.value = {} + formState.value = { + orgId: orgId.value, + } message.success('操作成功!'); mainRef.value?.nsTableRef.reload(); }); @@ -439,7 +443,9 @@ NsMessage.warning(res.data); }else{ visible.value = false - formState.value = {} + formState.value = { + orgId: orgId.value, + } message.success('操作成功!'); mainRef.value?.nsTableRef.reload(); } @@ -491,8 +497,8 @@ getDictList() visible.value = true fetch(energyConsumption.findById , {id : record.id }).then((res) => { - if(res.data.unit){ - res.data.unit = res.data.unit.split(',') + if(res.data.unitName){ + res.data.unitName = res.data.unitName.split(',') } formState.value = res.data }); @@ -519,7 +525,9 @@ // 关闭新增抽屉 const onClose = () => { visible.value = false; - formState.value = {} + formState.value = { + orgId: orgId.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 6f1a5d3..602471f 100644 --- a/hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionStatistics/quickCalculation/index.vue +++ b/hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionStatistics/quickCalculation/index.vue @@ -319,11 +319,11 @@ label: '编辑', name: 'userEdit', handle: (record: any) => { - selectedRowKeys.value = [record.carbonId]; + selectedRowKeys.value = [record.factorId]; formState.value.id = record.id formState.value.emissionFactors = record.emissionFactors formState.value.dateRange = [record.startTime, record.endTime]; - formState.value.carbonId = record.carbonId + formState.value.factorId = record.factorId visible.value = true getNewTable() }, @@ -375,7 +375,7 @@ const onSelectionChange = (selectedKeys, selectedRows) => { selectedRowKeys.value = selectedKeys; formState.value.emissionFactors = selectedRows[0].emissionFactors - formState.value.carbonId = selectedRows[0].id + formState.value.factorId = selectedRows[0].id }; const queryData = ref({ orgId: orgId.value, @@ -390,11 +390,11 @@ }; // 点击编辑按钮 const editData = (record) =>{ - selectedRowKeys.value = [record.carbonId]; + selectedRowKeys.value = [record.factorId]; formState.value.id = record.id formState.value.emissionFactors = record.emissionFactors formState.value.dateRange = [record.startTime, record.endTime]; - formState.value.carbonId = record.carbonId + formState.value.factorId = record.factorId visible.value = true getNewTable() }; diff --git a/hx-ai-intelligent/src/view/carbonEmissionManage/carbonInventoryCheck/fillInPage/index.vue b/hx-ai-intelligent/src/view/carbonEmissionManage/carbonInventoryCheck/fillInPage/index.vue new file mode 100644 index 0000000..eb62cd7 --- /dev/null +++ b/hx-ai-intelligent/src/view/carbonEmissionManage/carbonInventoryCheck/fillInPage/index.vue @@ -0,0 +1,10 @@ + + + + + \ No newline at end of file diff --git a/hx-ai-intelligent/src/view/carbonEmissionManage/carbonInventoryCheck/index.vue b/hx-ai-intelligent/src/view/carbonEmissionManage/carbonInventoryCheck/index.vue index d1a1a77..89ff479 100644 --- a/hx-ai-intelligent/src/view/carbonEmissionManage/carbonInventoryCheck/index.vue +++ b/hx-ai-intelligent/src/view/carbonEmissionManage/carbonInventoryCheck/index.vue @@ -1,8 +1,55 @@ -