3c39cf70e19a043d497091b60d8b15cd18a16b2b.svn-base 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257
  1. <template>
  2. <el-main class="history_project">
  3. <el-card>
  4. <div>
  5. <el-form ref="form" :inline="true" label-width="84px">
  6. <el-form-item label="年度" prop="planYr">
  7. <el-date-picker
  8. v-model="year"
  9. type="year"
  10. value-format="yyyy"
  11. placeholder="选择年">
  12. </el-date-picker>
  13. </el-form-item>
  14. <el-form-item label="地市">
  15. <el-select v-model="adCode" clearable>
  16. <el-option :label="item.nm" :value="item.id" v-for="(item,index) in addvList"></el-option>
  17. </el-select>
  18. </el-form-item>
  19. <el-form-item label="工程名称">
  20. <el-input v-model="objName" clearable autocomplete="off" style="width: 160px"></el-input>
  21. </el-form-item>
  22. <el-form-item label="问题名称">
  23. <el-input v-model="pblmNm" clearable autocomplete="off" style="width: 160px"></el-input>
  24. </el-form-item>
  25. <el-form-item label="单位名称">
  26. <el-input v-model="subjectNames" clearable autocomplete="off" style="width: 160px"></el-input>
  27. </el-form-item>
  28. <el-form-item label="严重程度">
  29. <el-select v-model="pblmPasi" clearable placeholder="请选择" style="width: 90px">
  30. <el-option
  31. v-for="item in problemType"
  32. :key="item.value"
  33. :label="item.label"
  34. :value="item.value">
  35. </el-option>
  36. </el-select>
  37. </el-form-item>
  38. <el-button style="margin-left:0;padding:7px 10px;" type="primary" @click="getProblemList()">查询</el-button>
  39. </el-form>
  40. </div>
  41. <div>
  42. <el-table
  43. :data="tableData"
  44. border
  45. stripe
  46. v-loading='loading'
  47. :height="tableHeight"
  48. style="width: 100%">
  49. <el-table-column align="center" label="序号" min-width="20">
  50. <template slot-scope="scope">{{ (pageIndex - 1) * pageSize + (scope.$index + 1) }}</template>
  51. </el-table-column>
  52. <el-table-column
  53. prop="objName"
  54. label="工程名称"
  55. show-overflow-tooltip
  56. min-width="100">
  57. </el-table-column>
  58. <el-table-column
  59. prop="location"
  60. label="所属区域"
  61. show-overflow-tooltip
  62. min-width="60">
  63. </el-table-column>
  64. <el-table-column
  65. prop="pblmNm"
  66. label="问题名称"
  67. show-overflow-tooltip
  68. min-width="120">
  69. </el-table-column>
  70. <el-table-column
  71. prop="pblmDesc"
  72. show-overflow-tooltip
  73. label="问题阐述"
  74. show-overflow-tooltip
  75. min-width="200">
  76. </el-table-column>
  77. <el-table-column
  78. prop="pblmPasi"
  79. min-width="40"
  80. label="严重程度">
  81. <template slot-scope="scope">
  82. <p v-if="scope.row.pblmPasi == 0"><span class="inspPblmCate"
  83. style="background: #27C19F;">一般</span></p>
  84. <p v-if="scope.row.pblmPasi == 1"><span class="inspPblmCate"
  85. style="background: #E6A23C;">较重</span></p>
  86. <p v-if="scope.row.pblmPasi == 2"><span class="inspPblmCate"
  87. style="background: #F56C6C;">严重</span></p>
  88. </template>
  89. </el-table-column>
  90. <el-table-column
  91. prop="pblmReason"
  92. show-overflow-tooltip
  93. min-width="160"
  94. label="主要原因分析">
  95. </el-table-column>
  96. <el-table-column
  97. label="操作"
  98. width="100">
  99. <template slot-scope="scope">
  100. <el-button type="text" size="small" @click="toCheckDetail(scope.row)">查看</el-button>
  101. </template>
  102. </el-table-column>
  103. </el-table>
  104. </div>
  105. <div style="margin: 10px auto;overflow: auto;">
  106. <el-pagination
  107. style="float:left;"
  108. background
  109. @size-change="handleSizeChange"
  110. @current-change="pageIndexChange"
  111. :current-page.sync="pageNum"
  112. :page-sizes="[10, 20, 300, 40]"
  113. :page-size="pageSize"
  114. layout="total, prev, pager, next, jumper"
  115. :total="total">
  116. </el-pagination>
  117. </div>
  118. <problem-detail-com v-if="showFileVisiual" :problemId="problemId"
  119. @dialogClose="dialogClose"></problem-detail-com>
  120. </el-card>
  121. </el-main>
  122. </template>
  123. <script>
  124. import request from "@util/gw_ajax_request"
  125. import ProblemDetailCom from './dialogCom/ProblemDetails1.vue'
  126. export default {
  127. data() {
  128. return {
  129. problemType: [
  130. {label: '一般', value: '0'},
  131. {label: '较重', value: '1'},
  132. {label: '严重', value: '2'}
  133. ],
  134. year: "",
  135. adCode: "",
  136. objName: "",
  137. addvList: [],
  138. pblmPasi: '', //严重程度
  139. pblmNm: '',
  140. showFileVisiual: false,
  141. subjectNames: '', //单位名称,多个单位逗号拼接字符串
  142. tableData: [],
  143. problemId: '',
  144. pageIndex: 1,
  145. pageSize: 20,
  146. total: 0,
  147. loading: false,
  148. tableHeight: window.innerHeight - 300,
  149. }
  150. },
  151. components: {
  152. ProblemDetailCom
  153. },
  154. computed: {
  155. persId() {
  156. return localStorage.getItem("userid") ? localStorage.getItem("userid") : "1098101939614724096";
  157. },
  158. organCode() {
  159. return localStorage.getItem('currentRlcode') ? localStorage.getItem('currentRlcode') : ''
  160. },
  161. },
  162. created() {
  163. this.getCityAddvcd();
  164. },
  165. mounted() {
  166. if(this.$route.query.date){
  167. this.year = this.$route.query.date;
  168. this.adCode = this.$route.query.adCode;
  169. }
  170. this.getProblemList();
  171. },
  172. activated() {
  173. },
  174. methods: {
  175. //获取地市级行政区划
  176. getCityAddvcd() {
  177. var _self = this;
  178. request.get(`/dc/att/adXBase/getAdTreeByAdCd`, {
  179. params: {
  180. 'adCd': this.organCode,
  181. 'level': "2",
  182. }
  183. }).then(res => {
  184. if (res.success) {
  185. _self.addvList = res.data.children;
  186. }
  187. })
  188. },
  189. getProblemList() {
  190. this.loading = true;
  191. let paramsObj = {
  192. year: this.year,
  193. adCode: this.adCode,
  194. objName: this.objName,
  195. pblmNm: this.pblmNm,
  196. subjectNames: this.subjectNames,
  197. pblmPasi: this.pblmPasi,
  198. pageNum: this.pageIndex,
  199. pageSize: this.pageSize
  200. };
  201. request.post(`tac/province/pblm/info/finalResults`, paramsObj).then(res => {
  202. if (res.success) {
  203. this.loading = false;
  204. this.tableData = res.data.list;
  205. this.total = res.data.total
  206. } else {
  207. this.loading = false
  208. this.$message.error(res.message)
  209. }
  210. }).catch(err => {
  211. this.$message.error(err)
  212. })
  213. },
  214. pageIndexChange(val) {
  215. this.pageIndex = val;
  216. this.getProblemList();
  217. },
  218. handleSizeChange(val) {
  219. this.pageSize = val;
  220. this.getProblemList();
  221. },
  222. dialogClose() {
  223. this.showFileVisiual = false
  224. this.getProblemList()
  225. },
  226. // 查看问题详情
  227. toCheckDetail(row) {
  228. this.problemId = row.id
  229. this.showFileVisiual = true
  230. }
  231. },
  232. watch: {}
  233. }
  234. </script>
  235. <style lang="scss">
  236. .history_project {
  237. width: 100%;
  238. height: 100%;
  239. padding: 0;
  240. .inspPblmCate {
  241. padding: 2px 10px;
  242. border-radius: 10px;
  243. color: #ffffff;
  244. -webkit-border-radius: 10px;
  245. -moz-border-radius: 10px;
  246. border-radius: 10px;
  247. }
  248. .el-select {
  249. width: 8vw;
  250. }
  251. }
  252. </style>