作者 徐强

提交

1 { 1 {
2 - "name" : "eej", 2 + "name" : "生态环境监管",
3 "appid" : "__UNI__8F3ECEE", 3 "appid" : "__UNI__8F3ECEE",
4 "description" : "", 4 "description" : "",
5 "versionName" : "1.0.0", 5 "versionName" : "1.0.0",
@@ -119,6 +119,7 @@ @@ -119,6 +119,7 @@
119 data:this.param, 119 data:this.param,
120 success: (res) => { 120 success: (res) => {
121 this.list = res.data.data 121 this.list = res.data.data
  122 + console.log('企业列表',this.list)
122 uni.hideLoading() 123 uni.hideLoading()
123 } 124 }
124 }) 125 })
@@ -7,7 +7,7 @@ @@ -7,7 +7,7 @@
7 <sub-radio-temp v-if="item.tempType == 'subRadio'" :keyList="item.keyList"></sub-radio-temp> 7 <sub-radio-temp v-if="item.tempType == 'subRadio'" :keyList="item.keyList"></sub-radio-temp>
8 </view> 8 </view>
9 <view style="height: 130rpx;"></view> 9 <view style="height: 130rpx;"></view>
10 - <view class="bottomBtnWrap"> 10 + <view class="bottomBtnWrap" v-if="param.code != 'fs' && param.code != 'fq' && param.code != 'gtfwpf' && companyInfo.STORED != 1">
11 <view class="bottomBtn" @click="save"> 11 <view class="bottomBtn" @click="save">
12 保存 12 保存
13 </view> 13 </view>
@@ -86,6 +86,7 @@ @@ -86,6 +86,7 @@
86 export default { 86 export default {
87 data() { 87 data() {
88 return { 88 return {
  89 + companyInfo:{},
89 desc:'', 90 desc:'',
90 LAT:'', 91 LAT:'',
91 LON:'', 92 LON:'',
@@ -99,6 +100,7 @@ @@ -99,6 +100,7 @@
99 checkList:[], 100 checkList:[],
100 checkIndex:0, 101 checkIndex:0,
101 keyIndex:0, 102 keyIndex:0,
  103 + checkDataList:{dataList1:[],dataList2:[]}
102 } 104 }
103 }, 105 },
104 components:{ 106 components:{
@@ -110,7 +112,16 @@ @@ -110,7 +112,16 @@
110 onLoad(option){ 112 onLoad(option){
111 this.param = JSON.parse(option.param) 113 this.param = JSON.parse(option.param)
112 this.companyId = option.companyid 114 this.companyId = option.companyid
113 - console.log('当前code',this.param.code) 115 + //企业状态查询
  116 + uni.request({
  117 + url:this.apiUrl + 'license/getCompany',
  118 + data:{companyId:this.companyId},
  119 + method:'get',
  120 + success: (res) => {
  121 + console.log('归档状态查询',res)
  122 + this.companyInfo = res.data.data
  123 + }
  124 + })
114 //基本情况 125 //基本情况
115 if(this.param.code == 'jbqk'){ 126 if(this.param.code == 'jbqk'){
116 this.checkList=[ 127 this.checkList=[
@@ -1096,7 +1107,7 @@ @@ -1096,7 +1107,7 @@
1096 keyList:[ 1107 keyList:[
1097 { 1108 {
1098 titleDesc:'一.', 1109 titleDesc:'一.',
1099 - title:'自行测报告', 1110 + title:'自行测报告',
1100 moreBtn:true,//是否显示更多按钮 1111 moreBtn:true,//是否显示更多按钮
1101 check:-1, 1112 check:-1,
1102 moreInfo:{ 1113 moreInfo:{
@@ -1122,7 +1133,12 @@ @@ -1122,7 +1133,12 @@
1122 title:'委托第三方监测', 1133 title:'委托第三方监测',
1123 moreBtn:true,//是否显示更多按钮 1134 moreBtn:true,//是否显示更多按钮
1124 check:-1, 1135 check:-1,
1125 - moreInfo:false, 1136 + moreInfo:{
  1137 + LAT:'',
  1138 + LON:'',
  1139 + NOTE:'',
  1140 + IMGS:[]
  1141 + },
1126 last:false, 1142 last:false,
1127 subKeyList:[ 1143 subKeyList:[
1128 { 1144 {
@@ -1729,58 +1745,40 @@ @@ -1729,58 +1745,40 @@
1729 } 1745 }
1730 1746
1731 } 1747 }
1732 - if(this.checkList[i].tempType == 'radio' && this.param.code == 'swrqk'){ 1748 + if(this.checkList[i].tempType == 'radio' && (this.param.code == 'swrqk' || this.param.code == 'dqwrqk')){
  1749 + var check = this.checkList[i]
  1750 + var type = this.param.code == 'swrqk' ? '21' : '22'
  1751 + console.log('type',type)
1733 uni.request({ 1752 uni.request({
1734 url:this.apiUrl + 'license/otherInfo', 1753 url:this.apiUrl + 'license/otherInfo',
1735 method:'get', 1754 method:'get',
1736 - data:{companyId:this.companyId,type:'21'}, 1755 + data:{companyId:this.companyId,type:type},
1737 success: (res) => { 1756 success: (res) => {
1738 - console.log('产污环节-水污染',res)  
1739 - }  
1740 - })  
1741 - /* for(var i = 0; i < this.checkList[k].keyList.length; i++){  
1742 - for(var j = 0; j < res.data.data.base.length; j ++){  
1743 - if(this.checkList[k].keyList[i].title == res.data.data.base[j].FIELDCN){  
1744 - this.checkList[k].keyList[i].id = res.data.data.base[j].ID  
1745 - if(this.checkList[k].keyList[i].title == '受纳自然水体'){  
1746 - for(var l = 0;l < res.data.data.snst.length; l++){  
1747 - if(res.data.data.snst[l].FILEDSTATICS){  
1748 - res.data.data.snst[l].FILEDSTATICS = parseInt(res.data.data.snst[l].FILEDSTATICS) 1757 + for(var j = 0; j < check.keyList.length; j++){
  1758 + for(var k = 0; k < res.data.data.length; k ++){
  1759 + if(check.keyList[j].title == res.data.data[k].FIELDCN){
  1760 + check.keyList[j].id = res.data.data[k].ID
  1761 + if(res.data.data[k].FILEDSTATICS){
  1762 + check.keyList[j].check = parseInt(res.data.data[k].FILEDSTATICS)
1749 }else{ 1763 }else{
1750 - res.data.data.snst[l].FILEDSTATICS = -1 1764 + check.keyList[j].check = -1
1751 } 1765 }
1752 - }  
1753 - this.checkList[k].keyList[i].subKeyList = res.data.data.snst  
1754 - }  
1755 - if(this.checkList[k].keyList[i].title == '污染物种类'){  
1756 - for(var l = 0;l < res.data.data.wrw.length; l++){  
1757 - if(res.data.data.wrw[l].FILEDSTATICS){  
1758 - res.data.data.wrw[l].FILEDSTATICS = parseInt(res.data.data.wrw[l].FILEDSTATICS)  
1759 - }else{  
1760 - res.data.data.wrw[l].FILEDSTATICS = -1 1766 + if(res.data.data[k].IMGS){
  1767 + check.keyList[j].moreInfo.IMGS = res.data.data[k].IMGS
1761 } 1768 }
  1769 + if(res.data.data[j].NOTE){
  1770 + check.keyList[j].moreInfo.NOTE = res.data.data[k].NOTE
  1771 + }
  1772 + if(res.data.data[j].LON){
  1773 + check.keyList[j].moreInfo.LON = res.data.data[k].LON
  1774 + check.keyList[j].moreInfo.LAT = res.data.data[k].LAT
  1775 + }
  1776 + break;
1762 } 1777 }
1763 - this.checkList[k].keyList[i].subKeyList = res.data.data.wrw  
1764 } 1778 }
1765 - if(res.data.data.base[j].FILEDSTATICS){  
1766 - this.checkList[k].keyList[i].check = parseInt(res.data.data.base[j].FILEDSTATICS)  
1767 - }else{  
1768 - this.checkList[k].keyList[i].check = -1  
1769 - }  
1770 - if(res.data.data.base[j].IMGS){  
1771 - this.checkList[k].keyList[i].moreInfo.IMGS = res.data.data.base[j].IMGS  
1772 - }  
1773 - if(res.data.data.base[j].NOTE){  
1774 - this.checkList[k].keyList[i].moreInfo.NOTE = res.data.data.base[j].NOTE  
1775 - }  
1776 - if(res.data.data.base[j].LON){  
1777 - this.checkList[k].keyList[i].moreInfo.LON = res.data.data.base[j].LON  
1778 - this.checkList[k].keyList[i].moreInfo.LAT = res.data.data.base[j].LAT  
1779 - }  
1780 - break;  
1781 } 1779 }
1782 } 1780 }
1783 - } */ 1781 + })
1784 } 1782 }
1785 } 1783 }
1786 } 1784 }
@@ -1954,57 +1952,27 @@ @@ -1954,57 +1952,27 @@
1954 } 1952 }
1955 } 1953 }
1956 } 1954 }
1957 - for(var k = 0; k < 2; k ++){  
1958 - console.log(res.data.data.noisevalue[k])  
1959 - this.checkList[1].keyList[0].subKeyList.push({  
1960 - ID:res.data.data.noisevalue[k].ID,  
1961 - FIELDCN:res.data.data.noisevalue[k].FIELDCN,  
1962 - CONTENT:res.data.data.noisevalue[k].CONTENT,  
1963 - FILEDSTATICS:res.data.data.noisevalue[k].FILEDSTATICS ? parseInt(res.data.data.noisevalue[k].FILEDSTATICS) : -1  
1964 - })  
1965 - }  
1966 - for(var k = 2; k < 4; k ++){  
1967 - this.checkList[3].keyList[0].subKeyList.push({  
1968 - ID:res.data.data.noisevalue[k].ID,  
1969 - FIELDCN:res.data.data.noisevalue[k].FIELDCN,  
1970 - CONTENT:res.data.data.noisevalue[k].CONTENT,  
1971 - FILEDSTATICS:res.data.data.noisevalue[k].FILEDSTATICS ? parseInt(res.data.data.noisevalue[k].FILEDSTATICS) : -1  
1972 - }) 1955 + if(res.data.data.noisevalue.length > 0){
  1956 + for(var k = 0; k < 2; k ++){
  1957 + console.log(res.data.data.noisevalue[k])
  1958 + this.checkList[1].keyList[0].subKeyList.push({
  1959 + ID:res.data.data.noisevalue[k].ID,
  1960 + FIELDCN:res.data.data.noisevalue[k].FIELDCN,
  1961 + CONTENT:res.data.data.noisevalue[k].CONTENT,
  1962 + FILEDSTATICS:res.data.data.noisevalue[k].FILEDSTATICS ? parseInt(res.data.data.noisevalue[k].FILEDSTATICS) : -1
  1963 + })
  1964 + }
  1965 + for(var k = 2; k < 4; k ++){
  1966 + this.checkList[3].keyList[0].subKeyList.push({
  1967 + ID:res.data.data.noisevalue[k].ID,
  1968 + FIELDCN:res.data.data.noisevalue[k].FIELDCN,
  1969 + CONTENT:res.data.data.noisevalue[k].CONTENT,
  1970 + FILEDSTATICS:res.data.data.noisevalue[k].FILEDSTATICS ? parseInt(res.data.data.noisevalue[k].FILEDSTATICS) : -1
  1971 + })
  1972 + }
1973 } 1973 }
1974 -  
1975 } 1974 }
1976 }) 1975 })
1977 -  
1978 - /* uni.request({  
1979 - url:this.apiUrl + 'license/noiselimit',  
1980 - method:'get',  
1981 - data:{itemId:'noisetime'},  
1982 - success: (res)=>{  
1983 - for(var k = 0; k < res.data.data.length; k ++){  
1984 - this.checkList[1].keyList[0].subKeyList.push({  
1985 - ID:res.data.data[k].ID,  
1986 - FIELDCN:res.data.data[k].TITLE,  
1987 - CONTENT:res.data.data[k].LIMIT_VALUE,  
1988 - FILEDSTATICS:res.data.data[k].FILEDSTATICS ? parseInt(res.data.data.solidwrw[l].FILEDSTATICS) : -1  
1989 - })  
1990 - }  
1991 - }  
1992 - })  
1993 - uni.request({  
1994 - url:this.apiUrl + 'license/noiselimit',  
1995 - method:'get',  
1996 - data:{itemId:'noisevalue'},  
1997 - success: (res)=>{  
1998 - for(var k = 0; k < res.data.data.length; k ++){  
1999 - this.checkList[3].keyList[0].subKeyList.push({  
2000 - ID:res.data.data[k].ID,  
2001 - FIELDCN:res.data.data[k].TITLE,  
2002 - CONTENT:res.data.data[k].LIMIT_VALUE,  
2003 - FILEDSTATICS:res.data.data[k].FILEDSTATICS ? parseInt(res.data.data.solidwrw[l].FILEDSTATICS) : -1  
2004 - })  
2005 - }  
2006 - }  
2007 - }) */  
2008 } 1976 }
2009 1977
2010 //委托处置 1978 //委托处置
@@ -2433,11 +2401,14 @@ @@ -2433,11 +2401,14 @@
2433 uni.showLoading({ 2401 uni.showLoading({
2434 title:'保存中...' 2402 title:'保存中...'
2435 }) 2403 })
  2404 + console.log('this.param.code',this.param.code)
2436 //全部保存状态 2405 //全部保存状态
2437 var allSaveStatus = true 2406 var allSaveStatus = true
2438 - //废气-排口、厂界 2407 +
  2408 + //废气-排口、厂界(已检查)
2439 if(this.param.code == 'fq_pc'){ 2409 if(this.param.code == 'fq_pc'){
2440 var saveParam = [] 2410 var saveParam = []
  2411 + var saveBaseParam = []
2441 //保存检测内容 2412 //保存检测内容
2442 for(var i = 0; i < this.checkList.length; i ++){ 2413 for(var i = 0; i < this.checkList.length; i ++){
2443 if(this.checkList[i].tempType == 'subRadio'){ 2414 if(this.checkList[i].tempType == 'subRadio'){
@@ -2453,24 +2424,62 @@ @@ -2453,24 +2424,62 @@
2453 }) 2424 })
2454 } 2425 }
2455 } 2426 }
2456 - uni.request({  
2457 - url:this.apiUrl + 'license/updateSelfMonitInfo',  
2458 - method:'post',  
2459 - data:saveParam,  
2460 - success: (res) => {  
2461 - uni.hideLoading()  
2462 - uni.showToast({  
2463 - title:'保存成功'  
2464 - })  
2465 - } 2427 +
  2428 + }
  2429 + }
  2430 + }
  2431 + if(this.checkList[i].tempType == 'radio'){
  2432 + for(var j = 0; j < this.checkList[i].keyList.length; j ++){
  2433 + var check = this.checkList[i].keyList[j].check
  2434 + var id = this.checkList[i].keyList[j].id
  2435 + if( this.checkList[i].keyList[j].moreInfo.IMGS.length > 0){
  2436 + this.returnImgs(this.checkList[i].keyList[j].moreInfo)
  2437 + }
  2438 + if(check != -1){
  2439 + saveBaseParam.push({
  2440 + filedstatic:check.toString(),
  2441 + id:id,
  2442 + lon:this.checkList[i].keyList[j].moreInfo.LON,
  2443 + lat:this.checkList[i].keyList[j].moreInfo.LAT,
  2444 + note:this.checkList[i].keyList[j].moreInfo.NOTE,
  2445 + imgs:this.checkList[i].keyList[j].moreInfo.IMGS
2466 }) 2446 })
2467 } 2447 }
2468 } 2448 }
2469 } 2449 }
2470 } 2450 }
  2451 + console.log('saveParam',saveParam)
  2452 + console.log('saveBaseParam',saveBaseParam)
  2453 + if(saveParam.length == 0 && saveBaseParam.length == 0){
  2454 + uni.showToast({
  2455 + title:'请选择检查项',
  2456 + icon:'none'
  2457 + })
  2458 + uni.hideLoading()
  2459 + }
  2460 + uni.request({
  2461 + url:this.apiUrl + 'license/updateSelfMonitInfo',
  2462 + method:'post',
  2463 + data:saveParam,
  2464 + success: (res) => {
  2465 + this.check_zxjc()
  2466 + }
  2467 + })
  2468 + uni.request({
  2469 + url:this.apiUrl + 'license/baseinfoupdate',
  2470 + method:'post',
  2471 + data:saveBaseParam,
  2472 + success: (res) => {
  2473 +
  2474 + }
  2475 + })
  2476 + uni.hideLoading()
  2477 + uni.showToast({
  2478 + title:'保存成功'
  2479 + })
2471 } 2480 }
2472 2481
2473 - //废水-排口-检测内容 2482 + //废水-排口-检测内容(已检查)
2474 if(this.param.code == 'fs_pk_jcnr'){ 2483 if(this.param.code == 'fs_pk_jcnr'){
2475 var saveParam = [] 2484 var saveParam = []
2476 //保存检测内容 2485 //保存检测内容
@@ -2485,18 +2494,19 @@ @@ -2485,18 +2494,19 @@
2485 }) 2494 })
2486 } 2495 }
2487 } 2496 }
2488 - uni.request({  
2489 - url:this.apiUrl + 'license/updateSelfMonitInfo',  
2490 - method:'post',  
2491 - data:saveParam,  
2492 - success: (res) => {  
2493 - uni.hideLoading()  
2494 - uni.showToast({  
2495 - title:'保存成功'  
2496 - })  
2497 - }  
2498 - })  
2499 } 2497 }
  2498 + uni.request({
  2499 + url:this.apiUrl + 'license/updateSelfMonitInfo',
  2500 + method:'post',
  2501 + data:saveParam,
  2502 + success: (res) => {
  2503 + uni.hideLoading()
  2504 + this.check_zxjc()
  2505 + uni.showToast({
  2506 + title:'保存成功'
  2507 + })
  2508 + }
  2509 + })
2500 } 2510 }
2501 2511
2502 if(this.param.code == 'jbqk' 2512 if(this.param.code == 'jbqk'
@@ -2506,6 +2516,7 @@ @@ -2506,6 +2516,7 @@
2506 || this.param.code == 'xglsqk' 2516 || this.param.code == 'xglsqk'
2507 || this.param.code == 'qtxknr' 2517 || this.param.code == 'qtxknr'
2508 || this.param.code == 'swrqk' 2518 || this.param.code == 'swrqk'
  2519 + || this.param.code == 'dqwrqk'
2509 || this.param.code == 'fs_pk' 2520 || this.param.code == 'fs_pk'
2510 ){ 2521 ){
2511 var saveParam = [] 2522 var saveParam = []
@@ -2555,21 +2566,36 @@ @@ -2555,21 +2566,36 @@
2555 }) 2566 })
2556 } 2567 }
2557 }) 2568 })
2558 -  
2559 - if(allSaveStatus){  
2560 - var four = 'one' 2569 + //判断是否保存完成调取保存步骤接口
  2570 + if(
  2571 + (this.param.code == 'jbqk'
  2572 + || this.param.code == 'hjgltz'
  2573 + || this.param.code == 'zxbg'
  2574 + || this.param.code == 'xxgk'
  2575 + || this.param.code == 'xglsqk'
  2576 + || this.param.code == 'qtxknr') && allSaveStatus
  2577 + ){
  2578 + var step = ''
2561 switch(this.param.code){ 2579 switch(this.param.code){
2562 - case 'jbqk' : four = '1';break;  
2563 - default:four = 'six';break; 2580 + case 'jbqk' : step = '1';break;
  2581 + case 'hjgltz' : step = '4';break;
  2582 + case 'zxbg' : step = '5';break;
  2583 + case 'xxgk' : step = '6';break;
  2584 + case 'xglsqk' : step = '7';break;
  2585 + default:step = '8';break;
2564 } 2586 }
2565 uni.request({ 2587 uni.request({
2566 - url:this.apiUrl + 'license/updateStep',  
2567 - data:{companyId:this.companyId,four:four}, 2588 + url:this.apiUrl + 'license/updateStep?companyId='+this.companyId+'&step='+step,
  2589 + data:{},
2568 method:'post', 2590 method:'post',
2569 success:(res)=>{ 2591 success:(res)=>{
2570 - console.log('保存成功!',res) 2592 + console.log('步骤保存',res)
2571 } 2593 }
2572 }) 2594 })
  2595 + }else if(this.param.code == 'fs_pk'){
  2596 + this.check_zxjc()
  2597 + }else{
  2598 + this.check_cwhj()
2573 } 2599 }
2574 uni.hideLoading() 2600 uni.hideLoading()
2575 } 2601 }
@@ -2635,15 +2661,18 @@ @@ -2635,15 +2661,18 @@
2635 }) 2661 })
2636 } 2662 }
2637 }) 2663 })
  2664 + this.check_cwhj()
2638 uni.hideLoading() 2665 uni.hideLoading()
2639 } 2666 }
  2667 + uni.navigateBack({
  2668 + delta:1
  2669 + })
2640 }, 2670 },
2641 async returnImgs(moreInfo){ 2671 async returnImgs(moreInfo){
2642 for(var j = 0; j < moreInfo.IMGS.length; j ++){ 2672 for(var j = 0; j < moreInfo.IMGS.length; j ++){
2643 moreInfo.IMGS[j] = (await this.imgToBase(moreInfo.IMGS[j])).base64 2673 moreInfo.IMGS[j] = (await this.imgToBase(moreInfo.IMGS[j])).base64
2644 } 2674 }
2645 }, 2675 },
2646 -  
2647 imgToBase(imgUrl){ 2676 imgToBase(imgUrl){
2648 return new Promise((reslove,reject) => { 2677 return new Promise((reslove,reject) => {
2649 pathToBase64(imgUrl).then(base64 => { 2678 pathToBase64(imgUrl).then(base64 => {
@@ -2652,6 +2681,458 @@ @@ -2652,6 +2681,458 @@
2652 reject(error) 2681 reject(error)
2653 }) 2682 })
2654 }) 2683 })
  2684 + },
  2685 + //自行检测检查是否全部保存
  2686 + check_zxjc(){
  2687 + let allSaveStatus = true
  2688 + //废水有组织排口
  2689 + this.zxjc_pc(0,0,1,'license/selfWater')
  2690 + //废气有组织排口
  2691 + this.zxjc_pc(1,0,1,'license/selfGas')
  2692 + //废气无组织排口
  2693 + this.zxjc_pc(1,1,1,'license/selfGas')
  2694 + setTimeout(() => {
  2695 + try{
  2696 + this.checkDataList.dataList1.forEach(item =>{
  2697 + console.log(item)
  2698 + if(!item.hasOwnProperty("FILEDSTATICS")){
  2699 + throw Error()
  2700 + }
  2701 + })
  2702 + this.checkDataList.dataList2.forEach(item =>{
  2703 + console.log(item)
  2704 + if(!item.hasOwnProperty("FILEDSTATICS")){
  2705 + throw Error()
  2706 + }
  2707 + })
  2708 + }catch(err){
  2709 + allSaveStatus = false
  2710 + }
  2711 + console.log('=================================allSaveStatus',allSaveStatus)
  2712 + if(allSaveStatus){
  2713 + uni.request({
  2714 + url:this.apiUrl + 'license/updateStep?companyId='+this.companyId+'&step=3',
  2715 + data:{},
  2716 + method:'post',
  2717 + success:(res)=>{
  2718 +
  2719 + }
  2720 + })
  2721 + }
  2722 + },1000)
  2723 + },
  2724 + check_zxjc_wait(checkParam){
  2725 + return new Promise((reslove,reject) => {
  2726 +
  2727 + for(var m = 0; m < checkParam.length; m++){
  2728 + var subUrl = checkParam[m].subUrl
  2729 + console.log('subUrl',subUrl)
  2730 + // 废水 - 有组织排口
  2731 + uni.request({
  2732 + url:this.apiUrl + 'license/pdos',
  2733 + method:'get',
  2734 + //pdoType:排口类型,0 水,1 空气,2 固体排放物
  2735 + //selfmonitor:0.非自行监测排口,1.自行监测排口
  2736 + //organization:0.有组织排口 1.无组织排口
  2737 + data:{
  2738 + companyId:this.companyId,
  2739 + pdoType:checkParam[m].pdoType,
  2740 + organization:checkParam[m].organization,
  2741 + selfmonitor:checkParam[m].selfmonitor
  2742 + },
  2743 + success: (res) => {
  2744 + for(var i = 0; i < res.data.data.length; i ++){
  2745 + console.log('checkParam',checkParam,res.data.data)
  2746 + // 废水、废气 - 有组织排口 - 排口检查项
  2747 + uni.request({
  2748 + url:this.apiUrl + subUrl,
  2749 + method:'get',
  2750 + data:{companyId:this.companyId,pdoId:res.data.data[i].ID},
  2751 + success: (res) => {
  2752 + for(var j = 0; j < res.data.data.length; j ++){
  2753 + if(res.data.data[j].FIELDCN =='监测内容'){
  2754 + // 废水、废气 - 有组织排口 - 检测内容
  2755 + uni.request({
  2756 + url:this.apiUrl + 'license/selfMonitInfo',
  2757 + method:'get',
  2758 + data:{id:res.data.data[j].ID},
  2759 + success: (res) => {
  2760 + for(var k = 0; k < res.data.data.length; k ++){
  2761 + console.log(res.data.data[k])
  2762 + uni.request({
  2763 + url:this.apiUrl + 'license/selfMonitValue',
  2764 + method:'get',
  2765 + data:{id:res.data.data[k].ID},
  2766 + success: (res) => {
  2767 + for(var l = 0; l < res.data.data.length; l ++){
  2768 + if(!res.data.data[l].hasOwnProperty("FILEDSTATICS")){
  2769 + reslove({allSaveStatus:false})
  2770 + }
  2771 + }
  2772 + }
  2773 + })
  2774 + }
  2775 + }
  2776 + })
  2777 + }else{
  2778 + if(!res.data.data[j].hasOwnProperty("FILEDSTATICS")){
  2779 + reslove({allSaveStatus:false})
  2780 + }
  2781 + }
  2782 + }
  2783 + }
  2784 + })
  2785 + }
  2786 + }
  2787 + })
  2788 + }
  2789 + })
  2790 + },
  2791 + //产污环节对应排放口及其排放数量
  2792 + async check_cwhj(){
  2793 + //水污染情况
  2794 + var swr_qtpk_ret = await this.check_qtpk('21')
  2795 + console.log('check_swrqk_qtpk之后执行',swr_qtpk_ret)
  2796 + //水污染情况-有组织排口
  2797 + var swr_yzzpk_ret = await this.check_gtfw(0,0,0,'license/waterpull')
  2798 + console.log('swr_yzzpk_ret之后执行',swr_yzzpk_ret)
  2799 + //大气污染情况
  2800 + var dqwr_qtpk_ret = await this.check_qtpk('22')
  2801 + console.log('check_swrqk_qtpk之后执行',dqwr_qtpk_ret)
  2802 + //大气污染情况-有组织排口
  2803 + var dqwr_yzzpk_ret = await this.check_gtfw(1,0,0,'license/airpull')
  2804 + console.log('dqwr_yzzpk_ret之后执行',dqwr_yzzpk_ret)
  2805 + //噪声排放
  2806 + var zspf_ret = await this.check_zspf()
  2807 + console.log('zspf_ret之后执行',zspf_ret)
  2808 + //固体废物排放
  2809 + var gtfw_ret = await this.check_gtfw(2,0,0,'license/solidpull')
  2810 + console.log('gtfw_ret之后执行',gtfw_ret)
  2811 + if(swr_qtpk_ret.allSaveStatus && swr_yzzpk_ret.allSaveStatus && dqwr_qtpk_ret.allSaveStatus && dqwr_yzzpk_ret.allSaveStatus && zspf_ret.allSaveStatus && gtfw_ret.allSaveStatus){
  2812 + uni.request({
  2813 + url:this.apiUrl + 'license/updateStep?companyId='+this.companyId+'&step=2',
  2814 + data:{},
  2815 + method:'post',
  2816 + success:(res)=>{
  2817 +
  2818 + }
  2819 + })
  2820 + }
  2821 + },
  2822 + //水污染情况-其他排口
  2823 + check_qtpk(type){
  2824 + return new Promise((reslove,reject) => {
  2825 + uni.request({
  2826 + url:this.apiUrl + 'license/otherInfo',
  2827 + data:{
  2828 + companyId:this.companyId,
  2829 + type:type
  2830 + },
  2831 + method:'get',
  2832 + success: (res) => {
  2833 + res.data.data.forEach(item => {
  2834 + console.log(item)
  2835 + if(!item.hasOwnProperty("FILEDSTATICS")){
  2836 + reslove({allSaveStatus:false})
  2837 + }
  2838 + })
  2839 + },
  2840 + complete: (res) => {
  2841 + reslove({allSaveStatus:true})
  2842 + }
  2843 + })
  2844 + })
  2845 + },
  2846 + //噪声排放
  2847 + check_zspf(){
  2848 + return new Promise((reslove,reject) => {
  2849 + uni.request({
  2850 + url:this.apiUrl + 'license/noisepull',
  2851 + data:{
  2852 + companyId:this.companyId
  2853 + },
  2854 + method:'get',
  2855 + success: (res) => {
  2856 + res.data.data.noisebase.forEach(item => {
  2857 + if(item.FIELDCN != '生产时段' && item.FIELDCN != '排放限值'){
  2858 + console.log(item)
  2859 + if(!item.hasOwnProperty("FILEDSTATICS")){
  2860 + reslove({allSaveStatus:false})
  2861 + }
  2862 + }
  2863 + })
  2864 + res.data.data.noisevalue.forEach(item => {
  2865 + console.log(item)
  2866 + if(!item.hasOwnProperty("FILEDSTATICS")){
  2867 + reslove({allSaveStatus:false})
  2868 + }
  2869 + })
  2870 + },
  2871 + complete: (res) => {
  2872 + reslove({allSaveStatus:true})
  2873 + }
  2874 + })
  2875 + })
  2876 + },
  2877 + check_gtfw(pdoType,organization,selfmonitor,subUrl){
  2878 + return new Promise((reslove,reject) => {
  2879 + uni.request({
  2880 + url:this.apiUrl + 'license/pdos',
  2881 + method:'get',
  2882 + //pdoType:排口类型,0 水,1 空气,2 固体排放物
  2883 + //selfmonitor:0.非自行监测排口,1.自行监测排口
  2884 + //organization:0.有组织排口 1.无组织排口
  2885 + data:{
  2886 + companyId:this.companyId,
  2887 + pdoType:pdoType,
  2888 + organization:organization,
  2889 + selfmonitor:selfmonitor
  2890 + },
  2891 + success: (res) => {
  2892 + res.data.data.forEach(item => {
  2893 + var gtfw_mc_ret = this.gtfw_mc(item.ID,subUrl)
  2894 + reslove(gtfw_mc_ret)
  2895 + })
  2896 + }
  2897 + })
  2898 + })
  2899 + },
  2900 + async gtfw_mc(pdoId,subUrl){
  2901 + var gtfw_mc_ret = await this.check_gtfw_mc(pdoId,subUrl)
  2902 + return gtfw_mc_ret
  2903 + },
  2904 + check_gtfw_mc(pdoId,subUrl){
  2905 + return new Promise((reslove,reject) => {
  2906 + uni.request({
  2907 + url:this.apiUrl + subUrl,
  2908 + data:{companyId:this.companyId,pdoId:pdoId},
  2909 + method:'get',
  2910 + success: (res_pk) => {
  2911 + console.log('res_pk',res_pk)
  2912 + if(res_pk.data.data.hasOwnProperty("solidbase")){
  2913 + res_pk.data.data.solidbase.forEach(item => {
  2914 + if(item.FIELDCN != '名称及产量'){
  2915 + console.log(item)
  2916 + if(!item.hasOwnProperty("FILEDSTATICS")){
  2917 + reslove({allSaveStatus:false})
  2918 + }
  2919 + }
  2920 + })
  2921 + }
  2922 + if(res_pk.data.data.hasOwnProperty("solidwrw")){
  2923 + res_pk.data.data.solidwrw.forEach(item => {
  2924 + if(item.FIELDCN != '名称及产量'){
  2925 + console.log(item)
  2926 + if(!item.hasOwnProperty("FILEDSTATICS")){
  2927 + reslove({allSaveStatus:false})
  2928 + }
  2929 + }
  2930 + })
  2931 + }
  2932 + if(res_pk.data.data.hasOwnProperty("base")){
  2933 + res_pk.data.data.base.forEach(item => {
  2934 + if(item.FIELDCN != '受纳自然水体' && item.FIELDCN != '污染物种类'){
  2935 + console.log(item)
  2936 + if(!item.hasOwnProperty("FILEDSTATICS")){
  2937 + reslove({allSaveStatus:false})
  2938 + }
  2939 + }
  2940 + })
  2941 + }
  2942 + if(res_pk.data.data.hasOwnProperty("snst")){
  2943 + res_pk.data.data.snst.forEach(item => {
  2944 + console.log(item)
  2945 + if(!item.hasOwnProperty("FILEDSTATICS")){
  2946 + reslove({allSaveStatus:false})
  2947 + }
  2948 + })
  2949 + }
  2950 + if(res_pk.data.data.hasOwnProperty("wrw")){
  2951 + res_pk.data.data.wrw.forEach(item => {
  2952 + console.log(item)
  2953 + if(!item.hasOwnProperty("FILEDSTATICS")){
  2954 + reslove({allSaveStatus:false})
  2955 + }
  2956 + })
  2957 + }
  2958 + if(res_pk.data.data.hasOwnProperty("airbase")){
  2959 + res_pk.data.data.airbase.forEach(item => {
  2960 + if(item.FIELDCN != '污染物种类'){
  2961 + console.log(item)
  2962 + if(!item.hasOwnProperty("FILEDSTATICS")){
  2963 + reslove({allSaveStatus:false})
  2964 + }
  2965 + }
  2966 + })
  2967 + }
  2968 + if(res_pk.data.data.hasOwnProperty("airwrw")){
  2969 + res_pk.data.data.airwrw.forEach(item => {
  2970 + console.log(item)
  2971 + if(!item.hasOwnProperty("FILEDSTATICS")){
  2972 + reslove({allSaveStatus:false})
  2973 + }
  2974 + })
  2975 + }
  2976 + },
  2977 + complete: (res) => {
  2978 + reslove({allSaveStatus:true})
  2979 + }
  2980 + })
  2981 + })
  2982 + },
  2983 +
  2984 + //自行监测-排口、厂界
  2985 + zxjc_pc(pdoType,organization,selfmonitor,subUrl){
  2986 + uni.request({
  2987 + url:this.apiUrl + 'license/pdos',
  2988 + method:'get',
  2989 + //pdoType:排口类型,0 水,1 空气,2 固体排放物
  2990 + //selfmonitor:0.非自行监测排口,1.自行监测排口
  2991 + //organization:0.有组织排口 1.无组织排口
  2992 + data:{
  2993 + companyId:this.companyId,
  2994 + pdoType:pdoType,
  2995 + organization:organization,
  2996 + selfmonitor:selfmonitor
  2997 + },
  2998 + success: (res1) => {
  2999 + res1.data.data.forEach(item1 => {
  3000 + // this.pk_jcx(item.ID,subUrl)
  3001 + uni.request({
  3002 + url:this.apiUrl + subUrl,
  3003 + data:{companyId:this.companyId,pdoId:item1.ID},
  3004 + method:'get',
  3005 + success: (res2) => {
  3006 +
  3007 + res2.data.data.forEach(item2 => {
  3008 + if(item2.FIELDCN != '监测内容'){
  3009 + this.checkDataList.dataList1.push(item2)
  3010 + // console.log(item2)
  3011 + // if(!item2.hasOwnProperty("FILEDSTATICS")){
  3012 + // // allStatusRet.allSaveStatus = false
  3013 + // // this.allSaveStatus = {allSaveStatus:false}
  3014 + // // reslove({allSaveStatus:false})
  3015 + // this.allStatusRet.allSaveStatus = false
  3016 + // }
  3017 + }else{
  3018 + // this.jcx_jcnr(item.ID)
  3019 + uni.request({
  3020 + url:this.apiUrl + 'license/selfMonitInfo',
  3021 + data:{id:item2.ID},
  3022 + method:'get',
  3023 + success: (res3) => {
  3024 +
  3025 + res3.data.data.forEach(item3 => {
  3026 + // var jcnr_check = this.jcnr_check(item.ID)
  3027 + // console.log('jcnr_check',jcnr_check)
  3028 + uni.request({
  3029 + url:this.apiUrl + 'license/selfMonitValue',
  3030 + data:{id:item3.ID},
  3031 + method:'get',
  3032 + success: (res4) => {
  3033 +
  3034 + res4.data.data.forEach(item4 => {
  3035 + this.checkDataList.dataList2.push(item4)
  3036 + // console.log(item4)
  3037 + // if(!item4.hasOwnProperty("FILEDSTATICS")){
  3038 + // this.checkDataList.itemList1.push(item2)
  3039 + // // reslove({allSaveStatus:false})
  3040 + // this.allStatusRet.allSaveStatus = false
  3041 + // // this.allSaveStatus = {allSaveStatus:false}
  3042 + // // return {allSaveStatus:false}
  3043 + // }
  3044 + })
  3045 + }
  3046 + })
  3047 + })
  3048 + }
  3049 + })
  3050 + }
  3051 + })
  3052 + }
  3053 + })
  3054 + })
  3055 + }
  3056 + })
  3057 + },
  3058 + //自行监测-排口、厂界-检查项-监测内容
  3059 + async pk_jcx(pdoType,organization,selfmonitor,subUrl){
  3060 + await this.pk_jcx_req(pdoType,organization,selfmonitor,subUrl)
  3061 +
  3062 + },
  3063 + pk_jcx_req(pdoType,organization,selfmonitor,subUrl){
  3064 + return new Promise((reslove,reject)=>{
  3065 +
  3066 + })
  3067 +
  3068 + /* return new Promise((reslove,reject) => {
  3069 + uni.request({
  3070 + url:this.apiUrl + subUrl,
  3071 + data:{companyId:this.companyId,pdoId:pdoId},
  3072 + method:'get',
  3073 + success: (res_pk) => {
  3074 + res_pk.data.data.forEach(item => {
  3075 + if(item.FIELDCN != '监测内容'){
  3076 + console.log(item)
  3077 + if(!item.hasOwnProperty("FILEDSTATICS")){
  3078 + reslove({allSaveStatus:false})
  3079 + }
  3080 + }else{
  3081 + this.jcx_jcnr(item.ID)
  3082 + }
  3083 + })
  3084 + }
  3085 + })
  3086 + }) */
  3087 + },
  3088 +
  3089 + //自行监测-排口、厂界-检查项-监测内容
  3090 + async jcx_jcnr(id){
  3091 + var jcx_jcnr_req = await this.jcx_jcnr_req(id)
  3092 + console.log('jcx_jcnr_req',jcx_jcnr_req)
  3093 + return jcx_jcnr_req
  3094 + },
  3095 + jcx_jcnr_req(id){
  3096 + return new Promise((reslove,reject) => {
  3097 + uni.request({
  3098 + url:this.apiUrl + 'license/selfMonitInfo',
  3099 + data:{id:id},
  3100 + method:'get',
  3101 + success: (res_pk) => {
  3102 + res_pk.data.data.forEach(item => {
  3103 + var jcnr_check = this.jcnr_check(item.ID)
  3104 + console.log('jcnr_check',jcnr_check)
  3105 + })
  3106 + }
  3107 + })
  3108 + })
  3109 + },
  3110 + //自行监测-排口、厂界-检查项-监测内容
  3111 + async jcnr_check(id){
  3112 + var jcnr_check_req = await this.jcnr_check_req(id)
  3113 + console.log('jcnr_check_req',jcnr_check_req)
  3114 + return jcnr_check_req
  3115 + },
  3116 + jcnr_check_req(id){
  3117 + return new Promise((reslove,reject) => {
  3118 + uni.request({
  3119 + url:this.apiUrl + 'license/selfMonitValue',
  3120 + data:{id:id},
  3121 + method:'get',
  3122 + success: (res_pk) => {
  3123 + res_pk.data.data.forEach(item => {
  3124 + console.log(item)
  3125 + if(!item.hasOwnProperty("FILEDSTATICS")){
  3126 + reslove({allSaveStatus:false})
  3127 + return
  3128 + }
  3129 + })
  3130 + },
  3131 + complete: (res) => {
  3132 + reslove({allSaveStatus:true})
  3133 + }
  3134 + })
  3135 + })
2655 } 3136 }
2656 } 3137 }
2657 } 3138 }
@@ -15,10 +15,13 @@ @@ -15,10 +15,13 @@
15 <view class="topLeft"> 15 <view class="topLeft">
16 检查时间<span>*</span> 16 检查时间<span>*</span>
17 </view> 17 </view>
18 - <view class="topRight" @tap="visibleMinute=true">  
19 - <text>{{checkTime}}</text> 18 + <view class="topRight" v-if="companyInfo.STORED != 1" @tap="visibleMinute=true">
  19 + <text :class="{activeTxt: checkTime != '请选择'}">{{checkTime}}</text>
20 <image class="rightImg" src="../../../static/image/icon_arrow.png" mode=""></image> 20 <image class="rightImg" src="../../../static/image/icon_arrow.png" mode=""></image>
21 </view> 21 </view>
  22 + <view class="topRight" v-if="companyInfo.STORED == 1">
  23 + <text style="color: #323232;">{{companyInfo.TM}}</text>
  24 + </view>
22 </view> 25 </view>
23 <w-picker 26 <w-picker
24 :visible.sync="visibleMinute" 27 :visible.sync="visibleMinute"
@@ -35,7 +38,7 @@ @@ -35,7 +38,7 @@
35 检查人员<span>*</span> 38 检查人员<span>*</span>
36 </view> 39 </view>
37 <view class="topRight"> 40 <view class="topRight">
38 - 普通用户 41 + {{companyInfo.STORED == 1 ? companyInfo.MISSIONPERSON : userInfo.name}}
39 </view> 42 </view>
40 </view> 43 </view>
41 </view> 44 </view>
@@ -64,7 +67,7 @@ @@ -64,7 +67,7 @@
64 </view> 67 </view>
65 </view> 68 </view>
66 <!-- 按钮区域 --> 69 <!-- 按钮区域 -->
67 - <view class="btnWrap"> 70 + <view class="btnWrap" v-if="companyInfo.STORED != 1">
68 <view class="title"> 71 <view class="title">
69 已督查企业记录需确认归档,确认归档后,信息将不可修改 72 已督查企业记录需确认归档,确认归档后,信息将不可修改
70 </view> 73 </view>
@@ -94,6 +97,8 @@ @@ -94,6 +97,8 @@
94 export default { 97 export default {
95 data() { 98 data() {
96 return { 99 return {
  100 + companyInfo:{},
  101 + userInfo:{},
97 companyid:'', 102 companyid:'',
98 showArchiveAlert:false, 103 showArchiveAlert:false,
99 visibleMinute:false, 104 visibleMinute:false,
@@ -201,12 +206,34 @@ @@ -201,12 +206,34 @@
201 }, 206 },
202 onLoad(option) { 207 onLoad(option) {
203 this.companyid = option.companyid 208 this.companyid = option.companyid
  209 + uni.request({
  210 + url:this.apiUrl + 'getLoginUser',
  211 + data:{},
  212 + method:'get',
  213 + header:{
  214 + Authorization:'Bearer '+uni.getStorageSync('token')
  215 + },
  216 + success: (res) => {
  217 + console.log('获取当前登录用户信息',res)
  218 + this.userInfo = res.data.data
  219 + }
  220 + })
204 uni.setNavigationBarTitle({ 221 uni.setNavigationBarTitle({
205 title: option.factoryName //这是修改后的导航栏文字 222 title: option.factoryName //这是修改后的导航栏文字
206 }) 223 })
207 }, 224 },
208 methods: { 225 methods: {
209 getData(){ 226 getData(){
  227 + //企业状态查询
  228 + uni.request({
  229 + url:this.apiUrl + 'license/getCompany',
  230 + data:{companyId:this.companyid},
  231 + method:'get',
  232 + success: (res) => {
  233 + console.log('归档状态查询',res)
  234 + this.companyInfo = res.data.data
  235 + }
  236 + })
210 uni.request({ 237 uni.request({
211 url:this.apiUrl + 'license/step', 238 url:this.apiUrl + 'license/step',
212 data:{companyId:this.companyid}, 239 data:{companyId:this.companyid},
@@ -256,6 +283,14 @@ @@ -256,6 +283,14 @@
256 }) 283 })
257 return 284 return
258 } 285 }
  286 + uni.request({
  287 + url:this.apiUrl + 'license/updateStatus?account='+this.userInfo.account+'&companyId='+this.companyid+'&date='+this.checkTime,
  288 + data:{},
  289 + method:'post',
  290 + success: (res) => {
  291 + console.log('保存归档',res)
  292 + }
  293 + })
259 this.showArchiveAlert = true 294 this.showArchiveAlert = true
260 } 295 }
261 } 296 }
@@ -271,6 +306,7 @@ @@ -271,6 +306,7 @@
271 .topLeft span{color: red;} 306 .topLeft span{color: red;}
272 .topItem .topRight{display: flex;align-items: center;} 307 .topItem .topRight{display: flex;align-items: center;}
273 .topRight text{color: #c8c9cc;} 308 .topRight text{color: #c8c9cc;}
  309 + .topRight .activeTxt{color: #323232;}
274 .topRight .topImg{width: 104rpx;height: 104rpx;} 310 .topRight .topImg{width: 104rpx;height: 104rpx;}
275 .topRight .rightImg{width: 32rpx;height: 32rpx;} 311 .topRight .rightImg{width: 32rpx;height: 32rpx;}
276 /* 底部区域 */ 312 /* 底部区域 */
@@ -11,7 +11,7 @@ @@ -11,7 +11,7 @@
11 账号 11 账号
12 </view> 12 </view>
13 <view class="formVal"> 13 <view class="formVal">
14 - <input type="text" value="" placeholder="请输入账号" placeholder-style="color:#88bdad;font-size: 32rpx;"/> 14 + <input type="text" v-model="param.account" placeholder="请输入账号" placeholder-style="color:#88bdad;font-size: 32rpx;"/>
15 </view> 15 </view>
16 </view> 16 </view>
17 <view class="formItem"> 17 <view class="formItem">
@@ -19,7 +19,7 @@ @@ -19,7 +19,7 @@
19 密码 19 密码
20 </view> 20 </view>
21 <view class="formVal"> 21 <view class="formVal">
22 - <input type="password" value="" placeholder="请输入密码" placeholder-style="color:#88bdad;font-size: 32rpx;"/> 22 + <input type="password" v-model="param.password" placeholder="请输入密码" placeholder-style="color:#88bdad;font-size: 32rpx;"/>
23 </view> 23 </view>
24 </view> 24 </view>
25 </view> 25 </view>
@@ -36,7 +36,10 @@ @@ -36,7 +36,10 @@
36 export default { 36 export default {
37 data() { 37 data() {
38 return { 38 return {
39 - 39 + param:{
  40 + account:'',
  41 + password:''
  42 + }
40 } 43 }
41 }, 44 },
42 onLoad() { 45 onLoad() {
@@ -47,9 +50,40 @@ @@ -47,9 +50,40 @@
47 }, 50 },
48 methods: { 51 methods: {
49 login(){ 52 login(){
50 - uni.switchTab({  
51 - url:'../index/index' 53 + if(this.param.account == ''){
  54 + uni.showToast({
  55 + title:'请输入账号',
  56 + icon:'none'
  57 + })
  58 + return
  59 + }
  60 + if(this.param.password == ''){
  61 + uni.showToast({
  62 + title:'请输入密码',
  63 + icon:'none'
  64 + })
  65 + return
  66 + }
  67 + uni.request({
  68 + url:this.apiUrl + 'login',
  69 + data:this.param,
  70 + method:'post',
  71 + success: (res) => {
  72 + console.log('登录接口',res)
  73 + if(res.data.code == 200){
  74 + uni.setStorageSync('token',res.data.data)
  75 + uni.switchTab({
  76 + url:'../index/index'
  77 + })
  78 + }else{
  79 + uni.showToast({
  80 + title:'账号或密码错误',
  81 + icon:'none'
  82 + })
  83 + }
  84 + }
52 }) 85 })
  86 +
53 } 87 }
54 } 88 }
55 } 89 }