parkRoomArchives.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409
  1. <template>
  2. <div>
  3. <el-row class="handle-box" style="margin-bottom: 10px">
  4. <el-col :span="2">
  5. <div style="text-align: center"><span>楼盘</span></div>
  6. </el-col>
  7. <el-col :span="4">
  8. <el-select
  9. v-model="search.groupId"
  10. style="width: 100%"
  11. clearable
  12. filterable
  13. @change="groupChange"
  14. >
  15. <el-option
  16. v-for="item in groupOption"
  17. :key="item.value"
  18. :label="item.label"
  19. :value="item.value"
  20. />
  21. </el-select>
  22. </el-col>
  23. <el-col :span="2">
  24. <div style="text-align: center"><span>分期</span></div>
  25. </el-col>
  26. <el-col :span="4">
  27. <el-select
  28. v-model="search.discId"
  29. style="width: 100%"
  30. clearable
  31. filterable
  32. @change="discChange"
  33. >
  34. <el-option
  35. v-for="item in discOption"
  36. :key="item.value"
  37. :label="item.label"
  38. :value="item.value"
  39. />
  40. </el-select>
  41. </el-col>
  42. <el-col :span="2">
  43. <div style="text-align: center"><span>单元/楼栋</span></div>
  44. </el-col>
  45. <el-col :span="4">
  46. <el-select
  47. v-model="search.buildId"
  48. style="width: 100%"
  49. clearable
  50. filterable
  51. @change="handleSearch"
  52. >
  53. <el-option
  54. v-for="item in buildOption"
  55. :key="item.value"
  56. :label="item.label"
  57. :value="item.value"
  58. />
  59. </el-select>
  60. </el-col>
  61. <el-col :span="2">
  62. <div style="text-align: center"><span>关键字</span></div>
  63. </el-col>
  64. <el-col :span="4">
  65. <el-input v-model="search.roomNo" />
  66. </el-col>
  67. </el-row>
  68. <el-row class="handle-box" style="margin-bottom: 10px">
  69. <el-col :span="24" style="margin-top: 20px">
  70. <el-button :loading="excelFlag" size="small" class="ch-button-export" style="float: right;" @click="handleExcel"><i class="el-icon-menu" />&nbsp;导出EXCEL</el-button>
  71. <el-button class="ch-button-warning" size="small" style="float: right" @click="handleReset()"><i class="el-icon-search" />&nbsp;重置</el-button>
  72. <el-button class="ch-button" size="small" style="float: right" @click="handleSearch()"><i class="el-icon-search" />&nbsp;查询</el-button>
  73. </el-col>
  74. </el-row>
  75. <el-row class="handle-box">
  76. <el-col :span="24">
  77. <el-table v-loading="loading" :data="AllData" row-class-name="g_table_row" stripe>
  78. <el-table-column label="序号" type="index" width="60" />
  79. <el-table-column label="楼盘" prop="groupName" />
  80. <el-table-column label="分期" prop="discName" />
  81. <el-table-column label="单元/楼栋号" prop="buildName" />
  82. <el-table-column label="户室号" prop="roomNo" />
  83. <el-table-column label="套内面积(㎡)" prop="actualInternalArea" />
  84. <el-table-column label="建筑面积(㎡)" prop="actualBuildArea" />
  85. <el-table-column label="装修情况" prop="decorationSituationStr" />
  86. <el-table-column label="交易次数" prop="transactionCount" />
  87. <el-table-column header-align="center" label="操作" width="180">
  88. <template scope="scope">
  89. <el-button size="mini" type="text" @click="handleView(scope.row)">详情档案</el-button>
  90. </template>
  91. </el-table-column>
  92. </el-table>
  93. <div class="table-page">
  94. <el-pagination
  95. :current-page.sync="currentPage"
  96. :page-sizes="[10, 20, 50, 100]"
  97. :page-size="pageSize"
  98. background
  99. layout="total, sizes, prev, pager, next, jumper"
  100. :total="allpage"
  101. @size-change="handleSizeChange"
  102. @current-change="handleCurrentChange"
  103. />
  104. </div>
  105. </el-col>
  106. </el-row>
  107. <!-- 详情页面 -->
  108. <el-dialog
  109. :title="'详情'"
  110. :visible.sync="dialogVisible"
  111. width="75%"
  112. top="50px"
  113. :close-on-press-escape="false"
  114. :close-on-click-modal="false"
  115. append-to-body
  116. >
  117. <park-room-index-detail
  118. v-if="dialogVisible"
  119. ref="parkRoomIndexDetail"
  120. />
  121. </el-dialog>
  122. </div>
  123. </template>
  124. <script>
  125. import Base from '@/views/base/base'
  126. import BaseData from '@/views/base/baseData'
  127. import ParkRoomIndexDetail from '@/views/reportForms/components/parkRoomIndexDetail.vue'
  128. export default {
  129. name: 'ParkRoomArchives',
  130. components: { ParkRoomIndexDetail },
  131. mixins: [Base, BaseData],
  132. data() {
  133. return {
  134. dc_key: ['DECORATION_SITUATION', 'MAPPING_STATUS', 'SOLD_STATUS', 'GROUP_NATURE', 'HOUSE_PAYMENT_STATUS'],
  135. // 列表相关
  136. search: {
  137. },
  138. AllData: [],
  139. loading: false,
  140. // 弹框相关
  141. dialogVisible: false,
  142. rules: {},
  143. form: {},
  144. dialogTitle: '新增',
  145. groupOption: [],
  146. discOption: [],
  147. buildOption: [],
  148. excelFlag: false
  149. }
  150. },
  151. mounted() {
  152. this.getGroupOption()
  153. // this.getDiscOption()
  154. // this.getBuildOption()
  155. this.initDict(this.dc_key).then((res) => {
  156. this.getData()
  157. })
  158. },
  159. methods: {
  160. groupChange() {
  161. this.handleSearch()
  162. const data = {
  163. groupId: this.search.groupId
  164. }
  165. this.getDiscOption(data)
  166. },
  167. discChange() {
  168. this.handleSearch()
  169. const data = {
  170. discId: this.search.discId
  171. }
  172. this.getBuildOption(data)
  173. },
  174. getData: function() {
  175. const _this = this
  176. _this.loading = true
  177. _this.AllData = []
  178. this.search.pageNum = this.currentPage
  179. this.search.pageSize = this.pageSize
  180. this.baseRequest('reportList', this.search).then((res) => {
  181. if (res.data.rows) {
  182. res.data.rows.forEach(function(item) {
  183. const json = _this.getItemJson(item)
  184. _this.AllData.push(json)
  185. })
  186. _this.allpage = res.data.total
  187. }
  188. _this.loading = false
  189. }).catch((e) => {
  190. // console.log(e)
  191. })
  192. // this.initOutData()
  193. },
  194. handleSearch: function() {
  195. this.getData()
  196. },
  197. handleReset: function() {
  198. for (const i in this.search) {
  199. if (i !== 'pageNum' && i !== 'pageSize') {
  200. this.search[i] = ''
  201. }
  202. }
  203. this.handleSearch()
  204. },
  205. getItemJson: function(item) {
  206. item.decorationSituationStr = this.dc_map.DECORATION_SITUATION[item.decorationSituation]
  207. item.areaStatusStr = this.dc_map.MAPPING_STATUS[item.areaStatus]
  208. item.soldStatusStr = this.dc_map.SOLD_STATUS[item.soldStatus]
  209. item.natureStr = this.dc_map.GROUP_NATURE[item.nature]
  210. item.collectionStatusStr = this.dc_map.HOUSE_PAYMENT_STATUS[item.collectionStatus]
  211. return item
  212. },
  213. cancel: function() {
  214. this.dialogVisible = false
  215. },
  216. handleView(val) {
  217. val.activeName = '概览'
  218. this.dialogVisible = true
  219. this.$nextTick(() => {
  220. this.$refs.parkRoomIndexDetail.initData(val)
  221. })
  222. },
  223. confirmSubmit: function() {
  224. const _this = this
  225. this.$refs.form.validate(valid => {
  226. if (valid) {
  227. let soaUrl = 'edit'
  228. const extraData = {}
  229. const postData = Object.assign({}, _this.form, extraData)
  230. if (!this.form.id) {
  231. soaUrl = 'add'
  232. }
  233. this.opRecord(postData, soaUrl)
  234. } else {
  235. // console.log('error submit!!')
  236. return false
  237. }
  238. })
  239. },
  240. getGroupOption() {
  241. this.baseGroupRequest('listAll', {}).then((res) => {
  242. const data = res.data
  243. this.groupOption = []
  244. data.forEach(item => {
  245. const obj = {
  246. value: item.groupId,
  247. label: item.groupName,
  248. key: item.groupId
  249. }
  250. this.groupOption.push(obj)
  251. })
  252. })
  253. },
  254. getDiscOption(data) {
  255. this.baseDiscRequest('listAll', data).then((res) => {
  256. const data = res.data
  257. this.discOption = []
  258. data.forEach(item => {
  259. const obj = {
  260. value: item.id,
  261. label: item.name,
  262. key: item.id
  263. }
  264. this.discOption.push(obj)
  265. })
  266. })
  267. },
  268. getBuildOption(data) {
  269. this.baseBuildRequest('listAll', data).then((res) => {
  270. const data = res.data
  271. this.buildOption = []
  272. data.forEach(item => {
  273. const obj = {
  274. value: item.id,
  275. label: item.buildNum,
  276. key: item.id
  277. }
  278. this.buildOption.push(obj)
  279. })
  280. })
  281. },
  282. // 导出
  283. handleExcel: function() {
  284. const _this = this
  285. _this.excelFlag = true
  286. _this.search.pageNum = _this.currentPage
  287. _this.search.pageSize = _this.pageSize
  288. this.OutData = []
  289. const title = ['房屋代码', '小区名称', '门牌', '户号', '施工号', '面积测绘状态', '销售状态', '房屋类别',
  290. '预测套内面积', '预测分摊面积', '预测建筑面积', '预测土地面积', '实测套内面积', '实测分摊面积', '实测建筑面积', '实测土地面积',
  291. '房屋总价', '备注', '选房时间', '批次号', '选房号', '网签合同备案号', '合同编号', '签约时间', '合同买受人', '合同买受人身份证',
  292. '买受人联系方式', '房屋买卖单价(元/㎡)', '总价款(元)', '买受人出资金额(元)', '应收房款(元)', '已付房款(元)',
  293. '尚欠房款(元)', '收款状态', '已付款详情', '实际入住时间'
  294. ]
  295. this.OutData.push(title)
  296. const temp = []
  297. this.baseRequest('projectHouseAllVoList', _this.search).then(res => {
  298. const data = res.data
  299. data.data.forEach(function(item) {
  300. const json = _this.getItemJson(item)
  301. temp.push(json)
  302. })
  303. temp.forEach(function(item) {
  304. const jsonArray = []
  305. jsonArray.push(item.roomNumber)
  306. jsonArray.push(item.groupName)
  307. jsonArray.push(item.buildName)
  308. jsonArray.push(item.roomNo)
  309. jsonArray.push(item.constructionNum)
  310. jsonArray.push(item.areaStatusStr)
  311. jsonArray.push(item.soldStatusStr)
  312. jsonArray.push(item.natureStr)
  313. jsonArray.push(item.predictionInternalArea)
  314. jsonArray.push(item.predictionShareArea)
  315. jsonArray.push(item.predictionBuildArea)
  316. jsonArray.push(item.predictionLandArea)
  317. jsonArray.push(item.actualInternalArea)
  318. jsonArray.push(item.actualShareArea)
  319. jsonArray.push(item.actualBuildArea)
  320. jsonArray.push(item.actualLandArea)
  321. jsonArray.push(item.houseTotalPrice)
  322. jsonArray.push(item.remark)
  323. jsonArray.push(item.roomSelectionDate)
  324. jsonArray.push(item.batchNumber)
  325. jsonArray.push(item.roomSelectionNumber)
  326. jsonArray.push(item.recordNumber)
  327. jsonArray.push(item.contractNumber)
  328. jsonArray.push(item.signingDate)
  329. jsonArray.push(item.buyerName)
  330. jsonArray.push(item.buyerIdentityCard)
  331. jsonArray.push(item.buyerPhone)
  332. jsonArray.push(item.contractHousePrice)
  333. jsonArray.push(item.contractTotalPrice)
  334. jsonArray.push(item.contractBuyerMoney)
  335. jsonArray.push(item.receivableMoney)
  336. jsonArray.push(item.receivedMoney)
  337. jsonArray.push(item.arrears)
  338. jsonArray.push(item.collectionStatusStr)
  339. jsonArray.push(item.payInfo)
  340. jsonArray.push(item.checkInDate)
  341. _this.OutData.push(jsonArray)
  342. })
  343. const OutSize = [{ wch: 15 }, { wch: 15 }, { wch: 15 }, { wch: 15 }, { wch: 15 }, { wch: 15 }, { wch: 15 },
  344. { wch: 15 }, { wch: 15 }, { wch: 15 }, { wch: 15 }, { wch: 15 }, { wch: 15 }, { wch: 15 }, { wch: 15 }, { wch: 15 },
  345. { wch: 15 }, { wch: 15 }, { wch: 15 }, { wch: 15 }, { wch: 15 }]
  346. const fileName = '房源档案导出 ' + new Date().Format('yyyyMMddhhmm')
  347. this.$outputXlsxFile(this.OutData, OutSize, fileName)
  348. _this.excelFlag = false
  349. })
  350. },
  351. baseRequest(opUrl, postData) {
  352. return this.$channel.globeRequest('ParkRoomController', opUrl, postData, 'project')
  353. },
  354. baseGroupRequest(opUrl, postData) {
  355. return this.$channel.globeRequest('ParkInfoController', opUrl, postData, 'project')
  356. },
  357. baseDiscRequest(opUrl, postData) {
  358. return this.$channel.globeRequest('ParkFloorDiscController', opUrl, postData, 'project')
  359. },
  360. baseBuildRequest(opUrl, postData) {
  361. return this.$channel.globeRequest('MnpBuildingController', opUrl, postData, 'project')
  362. }
  363. }
  364. }
  365. </script>
  366. <style scoped>
  367. .zt_css{
  368. overflow: hidden;
  369. white-space: nowrap;
  370. text-overflow:ellipsis;
  371. }
  372. .ch-input .el-input__inner {
  373. border-color: #32323A;
  374. }
  375. .ch-input-size {
  376. width: 150px;
  377. }
  378. .ch-button {
  379. border-color: #32323A;
  380. background-color: #32323A;
  381. color: #fff;
  382. }
  383. .ch-button-warning {
  384. margin-left: 10px;
  385. border-color: #E6A23C;
  386. background-color: #E6A23C;
  387. color: #fff;
  388. }
  389. .ch-button-export {
  390. margin-left: 10px;
  391. border-color: #98CC1F;
  392. background-color: #98CC1F;
  393. color: #fff;
  394. }
  395. /deep/.el-dialog__header {
  396. padding: 10px 20px;
  397. }
  398. /deep/.el-dialog__body {
  399. padding: 10px 20px;
  400. }
  401. </style>