c7b34ceb92983c8b3388cd60a4883b2562e7b92f.svn-base 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221
  1. <template>
  2. <div>
  3. <el-container :style="{'height':this.tableHeight+'px'}" >
  4. <el-main style="border:1px solid #d5d5ff;margin-left:5px;padding:0px;overflow-x: hidden;">
  5. <el-table
  6. v-loading="loading"
  7. ref="multipleTable"
  8. :data="problemList"
  9. :height="tableHeight1"
  10. style="width: 100%">
  11. <el-table-column align="center" type="index" label="序号" min-width="70">
  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="140"
  20. prop="inspPblmsName"
  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="inspPblmName"
  37. label="详细描述"
  38. show-overflow-tooltip>
  39. </el-table-column>
  40. <el-table-column
  41. prop="collTime"
  42. label="上报时间"
  43. :formatter="timestampToTime"
  44. sortable
  45. align="center"
  46. min-width="100"
  47. show-overflow-tooltip>
  48. </el-table-column>
  49. <el-table-column
  50. align="center"
  51. prop
  52. min-width="80"
  53. label="操作"
  54. show-overflow-tooltip
  55. fixed="right">
  56. <template slot-scope="scope">
  57. <el-button icon="el-icon-view" title="查看详情"type="text" @click="showDetails(scope.row.pblmId)"></el-button>
  58. </template>
  59. </el-table-column>
  60. </el-table>
  61. </el-main>
  62. </el-container>
  63. <!-- 分页 -->
  64. <div class="paginationWarpper">
  65. <el-pagination
  66. class="paginationCenter"
  67. background
  68. @size-change="handleSizeChange"
  69. @current-change="search"
  70. :current-page.sync="currentPage"
  71. :page-sizes="[10, 20, 50, 100]"
  72. :page-size="pageSize"
  73. layout="total, sizes, prev, pager, next, jumper"
  74. :total="total">
  75. </el-pagination>
  76. </div>
  77. <!-- 详情组件-->
  78. <el-dialog
  79. class="custom_dialog"
  80. title="问题详情"
  81. width="60%"
  82. append-to-body
  83. :visible.sync="supervisionDetailsVisible">
  84. <supervision-details ref="xianqing" :problemId="currentProblemId"></supervision-details>
  85. <span slot="footer">
  86. <el-button style="margin-top:5px;" @click="supervisionDetailsVisible = false">返回</el-button>
  87. </span>
  88. </el-dialog>
  89. </div>
  90. </template>
  91. <script>
  92. import {formatDateTimeD} from '@util/gw_date.js'
  93. import request from '@util/gw_ajax_request.js'
  94. export default {
  95. props: ['currentObjectId','currentObjectName','currentObjectRgstrId','isJiangXi'],
  96. data(){
  97. return{
  98. tableHeight: window.innerHeight * 0.5,
  99. tableHeight1: window.innerHeight * 0.5 -2,
  100. problemList:[],
  101. loading: false,
  102. currentPage: 1,
  103. pageSize: 10,
  104. pageNum: 1,
  105. total: 0,
  106. supervisionDetailsVisible:false,
  107. currentProblemId: '',
  108. problemDeleteVisible: false,
  109. deleteId: '',
  110. editId: '',
  111. changeSupervisionVisible: false,
  112. showAddProblemDialog: false,
  113. rsvrRules: null,
  114. probId: '',
  115. }
  116. },
  117. components:{
  118. //详情页
  119. supervisionDetails: resolve => {
  120. require(["../../../duChaWenTi/supervisionDetails_shuiku.vue"], resolve);
  121. },
  122. },
  123. computed:{
  124. persId() {
  125. return localStorage.getItem("userid") ? localStorage.getItem("userid") : "1098101939614724096";
  126. }
  127. },
  128. created(){
  129. this.findItemByType()
  130. },
  131. mounted(){
  132. this.getProblemList()
  133. },
  134. methods:{
  135. getProblemList(){
  136. let problemForm = {}
  137. problemForm.objId = this.currentObjectId;
  138. problemForm.objType = '1';
  139. problemForm.pageNum = this.currentPage;
  140. problemForm.pageSize = this.pageSize;
  141. problemForm.presId = this.persId;
  142. if(this.isJiangXi){
  143. problemForm['repeat'] = '0'
  144. }
  145. this.loading = true;
  146. request.post(`/dc/insp/pblm/list/${this.persId}`, problemForm).then(res => {
  147. if (res.success) {
  148. this.problemList = res.data.list;
  149. this.total = res.data.total;
  150. this.loading = false;
  151. }
  152. }).catch(err=>{
  153. this.$message.error(err)
  154. this.loading = false;
  155. });
  156. },
  157. showDetails(pblmId){
  158. this.currentProblemId = pblmId
  159. this.supervisionDetailsVisible = true
  160. },
  161. changeSup(pblmId){
  162. this.editId = pblmId
  163. this.changeSupervisionVisible = true
  164. },
  165. removeSuperviseOne(pblmId){
  166. this.deleteId = pblmId
  167. this.problemDeleteVisible = true
  168. },
  169. deleteSuccess() {
  170. this.problemDeleteVisible = false;
  171. this.getProblemList();
  172. },
  173. search(val){
  174. this.currentPage = val
  175. this.getProblemList()
  176. },
  177. handleSizeChange(){},
  178. timestampToTime(row, column) {
  179. var date = new Date(row.collTime);
  180. var Y = date.getFullYear() + "-";
  181. var M =
  182. (date.getMonth() + 1 < 10
  183. ? "0" + (date.getMonth() + 1)
  184. : "0" + date.getMonth() + 1) + "-";
  185. var D =
  186. (date.getDate() < 10 ? "0" + date.getDate() : date.getDate()) + " ";
  187. var h =
  188. (date.getHours() < 10 ? "0" + date.getHours() : date.getHours()) + ":";
  189. var m =
  190. date.getMinutes() < 10 ? "0" + date.getMinutes() : date.getMinutes();
  191. return Y + M + D + h + m;
  192. },
  193. closeEditDialog(){
  194. this.changeSupervisionVisible = false
  195. },
  196. findItemByType(){
  197. const obj ={
  198. tname: "BIS_INSP_BASE_PRES_EXT"
  199. }
  200. request.post("/bis/insp/item/ques/info/findItemByType",obj).then(res =>{
  201. this.rsvrRules = res.data;
  202. })
  203. },
  204. addProblem(item){
  205. let rest = this.rsvrRules
  206. this.probId = rest[0].id;
  207. this.showAddProblemDialog = true
  208. },
  209. closePlDialog(val) {
  210. this.showAddProblemDialog = false;
  211. this.getProblemList()
  212. }
  213. }
  214. }
  215. </script>
  216. <style scoped>
  217. </style>