From b84e5ae5d2301b3ca4389f9a971ce3ad6e6a4e51 Mon Sep 17 00:00:00 2001
From: BAOLH <baolh@yhzhg.cn>
Date: Wed, 21 May 2025 05:45:30 +0000
Subject: [PATCH] 企微每周报告初版添加
---
eladmin-web-master/src/views/project/project/index.vue | 70 ++++++++++++++++++++++++++++------
1 files changed, 57 insertions(+), 13 deletions(-)
diff --git a/eladmin-web-master/src/views/project/project/index.vue b/eladmin-web-master/src/views/project/project/index.vue
index 878b9e5..dc7af27 100644
--- a/eladmin-web-master/src/views/project/project/index.vue
+++ b/eladmin-web-master/src/views/project/project/index.vue
@@ -109,6 +109,19 @@
>
其他成本
</el-button>
+ <el-button
+ slot="right"
+ v-permission="permission.report"
+ :loading="generateReportParam.loading"
+ class="filter-item"
+ size="mini"
+ type="primary"
+ icon="el-icon-document"
+ style="margin-left: 4px !important;"
+ @click="doGenerateReport()"
+ >
+ 报告生成
+ </el-button>
</crudOperation>
<!--表单组件-->
<el-dialog :close-on-click-modal="false" :before-close="crud.cancelCU" :visible.sync="crud.status.cu > 0" :title="crud.status.title" width="690px">
@@ -419,13 +432,12 @@
import udOperation from '@crud/UD.operation'
import pagination from '@crud/Pagination'
import { mapGetters } from 'vuex'
-import moneyInput from '@/views/assembly/moneyInput/index.vue'
import constant from '@/utils/constant'
const defaultForm = { id: null, name: null, projectTypeId: null, projectDistinguish: null, companyId: null, requirement: null, unitCurrency: null, performanceObjectives: null, quotationPrice: null, performancePrice: null, contractPrice: null, contractPrePrice: null, projectPrice: null, liableUserId: null, liableUserIdList: [], planStartDate: null, planEndDate: null, projectStatus: null, approveStatus: null, remarks: null, createBy: null, createTime: null, updateBy: null, updateTime: null }
export default {
name: 'Project',
- components: { pagination, crudOperation, rrOperation, udOperation, moneyInput },
+ components: { pagination, crudOperation, rrOperation, udOperation },
mixins: [presenter(), header(), form(defaultForm), crud()],
dicts: [constant.STANDARD_UNIT_CURRENCY, constant.PROJECT_DISTINGUISH, constant.PROJECT_STATUS, constant.APPROVE_STATUS],
cruds() {
@@ -442,15 +454,15 @@
callback()
}
}
- // 比例(百内)验证
- var proportionValidate = (rule, value, callback) => {
- const reg = /^([0-9]|[1-9]\d)(\.\d{1,2})?$|100$/
- if (value != null && value !== '' && !reg.test(value)) {
- callback(new Error('请输入 一百 以内的正整数或两位小数'))
- } else {
- callback()
- }
- }
+ // // 比例(百内)验证
+ // var proportionValidate = (rule, value, callback) => {
+ // const reg = /^([0-9]|[1-9]\d)(\.\d{1,2})?$|100$/
+ // if (value != null && value !== '' && !reg.test(value)) {
+ // callback(new Error('请输入 一百 以内的正整数或两位小数'))
+ // } else {
+ // callback()
+ // }
+ // }
return {
permission: {
add: ['admin', 'project:add'],
@@ -460,7 +472,8 @@
admit: ['admin', 'project:admit'],
seeTask: ['admin', 'project:seeTask'],
seeCost: ['admin', 'project:seeCost'],
- master: ['admin', 'project:master']
+ master: ['admin', 'project:master'],
+ report: ['admin', 'project:report']
},
rules: {
name: [
@@ -534,7 +547,11 @@
}
},
// 表单禁用标记(承认状态)
- disabledFlagByApprove: false
+ disabledFlagByApprove: false,
+ // 报告生成参数
+ generateReportParam: {
+ loading: false
+ }
}
},
computed: {
@@ -772,6 +789,33 @@
projectId: data.id
}
})
+ },
+ // 执行报告生成
+ doGenerateReport() {
+ const that = this
+ let projectIds = []
+ if (that.crud.selections.length > 0) {
+ projectIds = that.crud.selections.map(p => p.id)
+ }
+ that.$confirm(
+ projectIds.length > 0 ? '此操作会生成所有选中项目的报告, 是否继续?' : '您未选中项目,本次操作会生成所有未完成项目的报告, 是否继续?',
+ '提示',
+ {
+ confirmButtonText: '确定',
+ cancelButtonText: '取消',
+ type: 'warning'
+ }
+ ).then(() => {
+ that.generateReportParam.loading = true
+ that.crud.crudMethod.generateReport({ idInList: projectIds }).then(() => {
+ that.generateReportParam.loading = false
+ that.$message({ type: 'success', message: '操作成功' })
+ }).catch(() => {
+ that.generateReportParam.loading = false
+ })
+ }).catch(() => {
+ that.$message({ type: 'info', message: '已取消操作' })
+ })
}
}
}
--
Gitblit v1.9.3