e58d2871e13ddf1e7b967a522796a51dcf966034.svn-base 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440
  1. <template>
  2. <div>
  3. <div class="detailsTop" style="border: 1px dotted skyblue;">
  4. <div id="fxwt" style="width: 100%;height: 100%;"></div>
  5. </div>
  6. <div class="detailsBottom" ref="table">
  7. <el-table
  8. border
  9. ref="multipleTable"
  10. :data="tableData"
  11. tooltip-effect="dark"
  12. >
  13. <el-table-column align="center" label="序号" min-width="50">
  14. <template slot-scope="scope">{{ (pageNum - 1) * pageSize + (scope.$index + 1) }}</template>
  15. </el-table-column>
  16. <el-table-column
  17. header-align="center"
  18. align="center"
  19. min-width="100"
  20. label="类型"
  21. show-overflow-tooltip
  22. >
  23. <template slot-scope="scope">
  24. {{scope.row.villType | dcType}}
  25. </template>
  26. </el-table-column>
  27. <el-table-column
  28. header-align="center"
  29. align="center"
  30. min-width="100"
  31. prop="nm"
  32. label="名称"
  33. show-overflow-tooltip
  34. ></el-table-column>
  35. <el-table-column
  36. header-align="center"
  37. align="center"
  38. min-width="100"
  39. prop="inspPblmName"
  40. label="问题类别"
  41. show-overflow-tooltip
  42. ></el-table-column>
  43. <el-table-column
  44. header-align="center"
  45. align="center"
  46. min-width="100"
  47. prop="inspPblmDesc"
  48. label="问题描述信息"
  49. show-overflow-tooltip
  50. ></el-table-column>
  51. <el-table-column
  52. header-align="center"
  53. align="center"
  54. min-width="80"
  55. label="操作"
  56. >
  57. <template slot-scope="scope">
  58. <el-button type="primary" size="mini" @click.stop="lookOver(scope.row)">详情</el-button>
  59. </template>
  60. </el-table-column>
  61. </el-table>
  62. <el-pagination
  63. @size-change="handleSizeChange"
  64. @current-change="handleCurrentChange"
  65. :current-page="pageNum"
  66. :page-sizes="[10, 20, 100]"
  67. :page-size="20"
  68. :pager-count="3"
  69. layout="total, sizes, prev, pager, next, jumper"
  70. :total="total"
  71. style="text-align: center;margin-top: 1vh;">
  72. </el-pagination>
  73. </div>
  74. <!-- 发现问题详情 -->
  75. <el-dialog
  76. class="outerDialog custom_dialog"
  77. title="问题详情"
  78. v-if="supervisionDetailsVisible"
  79. width="60%"
  80. :visible.sync="supervisionDetailsVisible"
  81. >
  82. <!--水库-->
  83. <supervision-details :problemId="currentProblemId" v-if="this.villType == '0'"></supervision-details>
  84. <!--行政村-->
  85. <xingzhengcun_Details :problemId="currentProblemId" v-if="this.villType == '1'"></xingzhengcun_Details>
  86. <!--饮水工程-->
  87. <yinshuigongcheng_Details :problemId="currentProblemId" v-if="this.villType == '2'"></yinshuigongcheng_Details>
  88. <!--水源地和人饮管理落实-->
  89. <shuiyuandi_Details :problemId="currentProblemId" v-if="this.villType == '3' || this.villType == '6'"></shuiyuandi_Details>
  90. <!--水毁-->
  91. <supervisionDetails_sh :problemId="currentProblemId" v-if="this.villType == '4'"></supervisionDetails_sh>
  92. <!--地下水-->
  93. <supervisionDetails_dxs :problemId="currentProblemId" v-if="this.villType == '5'"></supervisionDetails_dxs>
  94. <!--水闸-->
  95. <supervision-details :problemId="currentProblemId" :objType="6" v-if="this.villType == '7'"></supervision-details>
  96. <!--水利工程建设-->
  97. <el-tabs v-model="activeName" v-if="this.villType == '8'">
  98. <el-tab-pane label="问题详情" name="problem-detail">
  99. <problem-detail :problemId="currentProblemId" :projectType="projectType" :reviConc="reviConc"></problem-detail>
  100. </el-tab-pane>
  101. <el-tab-pane label="整改详情" name="rectify-detail" v-if="reviConc == '2'">
  102. <rectify-detail :rectifyId="rectifyId"></rectify-detail>
  103. </el-tab-pane>
  104. </el-tabs>
  105. <!--水利工程运行-->
  106. <el-tabs v-model="activeName" v-if="this.villType == '9'">
  107. <el-tab-pane label="问题详情" name="problem-detail">
  108. <problem-detail :problemId="currentProblemId" :projectType="projectType" :reviConc="reviConc"></problem-detail>
  109. </el-tab-pane>
  110. <el-tab-pane label="整改详情" name="rectify-detail" v-if="reviConc == '2'">
  111. <rectify-detail :rectifyId="rectifyId"></rectify-detail>
  112. </el-tab-pane>
  113. </el-tabs>
  114. <span slot="footer">
  115. <el-button style="margin-top:5px;" @click="supervisionDetailsVisible = false">返回</el-button>
  116. </span>
  117. </el-dialog>
  118. </div>
  119. </template>
  120. <script>
  121. import echarts from 'echarts'
  122. import request from '../../utils/gw_ajax_request';
  123. import problemDetail from '../duChaTianBao/project/problemDetails.vue'
  124. import rectifyDetail from '../duChaTianBao/project/rectifyDetails.vue'
  125. export default {
  126. name: "FxwtDetails",
  127. props: ["adCode","requestSttmTime","requestEntmTime","requestOrgId","requestObjectType"],
  128. components:{
  129. //水库详情页
  130. supervisionDetails: resolve => {
  131. require(["../duChaWenTi/supervisionDetails_shuiku.vue"], resolve);
  132. },
  133. //水毁详情页
  134. supervisionDetails_sh: resolve => {
  135. require(["../duChaWenTi/supervisionDetails_shuihui.vue"], resolve);
  136. },
  137. //行政村详情页
  138. xingzhengcun_Details: resolve => {
  139. require(["../duChaWenTi/supervisionDetails_xingzhengcun.vue"], resolve);
  140. },
  141. //饮水工程详情页
  142. yinshuigongcheng_Details: resolve => {
  143. require(["../duChaWenTi/supervisionDetails_yinshuigongcheng.vue"], resolve);
  144. },
  145. //水源地详情页
  146. shuiyuandi_Details: resolve => {
  147. require(["../duChaWenTi/supervisionDetails_shuiyuandi.vue"], resolve);
  148. },
  149. //水毁详情页
  150. supervisionDetails_dxs: resolve => {
  151. require(["../duChaWenTi/supervisionDetails_dxs.vue"], resolve);
  152. },
  153. //水利工程建设
  154. problemDetail: problemDetail,
  155. rectifyDetail: rectifyDetail,
  156. },
  157. data() {
  158. return {
  159. tableHeight: 0,
  160. tableData: [],
  161. pageNum: 1,
  162. pageSize: 20,
  163. total: 0,
  164. supervisionDetailsVisible: false,
  165. currentProblemId: '',
  166. villType: '',
  167. rectifyId: '',
  168. projectType: '',
  169. reviConc: '',
  170. activeName: 'problem-detail',
  171. xData: [],
  172. yData: []
  173. }
  174. },
  175. mounted() {
  176. this.getEcharts();
  177. this.getTableData();
  178. this.init();
  179. },
  180. methods:{
  181. init() {
  182. this.tableHeight = this.$refs['table'].offsetHeight - 45;
  183. },
  184. getTableData(){
  185. let params = {
  186. "adCode": this.adCode,
  187. "pageSize": this.pageSize,
  188. "pageNum": this.pageNum,
  189. "startTime": this.requestSttmTime,
  190. "endTime": this.requestEntmTime,
  191. "orgIds": this.requestOrgId,
  192. "pTypes": this.requestObjectType
  193. }
  194. this.$nextTick(function () {
  195. request.post(`/pc/index/findPblmByAdCode`,params).then(res =>{
  196. if(res.success){
  197. this.tableData = res.data.list;
  198. this.total = res.data.total;
  199. this.initCharts();
  200. }else{
  201. this.$message.error(res.message);
  202. }
  203. }).catch(err =>{
  204. this.$message.error(err);
  205. })
  206. })
  207. },
  208. getEcharts(){
  209. let params = {
  210. "adCode": this.adCode,
  211. "startTime": this.requestSttmTime,
  212. "endTime": this.requestEntmTime,
  213. "orgIds": this.requestOrgId,
  214. "pTypes": this.requestObjectType
  215. };
  216. this.$nextTick(function () {
  217. request.post(`/pc/index/findPblmCountByAdCode`, params).then(res => {
  218. if(res.success){
  219. let CountData = res.data;
  220. let xData = [];
  221. let yData = [];
  222. CountData.forEach((item, index) => {
  223. xData.push(item.name);
  224. yData.push(item.total);
  225. });
  226. this.xData = xData;
  227. this.yData = yData;
  228. console.log(this.xData,this.yData);
  229. this.initCharts();
  230. }
  231. }).catch(err => {
  232. })
  233. })
  234. },
  235. handleSizeChange(val) {
  236. this.pageSize = val;
  237. this.getTableData();
  238. },
  239. handleCurrentChange(val) {
  240. this.pageNum = val;
  241. this.getTableData();
  242. },
  243. //柱状图demo
  244. initCharts(){
  245. let me = this;
  246. me.myChart = echarts.init(document.getElementById('fxwt'));
  247. me.myChart.setOption({
  248. grid: {
  249. left: '7%',
  250. right: '5%',
  251. top: '15%',
  252. bottom: '25%',
  253. },
  254. title: {
  255. show: false
  256. },
  257. tooltip : {
  258. trigger: 'axis',
  259. label: {
  260. show: true
  261. },
  262. formatter: function (params) {
  263. return params[0].axisValue + ': ' +params[0].data + '个'
  264. }
  265. },
  266. legend: {
  267. data: me.xData,
  268. right: '3%',
  269. top: '10%',
  270. itemWidth: 11,
  271. itemHeight: 11,
  272. textStyle: {
  273. color: '#ffffff',
  274. fontSize: 13
  275. }
  276. },
  277. toolbox: {
  278. show: false,
  279. },
  280. xAxis: [
  281. {
  282. type: 'category',
  283. show: true,
  284. axisTick: {
  285. show: false,
  286. alignWithLabel: true
  287. },
  288. axisLabel: {
  289. rotate: 30,
  290. color: '#333',
  291. },
  292. axisLine: {
  293. show: true,
  294. lineStyle: {
  295. color: 'rgba(63, 158, 255, 1)'
  296. }
  297. },
  298. data: me.xData
  299. }
  300. ],
  301. yAxis: {
  302. axisLabel:{
  303. color:'#333'
  304. },
  305. axisLine: {
  306. show: true,
  307. lineStyle: {
  308. color: 'rgba(63, 158, 255, 1)'
  309. }
  310. },
  311. splitLine: {
  312. show: true,
  313. lineStyle: {
  314. type: 'dashed',
  315. color: 'rgba(33,148,246,0.2)'
  316. }
  317. },
  318. axisTick: {
  319. show: false
  320. },
  321. splitArea: {
  322. show: true,
  323. areaStyle: {
  324. color: 'rgba(255,255,255,1)'
  325. }
  326. },
  327. type: 'value',
  328. max: function(value) {
  329. return value.max;
  330. },
  331. min: function(value) {
  332. return value.min;
  333. },
  334. },
  335. series: [
  336. {
  337. type:'bar',
  338. label: {
  339. normal: {
  340. show: true,
  341. position: 'top',
  342. textStyle: {
  343. color: '#b87cf6'
  344. }
  345. }
  346. },
  347. itemStyle: {
  348. normal: {
  349. color: new echarts.graphic.LinearGradient(0, 1, 0, 0, [{
  350. offset: 0,
  351. color: "#b87cf6" // 0% 处的颜色
  352. }, {
  353. offset: 1,
  354. color: "#C58DF6" // 100% 处的颜色
  355. }], false)
  356. }
  357. },
  358. barWidth: '40%',
  359. yAxisIndex: 0,
  360. data: me.yData
  361. }
  362. ]
  363. });
  364. },
  365. // 详情接问题查看详情展示
  366. lookOver(row){
  367. console.log(row);
  368. this.villType = row.villType;
  369. this.currentProblemId = row.pblmId;
  370. if(row.villType == '8' || row.villType == '9'){
  371. this.rectifyId = row.guid;
  372. this.projectType = row.villType == '8' ? '1' : row.villType == '9' ? '2' : '1';
  373. this.reviConc = row.reviConc;
  374. }
  375. this.supervisionDetailsVisible = true;
  376. }
  377. },
  378. watch:{
  379. adCode(n,o){
  380. this.adCode = n;
  381. this.getTableData();
  382. }
  383. },
  384. filters:{
  385. dcType(val){
  386. switch (val) {
  387. case '0':
  388. return '小水库';
  389. break;
  390. case '1':
  391. return '行政村';
  392. break;
  393. case '2':
  394. return '饮水工程';
  395. break;
  396. case '3':
  397. return '水源地';
  398. break;
  399. case '4':
  400. return '水毁';
  401. break;
  402. case '5':
  403. return '地下水';
  404. break;
  405. case '6':
  406. return '人饮(落实情况)';
  407. break;
  408. case '7':
  409. return '水闸';
  410. break;
  411. case '8':
  412. return '水利工程建设';
  413. break;
  414. case '9':
  415. return '水利工程运行';
  416. break;
  417. }
  418. }
  419. },
  420. }
  421. </script>
  422. <style>
  423. .detailsTop,.detailsBottom{
  424. width: 100%;
  425. height: 30vh;
  426. overflow: auto;
  427. }
  428. .detailsBottom{
  429. margin-top: 2vh;
  430. }
  431. .v-modal{z-index: 1999 !important;}
  432. </style>