diff --git a/src/views/business/costRecord/component/applyDetail.vue b/src/views/business/costRecord/component/applyDetail.vue index 729acc70..86ea0922 100644 --- a/src/views/business/costRecord/component/applyDetail.vue +++ b/src/views/business/costRecord/component/applyDetail.vue @@ -70,7 +70,7 @@
说明
- {{ '本协议一式三份,甲方一份,乙方一份,经双方签字后生效。' }} + {{ '本协议一式两份,甲方一份,乙方一份,经双方签字后生效。' }}
diff --git a/src/views/material/cost/component/applyDetail.vue b/src/views/material/cost/component/applyDetail.vue index 5282f665..f668107e 100644 --- a/src/views/material/cost/component/applyDetail.vue +++ b/src/views/material/cost/component/applyDetail.vue @@ -200,7 +200,7 @@ {{ item.endTime }} {{ Number(item.leaseDays).toFixed(2) }} - {{ item.costs ? item.costs.toFixed(3) : '0' }} + {{ item.costs ? item.costs.toFixed(2) : '0' }}
@@ -214,8 +214,7 @@ style="width: 100%; border-collapse: collapse; text-align: center; margin-top: -1px;" > - 费用小计: - {{ leaseCost }} + 费用小计: {{ leaseCost }} @@ -323,7 +322,7 @@ {{ item.num.toFixed(2) }} {{ item.partType }} - {{ item.costs.toFixed(3) }} + {{ item.costs.toFixed(2) }} @@ -338,8 +337,7 @@ style="width: 100%; border-collapse: collapse; text-align: center; margin-top: -1px;" > - 费用小计: - {{ repairCost }} + 费用小计: {{ repairCost }} @@ -403,16 +401,18 @@ + - 丢失费用明细 + 丢失费用明细 序号 设备名称 规格型号 计量单位 + 扣款单价 丢失数量 丢失费用(元) @@ -421,13 +421,14 @@
- +
+ @@ -435,9 +436,11 @@ + + - +
{{ item.typeName }} {{ item.modelName }} {{ item.mtUnitName }}{{ item.buyPrice.toFixed(2) }} {{ item.num.toFixed(2) }} {{ item.costs.toFixed(3) }}{{ item.costs.toFixed(2) }}
@@ -452,8 +455,7 @@ style="width: 100%; border-collapse: collapse; text-align: center; margin-top: -1px;" > - 费用小计: - {{ loseCost }} + 费用小计: {{ loseCost }}
@@ -523,10 +525,11 @@ + - 报废费用明细 + 报废费用明细 序号 @@ -534,6 +537,7 @@ 规格型号 计量单位 报废数量 + 扣款单价 是否收费 报废费用(元) @@ -550,6 +554,7 @@ + @@ -559,6 +564,8 @@ {{ item.mtUnitName }} {{ item.num.toFixed(2) }} + {{ item.buyPrice.toFixed(2) }} + {{ item.partType }} {{ item.costs.toFixed(3) }} @@ -575,8 +582,7 @@ style="width: 100%; border-collapse: collapse; text-align: center; margin-top: -1px;" > - 费用小计: - {{ scrapCost }} + 费用小计: {{ scrapCost }} @@ -736,12 +742,10 @@ style="width: 100%; border-collapse: collapse; text-align: center; margin-top: -1px;" > - 费用小计: - {{ reducCost }} + 费用小计: {{ reducCost }} - 合计: - {{ costAll.toFixed(2) }} + 合计: {{ costAll.toFixed(2) }} diff --git a/src/views/material/cost/component/applyHome.vue b/src/views/material/cost/component/applyHome.vue index db4ee411..1ad62268 100644 --- a/src/views/material/cost/component/applyHome.vue +++ b/src/views/material/cost/component/applyHome.vue @@ -125,7 +125,7 @@ @pagination="getList" /> - +
@@ -200,7 +200,7 @@
说明:
- 本协议一式三份,甲方一份,乙方一份,经双方签字后生效。 + 本协议一式两份,甲方一份,乙方一份,经双方签字后生效。
@@ -235,6 +235,7 @@ @@ -322,6 +323,7 @@ import vueEasyPrint from 'vue-easy-print' import Treeselect from '@riophae/vue-treeselect' import '@riophae/vue-treeselect/dist/vue-treeselect.css' import printJS from 'print-js' +import ExcelJS from 'exceljs' export default { name: 'ApplyHome', dicts: ['cost_status'], @@ -616,6 +618,176 @@ export default { this.$refs.remarksPrintRef.print() }, + // 导出协议书 + async handleExportAgreement() { + try { + const workbook = new ExcelJS.Workbook() + const worksheet = workbook.addWorksheet('协议书') + + // 设置列宽 + worksheet.columns = [ + { header: '', key: 'col1', width: 30 }, + { header: '', key: 'col2', width: 30 }, + { header: '', key: 'col3', width: 20 }, + { header: '', key: 'col4', width: 30 } + ] + + // 定义边框样式 + const borderStyle = { + top: { style: 'thin', color: { argb: 'FF000000' } }, + bottom: { style: 'thin', color: { argb: 'FF000000' } }, + left: { style: 'thin', color: { argb: 'FF000000' } }, + right: { style: 'thin', color: { argb: 'FF000000' } } + } + + // 标题 - 跨行展示 + const titleRow = worksheet.addRow(['机具设备有偿使用费结算协议书', '', '', '']) + titleRow.height = 30 + // 先合并单元格 + worksheet.mergeCells('A1:D1') + // 然后设置合并后的单元格样式 + const titleCell = worksheet.getCell('A1') + titleCell.value = '机具设备有偿使用费结算协议书' + titleCell.font = { bold: true, size: 16 } + titleCell.alignment = { horizontal: 'center', vertical: 'center' } + titleCell.border = borderStyle + // 为其他单元格也设置边框 + titleRow.getCell(2).border = borderStyle + titleRow.getCell(3).border = borderStyle + titleRow.getCell(4).border = borderStyle + + // 协议号行 - 单独一行 + const agreementCode = this.agreementContent.agreementCode || '' + const agreementRow = worksheet.addRow(['协议号:', agreementCode, '', '']) + agreementRow.getCell(1).alignment = { horizontal: 'right', vertical: 'center' } + agreementRow.getCell(2).alignment = { horizontal: 'left', vertical: 'center' } + agreementRow.getCell(3).alignment = { horizontal: 'center', vertical: 'center' } + agreementRow.getCell(4).alignment = { horizontal: 'center', vertical: 'center' } + agreementRow.height = 25 + agreementRow.eachCell((cell) => { + cell.border = borderStyle + }) + + // 工程名称 + const projectName = this.agreementContent.projectName || '' + const projectRow = worksheet.addRow(['工程名称:', projectName, '', '']) + projectRow.getCell(1).alignment = { horizontal: 'right', vertical: 'center' } + projectRow.getCell(2).alignment = { horizontal: 'left', vertical: 'center' } + projectRow.height = 25 + projectRow.eachCell((cell) => { + cell.border = borderStyle + }) + worksheet.mergeCells('B3:D3') + worksheet.mergeCells('B4:D4') + + // 承租单位和日期 + const unitName = this.agreementContent.unitName || '' + const applyDate = this.agreementContent.applyTime || this.newData || '' + const unitRow = worksheet.addRow(['承租单位:', unitName, '日期:', applyDate]) + unitRow.getCell(1).alignment = { horizontal: 'right', vertical: 'center' } + unitRow.getCell(2).alignment = { horizontal: 'left', vertical: 'center' } + unitRow.getCell(3).alignment = { horizontal: 'right', vertical: 'center' } + unitRow.getCell(4).alignment = { horizontal: 'left', vertical: 'center' } + unitRow.height = 25 + unitRow.eachCell((cell) => { + cell.border = borderStyle + }) + + // 结算项目及金额 + const headerRow = worksheet.addRow(['结算项目及金额(元)']) + headerRow.font = { bold: true } + headerRow.eachCell((cell) => { + cell.border = borderStyle + }) + + // 费用项目 + const leaseCost = this.agreementContent.leaseCost ? Number(this.agreementContent.leaseCost).toFixed(2) : '0.00' + const leaseRow = worksheet.addRow(['一、施工机具有偿使用费:', leaseCost, '', '']) + leaseRow.getCell(1).alignment = { horizontal: 'left' } + leaseRow.getCell(2).alignment = { horizontal: 'right' } + leaseRow.eachCell((cell) => { + cell.border = borderStyle + }) + + const repairCost = this.agreementContent.repairCost ? Number(this.agreementContent.repairCost).toFixed(2) : '0.00' + const repairRow = worksheet.addRow(['二、施工机具维修费:', repairCost, '', '']) + repairRow.getCell(1).alignment = { horizontal: 'left' } + repairRow.getCell(2).alignment = { horizontal: 'right' } + repairRow.eachCell((cell) => { + cell.border = borderStyle + }) + + const loseCost = this.agreementContent.loseCost ? Number(this.agreementContent.loseCost).toFixed(2) : '0.00' + const loseRow = worksheet.addRow(['三、施工机具丢失费:', loseCost, '', '']) + loseRow.getCell(1).alignment = { horizontal: 'left' } + loseRow.getCell(2).alignment = { horizontal: 'right' } + loseRow.eachCell((cell) => { + cell.border = borderStyle + }) + + const scrapCost = this.agreementContent.scrapCost ? Number(this.agreementContent.scrapCost).toFixed(2) : '0.00' + const scrapRow = worksheet.addRow(['四、施工机具损坏赔偿费:', scrapCost, '', '']) + scrapRow.getCell(1).alignment = { horizontal: 'left' } + scrapRow.getCell(2).alignment = { horizontal: 'right' } + scrapRow.eachCell((cell) => { + cell.border = borderStyle + }) + + const reductionCost = this.agreementContent.reductionCost ? Number(this.agreementContent.reductionCost).toFixed(2) : '0.00' + const reductionRow = worksheet.addRow(['五、施工机具租赁减免费:', reductionCost, '', '']) + reductionRow.getCell(1).alignment = { horizontal: 'left' } + reductionRow.getCell(2).alignment = { horizontal: 'right' } + reductionRow.eachCell((cell) => { + cell.border = borderStyle + }) + + // 合计 + const costAllUpper = this.agreementContent.costAllUpper || '' + const costAll = this.agreementContent.costAll ? Number(this.agreementContent.costAll).toFixed(2) : '0.00' + const totalRow = worksheet.addRow(['费用合计金额(大写):', costAllUpper, '¥', costAll]) + totalRow.font = { bold: true } + totalRow.getCell(1).alignment = { horizontal: 'left' } + totalRow.getCell(2).alignment = { horizontal: 'left' } + totalRow.getCell(3).alignment = { horizontal: 'center' } + totalRow.getCell(4).alignment = { horizontal: 'right' } + totalRow.eachCell((cell) => { + cell.border = borderStyle + }) + + // 说明 + const remarkHeaderRow = worksheet.addRow(['说明: 本协议一式两份,甲方一份,乙方一份,经双方签字后生效。']) + remarkHeaderRow.font = { bold: true } + remarkHeaderRow.eachCell((cell) => { + cell.border = borderStyle + }) + worksheet.mergeCells('A13:D13') + + // 备注 + const noteHeaderRow = worksheet.addRow(['备注: 此费用仅为在机具设备分公司发生费用,未计从项目部领用机具费用。']) + noteHeaderRow.font = { bold: true } + noteHeaderRow.eachCell((cell) => { + cell.border = borderStyle + }) + + worksheet.mergeCells('A14:D14') + + + // 导出 + const buffer = await workbook.xlsx.writeBuffer() + const blob = new Blob([buffer], { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' }) + const url = window.URL.createObjectURL(blob) + const link = document.createElement('a') + link.href = url + link.download = `协议书_${this.agreementContent.agreementCode}_${new Date().getTime()}.xlsx` + link.click() + window.URL.revokeObjectURL(url) + this.$message.success('导出成功') + } catch (error) { + console.error('导出失败:', error) + this.$message.error('导出失败') + } + }, + /** 删除按钮操作 */ handleDelete(row) { // const agreementId = row.agreementId; diff --git a/src/views/material/cost/component/examHome.vue b/src/views/material/cost/component/examHome.vue index c0ba9460..1f46ebc6 100644 --- a/src/views/material/cost/component/examHome.vue +++ b/src/views/material/cost/component/examHome.vue @@ -168,32 +168,32 @@
一、施工机具有偿使用费:
-
¥ {{ agreementContent.leaseCost }}
+
¥ {{ Number(agreementContent.leaseCost).toFixed(2) }}
二、施工机具维修费:
-
¥ {{ agreementContent.repairCost }}
+
¥ {{ Number(agreementContent.repairCost).toFixed(2) }}
三、施工机具丢失费:
-
¥ {{ agreementContent.loseCost }}
+
¥ {{ Number(agreementContent.loseCost).toFixed(2) }}
四、施工机具损坏赔偿费:
-
¥ {{ agreementContent.scrapCost }}
+
¥ {{ Number(agreementContent.scrapCost).toFixed(2) }}
五、施工机具租赁减免费:
-
¥ {{ agreementContent.reductionCost }}
+
¥ {{ Number(agreementContent.reductionCost).toFixed(2) }}
费用合计金额(大写):
{{ agreementContent.costAllUpper }}
-
¥ {{ agreementContent.costAll }}
+
¥ {{ Number(agreementContent.costAll).toFixed(2) }}
说明:
-
本协议一式三份,甲方一份,乙方一份,经双方签字后生效。
+
本协议一式两份,甲方一份,乙方一份,经双方签字后生效。
备注:
diff --git a/src/views/material/cost/component/leaseCostRangeReportHome.vue b/src/views/material/cost/component/leaseCostRangeReportHome.vue index c714dee9..199adee2 100644 --- a/src/views/material/cost/component/leaseCostRangeReportHome.vue +++ b/src/views/material/cost/component/leaseCostRangeReportHome.vue @@ -419,8 +419,8 @@ export default { { header: '设备类型数', key: 'equipmentTypeCount', width: 12 }, { header: '设备总数量', key: 'totalEquipmentCount', width: 12 }, { header: '总租赁天数', key: 'totalLeaseDays', width: 12 }, - { header: '总租赁费用(元)', key: 'totalLeaseCost', width: 15 }, - { header: '日均租金(元)', key: 'avgDailyRent', width: 15 }, + { header: '总租赁费用(元)', key: 'totalLeaseCost', width: 18 }, + { header: '日均租金(元)', key: 'avgDailyRent', width: 18 }, { header: '查询开始日期', key: 'queryStartDate', width: 15 }, { header: '查询结束日期', key: 'queryEndDate', width: 15 }, { header: '最早租赁时间', key: 'earliestLeaseTime', width: 15 }, @@ -463,7 +463,7 @@ export default { // 添加数据行 this.tableList.forEach((row, index) => { const dataRow = { - index: index + 1, + index: String(index + 1), // 转换为字符串,避免被格式化为小数 agreementCode: row.agreementCode || '', unitName: row.unitName || '', projectName: row.projectName || '', @@ -617,7 +617,7 @@ export default { // 添加数据行 this.detailTableList.forEach((row, index) => { const dataRow = { - index: index + 1, + index: String(index + 1), // 转换为字符串,避免被格式化为小数 agreementCode: row.agreementCode || '', typeName: row.typeName || '', modelName: row.modelName || '', diff --git a/src/views/material/costPush/pushReview/index.vue b/src/views/material/costPush/pushReview/index.vue index ec96ceb0..92954e3b 100644 --- a/src/views/material/costPush/pushReview/index.vue +++ b/src/views/material/costPush/pushReview/index.vue @@ -1012,7 +1012,7 @@ export default { const dataRows = this.pushReviewList.slice(0, -1); dataRows.forEach((row, index) => { const dataRow = { - index: index + 1, + index: String(index + 1), // 转换为字符串,避免被格式化为小数 agreementCode: row.agreementCode || '', unitName: row.unitName || '', projectName: row.projectName || '', diff --git a/src/views/materialsStation/cost/component/applyHome.vue b/src/views/materialsStation/cost/component/applyHome.vue index f8f83ed3..aeb6da06 100644 --- a/src/views/materialsStation/cost/component/applyHome.vue +++ b/src/views/materialsStation/cost/component/applyHome.vue @@ -60,7 +60,7 @@ placeholder="请选择班组" clearable filterable - multiple + multiple style="width: 240px" @change="changeTeamId" > @@ -180,32 +180,32 @@
一、施工机具有偿使用费:
-
¥ {{ agreementContent.leaseCost }}
+
¥ {{ Number(agreementContent.leaseCost).toFixed(2) }}
二、施工机具维修费:
-
¥ {{ agreementContent.repairCost }}
+
¥ {{ Number(agreementContent.repairCost).toFixed(2) }}
三、施工机具丢失费:
-
¥ {{ agreementContent.loseCost }}
+
¥ {{ Number(agreementContent.loseCost).toFixed(2) }}
四、施工机具损坏赔偿费:
-
¥ {{ agreementContent.scrapCost }}
+
¥ {{ Number(agreementContent.scrapCost).toFixed(2) }}
五、施工机具租赁减免费:
-
¥ {{ agreementContent.reductionCost }}
+
¥ {{ Number(agreementContent.reductionCost).toFixed(2) }}
费用合计金额(大写):
{{ agreementContent.costAllUpper }}
-
¥ {{ agreementContent.costAll }}
+
¥ {{ Number(agreementContent.costAll).toFixed(2) }}
说明:
-
本协议一式三份,甲方一份,乙方一份,经双方签字后生效。
+
本协议一式两份,甲方一份,乙方一份,经双方签字后生效。
@@ -405,7 +405,7 @@ export default { console.error('获取班组列表失败:', error) this.$message.error('获取班组列表失败') } - + }, async changeTeamId() { diff --git a/src/views/materialsStation/cost/component/examHome.vue b/src/views/materialsStation/cost/component/examHome.vue index 070281a5..6ceb9f3a 100644 --- a/src/views/materialsStation/cost/component/examHome.vue +++ b/src/views/materialsStation/cost/component/examHome.vue @@ -149,32 +149,32 @@
一、施工机具有偿使用费:
-
¥ {{ agreementContent.leaseCost }}
+
¥ {{ Number(agreementContent.leaseCost).toFixed(2) }}
二、施工机具维修费:
-
¥ {{ agreementContent.repairCost }}
+
¥ {{ Number(agreementContent.repairCost).toFixed(2) }}
三、施工机具丢失费:
-
¥ {{ agreementContent.loseCost }}
+
¥ {{ Number(agreementContent.loseCost).toFixed(2) }}
四、施工机具损坏赔偿费:
-
¥ {{ agreementContent.scrapCost }}
+
¥ {{ Number(agreementContent.scrapCost).toFixed(2) }}
五、施工机具租赁减免费:
-
¥ {{ agreementContent.reductionCost }}
+
¥ {{ Number(agreementContent.reductionCost).toFixed(2) }}
费用合计金额(大写):
{{ agreementContent.costAllUpper }}
-
¥ {{ agreementContent.costAll }}
+
¥ {{ Number(agreementContent.costAll).toFixed(2) }}
说明:
-
本协议一式三份,甲方一份,乙方一份,经双方签字后生效。
+
本协议一式两份,甲方一份,乙方一份,经双方签字后生效。