Excel导出携带工程
This commit is contained in:
parent
8e18075be4
commit
d4a414ded2
|
|
@ -529,7 +529,6 @@
|
|||
</div>
|
||||
</div>
|
||||
</div> -->
|
||||
|
||||
<div style="margin-bottom: 20px">
|
||||
<table
|
||||
border="1"
|
||||
|
|
@ -859,7 +858,7 @@ export default {
|
|||
const currentTime = formatTime(new Date())
|
||||
let data = _.cloneDeep(this.rowData)
|
||||
const params = { params: JSON.stringify(data) }
|
||||
this.download('material/slt_agreement_info/exportLease', { ...params }, `租赁费用明细_${currentTime}.xlsx`)
|
||||
this.download('material/slt_agreement_info/exportLease', { ...params }, `${this.projectName}_租赁费用明细_${currentTime}.xlsx`)
|
||||
},
|
||||
//丢失
|
||||
handleExport2() {
|
||||
|
|
@ -876,7 +875,7 @@ export default {
|
|||
const currentTime = formatTime(new Date())
|
||||
let data = _.cloneDeep(this.rowData)
|
||||
const params = { params: JSON.stringify(data) }
|
||||
this.download('material/slt_agreement_info/exportLose', { ...params }, `丢失费用明细_${currentTime}.xlsx`)
|
||||
this.download('material/slt_agreement_info/exportLose', { ...params }, `${this.projectName}_丢失费用明细_${currentTime}.xlsx`)
|
||||
},
|
||||
// 维修
|
||||
handleExport3() {
|
||||
|
|
@ -893,7 +892,7 @@ export default {
|
|||
const currentTime = formatTime(new Date())
|
||||
let data = _.cloneDeep(this.rowData)
|
||||
const params = { params: JSON.stringify(data) }
|
||||
this.download('material/slt_agreement_info/exportRepair', { ...params }, `维修费用明细_${currentTime}.xlsx`)
|
||||
this.download('material/slt_agreement_info/exportRepair', { ...params }, `${this.projectName}_维修费用明细_${currentTime}.xlsx`)
|
||||
},
|
||||
//报废
|
||||
handleExport4() {
|
||||
|
|
@ -910,7 +909,7 @@ export default {
|
|||
const currentTime = formatTime(new Date())
|
||||
let data = _.cloneDeep(this.rowData)
|
||||
const params = { params: JSON.stringify(data) }
|
||||
this.download('material/slt_agreement_info/exportScrap', { ...params }, `报废费用明细_${currentTime}.xlsx`)
|
||||
this.download('material/slt_agreement_info/exportScrap', { ...params }, `${this.projectName}_报废费用明细_${currentTime}.xlsx`)
|
||||
// this.downloadJson(
|
||||
// 'material/slt_agreement_info/exportScrap',
|
||||
// JSON.stringify(this.rowData),
|
||||
|
|
@ -934,7 +933,7 @@ export default {
|
|||
this.download(
|
||||
'material/slt_agreement_info/exportReduction',
|
||||
{ ...params },
|
||||
`减免费用明细_${currentTime}.xlsx`
|
||||
`${this.projectName}_减免费用明细_${currentTime}.xlsx`
|
||||
)
|
||||
},
|
||||
|
||||
|
|
@ -952,7 +951,7 @@ export default {
|
|||
const currentTime = formatTime(new Date())
|
||||
let data = _.cloneDeep(this.rowData)
|
||||
const params = { params: JSON.stringify(data) }
|
||||
this.download('material/slt_agreement_info/exportAll', { ...params }, `全部费用明细_${currentTime}.xlsx`)
|
||||
this.download('material/slt_agreement_info/exportAll', { ...params }, `${this.projectName}_全部费用明细_${currentTime}.xlsx`)
|
||||
},
|
||||
handleExportEach() {
|
||||
const formatTime = date => {
|
||||
|
|
@ -968,7 +967,7 @@ export default {
|
|||
const currentTime = formatTime(new Date())
|
||||
let data = _.cloneDeep(this.rowData)
|
||||
const params = { params: JSON.stringify(data) }
|
||||
this.download('material/slt_agreement_info/exportEach', { ...params }, `各费用明细_${currentTime}.xlsx`)
|
||||
this.download('material/slt_agreement_info/exportEach', { ...params }, `${this.projectName}_各费用明细_${currentTime}.xlsx`)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,28 +1,28 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" v-show="showSearch" :inline="true" label-width="80px">
|
||||
<el-form-item label="选择单位" prop="unitId">
|
||||
<treeselect
|
||||
v-model="queryParams.unitId"
|
||||
:options="unitList" :normalizer="normalizer"
|
||||
:show-count="true" style="width: 215px" :disable-branch-nodes="true"
|
||||
noChildrenText="没有数据了" noOptionsText="没有数据" noResultsText="没有搜索结果"
|
||||
placeholder="请选择单位" @select="unitChange"
|
||||
/>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="选择单位" prop="unitId">-->
|
||||
<!-- <treeselect-->
|
||||
<!-- v-model="queryParams.unitId"-->
|
||||
<!-- :options="unitList" :normalizer="normalizer"-->
|
||||
<!-- :show-count="true" style="width: 215px" :disable-branch-nodes="true"-->
|
||||
<!-- noChildrenText="没有数据了" noOptionsText="没有数据" noResultsText="没有搜索结果"-->
|
||||
<!-- placeholder="请选择单位" @select="unitChange"-->
|
||||
<!-- />-->
|
||||
<!-- </el-form-item>-->
|
||||
|
||||
<el-form-item label="选择工程" prop="projectId">
|
||||
<treeselect
|
||||
v-model="queryParams.projectId"
|
||||
:options="proList" :normalizer="normalizer"
|
||||
:show-count="true" style="width: 215px" :disable-branch-nodes="true"
|
||||
noChildrenText="没有数据了" noOptionsText="没有数据" noResultsText="没有搜索结果"
|
||||
placeholder="请选择工程" @select="proChange"
|
||||
/>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="选择工程" prop="projectId">-->
|
||||
<!-- <treeselect-->
|
||||
<!-- v-model="queryParams.projectId"-->
|
||||
<!-- :options="proList" :normalizer="normalizer"-->
|
||||
<!-- :show-count="true" style="width: 215px" :disable-branch-nodes="true"-->
|
||||
<!-- noChildrenText="没有数据了" noOptionsText="没有数据" noResultsText="没有搜索结果"-->
|
||||
<!-- placeholder="请选择工程" @select="proChange"-->
|
||||
<!-- />-->
|
||||
<!-- </el-form-item>-->
|
||||
|
||||
<el-form-item label="协议号" prop="agreementCode">
|
||||
<el-input v-model="queryParams.agreementCode" placeholder="协议号" clearable disabled/>
|
||||
<el-input v-model="queryParams.agreementCode" placeholder="协议号" clearable/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="推送月份" prop="month">
|
||||
|
|
@ -36,24 +36,32 @@
|
|||
</el-date-picker>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="是否过滤" prop="isFilter">
|
||||
<el-select v-model="queryParams.isFilter" placeholder="请选择" clearable>
|
||||
<el-option label="已过滤" value="0"></el-option>
|
||||
<el-option label="未过滤" value="1"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否结算" prop="isPay">
|
||||
<el-select v-model="queryParams.isPay" placeholder="请选择" clearable>
|
||||
<!-- <el-form-item label="是否过滤" prop="isFilter">-->
|
||||
<!-- <el-select v-model="queryParams.isFilter" placeholder="请选择" clearable>-->
|
||||
<!-- <el-option label="已过滤" value="0"></el-option>-->
|
||||
<!-- <el-option label="未过滤" value="1"></el-option>-->
|
||||
<!-- </el-select>-->
|
||||
<!-- </el-form-item>-->
|
||||
<el-form-item label="是否结算" prop="isSettlement">
|
||||
<el-select v-model="queryParams.isSettlement" placeholder="请选择" clearable>
|
||||
<el-option label="已结算" value="0"></el-option>
|
||||
<el-option label="未结算" value="1"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否审核" prop="isReview">
|
||||
<el-select v-model="queryParams.isReview" placeholder="请选择" clearable>
|
||||
<el-option label="已审核" value="0"></el-option>
|
||||
<el-option label="未审核" value="1"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="费用归属" prop="settlementType">
|
||||
<el-select v-model="queryParams.settlementType" placeholder="请选择" clearable>
|
||||
<el-option label="工器具" value="1"></el-option>
|
||||
<el-option label="安全用品" value="2"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<!-- <el-form-item label="是否审核" prop="isReview">-->
|
||||
<!-- <el-select v-model="queryParams.isReview" placeholder="请选择" clearable>-->
|
||||
<!-- <el-option label="已审核" value="0"></el-option>-->
|
||||
<!-- <el-option label="未审核" value="1"></el-option>-->
|
||||
<!-- </el-select>-->
|
||||
<!-- </el-form-item>-->
|
||||
<el-form-item>
|
||||
<el-button
|
||||
type="primary"
|
||||
|
|
@ -178,7 +186,7 @@
|
|||
<span v-if="scope.row.checkStatus==1" style="color: #67c23a">已审核</span>
|
||||
<span v-if="scope.row.checkStatus==0" style="color: #f56c6c">未审核</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!-- <div class="tabelFirstBottom">
|
||||
<div class="columnFirstNum">合计费用</div>
|
||||
|
|
@ -246,7 +254,7 @@
|
|||
<template slot-scope="scope">
|
||||
{{ scope.row.leaseCost.toFixed(2) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="tabelAllBottom">
|
||||
<div class="columnAllNum">合计费用</div>
|
||||
|
|
@ -435,14 +443,14 @@
|
|||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
getProjectList,
|
||||
getUnitList,
|
||||
getAgreementInfoById,
|
||||
} from '@/api/back/index.js'
|
||||
getAgreementInfoById,
|
||||
} from '@/api/back/index.js'
|
||||
import {getPushReviewList,getLeaseList,getRepairList,getLoseList,getScrapList } from "@/api/costPush/costPush";
|
||||
import Treeselect from "@riophae/vue-treeselect";
|
||||
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
||||
|
|
@ -492,7 +500,8 @@ export default {
|
|||
agreementCode: '',
|
||||
month: null,
|
||||
isReview: null,
|
||||
isPay: null,
|
||||
isSettlement: null,
|
||||
settlementType: null,
|
||||
isFilter: null,
|
||||
},
|
||||
|
||||
|
|
@ -653,7 +662,7 @@ export default {
|
|||
this.scrapAll = 0;
|
||||
this.loseAll = 0;
|
||||
this.moneyAll = 0;
|
||||
|
||||
|
||||
console.log(this.queryParams.month)
|
||||
getPushReviewList(this.queryParams).then((response) => {
|
||||
this.pushReviewList = response.rows;
|
||||
|
|
@ -687,7 +696,7 @@ export default {
|
|||
this.scrapAll = 0;
|
||||
this.loseAll = 0;
|
||||
this.moneyAll = 0;
|
||||
|
||||
|
||||
this.queryParams = {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
|
|
@ -737,16 +746,16 @@ export default {
|
|||
//查询租赁费用
|
||||
getLeaseList(row) {
|
||||
this.loading = true;
|
||||
|
||||
|
||||
// 根据选择的月份计算开始日期和结束日期
|
||||
const selectedMonth = this.queryParams.month; // 格式: "2024-08"
|
||||
const startDate = selectedMonth + '-01'; // 月份第一天
|
||||
|
||||
|
||||
// 计算月份最后一天
|
||||
const year = parseInt(selectedMonth.split('-')[0]);
|
||||
const month = parseInt(selectedMonth.split('-')[1]);
|
||||
const endDate = new Date(year, month, 0).toISOString().split('T')[0]; // 当月最后一天
|
||||
|
||||
|
||||
let params = {
|
||||
month: this.queryParams.month,
|
||||
startDate: startDate,
|
||||
|
|
@ -899,7 +908,7 @@ export default {
|
|||
// 'agreementId': this.rowData.agreementId, 'agreementCode': this.rowData.agreementCode,'totalCostAll': this.costAll,
|
||||
// 'leaseList': this.leaseList, 'repairList': this.repairList, 'scrapList': this.scrapList,'loseList': this.loseList,
|
||||
// }
|
||||
|
||||
|
||||
// submitCosts(params).then((response) => {
|
||||
// this.$message({
|
||||
// type: 'success',
|
||||
|
|
@ -1011,4 +1020,4 @@ export default {
|
|||
width:41.7%;
|
||||
border-left: none;
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
|
|
|||
Loading…
Reference in New Issue