|
@ -20,8 +20,7 @@ |
|
|
:model="formState" |
|
|
:model="formState" |
|
|
:rules="rules" |
|
|
:rules="rules" |
|
|
:label-col="labelCol" |
|
|
:label-col="labelCol" |
|
|
:wrapper-col="wrapperCol" |
|
|
:wrapper-col="wrapperCol"> |
|
|
> |
|
|
|
|
|
<a-form-item ref="name" label="报告名称" name="reportName"> |
|
|
<a-form-item ref="name" label="报告名称" name="reportName"> |
|
|
<a-input v-model:value="formState.reportName" placeholder="请输入报告名称" /> |
|
|
<a-input v-model:value="formState.reportName" placeholder="请输入报告名称" /> |
|
|
</a-form-item> |
|
|
</a-form-item> |
|
@ -38,7 +37,10 @@ |
|
|
</a-select> |
|
|
</a-select> |
|
|
</a-form-item> |
|
|
</a-form-item> |
|
|
<a-form-item ref="name" label="报告范围" name="reportScope"> |
|
|
<a-form-item ref="name" label="报告范围" name="reportScope"> |
|
|
<a-range-picker v-model:value="formState.reportScope" picker="month" valueFormat="YYYY-MM" /> |
|
|
<a-range-picker |
|
|
|
|
|
v-model:value="formState.reportScope" |
|
|
|
|
|
picker="month" |
|
|
|
|
|
valueFormat="YYYY-MM" /> |
|
|
</a-form-item> |
|
|
</a-form-item> |
|
|
</a-form> |
|
|
</a-form> |
|
|
<template #footer> |
|
|
<template #footer> |
|
@ -49,7 +51,7 @@ |
|
|
</template> |
|
|
</template> |
|
|
|
|
|
|
|
|
<script lang="ts" setup> |
|
|
<script lang="ts" setup> |
|
|
import { ref,toRaw } from 'vue'; |
|
|
import { ref, toRaw } from 'vue'; |
|
|
import { http } from '/nerv-lib/util/http'; |
|
|
import { http } from '/nerv-lib/util/http'; |
|
|
import { carbonInventoryCheck } from '/@/api/carbonEmissionFactorLibrary'; |
|
|
import { carbonInventoryCheck } from '/@/api/carbonEmissionFactorLibrary'; |
|
|
import fillIn from './fillInPage/index.vue'; |
|
|
import fillIn from './fillInPage/index.vue'; |
|
@ -65,7 +67,7 @@ |
|
|
const fillInPage = ref(false); |
|
|
const fillInPage = ref(false); |
|
|
// 新增相关数据 |
|
|
// 新增相关数据 |
|
|
const visible = ref(false); |
|
|
const visible = ref(false); |
|
|
const formState = ref({}) |
|
|
const formState = ref({}); |
|
|
const formRef = ref(); |
|
|
const formRef = ref(); |
|
|
const labelCol = { span: 5 }; |
|
|
const labelCol = { span: 5 }; |
|
|
const wrapperCol = { span: 19 }; |
|
|
const wrapperCol = { span: 19 }; |
|
@ -80,7 +82,7 @@ |
|
|
// 关闭新增抽屉 |
|
|
// 关闭新增抽屉 |
|
|
const onClose = () => { |
|
|
const onClose = () => { |
|
|
visible.value = false; |
|
|
visible.value = false; |
|
|
formState.value = {} |
|
|
formState.value = {}; |
|
|
formRef.value.resetFields(); |
|
|
formRef.value.resetFields(); |
|
|
}; |
|
|
}; |
|
|
// 点击确定提交 |
|
|
// 点击确定提交 |
|
@ -89,15 +91,15 @@ |
|
|
.validate() |
|
|
.validate() |
|
|
.then(() => { |
|
|
.then(() => { |
|
|
console.log('values', formState, toRaw(formState)); |
|
|
console.log('values', formState, toRaw(formState)); |
|
|
formState.value.enterpriseOrgId = orgId.value |
|
|
formState.value.enterpriseOrgId = orgId.value; |
|
|
formState.value.startTime = formState.value.reportScope[0] |
|
|
formState.value.startTime = formState.value.reportScope[0]; |
|
|
formState.value.endTime = formState.value.reportScope[1] |
|
|
formState.value.endTime = formState.value.reportScope[1]; |
|
|
fetch(carbonInventoryCheck.createOrUpdate,formState.value).then((res) => { |
|
|
fetch(carbonInventoryCheck.createOrUpdate, formState.value).then((res) => { |
|
|
visible.value = false |
|
|
visible.value = false; |
|
|
mainRef.value?.nsTableRef.reload(); |
|
|
mainRef.value?.nsTableRef.reload(); |
|
|
}); |
|
|
}); |
|
|
}) |
|
|
}) |
|
|
.catch(error => { |
|
|
.catch((error) => { |
|
|
console.log('error', error); |
|
|
console.log('error', error); |
|
|
}); |
|
|
}); |
|
|
}; |
|
|
}; |
|
@ -110,7 +112,7 @@ |
|
|
title: '数据库', |
|
|
title: '数据库', |
|
|
api: carbonInventoryCheck.carbonInventoryList, |
|
|
api: carbonInventoryCheck.carbonInventoryList, |
|
|
params: { |
|
|
params: { |
|
|
orgId |
|
|
orgId, |
|
|
}, |
|
|
}, |
|
|
headerActions: [ |
|
|
headerActions: [ |
|
|
{ |
|
|
{ |
|
@ -118,7 +120,7 @@ |
|
|
name: 'userAdd', |
|
|
name: 'userAdd', |
|
|
type: 'primary', |
|
|
type: 'primary', |
|
|
handle: () => { |
|
|
handle: () => { |
|
|
visible.value = true |
|
|
visible.value = true; |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
], |
|
|
], |
|
@ -161,10 +163,10 @@ |
|
|
label: '编辑', |
|
|
label: '编辑', |
|
|
name: 'userEdit', |
|
|
name: 'userEdit', |
|
|
handle: (record: any) => { |
|
|
handle: (record: any) => { |
|
|
visible.value = true |
|
|
visible.value = true; |
|
|
fetch(carbonInventoryCheck.findById,{id:record.id}).then((res) => { |
|
|
fetch(carbonInventoryCheck.findById, { id: record.id }).then((res) => { |
|
|
formState.value = res.data |
|
|
formState.value = res.data; |
|
|
formState.value.reportScope = [res.data.startTime,res.data.endTime] |
|
|
formState.value.reportScope = [res.data.startTime, res.data.endTime]; |
|
|
}); |
|
|
}); |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
}, |
|
@ -172,17 +174,16 @@ |
|
|
label: '填报', |
|
|
label: '填报', |
|
|
name: 'fillIn', |
|
|
name: 'fillIn', |
|
|
handle: (record: any) => { |
|
|
handle: (record: any) => { |
|
|
isMainPage.value = false |
|
|
isMainPage.value = false; |
|
|
fillInPage.value = true |
|
|
fillInPage.value = true; |
|
|
reportId.value = record.id |
|
|
reportId.value = record.id; |
|
|
year.value = record.reportYear |
|
|
year.value = record.reportYear; |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
label: '下载', |
|
|
label: '下载', |
|
|
name: 'download', |
|
|
name: 'download', |
|
|
handle: (record: any) => { |
|
|
handle: (record: any) => {}, |
|
|
}, |
|
|
|
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
label: '删除', |
|
|
label: '删除', |
|
@ -213,7 +214,7 @@ |
|
|
componentProps: { |
|
|
componentProps: { |
|
|
valueFormat: 'YYYY', |
|
|
valueFormat: 'YYYY', |
|
|
placeholder: ['报告年度', '报告年度'], |
|
|
placeholder: ['报告年度', '报告年度'], |
|
|
picker:"year" |
|
|
picker: 'year', |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
], |
|
|
], |
|
@ -222,12 +223,10 @@ |
|
|
rowKey: 'id', |
|
|
rowKey: 'id', |
|
|
}); |
|
|
}); |
|
|
// 填报页点击返回 |
|
|
// 填报页点击返回 |
|
|
const updateData = (newDataOne,newDataTwo) => { |
|
|
const updateData = (newDataOne, newDataTwo) => { |
|
|
isMainPage.value = newDataOne |
|
|
isMainPage.value = newDataOne; |
|
|
fillInPage.value = newDataTwo |
|
|
fillInPage.value = newDataTwo; |
|
|
}; |
|
|
}; |
|
|
</script> |
|
|
</script> |
|
|
|
|
|
|
|
|
<style lang="less" scoped> |
|
|
<style lang="less" scoped></style> |
|
|
|
|
|
|
|
|
</style> |
|
|
|
|
|