| | |
| | | > |
| | | 其他成本 |
| | | </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"> |
| | |
| | | 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() { |
| | |
| | | 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'], |
| | |
| | | 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: [ |
| | |
| | | } |
| | | }, |
| | | // 表单禁用标记(承认状态) |
| | | disabledFlagByApprove: false |
| | | disabledFlagByApprove: false, |
| | | // 报告生成参数 |
| | | generateReportParam: { |
| | | loading: false |
| | | } |
| | | } |
| | | }, |
| | | computed: { |
| | |
| | | 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: '已取消操作' }) |
| | | }) |
| | | } |
| | | } |
| | | } |