PpChart.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244
  1. <template>
  2. <div class="app-container-Pp">
  3. <div id="PpChart" :style="{height:height,width:width}"></div>
  4. <el-dialog :title="title" :visible.sync="open" width="1600px" >
  5. <el-button
  6. type="warning"
  7. icon="el-icon-download"
  8. size="mini"
  9. @click="handleExport"
  10. >{{ $t('导出') }}</el-button>
  11. <el-table ref="deviceTable" :data="specYlgdList"
  12. border >
  13. <el-table-column :label="$t('装置名称')" align="center" fixed="left" prop="plantCode" :show-overflow-tooltip="true"/>
  14. <el-table-column :label="$t('单元')" align="center" fixed="left" prop="unit" :show-overflow-tooltip="true"/>
  15. <el-table-column :label="$t('装置维修组')" align="center" fixed="left" prop="plantMaint" :show-overflow-tooltip="true"/>
  16. <el-table-column :label="$t('装置维修工程师')" align="center" fixed="left" prop="engineer" :show-overflow-tooltip="true"/>
  17. <el-table-column :label="$t('管道名称')" align="center" fixed="left" prop="devname" :show-overflow-tooltip="true"/>
  18. <el-table-column :label="$t('管道编号')" align="center" fixed="left" prop="devno" :show-overflow-tooltip="true"/>
  19. <el-table-column :label="$t('注册代码')" align="center" prop="regno" :show-overflow-tooltip="true"/>
  20. <el-table-column :label="$t('使用登记证编号')" align="center" prop="useno" :show-overflow-tooltip="true"/>
  21. <el-table-column :label="$t('管道级别')" align="center" prop="grade" :show-overflow-tooltip="true"/>
  22. <el-table-column :label="$t('设计单位')" align="center" prop="designer" :show-overflow-tooltip="true"/>
  23. <el-table-column :label="$t('安装单位')" align="center" prop="installer" :show-overflow-tooltip="true"/>
  24. <el-table-column :label="$t('安装年月')" align="center" prop="installDate" width="100">
  25. <template slot-scope="scope">
  26. <span>{{ parseTime(scope.row.installDate, '{y}-{m') }}</span>
  27. </template>
  28. </el-table-column>
  29. <el-table-column :label="$t('投用年月')" align="center" prop="submitdate" width="100">
  30. <template slot-scope="scope">
  31. <span>{{ parseTime(scope.row.submitdate, '{y}-{m}') }}</span>
  32. </template>
  33. </el-table-column>
  34. <el-table-column :label="$t('材质')" align="center" prop="material" :show-overflow-tooltip="true"/>
  35. <el-table-column :label="$t('公称直径')" align="center" prop="dia" :show-overflow-tooltip="true"/>
  36. <el-table-column :label="$t('壁厚(mm)')" align="center" prop="scheduleNo" :show-overflow-tooltip="true"/>
  37. <el-table-column :label="$t('长度')+'(m)'" align="center" prop="length" :show-overflow-tooltip="true"/>
  38. <el-table-column :label="$t('焊口数量')" align="center" prop="weldNumber" :show-overflow-tooltip="true"/>
  39. <el-table-column :label="$t('起点')" align="center" prop="starting" :show-overflow-tooltip="true"/>
  40. <el-table-column :label="$t('终点')" align="center" prop="ending" :show-overflow-tooltip="true"/>
  41. <el-table-column :label="$t('敷设方式')" align="center" prop="layingMethod" :show-overflow-tooltip="true"/>
  42. <el-table-column :label="$t('介质')" align="center" prop="medium" :show-overflow-tooltip="true"/>
  43. <el-table-column :label="$t('设计压力')+'(MPa)'" align="center" prop="desPressure" :show-overflow-tooltip="true"/>
  44. <el-table-column :label="$t('工作压力')+'(MPa)'" align="center" prop="optPressure" :show-overflow-tooltip="true"/>
  45. <el-table-column :label="$t('设计温度')+'(℃)'" align="center" prop="desTemp" :show-overflow-tooltip="true"/>
  46. <el-table-column :label="$t('工作温度')+'(℃)'" align="center" prop="optTemp" :show-overflow-tooltip="true"/>
  47. <el-table-column :label="$t('绝热层代码')" align="center" prop="adiabatic" :show-overflow-tooltip="true"/>
  48. <el-table-column :label="$t('防腐层代码')" align="center" prop="antiCorrosion" :show-overflow-tooltip="true"/>
  49. <el-table-column :label="$t('是否涉危化品')" align="center" prop="isDanger" :show-overflow-tooltip="true"/>
  50. <el-table-column :label="$t('检验单位')" align="center" prop="checkUnit" :show-overflow-tooltip="true"/>
  51. <el-table-column :label="$t('定期检验日期')" align="center" prop="warnDate" width="100">
  52. <template slot-scope="scope">
  53. <span>{{ parseTime(scope.row.warnDate, '{y}-{m}-{d}') }}</span>
  54. </template>
  55. </el-table-column>
  56. <el-table-column :label="$t('安全状况等级')" align="center" prop="safeClass" :show-overflow-tooltip="true"/>
  57. <el-table-column :label="$t('下次定期检验日期')" align="center" prop="nextWarnDate" width="100" sortable="custom">
  58. <template slot-scope="scope">
  59. <span>{{ parseTime(scope.row.nextWarnDate, '{y}-{m}-{d}') }}</span>
  60. </template>
  61. </el-table-column>
  62. <el-table-column :label="$t('定期检验报告编号')" align="center" prop="reportNo" :show-overflow-tooltip="true"/>
  63. <el-table-column :label="$t('年度检查日期')" align="center" prop="yearWarnDate" width="100">
  64. <template slot-scope="scope">
  65. <span>{{ parseTime(scope.row.yearWarnDate, '{y}-{m}-{d}') }}</span>
  66. </template>
  67. </el-table-column>
  68. <el-table-column :label="$t('年度检查结论')" align="center" prop="checkConclusion" :show-overflow-tooltip="true"/>
  69. <el-table-column :label="$t('下次年度检查日期')" align="center" prop="yearNextWarnDate" width="100">
  70. <template slot-scope="scope">
  71. <span>{{ parseTime(scope.row.yearNextWarnDate, '{y}-{m}-{d}') }}</span>
  72. </template>
  73. </el-table-column>
  74. <el-table-column :label="$t('年度检查报告编号')" align="center" prop="yearReportNo" :show-overflow-tooltip="true"/>
  75. <el-table-column :label="$t('备注')" align="center" prop="remarks" :show-overflow-tooltip="true"/>
  76. </el-table>
  77. <pagination
  78. v-show="total>0"
  79. :total="total"
  80. :page.sync="queryParams.pageNum"
  81. :limit.sync="queryParams.pageSize"
  82. @pagination="getList"
  83. />
  84. </el-dialog>
  85. </div>
  86. </template>
  87. <script>
  88. import {devYlgdData, devYlgdDataByYear,exportSpecYlgd} from "@/api/sems/home";
  89. export default {
  90. props: {
  91. width: {
  92. type: String,
  93. default: '100%'
  94. },
  95. height: {
  96. type: String,
  97. default: '3.3rem'
  98. },
  99. year: {
  100. type: Number,
  101. }
  102. },
  103. data() {
  104. return {
  105. chart: null,
  106. open: false,
  107. title: '设备列表',
  108. // 总条数
  109. total: 0,
  110. specYlgdList: [],
  111. // 查询参数
  112. queryParams: {
  113. pageNum: 1,
  114. pageSize: 20,
  115. status: 1,
  116. plantIds: null,
  117. unitIds: null,
  118. checkYear: null
  119. },
  120. optionYlrq: {
  121. tooltip: {
  122. trigger: 'axis',
  123. axisPointer: {
  124. type: 'cross',
  125. crossStyle: {
  126. color: '#999'
  127. }
  128. }
  129. },
  130. toolbox: {
  131. feature: {
  132. }
  133. },
  134. /* 周围边距 */
  135. grid: {
  136. left: '3%',
  137. right: '3%',
  138. bottom: '1%',
  139. top: '13%',
  140. containLabel: true
  141. },
  142. legend: {
  143. data: [this.$t('devTotalChart'), this.$t('usage')]
  144. },
  145. xAxis: [
  146. {
  147. type: 'category',
  148. data: [this.$t('压力容器'), this.$t('压力管道'), this.$t('吊装设备'), this.$t('锅炉'), this.$t('电梯')],
  149. axisPointer: {
  150. type: 'shadow'
  151. }
  152. }
  153. ],
  154. yAxis: [
  155. {
  156. type: 'value',
  157. name: this.$t('devTotalChart'),
  158. min: 0,
  159. axisLabel: {
  160. formatter: '{value}'
  161. }
  162. }
  163. ],
  164. series: [
  165. {
  166. name: this.$t('devTotalChart'),
  167. type: 'bar',
  168. barWidth: 40,
  169. itemStyle: {
  170. normal: {
  171. barBorderRadius: [9, 9, 0, 0],
  172. }
  173. },
  174. stack: this.$t('devTotalChart'),
  175. data: [2.0, 4.9, 7.0, 23.2, 25.6]
  176. }
  177. ],
  178. },
  179. }
  180. },
  181. mounted() {
  182. this.chart = this.echarts.init(document.getElementById('PpChart'))
  183. },
  184. methods: {
  185. initChart() {
  186. this.chart.clear()
  187. this.chart.setOption(this.optionYlrq)
  188. window.addEventListener('resize', () => {
  189. this.chart.resize()
  190. })
  191. },
  192. devYlgdData(plantIds ,unitIds ){
  193. let params = {
  194. 'plantIds': plantIds,
  195. 'unitIds': unitIds
  196. }
  197. this.queryParams.plantIds = plantIds.join()
  198. this.queryParams.unitIds = unitIds.join()
  199. devYlgdData(params).then(response => {
  200. this.optionYlrq.xAxis[0].data = response.data.ylrqData.yearList
  201. this.optionYlrq.series[0].data = response.data.ylrqData.countList
  202. this.initChart()
  203. let _this = this
  204. this.chart.on('click', function(params) {
  205. // 控制台打印数据的名称
  206. console.log(params);
  207. _this.open = true
  208. _this.queryParams.checkYear = params.name
  209. _this.getList()
  210. });
  211. });
  212. },
  213. /** 查询特种设备压力容器台账列表 */
  214. getList() {
  215. this.loading = true;
  216. devYlgdDataByYear(this.queryParams).then(response => {
  217. this.specYlgdList = response.rows;
  218. this.total = response.total;
  219. this.$nextTick(() => {
  220. this.$refs.deviceTable.doLayout(); // 解决表格错位
  221. });
  222. this.loading = false;
  223. });
  224. },
  225. /** 导出按钮操作 */
  226. handleExport() {
  227. const queryParams = this.queryParams;
  228. this.$confirm(this.$t('是否确认导出所有特种设备压力管道台账数据项?'), this.$t('警告'), {
  229. confirmButtonText: this.$t('确定'),
  230. cancelButtonText: this.$t('取消'),
  231. type: "warning"
  232. }).then(function() {
  233. return exportSpecYlgd(queryParams);
  234. }).then(response => {
  235. this.download(response.msg);
  236. })
  237. },
  238. }
  239. }
  240. </script>