2f30b4e09857c3517c4e7afeaabc74a02b4519c6.svn-base 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230
  1. <template>
  2. <div :style="{'height': tableHeight1 + 'px'}">
  3. <el-table
  4. v-loading="loading"
  5. border
  6. ref="multipleTable"
  7. :data="problemList"
  8. :height="tableHeight"
  9. tooltip-effect="dark"
  10. style="width: 100%">
  11. <el-table-column align="center" type="index" label="序号" min-width="50">
  12. <template slot-scope="scope">
  13. {{ (currentPage - 1) * pageSize + (scope.$index + 1) }}
  14. </template>
  15. </el-table-column>
  16. <el-table-column
  17. header-align="center"
  18. align="center"
  19. min-width="120"
  20. prop="inspPblmName"
  21. label="问题类别"
  22. show-overflow-tooltip>
  23. </el-table-column>
  24. <el-table-column
  25. header-align="center"
  26. align="center"
  27. min-width="100"
  28. prop="checkPoint"
  29. label="检查项目"
  30. show-overflow-tooltip>
  31. </el-table-column>
  32. <el-table-column
  33. header-align="center"
  34. align="center"
  35. min-width="100"
  36. prop="inspPblmDesc"
  37. label="详细描述"
  38. show-overflow-tooltip>
  39. </el-table-column>
  40. <!-- <el-table-column
  41. header-align="center"
  42. align="center"
  43. prop="inspPblmCate"
  44. label="严重程度"
  45. min-width="90">
  46. <template slot-scope="scope">
  47. {{scope.row.inspPblmCate | inspPblmCate}}
  48. </template>
  49. </el-table-column> -->
  50. <el-table-column
  51. header-align="center"
  52. align="center"
  53. min-width="100"
  54. prop="ifCasePblm"
  55. label="是否典型"
  56. show-overflow-tooltip>
  57. <template slot-scope="scope">
  58. <span>{{scope.row.ifCasePblm == '1' ? '是' : scope.row.ifCasePblm == '0' ? '否' : ''}}</span>
  59. </template>
  60. </el-table-column>
  61. <el-table-column
  62. align="center"
  63. prop
  64. min-width="100"
  65. label="操作"
  66. show-overflow-tooltip>
  67. <template slot-scope="scope">
  68. <el-button icon="el-icon-view" title="查看详情"type="text" @click="showDetails(scope.row.pblmId)"></el-button>
  69. </template>
  70. </el-table-column>
  71. </el-table>
  72. <!-- 分页 -->
  73. <div class="paginationWarpper">
  74. <el-pagination
  75. class="paginationCenter"
  76. background
  77. @size-change="handleSizeChange"
  78. @current-change="search"
  79. :current-page.sync="currentPage"
  80. :page-sizes="[10, 20, 50, 100]"
  81. :page-size="pageSize"
  82. layout="total, sizes, prev, pager, next, jumper"
  83. :total="total">
  84. </el-pagination>
  85. </div>
  86. <!-- 详情组件-->
  87. <el-dialog
  88. class="custom_dialog"
  89. title="问题详情"
  90. width="60%"
  91. append-to-body
  92. :visible.sync="supervisionDetailsVisible">
  93. <supervision-details ref="xianqing" :problemId="currentProblemId"></supervision-details>
  94. <span slot="footer">
  95. <el-button style="margin-top:5px;" @click="supervisionDetailsVisible = false">返回</el-button>
  96. </span>
  97. </el-dialog>
  98. </div>
  99. </template>
  100. <script>
  101. import {formatDateTimeD} from '@util/gw_date.js'
  102. import request from '@util/gw_ajax_request.js'
  103. import {dateFormat} from "@util/gw_date";
  104. export default {
  105. props: ['currentObjectId','currentObjectName','currentObjectRgstrId'],
  106. data(){
  107. return{
  108. tableHeight: window.innerHeight * .45,
  109. tableHeight1: window.innerHeight * .55,
  110. problemList:[],
  111. loading: false,
  112. currentPage: 1,
  113. pageSize: 10,
  114. pageNum: 1,
  115. total: 0,
  116. supervisionDetailsVisible:false,
  117. currentProblemId: '',
  118. problemDeleteVisible: false,
  119. deleteId: '',
  120. editId: '',
  121. changeSupervisionVisible: false,
  122. showAddProblemDialog: false,
  123. rsvrRules: null,
  124. probId: '',
  125. }
  126. },
  127. components:{
  128. //详情页
  129. supervisionDetails: resolve => {
  130. require(["../../../../duChaTianBao/yongshuidw/problemDetail.vue"], resolve);
  131. }
  132. },
  133. computed:{
  134. persId() {
  135. return localStorage.getItem("userid") ? localStorage.getItem("userid") : "1098101939614724096";
  136. }
  137. },
  138. created(){
  139. // this.findItemByType()
  140. },
  141. mounted(){
  142. this.getProblemList()
  143. },
  144. methods:{
  145. getProblemList(){
  146. let problemForm = {}
  147. problemForm.regid = this.currentObjectRgstrId;
  148. problemForm.pageNum = this.currentPage;
  149. problemForm.pageSize = this.pageSize;
  150. problemForm.presId = this.persId;
  151. problemForm['objType'] = '16';
  152. this.loading = true;
  153. request.post(`/dc/insp/pblm/page`,problemForm).then(res => {
  154. if (res.success) {
  155. res.data.list.forEach((item)=>{
  156. if(item.fdTm){
  157. item.findTime = typeof(item.fdTm) == 'string' ? item.fdTm : dateFormat(item.fdTm,'yyyy-MM-dd')
  158. }
  159. })
  160. this.problemList = res.data.list;
  161. this.total = res.data.total;
  162. this.loading = false;
  163. }
  164. }).catch(err=>{
  165. this.$message.error(err)
  166. this.loading = false;
  167. });
  168. },
  169. showDetails(pblmId){
  170. this.currentProblemId = pblmId
  171. this.supervisionDetailsVisible = true
  172. },
  173. changeSup(pblmId){
  174. this.editId = pblmId
  175. this.changeSupervisionVisible = true
  176. },
  177. removeSuperviseOne(pblmId){
  178. this.deleteId = pblmId
  179. this.problemDeleteVisible = true
  180. },
  181. deleteSuccess() {
  182. this.problemDeleteVisible = false;
  183. this.getProblemList();
  184. },
  185. search(val){
  186. this.currentPage = val
  187. this.getProblemList()
  188. },
  189. handleSizeChange(){},
  190. closeEditDialog(){
  191. this.getProblemList()
  192. this.changeSupervisionVisible = false
  193. },
  194. addProblem(item){
  195. // let rest = this.rsvrRules;
  196. // this.probId = rest[0].id;
  197. this.showAddProblemDialog = true;
  198. },
  199. closePlDialog(val) {
  200. this.showAddProblemDialog = false;
  201. this.getProblemList()
  202. }
  203. },
  204. watch:{
  205. },
  206. filters:{
  207. inspPblmCate(val){
  208. if(!val || val == ''){
  209. return ''
  210. }
  211. if(val == '0'){
  212. return '一般'
  213. }else if(val == '1'){
  214. return '较重'
  215. }else if(val == '2'){
  216. return '严重'
  217. }else{
  218. return val
  219. }
  220. },
  221. }
  222. }
  223. </script>
  224. <style scoped>
  225. </style>