b663f3ece75e6f0338113ea3b7e82b5d5000443f.svn-base 11 KB

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