446afaac6a5d07e2aa4770d3934615a4c5b146ff.svn-base 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246
  1. <template>
  2. <div>
  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="40">
  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="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. 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="100"
  53. label="操作"
  54. show-overflow-tooltip
  55. fixed="right">
  56. <template slot-scope="scope">
  57. <el-button icon="el-icon-view" type="text" @click="showDetails(scope.row.pblmId)"></el-button>
  58. <el-button icon="el-icon-edit" type="text" @click="changeSup(scope.row.pblmId)"
  59. v-if="ownPriv('manage')"></el-button>
  60. <el-button icon="el-icon-delete" type="text" v-if="ownPriv('manage')"
  61. @click="removeSuperviseOne(scope.row.pblmId)"
  62. ></el-button>
  63. </template>
  64. </el-table-column>
  65. </el-table>
  66. <!-- 分页 -->
  67. <div class="paginationWarpper">
  68. <el-pagination
  69. class="paginationCenter"
  70. background
  71. @size-change="handleSizeChange"
  72. @current-change="search"
  73. :current-page.sync="currentPage"
  74. :page-sizes="[10, 20, 50, 100]"
  75. :page-size="pageSize"
  76. layout="total, sizes, prev, pager, next, jumper"
  77. :total="total">
  78. </el-pagination>
  79. </div>
  80. <!-- 详情组件-->
  81. <el-dialog
  82. class="custom_dialog"
  83. title="问题详情"
  84. width="60%"
  85. append-to-body
  86. :visible.sync="supervisionDetailsVisible">
  87. <supervision-details ref="xianqing" :problemId="currentProblemId" :objType="pType"></supervision-details>
  88. <span slot="footer">
  89. <el-button style="margin-top:5px;" @click="supervisionDetailsVisible = false">返回</el-button>
  90. </span>
  91. </el-dialog>
  92. </div>
  93. </template>
  94. <script>
  95. import {formatDateTimeD} from '@util/gw_date.js'
  96. import request from '@util/gw_ajax_request.js'
  97. export default {
  98. props: ['currentObjectId', 'currentObjectName', 'currentObjectRgstrId', 'activeLabel', 'pType'],
  99. data() {
  100. return {
  101. tableHeight: 450,
  102. problemList: [],
  103. loading: false,
  104. currentPage: 1,
  105. pageSize: 10,
  106. pageNum: 1,
  107. total: 0,
  108. supervisionDetailsVisible: false,
  109. currentProblemId: '',
  110. problemDeleteVisible: false,
  111. deleteId: '',
  112. editId: '',
  113. changeSupervisionVisible: false,
  114. showAddProblemDialog: false,
  115. rsvrRules: null,
  116. probId: '',
  117. pblmEascaderVisible: false,
  118. newModelData: null
  119. }
  120. },
  121. components: {
  122. //详情页
  123. supervisionDetails: resolve => {
  124. require(["../../../../duChaWenTi/supervisionDetails_shuiku.vue"], resolve);
  125. },
  126. },
  127. computed: {
  128. persId() {
  129. return localStorage.getItem("userid") ? localStorage.getItem("userid") : "1098101939614724096";
  130. }
  131. },
  132. created() {
  133. // this.findItemByType()
  134. },
  135. mounted() {
  136. this.getProblemList()
  137. },
  138. methods: {
  139. getProblemList() {
  140. let problemForm = {}
  141. problemForm.objId = this.currentObjectId;
  142. problemForm.objType = '29';
  143. problemForm.pageNum = this.currentPage;
  144. problemForm.pageSize = this.pageSize;
  145. problemForm.presId = this.persId;
  146. this.loading = true;
  147. request.post(`/dc/insp/pblm/list/${this.persId}`, problemForm).then(res => {
  148. if (res.success) {
  149. this.problemList = res.data.list;
  150. this.total = res.data.total;
  151. this.loading = false;
  152. }
  153. }).catch(err => {
  154. this.$message.error(err)
  155. this.loading = false;
  156. });
  157. },
  158. showDetails(pblmId) {
  159. this.currentProblemId = pblmId
  160. this.supervisionDetailsVisible = true
  161. },
  162. changeSup(pblmId) {
  163. this.editId = pblmId
  164. this.changeSupervisionVisible = true
  165. },
  166. removeSuperviseOne(pblmId) {
  167. this.deleteId = pblmId
  168. this.problemDeleteVisible = true
  169. },
  170. deleteSuccess() {
  171. this.problemDeleteVisible = false;
  172. this.getProblemList();
  173. },
  174. search(val) {
  175. this.currentPage = val
  176. this.getProblemList()
  177. },
  178. handleSizeChange() {
  179. },
  180. timestampToTime(row, column) {
  181. var date = new Date(row.collTime);
  182. var Y = date.getFullYear() + "-";
  183. var M =
  184. (date.getMonth() + 1 < 10
  185. ? "0" + (date.getMonth() + 1)
  186. : date.getMonth() + 1) + "-";
  187. var D =
  188. (date.getDate() < 10 ? "0" + date.getDate() : date.getDate()) + " ";
  189. var h =
  190. (date.getHours() < 10 ? "0" + date.getHours() : date.getHours()) + ":";
  191. var m =
  192. date.getMinutes() < 10 ? "0" + date.getMinutes() : date.getMinutes();
  193. return Y + M + D + h + m;
  194. },
  195. closeEditDialog() {
  196. this.changeSupervisionVisible = false
  197. this.getProblemList()
  198. },
  199. // findItemByType(){
  200. // const obj ={
  201. // tname: "BIS_INSP_BASE_PRES_EXT"
  202. // }
  203. // request.post("/bis/insp/item/ques/info/findItemByType",obj).then(res =>{
  204. // this.rsvrRules = res.data;
  205. // })
  206. // },
  207. addProblem(item) {
  208. this.pblmEascaderVisible = true;
  209. },
  210. closePlDialog(val) {
  211. this.showAddProblemDialog = false;
  212. this.getProblemList();
  213. this.newModelData = null;
  214. },
  215. submitEascader() {
  216. if (!this.newModelData || !this.newModelData.model.length) {
  217. this.$message.warning('问题不可以为空');
  218. return;
  219. }
  220. this.pblmEascaderVisible = false;
  221. // let rest = this.rsvrRules
  222. // this.probId = rest[0].id;
  223. this.showAddProblemDialog = true
  224. },
  225. modelData(val) {
  226. this.newModelData = val;
  227. }
  228. },
  229. watch: {
  230. activeLabel(val) {
  231. if (val == '问题清单') {
  232. this.getProblemList()
  233. }
  234. }
  235. }
  236. }
  237. </script>
  238. <style lang="scss">
  239. .pblmEascader .el-dialog__body {
  240. height: 15vh;
  241. overflow: auto;
  242. }
  243. </style>