diff --git a/src/api/well.js b/src/api/well.js
index 5a7af1e..c6eff97 100644
--- a/src/api/well.js
+++ b/src/api/well.js
@@ -60,7 +60,8 @@
return qs.stringify(params, { indices: false })
}
})
-}// 批量导入
+}
+// 批量导入
export function batchImportWell(fileobj) {
const param = new FormData()
param.append('file', fileobj)
@@ -91,3 +92,23 @@
}
})
}
+// 布防撤防
+export function bfcf(wellId, bfzt) {
+ return request({
+ url: 'well/bfcf',
+ method: 'post',
+ params: {
+ wellId: wellId,
+ bfzt: bfzt
+ }
+ })
+}
+// 闸井批量布防
+export function batchBfcf(params) {
+ return request({
+ url: 'well/batchBfcf',
+ method: 'post',
+ params
+ })
+}
+
diff --git a/src/api/well.js b/src/api/well.js
index 5a7af1e..c6eff97 100644
--- a/src/api/well.js
+++ b/src/api/well.js
@@ -60,7 +60,8 @@
return qs.stringify(params, { indices: false })
}
})
-}// 批量导入
+}
+// 批量导入
export function batchImportWell(fileobj) {
const param = new FormData()
param.append('file', fileobj)
@@ -91,3 +92,23 @@
}
})
}
+// 布防撤防
+export function bfcf(wellId, bfzt) {
+ return request({
+ url: 'well/bfcf',
+ method: 'post',
+ params: {
+ wellId: wellId,
+ bfzt: bfzt
+ }
+ })
+}
+// 闸井批量布防
+export function batchBfcf(params) {
+ return request({
+ url: 'well/batchBfcf',
+ method: 'post',
+ params
+ })
+}
+
diff --git a/src/views/wellManage/listWell.vue b/src/views/wellManage/listWell.vue
index 7b9d02c..7058cc9 100644
--- a/src/views/wellManage/listWell.vue
+++ b/src/views/wellManage/listWell.vue
@@ -42,6 +42,8 @@
class="edit_btn">
批量导入
+ 一键布防
+ 一键撤防
删除
新增
@@ -56,6 +58,11 @@
{{ scope.row[column.value] }}
+
+
+ {{ btnNames[scope.row.bfztName] }}
+
+
详情
@@ -90,7 +97,7 @@
import editWell from '@/views/wellManage/editWell'
import detailWell from '@/views/wellManage/detailWell'
import SelectTree from '@/components/SelectTree/singleSelect'
-import { getWellList, getWellType, delWell, batchImportWell, batchExportWell } from '@/api/well'
+import { getWellList, getWellType, delWell, batchImportWell, batchExportWell, batchBfcf, bfcf } from '@/api/well'
import DeptSelect from '@/components/DeptSelect'
import DownloadTemplate from '@/components/DownloadTemplate/index'
@@ -174,7 +181,15 @@
editShow: false, // 是否显示编辑框
detailShow: false, // 是否显示详情框
filename: 'sluicewell_template.xlsx',
- fileList: []
+ fileList: [],
+ btnNames: {
+ '布防': '撤防',
+ '撤防': '布防'
+ },
+ btnStatus: {
+ '撤防': 'success',
+ '布防': 'danger'
+ }
}
},
created() {
@@ -294,6 +309,102 @@
this.$message.error(res.message)
})
},
+ // 布防撤防
+ bfcf(row) {
+ if (row.bfzt === '1') {
+ // 需要撤防
+ this.$confirm(
+ '确定要对闸井进行撤防吗?',
+ '确认操作',
+ {
+ confirmButtonText: '确定',
+ cancelButtonText: '取消',
+ type: 'warning'
+ }
+ ).then(() => {
+ bfcf(row.id, '0').then(response => {
+ if (response.code === 200) {
+ this.$message.success('撤防成功')
+ this.fetchData()
+ }
+ })
+ })
+ } else {
+ // 需要布防
+ this.$confirm(
+ '确定要对闸井进行布防吗?',
+ '确认操作',
+ {
+ confirmButtonText: '确定',
+ cancelButtonText: '取消',
+ type: 'warning'
+ }
+ ).then(() => {
+ bfcf(row.id, '1').then(response => {
+ if (response.code === 200) {
+ this.$message.success('布防成功')
+ this.fetchData()
+ }
+ })
+ })
+ }
+ },
+ // 批量布防
+ batchBf() {
+ const listQuery = {
+ keywords: this.listQuery.keywords,
+ owner: this.listQuery.owner,
+ position: this.listQuery.position,
+ wellType: this.listQuery.wellType,
+ deptid: this.listQuery.deptid,
+ notes: this.listQuery.notes,
+ bfzt: '1'
+ }
+ this.$confirm(
+ '确定要对列表中的全部闸井进行布防吗?',
+ '确认操作',
+ {
+ confirmButtonText: '确定',
+ cancelButtonText: '取消',
+ type: 'warning'
+ }
+ ).then(() => {
+ batchBfcf(listQuery).then(response => {
+ if (response.code === 200) {
+ this.$message.success('布防成功')
+ this.fetchData()
+ }
+ })
+ })
+ },
+ // 批量撤防
+ batchCf() {
+ const listQuery = {
+ keywords: this.listQuery.keywords,
+ owner: this.listQuery.owner,
+ position: this.listQuery.position,
+ wellType: this.listQuery.wellType,
+ deptid: this.listQuery.deptid,
+ notes: this.listQuery.notes,
+ bfzt: '0'
+ }
+ this.$confirm(
+ '确定要对列表中的全部闸井进行撤防吗?',
+ '确认操作',
+ {
+ confirmButtonText: '确定',
+ cancelButtonText: '取消',
+ type: 'warning'
+ }
+ ).then(() => {
+ batchBfcf(listQuery).then(response => {
+ if (response.code === 200) {
+ this.$message.success('撤防成功')
+ this.fetchData()
+ }
+ })
+ })
+ },
// 查询数据
search() {
this.fetchData(false)