db8fc53d8a64e0ba4b312bd5eae578486bf3247c.svn-base 9.2 KB

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