diff --git a/src/views/financialManagement/arriveAndInvoicing/modules/InvoicingStageModule.vue b/src/views/financialManagement/arriveAndInvoicing/modules/InvoicingStageModule.vue index 0777273..2074113 100644 --- a/src/views/financialManagement/arriveAndInvoicing/modules/InvoicingStageModule.vue +++ b/src/views/financialManagement/arriveAndInvoicing/modules/InvoicingStageModule.vue @@ -9,50 +9,51 @@ @cancel="handleCancel" cancelText="关闭"> -
-
-
第{{ item.chinaNumIndex }}阶段
- + + - - @@ -72,9 +73,7 @@ import { payBillList } from '../../../../api/incomePaymentsApi' export default { name: 'InvoicingStageModule', components: { InvoicingModule }, - provide: { - - }, + provide: {}, props: { // 项目id projectId: { @@ -104,7 +103,7 @@ export default { // 弹窗显示时获取数据 visible: { handler(value) { - if(value) { + if (value) { this.open() } } @@ -175,7 +174,7 @@ export default { //将【一十】换成【十】 result = result.replace(/^一十/g, '十') return result - }, + } } } diff --git a/src/views/packManagement/PackProjectMaintenance.vue b/src/views/packManagement/PackProjectMaintenance.vue index 0341715..3f31414 100644 --- a/src/views/packManagement/PackProjectMaintenance.vue +++ b/src/views/packManagement/PackProjectMaintenance.vue @@ -108,9 +108,9 @@ - 来款 + 来款 取消打包 - 开票 + 开票
@@ -118,17 +118,40 @@ - + + - + + - + + - + + - +
@@ -293,6 +316,15 @@ export default { ], disableMixinCreated: true, selectPackProjectVisible: false, + selectedProject: [], // 选中的项目 + batchInvoicingVisible: false, // 批量开票对话框开启状态 + incomeVisible: false, // 批量来款对话框开启状态 + arriveStageVisible: false, // 来款阶段对话框开启状态 + invoicingStageVisible: false, // 开票阶段对话框开启状态 + selectProjectId: null, // 选中项目id + selectProjectType: null, // 选中项目类型 + selectProjectName: null, // 选中项目名称 + selectProjectChargeCompanyName: null, // 选中项目来款企业 url: { list: '/pack/payPackCompanyProject/listAll', exportXlsUrl: '/pack/payPackCompanyProject/exportXls' @@ -369,22 +401,39 @@ export default { * 批量来款 */ batchIncomePayment() { - this.$refs.batchIncomePaymentModal.open() + this.selectedProject = [] + if (this.selectedRowKeys.length === 0) { + this.$message.warn('请选择至少一个项目') + return + } + this.getProjectListBySelectedKeys(this.selectedRowKeys, 'incomePayment').then(res => { + this.selectedProject = res + this.incomeVisible = true + }).catch(message => { + this.$message.warn(message) + }).finally(() => { + this.onClearSelected() + }) }, /** * 批量开票 */ batchInvoicing() { - this.$refs.batchInvoicingModal.open() - }, - /** - * 来款 - * @param id - */ - incomePayment(id) { - console.log(id) - this.$refs.arriveStage.open() + this.selectedProject = [] + if (this.selectedRowKeys.length === 0) { + this.$message.warn('请选择至少一个项目') + return + } + this.getProjectListBySelectedKeys(this.selectedRowKeys, 'invoic').then(res => { + this.selectedProject = res + this.batchInvoicingVisible = true + }).catch((message) => { + this.$message.warn(message) + }).finally(() => { + this.onClearSelected() + }) }, + /** * 取消打包 * @param id @@ -416,12 +465,51 @@ export default { }) }, /** - * 开票 - * @param id + * 来款 + * @param record */ - invoicing(id) { - console.log(id) - this.$refs.invoicingStage.open() + incomePayment(record) { + this.selectProjectId = record.id + this.arriveStageVisible = true + }, + /** + * 开票 + * @param record + */ + invoicing(record) { + console.log(record) + this.selectProjectName = record.chargeProject + this.selectProjectId = record.id + this.selectProjectType = record.projectType + this.selectProjectChargeCompanyName = this.companyDataById.companyTemporaryName + this.invoicingStageVisible = true + }, + /** + * 通过选中项目id获取数据,并进行相应提示 + * @param selectedKeys + * @param operateType + * @returns {Promise} + */ + getProjectListBySelectedKeys(selectedKeys, operateType) { + return new Promise((resolve, reject) => { + let arr = [] + arr = this.dataSource.filter(tt => selectedKeys.indexOf(tt.id) > -1) + // 开票 + if (operateType === 'invoic') { + // 是否存在不需要发票的项目 + if (arr.some(item => item.needInvoice === 0 || Number(item.receivableAmount) === 0)){ + reject('存在不需要发票的项目!') + } + } + // 来款 + if (operateType === 'incomePayment') { + // 是否存在应收金额为0的项目 + if (arr.some(item => Number(item.receivableAmount) === 0)) { + reject('存在应收金额为0的项目!') + } + } + resolve(arr) + }) } } } diff --git a/src/views/packManagement/modules/BatchIncomePaymentModule.vue b/src/views/packManagement/modules/BatchIncomePaymentModule.vue index dfbae9b..7d3f83b 100644 --- a/src/views/packManagement/modules/BatchIncomePaymentModule.vue +++ b/src/views/packManagement/modules/BatchIncomePaymentModule.vue @@ -42,12 +42,7 @@ bordered rowKey="id" :columns="columns" - :dataSource="dataSource" - :pagination="ipagination" - :loading="loading" - :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" - @change="handleTableChange" class="j-table-force-nowrap"> @@ -68,19 +63,36 @@