index.vue 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604
  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 enginTypeOption"
  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="notstart"
  135. label="未施工(户)"
  136. >
  137. </el-table-column>
  138. <el-table-column
  139. prop="willDone"
  140. label="施工中(户)">
  141. </el-table-column>
  142. <el-table-column
  143. prop="done"
  144. label="竣工(户)">
  145. </el-table-column>
  146. </el-table>
  147. <div style="width: 100%; height: 100%;">
  148. <el-table
  149. class="materialStatisticsTable"
  150. :data="tableData"
  151. show-summary
  152. style="width: 100%">
  153. <el-table-column
  154. prop="areaName"
  155. label="小区"
  156. >
  157. </el-table-column>
  158. <el-table-column
  159. prop="enginType"
  160. label="工程类型">
  161. </el-table-column>
  162. <el-table-column
  163. prop="enginClassification"
  164. label="工程分类">
  165. </el-table-column>
  166. <!-- <el-table-column-->
  167. <!-- prop="nodeType"-->
  168. <!-- label="工程步骤">-->
  169. <!-- </el-table-column>-->
  170. <el-table-column
  171. prop="realityQuality"
  172. label="材质"
  173. >
  174. </el-table-column>
  175. <el-table-column
  176. prop="realitySpecifications"
  177. label="规格"
  178. >
  179. </el-table-column>
  180. <el-table-column
  181. prop="estimatedSize"
  182. label="预计用料">
  183. </el-table-column>
  184. <el-table-column
  185. prop="realitySize"
  186. label="实际用料">
  187. </el-table-column>
  188. </el-table>
  189. </div>
  190. </div>
  191. </template>
  192. <script>
  193. import {
  194. getAreaList, // 获取当前小区集合
  195. getBuildingList, getHousesList, // 获取当前楼栋集合
  196. getUnitList, // 获取当前单元集合
  197. } from '@/api/zdsz/enginee'
  198. import {
  199. getAreaCompletionInformationList,
  200. getEnginMaterialQualityList, getEnginSpecificationsList,
  201. materialStatistics // 获取当前单元集合
  202. } from '@/api/zdsz/overhead'
  203. import {getUnits} from "@/api/zdsz/unit";
  204. import {getDicts} from "@/api/system/dict/data";
  205. export default {
  206. name:'MaterialStatistics',
  207. dicts:['district','engin_cycle'],
  208. data(){
  209. return {
  210. currentEnginTypeChangeOptions1: [],
  211. currentEnginTypeChangeOptions2: [],
  212. buildingList: [],
  213. areaList:[],
  214. unitList: [],
  215. showSearch: true,
  216. currentDate:null,
  217. currentMenu:0, // 0:用料管理 1:进度统计 2:可视化进度
  218. typeOptions:[
  219. {
  220. value: '0',
  221. label: '市政工程'
  222. },
  223. {
  224. value: '1',
  225. label: '工业工程'
  226. },
  227. {
  228. value: '2',
  229. label: '民用工程'
  230. },
  231. {
  232. value: '3',
  233. label: '危险作业'
  234. },
  235. {
  236. value: '4',
  237. label: '顶管工程'
  238. },
  239. {
  240. value: '5',
  241. label: '基建工程'
  242. }
  243. ],
  244. communityOptions:[
  245. {
  246. value: '0',
  247. label: '领秀世家'
  248. },
  249. {
  250. value: '1',
  251. label: '上东府里'
  252. },
  253. {
  254. value: '2',
  255. label: '清华园'
  256. },
  257. {
  258. value: '3',
  259. label: '万科蓝山'
  260. },
  261. {
  262. value: '4',
  263. label: '龙腾香格里'
  264. },
  265. ],
  266. buildingOptions:[], // 楼栋集合
  267. unitOptions:[], // 单元集合
  268. currentType:null,
  269. currentDistrict:null, // 当前行政区
  270. currentCommunity:null, // 当前小区
  271. currentBuilding:null, // 当前楼宇
  272. currentUnit:null,// 当前单元
  273. AreaCompletionInformationList:[],
  274. queryParams:{
  275. pageNum:1,
  276. pageSize:10,
  277. district:null,
  278. areaId:undefined,
  279. realityQuality:undefined,
  280. realitySpecifications:undefined,
  281. enginClassification:undefined,
  282. enginType:undefined,
  283. nodeType:undefined,
  284. enginCycle:0
  285. },
  286. EnginMaterialQualityList:[],
  287. EnginSpecificationsList:[],
  288. tableData: [],
  289. searchRules:{
  290. district: [
  291. {required: true, message: "行政区不能为空", trigger: ['change']}
  292. ],
  293. areaId: [
  294. {required: true, message: "小区不能为空", trigger: ['change']}
  295. ],
  296. },
  297. enginTypeOption: [
  298. {
  299. value: 'old_renovation',
  300. label: '旧改'
  301. }, {
  302. value: 'new_built',
  303. label: '新建'
  304. },
  305. ]
  306. }
  307. },
  308. mounted(){
  309. console.log(this.dict)
  310. this.getEnginMaterialQualityList()
  311. //this.getEnginSpecificationsList()
  312. },
  313. methods:{
  314. enginTypeHasChangeds(enginType = null) {
  315. if (this.queryParams.enginType == undefined || this.queryParams.enginType == null || this.queryParams.enginType == '')
  316. return
  317. this.currentCheckList = []
  318. this.queryParams.enginClassification = ''
  319. this.currentEnginTypeChangeOptions1 = []
  320. getDicts(enginType || this.queryParams1.enginType).then(res => {
  321. this.currentEnginTypeChangeOptions1 = res.data
  322. })
  323. },
  324. nodeTypeHasChangeds(enginType = null,enginClassification = null) {
  325. if ((this.queryParams.enginType == undefined || this.queryParams.enginType == null || this.queryParams.enginType == '')&&(this.queryParams.enginClassification == undefined || this.queryParams.enginClassification == null || this.queryParams.enginClassification == ''))
  326. return
  327. this.currentCheckList = []
  328. this.queryParams.nodeType = ''
  329. this.currentEnginTypeChangeOptions2 = []
  330. getDicts(enginType&&enginClassification || this.queryParams.enginType+'_'+this.queryParams.enginClassification).then(res => {
  331. this.currentEnginTypeChangeOptions2 = res.data
  332. })
  333. },
  334. enginTypeHasChanged(enginType = null) {
  335. this.currentCheckList = []
  336. this.queryParams.enginClassification = ''
  337. this.currentEnginTypeChangeOptions = []
  338. getDicts(enginType || this.queryParams.enginType).then(res => {
  339. this.currentEnginTypeChangeOptions = res.data
  340. })
  341. },
  342. getList()
  343. {
  344. materialStatistics(this.queryParams).then(res=>{
  345. this.tableData=res.data
  346. })
  347. },
  348. getAreaCompletionInformationList()
  349. {
  350. getAreaCompletionInformationList(this.queryParams).then(res=>{
  351. //this.AreaCompletionInformationList=res.total
  352. this.AreaCompletionInformationList=res.rows
  353. })
  354. },
  355. getEnginMaterialQualityList()
  356. {
  357. getEnginMaterialQualityList().then(res=>{
  358. this.EnginMaterialQualityList=res.data
  359. })
  360. },
  361. getEnginSpecificationsList(materId)
  362. {
  363. getEnginSpecificationsList(materId).then(res=>{
  364. this.EnginSpecificationsList=res.data
  365. })
  366. },
  367. /** 搜索按钮操作 */
  368. handleQuery() {
  369. this.$refs.queryForm.validate(valid => {
  370. if(valid){
  371. // 校验 pass
  372. this.getList();
  373. this.getAreaCompletionInformationList()
  374. } else {
  375. this.$message.error('请填写必填项!')
  376. }
  377. })
  378. // this.queryParams = 1;
  379. },
  380. /** 重置按钮操作 */
  381. resetQuery() {
  382. this.resetForm("queryForm");
  383. this.queryParams = {
  384. district:null,
  385. areaId:undefined,
  386. realityQuality:undefined,
  387. realitySpecifications:undefined,
  388. enginCycle:0
  389. }
  390. this.AreaCompletionInformationList=[]
  391. this.tableData=[]
  392. //this.handleQuery();
  393. },
  394. getAreaList(district) {
  395. if (district === undefined || district == null || district === '')
  396. return
  397. getAreaList({district: district}).then(res => this.areaList = res.data)
  398. },
  399. getBuildingList1(areaId) {
  400. if (areaId === undefined || areaId == null || areaId === '')
  401. return
  402. getBuildingList({areaId: areaId}).then(res => this.buildingList = res.data)
  403. },
  404. getUnitList1(buildingId) {
  405. if (buildingId === undefined || buildingId == null || buildingId === '')
  406. return
  407. getUnits(buildingId).then(res => this.unitList = res.data)
  408. },
  409. currentEnginTypeChange(val){
  410. const enginDict = val[1]
  411. const enginType = val[0]
  412. this.queryParams.enginType = enginType
  413. this.enginClassification=enginDict
  414. this.enginClassificationOption = this.dict.type[enginDict]
  415. console.log(this.value)
  416. },
  417. // 当前所选行政区发生改变 查询当前小区集合
  418. districtHasChanged(district){
  419. this.queryParams.areaId = null
  420. this.queryParams.buildingId = null
  421. this.queryParams.unitId = null
  422. getAreaList({district}).then(res => {
  423. this.communityOptions = res.data
  424. })
  425. },
  426. // 当前所选小区发生改变 查询当前楼栋集合
  427. communityHasChanged(areaId){
  428. this.queryParams.buildingId = null
  429. this.queryParams.unitId = null
  430. getBuildingList({areaId}).then(res => {
  431. this.buildingOptions = res.data
  432. })
  433. },
  434. buildingHasChanged(buildingId){
  435. console.log(buildingId)
  436. this.queryParams.unitId = null
  437. getUnitList({buildingId}).then(res => {
  438. this.unitOptions = res.data
  439. })
  440. },
  441. unitHasChanged(unitId){
  442. getHousesList({unitId}).then(res => {
  443. console.log(res)
  444. this.houseOptions = res.data
  445. })
  446. },
  447. // // 当前所选行政区发生改变 查询当前小区集合
  448. // districtHasChanged(district){
  449. // this.currentCommunity = null
  450. // getAreaList({district}).then(res => {
  451. // this.communityOptions = res.data
  452. // })
  453. // },
  454. // // 当前所选小区发生改变 查询当前楼栋集合
  455. // communityHasChanged(areaId){
  456. // this.currentBuilding = null
  457. // getBuildingList({areaId}).then(res => {
  458. // this.buildingOptions = res.data
  459. // })
  460. // },
  461. // buildingHasChanged(buildingId){
  462. // this.currentUnit = null
  463. // getUnitList({buildingId}).then(res => {
  464. // console.log(res)
  465. // this.unitOptions = res.data
  466. // })
  467. // },
  468. /** 导出按钮操作 */
  469. handleExport() {
  470. this.download('zdsz/materialStatistics/export', {
  471. ...this.queryParams
  472. }, `用料统计${new Date().getTime()}.xlsx`)
  473. },
  474. tableRowClassName(){
  475. // return "background:#199ED8;border: 2px solid #000066"
  476. },
  477. toModule(){
  478. console.log(this.$router)
  479. const currentPage = this.currentMenu == 0 ? 'material_statistics' : this.currentMenu == 1 ? 'progres_statistics' :this.currentMenu == 2 ? 'echarts_statistics': 'progres_visual'
  480. this.$router.push({
  481. path:`/${currentPage}`
  482. })
  483. }
  484. }
  485. }
  486. </script>
  487. <style lang="scss" scoped>
  488. ::v-deep .searchForm{
  489. .el-input__inner{
  490. width: 190px;
  491. }
  492. }
  493. .tags-view-container{
  494. display: none;
  495. }
  496. .MaterialStatistics_Contain{
  497. width: 100%;
  498. height: 100%;
  499. padding: 1%;
  500. .topContain{
  501. display: flex;
  502. justify-content: space-between;
  503. width: 100%;
  504. height: 40px;
  505. ::v-deep .projectSelect{
  506. width: 16%;
  507. .el-input__inner{
  508. // font-size: 15px;
  509. // height: 40px ;
  510. // background-color: #1890FF;
  511. background: linear-gradient(to right, #2197F2, #0BB0DE);
  512. color: #fff;
  513. }
  514. }
  515. ::v-deep .districtSelect{
  516. width: 200px;
  517. }
  518. ::v-deep .communitySelect{
  519. margin-left: 2%;
  520. width: 200px;
  521. }
  522. ::v-deep .projectSelect:not(:nth-child(1)){
  523. margin-left: 1%;
  524. }
  525. ::v-deep .projectSelect:nth-child(3){
  526. width: 10%;
  527. }
  528. ::v-deep .projectSelect:nth-child(4){
  529. width: 10%;
  530. }
  531. .projectDropDown{
  532. background-color: #1890FF;
  533. .el-select-dropdown__item{
  534. background-color: #1890FF;
  535. color: #fff;
  536. }
  537. ::v-deep .el-select-dropdown__list {
  538. padding-top: 0 !important;
  539. padding-bottom: 0;
  540. }
  541. }
  542. .projectDropDown >ul{
  543. padding-top: 0 ;
  544. padding-bottom: 0;
  545. }
  546. }
  547. .materialStatisticsTable{
  548. margin-top: 1%;
  549. // border: 2px solid #000066 !important;
  550. }
  551. .materialStatisticsTable::before{
  552. background-color:#000066 ;
  553. }
  554. .materialStatisticsTable::after{
  555. background-color:#000066 ;
  556. }
  557. }
  558. </style>
  559. <style lang="scss" scoped>
  560. .customTable{
  561. .el-table__header-wrapper th{
  562. background-color: #199ED8;
  563. }
  564. .el-table--border th.el-table__cell{
  565. // border: 2px solid #000066 !important;
  566. }
  567. .el-table__empty-block{
  568. background-color: #199ED8;
  569. }
  570. .el-table__empty-text{
  571. color: #000066;
  572. }
  573. .el-table__cell{
  574. background-color: #199ED8 ;
  575. // border: 2px solid #000066 !important;
  576. }
  577. .el-table__cell >div{
  578. text-align: center;
  579. }
  580. .el-button{
  581. background-color: #169BD5;
  582. color: #fff;
  583. }
  584. }
  585. </style>