diff --git a/src/views/material/back/component/addReturn.vue b/src/views/material/back/component/addReturn.vue index ee16cbd1..d6c3a052 100644 --- a/src/views/material/back/component/addReturn.vue +++ b/src/views/material/back/component/addReturn.vue @@ -766,7 +766,8 @@ export default { maTypeName: parents[parents.length - 1] || '', unitName: node.unitName, unitValue: node.unitValue, - manageType: node.manageType + manageType: node.manageType, + isAlert: node.isAlert, }) } @@ -809,7 +810,14 @@ export default { this.$message.error('所选物资规格类型暂时无出库,无法申请!') this.tempDeviceType = this.tempDeviceType.filter(id => id !== lastSelected) } else { - console.log(typeData) + console.log('xxxxxxxxxxxxxxxxxx',typeData) + if(typeData.isAlert){ + this.$message({ + message: '当前工器具仍有班组在用,请核实退料单位', + type: 'warning' + }) + + } // 将新项添加到数组开头,实现倒序 this.equipmentList.unshift({ ...typeData, @@ -822,10 +830,12 @@ export default { bmFileInfos: [] }) this.deviceType.push(lastSelected) - this.$message({ - message: `已添加 ${typeData.typeName}`, - type: 'success' - }) + if(!typeData.isAlert){ + this.$message({ + message: `已添加 ${typeData.typeName}`, + type: 'success' + }) + } } } @@ -1193,7 +1203,22 @@ export default { this.open = true }, codeSelectionChange(selection) { + console.log('yyyyyyyyyyyyyyyy',selection) if (!this.open) return + // 检查新选中的行是否有isActive为true的情况 + const previousSelectionIds = new Set(this.maCodeList.map(item => item.maId)) + console.log('zzzzzzzzzzz',previousSelectionIds) + const newlySelected = selection.filter(item => !previousSelectionIds.has(item.maId)) + console.log('pppppppppppppp',newlySelected) + newlySelected.forEach(row => { + if (row.isAlert) { + this.$message({ + message: '当前工器具仍有班组在用,请核实退料单位', + type: 'warning' + }) + } + }) + this.maCodeList = selection // console.log(selection) // this.queryParams.equipmentList = selection diff --git a/src/views/material/cost/component/applyDetail.vue b/src/views/material/cost/component/applyDetail.vue index 73668a69..abe66597 100644 --- a/src/views/material/cost/component/applyDetail.vue +++ b/src/views/material/cost/component/applyDetail.vue @@ -505,7 +505,8 @@ export default { deptName: undefined, applyList: [], projectName: undefined, //结算工程 - unitName: undefined //结算单位 + unitName: undefined, //结算单位 + exportName: '', //导出文件名 } }, mounted() { @@ -577,6 +578,13 @@ export default { console.log('📋 解析后的数据:', arr) this.rowData = arr console.log('📋 准备调用 getDataAll() 获取详情数据') + this.exportName = arr.map(item => { + const projectName = item.projectName || '' + const unitName = item.unitName || '' + const agreementCode = item.agreementCode || '' + return `${projectName}_${unitName}_${agreementCode}` + }).join(', ') // 用逗号和空格连接所有项 + this.getDataAll() }, //获取单位类型 ,getUnitList, getProjectList @@ -755,7 +763,7 @@ export default { this.download( 'material/slt_agreement_info/exportLease', { ...params }, - `${this.projectName}_租赁费用明细_${currentTime}.xlsx` + `${this.exportName}_租赁费用明细_${currentTime}.xlsx` ) }, //丢失 @@ -776,7 +784,7 @@ export default { this.download( 'material/slt_agreement_info/exportLose', { ...params }, - `${this.projectName}_丢失费用明细_${currentTime}.xlsx` + `${this.exportName}_丢失费用明细_${currentTime}.xlsx` ) }, // 维修 @@ -797,7 +805,7 @@ export default { this.download( 'material/slt_agreement_info/exportRepair', { ...params }, - `${this.projectName}_维修费用明细_${currentTime}.xlsx` + `${this.exportName}_维修费用明细_${currentTime}.xlsx` ) }, //报废 @@ -818,7 +826,7 @@ export default { this.download( 'material/slt_agreement_info/exportScrap', { ...params }, - `${this.projectName}_报废费用明细_${currentTime}.xlsx` + `${this.exportName}_报废费用明细_${currentTime}.xlsx` ) // this.downloadJson( // 'material/slt_agreement_info/exportScrap', @@ -843,7 +851,7 @@ export default { this.download( 'material/slt_agreement_info/exportReduction', { ...params }, - `${this.projectName}_减免费用明细_${currentTime}.xlsx` + `${this.exportName}_减免费用明细_${currentTime}.xlsx` ) }, @@ -864,7 +872,7 @@ export default { this.download( 'material/slt_agreement_info/exportAll', { ...params }, - `${this.projectName}_全部费用明细_${currentTime}.xlsx` + `${this.exportName}_全部费用明细_${currentTime}.xlsx` ) }, handleExportEach() { @@ -884,7 +892,7 @@ export default { this.download( 'material/slt_agreement_info/exportEach', { ...params }, - `${this.projectName}_各费用明细_${currentTime}.xlsx` + `${this.exportName}_各费用明细_${currentTime}.xlsx` ) } } diff --git a/src/views/material/cost/component/examDetail.vue b/src/views/material/cost/component/examDetail.vue index 40073883..e8faf603 100644 --- a/src/views/material/cost/component/examDetail.vue +++ b/src/views/material/cost/component/examDetail.vue @@ -648,12 +648,19 @@ export default { applyList: [], projectName: undefined, //结算工程 unitName: undefined, //结算单位 + exportName: '', //导出文件名 } }, mounted() { console.log('33333333333',this.row) let arr = JSON.parse(this.row) this.rowData = arr + this.exportName = arr.map(item => { + const projectName = item.projectName || '' + const unitName = item.unitName || '' + const agreementCode = item.agreementCode || '' + return `${projectName}_${unitName}_${agreementCode}` + }).join(', ') // 用逗号和空格连接所有项 this.getDataAll() // this.getUnitList(); // this.getProjectList(); @@ -807,7 +814,7 @@ export default { this.download( 'material/slt_agreement_info/exportLease', {...params,}, - `租赁费用明细_${currentTime}.xlsx`, + `${this.exportName}_租赁费用明细_${currentTime}.xlsx`, ) }, //丢失 @@ -828,7 +835,7 @@ export default { this.download( 'material/slt_agreement_info/exportLose', {...params,}, - `丢失费用明细_${currentTime}.xlsx`, + `${this.exportName}_丢失费用明细_${currentTime}.xlsx`, ) }, // 维修 @@ -849,7 +856,7 @@ export default { this.download( 'material/slt_agreement_info/exportRepair', {...params,}, - `维修费用明细_${currentTime}.xlsx`, + `${this.exportName}_维修费用明细_${currentTime}.xlsx`, ) }, //报废 @@ -870,7 +877,7 @@ export default { this.download( 'material/slt_agreement_info/exportScrap', {...params,}, - `报废费用明细_${currentTime}.xlsx`, + `${this.exportName}_报废费用明细_${currentTime}.xlsx`, ) // this.downloadJson( // 'material/slt_agreement_info/exportScrap', @@ -895,7 +902,7 @@ export default { this.download( 'material/slt_agreement_info/exportReduction', {...params,}, - `减免费用明细_${currentTime}.xlsx`, + `${this.exportName}_减免费用明细_${currentTime}.xlsx`, ) }, @@ -916,7 +923,7 @@ export default { this.download( 'material/slt_agreement_info/exportAll', {...params,}, - `全部费用明细_${currentTime}.xlsx`, + `${this.exportName}_全部费用明细_${currentTime}.xlsx`, ) }, }, diff --git a/src/views/material/cost/component/leaseCostRangeReportHome.vue b/src/views/material/cost/component/leaseCostRangeReportHome.vue index c165ef99..d9bd1b1f 100644 --- a/src/views/material/cost/component/leaseCostRangeReportHome.vue +++ b/src/views/material/cost/component/leaseCostRangeReportHome.vue @@ -416,7 +416,7 @@ export default { try { // 创建工作簿 const workbook = new ExcelJS.Workbook(); - const worksheet = workbook.addWorksheet('租赁费用区间报表'); + const worksheet = workbook.addWorksheet('租赁费用区间统计报表'); // 定义列配置 const columns = [ @@ -504,7 +504,7 @@ export default { }); // 生成文件名 - let fileName = '租赁费用区间报表'; + let fileName = '租赁费用区间统计报表'; if (this.queryParams.startDate && this.queryParams.endDate) { fileName += `_${this.queryParams.startDate}_至_${this.queryParams.endDate}`; } diff --git a/src/views/material/cost/component/lostReportHome.vue b/src/views/material/cost/component/lostReportHome.vue index 26b4b6f0..a3f17ad9 100644 --- a/src/views/material/cost/component/lostReportHome.vue +++ b/src/views/material/cost/component/lostReportHome.vue @@ -1,7 +1,8 @@