导入。。。。。。。。。。。。。。。。
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user