From a876f1bbfd502e514cca49eb6bc061d06c7786a4 Mon Sep 17 00:00:00 2001 From: hongchao <3228015117@qq.com> Date: Tue, 25 Mar 2025 08:49:27 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=93=E7=AE=97=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/cost/cost.js | 14 ++- .../component/finishAndDetails.vue | 25 +++-- .../cost/csotSettlement/costApplyList.vue | 99 +++++++++++++++++-- 3 files changed, 121 insertions(+), 17 deletions(-) diff --git a/src/api/cost/cost.js b/src/api/cost/cost.js index 5ad0b1f..1bceaf3 100644 --- a/src/api/cost/cost.js +++ b/src/api/cost/cost.js @@ -87,7 +87,19 @@ export const costAuditingPassApi = (params) => { params }) } - +/** 获取工程下拉接口*/ +export const getProjectListByUnitIds = (params) => { + return request.get('/material/sltAgreementInfo/getProjectListByUnitIds', { + params + }) +} + +/** 获取单位下拉接口*/ +export const getUnitListByProjetctIds = (params) => { + return request.get('/material/sltAgreementInfo/getUnitListByProjetctIds', { + params + }) +} diff --git a/src/views/cost/csotSettlement/component/finishAndDetails.vue b/src/views/cost/csotSettlement/component/finishAndDetails.vue index 1ec5b02..7cf5da7 100644 --- a/src/views/cost/csotSettlement/component/finishAndDetails.vue +++ b/src/views/cost/csotSettlement/component/finishAndDetails.vue @@ -3,8 +3,8 @@
-
领用单位:{{ currRowInfo.unitName }}
-
工程名称:{{ currRowInfo.projectName }}
+
领用单位:{{ uniqueUnitNames.join(', ') }}
+
工程名称:{{ uniqueProjectNames.join(', ') }}
总合计:{{ totalAmount }}元
确认完工结算 @@ -124,11 +124,19 @@ export default { }, // 当前行的数据信息 currRowInfo: { - type: Object, - default: () => null, + type: Array, + default: () => [], }, }, computed: { + // 计算去重后的领用单位 + uniqueUnitNames() { + return [...new Set(this.currRowInfo.map(item => item.unitName))].filter(name => name); + }, + // 计算去重后的工程名称 + uniqueProjectNames() { + return [...new Set(this.currRowInfo.map(item => item.projectName))].filter(name => name); + }, totalAmount() { return ( this.settleTotalPrice_01 * 1 + @@ -238,9 +246,8 @@ export default { methods: { /** 获取结算信息 */ async getComSellList() { - const { data: res } = await getComSellQueryApi([ - { agreementId: this.currRowInfo.agreementId }, - ]) + console.log("xxxxxxxxxxxxxxxx", this.currRowInfo) + const { data: res } = await getComSellQueryApi(this.currRowInfo) this.settleTableData_01 = res.leaseListOne // 01承担方 this.settleTableData_03 = res.leaseListThree // 03承担方 diff --git a/src/views/cost/csotSettlement/costApplyList.vue b/src/views/cost/csotSettlement/costApplyList.vue index 9c0bfe5..002e551 100644 --- a/src/views/cost/csotSettlement/costApplyList.vue +++ b/src/views/cost/csotSettlement/costApplyList.vue @@ -10,12 +10,15 @@ v-show="showSearch" label-width="80px" > - + 批量导出月结明细表 + 批量结算 @@ -86,7 +98,7 @@ @selection-change="handleSelectionChange" ref="tableRef" > - + import { getUnitList, getProjectList } from '@/api/claimAndRefund/receive' -import { getSltAgreementInfo } from '@/api/cost/cost' +import { getSltAgreementInfo,getProjectListByUnitIds,getUnitListByProjetctIds } from '@/api/cost/cost' import ExportDialog from './component/exportDialog.vue' import MonthRecord from './component/monthRecord.vue' @@ -248,6 +260,8 @@ export default { unitId: '', projectId: '', }, + // 结算单位ids + unitIds: [], // 批量导出月结明细弹框 exportDialogVisible: false, // 月结记录弹框 @@ -255,7 +269,7 @@ export default { // 是否显示主页 isHome: true, // 当前行信息 - currRowInfo: null, + currRowInfo: [], // 页面标题 pageContent: '', // 查询月结记录的参数 @@ -270,6 +284,62 @@ export default { this.getProjectList() }, methods: { + //获取结算单位下的结算工程 + unitChange(val){ + console.log("xxxxxxxxxx",val) + if(val.length==0){ + setTimeout(()=>{ + this.getProjectList() + },500) + return + } + setTimeout(()=>{ + this.queryParams.projectId=null + this.GetProData() + },500) + }, + //获取结算工程下的结算单位 + proChange(val){ + console.log("xxxxxxxxxx",val) + if(!val){ + setTimeout(()=>{ + this.getUnitList() + },500) + return + } + setTimeout(()=>{ + this.GetUnitData() + },500) + }, + + // 获取 工程名称 列表数据 + async GetProData() { + const unitIdsAsNumbers = this.unitIds.map(id => Number(id)); + const params = { + unitIds: unitIdsAsNumbers, + } + const res = await getProjectListByUnitIds(params) + this.projectList = res.data; + + }, + // 获取 单位名称 列表数据 + async GetUnitData() { + + const params = { + projectId: this.queryParams.projectId, + } + const res = await getUnitListByProjetctIds(params) + this.unitList = res.data; + + }, + + selectAble(row) { + if (row.isSlt != 1) { + return true + }else{ + return false + } + }, //获取单位类型 ,getUnitList, getProjectList getUnitList() { getUnitList().then((response) => { @@ -285,7 +355,14 @@ export default { /** 查询字典类型列表 */ getList() { this.loading = true - getSltAgreementInfo(this.queryParams).then((response) => { + const params = { + unitIds: this.unitIds, + projectId: this.queryParams.projectId, + sltStatus: this.queryParams.sltStatus, + pageNum: this.queryParams.pageNum, + pageSize: this.queryParams.pageSize, + } + getSltAgreementInfo(params).then((response) => { this.agreementList = response.rows this.total = response.total this.loading = false @@ -300,6 +377,7 @@ export default { /** 重置按钮操作 */ resetQuery() { this.dateRange = [] + this.unitIds = [] this.resetForm('queryForm') this.handleQuery() }, @@ -332,6 +410,13 @@ export default { this.ids = selection.map((item) => item) }, + // 批量结算 + handleBatchSlt() { + this.currRowInfo = this.ids + this.pageContent = '完工结算' + this.isHome = false + }, + /** 批量导出月结明细表 */ handleBatchExport() { console.log('批量导出月结明细表') @@ -379,7 +464,7 @@ export default { }, /** 完工结算 结算明细*/ handleFinishCostAndDetails(row, isSlt) { - this.currRowInfo = row + this.currRowInfo = [row] // this.pageContent = '结算明细' isSlt == 1 ? (this.pageContent = '结算明细')