From 942a56e7d50731063c3b466e7c11e786b36f794d Mon Sep 17 00:00:00 2001 From: zhaoxiao Date: Mon, 11 Oct 2021 17:54:44 +0800 Subject: [PATCH] =?UTF-8?q?bug=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/incomePaymentsApi.js | 3 + .../businessManagement/BusinessManagement.vue | 104 ++++++++++++++++-- .../modules/BusinessManagementModule.vue | 4 +- .../WorkingGroupProjectDataMaintenance.vue | 2 +- .../modules/WorkingGroupProjectModule.vue | 3 + src/views/user/alteration/Alteration.vue | 18 +-- 6 files changed, 116 insertions(+), 18 deletions(-) diff --git a/src/api/incomePaymentsApi.js b/src/api/incomePaymentsApi.js index 7c7bf1f..22e38ae 100644 --- a/src/api/incomePaymentsApi.js +++ b/src/api/incomePaymentsApi.js @@ -52,6 +52,8 @@ const removePackProject = (param) => postAction('/pack/payPackCompanyProject/rem const batchRemovePackProject = (param) => postAction('/pack/payPackCompanyProject/removeBatch', param) // 企业管理审核 const aduitCompany = (param) => getAction('/company/payCompanyManagement/audit', param) +// 企业管理删除确认是否有联系人 +const checkContactByCompany = (param) => getAction('/company/payCompanyManagement/queryCompanyByIdFindContacts', param) // 资料分发 const distribute = (param) => postAction('/project/payWorkingGroupDistributionRecord/add', param) // 资料批量分发 @@ -100,6 +102,7 @@ export { removePackProject, batchRemovePackProject, aduitCompany, + checkContactByCompany, distribute, batchDistribute, distributeMemberList, diff --git a/src/views/businessManagement/BusinessManagement.vue b/src/views/businessManagement/BusinessManagement.vue index 183331a..40a7ac2 100644 --- a/src/views/businessManagement/BusinessManagement.vue +++ b/src/views/businessManagement/BusinessManagement.vue @@ -34,8 +34,11 @@ @change="handleImportExcel" v-has="'company:import'"> 导入 - 导出 - 下载模板 + 导出 + + + 下载模板 + 批量删除 @@ -61,9 +64,10 @@ - 确认 + 确认 编辑 - 删除 + 删除 @@ -78,7 +82,8 @@ import JEllipsis from '@comp/jero/JEllipsis' import BusinessManagementModule from './modules/BusinessManagementModule' import PageHeaderTitle from '@comp/layouts/PageHeaderTitle' import IconImg from '@/assets/imgs/icon/icon_company_management.png' -import { aduitCompany } from '../../api/incomePaymentsApi' +import { aduitCompany, checkContactByCompany } from '../../api/incomePaymentsApi' +import { getAction } from '../../api/manage' export default { name: 'BusinessManagement', @@ -177,9 +182,9 @@ export default { const that = this this.$confirm({ title: '确认', - content: '确认该单位信息吗?', + content: '确认该单位/开票信息吗?', onOk: function () { - aduitCompany({id: id}).then((res) => { + aduitCompany({ id: id }).then((res) => { if (res.success) { that.$message.success(res.result) that.loadData() @@ -189,6 +194,91 @@ export default { }) } }) + }, + /** + * 单个删除的确认 + * @param record + */ + confirmDelete(record) { + const that = this + checkContactByCompany({ id: record.id }).then((res) => { + if (res.success) { + let confirmContent = '确定要删除该企业吗?' + if (res.result && res.result.length > 0) { + confirmContent = `${ res.result.join(',').toString() }下有联系人,确定要删除该企业吗?` + } + this.$confirm({ + title: '确认删除', + content: confirmContent, + onOk: function () { + getAction(that.url.delete, { id: record.id }).then((res) => { + if (res.success) { + that.$message.success(res.message) + // 判断当前删除的数据是否是最后一页的最后一条数据,如果是的话页码减一 + if (that.ipagination.current > 1 && ((that.ipagination.current - 1) * that.ipagination.pageSize) + 1 === that.ipagination.total) { + that.ipagination.current -= 1 + } + that.loadData() + } else { + that.$message.warning(res.message) + } + }) + } + }) + } else { + that.$message.warning(res.message) + } + }) + }, + batchDel() { + if (!this.url.deleteBatch) { + this.$message.error('请设置url.deleteBatch属性!') + return + } + if (this.selectedRowKeys.length <= 0) { + this.$message.warning('请选择一条记录!') + return + } else { + let ids = '' + for (let a = 0; a < this.selectedRowKeys.length; a++) { + ids += this.selectedRowKeys[a] + ',' + } + checkContactByCompany({ id: ids }).then((res) => { + if (res.success) { + let confirmContent = '是否删除选中数据?' + if (res.result && res.result.length > 0) { + confirmContent = `${res.result.join(',').toString()}下有联系人,确定要删除选中企业吗?` + } + const that = this + this.$confirm({ + title: '确认删除', + content: confirmContent, + onOk: function () { + that.loading = true + getAction(that.url.deleteBatch, { ids: ids }).then((res) => { + if (res.success) { + that.$message.success(res.message) + // 判断当前删除的数据是否是最后一页的全部数据,如果是的话页码减一 + if (that.ipagination.current > 1 && (that.ipagination.current === Math.ceil(that.ipagination.total / that.ipagination.pageSize)) && + that.selectedRowKeys.length === that.dataSource.length + ) { + that.ipagination.current -= 1 + } + that.loadData() + that.onClearSelected() + } else { + that.$message.warning(res.message) + } + }).finally(() => { + that.loading = false + }) + } + }) + } else { + this.$message.warning(res.message) + } + }) + } } } } diff --git a/src/views/businessManagement/modules/BusinessManagementModule.vue b/src/views/businessManagement/modules/BusinessManagementModule.vue index 1b164b5..1e09566 100644 --- a/src/views/businessManagement/modules/BusinessManagementModule.vue +++ b/src/views/businessManagement/modules/BusinessManagementModule.vue @@ -23,7 +23,7 @@ @@ -258,7 +258,7 @@ export default { if (phoneReg(value) || isPhone(value)) { callback() } else { - callback('请填写正确的电话号码') + callback('请输入正确的电话号码') } return } diff --git a/src/views/projectManagement/WorkingGroupProjectDataMaintenance.vue b/src/views/projectManagement/WorkingGroupProjectDataMaintenance.vue index a94dd19..1ff8123 100644 --- a/src/views/projectManagement/WorkingGroupProjectDataMaintenance.vue +++ b/src/views/projectManagement/WorkingGroupProjectDataMaintenance.vue @@ -8,7 +8,7 @@ - + diff --git a/src/views/projectManagement/modules/WorkingGroupProjectModule.vue b/src/views/projectManagement/modules/WorkingGroupProjectModule.vue index d71ee40..ea9445d 100644 --- a/src/views/projectManagement/modules/WorkingGroupProjectModule.vue +++ b/src/views/projectManagement/modules/WorkingGroupProjectModule.vue @@ -251,6 +251,9 @@ export default { this.visible = true this.$nextTick(() => { this.form.setFieldsValue(pick(this.model, 'workingGroupProject', 'year', 'principalIdA', 'principalIdB', 'convokeNum', 'operationCycle', 'yearChargeA', 'chargeNoticeNoA', 'chargeNoticeAId', 'yearChargeB', 'chargeNoticeNoB', 'chargeNoticeBId', 'missionAndObjectives', 'remarks')) + if (!this.model.id) { + this.form.setFieldsValue({'year': (new Date().getFullYear()).toString()}) + } }) }, close() { diff --git a/src/views/user/alteration/Alteration.vue b/src/views/user/alteration/Alteration.vue index 9be4947..10e84fc 100644 --- a/src/views/user/alteration/Alteration.vue +++ b/src/views/user/alteration/Alteration.vue @@ -19,7 +19,7 @@ > @@ -35,7 +35,7 @@ > @@ -50,7 +50,7 @@ :labelCol="{span: 5}" :wrapperCol="{span: 19}"> @@ -72,7 +72,7 @@ :wrapperCol="{span: 19}"> @@ -89,7 +89,7 @@ :wrapperCol="{span: 19}"> @@ -134,7 +134,9 @@ export default { }, phone: { rules: [ - { required: true, message: '请输入手机号码!' }, { validator: this.validatePhone }], + { required: true, message: '请输入手机号码!' }, + { validator: this.validatePhone } + ], validateTrigger: 'blur' }, verifyCode: { @@ -242,7 +244,7 @@ export default { if (!err) { const hide = this.$message.loading('验证码发送中..', 0) let smsParams = { - phone: phone, + phone: phone } getAction('/sys/sendVerificationCode', smsParams).then(res => { if (!res.success) { @@ -279,7 +281,7 @@ export default { // 密码禁止粘贴 handleOperate() { return false - }, + } } }