index.vue 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650
  1. <template>
  2. <div class="MaterialStatistics_Contain">
  3. <el-radio-group v-model="currentMenu" style="margin-bottom: 20px;" @input="toModule">
  4. <el-radio-button label="0">用料统计</el-radio-button>
  5. <!--<el-radio-button label="1">进度统计</el-radio-button>-->
  6. <!--<el-radio-button label="2">可视化统计</el-radio-button>-->
  7. <!--<el-radio-button label="3">可视化进度</el-radio-button>-->
  8. </el-radio-group>
  9. <!-- <div class="topContain">-->
  10. <div style="width: 100%;height: 100%;display: flex;">
  11. <el-form :model="queryParams" :rules="searchRules" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px" class="searchForm">
  12. <el-form-item label="行政区" prop="district">
  13. <el-select v-model="queryParams.district" placeholder="请选择行政区" clearable
  14. @change="queryParams.areaId = undefined;getAreaList(queryParams.district)"
  15. @clear="queryParams.areaId = undefined;areaList=[];
  16. queryParams.buildingId = undefined;buildingList=[];
  17. queryParams.unitId = undefined;unitList=[]">
  18. <el-option
  19. v-for="dict in dict.type.district"
  20. :key="dict.value"
  21. :label="dict.label"
  22. :value="dict.value"
  23. />
  24. </el-select>
  25. </el-form-item>
  26. <el-form-item label="小区名称" prop="areaId" label-width="80px">
  27. <el-select v-model="queryParams.areaId" filterable clearable placeholder="请选择小区">
  28. <el-option
  29. v-for="item in areaList"
  30. :key="item.id"
  31. :label="item.name"
  32. :value="item.id">
  33. </el-option>
  34. </el-select>
  35. </el-form-item>
  36. <el-form-item label="工程类型" prop="enginType">
  37. <el-select v-model="queryParams.enginType" placeholder="请选择工程类型" clearable
  38. @change="enginTypeHasChangeds"
  39. @clear="currentEnginTypeChangeOptions1=[];queryParams.enginClassification=undefined;queryParams.enginType=undefined">
  40. <el-option
  41. v-for="dict in dict.type.municipal_engineering"
  42. :key="dict.value"
  43. :label="dict.label"
  44. :value="dict.value"
  45. />
  46. </el-select>
  47. </el-form-item>
  48. <!--<el-form-item label="工程分类" prop="enginClassification">-->
  49. <!--<el-select v-model="queryParams.enginClassification" placeholder="请选择工程分类" clearable-->
  50. <!--@change="nodeTypeHasChangeds"-->
  51. <!--@clear="currentEnginTypeChangeOptions1=[];queryParams.enginClassification=undefined;queryParams.enginType=undefined">-->
  52. <!--<el-option-->
  53. <!--v-for="dict in currentEnginTypeChangeOptions1"-->
  54. <!--:key="dict.dictValue"-->
  55. <!--:label="dict.dictLabel"-->
  56. <!--:value="dict.dictValue"-->
  57. <!--/>-->
  58. <!--</el-select>-->
  59. <!--</el-form-item>-->
  60. <!-- <el-form-item label="工程步骤" prop="enginClassification">-->
  61. <!-- <el-select v-model="queryParams.nodeType" placeholder="请选择工程步骤" clearable-->
  62. <!-- @clear="currentEnginTypeChangeOptions2=[];queryParams.enginClassification=undefined;queryParams.enginType=undefined;queryParams.nodeType=undefined">-->
  63. <!-- <el-option-->
  64. <!-- v-for="dict in currentEnginTypeChangeOptions2"-->
  65. <!-- :key="dict.dictValue"-->
  66. <!-- :label="dict.dictLabel"-->
  67. <!-- :value="dict.dictValue"-->
  68. <!-- />-->
  69. <!-- </el-select>-->
  70. <!-- </el-form-item>-->
  71. <el-form-item label="材质" prop="realityQuality" label-width="45px">
  72. <el-select v-model="queryParams.realityQuality" placeholder="请选择材质" filterable clearable
  73. @change="queryParams.realityQuality != undefined;getEnginSpecificationsList(queryParams.realityQuality)"
  74. @clear="queryParams.realityQuality = undefined;"
  75. >
  76. <el-option
  77. v-for="obj in EnginMaterialQualityList"
  78. :key="obj.id"
  79. :label="obj.name"
  80. :value="obj.id"
  81. ></el-option>
  82. </el-select>
  83. </el-form-item>
  84. <el-form-item label="规格" prop="realitySpecifications"label-width="45px">
  85. <el-select v-model="queryParams.realitySpecifications" filterable clearable placeholder="请选择规格"
  86. >
  87. <el-option
  88. v-for="item in EnginSpecificationsList"
  89. :key="item.id"
  90. :label="item.name"
  91. :value="item.id">
  92. </el-option>
  93. </el-select>
  94. </el-form-item>
  95. <!-- <el-form-item label="工程周期" prop="enginCycle" label-width="80px">-->
  96. <!-- <el-select v-model="queryParams.enginCycle" filterable clearable placeholder="请选择规格"-->
  97. <!-- >-->
  98. <!-- <el-option-->
  99. <!-- v-for="dict in dict.type.engin_cycle"-->
  100. <!-- :key="dict.value"-->
  101. <!-- :label="dict.label"-->
  102. <!-- :value="dict.value"-->
  103. <!-- />-->
  104. <!-- </el-select>-->
  105. <!-- </el-form-item>-->
  106. <el-form-item>
  107. <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
  108. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
  109. <el-button
  110. icon="el-icon-download"
  111. @click="handleExport"
  112. size="mini"
  113. v-hasPermi="['zdsz:visual_house:export']"
  114. >导出</el-button>
  115. </el-form-item>
  116. </el-form>
  117. </div>
  118. <el-table
  119. class="materialStatisticsTable"
  120. :data="AreaCompletionInformationList"
  121. style="width: 100%">
  122. <el-table-column
  123. prop="areaName"
  124. width="250"
  125. label="小区"
  126. >
  127. </el-table-column>
  128. <el-table-column
  129. prop="scale"
  130. label="规模(户)"
  131. >
  132. </el-table-column>
  133. <el-table-column
  134. prop="notInstall"
  135. label="未安装(户)"
  136. >
  137. </el-table-column>
  138. <el-table-column
  139. prop="notstart"
  140. label="未施工(户)"
  141. >
  142. </el-table-column>
  143. <el-table-column
  144. prop="willDone"
  145. label="施工中(户)">
  146. </el-table-column>
  147. <el-table-column
  148. prop="done"
  149. label="竣工(户)">
  150. </el-table-column>
  151. </el-table>
  152. <div style="width: 100%; height: 100%;">
  153. <el-table
  154. class="materialStatisticsTable"
  155. :data="tableData"
  156. style="width: 100%">
  157. <el-table-column
  158. prop="areaName"
  159. label="小区"
  160. >
  161. </el-table-column>
  162. <el-table-column
  163. prop="enginType"
  164. label="工程类型">
  165. </el-table-column>
  166. <el-table-column
  167. prop="enginClassification"
  168. label="工程分类">
  169. </el-table-column>
  170. <!-- <el-table-column-->
  171. <!-- prop="nodeType"-->
  172. <!-- label="工程步骤">-->
  173. <!-- </el-table-column>-->
  174. <el-table-column
  175. prop="realityQuality"
  176. label="材质"
  177. >
  178. </el-table-column>
  179. <el-table-column
  180. prop="realitySpecifications"
  181. label="规格"
  182. >
  183. </el-table-column>
  184. <el-table-column
  185. prop="estimatedSize"
  186. label="预计用料">
  187. </el-table-column>
  188. <el-table-column
  189. prop="realitySize"
  190. label="实际用料">
  191. </el-table-column>
  192. </el-table>
  193. </div>
  194. <div id="zhuzhuangtu" style="width: 100%;height: 75vh"></div>
  195. </div>
  196. </template>
  197. <script>
  198. import {
  199. getAreaList, // 获取当前小区集合
  200. getBuildingList, getHousesList, // 获取当前楼栋集合
  201. getUnitList, // 获取当前单元集合
  202. } from '@/api/zdsz/enginee'
  203. import {
  204. getAreaCompletionInformationList,
  205. getEnginMaterialQualityList, getEnginSpecificationsList,
  206. materialStatistics // 获取当前单元集合
  207. } from '@/api/zdsz/countMunicipal'
  208. import {getUnits} from "@/api/zdsz/unit";
  209. import {getDicts} from "@/api/system/dict/data";
  210. import * as echarts from "echarts";
  211. export default {
  212. name:'MaterialStatistics',
  213. dicts:['district','engin_cycle', 'municipal_engineering'],
  214. data(){
  215. return {
  216. currentEnginTypeChangeOptions1: [],
  217. currentEnginTypeChangeOptions2: [],
  218. buildingList: [],
  219. areaList:[],
  220. unitList: [],
  221. showSearch: true,
  222. currentDate:null,
  223. currentMenu:0, // 0:用料管理 1:进度统计 2:可视化进度
  224. typeOptions:[
  225. {
  226. value: '0',
  227. label: '市政工程'
  228. },
  229. {
  230. value: '1',
  231. label: '工业工程'
  232. },
  233. {
  234. value: '2',
  235. label: '民用工程'
  236. },
  237. {
  238. value: '3',
  239. label: '危险作业'
  240. },
  241. {
  242. value: '4',
  243. label: '顶管工程'
  244. },
  245. {
  246. value: '5',
  247. label: '基建工程'
  248. }
  249. ],
  250. communityOptions:[
  251. {
  252. value: '0',
  253. label: '领秀世家'
  254. },
  255. {
  256. value: '1',
  257. label: '上东府里'
  258. },
  259. {
  260. value: '2',
  261. label: '清华园'
  262. },
  263. {
  264. value: '3',
  265. label: '万科蓝山'
  266. },
  267. {
  268. value: '4',
  269. label: '龙腾香格里'
  270. },
  271. ],
  272. buildingOptions:[], // 楼栋集合
  273. unitOptions:[], // 单元集合
  274. currentType:null,
  275. currentDistrict:null, // 当前行政区
  276. currentCommunity:null, // 当前小区
  277. currentBuilding:null, // 当前楼宇
  278. currentUnit:null,// 当前单元
  279. AreaCompletionInformationList:[],
  280. queryParams:{
  281. pageNum:1,
  282. pageSize:10,
  283. district:null,
  284. areaId:undefined,
  285. realityQuality:undefined,
  286. realitySpecifications:undefined,
  287. enginClassification:undefined,
  288. enginType:undefined,
  289. nodeType:undefined,
  290. enginCycle:0
  291. },
  292. EnginMaterialQualityList:[],
  293. EnginSpecificationsList:[],
  294. tableData: [],
  295. searchRules:{
  296. district: [
  297. {required: true, message: "行政区不能为空", trigger: ['change']}
  298. ],
  299. areaId: [
  300. {required: true, message: "小区不能为空", trigger: ['change']}
  301. ],
  302. },
  303. enginTypeOption: [
  304. {
  305. value: 'old_renovation',
  306. label: '旧改'
  307. }, {
  308. value: 'new_built',
  309. label: '新建'
  310. },
  311. ]
  312. }
  313. },
  314. mounted(){
  315. console.log(this.dict)
  316. this.getEnginMaterialQualityList()
  317. //this.getEnginSpecificationsList()
  318. },
  319. methods:{
  320. enginTypeHasChangeds(enginType = null) {
  321. if (this.queryParams.enginType == undefined || this.queryParams.enginType == null || this.queryParams.enginType == '')
  322. return
  323. this.currentCheckList = []
  324. this.queryParams.enginClassification = ''
  325. this.currentEnginTypeChangeOptions1 = []
  326. getDicts(enginType || this.queryParams1.enginType).then(res => {
  327. this.currentEnginTypeChangeOptions1 = res.data
  328. })
  329. },
  330. nodeTypeHasChangeds(enginType = null,enginClassification = null) {
  331. if ((this.queryParams.enginType == undefined || this.queryParams.enginType == null || this.queryParams.enginType == '')&&(this.queryParams.enginClassification == undefined || this.queryParams.enginClassification == null || this.queryParams.enginClassification == ''))
  332. return
  333. this.currentCheckList = []
  334. this.queryParams.nodeType = ''
  335. this.currentEnginTypeChangeOptions2 = []
  336. getDicts(enginType&&enginClassification || this.queryParams.enginType+'_'+this.queryParams.enginClassification).then(res => {
  337. this.currentEnginTypeChangeOptions2 = res.data
  338. })
  339. },
  340. enginTypeHasChanged(enginType = null) {
  341. this.currentCheckList = []
  342. this.queryParams.enginClassification = ''
  343. this.currentEnginTypeChangeOptions = []
  344. getDicts(enginType || this.queryParams.enginType).then(res => {
  345. this.currentEnginTypeChangeOptions = res.data
  346. })
  347. },
  348. getLongestCollectionLength(jsonObj) {
  349. let longestLength = 0;
  350. for (let key in jsonObj) {
  351. if (Array.isArray(jsonObj[key])) {
  352. longestLength = Math.max(longestLength, jsonObj[key].length);
  353. }
  354. }
  355. return longestLength;
  356. },
  357. getList()
  358. {
  359. materialStatistics(this.queryParams).then(res=>{
  360. this.tableData=res.data;
  361. let seriesData = [];
  362. for (let item in res.data) {
  363. seriesData.push({
  364. name: res.data[item].realityQuality+'\n'+res.data[item].realitySpecifications,
  365. type: 'bar',
  366. stack: res.data[item].realityQuality,
  367. label:{
  368. show:true,
  369. formatter:'{a}\n{c}米'
  370. },
  371. data: [res.data[item].realitySize]
  372. },);
  373. }
  374. let option = {
  375. xAxis: [
  376. {
  377. type: 'category',
  378. data: ['A'],
  379. show:false,
  380. }
  381. ],
  382. yAxis: [
  383. {
  384. type: 'value'
  385. }
  386. ],
  387. series: seriesData
  388. };
  389. var myChart = echarts.init(document.getElementById('zhuzhuangtu'));
  390. myChart.clear()
  391. myChart.setOption(option);
  392. })
  393. },
  394. getAreaCompletionInformationList()
  395. {
  396. getAreaCompletionInformationList(this.queryParams).then(res=>{
  397. //this.AreaCompletionInformationList=res.total
  398. this.AreaCompletionInformationList=res.rows
  399. })
  400. },
  401. getEnginMaterialQualityList()
  402. {
  403. getEnginMaterialQualityList().then(res=>{
  404. this.EnginMaterialQualityList=res.data
  405. })
  406. },
  407. getEnginSpecificationsList(materId)
  408. {
  409. getEnginSpecificationsList(materId).then(res=>{
  410. this.EnginSpecificationsList=res.data
  411. })
  412. },
  413. /** 搜索按钮操作 */
  414. handleQuery() {
  415. this.$refs.queryForm.validate(valid => {
  416. if(valid){
  417. // 校验 pass
  418. this.getList();
  419. this.getAreaCompletionInformationList()
  420. } else {
  421. this.$message.error('请填写必填项!')
  422. }
  423. })
  424. // this.queryParams = 1;
  425. },
  426. /** 重置按钮操作 */
  427. resetQuery() {
  428. this.resetForm("queryForm");
  429. this.queryParams = {
  430. district:null,
  431. areaId:undefined,
  432. realityQuality:undefined,
  433. realitySpecifications:undefined,
  434. enginCycle:0
  435. }
  436. this.AreaCompletionInformationList=[]
  437. this.tableData=[]
  438. //this.handleQuery();
  439. },
  440. getAreaList(district) {
  441. if (district === undefined || district == null || district === '')
  442. return
  443. getAreaList({district: district}).then(res => this.areaList = res.data)
  444. },
  445. getBuildingList1(areaId) {
  446. if (areaId === undefined || areaId == null || areaId === '')
  447. return
  448. getBuildingList({areaId: areaId}).then(res => this.buildingList = res.data)
  449. },
  450. getUnitList1(buildingId) {
  451. if (buildingId === undefined || buildingId == null || buildingId === '')
  452. return
  453. getUnits(buildingId).then(res => this.unitList = res.data)
  454. },
  455. currentEnginTypeChange(val){
  456. const enginDict = val[1]
  457. const enginType = val[0]
  458. this.queryParams.enginType = enginType
  459. this.enginClassification=enginDict
  460. this.enginClassificationOption = this.dict.type[enginDict]
  461. console.log(this.value)
  462. },
  463. // 当前所选行政区发生改变 查询当前小区集合
  464. districtHasChanged(district){
  465. this.queryParams.areaId = null
  466. this.queryParams.buildingId = null
  467. this.queryParams.unitId = null
  468. getAreaList({district}).then(res => {
  469. this.communityOptions = res.data
  470. })
  471. },
  472. // 当前所选小区发生改变 查询当前楼栋集合
  473. communityHasChanged(areaId){
  474. this.queryParams.buildingId = null
  475. this.queryParams.unitId = null
  476. getBuildingList({areaId}).then(res => {
  477. this.buildingOptions = res.data
  478. })
  479. },
  480. buildingHasChanged(buildingId){
  481. console.log(buildingId)
  482. this.queryParams.unitId = null
  483. getUnitList({buildingId}).then(res => {
  484. this.unitOptions = res.data
  485. })
  486. },
  487. unitHasChanged(unitId){
  488. getHousesList({unitId}).then(res => {
  489. console.log(res)
  490. this.houseOptions = res.data
  491. })
  492. },
  493. // // 当前所选行政区发生改变 查询当前小区集合
  494. // districtHasChanged(district){
  495. // this.currentCommunity = null
  496. // getAreaList({district}).then(res => {
  497. // this.communityOptions = res.data
  498. // })
  499. // },
  500. // // 当前所选小区发生改变 查询当前楼栋集合
  501. // communityHasChanged(areaId){
  502. // this.currentBuilding = null
  503. // getBuildingList({areaId}).then(res => {
  504. // this.buildingOptions = res.data
  505. // })
  506. // },
  507. // buildingHasChanged(buildingId){
  508. // this.currentUnit = null
  509. // getUnitList({buildingId}).then(res => {
  510. // console.log(res)
  511. // this.unitOptions = res.data
  512. // })
  513. // },
  514. /** 导出按钮操作 */
  515. handleExport() {
  516. this.download('zdsz/materialStatistics/export', {
  517. ...this.queryParams
  518. }, `用料统计${new Date().getTime()}.xlsx`)
  519. },
  520. tableRowClassName(){
  521. // return "background:#199ED8;border: 2px solid #000066"
  522. },
  523. toModule(){
  524. console.log(this.$router)
  525. const currentPage = this.currentMenu == 0 ? 'material_statistics' : this.currentMenu == 1 ? 'progres_statistics' :this.currentMenu == 2 ? 'echarts_statistics': 'progres_visual'
  526. this.$router.push({
  527. path:`/${currentPage}`
  528. })
  529. }
  530. }
  531. }
  532. </script>
  533. <style lang="scss" scoped>
  534. ::v-deep .searchForm{
  535. .el-input__inner{
  536. width: 190px;
  537. }
  538. }
  539. .tags-view-container{
  540. display: none;
  541. }
  542. .MaterialStatistics_Contain{
  543. width: 100%;
  544. height: 100%;
  545. padding: 1%;
  546. .topContain{
  547. display: flex;
  548. justify-content: space-between;
  549. width: 100%;
  550. height: 40px;
  551. ::v-deep .projectSelect{
  552. width: 16%;
  553. .el-input__inner{
  554. // font-size: 15px;
  555. // height: 40px ;
  556. // background-color: #1890FF;
  557. background: linear-gradient(to right, #2197F2, #0BB0DE);
  558. color: #fff;
  559. }
  560. }
  561. ::v-deep .districtSelect{
  562. width: 200px;
  563. }
  564. ::v-deep .communitySelect{
  565. margin-left: 2%;
  566. width: 200px;
  567. }
  568. ::v-deep .projectSelect:not(:nth-child(1)){
  569. margin-left: 1%;
  570. }
  571. ::v-deep .projectSelect:nth-child(3){
  572. width: 10%;
  573. }
  574. ::v-deep .projectSelect:nth-child(4){
  575. width: 10%;
  576. }
  577. .projectDropDown{
  578. background-color: #1890FF;
  579. .el-select-dropdown__item{
  580. background-color: #1890FF;
  581. color: #fff;
  582. }
  583. ::v-deep .el-select-dropdown__list {
  584. padding-top: 0 !important;
  585. padding-bottom: 0;
  586. }
  587. }
  588. .projectDropDown >ul{
  589. padding-top: 0 ;
  590. padding-bottom: 0;
  591. }
  592. }
  593. .materialStatisticsTable{
  594. margin-top: 1%;
  595. // border: 2px solid #000066 !important;
  596. }
  597. .materialStatisticsTable::before{
  598. background-color:#000066 ;
  599. }
  600. .materialStatisticsTable::after{
  601. background-color:#000066 ;
  602. }
  603. }
  604. </style>
  605. <style lang="scss" scoped>
  606. .customTable{
  607. .el-table__header-wrapper th{
  608. background-color: #199ED8;
  609. }
  610. .el-table--border th.el-table__cell{
  611. // border: 2px solid #000066 !important;
  612. }
  613. .el-table__empty-block{
  614. background-color: #199ED8;
  615. }
  616. .el-table__empty-text{
  617. color: #000066;
  618. }
  619. .el-table__cell{
  620. background-color: #199ED8 ;
  621. // border: 2px solid #000066 !important;
  622. }
  623. .el-table__cell >div{
  624. text-align: center;
  625. }
  626. .el-button{
  627. background-color: #169BD5;
  628. color: #fff;
  629. }
  630. }
  631. </style>