LAPTOP-FO2T5SIU\35838 месяцев назад: 4
Родитель
Сommit
ab89dd64d1
1 измененных файлов с 73 добавлено и 2 удалено
  1. 73 2
      src/views/reportForms/parkRoomArchives.vue

+ 73 - 2
src/views/reportForms/parkRoomArchives.vue

@@ -67,6 +67,7 @@
     </el-row>
     <el-row class="handle-box" style="margin-bottom: 10px">
       <el-col :span="24" style="margin-top: 20px">
+        <el-button :loading="excelFlag" size="small" class="ch-button-export" style="float: right;" @click="handleExcel"><i class="el-icon-menu" />&nbsp;导出EXCEL</el-button>
         <el-button class="ch-button-warning" size="small" style="float: right" @click="handleReset()"><i class="el-icon-search" />&nbsp;重置</el-button>
         <el-button class="ch-button" size="small" style="float: right" @click="handleSearch()"><i class="el-icon-search" />&nbsp;查询</el-button>
       </el-col>
@@ -133,7 +134,7 @@ export default {
     mixins: [Base, BaseData],
     data() {
         return {
-            dc_key: ['DECORATION_SITUATION'],
+            dc_key: ['DECORATION_SITUATION', 'MAPPING_STATUS', 'SOLD_STATUS', 'GROUP_NATURE'],
             // 列表相关
             search: {
             },
@@ -146,7 +147,8 @@ export default {
             dialogTitle: '新增',
             groupOption: [],
             discOption: [],
-            buildOption: []
+            buildOption: [],
+            excelFlag: false
         }
     },
     mounted() {
@@ -206,6 +208,9 @@ export default {
         },
         getItemJson: function(item) {
             item.decorationSituationStr = this.dc_map.DECORATION_SITUATION[item.decorationSituation]
+            item.areaStatusStr = this.dc_map.MAPPING_STATUS[item.areaStatus]
+            item.soldStatusStr = this.dc_map.SOLD_STATUS[item.soldStatus]
+            item.natureStr = this.dc_map.GROUP_NATURE[item.nature]
             return item
         },
         cancel: function() {
@@ -279,6 +284,72 @@ export default {
                 })
             })
         },
+        // 导出
+        handleExcel: function() {
+            const _this = this
+            _this.excelFlag = true
+            _this.search.pageNum = _this.currentPage
+            _this.search.pageSize = _this.pageSize
+            this.OutData = []
+            const title = ['房屋代码', '小区名称', '门牌', '户号', '施工号', '面积测绘状态', '销售状态', '房屋类别',
+                '预测套内面积', '预测分摊面积', '预测建筑面积', '预测土地面积', '实测套内面积', '实测分摊面积', '实测建筑面积', '实测土地面积',
+                '房屋总价', '备注', '选房时间', '批次号', '选房号', '网签合同备案号', '合同编号', '合同时间', '合同买受人', '合同买受人身份证',
+                '合同面积状态', '合同面积', '合同金额', '已付款总额', '已付款详情', '合同联系方式', '实际入住时间'
+            ]
+            this.OutData.push(title)
+            const temp = []
+            this.baseRequest('projectHouseAllVoList', _this.search).then(res => {
+                const data = res.data
+                data.data.forEach(function(item) {
+                    const json = _this.getItemJson(item)
+                    temp.push(json)
+                })
+                temp.forEach(function(item) {
+                    const jsonArray = []
+                    jsonArray.push(item.roomNumber)
+                    jsonArray.push(item.groupName)
+                    jsonArray.push(item.buildName)
+                    jsonArray.push(item.roomNo)
+                    jsonArray.push(item.constructionNum)
+                    jsonArray.push(item.areaStatusStr)
+                    jsonArray.push(item.soldStatusStr)
+                    jsonArray.push(item.natureStr)
+                    jsonArray.push(item.predictionInternalArea)
+                    jsonArray.push(item.predictionShareArea)
+                    jsonArray.push(item.predictionBuildArea)
+                    jsonArray.push(item.predictionLandArea)
+                    jsonArray.push(item.actualInternalArea)
+                    jsonArray.push(item.actualShareArea)
+                    jsonArray.push(item.actualBuildArea)
+                    jsonArray.push(item.actualLandArea)
+                    jsonArray.push(item.houseTotalPrice)
+                    jsonArray.push(item.remark)
+                    jsonArray.push(item.roomSelectionDate)
+                    jsonArray.push(item.batchNumber)
+                    jsonArray.push(item.roomSelectionNumber)
+                    jsonArray.push(item.recordNumber)
+                    jsonArray.push(item.contractNumber)
+                    jsonArray.push(item.signingDate)
+                    jsonArray.push(item.buyerName)
+                    jsonArray.push(item.buyerIdentityCard)
+                    jsonArray.push(item.contractAreaStatus)
+                    jsonArray.push(item.contractArea)
+                    jsonArray.push(item.contractTotalPrice)
+                    jsonArray.push(item.receivedMoney)
+                    jsonArray.push(item.payInfo)
+                    jsonArray.push(item.contractContact)
+                    jsonArray.push(item.checkInDate)
+
+                    _this.OutData.push(jsonArray)
+                })
+                const OutSize = [{ wch: 15 }, { wch: 15 }, { wch: 15 }, { wch: 15 }, { wch: 15 }, { wch: 15 }, { wch: 15 },
+                    { wch: 15 }, { wch: 15 }, { wch: 15 }, { wch: 15 }, { wch: 15 }, { wch: 15 }, { wch: 15 }, { wch: 15 }, { wch: 15 },
+                    { wch: 15 }, { wch: 15 }, { wch: 15 }, { wch: 15 }, { wch: 15 }]
+                const fileName = '房间导出 ' + new Date().Format('yyyyMMddhhmm')
+                this.$outputXlsxFile(this.OutData, OutSize, fileName)
+                _this.excelFlag = false
+            })
+        },
         baseRequest(opUrl, postData) {
             return this.$channel.globeRequest('ParkRoomController', opUrl, postData, 'project')
         },