diff --git a/src/views/comprehensive/components/添加或修改年报修改授权.vue b/src/views/comprehensive/components/添加或修改年报修改授权.vue
index 972606b..ca1051e 100644
--- a/src/views/comprehensive/components/添加或修改年报修改授权.vue
+++ b/src/views/comprehensive/components/添加或修改年报修改授权.vue
@@ -35,15 +35,22 @@
/>
-
+
- 添加
+ 添加
重置
- 修改
+ 修改
取消
@@ -57,6 +64,7 @@ import { anModifyUpdata, anModifySave, anModifyGet } from '@/api/年报授权修
export default {
data() {
return {
+ isSubmitting: false, // 新增状态变量
dataId: '',
title: '',
dialogVisible: false,
@@ -98,24 +106,41 @@ export default {
},
methods: {
submitForm(formName) {
+ // 防止重复提交
+ if (this.isSubmitting) {
+ this.$message.warning('正在提交中,请勿重复点击!')
+ return
+ }
+
this.$refs[formName].validate((valid) => {
if (valid) {
+ this.isSubmitting = true // 开始提交,禁用按钮
+
const api = this.title === '添加' ? anModifySave : anModifyUpdata
const submitForm = {
...this.ruleForm,
begintime: this.ruleForm.timeStamp[0],
endtime: this.ruleForm.timeStamp[1]
}
- api(submitForm).then(res => {
- if (res.code === 0) {
- this.dialogVisible = false
- this.$message({
- message: this.title + '成功!',
- type: 'success'
- })
- this.$emit('refreshList')
- }
- })
+
+ api(submitForm)
+ .then(res => {
+ if (res.code === 0) {
+ this.dialogVisible = false
+ this.$message({
+ message: this.title + '成功!',
+ type: 'success'
+ })
+ this.$emit('refreshList')
+ }
+ })
+ .catch(err => {
+ console.error('提交失败:', err)
+ this.$message.error('提交失败,请稍后重试!')
+ })
+ .finally(() => {
+ this.isSubmitting = false // 提交完成,恢复按钮状态
+ })
} else {
console.log('error submit!!')
return false
@@ -125,10 +150,21 @@ export default {
resetForm(formName) {
this.$refs[formName].resetFields()
},
- generateYearList(endYear = new Date().getFullYear()) {
+ generateYearList() {
+ const currentDate = new Date()
+ const currentYear = currentDate.getFullYear()
+ const currentMonth = currentDate.getMonth() + 1 // 月份从 0 开始,需要加 1
+
this.ancheyearOptions = []
- const startYear = 2013
- for (let year = startYear; year <= endYear; year++) {
+ // 判断是否包含当前年份
+ const includeCurrentYear = currentMonth >= 7
+ // 计算起始年份
+ const startYear = currentYear - 2
+ // 生成年份选项
+ for (let year = startYear; year <= currentYear; year++) {
+ if ((year >= currentYear - 1) && !includeCurrentYear) {
+ continue // 排除当前年份(如果不符合条件)
+ }
this.ancheyearOptions.push({ value: year, label: year + '年' })
}
},
diff --git a/src/views/comprehensive/年报修改授权.vue b/src/views/comprehensive/年报修改授权.vue
index 8fe1358..0d4a19c 100644
--- a/src/views/comprehensive/年报修改授权.vue
+++ b/src/views/comprehensive/年报修改授权.vue
@@ -2,7 +2,7 @@
-
+
@@ -10,7 +10,7 @@
-
+
查询
@@ -23,9 +23,7 @@
{
- this.$refs.AddOrEditAuthorizateAnnualReport?.openDialog()
- }"
+ @click="handleAddClick"
>添加
@@ -54,7 +52,7 @@
- 修改
+ 修改
删除
@@ -83,6 +81,7 @@