饮用水导入bug修复+统计更新
This commit is contained in:
355
src/views/water/drinking-water-village/collect/bottomWater.vue
Normal file
355
src/views/water/drinking-water-village/collect/bottomWater.vue
Normal file
@@ -0,0 +1,355 @@
|
||||
<template>
|
||||
<div class="ele-body">
|
||||
<a-card :bordered="false">
|
||||
<!-- 搜索表单 -->
|
||||
<a-form
|
||||
:model="where"
|
||||
:label-col="{ md: { span: 8 }, sm: { span: 24 } }"
|
||||
:wrapper-col="{ md: { span: 16 }, sm: { span: 24 } }"
|
||||
>
|
||||
<a-row>
|
||||
<!-- <a-col :lg="6" :md="12" :sm="24" :xs="24">
|
||||
<a-form-item label="城区">
|
||||
<a-select v-model:value="where.area" allowClear showSearch>
|
||||
<a-select-option
|
||||
v-for="item in areaOptions"
|
||||
:key="item.value"
|
||||
>{{ item.label }}</a-select-option
|
||||
>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
</a-col> -->
|
||||
<a-col :lg="6" :md="12" :sm="24" :xs="24">
|
||||
<a-form-item class="ele-text-right" :wrapper-col="{ span: 24 }">
|
||||
<a-space>
|
||||
<a-button type="primary" @click="reload">查询</a-button>
|
||||
<a-button @click="reset">重置</a-button>
|
||||
</a-space>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-form>
|
||||
<a-modal
|
||||
v-model:visible="showEdit"
|
||||
:title="form.drinkingWaterVillageId !== undefined ? '修改记录' : '添加记录'"
|
||||
:confirm-loading="loading"
|
||||
:width="1000"
|
||||
:body-style="{ paddingBottom: '8px' }"
|
||||
@ok="save"
|
||||
>
|
||||
<a-form
|
||||
ref="form"
|
||||
:model="form"
|
||||
:rules="rules"
|
||||
:label-col="{ md: { span: 6 }, sm: { span: 24 } }"
|
||||
:wrapper-col="{ md: { span: 18 }, sm: { span: 24 } }"
|
||||
>
|
||||
<a-row>
|
||||
<a-col :md="12" :sm="24">
|
||||
<a-form-item label="日期" name="monitorDate">
|
||||
<a-date-picker
|
||||
v-model:value="form.monitorDate"
|
||||
:locale="locale"
|
||||
/>
|
||||
</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-col>
|
||||
</a-row>
|
||||
</a-form>
|
||||
</a-modal>
|
||||
<!-- 表格 -->
|
||||
<ele-pro-table
|
||||
v-model:selection="selectionList"
|
||||
ref="table"
|
||||
row-key="drinkingWaterVillageId"
|
||||
:datasource="url"
|
||||
:columns="columns"
|
||||
:where="where"
|
||||
:scroll="{ x: 'max-content' }"
|
||||
>
|
||||
<template v-if="bill.checked != 1" #toolbar>
|
||||
<a-space>
|
||||
<a-button @click="openEdit" type="primary">新增</a-button>
|
||||
<a-popconfirm
|
||||
:disabled="selectionList.length == 0"
|
||||
:title="`确认删除${selectionList.length}条数据吗?`"
|
||||
ok-text="Yes"
|
||||
cancel-text="No"
|
||||
@confirm="removeBatch"
|
||||
>
|
||||
<a-button
|
||||
:disabled="selectionList.length == 0"
|
||||
type="primary"
|
||||
ghost
|
||||
danger
|
||||
>删除</a-button
|
||||
>
|
||||
</a-popconfirm>
|
||||
</a-space>
|
||||
</template>
|
||||
<template #action="{ record }">
|
||||
<a-space>
|
||||
<a-button
|
||||
@click="openEdit(record)"
|
||||
type="primary"
|
||||
shape="round"
|
||||
size="small"
|
||||
>修改</a-button
|
||||
>
|
||||
<a-popconfirm
|
||||
:title="`确认删除这条数据吗?`"
|
||||
ok-text="Yes"
|
||||
cancel-text="No"
|
||||
@confirm="remove(record)"
|
||||
>
|
||||
<a-button type="primary" danger shape="round" size="small"
|
||||
>删除</a-button
|
||||
>
|
||||
</a-popconfirm>
|
||||
</a-space>
|
||||
</template>
|
||||
</ele-pro-table>
|
||||
</a-card>
|
||||
</div>
|
||||
<!-- 编辑弹窗 -->
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import _ from "lodash";
|
||||
import {
|
||||
pageDrinkingWaterVillageUrl,
|
||||
saveDrinkingWaterVillage,
|
||||
removeDrinkingWaterVillage,
|
||||
removeBatchDrinkingWaterVillage,
|
||||
updateDrinkingWaterVillage,
|
||||
getDrinkingWaterVillageBill,
|
||||
// getColumnOptions,
|
||||
} from "@/api/ecology/drinking-water-village";
|
||||
import locale from "ant-design-vue/es/date-picker/locale/zh_CN";
|
||||
import moment from "moment";
|
||||
import { tableColumns2 } from "./colums";
|
||||
// import utils from "./utils";
|
||||
export default {
|
||||
name: "DrinkingCollectWater",
|
||||
components: {},
|
||||
data() {
|
||||
const { billId } = this.$route.params;
|
||||
return {
|
||||
locale,
|
||||
bill: {},
|
||||
// 表格数据接口
|
||||
url: pageDrinkingWaterVillageUrl,
|
||||
selection: [],
|
||||
tableColumns2,
|
||||
// 表格列配置
|
||||
columns: [
|
||||
{
|
||||
title: "监测日期",
|
||||
dataIndex: "monitorTime",
|
||||
sorter: true,
|
||||
customRender: ({text})=> moment(text).format("YYYY-MM-DD")
|
||||
},
|
||||
|
||||
...tableColumns2,
|
||||
|
||||
{
|
||||
title: "区域等级",
|
||||
dataIndex: "regionLevel",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "水源类型",
|
||||
dataIndex: "waterSourceType",
|
||||
sorter: true,
|
||||
customRender: ({ text }) => (text == 1 ? "地表水" : "地下水"),
|
||||
},
|
||||
// {
|
||||
// title: "水源状态",
|
||||
// dataIndex: "drinkingWaterVillageType",
|
||||
// sorter: true,
|
||||
// customRender: ({ text }) => (text == 1 ? "在用" : "备用"),
|
||||
// },
|
||||
{
|
||||
title: "创建人",
|
||||
dataIndex: "username",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "操作",
|
||||
key: "action",
|
||||
width: 150,
|
||||
align: "center",
|
||||
fixed: "right",
|
||||
slots: {
|
||||
customRender: "action",
|
||||
},
|
||||
},
|
||||
],
|
||||
// 表格搜索条件
|
||||
drinkingWaterVillageBillId: billId,
|
||||
where: {
|
||||
drinkingWaterVillageBillId: billId,
|
||||
},
|
||||
// 表格选中数据
|
||||
selectionList: [],
|
||||
// 是否显示编辑弹窗
|
||||
showEdit: false,
|
||||
// 表单数据
|
||||
form: {},
|
||||
loading: false,
|
||||
rules: {},
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
const { billId } = this.$route.params;
|
||||
getDrinkingWaterVillageBill(billId).then((res) => {
|
||||
this.bill = res.data.data;
|
||||
if (res.data.data.checked == 1) {
|
||||
this.columns.splice(this.columns.length - 1, 1);
|
||||
}
|
||||
});
|
||||
this.loadOptionData();
|
||||
},
|
||||
methods: {
|
||||
/**获取下来框数据 */
|
||||
loadOptionData() {},
|
||||
/* 刷新表格 */
|
||||
reload() {
|
||||
|
||||
this.$refs.table.reload({
|
||||
where: this.where,
|
||||
});
|
||||
},
|
||||
/* 重置搜索 */
|
||||
reset() {
|
||||
this.where = {
|
||||
drinkingWaterVillageBillId: this.drinkingWaterVillageBillId,
|
||||
};
|
||||
this.reload();
|
||||
},
|
||||
/* 显示编辑 */
|
||||
openEdit(record) {
|
||||
const cloneRecord = _.cloneDeep(record);
|
||||
if (record && cloneRecord.monitorTime) {
|
||||
console.log(moment(cloneRecord.monitorTime).format("YYYY MM DD"));
|
||||
cloneRecord.monitorDate = moment(cloneRecord.monitorTime);
|
||||
cloneRecord.monitorTime = moment(cloneRecord.monitorTime);
|
||||
}
|
||||
// cloneRecord.mi
|
||||
this.form = Object.assign({}, cloneRecord);
|
||||
this.showEdit = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.form.clearValidate(); // 清除表单验证信息
|
||||
});
|
||||
},
|
||||
|
||||
save() {
|
||||
const hide = this.$message.loading("请求中..", 0);
|
||||
const form = _.cloneDeep(this.form);
|
||||
const date = new Date();
|
||||
date.setFullYear(form.monitorDate.year());
|
||||
date.setMonth(form.monitorDate.month());
|
||||
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();
|
||||
delete form["monitorDate"];
|
||||
if (form.drinkingWaterVillageId) {
|
||||
updateDrinkingWaterVillage(form)
|
||||
.then((res) => {
|
||||
if (res.data.code == 0) {
|
||||
this.showEdit = false;
|
||||
this.$message.success(res.data.msg);
|
||||
this.reload();
|
||||
} else {
|
||||
this.$message.error(res.data.msg);
|
||||
}
|
||||
})
|
||||
.catch((error) => {
|
||||
this.$message.error(error.message);
|
||||
})
|
||||
.finally(() => {
|
||||
console.log("finallyfinallyfinallyfinally");
|
||||
hide();
|
||||
});
|
||||
} else {
|
||||
form.drinkingWaterVillageBillId = this.drinkingWaterVillageBillId;
|
||||
saveDrinkingWaterVillage(form)
|
||||
.then((res) => {
|
||||
if (res.data.code == 0) {
|
||||
this.showEdit = false;
|
||||
this.$message.success(res.data.msg);
|
||||
this.reload();
|
||||
} else {
|
||||
this.$message.error(res.data.msg);
|
||||
}
|
||||
})
|
||||
.catch((error) => {
|
||||
this.$message.error(error.message);
|
||||
})
|
||||
.finally(() => {
|
||||
hide();
|
||||
});
|
||||
}
|
||||
},
|
||||
/* 删除单个 */
|
||||
remove(row) {
|
||||
const hide = this.$message.loading("请求中..", 0);
|
||||
removeDrinkingWaterVillage(row.drinkingWaterVillageId)
|
||||
.then((res) => {
|
||||
if (res.data.code === 0) {
|
||||
this.$message.success(res.data.msg);
|
||||
this.reload();
|
||||
} else {
|
||||
this.$message.error(res.data.msg);
|
||||
}
|
||||
})
|
||||
.catch((e) => {
|
||||
this.$message.error(e.msg);
|
||||
})
|
||||
.finally(() => hide());
|
||||
},
|
||||
removeBatch() {
|
||||
const ids = this.selectionList.map((item) => item.drinkingWaterVillageId);
|
||||
const hide = this.$message.loading("请求中..", 0);
|
||||
removeBatchDrinkingWaterVillage(ids)
|
||||
.then((res) => {
|
||||
if (res.data.code === 0) {
|
||||
this.$message.success(res.data.msg);
|
||||
this.reload();
|
||||
} else {
|
||||
this.$message.error(res.data.msg);
|
||||
}
|
||||
})
|
||||
.catch((e) => {
|
||||
this.$message.error(e.msg);
|
||||
})
|
||||
.finally(() => hide());
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
</style>
|
||||
@@ -1,9 +1,10 @@
|
||||
//地表水表格
|
||||
const tableColumns = [
|
||||
{title:"断面代码",dataIndex:"sectionCode",sorter:true},
|
||||
{title: "省",dataIndex: "province",sorter: true,},
|
||||
{title: "市",dataIndex: "city",sorter: true,},
|
||||
// {title: "城区",dataIndex: "城区",sorter: true,},
|
||||
{title: "县",dataIndex: "county",sorter: true,},
|
||||
{title: "县(区)",dataIndex: "county",sorter: true,},
|
||||
{title: "乡镇",dataIndex: "township",sorter: true,},
|
||||
{title: "村",dataIndex: "village",sorter: true,},
|
||||
{title: "点位名称",dataIndex: "place",sorter: true,},
|
||||
@@ -42,7 +43,79 @@ const tableColumns = [
|
||||
{title: "硝酸盐氮 (mg/L)",dataIndex: "nitrateNitrogen",sorter: true,},
|
||||
{title: "铁 (mg/L)",dataIndex: "fe",sorter: true,},
|
||||
{title: "锰 (mg/L)",dataIndex: "mn",sorter: true,},
|
||||
{title: "水质类别",dataIndex: "waterQualityCategory",sorter: true,},
|
||||
// {title: "水质类别",dataIndex: "waterQualityCategory",sorter: true,},
|
||||
{title: "特征污染物监测项目名称",dataIndex: "characteristicPollutantMonitoringProjectName",sorter: true,},
|
||||
{title: "特征污染物监测数值(mg/L)",dataIndex: "characteristicPollutantMonitoringValue",sorter: true,},
|
||||
// {title: "色(mg/L)",dataIndex: "color",sorter: true,},
|
||||
// {title: "嗅和味",dataIndex: "smellAndTaste",sorter: true,},
|
||||
// {title: "浊度",dataIndex: "turbidity",sorter: true,},
|
||||
// {title: "肉眼可见物",dataIndex: "visibleNakedEye",sorter: true,},
|
||||
// {title: "总硬度(mg/L)",dataIndex: "totalHardness",sorter: true,},
|
||||
// {title: "溶解性总固体(mg/L)",dataIndex: "totalDissolvedSolids",sorter: true,},
|
||||
// {title: "铝(mg/L)",dataIndex: "ai",sorter: true,},
|
||||
// {title: "耗氧量(mg/L)",dataIndex: "oxygenConsumption",sorter: true,},
|
||||
// {title: "硝酸盐(mg/L)",dataIndex: "nitrate",sorter: true,},
|
||||
// {title: "亚硝酸盐(mg/L)",dataIndex: "nitrite",sorter: true,},
|
||||
// {title: "钠(mg/L)",dataIndex: "na",sorter: true,},
|
||||
// {title: "碘化物(mg/L)",dataIndex: "lodide",sorter: true,},
|
||||
// {title: "总大肠菌群(个/L)",dataIndex: "totalColiform",sorter: true,},
|
||||
// {title: "菌落总数(CFU/mL))",dataIndex: "totalNumberColonies",sorter: true,},
|
||||
// {title: "三氯甲烷(μg/L)",dataIndex: "chcl3",sorter: true,},
|
||||
// {title: "四氯化碳 (μg/L)",dataIndex: "ccl4",sorter: true,},
|
||||
// {title: "苯 (μg/L)",dataIndex: "c6h6",sorter: true,},
|
||||
// {title: "甲苯 (μg/L)",dataIndex: "c7h8",sorter: true,},
|
||||
// {title: "总α放射性(Bq/L)",dataIndex: "totalAlphaRadioactivity",sorter: true,},
|
||||
// {title: "总β放射性(Bq/L)",dataIndex: "totalBetaRadioactivity",sorter: true,},
|
||||
{title: "备注",dataIndex: "remark",sorter: true,},
|
||||
];
|
||||
export {tableColumns}
|
||||
|
||||
//地下水表格
|
||||
const tableColumns2 = [
|
||||
{title:"断面代码",dataIndex:"sectionCode",sorter:true},
|
||||
{title: "省",dataIndex: "province",sorter: true,},
|
||||
{title: "市",dataIndex: "city",sorter: true,},
|
||||
// {title: "城区",dataIndex: "城区",sorter: true,},
|
||||
{title: "县(区)",dataIndex: "county",sorter: true,},
|
||||
{title: "乡镇",dataIndex: "township",sorter: true,},
|
||||
{title: "村",dataIndex: "village",sorter: true,},
|
||||
{title: "点位名称",dataIndex: "place",sorter: true,},
|
||||
// {title: "监测时间",dataIndex: "monitorTime",sorter: true,},
|
||||
// {title: "湖库(是/否)",dataIndex: "lakeLibraryFlag",sorter: true,},
|
||||
// {title: "必测村庄(是/否) ",dataIndex: "mustTestVillagesFlag",sorter: true,},
|
||||
{title: "经度(°)",dataIndex: "longitude",sorter: true,},
|
||||
{title: "纬度(°)",dataIndex: "latitude",sorter: true,},
|
||||
{title: "服务人口数量(人)",dataIndex: "numberServingPopulation",sorter: true,},
|
||||
{title: "日供水规模(吨)",dataIndex: "dailyWaterSupplyScale",sorter: true,},
|
||||
// {title: "水温(℃)",dataIndex: "waterTemperature",sorter: true,},
|
||||
{title: "pH(mg/L)",dataIndex: "ph",sorter: true,},
|
||||
// {title: "溶解氧(mg/L)",dataIndex: "dissolvedOxygen",sorter: true,},
|
||||
// {title: "高锰酸盐指数(mg/L)",dataIndex: "permanganateIndex",sorter: true,},
|
||||
// {title: "五日生化需氧量(mg/L)",dataIndex: "fiveDayBod",sorter: true,},
|
||||
{title: "氨氮(mg/L)",dataIndex: "ammonia",sorter: true,},
|
||||
// {title: "总磷 (mg/L)",dataIndex: "totalPhosphorus",sorter: true,},
|
||||
// {title: "总氮 (mg/L)",dataIndex: "totalNitrogen",sorter: true,},
|
||||
{title: "铜 (mg/L)",dataIndex: "cu",sorter: true,},
|
||||
{title: "锌 (mg/L)",dataIndex: "zn",sorter: true,},
|
||||
{title: "氟化物(mg/L)",dataIndex: "fluoride",sorter: true,},
|
||||
{title: "硒 (mg/L)",dataIndex: "se",sorter: true,},
|
||||
{title: "砷 (mg/L)",dataIndex: "as",sorter: true,},
|
||||
{title: "汞 (mg/L)",dataIndex: "hg",sorter: true,},
|
||||
{title: "镉 (mg/L)",dataIndex: "cd",sorter: true,},
|
||||
{title: "铬(六价)(mg/L)",dataIndex: "cr",sorter: true,},
|
||||
{title: "铅 (mg/L)",dataIndex: "pb",sorter: true,},
|
||||
{title: "氰化物 (mg/L)",dataIndex: "cyanide",sorter: true,},
|
||||
{title: "挥发酚 (mg/L)",dataIndex: "volatilePhenol",sorter: true,},
|
||||
// {title: "石油类 (mg/L)",dataIndex: "petro",sorter: true,},
|
||||
{title: "阴离子表面活性剂 (mg/L)",dataIndex: "anionicSurfactant",sorter: true,},
|
||||
{title: "硫化物 (mg/L)",dataIndex: "sulfide",sorter: true,},
|
||||
// {title: "粪大肠菌群(个/L)",dataIndex: "fecalColiforms",sorter: true,},
|
||||
// {title: "硫酸盐 (mg/L)",dataIndex: "sulfate",sorter: true,},
|
||||
{title: "氯化物 (mg/L)",dataIndex: "chloride",sorter: true,},
|
||||
// {title: "硝酸盐氮 (mg/L)",dataIndex: "nitrateNitrogen",sorter: true,},
|
||||
{title: "铁 (mg/L)",dataIndex: "fe",sorter: true,},
|
||||
{title: "锰 (mg/L)",dataIndex: "mn",sorter: true,},
|
||||
// {title: "水质类别",dataIndex: "waterQualityCategory",sorter: true,},
|
||||
{title: "特征污染物监测项目名称",dataIndex: "characteristicPollutantMonitoringProjectName",sorter: true,},
|
||||
{title: "特征污染物监测数值(mg/L)",dataIndex: "characteristicPollutantMonitoringValue",sorter: true,},
|
||||
{title: "色(mg/L)",dataIndex: "color",sorter: true,},
|
||||
@@ -67,5 +140,4 @@ const tableColumns = [
|
||||
{title: "总β放射性(Bq/L)",dataIndex: "totalBetaRadioactivity",sorter: true,},
|
||||
{title: "备注",dataIndex: "remark",sorter: true,},
|
||||
];
|
||||
|
||||
export {tableColumns}
|
||||
export {tableColumns2}
|
||||
@@ -22,7 +22,7 @@
|
||||
<template #overlay>
|
||||
<a-menu>
|
||||
<a-menu-item @click="download('农村村庄地表水饮用水','xlsx')"> 农村村庄地表水饮用水</a-menu-item>
|
||||
<a-menu-item @click="download('农村村庄地表水饮用水','xlsx')"> 农村村庄地表水饮用水</a-menu-item>
|
||||
<a-menu-item @click="download('农村村庄地下水饮用水','xlsx')"> 农村村庄地下水饮用水</a-menu-item>
|
||||
</a-menu>
|
||||
</template>
|
||||
<a-button type="primary" style="left: 10px">
|
||||
|
||||
@@ -12,8 +12,9 @@ export default {
|
||||
sectionCode:item[0],
|
||||
province: item[1],
|
||||
city: item[2],
|
||||
area: item[3].includes("区")?item[3]:null,
|
||||
county: !item[3].includes("区")?item[3]:null,
|
||||
// area: item[3].includes("区")?item[3]:null,
|
||||
// county: !item[3].includes("区")?item[3]:null,
|
||||
county:item[3],
|
||||
township: item[4],
|
||||
village: item[5],
|
||||
place: item[6],
|
||||
@@ -75,8 +76,9 @@ export default {
|
||||
sectionCode:item[0],
|
||||
province: item[1],
|
||||
city: item[2],
|
||||
area: item[3].includes("区")?item[3]:null,
|
||||
county: !item[3].includes("区")?item[3]:null,
|
||||
// area: item[3].includes("区")?item[3]:null,
|
||||
// county: !item[3].includes("区")?item[3]:null,
|
||||
county:item[3],
|
||||
township: item[4],
|
||||
village: item[5],
|
||||
place: item[6],
|
||||
|
||||
@@ -265,9 +265,16 @@
|
||||
this.reload();
|
||||
},
|
||||
detail(record) {
|
||||
this.$router.replace({
|
||||
if(record.waterSourceType===1){
|
||||
this.$router.replace({
|
||||
path: "/water/drinking-water-village/collect/water/" + record.drinkingWaterVillageBillId
|
||||
})
|
||||
}else{
|
||||
this.$router.replace({
|
||||
path: "/water/drinking-water-village/collect/bottomWater/" + record.drinkingWaterVillageBillId
|
||||
})
|
||||
}
|
||||
|
||||
},
|
||||
edit(record) {
|
||||
this.editableData[record.drinkingWaterVillageBillId] = _.cloneDeep(record);
|
||||
|
||||
Reference in New Issue
Block a user