9c576bc8387ccbe16fbf3aa1bd81d8a1612b128f.svn-base 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484
  1. <template>
  2. <div class="add_pblm">
  3. <el-dialog :visible.sync="dialogFormEditorVisible" :close-on-click-modal="false" width="70%" @close="closeDialog">
  4. <h3 v-if="ifShiJi == '1'">待分发问题</h3>
  5. <h3 v-else>添加问题</h3>
  6. <div>
  7. <el-row :gutter="20" type="flex" style="margin-bottom: 10px;">
  8. <el-col :span="20">
  9. <el-form :inline="true" size="mini" class="demo-form-inline">
  10. <el-form-item label="工程">
  11. <el-input v-model="editorFormAll.name" clearable placeholder="请输入工程" style="width: 6vw"></el-input>
  12. </el-form-item>
  13. <el-form-item label="问题类别">
  14. <el-input v-model="editorFormAll.inspPblmName" clearable placeholder="请输入问题类别" style="width: 6vw"></el-input>
  15. </el-form-item>
  16. <el-form-item label="严重程度">
  17. <el-select v-model="editorFormAll.inspPblmCate" clearable placeholder="请选择">
  18. <el-option
  19. v-for="item in supervisionState"
  20. :key="item.value"
  21. :label="item.label"
  22. :value="item.value"
  23. ></el-option>
  24. </el-select>
  25. </el-form-item>
  26. <el-form-item label="是否典型">
  27. <el-select v-model="editorFormAll.ifCasePblm" clearable style="width: 6vw">
  28. <el-option label="是" value="1"></el-option>
  29. <el-option label="否" value="0"></el-option>
  30. </el-select>
  31. </el-form-item>
  32. </el-form>
  33. </el-col>
  34. <el-col :span="2" :offset=2 style="text-align: end;">
  35. <el-button @click="searchAll" type="success">查询</el-button>
  36. </el-col>
  37. </el-row>
  38. <div>
  39. <el-table
  40. :data="pblmListAll"
  41. :height="tableHeight1"
  42. style="width: 100%"
  43. border
  44. tooltip-effect="dark"
  45. @selection-change="handleSelectionChange"
  46. ref="multipleTable">
  47. <el-table-column
  48. type="selection"
  49. width="55">
  50. </el-table-column>
  51. <el-table-column
  52. prop="name"
  53. label="工程名称"
  54. min-width="50"
  55. show-overflow-tooltip>
  56. </el-table-column>
  57. <el-table-column
  58. prop="inspPblmName"
  59. label="问题类别"
  60. min-width="100"
  61. show-overflow-tooltip>
  62. </el-table-column>
  63. <el-table-column
  64. prop="inspPblmDesc"
  65. label="问题描述"
  66. min-width="100"
  67. show-overflow-tooltip>
  68. </el-table-column>
  69. <el-table-column
  70. label="严重程度"
  71. min-width="50">
  72. <template slot-scope="scope">
  73. <p v-if="scope.row.inspPblmCate == 0"><span class="inspPblmCate" style="background: #27C19F;">一般</span></p>
  74. <p v-if="scope.row.inspPblmCate == 1"><span class="inspPblmCate" style="background: #E6A23C;" >较重</span></p>
  75. <p v-if="scope.row.inspPblmCate == 2"><span class="inspPblmCate" style="background: #F56C6C;" >严重</span></p>
  76. <p v-if="scope.row.inspPblmCate == 3"><span class="inspPblmCate" style="background: #795548;">特别严重</span></p>
  77. </template>
  78. </el-table-column>
  79. <el-table-column
  80. label="是否典型"
  81. min-width="50">
  82. <template slot-scope="scope">
  83. <p v-if="scope.row.ifCasePblm == 1">是</p>
  84. <p v-if="scope.row.ifCasePblm == 0">否</p>
  85. </template>
  86. </el-table-column>
  87. <el-table-column
  88. prop="inspPblmTm"
  89. label="上报时间"
  90. min-width="50">
  91. <!--<template slot-scope="scope">-->
  92. <!--<span v-if="scope.row.inspPblmTm">{{formatDate(scope.row.inspPblmTm)}}</span>-->
  93. <!--</template>-->
  94. </el-table-column>
  95. <el-table-column
  96. label="操作"
  97. min-width="50">
  98. <template slot-scope="scope">
  99. <el-button @click="toView(scope.row)" type="text" size="small" >查看</el-button>
  100. </template>
  101. </el-table-column>
  102. </el-table>
  103. </div>
  104. <el-row style="margin-top: 10px;">
  105. <!-- 分页 -->
  106. <el-col :span="20" class="paginationWarpper">
  107. <el-pagination
  108. class="paginationCenter"
  109. background
  110. @size-change="handleSizeChange"
  111. @current-change="pageIndexChange"
  112. :current-page.sync="pageNum"
  113. :page-sizes="[10, 20, 50, 100]"
  114. :page-size="pageSize"
  115. layout="total, sizes, prev, pager, next, jumper"
  116. :total="total"
  117. ></el-pagination>
  118. </el-col>
  119. <el-col :span="4" style="text-align: end;">
  120. <!--<el-button type="primary" @click="addPblmArray">添加</el-button>-->
  121. <el-button type="primary" @click="sureToAdd">确定添加</el-button>
  122. </el-col>
  123. </el-row>
  124. </div>
  125. <el-divider></el-divider>
  126. <h3 v-if="ifShiJi == '1'">已分发问题</h3>
  127. <h3 v-else>已选择的问题</h3>
  128. <div>
  129. <el-row :gutter="20" type="flex" style="margin-bottom: 10px;">
  130. <el-col :span="20">
  131. <el-form :inline="true" size="mini" class="demo-form-inline">
  132. <!--<el-form-item label="工程">-->
  133. <!--<el-input v-model="editorForm.name" clearable placeholder="请输入工程" style="width: 6vw"></el-input>-->
  134. <!--</el-form-item>-->
  135. <el-form-item label="问题类别">
  136. <el-input v-model="editorForm.inspPblmName" clearable placeholder="请输入问题类别" style="width: 6vw"></el-input>
  137. </el-form-item>
  138. <el-form-item label="严重程度">
  139. <el-select v-model="editorForm.inspPblmCate" clearable placeholder="请选择">
  140. <el-option
  141. v-for="item in supervisionState"
  142. :key="item.value"
  143. :label="item.label"
  144. :value="item.value"
  145. ></el-option>
  146. </el-select>
  147. </el-form-item>
  148. <!--<el-form-item label="是否典型">-->
  149. <!--<el-select v-model="editorForm.state" clearable style="width: 6vw">-->
  150. <!--<el-option label="未下发" value="0"></el-option>-->
  151. <!--<el-option label="已下发" value="1"></el-option>-->
  152. <!--<el-option label="已反馈" value="2"></el-option>-->
  153. <!--</el-select>-->
  154. <!--</el-form-item>-->
  155. </el-form>
  156. </el-col>
  157. <el-col :span="2" :offset=2 style="text-align: end;">
  158. <el-button @click="search" type="success">查询</el-button>
  159. </el-col>
  160. </el-row>
  161. <div>
  162. <el-table
  163. :data="pblmList"
  164. :height="tableHeight1"
  165. style="width: 100%"
  166. border
  167. tooltip-effect="dark">
  168. <el-table-column
  169. prop="name"
  170. label="工程名称"
  171. min-width="100"
  172. show-overflow-tooltip>
  173. </el-table-column>
  174. <el-table-column
  175. prop="inspPblmName"
  176. label="问题类别"
  177. min-width="100"
  178. show-overflow-tooltip>
  179. </el-table-column>
  180. <el-table-column
  181. prop="inspPblmDesc"
  182. label="问题描述"
  183. min-width="100"
  184. show-overflow-tooltip>
  185. </el-table-column>
  186. <el-table-column
  187. prop="inspPblmCate"
  188. label="严重程度"
  189. min-width="50">
  190. <template slot-scope="scope">
  191. <p v-if="scope.row.inspPblmCate == 0"><span class="inspPblmCate" style="background: #27C19F;">一般</span></p>
  192. <p v-if="scope.row.inspPblmCate == 1"><span class="inspPblmCate" style="background: #E6A23C;" >较重</span></p>
  193. <p v-if="scope.row.inspPblmCate == 2"><span class="inspPblmCate" style="background: #F56C6C;" >严重</span></p>
  194. <p v-if="scope.row.inspPblmCate == 3"><span class="inspPblmCate" style="background: #795548;">特别严重</span></p>
  195. </template>
  196. </el-table-column>
  197. <!--<el-table-column-->
  198. <!--prop="pblmSize"-->
  199. <!--label="是否典型"-->
  200. <!--min-width="50">-->
  201. <!--</el-table-column>-->
  202. <el-table-column
  203. prop="inspPblmTm"
  204. label="上报时间"
  205. min-width="50">
  206. <template slot-scope="scope">
  207. <span v-if="scope.row.inspPblmTm">{{formatDate(scope.row.inspPblmTm)}}</span>
  208. </template>
  209. </el-table-column>
  210. <el-table-column
  211. label="操作"
  212. min-width="100">
  213. <template slot-scope="scope">
  214. <el-button @click="toView(scope.row)" type="text" size="small" >查看</el-button>
  215. <el-button @click="toDelete(scope.row)" type="text" size="small" >删除</el-button>
  216. </template>
  217. </el-table-column>
  218. </el-table>
  219. <el-row style="margin-top: 10px;">
  220. <!-- 分页 -->
  221. <el-col :span="20" class="paginationWarpper">
  222. <el-pagination
  223. class="paginationCenter"
  224. background
  225. @size-change="handleSizeChangeEditor"
  226. @current-change="pageIndexChangeEditor"
  227. :current-page.sync="editorForm.pageNum"
  228. :page-sizes="[10, 20, 50, 100]"
  229. :page-size="editorForm.pageSize"
  230. layout="total, sizes, prev, pager, next, jumper"
  231. :total="totalEditor"
  232. ></el-pagination>
  233. </el-col>
  234. <el-col :span="4" style="text-align: end;">
  235. </el-col>
  236. </el-row>
  237. </div>
  238. </div>
  239. </el-dialog>
  240. <!-- 详情弹框 -->
  241. <el-dialog
  242. class="outerDialog custom_dialog"
  243. title="问题详情"
  244. width="60%"
  245. :visible.sync="supervisionDetailsVisible"
  246. v-if="supervisionDetailsVisible"
  247. >
  248. <supervision-details ref="xianqing" :problemId="currentProblemId" :objType="objType"></supervision-details>
  249. <span slot="footer">
  250. <el-button style="margin-top:5px;" @click="supervisionDetailsVisible = false">返回</el-button>
  251. </span>
  252. </el-dialog>
  253. </div>
  254. </template>
  255. <script>
  256. import request from '@util/gw_ajax_request'
  257. import {dateFormat} from '@util/gw_date';
  258. export default {
  259. name: "addPblm",
  260. props:['RowId','supervisionState','objType','rectId','ifShiJi'],
  261. data (){
  262. return {
  263. dialogFormEditorVisible: true,
  264. formLabelWidth: '120px',
  265. pblmList: [],
  266. pblmListAll: [],
  267. tableHeight1: window.innerHeight * .2,
  268. editorForm: {
  269. "rectId": null,
  270. "inspPblmName": null,//问题类别
  271. "inspPblmCate": null,//严重程度
  272. "pageNum": 1,
  273. "pageSize": 20,
  274. },
  275. editorFormAll: {
  276. // "inspPblmType": null,//问题类别
  277. "inspPblmCate": null,//严重程度
  278. ifCasePblm: "",//是否典型
  279. inspPblmName: "",//问题类别名称
  280. objType: null,//类型
  281. pageNum: null,
  282. pageSize: null,
  283. name: "",//工程名称
  284. orgId: ""
  285. },
  286. pageNum: 1,
  287. pageSize: 20,
  288. total: null,
  289. totalEditor: null,
  290. multipleSelection: [],
  291. supervisionDetailsVisible: false,
  292. currentProblemId: null
  293. }
  294. },
  295. components:{
  296. //详情页
  297. supervisionDetails: resolve => {
  298. require(["./supervisionDetails.vue"], resolve);
  299. }
  300. },
  301. computed: {
  302. persId() {
  303. return localStorage.getItem("userid")
  304. ? localStorage.getItem("userid")
  305. : "1098101939614724096";
  306. }
  307. },
  308. mounted(){
  309. this.$nextTick(()=>{
  310. this.getPblmList();
  311. this.getDuChaTypePblm();
  312. })
  313. },
  314. methods:{
  315. closeDialog(){
  316. this.$emit('closeDialog');
  317. },
  318. //所有问题查看
  319. toView(row){
  320. // this.objType = row.sndType;
  321. this.currentProblemId = row.pblmId;
  322. this.supervisionDetailsVisible = true;
  323. },
  324. //删除问题
  325. toDelete(row){
  326. this.$confirm('确定要删除该问题, 是否继续?', '提示', {
  327. confirmButtonText: '确定',
  328. cancelButtonText: '取消',
  329. type: 'warning'
  330. }).then(() => {
  331. request.post(`/bis/insp/rect/pblm/delete/${row.id}`)
  332. .then(res => {
  333. if (res.success) {
  334. this.$message.success("删除成功");
  335. this.getPblmList();
  336. } else {
  337. this.$message.warning(res.message);
  338. }
  339. })
  340. .catch(err => {
  341. console.log(err);
  342. })
  343. }).catch(() => {
  344. this.$message({
  345. type: 'info',
  346. message: '已取消删除'
  347. });
  348. });
  349. },
  350. //获取当前通知下督查对象下问题List
  351. getPblmList() {
  352. let obj = {
  353. "rectId": this.RowId,//通知ID 必须
  354. // "name":this.editorForm.name,//工程名称 非必传
  355. "inspPblmName": this.editorForm.inspPblmName,
  356. "inspPblmCate": this.editorForm.inspPblmCate,
  357. "pageSize": this.editorForm.pageSize,
  358. "pageNum": this.editorForm.pageNum
  359. }
  360. request.post(`/bis/insp/rect/pblm/getPageInfo`, obj)
  361. .then(res => {
  362. if (res.success) {
  363. this.$nextTick(() => {
  364. this.pblmList = res.data.list;
  365. this.totalEditor = res.data.total;
  366. })
  367. } else {
  368. this.$message.warning(res.message);
  369. }
  370. })
  371. .catch(err => {
  372. console.log(err);
  373. })
  374. },
  375. //获取督查对象所有问题
  376. getDuChaTypePblm(){
  377. let _self = this;
  378. let data = _self.editorFormAll;
  379. data.pageNum = _self.pageNum;
  380. data.pageSize = _self.pageSize;
  381. data.objType = _self.objType;
  382. data.orgId = _self.rectId;
  383. request.post(`/dc/insp/pblm/chuzhi/pblmPage`,data)
  384. .then(res =>{
  385. if (res.success) {
  386. _self.$nextTick(()=>{
  387. _self.pblmListAll = res.data.list;
  388. _self.total = res.data.total;
  389. })
  390. } else {
  391. _self.$message.warning(res.success);
  392. }
  393. })
  394. .catch(err =>{
  395. console.log(err);
  396. })
  397. },
  398. handleSizeChange(pageSize) {
  399. this.pageSize = pageSize;
  400. this.getDuChaTypePblm();
  401. },
  402. pageIndexChange(val) {
  403. this.pageNum = val;
  404. this.getDuChaTypePblm();
  405. },
  406. handleSizeChangeEditor(pageSize) {
  407. this.editorForm.pageSize = pageSize;
  408. this.getPblmList();
  409. },
  410. pageIndexChangeEditor(val) {
  411. this.editorForm.pageNum = val;
  412. this.getPblmList();
  413. },
  414. formatDate(timestamp) {
  415. return timestamp ? dateFormat(timestamp, 'yyyy-MM-dd') : "";
  416. },
  417. // 选中table数据
  418. handleSelectionChange(val) {
  419. this.multipleSelection = [];
  420. val.forEach((item,index)=>{
  421. this.multipleSelection.push(
  422. Object.assign({},item, {'rectId':this.RowId,'persId': this.persId})
  423. )
  424. })
  425. },
  426. //全部问题搜索
  427. searchAll(){
  428. this.getDuChaTypePblm();
  429. },
  430. // 添加问题
  431. // addPblmArray(){
  432. // this.$nextTick(()=>{
  433. // this.pblmList.push(...this.multipleSelection);
  434. // })
  435. // },
  436. // 新增加问题搜索
  437. search(){
  438. this.getPblmList();
  439. },
  440. // 确定添加
  441. sureToAdd(){
  442. if(this.multipleSelection.length){
  443. request.post(`/bis/insp/rect/pblm/addList`,this.multipleSelection)
  444. .then(res =>{
  445. if(res.success){
  446. this.$message.success("添加成功");
  447. this.getPblmList();
  448. this.$refs.multipleTable.clearSelection();
  449. }else{
  450. this.$message.warning(res.message);
  451. }
  452. })
  453. .catch(err =>{
  454. console.log(err);
  455. })
  456. }else{
  457. this.$message.warning("请选择需要添加的问题");
  458. }
  459. },
  460. }
  461. }
  462. </script>
  463. <style lang="scss" scoped>
  464. .add_pblm {
  465. h3{
  466. margin-bottom: 20px;
  467. font-size: 20px;
  468. }
  469. .inspPblmCate{
  470. padding: 2px 10px;
  471. color: #fff;
  472. -webkit-border-radius: 10px;
  473. -moz-border-radius: 10px;
  474. border-radius: 10px;
  475. }
  476. }
  477. </style>