新增/修复农村饮用水板块,修复市级县级饮用水板块

This commit is contained in:
710356044
2021-11-22 13:03:50 +08:00
parent 05f2424bea
commit 534db1163c
23 changed files with 901 additions and 615 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -50,6 +50,10 @@ const removeBatchDrinkingWater = function (ids) {
const updateDrinkingWater = function (data) { const updateDrinkingWater = function (data) {
return axios.put("/drinkingWater/drinkingWater",data) return axios.put("/drinkingWater/drinkingWater",data)
} }
//批量修改取水量
const updateWaterWithdrawal=function(data){
return axios.put("/drinkingWater/drinkingWater/updateWater",data)
}
@@ -89,6 +93,7 @@ export {
getColumnOptions, getColumnOptions,
listAll, listAll,
getGisBase, getGisBase,
getGisArea getGisArea,
updateWaterWithdrawal
} }

View File

@@ -1,14 +1,15 @@
const tableColumns = [ const tableColumns = [
{title:"断面代码",dataIndex:"sectionCode",sorter:true},
{title: "省",dataIndex: "province",sorter: true,}, {title: "省",dataIndex: "province",sorter: true,},
{title: "市",dataIndex: "city",sorter: true,}, {title: "市",dataIndex: "city",sorter: true,},
{title: "城区",dataIndex: "城区",sorter: true,}, // {title: "城区",dataIndex: "城区",sorter: true,},
{title: "县",dataIndex: "county",sorter: true,}, {title: "县",dataIndex: "county",sorter: true,},
{title: "乡镇",dataIndex: "township",sorter: true,}, {title: "乡镇",dataIndex: "township",sorter: true,},
{title: "村",dataIndex: "village",sorter: true,}, {title: "村",dataIndex: "village",sorter: true,},
{title: "点位名称",dataIndex: "place",sorter: true,}, {title: "点位名称",dataIndex: "place",sorter: true,},
// {title: "监测时间",dataIndex: "monitorTime",sorter: true,}, // {title: "监测时间",dataIndex: "monitorTime",sorter: true,},
{title: "湖库(是/否)",dataIndex: "lakeLibraryFlag",sorter: true,}, {title: "湖库(是/否)",dataIndex: "lakeLibraryFlag",sorter: true,},
{title: "必测村庄(是/否) ",dataIndex: "mustTestVillagesFlag",sorter: true,}, // {title: "必测村庄(是/否) ",dataIndex: "mustTestVillagesFlag",sorter: true,},
{title: "经度(°)",dataIndex: "longitude",sorter: true,}, {title: "经度(°)",dataIndex: "longitude",sorter: true,},
{title: "纬度(°)",dataIndex: "latitude",sorter: true,}, {title: "纬度(°)",dataIndex: "latitude",sorter: true,},
{title: "服务人口数量(人)",dataIndex: "numberServingPopulation",sorter: true,}, {title: "服务人口数量(人)",dataIndex: "numberServingPopulation",sorter: true,},
@@ -65,6 +66,6 @@ const tableColumns = [
{title: "总α放射性(Bq/L)",dataIndex: "totalAlphaRadioactivity",sorter: true,}, {title: "总α放射性(Bq/L)",dataIndex: "totalAlphaRadioactivity",sorter: true,},
{title: "总β放射性(Bq/L)",dataIndex: "totalBetaRadioactivity",sorter: true,}, {title: "总β放射性(Bq/L)",dataIndex: "totalBetaRadioactivity",sorter: true,},
{title: "备注",dataIndex: "remark",sorter: true,}, {title: "备注",dataIndex: "remark",sorter: true,},
]; ];
export {tableColumns} export {tableColumns}

View File

@@ -18,6 +18,18 @@
<a-button>农村地下水导入</a-button> <a-button>农村地下水导入</a-button>
</a-upload> </a-upload>
</a-space> </a-space>
<a-dropdown>
<template #overlay>
<a-menu>
<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">
模板下载
<DownOutlined />
</a-button>
</a-dropdown>
</template> </template>
<a-tabs v-model:activeKey="activeKey"> <a-tabs v-model:activeKey="activeKey">
<a-tab-pane tab="农村饮用水" key="water"> <a-tab-pane tab="农村饮用水" key="water">
@@ -33,11 +45,18 @@ import XLSX from "xlsx";
import utils from "./utils"; import utils from "./utils";
import { Modal } from "ant-design-vue"; import { Modal } from "ant-design-vue";
import WaterBill from "./water-bill.vue"; import WaterBill from "./water-bill.vue";
import { DownOutlined } from "@ant-design/icons-vue";
import { saveDrinkingWaterVillageBill } from "@/api/ecology/drinking-water-village"; import { saveDrinkingWaterVillageBill } from "@/api/ecology/drinking-water-village";
import {
downloadTemplatexls,
downloadTemplate,
downloadTemplatexlsm,
} from "@/utils/excel-util";
export default { export default {
name: "DrinkWaterVillageCollectIndex", name: "DrinkWaterVillageCollectIndex",
components: { components: {
WaterBill, WaterBill,
DownOutlined,
}, },
data() { data() {
return { return {
@@ -45,7 +64,7 @@ export default {
}; };
}, },
methods: { methods: {
/* 导入本地excel文件 */ /* 导入农村地表水文件 */
importFileTop(file) { importFileTop(file) {
const hide = this.$message.loading("导入中..", 0); const hide = this.$message.loading("导入中..", 0);
let reader = new FileReader(); let reader = new FileReader();
@@ -58,19 +77,23 @@ export default {
//0.昼间数据 1.夜间数据 2.其他信息 //0.昼间数据 1.夜间数据 2.其他信息
let sheetNames = workbook.SheetNames; let sheetNames = workbook.SheetNames;
// 解析成二维数组 // 解析成二维数组
let aoa1 = XLSX.utils.sheet_to_json(workbook.Sheets[sheetNames[0]], { let aoa1 = XLSX.utils.sheet_to_json(
workbook.Sheets[sheetNames[0]], {
header: 1, header: 1,
}); });
const drinkingWaterVillageList = aoa1.filter((item) => { const drinkingWaterVillageList = aoa1.filter((item) => {
return item.length >= 40 && typeof item[0] == "number"; // return item.length >= 40 && typeof item[0] == "number";
return (
item.length >= 40 && item[0] && !item[0].includes("断面代码") && !item[0].includes("导出人") && !item[0].includes("地表水")
);
}); });
// 解析成对象数组 // 解析成对象数组
console.log(file); // console.log(file);
const billName1 = file.name; const billName1 = file.name;
const billData1 = utils.toVillageTop(drinkingWaterVillageList); const billData1 = utils.toVillageTop(drinkingWaterVillageList);
// console.log(billData1);
if (!billData1 || billData1.length == 0) { if (!billData1 || billData1.length == 0) {
hide(); hide();
Modal.error({ Modal.error({
@@ -126,6 +149,7 @@ export default {
reader.readAsArrayBuffer(file); reader.readAsArrayBuffer(file);
return false; return false;
}, },
/* 导入农村地下水文件 */
importFileBottom(file) { importFileBottom(file) {
const hide = this.$message.loading("导入中..", 0); const hide = this.$message.loading("导入中..", 0);
let reader = new FileReader(); let reader = new FileReader();
@@ -138,19 +162,22 @@ export default {
//0.昼间数据 1.夜间数据 2.其他信息 //0.昼间数据 1.夜间数据 2.其他信息
let sheetNames = workbook.SheetNames; let sheetNames = workbook.SheetNames;
// 解析成二维数组 // 解析成二维数组
let aoa1 = XLSX.utils.sheet_to_json(workbook.Sheets[sheetNames[0]], { let aoa1 = XLSX.utils.sheet_to_json(
workbook.Sheets[sheetNames[0]], {
header: 1, header: 1,
}); });
const drinkingWaterVillageList = aoa1.filter((item) => { const drinkingWaterVillageList = aoa1.filter((item) => {
return item.length >= 40 && typeof item[0] == "number"; return (
item.length >= 40 && item[0] && !item[0].includes("点位代码") && !item[0].includes("导出人") && !item[0].includes("地下水")
);
}); });
// 解析成对象数组 // 解析成对象数组
console.log(file); console.log(file);
const billName1 = file.name; const billName1 = file.name;
const billData1 = utils.toVillageBottom(drinkingWaterVillageList); const billData1 = utils.toVillageBottom(drinkingWaterVillageList);
console.log(billData1);
if (!billData1 || billData1.length == 0) { if (!billData1 || billData1.length == 0) {
hide(); hide();
Modal.error({ Modal.error({
@@ -206,6 +233,16 @@ export default {
reader.readAsArrayBuffer(file); reader.readAsArrayBuffer(file);
return false; return false;
}, },
//下载文件
download(filename, fileType) {
if (fileType == "xls") {
downloadTemplatexls(filename);
} else if (fileType == "xlsm") {
downloadTemplatexlsm(filename);
} else if (fileType == "xlsx") {
downloadTemplate(filename);
}
},
}, },
}; };
</script> </script>

View File

@@ -4,11 +4,12 @@ export default {
toVillageTop(excelData){ toVillageTop(excelData){
return excelData.map(item=>{ return excelData.map(item=>{
const monitorTime = new Date(); const monitorTime = new Date();
monitorTime.setFullYear(item[11]); monitorTime.setFullYear(item[12]);
monitorTime.setMonth(item[12] - 1); monitorTime.setMonth(item[13] - 1);
monitorTime.setDate(item[13]); monitorTime.setDate(item[14]);
const row = { const row = {
monitorTime: monitorTime.getTime(), monitorTime: monitorTime.getTime(),
sectionCode:item[0],
province: item[1], province: item[1],
city: item[2], city: item[2],
area: item[3].includes("区")?item[3]:null, area: item[3].includes("区")?item[3]:null,
@@ -17,46 +18,46 @@ export default {
village: item[5], village: item[5],
place: item[6], place: item[6],
lakeLibraryFlag: item[7], lakeLibraryFlag: item[7],
mustTestVillagesFlag: item[8], // mustTestVillagesFlag: item[8],
longitude: item[9], longitude: item[8],
latitude: item[10], latitude: item[9],
numberServingPopulation: item[10],
dailyWaterSupplyScale: item[11],
// province: item[11], // province: item[11],
// province: item[12], // province: item[12],
// province: item[13], // province: item[13],
numberServingPopulation: item[14], waterTemperature: item[15],
dailyWaterSupplyScale: item[15], ph: item[16],
waterTemperature: item[16], dissolvedOxygen: item[17],
ph: item[17], permanganateIndex: item[18],
dissolvedOxygen: item[18], fiveDayBod: item[19],
permanganateIndex: item[19], ammonia: item[20],
fiveDayBod: item[20], totalPhosphorus: item[21],
ammonia: item[21], totalNitrogen: item[22],
totalPhosphorus: item[22], cu: item[23],
totalNitrogen: item[23], zn: item[24],
cu: item[24], fluoride: item[25],
zn: item[25], se: item[26],
fluoride: item[26], as: item[27],
se: item[27], hg: item[28],
as: item[28], cd: item[29],
hg: item[29], cr: item[30],
cd: item[30], pb: item[31],
cr: item[31], cyanide: item[32],
pb: item[32], volatilePhenol: item[33],
cyanide: item[33], petro: item[34],
volatilePhenol: item[34], anionicSurfactant: item[35],
petro: item[35], sulfide: item[36],
anionicSurfactant: item[36], fecalColiforms: item[37],
sulfide: item[37], sulfate: item[38],
fecalColiforms: item[38], chloride: item[39],
sulfate: item[39], nitrateNitrogen: item[40],
chloride: item[40], fe: item[41],
nitrateNitrogen: item[41], mn: item[42],
fe: item[42], // waterQualityCategory: item[44],
mn: item[43], characteristicPollutantMonitoringProjectName: item[43],
waterQualityCategory: item[44], characteristicPollutantMonitoringValue: item[44],
characteristicPollutantMonitoringProjectName: item[45], remark: item[45],
characteristicPollutantMonitoringValue: item[46],
remark: item[47],
}; };
return row; return row;
@@ -66,70 +67,70 @@ export default {
toVillageBottom(excelData){ toVillageBottom(excelData){
return excelData.map(item=>{ return excelData.map(item=>{
const monitorTime = new Date(); const monitorTime = new Date();
monitorTime.setFullYear(item[10]); monitorTime.setFullYear(item[11]);
monitorTime.setMonth(item[11] - 1); monitorTime.setMonth(item[12] - 1);
monitorTime.setDate(item[12]); monitorTime.setDate(item[13]);
const row = { const row = {
lakeLibraryFlag: "否",
monitorTime: monitorTime.getTime(), monitorTime: monitorTime.getTime(),
sectionCode:item[0],
province: item[1], province: item[1],
city: item[2], city: item[2],
area: item[3].includes("区")?item[3]:null, area: item[3].includes("区")?item[3]:null,
county: !item[3].includes("区")?item[3]:null, county: !item[3].includes("区")?item[3]:null,
township: item[4], township: item[4],
village: item[5], village: item[5],
mustTestVillagesFlag: item[6], place: item[6],
place: item[7], // lakeLibraryFlag: item[7],
longitude: item[8], // mustTestVillagesFlag: item[8],
latitude: item[9], longitude: item[7],
// latitude: item[10], latitude: item[8],
numberServingPopulation: item[9],
dailyWaterSupplyScale: item[10],
// province: item[11], // province: item[11],
// province: item[12], // province: item[12],
numberServingPopulation: item[13], // province: item[13],
dailyWaterSupplyScale: item[14], color:item[14],
color: item[15], smellAndTaste: item[15],
smellAndTaste: item[16], turbidity: item[16],
turbidity: item[17], visibleNakedEye: item[17],
visibleNakedEye: item[18], ph: item[18],
ph: item[19], totalHardness: item[19],
totalHardness: item[20], totalDissolvedSolids: item[20],
totalDissolvedSolids: item[21], totalNitrsulfateogen: item[21],
sulfate: item[22], chloride: item[22],
chloride: item[23], fe: item[23],
fe: item[24], mn: item[24],
mn: item[25], cu: item[25],
cu: item[26], zn: item[26],
zn: item[27], ai: item[27],
ai: item[28], volatilePhenol: item[28],
volatilePhenol: item[29], anionicSurfactant: item[29],
anionicSurfactant: item[30], oxygenConsumption: item[30],
oxygenConsumption: item[31], nitrate: item[31],
nitrate: item[32], nitrite: item[32],
nitrite: item[33], ammonia: item[33],
ammonia: item[34], sulfide: item[34],
sulfide: item[35], na: item[35],
na: item[36], fluoride: item[36],
fluoride: item[37], cyanide: item[37],
cyanide: item[38], lodide: item[38],
lodide: item[39], hg: item[39],
hg: item[40], as: item[40],
as: item[41], se: item[41],
se: item[42], cd: item[42],
cd: item[43], cr: item[43],
cr: item[44], pb: item[44],
pb: item[45], totalColiform: item[45],
totalColiform: item[46], totalNumberColonies: item[46],
totalNumberColonies: item[47], chcl3: item[47],
chcl3: item[48], ccl4: item[48],
ccl4: item[49], c6h6: item[49],
c6h6: item[50], c7h8: item[50],
c7h8: item[51], totalAlphaRadioactivity: item[51],
totalAlphaRadioactivity: item[52], totalBetaRadioactivity: item[52],
totalBetaRadioactivity: item[53], characteristicPollutantMonitoringProjectName: item[53],
waterQualityCategory: item[54], characteristicPollutantMonitoringValue: item[54],
characteristicPollutantMonitoringProjectName: item[55], remark: item[55],
characteristicPollutantMonitoringValue: item[56],
remark: item[57],
}; };
return row; return row;
}) })

View File

@@ -173,17 +173,17 @@
// dataIndex: 'title', // dataIndex: 'title',
// sorter: true // sorter: true
// }, // },
{ // {
title: '监测时间', // title: '监测时间',
dataIndex: 'reportTime', // dataIndex: 'reportTime',
sorter: true, // sorter: true,
slots: { // slots: {
customRender: 'reportTime', // customRender: 'reportTime',
}, // },
// customRender: ({ // // customRender: ({
// text // // text
// }) => this.$util.toDateString(text) // // }) => this.$util.toDateString(text)
}, // },
{ {
title: '导入时间', title: '导入时间',
dataIndex: 'createTime', dataIndex: 'createTime',
@@ -303,24 +303,37 @@
let { let {
drinkingWaterVillageBillId, drinkingWaterVillageBillId,
billName, billName,
reportTime // reportTime
regionLevel,
createTime,
checked,
waterSourceType,
drinkingWaterType,
userId
} = this.editableData[record.drinkingWaterVillageBillId]; } = this.editableData[record.drinkingWaterVillageBillId];
if (!drinkingWaterVillageBillId || !reportTime) { // if (!drinkingWaterVillageBillId || !reportTime) {
if (!drinkingWaterVillageBillId) {
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)
updateDrinkingWaterVillageBill({ updateDrinkingWaterVillageBill({
drinkingWaterVillageBillId, drinkingWaterVillageBillId,
billName, billName,
reportTime // reportTime
regionLevel,
createTime,
checked,
waterSourceType,
drinkingWaterType,
userId
}).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);
record.billName = billName; record.billName = billName;
record.reportTime = reportTime // record.reportTime = reportTime
} else { } else {
this.$message.error(res.data.msg); this.$message.error(res.data.msg);
} }

View File

@@ -53,14 +53,14 @@
/> />
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :md="12" :sm="24"> <!-- <a-col :md="12" :sm="24">
<a-form-item label="时间" name="monitorTime"> <a-form-item label="时间" name="monitorTime">
<a-time-picker <a-time-picker
v-model:value="form.monitorTime" v-model:value="form.monitorTime"
format="HH:mm" format="HH:mm"
/> />
</a-form-item> </a-form-item>
</a-col> </a-col> -->
<a-col v-for="(item,index) in tableColumns" :key="index" :md="12" :sm="24"> <a-col v-for="(item,index) in tableColumns" :key="index" :md="12" :sm="24">
<a-form-item :label="item.title" :name="item.dataIndex"> <a-form-item :label="item.title" :name="item.dataIndex">
<a-input <a-input
@@ -159,7 +159,15 @@ export default {
tableColumns, tableColumns,
// 表格列配置 // 表格列配置
columns: [ columns: [
{
title: "监测日期",
dataIndex: "monitorTime",
sorter: true,
customRender: ({text})=> moment(text).format("YYYY-MM-DD")
},
...tableColumns, ...tableColumns,
{ {
title: "区域等级", title: "区域等级",
dataIndex: "regionLevel", dataIndex: "regionLevel",

View File

@@ -1,6 +1,9 @@
const tableColumns = [ const tableColumns = [
{title: "点位名称",dataIndex: "place",sorter: true,}, {title: "点位名称",dataIndex: "place",sorter: true,},
{title: "取水量",dataIndex: "waterWithdrawal",sorter: true,},
{title: "'水温(℃)",dataIndex: "waterTemperature",sorter: true,}, {title: "'水温(℃)",dataIndex: "waterTemperature",sorter: true,},
// {title: "采样时间",dataIndex: "monitorTime",sorter: true,},
{title: "pH(无量纲)",dataIndex: "ph",sorter: true,}, {title: "pH(无量纲)",dataIndex: "ph",sorter: true,},
{title: "溶解氧",dataIndex: "dissolvedOxygen",sorter: true,}, {title: "溶解氧",dataIndex: "dissolvedOxygen",sorter: true,},
{title: "高锰酸盐指数",dataIndex: "permanganateIndex",sorter: true,}, {title: "高锰酸盐指数",dataIndex: "permanganateIndex",sorter: true,},
@@ -124,7 +127,10 @@ const tableColumns = [
//新增 //新增
{title: "叶绿素mg/m3)",dataIndex:"chlorophyll",sorter:true,}, {title: "叶绿素mg/m3)",dataIndex:"chlorophyll",sorter:true,},
{title: "透明度cm",dataIndex:"transparency",sorter:true,}, {title: "透明度cm",dataIndex:"transparency",sorter:true,},
{title: "总α放射性",dataIndex:"totalAlphaRadioactivity",sorter:true,},
{title: "总β放射性",dataIndex:"totalBetaRadioactivity",sorter:true,},
{title: "1,1,1-三氯乙烷(mg/L)",dataIndex:"c2h3cl3_111",sorter:true,},
{title: "1,1,2-三氯乙烷(mg/L)",dataIndex:"c2h3cl3_112",sorter:true,},
]; ];
export {tableColumns} export {tableColumns}

View File

@@ -71,11 +71,11 @@
<a-dropdown> <a-dropdown>
<template #overlay> <template #overlay>
<a-menu style="word-spacing:10px;"> <a-menu style="word-spacing:10px;">
<a-menu-item @click="download('市级地表水(在用)导入','xls')"> 市级在用导入{{"\xa0"}} <span style="color:#1890FF">模板下载</span> </a-menu-item> <a-menu-item @click="download('市级(在用)地表水饮用水','xls')" > 市级在用地表水饮用水 </a-menu-item>
<a-menu-item @click="download('市级地表水(备用)导入','xlsx')"> 市级备用导入{{"\xa0"}} <span style="color:#1890FF">模板下载</span> </a-menu-item> <a-menu-item @click="download('市级(备用)地表水饮用水','xlsx')" > 市级备用地表水饮用水 </a-menu-item>
<a-menu-item @click="download('县级地表水(在用)','xlsm')"> 县级在用导入{{"\xa0"}} <span style="color:#1890FF">模板下载</span> </a-menu-item> <a-menu-item @click="download('县级(在用)地表水饮用水','xlsm')" > 县级在用地表水饮用水 </a-menu-item>
<a-menu-item @click="download('县级地表水(备用)','xls')"> 县级备用导入{{"\xa0"}} <span style="color:#1890FF">模板下载</span> </a-menu-item> <a-menu-item @click="download('县级(备用、规划)地表水饮用水','xls')"> 县级备用规划地表水饮用水 </a-menu-item>
<a-menu-item @click="download('县级地下水','xlsx')" style="word-spacing:3px"> 县级地下水导入{{"\xa0"}} <span style="color:#1890FF">模板下载</span> </a-menu-item> <a-menu-item @click="download('县级地下水饮用水','xlsx')" > 县级地下水饮用水 </a-menu-item>
</a-menu> </a-menu>
</template> </template>
<a-button type="primary" style="left: 60px"> <a-button type="primary" style="left: 60px">
@@ -84,8 +84,10 @@
</a-button> </a-button>
</a-dropdown> </a-dropdown>
</template> </template>
<a-tabs v-model:activeKey="activeKey"> <a-tabs v-model:activeKey="activeKey">
<a-tab-pane tab="饮用水" key="water"> <a-tab-pane tab="饮用水页面" key="water">
<water-bill ref="water"></water-bill> <water-bill ref="water"></water-bill>
</a-tab-pane> </a-tab-pane>
</a-tabs> </a-tabs>
@@ -149,7 +151,7 @@ export default {
}); });
// 解析成对象数组 // 解析成对象数组
const billName1 = aoa1[0][0] + aoa1[1][0]; const billName1 = file.name;
const billData1 = utils.toCityUseTopWaterObjData(drinkingWaterList); const billData1 = utils.toCityUseTopWaterObjData(drinkingWaterList);
if (!billData1 || billData1.length == 0) { if (!billData1 || billData1.length == 0) {
@@ -237,7 +239,7 @@ export default {
}); });
// 解析成对象数组 // 解析成对象数组
const billName1 = aoa1[0][0] + aoa1[1][0]; const billName1 = file.name;
const billData1 = utils.toCitySpareTopWaterObjData(drinkingWaterList); const billData1 = utils.toCitySpareTopWaterObjData(drinkingWaterList);
if (!billData1 || billData1.length == 0) { if (!billData1 || billData1.length == 0) {
@@ -325,7 +327,7 @@ export default {
}); });
// 解析成对象数组 // 解析成对象数组
const billName1 = aoa1[0][0]; const billName1 = file.name;
const billData1 = utils.toCountyUseTopWaterObjData(drinkingWaterList); const billData1 = utils.toCountyUseTopWaterObjData(drinkingWaterList);
if (!billData1 || billData1.length == 0) { if (!billData1 || billData1.length == 0) {
@@ -413,7 +415,7 @@ export default {
}); });
// 解析成对象数组 // 解析成对象数组
const billName1 = aoa1[0][0]; const billName1 = file.name;
const billData1 = utils.toCountyUseTopWaterObjData(drinkingWaterList); const billData1 = utils.toCountyUseTopWaterObjData(drinkingWaterList);
if (!billData1 || billData1.length == 0) { if (!billData1 || billData1.length == 0) {
@@ -501,10 +503,10 @@ export default {
}); });
// 解析成对象数组 // 解析成对象数组
const billName1 = aoa1[0][1]; const billName1 = file.name;
const billData1 = const billData1 =
utils.toCountyUseBottomWaterObjData(drinkingWaterList); utils.toCountyUseBottomWaterObjData(drinkingWaterList);
console.log(billData1);
if (!billData1 || billData1.length == 0) { if (!billData1 || billData1.length == 0) {
hide(); hide();
Modal.error({ Modal.error({
@@ -571,19 +573,6 @@ export default {
downloadTemplate(filename); downloadTemplate(filename);
} }
}, },
// //下载市级在用地表水文件
// downloadCityUseFile(){
// downloadTemplate();
// },
// //下载市级在用地表水文件
// downloadCityUseFile(){
// downloadTemplate();
// },
// //下载市级在用地表水文件
// downloadCityUseFile(){
// downloadTemplate();
// },
}, },
}; };
</script> </script>

View File

@@ -1,4 +1,4 @@
import moment from "moment"; // import moment from "moment";
export default { export default {
// 市级在用地表水 已可用 // 市级在用地表水 已可用
toCityUseTopWaterObjData(excelData) { toCityUseTopWaterObjData(excelData) {
@@ -509,7 +509,7 @@ export default {
county: item[0], county: item[0],
place: item[1], place: item[1],
waterSourceType: 2, // 1地表水、2地下水 waterSourceType: 2, // 1地表水、2地下水
monitorTime: moment(item[3], "YYYY年M月D日H:m").valueOf(), // monitorTime: moment(item[3], "YYYY年MM月DD日HH:mm").valueOf(),
waterTemperature: item[4], waterTemperature: item[4],
chroma: item[5], chroma: item[5],
smellAndTaste: item[6], smellAndTaste: item[6],
@@ -622,4 +622,13 @@ export default {
}) })
}, },
importWaterWithdrawalData(excelData){
return excelData.map(item => {
const row = {
place:item[0],
waterWithdrawal:item[1],
}
return row;
})
}
} }

View File

@@ -1,34 +1,52 @@
<template> <template>
<div> <div>
<!-- 表格 --> <!-- 表格 -->
<ele-pro-table v-model:selection="selectionList" ref="table" row-key="drinkingWaterBillId" :datasource="url" <ele-pro-table
:columns="columns" :where="where" :scroll="{x: 'max-content'}"> v-model:selection="selectionList"
ref="table"
row-key="drinkingWaterBillId"
:datasource="url"
:columns="columns"
:where="where"
:scroll="{ x: 'max-content' }"
>
<template #toolbar> <template #toolbar>
<!-- 搜索表单 --> <!-- 搜索表单 -->
<a-form layout="inline" :model="where" :labelCol="{ offset: 1}"> <a-form layout="inline" :model="where" :labelCol="{ offset: 1 }">
<a-form-item label="区域等级:"> <a-form-item label="区域等级:">
<a-select v-model:value="where.regionLevel" allowClear placeholder="未选择"> <a-select
v-model:value="where.regionLevel"
allowClear
placeholder="未选择"
>
<a-select-option :value="'市级'">市级</a-select-option> <a-select-option :value="'市级'">市级</a-select-option>
<a-select-option :value="'县级'">县级</a-select-option> <a-select-option :value="'县级'">县级</a-select-option>
</a-select> </a-select>
</a-form-item> </a-form-item>
<a-form-item label="审核状态:"> <a-form-item label="审核状态:">
<a-select v-model:value="where.checked" allowClear placeholder="未选择"> <a-select
v-model:value="where.checked"
allowClear
placeholder="未选择"
>
<a-select-option :value="1">已审核</a-select-option> <a-select-option :value="1">已审核</a-select-option>
<a-select-option :value="0">未审核</a-select-option> <a-select-option :value="0">未审核</a-select-option>
</a-select> </a-select>
</a-form-item> </a-form-item>
<a-form-item label="表格名称:"> <a-form-item label="表格名称:">
<a-input v-model:value.trim="where.billName" placeholder="请输入" allow-clear /> <a-input
v-model:value.trim="where.billName"
placeholder="请输入"
allow-clear
/>
</a-form-item> </a-form-item>
<a-form-item label="上报时间:"> <a-form-item label="上报时间:">
<a-range-picker separator="~" v-model:value="reportTimeScope" /> <a-range-picker separator="~" v-model:value="reportTimeScope" />
</a-form-item> </a-form-item>
<a-form-item class="ele-text-right" :wrapper-col="{span: 24}"> <a-form-item class="ele-text-right" :wrapper-col="{ span: 24 }">
<a-space> <a-space>
<a-button type="primary" @click="reload">查询</a-button> <a-button type="primary" @click="reload">查询</a-button>
<a-button @click="reset">重置</a-button> <a-button @click="reset">重置</a-button>
@@ -37,38 +55,68 @@
</a-form> </a-form>
</template> </template>
<template #toolkit> <template #toolkit>
<a-popconfirm :disabled="selectionList.length == 0" :title="`确认删除${selectionList.length}条数据吗?`" ok-text="Yes" <a-popconfirm
cancel-text="No" @confirm="removeBatch"> :disabled="selectionList.length == 0"
<a-button :disabled="selectionList.length == 0" type="primary" ghost danger>批量删除</a-button> :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-popconfirm>
</template> </template>
<template #billName="{ text, record }"> <template #billName="{ text, record }">
<div class="editable-cell"> <div class="editable-cell">
<div v-if="editableData[record.drinkingWaterBillId]" class="editable-cell-input-wrapper"> <div
<a-input v-model:value="editableData[record.drinkingWaterBillId].billName" v-if="editableData[record.drinkingWaterBillId]"
@pressEnter="save(record)" /> class="editable-cell-input-wrapper"
<check-outlined class="editable-cell-icon-check" @click="save(record)" /> >
<a-input
v-model:value="editableData[record.drinkingWaterBillId].billName"
@pressEnter="save(record)"
/>
<check-outlined
class="editable-cell-icon-check"
@click="save(record)"
/>
</div> </div>
<div v-else class="editable-cell-text-wrapper"> <div v-else class="editable-cell-text-wrapper">
{{ text || ' ' }} {{ text || " " }}
<edit-outlined class="editable-cell-icon" @click="edit(record)" /> <edit-outlined class="editable-cell-icon" @click="edit(record)" />
</div> </div>
</div> </div>
</template> </template>
<template #reportTime="{ text, record }"> <template #reportTime="{ text, record }">
<div class="editable-cell"> <div class="editable-cell">
<div v-if="editableData[record.drinkingWaterBillId]" class="editable-cell-input-wrapper"> <div
<a-date-picker v-model:value="editableData[record.drinkingWaterBillId].reportTime " @pressEnter="save(record)"></a-date-picker> v-if="editableData[record.drinkingWaterBillId]"
class="editable-cell-input-wrapper"
>
<a-date-picker
v-model:value="
editableData[record.drinkingWaterBillId].reportTime
"
@pressEnter="save(record)"
></a-date-picker>
<!-- <a-input v-model:value="editableData[record.drinkingWaterBillId].reportTime" @pressEnter="save(record)" /> --> <!-- <a-input v-model:value="editableData[record.drinkingWaterBillId].reportTime" @pressEnter="save(record)" /> -->
<check-outlined class="editable-cell-icon-check" @click="save(record)" /> <check-outlined
class="editable-cell-icon-check"
@click="save(record)"
/>
</div> </div>
<div v-else class="editable-cell-text-wrapper"> <div v-else class="editable-cell-text-wrapper">
{{ $util.toDateString(text,'yyyy-MM-dd') || ' ' }} {{ $util.toDateString(text, "yyyy-MM-dd") || " " }}
<edit-outlined class="editable-cell-icon" @click="edit(record)" /> <edit-outlined class="editable-cell-icon" @click="edit(record)" />
</div> </div>
</div> </div>
</template> </template>
<template #checked="{text}"> <template #checked="{ text }">
<span> <span>
<a-tag v-if="text" color="green">已审核</a-tag> <a-tag v-if="text" color="green">已审核</a-tag>
<a-tag v-else color="orange">未审核</a-tag> <a-tag v-else color="orange">未审核</a-tag>
@@ -77,21 +125,55 @@
<template #action="{ record }"> <template #action="{ record }">
<a-space> <a-space>
<a-button @click="detail(record)" shape="round" size="small">查看</a-button> <a-button @click="detail(record)" shape="round" size="small"
>查看</a-button
>
<!-- <span v-hasPermi="['ecology:sound:verify']"> --> <!-- <span v-hasPermi="['ecology:sound:verify']"> -->
<span> <span>
<a-popconfirm v-if="record.checked != 1" :title="`审核通过后将无法修改,确认?`" ok-text="Yes" cancel-text="No" <a-popconfirm
@confirm="verify(record,1)"> v-if="record.checked != 1"
<a-button type="primary" shape="round" size="small">审核</a-button> :title="`审核通过后将无法修改,确认?`"
ok-text="Yes"
cancel-text="No"
@confirm="verify(record, 1)"
>
<a-button type="primary" shape="round" size="small"
>审核</a-button
>
</a-popconfirm> </a-popconfirm>
<a-popconfirm v-else :title="`撤回重新编辑,确认?`" ok-text="Yes" cancel-text="No" <a-popconfirm
@confirm="verify(record,0)"> v-else
:title="`撤回重新编辑,确认?`"
ok-text="Yes"
cancel-text="No"
@confirm="verify(record, 0)"
>
<a-button type="dashed" shape="round" size="small">撤回</a-button> <a-button type="dashed" shape="round" size="small">撤回</a-button>
</a-popconfirm> </a-popconfirm>
</span> </span>
<a-popconfirm :title="`确认删除${record.billName}吗?`" ok-text="Yes" cancel-text="No" @confirm="remove(record)"> <a-popconfirm
<a-button type="primary" danger shape="round" size="small">删除</a-button> :title="`确认删除${record.billName}吗?`"
ok-text="Yes"
cancel-text="No"
@confirm="remove(record)"
>
<a-button type="primary" danger shape="round" size="small"
>删除</a-button
>
</a-popconfirm> </a-popconfirm>
<a-upload
:before-upload="importWaterWithdrawal"
:showUploadList="false"
accept=".xls,.xlsx,.csv"
>
<a-button
:disabled="isCity(record)"
type="primary"
shape="round"
size="small"
>取水量导入</a-button
>
</a-upload>
</a-space> </a-space>
</template> </template>
</ele-pro-table> </ele-pro-table>
@@ -99,75 +181,71 @@
</template> </template>
<script> <script>
import _ from "lodash";
import _ from "lodash" import XLSX from "xlsx";
import { import { CheckOutlined, EditOutlined } from "@ant-design/icons-vue";
CheckOutlined, import utils from "./utils";
EditOutlined import { Modal } from "ant-design-vue";
} from '@ant-design/icons-vue'; // import {saveWaterWithdrawal} from './water.vue'
import { Modal } from 'ant-design-vue'; import {
import {
pageBillUrl, pageBillUrl,
// saveDrinkingWaterBill, // saveDrinkingWaterBill,
removeDrinkingWaterBill, removeDrinkingWaterBill,
removeBatchDrinkingWaterBill, removeBatchDrinkingWaterBill,
updateDrinkingWaterBill, updateDrinkingWaterBill,
verifyDrinkingWaterBill verifyDrinkingWaterBill,
} from "@/api/ecology/drinking-water"; updateWaterWithdrawal
import moment from "moment"; } from "@/api/ecology/drinking-water";
export default { import moment from "moment";
name: 'DrinkingCollectWaterBill', export default {
name: "DrinkingCollectWaterBill",
components: { components: {
CheckOutlined, CheckOutlined,
EditOutlined EditOutlined,
}, },
data() { data() {
return { return {
// 表格数据接口 // 表格数据接口
url: pageBillUrl, url: pageBillUrl,
selection: [], selection: [],
// 表格列配置 // 表格列配置
columns: [{ columns: [
key: 'index', {
dataIndex: 'index', key: "index",
dataIndex: "index",
width: 48, width: 48,
align: 'center', align: "center",
customRender: ({ customRender: ({ index }) => index + 1,
index
}) => index + 1
}, },
{ {
title: '表格名称', title: "表格名称",
dataIndex: 'billName', dataIndex: "billName",
sorter: true, sorter: true,
slots: { slots: {
customRender: 'billName', customRender: "billName",
}, },
}, },
{ {
title: '区域等级', title: "区域等级",
dataIndex: 'regionLevel', dataIndex: "regionLevel",
sorter: true, sorter: true,
}, },
{ {
title: '水源类型', title: "水源类型",
dataIndex: 'waterSourceType', dataIndex: "waterSourceType",
sorter: true, sorter: true,
customRender: ({text})=> text == 1?"地表水":"地下水" customRender: ({ text }) => (text == 1 ? "地表水" : "地下水"),
}, },
{ {
title: '水源状态', title: "水源状态",
dataIndex: 'drinkingWaterType', dataIndex: "drinkingWaterType",
sorter: true, sorter: true,
customRender: ({text})=> text == 1?"在用":"备用" customRender: ({ text }) => (text == 1 ? "在用" : "备用"),
}, },
{ {
title: '条目', title: "条目",
dataIndex: 'recordSize', dataIndex: "recordSize",
sorter: true, sorter: true,
}, },
// { // {
// title: '菜单名称', // title: '菜单名称',
@@ -175,23 +253,21 @@
// sorter: true // sorter: true
// }, // },
{ {
title: '监测时间', title: "监测时间",
dataIndex: 'reportTime', dataIndex: "reportTime",
sorter: true, sorter: true,
slots: { slots: {
customRender: 'reportTime', customRender: "reportTime",
}, },
// customRender: ({ // customRender: ({
// text // text
// }) => this.$util.toDateString(text) // }) => this.$util.toDateString(text)
}, },
{ {
title: '导入时间', title: "导入时间",
dataIndex: 'createTime', dataIndex: "createTime",
sorter: true, sorter: true,
customRender: ({ customRender: ({ text }) => this.$util.toDateString(text),
text
}) => this.$util.toDateString(text)
}, },
// { // {
// title: '最后更新时间', // title: '最后更新时间',
@@ -202,17 +278,16 @@
// }) => this.$util.toDateString(text) // }) => this.$util.toDateString(text)
// }, // },
{ {
title: '审核状态', title: "审核状态",
dataIndex: 'checked', dataIndex: "checked",
sorter: true, sorter: true,
slots: { slots: {
customRender: 'checked', customRender: "checked",
}, },
}, },
{ {
title: '创建人', title: "创建人",
dataIndex: 'userId', dataIndex: "userId",
sorter: true, sorter: true,
customRender: ({ text }) => (text == 1 ? "admin" : ""), customRender: ({ text }) => (text == 1 ? "admin" : ""),
}, },
@@ -225,14 +300,14 @@
// }) => this.$util.toDateString(text) // }) => this.$util.toDateString(text)
// }, // },
{ {
title: '操作', title: "操作",
key: 'action', key: "action",
width: 150, width: 150,
align: 'center', align: "center",
slots: { slots: {
customRender: 'action' customRender: "action",
} },
} },
], ],
// 表格搜索条件 // 表格搜索条件
where: { where: {
@@ -247,19 +322,141 @@
current: null, current: null,
}; };
}, },
methods: { methods: {
/* 判断是否是市级,用于取水量导入 */
isCity(record) {
if (record.regionLevel === "市级") {
return false;
} else {
return true;
}
},
/*市级取水量导入 */
importWaterWithdrawal(file) {
const hide = this.$message.loading("导入中..", 0);
let reader = new FileReader();
reader.onload = (e) => {
try {
let data = new Uint8Array(e.target.result);
let workbook = XLSX.read(data, {
type: "array",
});
//0.昼间数据 1.夜间数据 2.其他信息
// let sheetNames = workbook.SheetNames;
// 解析成二维数组
let aoa1 = XLSX.utils.sheet_to_json(workbook.Sheets["Sheet1"], {
header: 1,
});
const drinkingWaterList = aoa1.filter((item) => {
return (
item[0] && !item[0].includes("取水点") && !item[0].includes("合计")
);
});
// 解析成对象数组
// const billName1 = file.name;
const billData1 = utils.importWaterWithdrawalData(drinkingWaterList);
console.log(billData1);
// console.log(billData1.place);
if (!billData1 || billData1.length == 0) {
hide();
Modal.error({
title: "导入失败",
content: "找不到可用数据",
});
return;
}
if (billData1.length > 0) {
updateWaterWithdrawal({
drinkingWaterList: billData1,
})
.then((res) => {
if (res.data.code == 0) {
Modal.success({
title: "导入成功",
});
this.$refs.water && this.$refs.water.reload();
} else {
Modal.error({
title: "导入失败",
content: "数据上传出错1",
});
}
})
.catch(() => {
Modal.error({
title: "导入失败",
content: "数据上传出错2",
});
})
.finally(() => {
hide();
});
}
// if (billData1.length > 0) {
// // 上传到服务器
// saveDrinkingWaterBill({
// billName: billName1,
// regionLevel: "县级",
// waterSourceType: 1,
// drinkingWaterType: 2,
// drinkingWaterList: billData1,
// // reportTime: new Date(`${this.year}-01-01 00:00:00`).getTime(),
// })
// .then((res) => {
// if (res.data.code == 0) {
// Modal.success({
// title: "导入成功",
// content: `成功导入${billData1.length}条数据`,
// });
// this.$refs.water && this.$refs.water.reload();
// } else {
// Modal.error({
// title: "导入失败",
// content: "数据上传出错",
// });
// }
// })
// .catch(() => {
// Modal.error({
// title: "导入失败",
// content: "数据上传出错",
// });
// })
// .finally(() => {
// hide();
// });
// }
} catch (error) {
hide();
Modal.error({
title: "导入失败",
content: error.message,
});
console.log(error);
}
};
reader.readAsArrayBuffer(file);
return false;
},
/* 刷新表格 */ /* 刷新表格 */
reload() { reload() {
this.where.reportTimeStart = null; this.where.reportTimeStart = null;
this.where.reportTimeEnd = null; this.where.reportTimeEnd = null;
if (this.reportTimeScope && this.reportTimeScope.length == 2) { if (this.reportTimeScope && this.reportTimeScope.length == 2) {
this.where.reportTimeStart = this.reportTimeScope[0].format("Y-M-D H:m:s") this.where.reportTimeStart =
this.where.reportTimeEnd = this.reportTimeScope[1].format("Y-M-D H:m:s") this.reportTimeScope[0].format("Y-M-D H:m:s");
this.where.reportTimeEnd =
this.reportTimeScope[1].format("Y-M-D H:m:s");
} }
this.$refs.table.reload({ this.$refs.table.reload({
where: this.where where: this.where,
}); });
}, },
/* 重置搜索 */ /* 重置搜索 */
@@ -270,36 +467,42 @@
}, },
detail(record) { detail(record) {
this.$router.replace({ this.$router.replace({
path: "/water/drinking-water/collect/water/" + record.drinkingWaterBillId path:
}) "/water/drinking-water/collect/water/" + record.drinkingWaterBillId,
});
}, },
edit(record) { edit(record) {
this.editableData[record.drinkingWaterBillId] = _.cloneDeep(record); this.editableData[record.drinkingWaterBillId] = _.cloneDeep(record);
this.editableData[record.drinkingWaterBillId].reportTime = moment(this.editableData[record.drinkingWaterBillId].reportTime); this.editableData[record.drinkingWaterBillId].reportTime = moment(
this.editableData[record.drinkingWaterBillId].reportTime
);
}, },
verify(record,checked) { verify(record, checked) {
const hide = this.$message.loading('请求中..', 0); const hide = this.$message.loading("请求中..", 0);
verifyDrinkingWaterBill({ verifyDrinkingWaterBill({
drinkingWaterBillId: record.drinkingWaterBillId, drinkingWaterBillId: record.drinkingWaterBillId,
checked checked,
}).then(res => { })
.then((res) => {
if (res.data.code == 0) { if (res.data.code == 0) {
record.checked = checked record.checked = checked;
Modal.success({ Modal.success({
title: "提示", title: "提示",
content: checked?"审核成功":"撤回成功" content: checked ? "审核成功" : "撤回成功",
}); });
} else { } else {
Modal.error({ Modal.error({
title: "提示", title: "提示",
content: res.data.msg content: res.data.msg,
}); });
} }
}).catch((e) => {
this.$message.error(e.message);
}).finally(() => {
hide();
}) })
.catch((e) => {
this.$message.error(e.message);
})
.finally(() => {
hide();
});
}, },
save(record) { save(record) {
let { let {
@@ -311,16 +514,15 @@
checked, checked,
waterSourceType, waterSourceType,
drinkingWaterType, drinkingWaterType,
userId userId,
} = this.editableData[record.drinkingWaterBillId]; } = this.editableData[record.drinkingWaterBillId];
if (!drinkingWaterBillId || !reportTime) { if (!drinkingWaterBillId || !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);
updateDrinkingWaterBill({ updateDrinkingWaterBill({
drinkingWaterBillId, drinkingWaterBillId,
billName, billName,
@@ -330,8 +532,9 @@
checked, checked,
waterSourceType, waterSourceType,
drinkingWaterType, drinkingWaterType,
userId userId,
}).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);
record.billName = billName; record.billName = billName;
@@ -339,51 +542,56 @@
} else { } else {
this.$message.error(res.data.msg); this.$message.error(res.data.msg);
} }
}).catch(e => { })
.catch((e) => {
console.log(e); console.log(e);
this.$message.error(e.message); this.$message.error(e.message);
}).finally(() => {
delete this.editableData[record.drinkingWaterBillId]
hide()
}) })
.finally(() => {
delete this.editableData[record.drinkingWaterBillId];
hide();
});
}, },
/* 删除单个 */ /* 删除单个 */
remove(row) { remove(row) {
const hide = this.$message.loading('请求中..', 0); const hide = this.$message.loading("请求中..", 0);
removeDrinkingWaterBill(row.drinkingWaterBillId).then(res => { removeDrinkingWaterBill(row.drinkingWaterBillId)
.then((res) => {
if (res.data.code === 0) { if (res.data.code === 0) {
this.$message.success(res.data.msg); this.$message.success(res.data.msg);
this.reload(); this.reload();
} else { } else {
this.$message.error(res.data.msg); this.$message.error(res.data.msg);
} }
}).catch(e => { })
.catch((e) => {
this.$message.error(e.msg); this.$message.error(e.msg);
}).finally(() => hide()); })
.finally(() => hide());
}, },
removeBatch() { removeBatch() {
const ids = this.selectionList.map(item => item.drinkingWaterBillId); const ids = this.selectionList.map((item) => item.drinkingWaterBillId);
const hide = this.$message.loading('请求中..', 0); const hide = this.$message.loading("请求中..", 0);
removeBatchDrinkingWaterBill(ids).then(res => { removeBatchDrinkingWaterBill(ids)
.then((res) => {
if (res.data.code === 0) { if (res.data.code === 0) {
this.$message.success(res.data.msg); this.$message.success(res.data.msg);
this.reload(); this.reload();
} else { } else {
this.$message.error(res.data.msg); this.$message.error(res.data.msg);
} }
}).catch(e => { })
.catch((e) => {
this.$message.error(e.msg); this.$message.error(e.msg);
}).finally(() => hide()); })
.finally(() => hide());
}, },
},
} };
}
</script> </script>
<style lang="less"> <style lang="less">
.editable-cell { .editable-cell {
position: relative; position: relative;
.editable-cell-input-wrapper, .editable-cell-input-wrapper,
@@ -420,9 +628,9 @@
.editable-add-btn { .editable-add-btn {
margin-bottom: 8px; margin-bottom: 8px;
} }
} }
.editable-cell:hover .editable-cell-icon { .editable-cell:hover .editable-cell-icon {
display: inline-block; display: inline-block;
} }
</style> </style>

View File

@@ -53,14 +53,14 @@
/> />
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :md="12" :sm="24"> <!-- <a-col :md="12" :sm="24">
<a-form-item label="时间" name="monitorTime"> <a-form-item label="时间" name="monitorTime">
<a-time-picker <a-time-picker
v-model:value="form.monitorTime" v-model:value="form.monitorTime"
format="HH:mm" format="HH:mm"
/> />
</a-form-item> </a-form-item>
</a-col> </a-col> -->
<a-col v-for="(item,index) in tableColumns" :key="index" :md="12" :sm="24"> <a-col v-for="(item,index) in tableColumns" :key="index" :md="12" :sm="24">
<a-form-item :label="item.title" :name="item.dataIndex"> <a-form-item :label="item.title" :name="item.dataIndex">
<a-input <a-input
@@ -159,6 +159,12 @@ export default {
tableColumns, tableColumns,
// 表格列配置 // 表格列配置
columns: [ columns: [
// {
// title: "监测日期",
// dataIndex: "monitorTime",
// sorter: true,
// customRender: ({text})=> moment(text).format("YYYY年MM月DD日HH:mm")
// },
...tableColumns, ...tableColumns,
{ {
title: "区域等级", title: "区域等级",
@@ -254,19 +260,22 @@ export default {
save() { save() {
const hide = this.$message.loading("请求中..", 0); const hide = this.$message.loading("请求中..", 0);
const form = _.cloneDeep(this.form); const form = _.cloneDeep(this.form);
const date = new Date(); // const date = new Date();
date.setFullYear(form.monitorDate.year()); // date.setFullYear(form.monitorDate.year());
date.setMonth(form.monitorDate.month()); // date.setMonth(form.monitorDate.month());
date.setDate(form.monitorDate.date()); // date.setDate(form.monitorDate.date());
date.setHours(form.monitorTime.hour()); // date.setHours(form.monitorTime.hour());
date.setMinutes(form.monitorTime.minutes()); // date.setMinutes(form.monitorTime.minutes());
form.monitorTime = date.getTime(); // form.monitorTime = date.getTime();
form.monitorYear = date.getFullYear(); // form.monitorYear = date.getFullYear();
form.monitorMonth = date.getMonth() + 1; // form.monitorMonth = date.getMonth() + 1;
form.monitorDay = date.getDate(); // form.monitorDay = date.getDate();
form.monitorHour = date.getHours(); // form.monitorHour = date.getHours();
form.monitorMinute = date.getMinutes(); // form.monitorMinute = date.getMinutes();
delete form["monitorDate"]; // delete form["monitorDate"];
console.log(form,'form');
const { billId } = this.$route.params;
form.drinkingWaterBillId = billId;
if (form.drinkingWaterId) { if (form.drinkingWaterId) {
updateDrinkingWater(form) updateDrinkingWater(form)
.then((res) => { .then((res) => {