1182c8d7e118cb480918d5c3b3d42672b02ea965.svn-base 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267
  1. <template>
  2. <div>
  3. <el-button @click="addProblem" type="primary" style="float: right;margin-bottom: 10px" v-if="openType">添加问题</el-button>
  4. <el-table
  5. v-loading="loading"
  6. border
  7. ref="multipleTable"
  8. :data="problemList"
  9. :height="tableHeight"
  10. tooltip-effect="dark"
  11. style="width: 100%"
  12. >
  13. <el-table-column align="center" type="index" label="序号" min-width="40">
  14. <template slot-scope="scope">{{ (currentPage - 1) * pageSize + (scope.$index + 1) }}</template>
  15. </el-table-column>
  16. <el-table-column
  17. header-align="center"
  18. align="center"
  19. min-width="100"
  20. prop="inspPblmDesc"
  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="ifCasePblm"
  29. label="是否典型"
  30. :formatter="ifCasePblm"
  31. show-overflow-tooltip
  32. ></el-table-column>
  33. <el-table-column
  34. prop="collTime"
  35. label="上报时间"
  36. sortable
  37. align="center"
  38. min-width="100"
  39. show-overflow-tooltip
  40. >
  41. <template
  42. slot-scope="scope"
  43. >{{scope.row.collTime ? formatDateTime(scope.row.collTime) : ''}}</template>
  44. </el-table-column>
  45. <el-table-column align="center" min-width="100" label="操作" show-overflow-tooltip>
  46. <template slot-scope="scope">
  47. <el-button icon="el-icon-view" title="查看详情"type="text" @click="showDetails(scope.row.pblmId)"></el-button>
  48. <el-button
  49. icon="el-icon-edit"
  50. type="text"
  51. @click="changeSup(scope.row.pblmId)"
  52. v-if="ownPriv('manage') && openType"
  53. ></el-button>
  54. <el-button
  55. icon="el-icon-delete"
  56. type="text"
  57. v-if="ownPriv('manage') && openType"
  58. title="删除问题" @click="removeSuperviseOne(scope.row.pblmId)"
  59. ></el-button>
  60. </template>
  61. </el-table-column>
  62. </el-table>
  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. @close="detailClose"
  84. :visible.sync="supervisionDetailsVisible"
  85. >
  86. <supervision-details ref="xianqing" :problemId="currentProblemId"></supervision-details>
  87. <span slot="footer">
  88. <el-button style="margin-top:5px;" @click="supervisionDetailsVisible = false">返回</el-button>
  89. </span>
  90. </el-dialog>
  91. <!-- 删除组件 -->
  92. <el-dialog
  93. class="deleteDialog"
  94. title="问题删除描述"
  95. append-to-body
  96. :visible.sync="problemDeleteVisible"
  97. >
  98. <Problem-delete
  99. ref="deleteMiaoShu"
  100. :deleteProblemId="deleteId"
  101. @deleteSuccess="deleteSuccess"
  102. ></Problem-delete>
  103. <span slot="footer">
  104. <el-button @click="problemDeleteVisible = false">返回</el-button>
  105. </span>
  106. </el-dialog>
  107. <!-- 修改组件 -->
  108. <problem-edit
  109. :editId="editId"
  110. @closeEditDialog="closeEditDialog"
  111. v-if="changeSupervisionVisible"
  112. ></problem-edit>
  113. <!-- 添加问题组件 -->
  114. <problem-dialog
  115. v-if="showAddProblemDialog"
  116. fenlei="siluan"
  117. :objType="objType"
  118. :objId="currentObjectId"
  119. :objName="currentObjectName"
  120. @closeDialog="closePlDialog"
  121. :currentObjectRgstrId="currentObjectRgstrId"
  122. ></problem-dialog>
  123. </div>
  124. </template>
  125. <script>
  126. import { formatDateTime2 } from '@util/gw_date.js'
  127. import problemDialog from "../waterIntake/addProblemDialog.vue"
  128. import request from '@util/gw_ajax_request.js'
  129. export default {
  130. props: ['currentObjectId', 'currentObjectName', 'currentObjectRgstrId', 'activeLabel', 'objType','openType'],
  131. data () {
  132. return {
  133. tableHeight: window.innerHeight - 250,
  134. problemList: [],
  135. loading: false,
  136. currentPage: 1,
  137. pageSize: 10,
  138. pageNum: 1,
  139. total: 0,
  140. supervisionDetailsVisible: false,
  141. currentProblemId: '',
  142. problemDeleteVisible: false,
  143. deleteId: '',
  144. editId: '',
  145. changeSupervisionVisible: false,
  146. showAddProblemDialog: false,
  147. rsvrRules: null,
  148. probId: '',
  149. }
  150. },
  151. components: {
  152. //详情页
  153. supervisionDetails: resolve => {
  154. require(["../../duChaWenTi/supervisionDetails_siluan.vue"], resolve)
  155. },
  156. // 删除描述页
  157. ProblemDelete: resolve => {
  158. require(["../../duChaWenTi/problemDelete.vue"], resolve)
  159. },
  160. // 修改问题
  161. problemEdit: resolve => {
  162. require(["../../duChaWenTi/siLuanProblemModify.vue"], resolve)
  163. },
  164. problemDialog
  165. },
  166. computed: {
  167. persId () {
  168. return localStorage.getItem("userid") ? localStorage.getItem("userid") : "1098101939614724096"
  169. },
  170. formatDateTime () {
  171. return formatDateTime2
  172. },
  173. },
  174. created () {
  175. this.findItemByType()
  176. },
  177. mounted () {
  178. this.getProblemList()
  179. },
  180. methods: {
  181. getProblemList () {
  182. let problemForm = {}
  183. problemForm.objId = this.currentObjectId
  184. problemForm.objType = this.objType
  185. problemForm.pageNum = this.currentPage
  186. problemForm.pageSize = this.pageSize
  187. problemForm.presId = this.persId
  188. this.loading = true
  189. request.post(`/dc/insp/pblm/list/${this.persId}`, problemForm).then(res => {
  190. if (res.success) {
  191. this.problemList = res.data.list
  192. this.total = res.data.total
  193. this.loading = false
  194. }
  195. }).catch(err => {
  196. this.$message.error(err)
  197. this.loading = false
  198. })
  199. },
  200. showDetails (pblmId) {
  201. this.currentProblemId = pblmId
  202. this.supervisionDetailsVisible = true
  203. },
  204. changeSup (pblmId) {
  205. this.editId = pblmId
  206. this.changeSupervisionVisible = true
  207. },
  208. removeSuperviseOne (pblmId) {
  209. this.deleteId = pblmId
  210. this.problemDeleteVisible = true
  211. },
  212. deleteSuccess () {
  213. this.problemDeleteVisible = false
  214. this.getProblemList()
  215. },
  216. search (val) {
  217. this.currentPage = val
  218. this.getProblemList()
  219. },
  220. handleSizeChange () { },
  221. closeEditDialog () {
  222. this.changeSupervisionVisible = false
  223. this.getProblemList()
  224. },
  225. findItemByType () {
  226. const obj = {
  227. tname: "BIS_INSP_BASE_PRES_EXT"
  228. }
  229. request.post("/bis/insp/item/ques/info/findItemByType", obj).then(res => {
  230. this.rsvrRules = res.data
  231. })
  232. },
  233. addProblem (item) {
  234. let rest = this.rsvrRules
  235. this.probId = rest[0].id
  236. this.showAddProblemDialog = true
  237. },
  238. closePlDialog (val) {
  239. this.showAddProblemDialog = false
  240. this.getProblemList()
  241. },
  242. detailClose () {
  243. this.currentProblemId = ''
  244. },
  245. ifCasePblm (row) {
  246. if (row.ifCasePblm == '0') {
  247. return '否'
  248. } else if (row.ifCasePblm == '1') {
  249. return '是'
  250. } else {
  251. return row.ifCasePblm
  252. }
  253. }
  254. },
  255. watch: {
  256. activeLabel (val) {
  257. if (val == '问题清单') {
  258. this.getProblemList()
  259. }
  260. }
  261. }
  262. }
  263. </script>
  264. <style scoped>
  265. </style>