a34b2e83e17b2d0a49ba8cd3375ba953825d9475.svn-base 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560
  1. <template>
  2. <div style="height:100%;width:100%;">
  3. <el-container style="height:100%;width:100%;">
  4. <el-aside width="320px" style="border-right:2px solid #d5d5ff;float:left" :style="{'max-height':testHeight+'px','height':testHeight+'px'}">
  5. <div class="tree" style="
  6. height: 100%;
  7. width: 100%;
  8. overflow: auto;
  9. display: inline-flex;">
  10. <el-tree
  11. :highlight-current="true"
  12. style="height:100%;"
  13. :data="treeData"
  14. node-key="id"
  15. show-checkbox
  16. :expand-on-click-node="false"
  17. @check-change="handleCheckChange"
  18. ref="jigou_tree"
  19. >
  20. <div class="custom-tree-node" slot-scope="{ node, data }">
  21. <span style="float:left;">{{data.name}}
  22. </span>
  23. </div>
  24. </el-tree>
  25. </div>
  26. </el-aside>
  27. <!-- 主要窗口 -->
  28. <el-main id="dxdcListMaintdfj" style="padding:5px 20px;">
  29. <el-row>
  30. <el-col :span="24">
  31. <el-form :inline="true" size="mini" class="demo-form-inline" style="padding-left: 10px;">
  32. <el-form-item label="督查状态">
  33. <el-select v-model="dcType" clearable placeholder="督查状态">
  34. <el-option label="未飞检" value="0"></el-option>
  35. <el-option label="飞检中" value="1"></el-option>
  36. <el-option label="已飞检" value="2"></el-option>
  37. </el-select>
  38. </el-form-item>
  39. <!-- <el-form-item label="行政区名称">
  40. <addvSearch
  41. v-model="adName"
  42. :maxHeight='300'
  43. :maxWidth='250'
  44. :rootAddCode='"000000000000"'
  45. :level='"3"'
  46. :nameOrCode="'name'"
  47. ></addvSearch>
  48. </el-form-item> -->
  49. <el-form-item label="项目名称">
  50. <el-input v-model="name" placeholder="项目名称"></el-input>
  51. </el-form-item>
  52. <!-- <el-form-item label="所在组">
  53. <el-autocomplete v-model="groupName" clearable value-key='nm' :fetch-suggestions="querySearchAsync" placeholder="请输入内容"
  54. @select="handleSelect"></el-autocomplete>
  55. </el-form-item> -->
  56. <el-form-item label="督查时间">
  57. <div style="display: flex;">
  58. <el-date-picker
  59. v-model="dateRange"
  60. type="daterange"
  61. value-format="yyyy-MM-dd"
  62. style="width:100%"
  63. range-separator="至"
  64. start-placeholder="开始日期"
  65. end-placeholder="结束日期"
  66. ></el-date-picker>
  67. </div>
  68. </el-form-item>
  69. <el-form-item style="float:right">
  70. <el-button type="primary" @click="onSubmit" icon="el-icon-search">查询</el-button>
  71. <!-- <el-button type="success" style="float:right;margin-left:5px"
  72. @click="showPlDialog"
  73. icon="el-icon-upload2"
  74. :disabled="disabled"
  75. >批量填报</el-button>
  76. <el-button type="success" style="float:right;"
  77. @click="downloadTemplate"
  78. :icon="downIcon"
  79. >下载模板</el-button> -->
  80. </el-form-item>
  81. </el-form>
  82. </el-col>
  83. </el-row>
  84. <el-table
  85. ref="table"
  86. border
  87. :height="tableHeight"
  88. :data="tdfjDataList"
  89. style="width: 100%"
  90. v-loading="expLoading">
  91. <el-table-column prop="province" label="省" v-if="isXj" show-overflow-tooltip min-width="100" align="center"></el-table-column>
  92. <el-table-column prop="city" :label="ownAdName" show-overflow-tooltip min-width="100" align="center"></el-table-column>
  93. <el-table-column prop="county" label="县" v-if="isXj" show-overflow-tooltip min-width="100" align="center"></el-table-column>
  94. <!-- <el-table-column prop="basName" label="流域机构" show-overflow-tooltip min-width="130" align="center"></el-table-column> -->
  95. <el-table-column prop="name" label="项目名称" min-width="130" align="center" fixed="left"></el-table-column>
  96. <el-table-column
  97. prop="type"
  98. label='检查分类'
  99. align="center"
  100. min-width="130">
  101. <template slot-scope="scope">
  102. <span v-if="scope.row.type == '1'">水库</span>
  103. <span v-if="scope.row.type == '2'">水闸</span>
  104. <span v-if="scope.row.type == '3'">人饮</span>
  105. <span v-if="scope.row.type == '4'">水利工程建设</span>
  106. <span v-if="scope.row.type == '5'">水利工程运行</span>
  107. </template>
  108. </el-table-column>
  109. <!--<el-table-column prop="riverName" label="检查单位" show-overflow-tooltip min-width="120" align="center"></el-table-column>-->
  110. <!-- <el-table-column prop="groupName" label="所在组" show-overflow-tooltip min-width="150" align="center"></el-table-column> -->
  111. <el-table-column prop="intm" label="创建时间" show-overflow-tooltip min-width="120" align="center"></el-table-column>
  112. <el-table-column
  113. prop="uptm"
  114. label="修改时间"
  115. align="center"
  116. min-width="120">
  117. </el-table-column>
  118. <el-table-column
  119. prop="fscState"
  120. label="督查状态"
  121. align="center"
  122. min-width="130">
  123. <template slot-scope="scope">
  124. <span
  125. style="padding: 3px 10px;background:#F56C6C;border-radius:15px;color:rgba(255,255,255,1)"
  126. v-if="scope.row.fscState == 0"
  127. >未飞检</span>
  128. <span
  129. style="padding: 3px 10px;background:#FBB56D;border-radius:15px;color:rgba(255,255,255,1)"
  130. v-if="scope.row.fscState == 1"
  131. >飞检中</span>
  132. <span
  133. style="padding: 3px 10px;background:#63C25E;border-radius:15px;color:rgba(255,255,255,1)"
  134. v-if="scope.row.fscState == 2"
  135. >已飞检</span>
  136. </template>
  137. </el-table-column>
  138. <el-table-column
  139. prop="location"
  140. min-width="200"
  141. label="工程详细位置">
  142. </el-table-column>
  143. <el-table-column align="center" label="操作" min-width="220" fixed="right">
  144. <template slot-scope="scope">
  145. <!-- <el-button
  146. size="mini"
  147. type="success"
  148. plain
  149. @click="sHInfo(scope.row,'dcInfo')"
  150. >查看</el-button> -->
  151. <el-button size="mini" type="success" v-if="scope.row.rgstrId" plain @click="toAddMember('编辑',scope.row)">查看</el-button>
  152. </template>
  153. </el-table-column>
  154. </el-table>
  155. <el-pagination background :pager-count="5" :current-page="pageIndex"
  156. :page-size="pageSize" :page-sizes="[10, 20, 30, 40, 50, 100]"
  157. layout="sizes, total, prev, pager, next" :total="total"
  158. @current-change="pageIndexChange" @size-change="handleSizeChange"
  159. ></el-pagination>
  160. </el-main>
  161. <!-- </el-container> -->
  162. <teDingFeiJianTianBao v-if="showTeDingFeiJianTianBao" :rowData="rowData" :currentObjectRgstrId="currentObjectRgstrId"
  163. :currentResCode="currentResCode" :currentObjectId="currentObjectId"
  164. :currentObjectName="currentResName"
  165. @cancelHandler="cancelHandler" @addTeDingFeiJianSuccess="addTeDingFeiJianSuccess"></teDingFeiJianTianBao>
  166. </el-container>
  167. <!-- 添加/编辑人员弹窗 -->
  168. <!-- 上传模板弹窗 -->
  169. <teDingFeiJianTianBaoPl v-if="showTeDingFeiJianTianBaoPl"
  170. :showTeDingFeiJianTianBaoPl="showTeDingFeiJianTianBaoPl"
  171. :id="currentNodeId"
  172. @closePlDialog="closePlDialog" @uploadSuccess="uploadSuccess"></teDingFeiJianTianBaoPl>
  173. </div>
  174. </template>
  175. <script>
  176. import request from '../../../utils/gw_ajax_request.js'
  177. import {dateFormat} from '../../../utils/gw_date.js'
  178. import provTreeList from "@widget/addLeftTree.vue";
  179. import teDingFeiJianTianBao from "./teDingFeiJianChengGuo.vue"
  180. import teDingFeiJianTianBaoPl from "../../duChaTianBao/teDingFeiJianTianbao_piliang.vue"
  181. import addvSearch from "../../../widgets/addvSearch.vue"
  182. export default {
  183. components: {
  184. provTreeList: provTreeList,
  185. teDingFeiJianTianBao:teDingFeiJianTianBao,
  186. teDingFeiJianTianBaoPl:teDingFeiJianTianBaoPl,
  187. addvSearch
  188. },
  189. props: [],
  190. data() {
  191. return {
  192. dateRange:[],
  193. lyjg:[],
  194. engScale:'',
  195. orgName:'',
  196. groupName:'',
  197. groupId:'',
  198. groups:[],
  199. // sttm:'',
  200. // ettm:'',
  201. adName:'',
  202. treeData:[],
  203. dxdcMainHeight: window.innerHeight - 304,
  204. testHeight: window.innerHeight - 111,
  205. tdfjDataList: [],
  206. pageIndex:1,
  207. pageSize:20,
  208. total:0,
  209. tableHeight:0,
  210. currentResCode:'',
  211. currentResName:'',
  212. currentObjectId:'',
  213. currentObjectRgstrId:'',
  214. currentObjectInfoObject:null,
  215. showTeDingFeiJianTianBao:false,
  216. currentAdCode:'',
  217. currentNodeId:'',
  218. rsvrName:'',
  219. dcType:'',
  220. sjState:'',
  221. rowData:'',
  222. disabled:true,
  223. showTeDingFeiJianTianBaoPl:false,
  224. downIcon:'el-icon-download',
  225. expLoading:false,
  226. dataStat: '',
  227. name: '',
  228. state: '',
  229. adCodes: []
  230. };
  231. },
  232. computed: {
  233. persId() {
  234. return localStorage.getItem("userid")
  235. ? localStorage.getItem("userid")
  236. : "1098101939614724096";
  237. },
  238. isAdmin:function(){
  239. return localStorage.getItem("isAdmin")? localStorage.getItem("isAdmin"): ''
  240. },
  241. },
  242. mounted() {
  243. this.$nextTick(function () {
  244. this.tableHeight = window.innerHeight - this.$refs.table.$el.offsetTop - 50;
  245. let _self = this;
  246. window.onresize = function() {
  247. _self.tableHeight = window.innerHeight - _self.$refs.table.$el.offsetTop - 50
  248. }
  249. })
  250. // this.getTdfjDataList();
  251. this.getAllGroup();
  252. this.getLeftTreeData();
  253. },
  254. activated(){
  255. this.getLeftTreeData();
  256. this.currentNodeId = "";
  257. this.rsvrName = "";
  258. this.dcType = "";
  259. },
  260. watch: {
  261. currentNodeId(n,o){
  262. this.getTdfjDataList();
  263. },
  264. groupName(n,o){
  265. if(n==''){
  266. this.groupId = '';
  267. }
  268. },
  269. adCodes(val) {
  270. if(val.length) {
  271. this.getTdfjDataList();
  272. }
  273. }
  274. },
  275. methods: {
  276. //获取所有的组
  277. getAllGroup(){
  278. var _self = this;
  279. request.get('/dc/user/getGroupByPersid',{params:{'persid':this.persId,'ptype':'9'}}).then((res)=>{
  280. if(res.success){
  281. _self.groups = res.data;
  282. }
  283. })
  284. },
  285. querySearchAsync(queryString, cb) {
  286. var restaurants = this.groups;
  287. var results = queryString ? restaurants.filter(this.createStateFilter(queryString)) : restaurants;
  288. clearTimeout(this.timeout);
  289. this.timeout = setTimeout(() => {
  290. cb(results);
  291. }, 1500 * Math.random());
  292. },
  293. createStateFilter(queryString) {
  294. return (state) => {
  295. return (state.nm.toLowerCase().indexOf(queryString.toLowerCase()) != -1);
  296. };
  297. },
  298. handleSelect(item) {
  299. console.log(item);
  300. this.groupId = item.id;
  301. },
  302. getLeftTreeData(){
  303. var _self = this;
  304. _self.lyjg = [];
  305. request.get(`/bis/insp/BisInspConfigOrgAd/getAdByPersId/${this.persId}/9`).then((res)=>{
  306. let data = res.data
  307. data.forEach(ele => {
  308. if(ele.pid == null || ele.pid == ''){
  309. ele.pid = '009'
  310. }
  311. if(ele.id.length == 6){
  312. _self.lyjg.push(ele);
  313. }
  314. });
  315. data = _self.getTrees(data)
  316. _self.treeData = data;
  317. })
  318. },
  319. handleCheckChange() {
  320. this.adCodes = [];
  321. let nodes = this.$refs.jigou_tree.getCheckedNodes();
  322. nodes.forEach(item => {
  323. this.adCodes.push(item.id);
  324. });
  325. },
  326. //格式化树形数据
  327. getTrees(list) {
  328. //@wxcwater重写方法 适应多个树
  329. let highLevelLength = 99;//预设最大节点id长度,目前最大应该为12,所以设置为99保证正常
  330. let _self =this;
  331. list.forEach((item,index)=>{
  332. item['pidLength'] = item.pid&&item.pid!=''?item.pid.length:0;
  333. if(highLevelLength>item.pidLength){
  334. highLevelLength = item.pidLength;
  335. }
  336. });
  337. let heightLevelNode = [];
  338. list.forEach((item,index)=>{
  339. if(highLevelLength>=item.pidLength){
  340. heightLevelNode.push(item);
  341. }
  342. });
  343. list.forEach((item,index)=>{
  344. heightLevelNode.forEach((pItem)=>{
  345. _self.addTreeNode(pItem,item);
  346. });
  347. });
  348. return heightLevelNode;
  349. },
  350. addTreeNode:function(treeNode,leafNode){
  351. let _self = this;
  352. if(!treeNode.hasOwnProperty('children')){
  353. treeNode['children'] = [];
  354. }
  355. if(leafNode.pid == treeNode.id){
  356. treeNode.children.push(leafNode);
  357. return;
  358. }
  359. treeNode.children.forEach((item) => {
  360. _self.addTreeNode(item,leafNode);
  361. });
  362. },
  363. treeNodeClickHandler:function(data,node,tree){
  364. this.currentNodeId = data.id;
  365. },
  366. provTreeSelectChangeHandler:function(params){
  367. this.currentAdCode = params.likeCode;
  368. this.getTdfjDataList();
  369. },
  370. formatDate(row,column){
  371. if(row.uptm){
  372. return (dateFormat(row.uptm,'yyyy-MM-dd'));
  373. }
  374. },
  375. getTdfjDataList:function(){
  376. this.expLoading = true;
  377. let paramStartDate = '';
  378. let paramEndDate = '';
  379. if(this.dateRange&&this.dateRange.length>1&&this.dateRange[0]!=''&&this.dateRange[1]!=''){
  380. paramStartDate = this.dateRange[0];
  381. paramEndDate = this.dateRange[1];
  382. }
  383. let params = {
  384. "sttm": paramStartDate,
  385. "entm": paramEndDate,
  386. "pageSize": this.pageSize,
  387. "pageNum": this.pageIndex,
  388. // "dataStat": this.dataStat,
  389. "groupId": this.groupId,
  390. "name": this.name,
  391. "state": this.dcType,
  392. // "type": this.dcType,
  393. "adName": this.adName,
  394. "presId": this.persId,
  395. "adCodes": this.adCodes.toString()
  396. // "orgId": this.currentNodeId
  397. };
  398. // /bis/insp/fsc/rgstr/list/page
  399. request.post(`/bis/insp/fsc/rgstr/list/page`,params).then(res =>{
  400. if(res.success){
  401. this.expLoading = false;
  402. if(res.data.list){
  403. res.data.list.forEach((item)=>{
  404. if(item.intm || item.uptm){
  405. item.intm = item.intm.substr(0,10);
  406. item.uptm = item.uptm.substr(0,10);
  407. }
  408. })
  409. }
  410. this.tdfjDataList = res.data.list;
  411. this.total = res.data.total;
  412. }
  413. })
  414. },
  415. onSubmit(){
  416. if(this.adCodes.length)
  417. this.getTdfjDataList();
  418. },
  419. toAddMember(type,rowData){
  420. var _self = this;
  421. this.rowData = rowData;
  422. _self.currentObjectId = this.rowData.baseId;
  423. _self.currentObjectRgstrId = this.rowData.rgstrId;
  424. _self.currentResName = this.rowData.name;
  425. _self.showTeDingFeiJianTianBao = true;
  426. },
  427. cancelHandler(){
  428. this.showTeDingFeiJianTianBao = false;
  429. },
  430. addTeDingFeiJianSuccess(){
  431. this.getTdfjDataList();
  432. },
  433. deleteMember(obj){
  434. console.log(obj);
  435. var _self = this;
  436. // /dc/insp/rsvrRgstr/delete/{id}
  437. this.$confirm('此操作将删除该条相关的所有已填报的信息和问题,确认删除该条数据吗?', '提示', {
  438. confirmButtonText: '确定',
  439. cancelButtonText: '取消',
  440. type: 'warning'
  441. }).then(() => {
  442. request.get(`/supervision/plan/cleanObjDataByObjId?objType=9&objId=${obj.objId}`).then((res)=>{
  443. if(res.success){
  444. _self.pageIndexChange();
  445. _self.$message.success('删除成功')
  446. }else{
  447. _self.$message.error(res.message)
  448. }
  449. });
  450. }).catch(() => {
  451. });
  452. },
  453. submitHandler(rowData){
  454. console.log(rowData)
  455. var _self = this;
  456. this.$confirm('请确认所有信息填报完毕?', '提示', {
  457. confirmButtonText: '确定',
  458. cancelButtonText: '取消',
  459. type: 'warning'
  460. }).then(() => {
  461. let formObj = {
  462. "id":rowData.rgstrId,
  463. "state":"2"
  464. }
  465. request.post('/bis/insp/fsc/rgstr', formObj).then((res) => {
  466. if (res.success) {
  467. _self.addTeDingFeiJianSuccess();
  468. _self.$message.success("提交成功");
  469. } else {
  470. _self.cancelHandler();
  471. }
  472. });
  473. }).catch(() => {
  474. });
  475. },
  476. pageIndexChange(val){
  477. console.log(val);
  478. this.pageIndex = val;
  479. this.getTdfjDataList();
  480. },
  481. handleSizeChange(val){
  482. this.pageSize = val;
  483. this.getTdfjDataList();
  484. },
  485. // 下载填报模板
  486. downloadTemplate(){
  487. this.downloadTemplateSet();
  488. this.disabled = false;
  489. },
  490. downloadTemplateSet(){
  491. let paramStartDate = '';
  492. let paramEndDate = '';
  493. if(this.dateRange&&this.dateRange.length>1&&this.dateRange[0]!=''&&this.dateRange[1]!=''){
  494. paramStartDate = this.dateRange[0];
  495. paramEndDate = this.dateRange[1];
  496. }
  497. let href = `/pdcApi/bis/insp/fsc/pblm/downTemplate?fileName=pblmFsc.xlsx&adName=${this.adName}&name=${this.name}&state=${this.dcType}&entm=${paramEndDate}sttm=${paramStartDate}&presId=${this.persId}&startRow=1`;
  498. const a = document.createElement('a'); // 创建a标签
  499. a.setAttribute('download', '特定飞检填报模板.xls');// download属性
  500. a.setAttribute('href', href);// href链接
  501. a.click();// 自执行点击事件
  502. },
  503. showPlDialog(){
  504. this.showTeDingFeiJianTianBaoPl = true
  505. },
  506. closePlDialog(val){
  507. this.showTeDingFeiJianTianBaoPl = false
  508. },
  509. uploadSuccess(){
  510. this.showTeDingFeiJianTianBaoPl = false;
  511. this.getTdfjDataList();
  512. },
  513. sHInfo(row, info) {
  514. // this.currentDuchaTpe = true;
  515. this.shInfoDialog = true;
  516. this.shInfoContent = row;
  517. // this.currentDuchaTpe = true;
  518. // this.showSzDuChaInfo = true;
  519. // this.currentObjectRgstrId = row.rgstrId;
  520. // this.currentResCode = row.code;
  521. // this.currentGroupId = row.groupId;
  522. // this.currentObjectId = row.objId;
  523. // this.currentResName = row.nm
  524. },
  525. },
  526. };
  527. </script>
  528. <style>
  529. .el-table .warning-row {
  530. background: oldlace;
  531. }
  532. .el-table .success-row {
  533. background: #f0f9eb;
  534. }
  535. #dxdcListMaintdfj{
  536. overflow-y: hidden;
  537. }
  538. </style>