@@ -26,8 +32,8 @@
-
-
+
+
导出记录
@@ -44,6 +50,8 @@
删除
新增
+ 一键布防
+ 一键撤防
@@ -56,6 +64,11 @@
{{ scope.row[column.value] }}
+
+
+ {{ btnNames[scope.row.bfztName] }}
+
+
详情
@@ -90,7 +103,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'
@@ -100,9 +113,11 @@
data() {
return {
listQuery: {
- keywords: '',
- wellType: '',
- deptid: '',
+ keywords: '', // 关键字:闸井编号
+ position: '', // 位置
+ owner: '', // 权属单位
+ wellType: '', // 井类型
+ deptid: '', // deptid
offset: 1,
limit: 20,
sort: 'wellCode',
@@ -112,18 +127,18 @@
{
text: '闸井编号',
value: 'wellCode',
- width: 130,
+ width: 100,
align: 'center'
},
{
text: '闸井名称',
value: 'wellName',
+ width: 100,
align: 'center'
},
{
- text: '井深(m)',
- value: 'deep',
- width: 80,
+ text: '产权单位',
+ value: 'owner',
align: 'center'
},
{
@@ -134,7 +149,6 @@
{
text: '井类型',
value: 'wellTypeName',
- width: 70,
align: 'center'
},
{
@@ -174,7 +188,15 @@
editShow: false, // 是否显示编辑框
detailShow: false, // 是否显示详情框
filename: 'sluicewell_template.xlsx',
- fileList: []
+ fileList: [],
+ btnNames: {
+ '布防': '撤防',
+ '撤防': '布防'
+ },
+ btnStatus: {
+ '撤防': 'success',
+ '布防': 'danger'
+ }
}
},
created() {
@@ -235,6 +257,100 @@
this.$message.error('至少选中一项')
}
},
+ // 布防撤防
+ 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,
+ 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,
+ bfzt: '0'
+ }
+ this.$confirm(
+ '确定要对列表中的全部闸井进行撤防吗?',
+ '确认操作',
+ {
+ confirmButtonText: '确定',
+ cancelButtonText: '取消',
+ type: 'warning'
+ }
+ ).then(() => {
+ batchBfcf(listQuery).then(response => {
+ if (response.code === 200) {
+ this.$message.success('撤防成功')
+ this.fetchData()
+ }
+ })
+ })
+ },
// 批量导入闸井
uploadFile(param) {
console.log('uploadFile')