d5812207dd966461e5bfc9db08ca3b7b0c3d1e93.svn-base 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203
  1. <template>
  2. <div :style="{'height':testHeight1+'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="80">
  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. <el-button icon="el-icon-edit" type="text" title="修改问题" @click="changeSup(scope.row.pblmId)" v-if="ownPriv('manage')"></el-button>
  70. <el-button icon="el-icon-delete" type="text" v-if="ownPriv('manage')" title="删除问题" @click="removeSuperviseOne(scope.row.pblmId)"
  71. ></el-button>
  72. </template>
  73. </el-table-column>
  74. </el-table>
  75. <!-- 分页 -->
  76. <div class="paginationWarpper">
  77. <el-pagination
  78. class="paginationCenter"
  79. background
  80. @size-change="handleSizeChange"
  81. @current-change="search"
  82. :current-page.sync="currentPage"
  83. :page-sizes="[10, 20, 50, 100]"
  84. :page-size="pageSize"
  85. layout="total, sizes, prev, pager, next, jumper"
  86. :total="total">
  87. </el-pagination>
  88. </div>
  89. </div>
  90. </template>
  91. <script>
  92. import {formatDateTimeD} from '@util/gw_date.js'
  93. import request from '@util/gw_ajax_request.js'
  94. import {dateFormat} from "@util/gw_date";
  95. export default {
  96. props: ['currentObjectRgstrId'],
  97. data(){
  98. return{
  99. testHeight1:window.innerHeight * 0.5,
  100. tableHeight: window.innerHeight - 250,
  101. problemList:[],
  102. loading: false,
  103. currentPage: 1,
  104. pageSize: 10,
  105. pageNum: 1,
  106. total: 0,
  107. supervisionDetailsVisible:false,
  108. currentProblemId: '',
  109. problemDeleteVisible: false,
  110. deleteId: '',
  111. editId: '',
  112. changeSupervisionVisible: false,
  113. showAddProblemDialog: false,
  114. rsvrRules: null,
  115. probId: '',
  116. }
  117. },
  118. components:{
  119. },
  120. computed:{
  121. persId() {
  122. return localStorage.getItem("userid") ? localStorage.getItem("userid") : "1098101939614724096";
  123. }
  124. },
  125. created(){
  126. },
  127. mounted(){
  128. this.getProblemList()
  129. },
  130. methods:{
  131. getProblemList(){
  132. let problemForm = {}
  133. problemForm.regid = this.currentObjectRgstrId;
  134. problemForm.pageNum = this.currentPage;
  135. problemForm.pageSize = this.pageSize;
  136. problemForm.presId = this.persId;
  137. problemForm['objType'] = '12';
  138. this.loading = true;
  139. request.post(`/dc/insp/pblm/page`,problemForm).then(res => {
  140. if (res.success) {
  141. res.data.list.forEach((item)=>{
  142. if(item.fdTm){
  143. item.findTime = typeof(item.fdTm) == 'string' ? item.fdTm : dateFormat(item.fdTm,'yyyy-MM-dd')
  144. }
  145. })
  146. this.problemList = res.data.list;
  147. this.total = res.data.total;
  148. this.loading = false;
  149. }
  150. }).catch(err=>{
  151. this.$message.error(err)
  152. this.loading = false;
  153. });
  154. },
  155. showDetails(pblmId){
  156. this.currentProblemId = pblmId
  157. this.supervisionDetailsVisible = true
  158. },
  159. changeSup(pblmId){
  160. this.editId = pblmId
  161. this.changeSupervisionVisible = true
  162. },
  163. removeSuperviseOne(pblmId){
  164. this.deleteId = pblmId
  165. this.problemDeleteVisible = true
  166. },
  167. search(val){
  168. this.currentPage = val
  169. this.getProblemList()
  170. },
  171. handleSizeChange(){},
  172. timestampToTime(row, column) {
  173. var date = new Date(row);
  174. var Y = date.getFullYear() + "-";
  175. var M =
  176. (date.getMonth() + 1 < 10
  177. ? "0" + (date.getMonth() + 1)
  178. : date.getMonth() + 1) + "-";
  179. var D =
  180. (date.getDate() < 10 ? "0" + date.getDate() : date.getDate()) + " ";
  181. var h =
  182. (date.getHours() < 10 ? "0" + date.getHours() : date.getHours()) + ":";
  183. var m =
  184. date.getMinutes() < 10 ? "0" + date.getMinutes() : date.getMinutes();
  185. return Y + M + D + h + m;
  186. },
  187. closeEditDialog(){
  188. this.getProblemList()
  189. this.changeSupervisionVisible = false
  190. },
  191. },
  192. watch:{
  193. },
  194. filters:{
  195. }
  196. }
  197. </script>
  198. <style scoped>
  199. </style>