This commit is contained in:
weicw
2021-08-30 10:04:38 +08:00
parent 76d2c9bba0
commit ab71482bae
26 changed files with 3267 additions and 20012 deletions

View File

@@ -42,7 +42,7 @@
</a-form>
<a-modal
v-model:visible="showEdit"
:title="form.airNoiseId !== undefined ? '修改记录' : '添加记录'"
:title="form.airId !== undefined ? '修改记录' : '添加记录'"
:confirm-loading="loading"
:width="1000"
:body-style="{ paddingBottom: '8px' }"
@@ -267,7 +267,7 @@
<ele-pro-table
v-model:selection="selectionList"
ref="table"
row-key="airNoiseId"
row-key="airId"
:datasource="url"
:columns="columns"
:where="where"
@@ -333,19 +333,19 @@
<script>
import _ from "lodash";
import {
pageAirNoiseUrl,
saveAirNoise,
removeAirNoise,
removeBatchAirNoise,
updateAirNoise,
getAirNoiseBill,
pageAirUrl,
saveAir,
removeAir,
removeBatchAir,
updateAir,
getAirBill,
getColumnOptions,
} from "@/api/ecology/air";
import locale from "ant-design-vue/es/date-picker/locale/zh_CN";
import moment from "moment";
// import utils from "./utils";
export default {
name: "AirCollectNoise",
name: "AirCollect",
components: {},
data() {
const { billId } = this.$route.params;
@@ -354,7 +354,7 @@ export default {
locale,
bill: {},
// 表格数据接口
url: pageAirNoiseUrl,
url: pageAirUrl,
selection: [],
// 表格列配置
columns: [
@@ -517,11 +517,11 @@ export default {
},
],
// 表格搜索条件
airNoiseBillId: billId,
airBillId: billId,
palceOptions: [],
areaOptions: [],
where: {
airNoiseBillId: billId,
airBillId: billId,
},
// 表格选中数据
selectionList: [],
@@ -535,7 +535,7 @@ export default {
},
mounted() {
const { billId } = this.$route.params;
getAirNoiseBill(billId).then((res) => {
getAirBill(billId).then((res) => {
this.bill = res.data.data;
if (res.data.data.checked == 1) {
this.columns.splice(this.columns.length - 1, 1);
@@ -574,7 +574,7 @@ export default {
/* 重置搜索 */
reset() {
this.where = {
airNoiseBillId: this.airNoiseBillId,
airBillId: this.airBillId,
};
this.reload();
},
@@ -610,8 +610,8 @@ export default {
form.monitorHour = date.getHours();
form.monitorMinute = date.getMinutes();
delete form["monitorDate"];
if (form.airNoiseId) {
updateAirNoise(form)
if (form.airId) {
updateAir(form)
.then((res) => {
if (res.data.code == 0) {
this.showEdit = false;
@@ -629,8 +629,8 @@ export default {
hide();
});
} else {
form.airNoiseBillId = this.airNoiseBillId;
saveAirNoise(form)
form.airBillId = this.airBillId;
saveAir(form)
.then((res) => {
if (res.data.code == 0) {
this.showEdit = false;
@@ -651,7 +651,7 @@ export default {
/* 删除单个 */
remove(row) {
const hide = this.$message.loading("请求中..", 0);
removeAirNoise(row.airNoiseId)
removeAir(row.airId)
.then((res) => {
if (res.data.code === 0) {
this.$message.success(res.data.msg);
@@ -666,9 +666,9 @@ export default {
.finally(() => hide());
},
removeBatch() {
const ids = this.selectionList.map((item) => item.airNoiseId);
const ids = this.selectionList.map((item) => item.airId);
const hide = this.$message.loading("请求中..", 0);
removeBatchAirNoise(ids)
removeBatchAir(ids)
.then((res) => {
if (res.data.code === 0) {
this.$message.success(res.data.msg);