江河数据采集bug修复

This commit is contained in:
shixiaoman
2021-12-16 14:32:37 +08:00
parent a3f5f6ffe2
commit 7517408155
7 changed files with 213 additions and 37 deletions

View File

@@ -254,20 +254,28 @@
let { let {
waterSiteBillId, waterSiteBillId,
billName, billName
reportTime
} = this.editableData[record.waterSiteBillId]; } = this.editableData[record.waterSiteBillId];
let regionLevel = record.regionLevel;
let reportTime = record.createTime;
let createTime = record.createTime;
let userId = record.userId;
let checked = record.checked;
if (!waterSiteBillId || !reportTime) { if (!waterSiteBillId || !reportTime) {
this.$message.error('请填写完整信息再提交') this.$message.error('请填写完整信息再提交')
return return
} }
const hide = this.$message.loading('请求中..', 0); const hide = this.$message.loading('请求中..', 0);
reportTime = reportTime.format("x")
reportTime = Number(reportTime)
updateRiverStationBill({ updateRiverStationBill({
waterSiteBillId, waterSiteBillId,
billName, billName,
reportTime reportTime,
regionLevel,
userId,
createTime,
checked
}).then(res => { }).then(res => {
if (res.data.code == 0) { if (res.data.code == 0) {
this.$message.success(res.data.msg); this.$message.success(res.data.msg);

View File

@@ -124,20 +124,21 @@ export default {
toNationalLevelDataObj(excelData) { toNationalLevelDataObj(excelData) {
var dataTime; var dataTime;
return excelData.map(item => { return excelData.map(item => {
let date = new Date(); // let date = new Date();
let year = date.getFullYear(); // 年 // let year = date.getFullYear(); // 年
var time; // var time;
var samplingTime=""; // var samplingTime="";
console.log(item); // console.log(item);
if(item[14]){ // if(item[14]){
time = item[14].replace('月','-').replace('日','').trim(); // time = item[14].replace('月','-').replace('日','').trim();
console.log(time); // console.log(time);
samplingTime = year+"-"+time; // samplingTime = year+"-"+time;
} // }
console.log(samplingTime); // console.log(samplingTime);
if(samplingTime != ''){ // if(samplingTime != ''){
dataTime = samplingTime; // dataTime = samplingTime;
} // }
var dataTime = moment(item[14],"YYYY/MM/DD").format("YYYY-MM-DD");
console.log(dataTime); console.log(dataTime);
const row = { const row = {
waterSystem:item[1], waterSystem:item[1],
@@ -153,7 +154,7 @@ export default {
waterQualityGoal:item[11], waterQualityGoal:item[11],
dataSources:item[12], dataSources:item[12],
sectionName:item[13], sectionName:item[13],
samplingTime:samplingTime==''?dataTime:samplingTime, samplingTime:dataTime,
wTemp:item[15], wTemp:item[15],
ph:item[16], ph:item[16],
dissolvedOxygen:item[17], dissolvedOxygen:item[17],

View File

@@ -283,19 +283,28 @@
let { let {
surfaceWaterSectionBillId, surfaceWaterSectionBillId,
billName, billName,
reportTime
} = this.editableData[record.surfaceWaterSectionBillId]; } = this.editableData[record.surfaceWaterSectionBillId];
let regionLevel = record.regionLevel;
let reportTime = record.createTime;
let createTime = record.createTime;
let userId = record.userId;
let checked = record.checked;
if (!surfaceWaterSectionBillId || !reportTime) { if (!surfaceWaterSectionBillId || !reportTime) {
this.$message.error('请填写完整信息再提交') this.$message.error('请填写完整信息再提交')
return return
} }
const hide = this.$message.loading('请求中..', 0); const hide = this.$message.loading('请求中..', 0);
reportTime = reportTime.format("x")
reportTime = Number(reportTime)
updateRiverBill({ updateRiverBill({
surfaceWaterSectionBillId, surfaceWaterSectionBillId,
billName, billName,
reportTime reportTime,
regionLevel,
userId,
createTime,
checked
}).then(res => { }).then(res => {
if (res.data.code == 0) { if (res.data.code == 0) {
this.$message.success(res.data.msg); this.$message.success(res.data.msg);

View File

@@ -105,7 +105,8 @@
import { import {
removeRiverStationBill, removeRiverStationBill,
removeBatchRiverStationBill, removeBatchRiverStationBill,
verifyRiverStationBill verifyRiverStationBill,
updateRiverStationBill,
} from "@/api/ecology/river-station"; } from "@/api/ecology/river-station";
import moment from "moment"; import moment from "moment";
export default { export default {
@@ -289,23 +290,34 @@
}, },
save(record) { save(record) {
console.log(record);
let { let {
nationalLevelWaterFunctionAreaBillId, nationalLevelWaterFunctionAreaBillId,
billName, billName,
reportTime } =this.editableData[record.nationalLevelWaterFunctionAreaBillId];
} = this.editableData[record.nationalLevelWaterFunctionAreaBillId];
console.log(billName);
let regionLevel = record.regionLevel;
let reportTime = record.createTime;
let createTime = record.createTime;
let userId = record.userId
let checked = record.checked
if (!nationalLevelWaterFunctionAreaBillId || !reportTime) { if (!nationalLevelWaterFunctionAreaBillId || !reportTime) {
this.$message.error('请填写完整信息再提交') this.$message.error('请填写完整信息再提交')
return return
} }
const hide = this.$message.loading('请求中..', 0); const hide = this.$message.loading('请求中..', 0);
reportTime = reportTime.format("x") // reportTime = reportTime.format("x")
reportTime = Number(reportTime) // reportTime = Number(reportTime)
if(record.regionLevel == '1'){
updateWaterFunctionAreaBill({ updateWaterFunctionAreaBill({
nationalLevelWaterFunctionAreaBillId, nationalLevelWaterFunctionAreaBillId,
billName, billName,
reportTime reportTime,
regionLevel,
userId,
createTime,
checked
}).then(res => { }).then(res => {
if (res.data.code == 0) { if (res.data.code == 0) {
this.$message.success(res.data.msg); this.$message.success(res.data.msg);
@@ -321,6 +333,33 @@
delete this.editableData[record.nationalLevelWaterFunctionAreaBillId] delete this.editableData[record.nationalLevelWaterFunctionAreaBillId]
hide() hide()
}) })
}else{
let waterStationWaterFunctionAreaBillId = nationalLevelWaterFunctionAreaBillId
updateRiverStationBill({
waterStationWaterFunctionAreaBillId,
billName,
reportTime,
regionLevel,
userId,
createTime,
checked
}).then(res => {
if (res.data.code == 0) {
this.$message.success(res.data.msg);
record.billName = billName;
record.reportTime = reportTime
} else {
this.$message.error(res.data.msg);
}
}).catch(e => {
console.log(e);
this.$message.error(e.message);
}).finally(() => {
delete this.editableData[record.nationalLevelWaterFunctionAreaBillId]
hide()
})
}
}, },
/* 删除单个 */ /* 删除单个 */

View File

@@ -20,7 +20,7 @@
</a-select> </a-select>
</a-form-item> </a-form-item>
<a-form-item label="监测类型"> <a-form-item label="监测类型">
<a-select v-model:value="where.monitorType" placeholder="请选择监测类型" allowClear showSearch> <a-select v-model:value="where.monitorType" placeholder="请选择监测类型" @change="handleChange" allowClear showSearch>
<a-select-option :value="'1'">全因子</a-select-option> <a-select-option :value="'1'">全因子</a-select-option>
<a-select-option :value="'2'">纳污红线</a-select-option> <a-select-option :value="'2'">纳污红线</a-select-option>
</a-select> </a-select>
@@ -114,6 +114,64 @@
}) })
}, },
methods: { methods: {
handleChange() {
console.log(this.columns.length);
console.log(this.where.monitorType);
let item1 = {
title: "水功能区限值纳污红线主要控制项目达标评价",
children: [{
title: "水功能区水质类别",
dataIndex: "lprlWaterFunctionAreaWaterQualityCategory"
},
{
title: "达标评价结论",
dataIndex: "lprlCompliantEvaluationConclusion"
},
{
title: "主要超标项目及其超标倍数",
dataIndex: "lprlMajorOverStandardItemsMultiples"
},
]
};
let item2 = {
title: "全因子评价",
children: [{
title: "水功能区水质类别",
dataIndex: "ffeWaterFunctionAreaWaterQualityCategory"
},
{
title: "达标评价结论",
dataIndex: "ffeCompliantEvaluationConclusion"
},
{
title: "主要超标项目及其超标倍数",
dataIndex: "ffeMajorOverStandardItemsMultiples"
},
]
};
let item3 = {title: "系统编码", dataIndex: "systemCode", sorter: true,};
let item4 = {title: "备注", dataIndex: "remark", sorter: true,};
if(this.where.monitorType == undefined){
this.columns.splice(37, 1, item2);
this.columns.splice(38, 1, item1);
this.columns.splice(39, 1, item3);
this.columns.splice(40, 1, item4);
}
if (this.columns.length == 40) {
if (this.where.monitorType == '2') {
this.columns.splice(37, 1, item1);
} else if (this.where.monitorType == '1') {
this.columns.splice(37, 1, item2);
}
}
if (this.columns.length == 41) {
if (this.where.monitorType == '2') {
this.columns.splice(37, 1);
} else if (this.where.monitorType == '1') {
this.columns.splice(38, 1);
}
}
},
/* 刷新表格 */ /* 刷新表格 */
reload() { reload() {
this.loading = true; this.loading = true;
@@ -122,8 +180,8 @@
console.log(res.data.data); console.log(res.data.data);
if (res.data.code == 0) { if (res.data.code == 0) {
this.$message.success(res.data.msg); this.$message.success(res.data.msg);
if(res.data.data != undefined){ if (res.data.data != undefined) {
res.data.data.forEach((e=>{ res.data.data.forEach((e => {
this.datasource.push(e); this.datasource.push(e);
})) }))
} }

View File

@@ -20,7 +20,7 @@
</a-select> </a-select>
</a-form-item> </a-form-item>
<a-form-item label="监测类型"> <a-form-item label="监测类型">
<a-select v-model:value="where.monitorType" placeholder="请选择监测类型" allowClear showSearch> <a-select v-model:value="where.monitorType" placeholder="请选择监测类型" @change="handleChange" allowClear showSearch>
<a-select-option :value="'1'">全因子</a-select-option> <a-select-option :value="'1'">全因子</a-select-option>
<a-select-option :value="'2'">纳污红线</a-select-option> <a-select-option :value="'2'">纳污红线</a-select-option>
</a-select> </a-select>
@@ -116,6 +116,67 @@
}) })
}, },
methods: { methods: {
handleChange() {
this.columns.forEach((e,index)=>{
console.log("jjjjj"+e.title+"index"+index);
})
console.log(this.columns.length);
console.log(this.where.monitorType);
let item1 = {
title: "水功能区限值纳污红线主要控制项目达标评价",
children: [{
title: "水功能区水质类别",
dataIndex: "lprlWaterFunctionAreaWaterQualityCategory"
},
{
title: "达标评价结论",
dataIndex: "lprlCompliantEvaluationConclusion"
},
{
title: "主要超标项目及其超标倍数",
dataIndex: "lprlMajorOverStandardItemsMultiples"
},
]
};
let item2 = {
title: "全因子评价",
children: [{
title: "水功能区水质类别",
dataIndex: "ffeWaterFunctionAreaWaterQualityCategory"
},
{
title: "达标评价结论",
dataIndex: "ffeCompliantEvaluationConclusion"
},
{
title: "主要超标项目及其超标倍数",
dataIndex: "ffeMajorOverStandardItemsMultiples"
},
]
};
let item3 = {title: "系统编码", dataIndex: "systemCode", sorter: true,};
let item4 = {title: "备注", dataIndex: "remark", sorter: true,};
if(this.where.monitorType == undefined){
this.columns.splice(37, 1, item2);
this.columns.splice(38, 1, item1);
this.columns.splice(39, 1, item3);
this.columns.splice(40, 1, item4);
}
if (this.columns.length == 40) {
if (this.where.monitorType == '2') {
this.columns.splice(37, 1, item1);
} else if (this.where.monitorType == '1') {
this.columns.splice(37, 1, item2);
}
}
if (this.columns.length == 41) {
if (this.where.monitorType == '2') {
this.columns.splice(37, 1);
} else if (this.where.monitorType == '1') {
this.columns.splice(38, 1);
}
}
},
/* 刷新表格 */ /* 刷新表格 */
reload() { reload() {
this.loading = true; this.loading = true;