270a739cefbc249c8cc062fb26cd8fe1a5a5f864.svn-base 20 KB

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