60a7b1f2f5eca4dfeec2e8fab9eb15770bd889ed.svn-base 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531
  1. <template>
  2. <div style="height:100%;width:100%;" class="dctb_dxs">
  3. <el-container style="height:100%;width:100%;">
  4. <el-aside width="260px" style="border-right:2px solid #d5d5ff;float:left" :style="{'max-height':testHeight+'px','height':testHeight+'px'}">
  5. <el-button size="mini" :class="tabType==1 ? 'skactive' : 'sknormal'" @click="tabChange('1')">当前数据</el-button>
  6. <!-- <el-button size="mini" :class="tabType==2 ? 'skactive' : 'sknormal'" @click="tabChange('2')">历史数据</el-button>-->
  7. <el-button size="mini" :class="tabType==0 ? 'skactive' : 'sknormal'" @click="tabChange('0')">全部数据</el-button>
  8. <div class="tree" style="
  9. height: calc(100% - 50px);
  10. width: 100%;
  11. overflow: auto;
  12. display: inline-flex;">
  13. <el-tree
  14. :highlight-current="true"
  15. style="height:100%;"
  16. :data="treeData"
  17. node-key="id"
  18. :expand-on-click-node="false"
  19. @node-click = 'treeNodeClickHandler'
  20. ref="jigou_tree"
  21. >
  22. <div class="custom-tree-node" slot-scope="{ node, data }">
  23. <span style="float:left;">{{ data.pnm}}
  24. </span>
  25. </div>
  26. </el-tree>
  27. </div>
  28. </el-aside>
  29. <!-- <el-container> -->
  30. <el-main id="dxdcListMainsk" style="padding:5px 20px;">
  31. <div>
  32. <h3 style="text-align: center; margin: 10px 0;">地下水督查情况</h3>
  33. </div>
  34. <el-table
  35. :data="dxsDataList"
  36. style="width: 100%"
  37. :height="dxdcMainHeight"
  38. >
  39. <el-table-column
  40. prop="stnm"
  41. label="测站名称"
  42. min-width="100">
  43. </el-table-column>
  44. <el-table-column
  45. prop="stcd"
  46. label="测站编码"
  47. min-width="100">
  48. </el-table-column>
  49. <el-table-column
  50. prop="sttpNm"
  51. min-width="120"
  52. label="测站类别">
  53. <!-- <template slot-scope="scope">
  54. <span>{{ formatSttp(scope.row.sttp) }}</span>
  55. </template> -->
  56. </el-table-column>
  57. <el-table-column
  58. prop="stlc"
  59. min-width="180"
  60. label="测站地址">
  61. </el-table-column>
  62. <el-table-column
  63. prop="allScore"
  64. min-width="80"
  65. label="得分合计">
  66. </el-table-column>
  67. <el-table-column
  68. prop="inspState"
  69. label="督查状态"
  70. align="center"
  71. min-width="130">
  72. <template slot-scope="scope">
  73. <span
  74. style="padding: 3px 10px;background:#F56C6C;border-radius:15px;color:rgba(255,255,255,1)"
  75. v-if="scope.row.inspState == 0"
  76. >未督查</span>
  77. <span
  78. style="padding: 3px 10px;background:#FBB56D;border-radius:15px;color:rgba(255,255,255,1)"
  79. v-if="scope.row.inspState == 1"
  80. >督查中</span>
  81. <span
  82. style="padding: 3px 10px;background:#63C25E;border-radius:15px;color:rgba(255,255,255,1)"
  83. v-if="scope.row.inspState == 2"
  84. >已督查</span>
  85. </template>
  86. </el-table-column>
  87. <el-table-column
  88. prop="maintainStatus"
  89. label="测站维护管理状态"
  90. align="center"
  91. min-width="130">
  92. <template slot-scope="scope">
  93. <p style="cursor:pointer;color:#67C23A" v-if="scope.row.maintainStatus == '2' || (scope.row.maintainStatus == '1' && scope.row.inspState == '2')">已完成</p>
  94. <p style="cursor:pointer;color:#67C23A" v-if="scope.row.maintainStatus == '1' && scope.row.inspState != '2'">已填报</p>
  95. <p style="cursor:pointer;color:#F56C6C;" v-if="!scope.row.maintainStatus || scope.row.maintainStatus == '0'">未填报</p>
  96. </template>
  97. </el-table-column>
  98. <el-table-column
  99. prop="percentageStatus"
  100. label="监测数据质量和到报率状态"
  101. align="center"
  102. min-width="130">
  103. <template slot-scope="scope">
  104. <p style="cursor:pointer;color:#67C23A" v-if="scope.row.percentageStatus == '2' || (scope.row.percentageStatus == '1' && scope.row.inspState == '2')">已完成</p>
  105. <p style="cursor:pointer;color:#67C23A" v-if="scope.row.percentageStatus == '1' && scope.row.inspState != '2'">已填报</p>
  106. <p style="cursor:pointer;color:#F56C6C;" v-if="!scope.row.percentageStatus || scope.row.percentageStatus == '0'">未填报</p>
  107. </template>
  108. </el-table-column>
  109. <el-table-column
  110. prop="checkComment"
  111. label="检查人员评价"
  112. align="center"
  113. min-width="130">
  114. <template slot-scope="scope">
  115. <p style="cursor:pointer;color:#67C23A" v-if="scope.row.inspState == '2' && scope.row.checkComment">已完成</p>
  116. <p style="cursor:pointer;color:#67C23A" v-if="scope.row.checkComment && scope.row.checkComment != '' && scope.row.inspState !== '2'">已填报</p>
  117. <p style="cursor:pointer;color:#F56C6C;" v-if="!scope.row.checkComment || scope.row.checkComment == ''">未填报</p>
  118. </template>
  119. </el-table-column>
  120. <el-table-column
  121. prop="uptm"
  122. label="更新时间"
  123. align="center"
  124. min-width="160">
  125. </el-table-column>
  126. <el-table-column align="center" show-overflow-tooltip label="操作" min-width="160" fixed="right" v-if="ownPriv('manage')">
  127. <template slot-scope="scope">
  128. <el-button type="success" plain @click="toAddMember('填报',scope.row)" :disabled="scope.row.inspState == 2">填报</el-button>
  129. <el-button type="danger" plain @click="submitHandler(scope.row)">提 交</el-button>
  130. <!-- <el-button type="danger" plain @click="deleteMember(scope.row)">删除</el-button> -->
  131. </template>
  132. </el-table-column>
  133. </el-table>
  134. <el-pagination background :pager-count="5" :current-page="pageIndex"
  135. :page-size="pageSize" :page-sizes="[10, 20, 30, 40, 50, 100]"
  136. layout="sizes, total, prev, pager, next" :total="total"
  137. @current-change="pageIndexChange" @size-change="handleSizeChange"
  138. ></el-pagination>
  139. </el-main>
  140. <!-- </el-container> -->
  141. <dxsTianBao v-if="showShuDxsTianBao" :currentObjectRgstrId="currentObjectRgstrId"
  142. :currentGrwCode="currentGrwCode" :currentObjectId="currentObjectId"
  143. :currentObjectName="currentGrwName"
  144. :currentGrwName="currentGrwName"
  145. :currentSttp="currentSttp"
  146. :stationType="stationType"
  147. :staType="staType"
  148. :frequency="frequency"
  149. @cancelHandler="cancelHandler" @addShuiKuSuccess="addShuiKuSuccess"></dxsTianBao>
  150. </el-container>
  151. <!-- 选择测站类型弹窗 -->
  152. <el-dialog :title="currentGrwName + '测站类型'" :visible.sync="typeDialog">
  153. <el-form label-width="120px">
  154. <el-form-item label="测站类型" required>
  155. <el-select v-model="staType" :disabled="btnType == 'submit'" placeholder="请选择">
  156. <el-option label="省级自动监测站" value="PROVAUTO"></el-option>
  157. <el-option label="省级人工监测站" value="PROVHAND"></el-option>
  158. </el-select>
  159. </el-form-item>
  160. <el-form-item label="监测频次" required v-if="staType == 'PROVHAND'">
  161. <el-select v-model="frequency" placeholder="请选择">
  162. <el-option label="逐日" value="DAY"></el-option>
  163. <el-option label="五日" value="FDAY"></el-option>
  164. <el-option label="其它" value="OTHER"></el-option>
  165. </el-select>
  166. </el-form-item>
  167. </el-form>
  168. <div slot="footer" class="dialog-footer">
  169. <el-button @click="typeDialog = false">取 消</el-button>
  170. <el-button type="primary" @click="selectType">确 定</el-button>
  171. </div>
  172. </el-dialog>
  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 "../../widgets/provTreeList.vue";
  179. import dxsTianBao from "../duChaTianBao/dxsTianBao.vue"
  180. export default {
  181. components: {
  182. provTreeList: provTreeList,
  183. dxsTianBao:dxsTianBao,
  184. },
  185. props: [],
  186. data() {
  187. return {
  188. tabType:"0",//0全部数据,1当前数据,2历史数据
  189. treeData:[],
  190. dxdcMainHeight: window.innerHeight - 197,
  191. testHeight: window.innerHeight - 111,
  192. // stationType: 'artiStation',
  193. stationType: 'autoStation',
  194. dxsDataList: [],
  195. pageIndex:1,
  196. pageSize:20,
  197. total:0,
  198. tableHeight:0,
  199. currentGrwCode:'',
  200. currentGrwName:'',
  201. currentObjectId:'',
  202. currentObjectRgstrId:'',
  203. currentSttp: '',
  204. currentObjectInfoObject:null,
  205. showShuDxsTianBao:false,
  206. currentAdCode:'',
  207. currentNodeId:'',//没有初始值。
  208. typeDialog: false,
  209. staType: '',
  210. frequency: '',
  211. btnType: '',
  212. submitRow: null,
  213. };
  214. },
  215. computed: {
  216. persId() {
  217. return localStorage.getItem("userid")
  218. ? localStorage.getItem("userid")
  219. : "1098101939614724096";
  220. },
  221. recPersName(){
  222. return localStorage.getItem("account")? localStorage.getItem("account"): ''
  223. }
  224. },
  225. mounted() {
  226. this.getLeftTreeData();
  227. let h = document.getElementById('dxdcListMainsk').offsetHeight;
  228. this.tableHeight = h - 100;
  229. console.log('tableHeight'+this.tableHeight);
  230. },
  231. activated(){
  232. this.getLeftTreeData();
  233. this.currentNodeId = "";
  234. // this.getDXSDataList();
  235. },
  236. watch: {
  237. currentNodeId(n,o){
  238. if(n&&n!=''){
  239. this.getDXSDataList();
  240. }
  241. }
  242. },
  243. methods: {
  244. tabChange(tabType){
  245. this.tabType = tabType;
  246. this.currentNodeId = "";
  247. this.getLeftTreeData();
  248. this.getDXSDataList();
  249. },
  250. getLeftTreeData(){
  251. var _self = this;
  252. request.get('/dc/organization/base/getAllNode',{params:{'userId':this.persId,'orgType':'005',"tabType":this.tabType}}).then((res)=>{
  253. let data = res.data
  254. data.forEach(ele => {
  255. if(ele.pid == null || ele.pid == ''){
  256. ele.pid = '001'
  257. }
  258. });
  259. data = _self.getTrees(data);
  260. _self.currentNodeId = data[0].id;
  261. _self.getDXSDataList();
  262. _self.treeData = data;
  263. // _self.duChaType = _self.treeData[0].id.substring(2,3);
  264. })
  265. },
  266. //格式化树形数据
  267. getTrees(list) {
  268. //@wxcwater重写方法 适应多个树
  269. let highLevelLength = 99;//预设最大节点id长度,目前最大应该为12,所以设置为99保证正常
  270. let _self =this;
  271. list.forEach((item,index)=>{
  272. item['pidLength'] = item.pid&&item.pid!=''?item.pid.length:0;
  273. if(highLevelLength>item.pidLength){
  274. highLevelLength = item.pidLength;
  275. }
  276. });
  277. console.log(highLevelLength);
  278. let heightLevelNode = [];
  279. list.forEach((item,index)=>{
  280. if(highLevelLength>=item.pidLength){
  281. heightLevelNode.push(item);
  282. }
  283. });
  284. list.forEach((item,index)=>{
  285. heightLevelNode.forEach((pItem)=>{
  286. _self.addTreeNode(pItem,item);
  287. });
  288. });
  289. console.log(heightLevelNode);
  290. return heightLevelNode;
  291. },
  292. addTreeNode:function(treeNode,leafNode){
  293. let _self = this;
  294. if(!treeNode.hasOwnProperty('children')){
  295. treeNode['children'] = [];
  296. }
  297. if(leafNode.pid == treeNode.id){
  298. treeNode.children.push(leafNode);
  299. return;
  300. }
  301. treeNode.children.forEach((item) => {
  302. _self.addTreeNode(item,leafNode);
  303. });
  304. },
  305. treeNodeClickHandler(data,node,tree){
  306. this.currentNodeId = data.id;
  307. },
  308. provTreeSelectChangeHandler:function(params){
  309. this.currentAdCode = params.likeCode;
  310. this.getDXSDataList();
  311. },
  312. formatDate(row,column){
  313. if(row.uptm){
  314. return (dateFormat(row.uptm,'yyyy-MM-dd'));
  315. }
  316. },
  317. getDXSDataList(){
  318. request.post(`/dc/insp/grw/queryDetailListWithPblm`,{'nodeId':this.currentNodeId,'pageSize':this.pageSize,'pageNum': this.pageIndex,'tabType':this.tabType}).then((res) => {
  319. console.log(res)
  320. if(res.success){
  321. this.dxsDataList = res.data.list;
  322. this.total = res.data.total;
  323. }
  324. }
  325. );
  326. },
  327. selectType(){
  328. if(!this.staType){
  329. this.$message.warning('请选择测站类型')
  330. return
  331. }
  332. if(this.staType == 'PROVHAND' && !this.frequency){
  333. this.$message.warning('请选择监测频率')
  334. return
  335. }
  336. if(this.staType == 'PROVAUTO'){
  337. this.stationType = 'autoStation'
  338. this.currentSttp = 'PROVAUTO'
  339. }else{
  340. this.stationType = 'artiStation'
  341. this.currentSttp = 'PROVHAND'
  342. }
  343. let formObj = {
  344. "id":this.currentObjectRgstrId,
  345. "checkPid": this.persId,
  346. "checkPname": this.recPersName,
  347. "sttp": this.currentSttp
  348. }
  349. if(this.btnType == 'add'){
  350. request.post(`/dc/insp/grw/setProvSttp`,formObj).then(res=>{
  351. if(res.success){
  352. this.typeDialog = false
  353. this.showShuDxsTianBao = true;
  354. this.getDXSDataList()
  355. }else{
  356. this.$message.warning(res.message)
  357. }
  358. })
  359. }else if(this.btnType == 'submit'){
  360. this.typeDialog = false
  361. this.submitRow.monitorRate = this.frequency
  362. this.submitHandler(this.submitRow)
  363. }
  364. },
  365. toAddMember(type,rowData){
  366. this.btnType = 'add'
  367. var _self = this;
  368. request.post(`/dc/insp/grw/getBy`,{'objId':rowData.objId,'stcd':rowData.stcd}).then((res) =>{
  369. console.log(res);
  370. if(res.success){
  371. _self.currentGrwCode = res.data.stcd;
  372. _self.currentObjectId = res.data.objId;
  373. _self.currentObjectRgstrId = res.data.id;
  374. _self.currentGrwName = res.data.stnm;
  375. _self.currentSttp = res.data.sttp;
  376. if(_self.currentSttp == 'PROV' || !_self.currentSttp){
  377. _self.staType = ''
  378. _self.frequency = ''
  379. _self.typeDialog = true
  380. }else if(_self.currentSttp == 'PROVHAND'){
  381. _self.stationType = 'artiStation'
  382. _self.showShuDxsTianBao = true;
  383. }else{
  384. _self.stationType = 'autoStation'
  385. _self.showShuDxsTianBao = true;
  386. }
  387. }
  388. // 获取完成
  389. },
  390. (err) =>{
  391. }
  392. );
  393. },
  394. cancelHandler(){
  395. this.showShuDxsTianBao = false;
  396. },
  397. addShuiKuSuccess(){
  398. this.getDXSDataList();
  399. // this.showShuDxsTianBao = false;
  400. },
  401. deleteMember(obj){
  402. // /dc/insp/rsvrRgstr/delete/{id}
  403. deleteXSKByObjId(obj.rgstrId).then((res)=>{
  404. this.pageIndexChange();
  405. });
  406. },
  407. pageIndexChange(val){
  408. console.log(val);
  409. this.pageIndex = val;
  410. this.getDXSDataList();
  411. },
  412. handleSizeChange(val){
  413. this.pageSize = val;
  414. this.getDXSDataList();
  415. },
  416. formatSttp(val){
  417. let sttp = val ? val.toUpperCase() : ''
  418. if(sttp == 'NATIONAL'){
  419. return '国家级'
  420. }else if(sttp == 'PROVAUTO'){
  421. return '省级自动站'
  422. }else if(sttp == 'PROVHAND'){
  423. return '省级手动站'
  424. }
  425. },
  426. submitHandler(row){
  427. this.submitRow = row
  428. this.btnType = 'submit'
  429. var _self = this;
  430. request.post(`/dc/insp/grw/getBy`,{'objId':row.objId,'stcd':row.stcd}).then(
  431. (res) =>{
  432. if(res.data.maintainStatus=='0' || !res.data.maintainStatus){
  433. this.$message({
  434. message: '请填写测站维护管理!',
  435. type: 'warning'
  436. });
  437. return
  438. }else if(res.data.percentageStatus=='0' || !res.data.percentageStatus){
  439. this.$message({
  440. message: '请填写监测数据质量和到报率',
  441. type: 'warning'
  442. });
  443. return
  444. }else if(!res.data.checkComment){
  445. this.$message({
  446. message: '请填写检查人员评价!',
  447. type: 'warning'
  448. });
  449. return
  450. }
  451. if(res.data.sttp == 'PROVHAND' && !row.monitorRate){
  452. this.$message.warning('请选择监测频率')
  453. this.staType = res.data.sttp
  454. this.typeDialog = true
  455. return
  456. }
  457. this.$confirm('请确认所有信息填报完毕?', '提示', {
  458. confirmButtonText: '确定',
  459. cancelButtonText: '取消',
  460. type: 'warning'
  461. }).then(() => {
  462. let formObj = {
  463. "id":row.id,
  464. "checkPid": this.persId,
  465. "checkPname": this.recPersName,
  466. "monitorRate": this.frequency,
  467. "sttp": row.sttp
  468. }
  469. request.post('/dc/insp/grw/submitData', formObj).then((res) => {
  470. if (res.success) {
  471. _self.$emit("addShuiKuSuccess");
  472. _self.$message.success("提交成功");
  473. this.getDXSDataList()
  474. } else {
  475. _self.$message.error(res.message);
  476. // _self.$emit('cancelHandler');
  477. }
  478. });
  479. }).catch(() => {
  480. _self.$message.error(res.message);
  481. });
  482. },(err) =>{
  483. });
  484. },
  485. },
  486. };
  487. </script>
  488. <style>
  489. .skactive{
  490. background: #3f8eff !important;
  491. color:white !important;
  492. margin-top: 5px;
  493. margin-bottom: 5px;
  494. padding: 7px 12px !important;
  495. }
  496. .sknormal{
  497. background: white;
  498. margin-top: 5px;
  499. margin-bottom: 5px;
  500. padding: 7px 12px !important;
  501. }
  502. .dctb_dxs .el-table .warning-row {
  503. background: oldlace;
  504. }
  505. .dctb_dxs .el-table .success-row {
  506. background: #f0f9eb;
  507. }
  508. </style>