导入。。。。。。。。。。。。。。。。

This commit is contained in:
weicw
2021-09-09 02:47:54 +08:00
parent 39b8b8c34b
commit 185c21eb73
42 changed files with 7693 additions and 1294 deletions

View File

@@ -1,128 +1,33 @@
const tableColumns = [
{title: "点位名称",dataIndex: "place",sorter: true,},
{title: "'水温(℃)",dataIndex: "waterTemperature",sorter: true,},
{title: "pH(无量纲)",dataIndex: "ph",sorter: true,},
{title: "溶解氧",dataIndex: "dissolvedOxygen",sorter: true,},
{title: "高锰酸盐指数",dataIndex: "permanganateIndex",sorter: true,},
{title: "化学需氧量",dataIndex: "cod",sorter: true,},
{title: "五日生化需氧量",dataIndex: "fiveDayBod",sorter: true,},
{title: "氨氮",dataIndex: "ammonia",sorter: true,},
{title: "总磷",dataIndex: "totalPhosphorus",sorter: true,},
{title: "总氮",dataIndex: "totalNitrogen",sorter: true,},
{title: "",dataIndex: "cu",sorter: true,},
{title: "",dataIndex: "zn",sorter: true,},
{title: "氟化物",dataIndex: "fluoride",sorter: true,},
{title: "硒",dataIndex: "se",sorter: true,},
{title: "",dataIndex: "as",sorter: true,},
{title: "",dataIndex: "hg",sorter: true,},
{title: "",dataIndex: "cd",sorter: true,},
{title: "铬(六价)",dataIndex: "cr",sorter: true,},
{title: "铅",dataIndex: "pb",sorter: true,},
{title: "氰化物",dataIndex: "cyanide",sorter: true,},
{title: "挥发酚",dataIndex: "volatilePhenol",sorter: true,},
{title: "石油类",dataIndex: "petro",sorter: true,},
{title: "阴离子表面活性剂",dataIndex: "anionicSurfactant",sorter: true,},
{title: "硫化物",dataIndex: "sulfide",sorter: true,},
{title: "粪大肠菌群(MPN/L)",dataIndex: "fecalColiforms",sorter: true,},
{title: "硫酸盐",dataIndex: "sulfate",sorter: true,},
{title: "氯化物",dataIndex: "chloride",sorter: true,},
{title: "硝酸盐氮",dataIndex: "nitrateNitrogen",sorter: true,},
{title: "铁",dataIndex: "fe",sorter: true,},
{title: "锰",dataIndex: "mn",sorter: true,},
{title: "三氯甲烷",dataIndex: "chcl3",sorter: true,},
{title: "四氯化碳",dataIndex: "ccl4",sorter: true,},
{title: "三溴甲烷",dataIndex: "chbr3",sorter: true,},
{title: "二氯甲烷",dataIndex: "ch2cl2",sorter: true,},
{title: "12-二氯乙烷",dataIndex: "c2h4cl2",sorter: true,},
{title: "环氧氯丙烷",dataIndex: "c3h5clO",sorter: true,},
{title: "氯乙烯",dataIndex: "c2h3cl",sorter: true,},
{title: "11-二氯乙烯",dataIndex: "c2h2cl211",sorter: true,},
{title: "12-二氯乙烯",dataIndex: "c2h2cl212",sorter: true,},
{title: "三氯乙烯",dataIndex: "c2hcl3",sorter: true,},
{title: "四氯乙烯",dataIndex: "c2cl4",sorter: true,},
{title: "氯丁二烯",dataIndex: "c4h5cl",sorter: true,},
{title: "六氯丁二烯",dataIndex: "c4cl6",sorter: true,},
{title: "苯乙烯",dataIndex: "c8h8",sorter: true,},
{title: "甲醛",dataIndex: "ch2o",sorter: true,},
{title: "乙醛",dataIndex: "c2h4o",sorter: true,},
{title: "丙烯醛",dataIndex: "c3h4o",sorter: true,},
{title: "三氯乙醛",dataIndex: "c2hcl3o",sorter: true,},
{title: "苯",dataIndex: "c6h6",sorter: true,},
{title: "甲苯",dataIndex: "c7h8",sorter: true,},
{title: "乙苯",dataIndex: "c8h10Ethylbenzene",sorter: true,},
{title: "二甲苯",dataIndex: "c8h10Dimethylbenzene",sorter: true,},
{title: "异丙苯",dataIndex: "c9h12",sorter: true,},
{title: "氯苯",dataIndex: "c6h5cl",sorter: true,},
{title: "12-二氯苯",dataIndex: "c6h4cl212",sorter: true,},
{title: "14-二氯苯",dataIndex: "c6h4cl214",sorter: true,},
{title: "三氯苯",dataIndex: "c6h3cl3",sorter: true,},
{title: "四氯苯",dataIndex: "c6h2cl4",sorter: true,},
{title: "六氯苯",dataIndex: "c6cl6",sorter: true,},
{title: "硝基苯",dataIndex: "c6h5no2",sorter: true,},
{title: "二硝基苯",dataIndex: "c6h4n2o4",sorter: true,},
{title: "24-二硝基甲苯",dataIndex: "c7h6n2o4",sorter: true,},
{title: "246-三硝基甲苯",dataIndex: "c7h5o6n3",sorter: true,},
{title: "硝基氯苯",dataIndex: "c6h4clno2",sorter: true,},
{title: "24-二硝基氯苯 ",dataIndex: "c6h3cln2o4",sorter: true,},
{title: "24-二氯苯酚",dataIndex: "c6h4cl2o",sorter: true,},
{title: "246-三氯苯酚",dataIndex: "c6h3cl3o",sorter: true,},
{title: "五氯酚",dataIndex: "c6hcl5o",sorter: true,},
{title: "苯胺",dataIndex: "c6h7n",sorter: true,},
{title: "联苯胺",dataIndex: "c6h4nh22",sorter: true,},
{title: "丙烯酰胺",dataIndex: "c3h5no",sorter: true,},
{title: "丙烯腈",dataIndex: "c3h3n",sorter: true,},
{title: "邻苯二甲酸二丁酯",dataIndex: "c16h22o4",sorter: true,},
{title: "邻苯二甲酸二2-乙基已基)酯",dataIndex: "c16h35o4p",sorter: true,},
{title: "水合肼",dataIndex: "n2h4h2o",sorter: true,},
{title: "四乙基铅",dataIndex: "c8h20pd",sorter: true,},
{title: "吡啶",dataIndex: "c5h5n",sorter: true,},
{title: "松节油",dataIndex: "turpentine",sorter: true,},
{title: "苦味酸",dataIndex: "c6h3n3o7",sorter: true,},
{title: "丁基黄原酸",dataIndex: "butylXanthogenAcid",sorter: true,},
{title: "活性氯",dataIndex: "activeChlorine",sorter: true,},
{title: "滴滴涕",dataIndex: "c14h9cl5",sorter: true,},
{title: "林丹",dataIndex: "c6h6cl6",sorter: true,},
{title: "环氧七氯",dataIndex: "c10h5cl7O",sorter: true,},
{title: "对硫磷",dataIndex: "c10h14no5ps",sorter: true,},
{title: "甲基对硫磷",dataIndex: "c8h10o5nps",sorter: true,},
{title: "马拉硫磷",dataIndex: "c10h19o6ps2",sorter: true,},
{title: "乐果",dataIndex: "c5h12no3ps2",sorter: true,},
{title: "敌敌畏",dataIndex: "c4h7cl2o4p",sorter: true,},
{title: "敌百虫",dataIndex: "c4h8cl3o4p",sorter: true,},
{title: "内吸磷",dataIndex: "c8h19o3ps2",sorter: true,},
{title: "百菌清",dataIndex: "c8cl4n2",sorter: true,},
{title: "甲萘威",dataIndex: "c12h11no2",sorter: true,},
{title: "溴氰菊酯",dataIndex: "c22h19br2no3",sorter: true,},
{title: "阿特拉津",dataIndex: "c8h14cln5",sorter: true,},
{title: "苯并(a)芘 ",dataIndex: "c20h12",sorter: true,},
{title: "甲基汞",dataIndex: "ch3hg",sorter: true,},
{title: "多氯联苯",dataIndex: "c12h10Xclx",sorter: true,},
{title: "微囊藻毒素-LR",dataIndex: "微囊藻毒素-LR",sorter: true,},
{title: "黄磷",dataIndex: "p4",sorter: true,},
{title: "钼",dataIndex: "mo",sorter: true,},
{title: "钴",dataIndex: "co",sorter: true,},
{title: "铍",dataIndex: "be",sorter: true,},
{title: "硼",dataIndex: "b",sorter: true,},
{title: "锑",dataIndex: "sb",sorter: true,},
{title: "镍",dataIndex: "ni",sorter: true,},
{title: "钡",dataIndex: "ba",sorter: true,},
{title: "钒",dataIndex: "v",sorter: true,},
{title: "钛",dataIndex: "ti",sorter: true,},
{title: "铊",dataIndex: "tl",sorter: true,},
{title: "水体类型", dataIndex: "waterBodyType", sorter: true,},
{title: "水资源一级区名称", dataIndex: "waterResourcesFirstLevelZoneName", sorter: true,},
{title: "水质目标", dataIndex: "waterQualityGoal", sorter: true,},
{title: "数据来源", dataIndex: "dataSources", sorter: true,},
{title: "断面名称", dataIndex: "sectionName", sorter: true,},
// {title: "采样时间", dataIndex: "samplingTime", sorter: true,},
{title: "溶解氧", dataIndex: "dissolvedOxygen", sorter: true,},
{title: "高锰酸盐指数", dataIndex: "permanganateIndex", sorter: true,},
{title: "化学需氧量", dataIndex: "cod", sorter: true,},
{title: "五日生化需氧量", dataIndex: "fiveDayBod", sorter: true,},
{title: "氨氮", dataIndex: "ammonia", sorter: true,},
{title: "总磷", dataIndex: "totalPhosphorus", sorter: true,},
{
title: "全因子评价", children: [
{title: "水功能区水质类别", dataIndex: "ffeWaterFunctionAreaWaterQualityCategory"},
{title: "达标评价结论", dataIndex: "ffeCompliantEvaluationConclusion"},
{title: "主要超标项目及其超标倍数", dataIndex: "ffeMajorOverStandardItemsMultiples"},
]
},
{
title: "水功能区限值纳污红线主要控制项目达标评价", children: [
{title: "水功能区水质类别", dataIndex: "lprlWaterFunctionAreaWaterQualityCategory"},
{title: "达标评价结论", dataIndex: "lprlCompliantEvaluationConclusion"},
{title: "主要超标项目及其超标倍数", dataIndex: "lprlMajorOverStandardItemsMultiples"},
]
},
{title: "系统编码", dataIndex: "systemCode", sorter: true,},
{title: "备注", dataIndex: "remark", sorter: true,},
{title: "六价铬",dataIndex: "cr6",sorter: true,},
{title: "邻二氯苯",dataIndex: "odcb",sorter: true,},
{title: "对二氯苯",dataIndex: "pdcp",sorter: true,},
];
{title: "苯并(a)芘",dataIndex: "bap",sorter: true,},
{title: "苯并(b)荧蒽",dataIndex: "bbfa",sorter: true,},
{title: "磷酸盐",dataIndex: "phosphate",sorter: true,},
{title: "急性毒性",dataIndex: "acuteToxicity",sorter: true,},
{title: "余氯",dataIndex: "residualChlorine",sorter: true,},
{title: "六六六",dataIndex: "c6h6cl6666",sorter: true,},
{title: "2,4,6-三氯酚",dataIndex: "c6h3cl3o246",sorter: true,},
];
export {tableColumns}
export {tableColumns}

View File

@@ -42,7 +42,7 @@ import { Modal } from "ant-design-vue";
import WaterBill from "./water-bill.vue";
import { saveWaterFunctionAreaBill } from "@/api/ecology/water-function-area";
export default {
name: "DrinkWaterCollectIndex",
name: "RiverFunctionCollectIndex",
components: {
WaterBill,
},
@@ -348,4 +348,4 @@ export default {
</script>
<style scoped lang="less">
</style>
</style>

View File

@@ -1,57 +1,3 @@
import moment from "moment";
export default {
// 水站均值数据 水功能区
toStationAvgObjData(excelData) {
return excelData.map(item => {
const row = {
area: item[1].includes("区") ? item[1] : null,
county: !item[1].includes("县") ? item[1] : null,
watershed: item[2],
place: item[3],
periodWaterQuality: item[4],
waterTemperature: item[5],
ph: item[6],
dissolvedOxygen: item[7],
conductivity: item[8],
turbidity: item[9],
permanganateIndex: item[10],
ammonia: item[11],
totalPhosphorus: item[12],
totalNitrogen: item[13],
mainPollutionIndicators: item[14],
remark: item[15],
// dissolvedOxygen: item[16],
}
return row;
})
},
// 国家级水功能区上报数据
toNationalLevelDataObj(excelData) {
return excelData.map(item => {
const row = {
waterBodyType: item[0],
provinceRegionCode: item[1],
waterResourcesFirstLevelZoneName: item[2],
dataSources: item[3],
sectionName: item[4],
samplingTime: moment(item[5],"M月D日").valueOf(),
permanganateIndex: item[6],
ammonia: item[7],
totalPhosphorus: item[8],
ffeWaterFunctionAreaWaterQualityCategory: item[9],
lprlCompliantEvaluationConclusion: item[10],
ffeCompliantEvaluationConclusion: item[11],
ffeMajorOverStandardItemsMultiples: item[12],
lprlWaterFunctionAreaWaterQualityCategory: item[13],
// lprlCompliantEvaluationConclusion: item[14],
lprlMajorOverStandardItemsMultiples: item[15],
remark: item[16],
systemCode: item[17],
}
return row;
})
},
}

View File

@@ -1,7 +1,7 @@
<template>
<div>
<!-- 表格 -->
<ele-pro-table v-model:selection="selectionList" ref="table" row-key="waterFunctionAreaBillId" :datasource="url"
<ele-pro-table v-model:selection="selectionList" ref="table" row-key="nationalLevelWaterFunctionAreaBillId" :datasource="url"
:columns="columns" :where="where" :scroll="{x: 'max-content'}">
<template #toolbar>
@@ -44,8 +44,8 @@
</template>
<template #billName="{ text, record }">
<div class="editable-cell">
<div v-if="editableData[record.waterFunctionAreaBillId]" class="editable-cell-input-wrapper">
<a-input v-model:value="editableData[record.waterFunctionAreaBillId].billName" @pressEnter="save(record)" />
<div v-if="editableData[record.nationalLevelWaterFunctionAreaBillId]" class="editable-cell-input-wrapper">
<a-input v-model:value="editableData[record.nationalLevelWaterFunctionAreaBillId].billName" @pressEnter="save(record)" />
<check-outlined class="editable-cell-icon-check" @click="save(record)" />
</div>
<div v-else class="editable-cell-text-wrapper">
@@ -56,9 +56,9 @@
</template>
<template #reportTime="{ text, record }">
<div class="editable-cell">
<div v-if="editableData[record.waterFunctionAreaBillId]" class="editable-cell-input-wrapper">
<a-date-picker v-model:value="editableData[record.waterFunctionAreaBillId].reportTime"></a-date-picker>
<!-- <a-input v-model:value="editableData[record.waterFunctionAreaBillId].reportTime" @pressEnter="save(record)" /> -->
<div v-if="editableData[record.nationalLevelWaterFunctionAreaBillId]" class="editable-cell-input-wrapper">
<a-date-picker v-model:value="editableData[record.nationalLevelWaterFunctionAreaBillId].reportTime"></a-date-picker>
<!-- <a-input v-model:value="editableData[record.nationalLevelWaterFunctionAreaBillId].reportTime" @pressEnter="save(record)" /> -->
<check-outlined class="editable-cell-icon-check" @click="save(record)" />
</div>
<div v-else class="editable-cell-text-wrapper">
@@ -111,7 +111,7 @@
removeBatchWaterFunctionAreaBill,
updateWaterFunctionAreaBill,
verifyWaterFunctionAreaBill
} from "@/api/ecology/drinking-water";
} from "@/api/ecology/water-function-area";
import moment from "moment";
export default {
name: 'DrinkingCollectWaterBill',
@@ -144,23 +144,6 @@
},
},
{
title: '区域等级',
dataIndex: 'regionLevel',
sorter: true,
},
{
title: '水源类型',
dataIndex: 'waterSourceType',
sorter: true,
customRender: ({text})=> text == 1?"地表水":"地下水"
},
{
title: '水源状态',
dataIndex: 'waterFunctionAreaType',
sorter: true,
customRender: ({text})=> text == 1?"在用":"备用"
},
{
title: '条目',
dataIndex: 'recordSize',
@@ -265,18 +248,18 @@
},
detail(record) {
this.$router.replace({
path: "/water/drinking-water/collect/water/" + record.waterFunctionAreaBillId
path: "/water/river/function/collect/water/" + record.nationalLevelWaterFunctionAreaBillId
})
},
edit(record) {
this.editableData[record.waterFunctionAreaBillId] = _.cloneDeep(record);
this.editableData[record.waterFunctionAreaBillId].reportTime = moment(this.editableData[record.waterFunctionAreaBillId]
this.editableData[record.nationalLevelWaterFunctionAreaBillId] = _.cloneDeep(record);
this.editableData[record.nationalLevelWaterFunctionAreaBillId].reportTime = moment(this.editableData[record.nationalLevelWaterFunctionAreaBillId]
.reportTime)
},
verify(record,checked) {
const hide = this.$message.loading('请求中..', 0);
verifyWaterFunctionAreaBill({
waterFunctionAreaBillId: record.waterFunctionAreaBillId,
nationalLevelWaterFunctionAreaBillId: record.nationalLevelWaterFunctionAreaBillId,
checked
}).then(res => {
if (res.data.code == 0) {
@@ -300,11 +283,11 @@
save(record) {
let {
waterFunctionAreaBillId,
nationalLevelWaterFunctionAreaBillId,
billName,
reportTime
} = this.editableData[record.waterFunctionAreaBillId];
if (!waterFunctionAreaBillId || !reportTime) {
} = this.editableData[record.nationalLevelWaterFunctionAreaBillId];
if (!nationalLevelWaterFunctionAreaBillId || !reportTime) {
this.$message.error('请填写完整信息再提交')
return
}
@@ -312,7 +295,7 @@
reportTime = reportTime.format("x")
reportTime = Number(reportTime)
updateWaterFunctionAreaBill({
waterFunctionAreaBillId,
nationalLevelWaterFunctionAreaBillId,
billName,
reportTime
}).then(res => {
@@ -327,7 +310,7 @@
console.log(e);
this.$message.error(e.message);
}).finally(() => {
delete this.editableData[record.waterFunctionAreaBillId]
delete this.editableData[record.nationalLevelWaterFunctionAreaBillId]
hide()
})
@@ -335,7 +318,7 @@
/* 删除单个 */
remove(row) {
const hide = this.$message.loading('请求中..', 0);
removeWaterFunctionAreaBill(row.waterFunctionAreaBillId).then(res => {
removeWaterFunctionAreaBill(row.nationalLevelWaterFunctionAreaBillId).then(res => {
if (res.data.code === 0) {
this.$message.success(res.data.msg);
this.reload();
@@ -347,7 +330,7 @@
}).finally(() => hide());
},
removeBatch() {
const ids = this.selectionList.map(item => item.waterFunctionAreaBillId);
const ids = this.selectionList.map(item => item.nationalLevelWaterFunctionAreaBillId);
const hide = this.$message.loading('请求中..', 0);
removeBatchWaterFunctionAreaBill(ids).then(res => {
if (res.data.code === 0) {
@@ -361,7 +344,7 @@
this.$message.error(e.msg);
}).finally(() => hide());
},
}
}
</script>
@@ -409,4 +392,4 @@
.editable-cell:hover .editable-cell-icon {
display: inline-block;
}
</style>
</style>

View File

@@ -31,7 +31,7 @@
</a-form>
<a-modal
v-model:visible="showEdit"
:title="form.waterFunctionAreaId !== undefined ? '修改记录' : '添加记录'"
:title="form.nationalLevelWaterFunctionAreaId !== undefined ? '修改记录' : '添加记录'"
:confirm-loading="loading"
:width="1000"
:body-style="{ paddingBottom: '8px' }"
@@ -41,12 +41,14 @@
ref="form"
:model="form"
:rules="rules"
:label-col="{ md: { span: 6 }, sm: { span: 24 } }"
:wrapper-col="{ md: { span: 18 }, sm: { span: 24 } }"
:label-col="{ md: { span: 24 }, sm: { span: 24 } }"
:wrapper-col="{ md: { span: 24 }, sm: { span: 24 } }"
layout="vertical"
labelAlign="left"
>
<a-row>
<a-row gutter="12" >
<a-col :md="12" :sm="24">
<a-form-item label="日期" name="monitorDate">
<a-form-item label="采样时间" name="monitorDate">
<a-date-picker
v-model:value="form.monitorDate"
:locale="locale"
@@ -54,22 +56,38 @@
</a-form-item>
</a-col>
<a-col :md="12" :sm="24">
<a-form-item label="时间" name="monitorTime">
<a-time-picker
v-model:value="form.monitorTime"
format="HH:mm"
/>
</a-form-item>
</a-col>
<a-col v-for="(item,index) in tableColumns" :key="index" :md="12" :sm="24">
<a-form-item :label="item.title" :name="item.dataIndex">
<a-input
v-model:value="form[item.dataIndex]"
:placeholder="'请输入' + item.title"
allow-clear
/>
</a-form-item>
<!-- <a-form-item label="时间" name="monitorTime">-->
<!-- <a-time-picker-->
<!-- v-model:value="form.monitorTime"-->
<!-- format="HH:mm"-->
<!-- />-->
<!-- </a-form-item>-->
</a-col>
<template v-for="(item,index) in tableColumns" :key="index">
<template v-if="item.children">
<a-col v-for="(citem,cindex) in item.children" :key="cindex" :md="12" :sm="24">
<a-form-item :label="item.title + '-' + citem.title" :name="citem.dataIndex">
<a-input
v-model:value="form[citem.dataIndex]"
:placeholder="'请输入' +item.title + '-' + citem.title"
allow-clear
/>
</a-form-item>
</a-col>
</template>
<template v-else>
<a-col :md="12" :sm="24">
<a-form-item :label="item.title" :name="item.dataIndex">
<a-input
v-model:value="form[item.dataIndex]"
:placeholder="'请输入' + item.title"
allow-clear
/>
</a-form-item>
</a-col>
</template>
</template>
</a-row>
</a-form>
</a-modal>
@@ -77,7 +95,7 @@
<ele-pro-table
v-model:selection="selectionList"
ref="table"
row-key="waterFunctionAreaId"
row-key="nationalLevelWaterFunctionAreaId"
:datasource="url"
:columns="columns"
:where="where"
@@ -140,13 +158,13 @@ import {
updateWaterFunctionArea,
getWaterFunctionAreaBill,
// getColumnOptions,
} from "@/api/ecology/drinking-water";
} from "@/api/ecology/water-function-area";
import locale from "ant-design-vue/es/date-picker/locale/zh_CN";
import moment from "moment";
import { tableColumns } from "./colums";
// import utils from "./utils";
export default {
name: "DrinkingCollectWater",
name: "WaterFunctionAreaCollectWater",
components: {},
data() {
const { billId } = this.$route.params;
@@ -160,26 +178,10 @@ export default {
// 表格列配置
columns: [
...tableColumns,
{
title: "区域等级",
dataIndex: "regionLevel",
sorter: true,
},
{
title: "水源类型",
dataIndex: "waterSourceType",
sorter: true,
customRender: ({ text }) => (text == 1 ? "地表水" : "地下水"),
},
{
title: "水源状态",
dataIndex: "waterFunctionAreaType",
sorter: true,
customRender: ({ text }) => (text == 1 ? "在用" : "备用"),
},
{
title: "创建人",
dataIndex: "username",
dataIndex: "userName",
sorter: true,
},
{
@@ -194,9 +196,9 @@ export default {
},
],
// 表格搜索条件
waterFunctionAreaBillId: billId,
nationalLevelWaterFunctionAreaBillId: billId,
where: {
waterFunctionAreaBillId: billId,
nationalLevelWaterFunctionAreaBillId: billId,
},
// 表格选中数据
selectionList: [],
@@ -223,8 +225,8 @@ export default {
loadOptionData() {},
/* 刷新表格 */
reload() {
console.log(this.$route);
console.log(this.$router);
console.log("--------------------------")
console.log(this.url);
this.$refs.table.reload({
where: this.where,
});
@@ -232,17 +234,17 @@ export default {
/* 重置搜索 */
reset() {
this.where = {
waterFunctionAreaBillId: this.waterFunctionAreaBillId,
nationalLevelWaterFunctionAreaBillId: this.nationalLevelWaterFunctionAreaBillId,
};
this.reload();
},
/* 显示编辑 */
openEdit(record) {
const cloneRecord = _.cloneDeep(record);
if (record && cloneRecord.monitorTime) {
if (record && cloneRecord.samplingTime) {
console.log(moment(cloneRecord.monitorTime).format("YYYY MM DD"));
cloneRecord.monitorDate = moment(cloneRecord.monitorTime);
cloneRecord.monitorTime = moment(cloneRecord.monitorTime);
cloneRecord.monitorDate = moment(cloneRecord.samplingTime);
cloneRecord.monitorTime = moment(cloneRecord.samplingTime);
}
// cloneRecord.mi
this.form = Object.assign({}, cloneRecord);
@@ -261,14 +263,15 @@ export default {
date.setDate(form.monitorDate.date());
date.setHours(form.monitorTime.hour());
date.setMinutes(form.monitorTime.minutes());
form.monitorTime = date.getTime();
form.monitorYear = date.getFullYear();
form.monitorMonth = date.getMonth() + 1;
form.monitorDay = date.getDate();
form.monitorHour = date.getHours();
form.monitorMinute = date.getMinutes();
form.samplingTime = date.getTime();
// form.monitorYear = date.getFullYear();
// form.monitorMonth = date.getMonth() + 1;
// form.monitorDay = date.getDate();
// form.monitorHour = date.getHours();
// form.monitorMinute = date.getMinutes();
delete form["monitorDate"];
if (form.waterFunctionAreaId) {
delete form["monitorTime"];
if (form.nationalLevelWaterFunctionAreaId) {
updateWaterFunctionArea(form)
.then((res) => {
if (res.data.code == 0) {
@@ -287,7 +290,7 @@ export default {
hide();
});
} else {
form.waterFunctionAreaBillId = this.waterFunctionAreaBillId;
form.nationalLevelWaterFunctionAreaBillId = this.nationalLevelWaterFunctionAreaBillId;
saveWaterFunctionArea(form)
.then((res) => {
if (res.data.code == 0) {
@@ -309,7 +312,7 @@ export default {
/* 删除单个 */
remove(row) {
const hide = this.$message.loading("请求中..", 0);
removeWaterFunctionArea(row.waterFunctionAreaId)
removeWaterFunctionArea(row.nationalLevelWaterFunctionAreaId)
.then((res) => {
if (res.data.code === 0) {
this.$message.success(res.data.msg);
@@ -324,7 +327,7 @@ export default {
.finally(() => hide());
},
removeBatch() {
const ids = this.selectionList.map((item) => item.waterFunctionAreaId);
const ids = this.selectionList.map((item) => item.nationalLevelWaterFunctionAreaId);
const hide = this.$message.loading("请求中..", 0);
removeBatchWaterFunctionArea(ids)
.then((res) => {
@@ -345,4 +348,4 @@ export default {
</script>
<style scoped lang="less">
</style>
</style>