|
@@ -1,6 +1,6 @@
|
|
|
<script setup>
|
|
|
import { ref, unref, onMounted } from 'vue';
|
|
|
-import { NDrawer, NDrawerContent, NForm, NSelect, NFormItem, NDatePicker, useMessage, NScrollbar } from 'naive-ui';
|
|
|
+import { NDrawer, NDrawerContent, NForm, NSelect, NFormItem, NDatePicker, useMessage, NScrollbar, NTooltip } from 'naive-ui';
|
|
|
import { SvgIcon, BaseNumberInput } from '@/components';
|
|
|
import { BaseCard, BaseStep, BaseTable, BasePanel } from './index';
|
|
|
import zhCn from 'element-plus/es/locale/lang/zh-cn'
|
|
@@ -29,6 +29,8 @@ const inpConfig = ref(inputConfig);
|
|
|
|
|
|
const spliceInpData = ref([]);
|
|
|
|
|
|
+const today = dayjs();
|
|
|
+const firstDayOfMonth = today.startOf('month');
|
|
|
const elementDatePicker = ref(null);
|
|
|
|
|
|
const formValue = ref({});
|
|
@@ -37,6 +39,7 @@ const selectValue = ref({});
|
|
|
|
|
|
const formRef = ref(null);
|
|
|
const switchCo2State = ref(0);
|
|
|
+const disableEnthalpyValue = ref(false);
|
|
|
const tabCo2Data = ['泵站和沉砂池逸散的CH₄量(实测)', '泵站和沉砂池逸散的CH₄量(未实测)']
|
|
|
|
|
|
const rules = {
|
|
@@ -59,15 +62,19 @@ const rules = {
|
|
|
wsTdN2oCsTn: [{ required: true, type: 'number' }],
|
|
|
|
|
|
nyyjDlxhZhdl: [{ required: true, type: 'number' }],
|
|
|
- nyyjDlxhJsbf: [{ validator: (_, val) => ((formValue.value.nyyjDlxhZhdl && !val) ? new Error() : true) }],
|
|
|
- nyyjDlxhGfjf: [{ validator: (_, val) => ((formValue.value.nyyjDlxhZhdl && !val) ? new Error() : true) }],
|
|
|
- nyyjDlxhTsjf: [{ validator: (_, val) => ((formValue.value.nyyjDlxhZhdl && !val) ? new Error() : true) }],
|
|
|
- nyyjDlxhXdj: [{ validator: (_, val) => ((formValue.value.nyyjDlxhZhdl && !val) ? new Error() : true) }],
|
|
|
- nyyjDlxhSdcl: [{ validator: (_, val) => ((formValue.value.nyyjDlxhZhdl && !val) ? new Error() : true) }],
|
|
|
- nyyjDlxhWncz: [{ validator: (_, val) => ((formValue.value.nyyjDlxhZhdl && !val) ? new Error() : true) }],
|
|
|
- nyyjDlxhShq: [{ validator: (_, val) => ((formValue.value.nyyjDlxhZhdl && !val) ? new Error() : true) }],
|
|
|
- nyyjDlxhQt: [{ validator: (_, val) => ((formValue.value.nyyjDlxhZhdl && !val) ? new Error() : true) }],
|
|
|
-
|
|
|
+ nyyjGrrlZq: [
|
|
|
+ { required: true, type: 'number' }
|
|
|
+ ],
|
|
|
+ nyyjGrrlDyhz: [
|
|
|
+ { validator: (_, val) => {
|
|
|
+ if ( formValue.value.nyyjGrrlZq === 0 ) {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ if (!val && val != 0) {
|
|
|
+ return new Error()
|
|
|
+ }
|
|
|
+ }}
|
|
|
+ ],
|
|
|
wnclYyzqZqcl: [{ validator: (_, val) => (formValue.value.wnclYyzqChZlfs && !val ? new Error() : true) }],
|
|
|
wnclYyzqChZlfs: [{ validator: (_, val) => (formValue.value.wnclYyzqZqcl && !val ? new Error() : true) }],
|
|
|
|
|
@@ -110,6 +117,22 @@ const rules = {
|
|
|
|
|
|
}
|
|
|
|
|
|
+const handleDatePicker = async (month) => {
|
|
|
+ const { data } = await carbonApi.getBaseData(dayjs(month).format('YYYY-MM'));
|
|
|
+
|
|
|
+ const { jsl, jsCod, csCod, jsTn, csTn } = data;
|
|
|
+ formValue.value.wsHsytkhClsl = jsl;
|
|
|
+ formValue.value.wsHsytkhJsCod = jsCod;
|
|
|
+ formValue.value.wsHsytkhCsCod = csCod;
|
|
|
+ formValue.value.wsSjclCh4Clsl = jsl;
|
|
|
+ formValue.value.wsSjclCh4JsCod = jsCod;
|
|
|
+ formValue.value.wsSjclCh4CsCod = csCod;
|
|
|
+
|
|
|
+ formValue.value.wsTdN2oClsl = jsl;
|
|
|
+ formValue.value.wsTdN2oJsTn = jsTn;
|
|
|
+ formValue.value.wsTdN2oCsTn = csTn;
|
|
|
+}
|
|
|
+
|
|
|
const switchTabs = (index) => {
|
|
|
switchCo2State.value = index;
|
|
|
if (index == 1) {
|
|
@@ -172,10 +195,10 @@ const handleAddTableRow = (key) => {
|
|
|
const isExists = ids.includes(codeSet.dictCode);
|
|
|
|
|
|
option = {
|
|
|
- columns: ['燃料名称', '燃料消耗量', '操作'],
|
|
|
+ columns: ['替代的燃料名称', '燃料消耗量', '操作'],
|
|
|
data: [
|
|
|
{ type: 'name', value: codeSet.dictLabel },
|
|
|
- { type: 'input', value: null, unit: isExists ? 'm³/月' : 't/月' },
|
|
|
+ { type: 'input', value: null, unit: isExists ? '万m³/月' : 't/月' },
|
|
|
{ type: 'text' }
|
|
|
],
|
|
|
codeSet,
|
|
@@ -224,10 +247,10 @@ const handleAddTableRow = (key) => {
|
|
|
});
|
|
|
|
|
|
option = {
|
|
|
- columns: ['燃料名称', '热泵供热、供冷量', '操作'],
|
|
|
+ columns: ['替代的燃料名称', '热泵供热、供冷量', '操作'],
|
|
|
data: [
|
|
|
{ type: 'name', value: codeSet.dictLabel },
|
|
|
- { type: 'input', value: null, unit: 'Kg/月' },
|
|
|
+ { type: 'input', value: null, unit: 'KJ/月' },
|
|
|
{ type: 'text' }
|
|
|
],
|
|
|
codeSet,
|
|
@@ -248,7 +271,7 @@ const handleAddTableRow = (key) => {
|
|
|
});
|
|
|
|
|
|
option = {
|
|
|
- columns: ['燃料名称', '污泥厌氧消化沼气发电量', '厌氧消化沼气富余热能用量', '沼气提纯并网的天然气量', '操作'],
|
|
|
+ columns: ['替代的燃料名称', '污泥厌氧消化沼气发电量', '厌氧消化沼气富余热能用量', '沼气提纯并网的天然气量', '操作'],
|
|
|
data: [
|
|
|
{ type: 'name', value: codeSet.dictLabel },
|
|
|
{ type: 'input', value: null, unit: 'kW·h/月' },
|
|
@@ -274,12 +297,13 @@ const handleAddTableRow = (key) => {
|
|
|
});
|
|
|
|
|
|
option = {
|
|
|
- columns: ['燃料名称', '污泥焚烧或热解电力利用量', '污泥焚烧或热解热能利用量', '沼气提纯并网的天然气量', '操作'],
|
|
|
+ // 沼气提纯并网的天然气量
|
|
|
+ columns: ['替代的燃料名称', '污泥焚烧或热解电力利用量', '污泥焚烧或热解热能利用量', '操作'],
|
|
|
data: [
|
|
|
{ type: 'name', value: codeSet.dictLabel },
|
|
|
{ type: 'input', value: null, unit: 'kW·h/月' },
|
|
|
- { type: 'input', value: null, unit: 't/d' },
|
|
|
- { type: 'input', value: null, unit: 'mKJ/Kg' },
|
|
|
+ { type: 'input', value: null, unit: 'GJ/月' },
|
|
|
+ // { type: 'input', value: null, unit: 'mKJ/Kg' },
|
|
|
{ type: 'text' }
|
|
|
],
|
|
|
codeSet,
|
|
@@ -418,24 +442,24 @@ const onReset = () => {
|
|
|
data: [
|
|
|
{ type: 'select', value: '', key: 'wnclBwqrsRslx' },
|
|
|
{ type: 'input', value: null, unit: 't干污泥/月', key: 'wnclBwqrsFsl' },
|
|
|
- { type: 'input', value: null, unit: 'tkg N₂O/t 干污泥', key: 'wnclBwqrsPfyz' }
|
|
|
+ { type: 'input', value: null, unit: 'tkg N₂O/t 干污泥', key: 'wnclBwqrsPfyz', tips: '若无实测,填写0.99' }
|
|
|
]
|
|
|
}
|
|
|
],
|
|
|
mudSecond: [
|
|
|
{
|
|
|
- columns: ['反应堆类型', '污泥热解消耗量', '污泥热解过程N₂O的排放因子'],
|
|
|
+ columns: ['反应堆类型', '污泥热解消耗量'],
|
|
|
data: [
|
|
|
{ type: 'select', value: '', key: 'wnclWnrjQtLx' },
|
|
|
{ type: 'input', value: null, unit: 't干污泥/月', key: 'wnclWnrjQtXhl' },
|
|
|
- { type: 'input', value: null, unit: 'tkg N₂O/t 干污泥', key: 'wnclWnrjQtPfyz' }
|
|
|
+ // { type: 'input', value: null, unit: 'tkg N₂O/t 干污泥', key: 'wnclWnrjQtPfyz' }
|
|
|
]
|
|
|
}
|
|
|
],
|
|
|
carbonFirst: [],
|
|
|
carbonSecond: [
|
|
|
{
|
|
|
- columns: ['水厂规模', '回用水供应量'],
|
|
|
+ columns: ['替代的供水厂规模', '回用水供应量'],
|
|
|
data: [
|
|
|
{ type: 'select', value: '', key: 'thZssScgm' },
|
|
|
{ type: 'input', value: null, unit: 'm³/月', key: '', key: 'thZssGyl' },
|
|
@@ -456,10 +480,14 @@ const onSubmit = (e) => {
|
|
|
return message.error("提交失败, 请检查");
|
|
|
}
|
|
|
const params = formatData();
|
|
|
- await carbonApi.postCarbonSmart(params);
|
|
|
- onReset();
|
|
|
- emit('on-submit');
|
|
|
- message.success("提交成功");
|
|
|
+ try {
|
|
|
+ await carbonApi.postCarbonSmart(params);
|
|
|
+ onReset();
|
|
|
+ emit('on-submit');
|
|
|
+ message.success("提交成功");
|
|
|
+ } catch (e) {
|
|
|
+ message.error(e.msg, { duration: 3500 });
|
|
|
+ }
|
|
|
} else {
|
|
|
message.error("提交失败, 请检查");
|
|
|
}
|
|
@@ -497,22 +525,35 @@ const getAllCodeSet = async () => {
|
|
|
],
|
|
|
scgmOptions: [
|
|
|
{ label: '选择', value: "" },
|
|
|
- { label: '小型', value: 0 },
|
|
|
- { label: '中型', value: 1 },
|
|
|
- { label: '大型', value: 2 }
|
|
|
+ { label: '< 5万,为小型', value: 0 },
|
|
|
+ { label: '5万 ~ 10万,为中型', value: 1 },
|
|
|
+ { label: '>10万,为大型', value: 2 }
|
|
|
]
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
const disabledDate = (t) => {
|
|
|
- return props.allMonth?.includes(dayjs(t).format('YYYY-MM'))
|
|
|
+ console.log( );
|
|
|
+
|
|
|
+ return props.allMonth?.includes(dayjs(t).format('YYYY-MM')) || !dayjs(t).isBefore(firstDayOfMonth)
|
|
|
}
|
|
|
|
|
|
const handleInpFocus = () => {
|
|
|
elementDatePicker.value.focus();
|
|
|
}
|
|
|
|
|
|
+const onInput = ({ value, name }) => {
|
|
|
+ if ( name === 'nyyjGrrlZq' ) {
|
|
|
+ if ( value === 0 ) {
|
|
|
+ formValue.value.nyyjGrrlDyhz = null;
|
|
|
+ disableEnthalpyValue.value = true;
|
|
|
+ } else {
|
|
|
+ disableEnthalpyValue.value = false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
onMounted(async () => {
|
|
|
getAllCodeSet();
|
|
|
})
|
|
@@ -549,7 +590,7 @@ onMounted(async () => {
|
|
|
<el-config-provider :locale="zhCn">
|
|
|
<el-date-picker class="custom-date-picker" v-model="formValue.addYearMonth" type="month"
|
|
|
placeholder="请选择" :teleported="false" ref="elementDatePicker" style="position: absolute;"
|
|
|
- :disabledDate="disabledDate" />
|
|
|
+ :disabledDate="disabledDate" @change="handleDatePicker"/>
|
|
|
</el-config-provider>
|
|
|
</NFormItem>
|
|
|
</div>
|
|
@@ -579,7 +620,7 @@ onMounted(async () => {
|
|
|
@on-remove="(name, index) => removeTable(name, index)"></BaseTable>
|
|
|
</BasePanel>
|
|
|
|
|
|
- <BasePanel isXScroll required title="污水收集提升和处理阶段排放的CH₄的CO₂当量">
|
|
|
+ <BasePanel isXScroll trigger="none" required title="污水收集提升和处理阶段排放的CH₄的CO₂当量">
|
|
|
<template #side>
|
|
|
<ul class="tabs space-x-[12px]">
|
|
|
<li v-for="item, index in tabCo2Data"
|
|
@@ -589,6 +630,19 @@ onMounted(async () => {
|
|
|
</template>
|
|
|
<NFormItem label-placement="top" :label="item.label" :path="item.key"
|
|
|
v-for="item, index in inpConfig.sewage.twoBlock" :key="index">
|
|
|
+ <template #label>
|
|
|
+ <div class="flex items-center space-x-[2px]">
|
|
|
+ <span>{{ item.label }}</span>
|
|
|
+ <span class="w-[14px] h-[14px]" v-if="item.key === 'wsSjclCh4Pfyz'">
|
|
|
+ <NTooltip>
|
|
|
+ <template #trigger>
|
|
|
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 512 512"><path fill="none" d="M240 304h32l6-160h-44l6 160z"></path><path d="M256 48C141.31 48 48 141.31 48 256s93.31 208 208 208s208-93.31 208-208S370.69 48 256 48zm20 319.91h-40v-40h40zM272 304h-32l-6-160h44z" fill="currentColor"></path></svg>
|
|
|
+ </template>
|
|
|
+ <span>若未实测,请填写0.0075</span>
|
|
|
+ </NTooltip>
|
|
|
+ </span>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
<BaseNumberInput :unit="item.unit" v-model:value="formValue[item.key]"></BaseNumberInput>
|
|
|
</NFormItem>
|
|
|
</BasePanel>
|
|
@@ -596,23 +650,51 @@ onMounted(async () => {
|
|
|
<BasePanel isXScroll required title="污水生物处理脱氮过程排放的N₂O的CO₂当量">
|
|
|
<NFormItem label-placement="top" :path="item.key" :label="item.label"
|
|
|
v-for="item, index in inpConfig.sewage.threeBlock" :key="index">
|
|
|
+ <template #label>
|
|
|
+ <div class="flex items-center space-x-[2px]">
|
|
|
+ <span>{{ item.label }}</span>
|
|
|
+ <span class="w-[14px] h-[14px]" v-if="item.key === 'wsTdN2oPfyz'">
|
|
|
+ <NTooltip>
|
|
|
+ <template #trigger>
|
|
|
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 512 512"><path fill="none" d="M240 304h32l6-160h-44l6 160z"></path><path d="M256 48C141.31 48 48 141.31 48 256s93.31 208 208 208s208-93.31 208-208S370.69 48 256 48zm20 319.91h-40v-40h40zM272 304h-32l-6-160h44z" fill="currentColor"></path></svg>
|
|
|
+ </template>
|
|
|
+ <span>若未实测,请填写0.01</span>
|
|
|
+ </NTooltip>
|
|
|
+ </span>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
<BaseNumberInput :unit="item.unit" v-model:value="formValue[item.key]"></BaseNumberInput>
|
|
|
</NFormItem>
|
|
|
</BasePanel>
|
|
|
</BaseCard>
|
|
|
|
|
|
<BaseCard title="能源、药剂碳排" sub-title="能源、药剂碳排">
|
|
|
- <BasePanel isXScroll required title="污水厂电力消耗产生的碳排放量">
|
|
|
+ <BasePanel isXScroll required title="污水厂电力消耗产生的碳排放量" tips="*为必填项,若有各分项电量,请填写,若无,可不填">
|
|
|
<NFormItem label-placement="top" :path="item.key" :label="item.label"
|
|
|
v-for="item, index in inpConfig.energy.oneBlock" :key="index">
|
|
|
+ <template #label>
|
|
|
+ <div class="flex items-center space-x-[2px]">
|
|
|
+ <span>{{ item.label }}</span>
|
|
|
+ <span class="w-[14px] h-[14px]" v-if="item.key === 'nyyjDlxhQt'">
|
|
|
+ <NTooltip>
|
|
|
+ <template #trigger>
|
|
|
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 512 512"><path fill="none" d="M240 304h32l6-160h-44l6 160z"></path><path d="M256 48C141.31 48 48 141.31 48 256s93.31 208 208 208s208-93.31 208-208S370.69 48 256 48zm20 319.91h-40v-40h40zM272 304h-32l-6-160h44z" fill="currentColor"></path></svg>
|
|
|
+ </template>
|
|
|
+ <span>其他耗电量=总耗电量-各分项电量,若分项填写不全,则不填</span>
|
|
|
+ </NTooltip>
|
|
|
+ </span>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
<BaseNumberInput :unit="item.unit" v-model:value="formValue[item.key]"></BaseNumberInput>
|
|
|
</NFormItem>
|
|
|
</BasePanel>
|
|
|
|
|
|
<BasePanel isXScroll required title="净购入热力消耗产生的碳排放量">
|
|
|
- <NFormItem label-placement="top" :path="item.key" :label="item.label"
|
|
|
- v-for="item, index in inpConfig.energy.twoBlock" :key="index" :rule="BASE_RULES">
|
|
|
- <BaseNumberInput :unit="item.unit" v-model:value="formValue[item.key]"></BaseNumberInput>
|
|
|
+ <NFormItem label-placement="top" path="nyyjGrrlZq" label="蒸汽">
|
|
|
+ <BaseNumberInput unit="t/月" v-model:value="formValue.nyyjGrrlZq" @on-input="onInput" name="nyyjGrrlZq"></BaseNumberInput>
|
|
|
+ </NFormItem>
|
|
|
+ <NFormItem label-placement="top" path="nyyjGrrlDyhz" label="对应焓值" required="">
|
|
|
+ <BaseNumberInput unit="KJ/Kg" v-model:value="formValue.nyyjGrrlDyhz" name="nyyjGrrlDyhz" :disabled="disableEnthalpyValue"></BaseNumberInput>
|
|
|
</NFormItem>
|
|
|
</BasePanel>
|
|
|
|
|
@@ -649,7 +731,7 @@ onMounted(async () => {
|
|
|
|
|
|
</BaseCard>
|
|
|
|
|
|
- <BaseCard title="污泥处理" sub-title="生化反应总碳排">
|
|
|
+ <BaseCard title="污泥处理" sub-title="生化反应总碳排" tips="污泥处理生化反应总碳排模块中,企业涉及的过程对应填写相应数据,不涉及的不填写">
|
|
|
<BasePanel isXScroll title="污泥厌氧消化沼气收集管路无意泄露的CH₄或沼气火炬燃烧不充分导致的碳排放">
|
|
|
<NFormItem label-placement="top" :path="item.key" :label="item.label"
|
|
|
v-for="item, index in inpConfig.sludge.oneBlock" :key="index" required>
|
|
@@ -660,6 +742,19 @@ onMounted(async () => {
|
|
|
<BasePanel isXScroll title="单独处理污泥厌氧消化过程产生的碳排放量">
|
|
|
<NFormItem label-placement="top" :path="item.key" :label="item.label"
|
|
|
v-for="item, index in inpConfig.sludge.twoBlock" :key="index">
|
|
|
+ <template #label>
|
|
|
+ <div class="flex items-center space-x-[2px]">
|
|
|
+ <span>{{ item.label }}</span>
|
|
|
+ <span class="w-[14px] h-[14px]" v-if="item.key === 'wnclDdclPfyz'">
|
|
|
+ <NTooltip>
|
|
|
+ <template #trigger>
|
|
|
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 512 512"><path fill="none" d="M240 304h32l6-160h-44l6 160z"></path><path d="M256 48C141.31 48 48 141.31 48 256s93.31 208 208 208s208-93.31 208-208S370.69 48 256 48zm20 319.91h-40v-40h40zM272 304h-32l-6-160h44z" fill="currentColor"></path></svg>
|
|
|
+ </template>
|
|
|
+ <span>若未实测,请填写0.01</span>
|
|
|
+ </NTooltip>
|
|
|
+ </span>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
<BaseNumberInput :unit="item.unit" v-model:value="formValue[item.key]"></BaseNumberInput>
|
|
|
</NFormItem>
|
|
|
</BasePanel>
|
|
@@ -697,7 +792,7 @@ onMounted(async () => {
|
|
|
</BasePanel>
|
|
|
</BaseCard>
|
|
|
|
|
|
- <BaseCard title="替碳、碳汇" sub-title="替碳、碳汇基础信息填写">
|
|
|
+ <BaseCard title="替碳、碳汇" sub-title="替碳、碳汇基础信息填写" tips="替碳、碳汇模块中,企业涉及的过程对应填写相应数据,不涉及的不填写">
|
|
|
<BasePanel title="热泵技术-替碳量">
|
|
|
<template #side>
|
|
|
<div class="flex items-center space-x-[14px]">
|