dfdecdf32c4712ec31a0db4be7b1ad36b1c0e9d2.svn-base 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300
  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. <el-table-column align="center" type="index" label="序号" min-width="40">
  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="140"
  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="120"
  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="130"
  37. prop="inspPblmDesc"
  38. label="问题描述"
  39. show-overflow-tooltip>
  40. </el-table-column>
  41. <el-table-column
  42. prop="collTime"
  43. label="上报时间"
  44. :formatter="timestampToTime"
  45. sortable
  46. align="center"
  47. min-width="120"
  48. show-overflow-tooltip>
  49. </el-table-column>
  50. <el-table-column
  51. align="center"
  52. prop
  53. min-width="100"
  54. label="操作"
  55. show-overflow-tooltip
  56. fixed="right">
  57. <template slot-scope="scope">
  58. <el-button icon="el-icon-view" title="查看详情"type="text" @click="showDetails(scope.row.pblmId)"></el-button>
  59. <el-button icon="el-icon-edit" type="text" title="修改问题" @click="changeSup(scope.row.pblmId)" v-if="isMine(scope.row) && ownPriv('manage') && openType"></el-button>
  60. <el-button icon="el-icon-delete" type="text" v-if="isMine(scope.row) && ownPriv('manage') && openType" title="删除问题" @click="removeSuperviseOne(scope.row.pblmId)"
  61. ></el-button>
  62. </template>
  63. </el-table-column>
  64. </el-table>
  65. <!-- 分页 -->
  66. <div class="paginationWarpper">
  67. <el-pagination
  68. class="paginationCenter"
  69. background
  70. @size-change="handleSizeChange"
  71. @current-change="search"
  72. :current-page.sync="currentPage"
  73. :page-sizes="[10, 20, 50, 100]"
  74. :page-size="pageSize"
  75. layout="total, sizes, prev, pager, next, jumper"
  76. :total="total">
  77. </el-pagination>
  78. </div>
  79. <!-- 详情组件-->
  80. <el-dialog
  81. class="custom_dialog"
  82. title="问题详情"
  83. width="60%"
  84. append-to-body
  85. :visible.sync="supervisionDetailsVisible">
  86. <supervision-details ref="xianqing" :problemId="currentProblemId" :objType="27"></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 class="deleteDialog" title="问题删除描述" append-to-body :visible.sync="problemDeleteVisible">
  93. <Problem-delete
  94. ref="deleteMiaoShu"
  95. :deleteProblemId="deleteId"
  96. @deleteSuccess="deleteSuccess"
  97. ></Problem-delete>
  98. <span slot="footer">
  99. <el-button @click="problemDeleteVisible = false">返回</el-button>
  100. </span>
  101. </el-dialog>
  102. <!-- 修改组件 -->
  103. <problem-edit :editId="editId" :objType="27" :adCode="adCode" :adName="adName" @closeEditDialog="closeEditDialog" v-if="changeSupervisionVisible"></problem-edit>
  104. <!-- 添加问题组件 -->
  105. <problem-dialog
  106. v-if="showAddProblemDialog"
  107. :objType="27"
  108. :villType="37"
  109. :objId="currentObjectId"
  110. :objName="currentObjectName"
  111. :adCode="adCode"
  112. :adName="adName"
  113. :problemMiddleType="'山洪灾害防御'"
  114. @closeDialog="closePlDialog"
  115. :newModelData="newModelData"
  116. :regId="currentObjectRgstrId">
  117. </problem-dialog>
  118. <el-dialog
  119. class="pblmEascader"
  120. title="新增问题"
  121. width="60%"
  122. append-to-body
  123. :visible.sync="pblmEascaderVisible">
  124. <pblmEascader :objType="27" @modelData="modelData" v-if="pblmEascaderVisible"></pblmEascader>
  125. <span slot="footer">
  126. <el-button @click="pblmEascaderVisible=false">返 回</el-button>
  127. <el-button type="primary" @click="submitEascader">确 定</el-button>
  128. </span>
  129. </el-dialog>
  130. </div>
  131. </template>
  132. <script>
  133. import {formatDateTimeD} from '@util/gw_date.js'
  134. import problemDialog from "../../duChaWenTi/addProblem/xiaoshuiku_problem_dialog.vue";
  135. import request from '@util/gw_ajax_request.js'
  136. import pblmEascader from '../project/pblmEascader'
  137. export default {
  138. props: ['currentObjectId','currentObjectName','currentObjectRgstrId','activeLabel','rowData','adCode','adName','openType'],
  139. data(){
  140. return{
  141. tableHeight: 490,
  142. problemList:[],
  143. loading: false,
  144. currentPage: 1,
  145. pageSize: 10,
  146. pageNum: 1,
  147. total: 0,
  148. supervisionDetailsVisible:false,
  149. currentProblemId: '',
  150. problemDeleteVisible: false,
  151. deleteId: '',
  152. editId: '',
  153. changeSupervisionVisible: false,
  154. showAddProblemDialog: false,
  155. rsvrRules: null,
  156. probId: '',
  157. pblmEascaderVisible: false,
  158. newModelData: null
  159. }
  160. },
  161. components:{
  162. //详情页
  163. supervisionDetails: resolve => {
  164. require(["../../duChaWenTi/problemDetails/supervisionDetails_shanhong.vue"], resolve);
  165. },
  166. // 删除描述页
  167. ProblemDelete: resolve => {
  168. require(["../../duChaWenTi/problemDelete.vue"], resolve);
  169. },
  170. // 修改问题
  171. problemEdit: resolve => {
  172. require(["../../duChaWenTi/problemModify/shanhongProblemModify.vue"], resolve);
  173. },
  174. problemDialog,
  175. pblmEascader
  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. isMine(row){
  190. return row.recPers == this.persId;
  191. },
  192. getProblemList(){
  193. let problemForm = {}
  194. problemForm.objId = this.currentObjectId;
  195. problemForm.objType = '27';
  196. problemForm.pageNum = this.currentPage;
  197. problemForm.pageSize = this.pageSize;
  198. problemForm.presId = this.persId;
  199. this.loading = true;
  200. request.post(`/dc/insp/pblm/list/${this.persId}`, problemForm).then(res => {
  201. if (res.success) {
  202. this.problemList = res.data.list;
  203. this.total = res.data.total;
  204. this.loading = false;
  205. }
  206. }).catch(err=>{
  207. this.$message.error(err)
  208. this.loading = false;
  209. });
  210. },
  211. showDetails(pblmId){
  212. this.currentProblemId = pblmId
  213. this.supervisionDetailsVisible = true
  214. },
  215. changeSup(pblmId){
  216. this.editId = pblmId
  217. this.changeSupervisionVisible = true
  218. },
  219. removeSuperviseOne(pblmId){
  220. this.deleteId = pblmId
  221. this.problemDeleteVisible = true
  222. },
  223. deleteSuccess() {
  224. this.problemDeleteVisible = false;
  225. this.getProblemList();
  226. },
  227. search(val){
  228. this.currentPage = val
  229. this.getProblemList()
  230. },
  231. handleSizeChange(){},
  232. timestampToTime(row, column) {
  233. var date = new Date(row.collTime);
  234. var Y = date.getFullYear() + "-";
  235. var M =
  236. (date.getMonth() + 1 < 10
  237. ? "0" + (date.getMonth() + 1)
  238. : date.getMonth() + 1) + "-";
  239. var D =
  240. (date.getDate() < 10 ? "0" + date.getDate() : date.getDate()) + " ";
  241. var h =
  242. (date.getHours() < 10 ? "0" + date.getHours() : date.getHours()) + ":";
  243. var m =
  244. date.getMinutes() < 10 ? "0" + date.getMinutes() : date.getMinutes();
  245. return Y + M + D + h + m;
  246. },
  247. closeEditDialog(){
  248. this.changeSupervisionVisible = false
  249. setTimeout(()=>{
  250. this.getProblemList()
  251. },800)
  252. },
  253. findItemByType(){
  254. const obj ={
  255. tname: "BIS_INSP_RSFCO_RGSTR_FLLI"
  256. }
  257. request.post("/bis/insp/item/ques/info/findItemByType",obj).then(res =>{
  258. this.rsvrRules = res.data;
  259. })
  260. },
  261. addProblem(item){
  262. this.pblmEascaderVisible = true;
  263. },
  264. closePlDialog(val) {
  265. this.showAddProblemDialog = false;
  266. this.getProblemList();
  267. this.newModelData = null;
  268. },
  269. submitEascader(){
  270. if(!this.newModelData || !this.newModelData.model.length){
  271. this.$message.warning('问题不可以为空');
  272. return;
  273. }
  274. this.pblmEascaderVisible = false;
  275. let rest = this.rsvrRules
  276. this.probId = rest[0].id;
  277. this.showAddProblemDialog = true
  278. },
  279. modelData(val){
  280. this.newModelData = val;
  281. }
  282. },
  283. watch:{
  284. activeLabel(val){
  285. if(val == '问题清单'){
  286. this.getProblemList()
  287. }
  288. }
  289. }
  290. }
  291. </script>
  292. <style lang="scss">
  293. .pblmEascader .el-dialog__body {
  294. height: 15vh;
  295. overflow: auto;
  296. }
  297. </style>