作者 徐强

提交

{
"name" : "eej",
"name" : "生态环境监管",
"appid" : "__UNI__8F3ECEE",
"description" : "",
"versionName" : "1.0.0",
... ...
... ... @@ -119,6 +119,7 @@
data:this.param,
success: (res) => {
this.list = res.data.data
console.log('企业列表',this.list)
uni.hideLoading()
}
})
... ...
... ... @@ -7,7 +7,7 @@
<sub-radio-temp v-if="item.tempType == 'subRadio'" :keyList="item.keyList"></sub-radio-temp>
</view>
<view style="height: 130rpx;"></view>
<view class="bottomBtnWrap">
<view class="bottomBtnWrap" v-if="param.code != 'fs' && param.code != 'fq' && param.code != 'gtfwpf' && companyInfo.STORED != 1">
<view class="bottomBtn" @click="save">
保存
</view>
... ... @@ -86,6 +86,7 @@
export default {
data() {
return {
companyInfo:{},
desc:'',
LAT:'',
LON:'',
... ... @@ -99,6 +100,7 @@
checkList:[],
checkIndex:0,
keyIndex:0,
checkDataList:{dataList1:[],dataList2:[]}
}
},
components:{
... ... @@ -110,7 +112,16 @@
onLoad(option){
this.param = JSON.parse(option.param)
this.companyId = option.companyid
console.log('当前code',this.param.code)
//企业状态查询
uni.request({
url:this.apiUrl + 'license/getCompany',
data:{companyId:this.companyId},
method:'get',
success: (res) => {
console.log('归档状态查询',res)
this.companyInfo = res.data.data
}
})
//基本情况
if(this.param.code == 'jbqk'){
this.checkList=[
... ... @@ -1096,7 +1107,7 @@
keyList:[
{
titleDesc:'一.',
title:'自行测报告',
title:'自行测报告',
moreBtn:true,//是否显示更多按钮
check:-1,
moreInfo:{
... ... @@ -1122,7 +1133,12 @@
title:'委托第三方监测',
moreBtn:true,//是否显示更多按钮
check:-1,
moreInfo:false,
moreInfo:{
LAT:'',
LON:'',
NOTE:'',
IMGS:[]
},
last:false,
subKeyList:[
{
... ... @@ -1729,58 +1745,40 @@
}
}
if(this.checkList[i].tempType == 'radio' && this.param.code == 'swrqk'){
if(this.checkList[i].tempType == 'radio' && (this.param.code == 'swrqk' || this.param.code == 'dqwrqk')){
var check = this.checkList[i]
var type = this.param.code == 'swrqk' ? '21' : '22'
console.log('type',type)
uni.request({
url:this.apiUrl + 'license/otherInfo',
method:'get',
data:{companyId:this.companyId,type:'21'},
data:{companyId:this.companyId,type:type},
success: (res) => {
console.log('产污环节-水污染',res)
}
})
/* for(var i = 0; i < this.checkList[k].keyList.length; i++){
for(var j = 0; j < res.data.data.base.length; j ++){
if(this.checkList[k].keyList[i].title == res.data.data.base[j].FIELDCN){
this.checkList[k].keyList[i].id = res.data.data.base[j].ID
if(this.checkList[k].keyList[i].title == '受纳自然水体'){
for(var l = 0;l < res.data.data.snst.length; l++){
if(res.data.data.snst[l].FILEDSTATICS){
res.data.data.snst[l].FILEDSTATICS = parseInt(res.data.data.snst[l].FILEDSTATICS)
}else{
res.data.data.snst[l].FILEDSTATICS = -1
}
}
this.checkList[k].keyList[i].subKeyList = res.data.data.snst
}
if(this.checkList[k].keyList[i].title == '污染物种类'){
for(var l = 0;l < res.data.data.wrw.length; l++){
if(res.data.data.wrw[l].FILEDSTATICS){
res.data.data.wrw[l].FILEDSTATICS = parseInt(res.data.data.wrw[l].FILEDSTATICS)
for(var j = 0; j < check.keyList.length; j++){
for(var k = 0; k < res.data.data.length; k ++){
if(check.keyList[j].title == res.data.data[k].FIELDCN){
check.keyList[j].id = res.data.data[k].ID
if(res.data.data[k].FILEDSTATICS){
check.keyList[j].check = parseInt(res.data.data[k].FILEDSTATICS)
}else{
res.data.data.wrw[l].FILEDSTATICS = -1
}
check.keyList[j].check = -1
}
this.checkList[k].keyList[i].subKeyList = res.data.data.wrw
if(res.data.data[k].IMGS){
check.keyList[j].moreInfo.IMGS = res.data.data[k].IMGS
}
if(res.data.data.base[j].FILEDSTATICS){
this.checkList[k].keyList[i].check = parseInt(res.data.data.base[j].FILEDSTATICS)
}else{
this.checkList[k].keyList[i].check = -1
if(res.data.data[j].NOTE){
check.keyList[j].moreInfo.NOTE = res.data.data[k].NOTE
}
if(res.data.data.base[j].IMGS){
this.checkList[k].keyList[i].moreInfo.IMGS = res.data.data.base[j].IMGS
if(res.data.data[j].LON){
check.keyList[j].moreInfo.LON = res.data.data[k].LON
check.keyList[j].moreInfo.LAT = res.data.data[k].LAT
}
if(res.data.data.base[j].NOTE){
this.checkList[k].keyList[i].moreInfo.NOTE = res.data.data.base[j].NOTE
break;
}
if(res.data.data.base[j].LON){
this.checkList[k].keyList[i].moreInfo.LON = res.data.data.base[j].LON
this.checkList[k].keyList[i].moreInfo.LAT = res.data.data.base[j].LAT
}
break;
}
}
} */
})
}
}
}
... ... @@ -1954,6 +1952,7 @@
}
}
}
if(res.data.data.noisevalue.length > 0){
for(var k = 0; k < 2; k ++){
console.log(res.data.data.noisevalue[k])
this.checkList[1].keyList[0].subKeyList.push({
... ... @@ -1971,40 +1970,9 @@
FILEDSTATICS:res.data.data.noisevalue[k].FILEDSTATICS ? parseInt(res.data.data.noisevalue[k].FILEDSTATICS) : -1
})
}
}
})
/* uni.request({
url:this.apiUrl + 'license/noiselimit',
method:'get',
data:{itemId:'noisetime'},
success: (res)=>{
for(var k = 0; k < res.data.data.length; k ++){
this.checkList[1].keyList[0].subKeyList.push({
ID:res.data.data[k].ID,
FIELDCN:res.data.data[k].TITLE,
CONTENT:res.data.data[k].LIMIT_VALUE,
FILEDSTATICS:res.data.data[k].FILEDSTATICS ? parseInt(res.data.data.solidwrw[l].FILEDSTATICS) : -1
})
}
}
})
uni.request({
url:this.apiUrl + 'license/noiselimit',
method:'get',
data:{itemId:'noisevalue'},
success: (res)=>{
for(var k = 0; k < res.data.data.length; k ++){
this.checkList[3].keyList[0].subKeyList.push({
ID:res.data.data[k].ID,
FIELDCN:res.data.data[k].TITLE,
CONTENT:res.data.data[k].LIMIT_VALUE,
FILEDSTATICS:res.data.data[k].FILEDSTATICS ? parseInt(res.data.data.solidwrw[l].FILEDSTATICS) : -1
})
}
}
}) */
}
//委托处置
... ... @@ -2433,11 +2401,14 @@
uni.showLoading({
title:'保存中...'
})
console.log('this.param.code',this.param.code)
//全部保存状态
var allSaveStatus = true
//废气-排口、厂界
//废气-排口、厂界(已检查)
if(this.param.code == 'fq_pc'){
var saveParam = []
var saveBaseParam = []
//保存检测内容
for(var i = 0; i < this.checkList.length; i ++){
if(this.checkList[i].tempType == 'subRadio'){
... ... @@ -2453,24 +2424,62 @@
})
}
}
}
}
}
if(this.checkList[i].tempType == 'radio'){
for(var j = 0; j < this.checkList[i].keyList.length; j ++){
var check = this.checkList[i].keyList[j].check
var id = this.checkList[i].keyList[j].id
if( this.checkList[i].keyList[j].moreInfo.IMGS.length > 0){
this.returnImgs(this.checkList[i].keyList[j].moreInfo)
}
if(check != -1){
saveBaseParam.push({
filedstatic:check.toString(),
id:id,
lon:this.checkList[i].keyList[j].moreInfo.LON,
lat:this.checkList[i].keyList[j].moreInfo.LAT,
note:this.checkList[i].keyList[j].moreInfo.NOTE,
imgs:this.checkList[i].keyList[j].moreInfo.IMGS
})
}
}
}
}
console.log('saveParam',saveParam)
console.log('saveBaseParam',saveBaseParam)
if(saveParam.length == 0 && saveBaseParam.length == 0){
uni.showToast({
title:'请选择检查项',
icon:'none'
})
uni.hideLoading()
}
uni.request({
url:this.apiUrl + 'license/updateSelfMonitInfo',
method:'post',
data:saveParam,
success: (res) => {
this.check_zxjc()
}
})
uni.request({
url:this.apiUrl + 'license/baseinfoupdate',
method:'post',
data:saveBaseParam,
success: (res) => {
}
})
uni.hideLoading()
uni.showToast({
title:'保存成功'
})
}
})
}
}
}
}
}
//废水-排口-检测内容
//废水-排口-检测内容(已检查)
if(this.param.code == 'fs_pk_jcnr'){
var saveParam = []
//保存检测内容
... ... @@ -2485,19 +2494,20 @@
})
}
}
}
uni.request({
url:this.apiUrl + 'license/updateSelfMonitInfo',
method:'post',
data:saveParam,
success: (res) => {
uni.hideLoading()
this.check_zxjc()
uni.showToast({
title:'保存成功'
})
}
})
}
}
if(this.param.code == 'jbqk'
|| this.param.code == 'hjgltz'
... ... @@ -2506,6 +2516,7 @@
|| this.param.code == 'xglsqk'
|| this.param.code == 'qtxknr'
|| this.param.code == 'swrqk'
|| this.param.code == 'dqwrqk'
|| this.param.code == 'fs_pk'
){
var saveParam = []
... ... @@ -2555,21 +2566,36 @@
})
}
})
if(allSaveStatus){
var four = 'one'
//判断是否保存完成调取保存步骤接口
if(
(this.param.code == 'jbqk'
|| this.param.code == 'hjgltz'
|| this.param.code == 'zxbg'
|| this.param.code == 'xxgk'
|| this.param.code == 'xglsqk'
|| this.param.code == 'qtxknr') && allSaveStatus
){
var step = ''
switch(this.param.code){
case 'jbqk' : four = '1';break;
default:four = 'six';break;
case 'jbqk' : step = '1';break;
case 'hjgltz' : step = '4';break;
case 'zxbg' : step = '5';break;
case 'xxgk' : step = '6';break;
case 'xglsqk' : step = '7';break;
default:step = '8';break;
}
uni.request({
url:this.apiUrl + 'license/updateStep',
data:{companyId:this.companyId,four:four},
url:this.apiUrl + 'license/updateStep?companyId='+this.companyId+'&step='+step,
data:{},
method:'post',
success:(res)=>{
console.log('保存成功!',res)
console.log('步骤保存',res)
}
})
}else if(this.param.code == 'fs_pk'){
this.check_zxjc()
}else{
this.check_cwhj()
}
uni.hideLoading()
}
... ... @@ -2635,15 +2661,18 @@
})
}
})
this.check_cwhj()
uni.hideLoading()
}
uni.navigateBack({
delta:1
})
},
async returnImgs(moreInfo){
for(var j = 0; j < moreInfo.IMGS.length; j ++){
moreInfo.IMGS[j] = (await this.imgToBase(moreInfo.IMGS[j])).base64
}
},
imgToBase(imgUrl){
return new Promise((reslove,reject) => {
pathToBase64(imgUrl).then(base64 => {
... ... @@ -2652,6 +2681,458 @@
reject(error)
})
})
},
//自行检测检查是否全部保存
check_zxjc(){
let allSaveStatus = true
//废水有组织排口
this.zxjc_pc(0,0,1,'license/selfWater')
//废气有组织排口
this.zxjc_pc(1,0,1,'license/selfGas')
//废气无组织排口
this.zxjc_pc(1,1,1,'license/selfGas')
setTimeout(() => {
try{
this.checkDataList.dataList1.forEach(item =>{
console.log(item)
if(!item.hasOwnProperty("FILEDSTATICS")){
throw Error()
}
})
this.checkDataList.dataList2.forEach(item =>{
console.log(item)
if(!item.hasOwnProperty("FILEDSTATICS")){
throw Error()
}
})
}catch(err){
allSaveStatus = false
}
console.log('=================================allSaveStatus',allSaveStatus)
if(allSaveStatus){
uni.request({
url:this.apiUrl + 'license/updateStep?companyId='+this.companyId+'&step=3',
data:{},
method:'post',
success:(res)=>{
}
})
}
},1000)
},
check_zxjc_wait(checkParam){
return new Promise((reslove,reject) => {
for(var m = 0; m < checkParam.length; m++){
var subUrl = checkParam[m].subUrl
console.log('subUrl',subUrl)
// 废水 - 有组织排口
uni.request({
url:this.apiUrl + 'license/pdos',
method:'get',
//pdoType:排口类型,0 水,1 空气,2 固体排放物
//selfmonitor:0.非自行监测排口,1.自行监测排口
//organization:0.有组织排口 1.无组织排口
data:{
companyId:this.companyId,
pdoType:checkParam[m].pdoType,
organization:checkParam[m].organization,
selfmonitor:checkParam[m].selfmonitor
},
success: (res) => {
for(var i = 0; i < res.data.data.length; i ++){
console.log('checkParam',checkParam,res.data.data)
// 废水、废气 - 有组织排口 - 排口检查项
uni.request({
url:this.apiUrl + subUrl,
method:'get',
data:{companyId:this.companyId,pdoId:res.data.data[i].ID},
success: (res) => {
for(var j = 0; j < res.data.data.length; j ++){
if(res.data.data[j].FIELDCN =='监测内容'){
// 废水、废气 - 有组织排口 - 检测内容
uni.request({
url:this.apiUrl + 'license/selfMonitInfo',
method:'get',
data:{id:res.data.data[j].ID},
success: (res) => {
for(var k = 0; k < res.data.data.length; k ++){
console.log(res.data.data[k])
uni.request({
url:this.apiUrl + 'license/selfMonitValue',
method:'get',
data:{id:res.data.data[k].ID},
success: (res) => {
for(var l = 0; l < res.data.data.length; l ++){
if(!res.data.data[l].hasOwnProperty("FILEDSTATICS")){
reslove({allSaveStatus:false})
}
}
}
})
}
}
})
}else{
if(!res.data.data[j].hasOwnProperty("FILEDSTATICS")){
reslove({allSaveStatus:false})
}
}
}
}
})
}
}
})
}
})
},
//产污环节对应排放口及其排放数量
async check_cwhj(){
//水污染情况
var swr_qtpk_ret = await this.check_qtpk('21')
console.log('check_swrqk_qtpk之后执行',swr_qtpk_ret)
//水污染情况-有组织排口
var swr_yzzpk_ret = await this.check_gtfw(0,0,0,'license/waterpull')
console.log('swr_yzzpk_ret之后执行',swr_yzzpk_ret)
//大气污染情况
var dqwr_qtpk_ret = await this.check_qtpk('22')
console.log('check_swrqk_qtpk之后执行',dqwr_qtpk_ret)
//大气污染情况-有组织排口
var dqwr_yzzpk_ret = await this.check_gtfw(1,0,0,'license/airpull')
console.log('dqwr_yzzpk_ret之后执行',dqwr_yzzpk_ret)
//噪声排放
var zspf_ret = await this.check_zspf()
console.log('zspf_ret之后执行',zspf_ret)
//固体废物排放
var gtfw_ret = await this.check_gtfw(2,0,0,'license/solidpull')
console.log('gtfw_ret之后执行',gtfw_ret)
if(swr_qtpk_ret.allSaveStatus && swr_yzzpk_ret.allSaveStatus && dqwr_qtpk_ret.allSaveStatus && dqwr_yzzpk_ret.allSaveStatus && zspf_ret.allSaveStatus && gtfw_ret.allSaveStatus){
uni.request({
url:this.apiUrl + 'license/updateStep?companyId='+this.companyId+'&step=2',
data:{},
method:'post',
success:(res)=>{
}
})
}
},
//水污染情况-其他排口
check_qtpk(type){
return new Promise((reslove,reject) => {
uni.request({
url:this.apiUrl + 'license/otherInfo',
data:{
companyId:this.companyId,
type:type
},
method:'get',
success: (res) => {
res.data.data.forEach(item => {
console.log(item)
if(!item.hasOwnProperty("FILEDSTATICS")){
reslove({allSaveStatus:false})
}
})
},
complete: (res) => {
reslove({allSaveStatus:true})
}
})
})
},
//噪声排放
check_zspf(){
return new Promise((reslove,reject) => {
uni.request({
url:this.apiUrl + 'license/noisepull',
data:{
companyId:this.companyId
},
method:'get',
success: (res) => {
res.data.data.noisebase.forEach(item => {
if(item.FIELDCN != '生产时段' && item.FIELDCN != '排放限值'){
console.log(item)
if(!item.hasOwnProperty("FILEDSTATICS")){
reslove({allSaveStatus:false})
}
}
})
res.data.data.noisevalue.forEach(item => {
console.log(item)
if(!item.hasOwnProperty("FILEDSTATICS")){
reslove({allSaveStatus:false})
}
})
},
complete: (res) => {
reslove({allSaveStatus:true})
}
})
})
},
check_gtfw(pdoType,organization,selfmonitor,subUrl){
return new Promise((reslove,reject) => {
uni.request({
url:this.apiUrl + 'license/pdos',
method:'get',
//pdoType:排口类型,0 水,1 空气,2 固体排放物
//selfmonitor:0.非自行监测排口,1.自行监测排口
//organization:0.有组织排口 1.无组织排口
data:{
companyId:this.companyId,
pdoType:pdoType,
organization:organization,
selfmonitor:selfmonitor
},
success: (res) => {
res.data.data.forEach(item => {
var gtfw_mc_ret = this.gtfw_mc(item.ID,subUrl)
reslove(gtfw_mc_ret)
})
}
})
})
},
async gtfw_mc(pdoId,subUrl){
var gtfw_mc_ret = await this.check_gtfw_mc(pdoId,subUrl)
return gtfw_mc_ret
},
check_gtfw_mc(pdoId,subUrl){
return new Promise((reslove,reject) => {
uni.request({
url:this.apiUrl + subUrl,
data:{companyId:this.companyId,pdoId:pdoId},
method:'get',
success: (res_pk) => {
console.log('res_pk',res_pk)
if(res_pk.data.data.hasOwnProperty("solidbase")){
res_pk.data.data.solidbase.forEach(item => {
if(item.FIELDCN != '名称及产量'){
console.log(item)
if(!item.hasOwnProperty("FILEDSTATICS")){
reslove({allSaveStatus:false})
}
}
})
}
if(res_pk.data.data.hasOwnProperty("solidwrw")){
res_pk.data.data.solidwrw.forEach(item => {
if(item.FIELDCN != '名称及产量'){
console.log(item)
if(!item.hasOwnProperty("FILEDSTATICS")){
reslove({allSaveStatus:false})
}
}
})
}
if(res_pk.data.data.hasOwnProperty("base")){
res_pk.data.data.base.forEach(item => {
if(item.FIELDCN != '受纳自然水体' && item.FIELDCN != '污染物种类'){
console.log(item)
if(!item.hasOwnProperty("FILEDSTATICS")){
reslove({allSaveStatus:false})
}
}
})
}
if(res_pk.data.data.hasOwnProperty("snst")){
res_pk.data.data.snst.forEach(item => {
console.log(item)
if(!item.hasOwnProperty("FILEDSTATICS")){
reslove({allSaveStatus:false})
}
})
}
if(res_pk.data.data.hasOwnProperty("wrw")){
res_pk.data.data.wrw.forEach(item => {
console.log(item)
if(!item.hasOwnProperty("FILEDSTATICS")){
reslove({allSaveStatus:false})
}
})
}
if(res_pk.data.data.hasOwnProperty("airbase")){
res_pk.data.data.airbase.forEach(item => {
if(item.FIELDCN != '污染物种类'){
console.log(item)
if(!item.hasOwnProperty("FILEDSTATICS")){
reslove({allSaveStatus:false})
}
}
})
}
if(res_pk.data.data.hasOwnProperty("airwrw")){
res_pk.data.data.airwrw.forEach(item => {
console.log(item)
if(!item.hasOwnProperty("FILEDSTATICS")){
reslove({allSaveStatus:false})
}
})
}
},
complete: (res) => {
reslove({allSaveStatus:true})
}
})
})
},
//自行监测-排口、厂界
zxjc_pc(pdoType,organization,selfmonitor,subUrl){
uni.request({
url:this.apiUrl + 'license/pdos',
method:'get',
//pdoType:排口类型,0 水,1 空气,2 固体排放物
//selfmonitor:0.非自行监测排口,1.自行监测排口
//organization:0.有组织排口 1.无组织排口
data:{
companyId:this.companyId,
pdoType:pdoType,
organization:organization,
selfmonitor:selfmonitor
},
success: (res1) => {
res1.data.data.forEach(item1 => {
// this.pk_jcx(item.ID,subUrl)
uni.request({
url:this.apiUrl + subUrl,
data:{companyId:this.companyId,pdoId:item1.ID},
method:'get',
success: (res2) => {
res2.data.data.forEach(item2 => {
if(item2.FIELDCN != '监测内容'){
this.checkDataList.dataList1.push(item2)
// console.log(item2)
// if(!item2.hasOwnProperty("FILEDSTATICS")){
// // allStatusRet.allSaveStatus = false
// // this.allSaveStatus = {allSaveStatus:false}
// // reslove({allSaveStatus:false})
// this.allStatusRet.allSaveStatus = false
// }
}else{
// this.jcx_jcnr(item.ID)
uni.request({
url:this.apiUrl + 'license/selfMonitInfo',
data:{id:item2.ID},
method:'get',
success: (res3) => {
res3.data.data.forEach(item3 => {
// var jcnr_check = this.jcnr_check(item.ID)
// console.log('jcnr_check',jcnr_check)
uni.request({
url:this.apiUrl + 'license/selfMonitValue',
data:{id:item3.ID},
method:'get',
success: (res4) => {
res4.data.data.forEach(item4 => {
this.checkDataList.dataList2.push(item4)
// console.log(item4)
// if(!item4.hasOwnProperty("FILEDSTATICS")){
// this.checkDataList.itemList1.push(item2)
// // reslove({allSaveStatus:false})
// this.allStatusRet.allSaveStatus = false
// // this.allSaveStatus = {allSaveStatus:false}
// // return {allSaveStatus:false}
// }
})
}
})
})
}
})
}
})
}
})
})
}
})
},
//自行监测-排口、厂界-检查项-监测内容
async pk_jcx(pdoType,organization,selfmonitor,subUrl){
await this.pk_jcx_req(pdoType,organization,selfmonitor,subUrl)
},
pk_jcx_req(pdoType,organization,selfmonitor,subUrl){
return new Promise((reslove,reject)=>{
})
/* return new Promise((reslove,reject) => {
uni.request({
url:this.apiUrl + subUrl,
data:{companyId:this.companyId,pdoId:pdoId},
method:'get',
success: (res_pk) => {
res_pk.data.data.forEach(item => {
if(item.FIELDCN != '监测内容'){
console.log(item)
if(!item.hasOwnProperty("FILEDSTATICS")){
reslove({allSaveStatus:false})
}
}else{
this.jcx_jcnr(item.ID)
}
})
}
})
}) */
},
//自行监测-排口、厂界-检查项-监测内容
async jcx_jcnr(id){
var jcx_jcnr_req = await this.jcx_jcnr_req(id)
console.log('jcx_jcnr_req',jcx_jcnr_req)
return jcx_jcnr_req
},
jcx_jcnr_req(id){
return new Promise((reslove,reject) => {
uni.request({
url:this.apiUrl + 'license/selfMonitInfo',
data:{id:id},
method:'get',
success: (res_pk) => {
res_pk.data.data.forEach(item => {
var jcnr_check = this.jcnr_check(item.ID)
console.log('jcnr_check',jcnr_check)
})
}
})
})
},
//自行监测-排口、厂界-检查项-监测内容
async jcnr_check(id){
var jcnr_check_req = await this.jcnr_check_req(id)
console.log('jcnr_check_req',jcnr_check_req)
return jcnr_check_req
},
jcnr_check_req(id){
return new Promise((reslove,reject) => {
uni.request({
url:this.apiUrl + 'license/selfMonitValue',
data:{id:id},
method:'get',
success: (res_pk) => {
res_pk.data.data.forEach(item => {
console.log(item)
if(!item.hasOwnProperty("FILEDSTATICS")){
reslove({allSaveStatus:false})
return
}
})
},
complete: (res) => {
reslove({allSaveStatus:true})
}
})
})
}
}
}
... ...
... ... @@ -15,10 +15,13 @@
<view class="topLeft">
检查时间<span>*</span>
</view>
<view class="topRight" @tap="visibleMinute=true">
<text>{{checkTime}}</text>
<view class="topRight" v-if="companyInfo.STORED != 1" @tap="visibleMinute=true">
<text :class="{activeTxt: checkTime != '请选择'}">{{checkTime}}</text>
<image class="rightImg" src="../../../static/image/icon_arrow.png" mode=""></image>
</view>
<view class="topRight" v-if="companyInfo.STORED == 1">
<text style="color: #323232;">{{companyInfo.TM}}</text>
</view>
</view>
<w-picker
:visible.sync="visibleMinute"
... ... @@ -35,7 +38,7 @@
检查人员<span>*</span>
</view>
<view class="topRight">
普通用户
{{companyInfo.STORED == 1 ? companyInfo.MISSIONPERSON : userInfo.name}}
</view>
</view>
</view>
... ... @@ -64,7 +67,7 @@
</view>
</view>
<!-- 按钮区域 -->
<view class="btnWrap">
<view class="btnWrap" v-if="companyInfo.STORED != 1">
<view class="title">
已督查企业记录需确认归档,确认归档后,信息将不可修改
</view>
... ... @@ -94,6 +97,8 @@
export default {
data() {
return {
companyInfo:{},
userInfo:{},
companyid:'',
showArchiveAlert:false,
visibleMinute:false,
... ... @@ -201,12 +206,34 @@
},
onLoad(option) {
this.companyid = option.companyid
uni.request({
url:this.apiUrl + 'getLoginUser',
data:{},
method:'get',
header:{
Authorization:'Bearer '+uni.getStorageSync('token')
},
success: (res) => {
console.log('获取当前登录用户信息',res)
this.userInfo = res.data.data
}
})
uni.setNavigationBarTitle({
title: option.factoryName //这是修改后的导航栏文字
})
},
methods: {
getData(){
//企业状态查询
uni.request({
url:this.apiUrl + 'license/getCompany',
data:{companyId:this.companyid},
method:'get',
success: (res) => {
console.log('归档状态查询',res)
this.companyInfo = res.data.data
}
})
uni.request({
url:this.apiUrl + 'license/step',
data:{companyId:this.companyid},
... ... @@ -256,6 +283,14 @@
})
return
}
uni.request({
url:this.apiUrl + 'license/updateStatus?account='+this.userInfo.account+'&companyId='+this.companyid+'&date='+this.checkTime,
data:{},
method:'post',
success: (res) => {
console.log('保存归档',res)
}
})
this.showArchiveAlert = true
}
}
... ... @@ -271,6 +306,7 @@
.topLeft span{color: red;}
.topItem .topRight{display: flex;align-items: center;}
.topRight text{color: #c8c9cc;}
.topRight .activeTxt{color: #323232;}
.topRight .topImg{width: 104rpx;height: 104rpx;}
.topRight .rightImg{width: 32rpx;height: 32rpx;}
/* 底部区域 */
... ...
... ... @@ -11,7 +11,7 @@
账号
</view>
<view class="formVal">
<input type="text" value="" placeholder="请输入账号" placeholder-style="color:#88bdad;font-size: 32rpx;"/>
<input type="text" v-model="param.account" placeholder="请输入账号" placeholder-style="color:#88bdad;font-size: 32rpx;"/>
</view>
</view>
<view class="formItem">
... ... @@ -19,7 +19,7 @@
密码
</view>
<view class="formVal">
<input type="password" value="" placeholder="请输入密码" placeholder-style="color:#88bdad;font-size: 32rpx;"/>
<input type="password" v-model="param.password" placeholder="请输入密码" placeholder-style="color:#88bdad;font-size: 32rpx;"/>
</view>
</view>
</view>
... ... @@ -36,7 +36,10 @@
export default {
data() {
return {
param:{
account:'',
password:''
}
}
},
onLoad() {
... ... @@ -47,9 +50,40 @@
},
methods: {
login(){
if(this.param.account == ''){
uni.showToast({
title:'请输入账号',
icon:'none'
})
return
}
if(this.param.password == ''){
uni.showToast({
title:'请输入密码',
icon:'none'
})
return
}
uni.request({
url:this.apiUrl + 'login',
data:this.param,
method:'post',
success: (res) => {
console.log('登录接口',res)
if(res.data.code == 200){
uni.setStorageSync('token',res.data.data)
uni.switchTab({
url:'../index/index'
})
}else{
uni.showToast({
title:'账号或密码错误',
icon:'none'
})
}
}
})
}
}
}
... ...