diff --git a/src/api/backpack.js b/src/api/backpack.js index 789323c..67e7e2d 100644 --- a/src/api/backpack.js +++ b/src/api/backpack.js @@ -69,6 +69,19 @@ } }) } +// 删除背负式设备 +export function batchdelBackpack(backpackInfoIds) { + return request({ + url: 'backpack/batchDelete', + method: 'post', + params: { + backpackInfoIds: backpackInfoIds + }, + paramsSerializer: params => { + return qs.stringify(params, { indices: false }) + } + }) +} // 批量导入 export function batchImportBackpack(fileobj) { const param = new FormData() diff --git a/src/api/backpack.js b/src/api/backpack.js index 789323c..67e7e2d 100644 --- a/src/api/backpack.js +++ b/src/api/backpack.js @@ -69,6 +69,19 @@ } }) } +// 删除背负式设备 +export function batchdelBackpack(backpackInfoIds) { + return request({ + url: 'backpack/batchDelete', + method: 'post', + params: { + backpackInfoIds: backpackInfoIds + }, + paramsSerializer: params => { + return qs.stringify(params, { indices: false }) + } + }) +} // 批量导入 export function batchImportBackpack(fileobj) { const param = new FormData() diff --git a/src/views/backpackManage/addBackpack.vue b/src/views/backpackManage/addBackpack.vue index 7a7dc5a..2ff263e 100644 --- a/src/views/backpackManage/addBackpack.vue +++ b/src/views/backpackManage/addBackpack.vue @@ -210,7 +210,7 @@ }, computed: { showResponseDept() { - if (this.backpackForm.deptid === '') { + if (this.backpackForm.deptId === '') { return true } else { if (this.secondDeptTreeList && this.secondDeptTreeList.length >= 1) { @@ -221,14 +221,14 @@ } }, showArea() { - if (this.backpackForm.deptid === '') { + if (this.backpackForm.deptId === '') { return true } else { return false } }, firstDept() { // 获取权属单位 - return this.backpackForm.deptid + return this.backpackForm.deptId }, qu() { // 获取区 return this.backpackForm.qu @@ -260,13 +260,13 @@ // 加载组织机构树形下拉菜单 fetchSecondDeptTree: function() { const listQuery = { - pid: this.backpackForm.deptid, + pid: this.backpackForm.deptId, deptType: '04' } getDeptTreeList(listQuery).then(response => { console.log(response.data) if (response.data.list) { - this.secondDeptTreeList = toTreeList(response.data.list, this.backpackForm.deptid) + this.secondDeptTreeList = toTreeList(response.data.list, this.backpackForm.deptId) } }) }, @@ -287,7 +287,7 @@ }, // 获取区域1 fetchArea1() { - getAreaByDept(this.backpackForm.deptid).then(response => { + getAreaByDept(this.backpackForm.deptId).then(response => { if (response.code === 200) { const pid = response.data.area getAreaList(pid).then(response => { @@ -314,19 +314,34 @@ // 重置表单 resetForm() { this.backpackForm = { - backpackCode: '', // 井编号 - backpackName: '', // 井名称 - backpackType: '', // 井类型 - deptid: '', // 权属单位 - deep: '', // 井深, - position: '', // 位置描述 - coordinateX: '', // 经度 - coordinateY: '', // 纬度 - photos: '', // 照片路径 - notes: '', // 备注, - qu: '', - area: '', // 街道 - responsibleDept: '' // 维护人员部门 + // backpackCode: '', // 井编号 + // backpackName: '', // 井名称 + // backpackType: '', // 井类型 + // deptid: '', // 权属单位 + // deep: '', // 井深, + // position: '', // 位置描述 + // coordinateX: '', // 经度 + // coordinateY: '', // 纬度 + // photos: '', // 照片路径 + // notes: '', // 备注, + // qu: '', + // area: '', // 街道 + // responsibleDept: '' // 维护人员部门 + id: '', + backpackCode: '', + description: '', + deptId: '', + brandModel: '', + userPerson: '', + userPhone: '', + chargePerson: '', + chargePhone: '', + purchaseDate: '', + registerDate: '', + remarks: '', + deviceId: '', + liquidCode: '', + electricCode: '' } // 清空上传图片 this.$refs.upload.clearFiles() @@ -352,7 +367,7 @@ this.$message.warning('必须选择维护机构') return } else { - this.backpackForm.responsibleDept = this.backpackForm.deptid + this.backpackForm.responsibleDept = this.backpackForm.deptId } } this.$refs['dataForm'].validate((valid) => { diff --git a/src/api/backpack.js b/src/api/backpack.js index 789323c..67e7e2d 100644 --- a/src/api/backpack.js +++ b/src/api/backpack.js @@ -69,6 +69,19 @@ } }) } +// 删除背负式设备 +export function batchdelBackpack(backpackInfoIds) { + return request({ + url: 'backpack/batchDelete', + method: 'post', + params: { + backpackInfoIds: backpackInfoIds + }, + paramsSerializer: params => { + return qs.stringify(params, { indices: false }) + } + }) +} // 批量导入 export function batchImportBackpack(fileobj) { const param = new FormData() diff --git a/src/views/backpackManage/addBackpack.vue b/src/views/backpackManage/addBackpack.vue index 7a7dc5a..2ff263e 100644 --- a/src/views/backpackManage/addBackpack.vue +++ b/src/views/backpackManage/addBackpack.vue @@ -210,7 +210,7 @@ }, computed: { showResponseDept() { - if (this.backpackForm.deptid === '') { + if (this.backpackForm.deptId === '') { return true } else { if (this.secondDeptTreeList && this.secondDeptTreeList.length >= 1) { @@ -221,14 +221,14 @@ } }, showArea() { - if (this.backpackForm.deptid === '') { + if (this.backpackForm.deptId === '') { return true } else { return false } }, firstDept() { // 获取权属单位 - return this.backpackForm.deptid + return this.backpackForm.deptId }, qu() { // 获取区 return this.backpackForm.qu @@ -260,13 +260,13 @@ // 加载组织机构树形下拉菜单 fetchSecondDeptTree: function() { const listQuery = { - pid: this.backpackForm.deptid, + pid: this.backpackForm.deptId, deptType: '04' } getDeptTreeList(listQuery).then(response => { console.log(response.data) if (response.data.list) { - this.secondDeptTreeList = toTreeList(response.data.list, this.backpackForm.deptid) + this.secondDeptTreeList = toTreeList(response.data.list, this.backpackForm.deptId) } }) }, @@ -287,7 +287,7 @@ }, // 获取区域1 fetchArea1() { - getAreaByDept(this.backpackForm.deptid).then(response => { + getAreaByDept(this.backpackForm.deptId).then(response => { if (response.code === 200) { const pid = response.data.area getAreaList(pid).then(response => { @@ -314,19 +314,34 @@ // 重置表单 resetForm() { this.backpackForm = { - backpackCode: '', // 井编号 - backpackName: '', // 井名称 - backpackType: '', // 井类型 - deptid: '', // 权属单位 - deep: '', // 井深, - position: '', // 位置描述 - coordinateX: '', // 经度 - coordinateY: '', // 纬度 - photos: '', // 照片路径 - notes: '', // 备注, - qu: '', - area: '', // 街道 - responsibleDept: '' // 维护人员部门 + // backpackCode: '', // 井编号 + // backpackName: '', // 井名称 + // backpackType: '', // 井类型 + // deptid: '', // 权属单位 + // deep: '', // 井深, + // position: '', // 位置描述 + // coordinateX: '', // 经度 + // coordinateY: '', // 纬度 + // photos: '', // 照片路径 + // notes: '', // 备注, + // qu: '', + // area: '', // 街道 + // responsibleDept: '' // 维护人员部门 + id: '', + backpackCode: '', + description: '', + deptId: '', + brandModel: '', + userPerson: '', + userPhone: '', + chargePerson: '', + chargePhone: '', + purchaseDate: '', + registerDate: '', + remarks: '', + deviceId: '', + liquidCode: '', + electricCode: '' } // 清空上传图片 this.$refs.upload.clearFiles() @@ -352,7 +367,7 @@ this.$message.warning('必须选择维护机构') return } else { - this.backpackForm.responsibleDept = this.backpackForm.deptid + this.backpackForm.responsibleDept = this.backpackForm.deptId } } this.$refs['dataForm'].validate((valid) => { diff --git a/src/views/backpackManage/detailBackpack.vue b/src/views/backpackManage/detailBackpack.vue index ceca5b6..b7eec46 100644 --- a/src/views/backpackManage/detailBackpack.vue +++ b/src/views/backpackManage/detailBackpack.vue @@ -44,11 +44,11 @@ - - - - - + + + + + @@ -133,29 +133,29 @@ - - - - - - - - - - - - + + + + + + + + + + + + - - - - - + + + + + @@ -181,6 +181,13 @@ + + + + + + + @@ -372,7 +379,7 @@ this.dialogFormVisible = dialogFormVisible console.log(row,"=======row========"); this.backpackForm = { - backpackInfoId: row.id || row.data.id, // 背负式设备id + id: row.id || row.data.id, // 背负式设备id backpackCode: row.data.backpackCode || '', description: row.data.description || '', deptId: row.data.deptId || '', @@ -392,7 +399,7 @@ imei: row.data.imei || '', delflag: row.data.delflag || '' } - if (row.deptid && row.deptid !== '') { + if (row.deptId && row.deptId !== '') { this.fetchArea1() this.fetchArea2() this.loading = false @@ -420,7 +427,7 @@ }, // 获取区域1 fetchArea1() { - getAreaByDept(this.backpackForm.deptid).then(response => { + getAreaByDept(this.backpackForm.deptId).then(response => { if (response.code === 200) { const pid = response.data.area getAreaList(pid).then(response => { diff --git a/src/api/backpack.js b/src/api/backpack.js index 789323c..67e7e2d 100644 --- a/src/api/backpack.js +++ b/src/api/backpack.js @@ -69,6 +69,19 @@ } }) } +// 删除背负式设备 +export function batchdelBackpack(backpackInfoIds) { + return request({ + url: 'backpack/batchDelete', + method: 'post', + params: { + backpackInfoIds: backpackInfoIds + }, + paramsSerializer: params => { + return qs.stringify(params, { indices: false }) + } + }) +} // 批量导入 export function batchImportBackpack(fileobj) { const param = new FormData() diff --git a/src/views/backpackManage/addBackpack.vue b/src/views/backpackManage/addBackpack.vue index 7a7dc5a..2ff263e 100644 --- a/src/views/backpackManage/addBackpack.vue +++ b/src/views/backpackManage/addBackpack.vue @@ -210,7 +210,7 @@ }, computed: { showResponseDept() { - if (this.backpackForm.deptid === '') { + if (this.backpackForm.deptId === '') { return true } else { if (this.secondDeptTreeList && this.secondDeptTreeList.length >= 1) { @@ -221,14 +221,14 @@ } }, showArea() { - if (this.backpackForm.deptid === '') { + if (this.backpackForm.deptId === '') { return true } else { return false } }, firstDept() { // 获取权属单位 - return this.backpackForm.deptid + return this.backpackForm.deptId }, qu() { // 获取区 return this.backpackForm.qu @@ -260,13 +260,13 @@ // 加载组织机构树形下拉菜单 fetchSecondDeptTree: function() { const listQuery = { - pid: this.backpackForm.deptid, + pid: this.backpackForm.deptId, deptType: '04' } getDeptTreeList(listQuery).then(response => { console.log(response.data) if (response.data.list) { - this.secondDeptTreeList = toTreeList(response.data.list, this.backpackForm.deptid) + this.secondDeptTreeList = toTreeList(response.data.list, this.backpackForm.deptId) } }) }, @@ -287,7 +287,7 @@ }, // 获取区域1 fetchArea1() { - getAreaByDept(this.backpackForm.deptid).then(response => { + getAreaByDept(this.backpackForm.deptId).then(response => { if (response.code === 200) { const pid = response.data.area getAreaList(pid).then(response => { @@ -314,19 +314,34 @@ // 重置表单 resetForm() { this.backpackForm = { - backpackCode: '', // 井编号 - backpackName: '', // 井名称 - backpackType: '', // 井类型 - deptid: '', // 权属单位 - deep: '', // 井深, - position: '', // 位置描述 - coordinateX: '', // 经度 - coordinateY: '', // 纬度 - photos: '', // 照片路径 - notes: '', // 备注, - qu: '', - area: '', // 街道 - responsibleDept: '' // 维护人员部门 + // backpackCode: '', // 井编号 + // backpackName: '', // 井名称 + // backpackType: '', // 井类型 + // deptid: '', // 权属单位 + // deep: '', // 井深, + // position: '', // 位置描述 + // coordinateX: '', // 经度 + // coordinateY: '', // 纬度 + // photos: '', // 照片路径 + // notes: '', // 备注, + // qu: '', + // area: '', // 街道 + // responsibleDept: '' // 维护人员部门 + id: '', + backpackCode: '', + description: '', + deptId: '', + brandModel: '', + userPerson: '', + userPhone: '', + chargePerson: '', + chargePhone: '', + purchaseDate: '', + registerDate: '', + remarks: '', + deviceId: '', + liquidCode: '', + electricCode: '' } // 清空上传图片 this.$refs.upload.clearFiles() @@ -352,7 +367,7 @@ this.$message.warning('必须选择维护机构') return } else { - this.backpackForm.responsibleDept = this.backpackForm.deptid + this.backpackForm.responsibleDept = this.backpackForm.deptId } } this.$refs['dataForm'].validate((valid) => { diff --git a/src/views/backpackManage/detailBackpack.vue b/src/views/backpackManage/detailBackpack.vue index ceca5b6..b7eec46 100644 --- a/src/views/backpackManage/detailBackpack.vue +++ b/src/views/backpackManage/detailBackpack.vue @@ -44,11 +44,11 @@ - - - - - + + + + + @@ -133,29 +133,29 @@ - - - - - - - - - - - - + + + + + + + + + + + + - - - - - + + + + + @@ -181,6 +181,13 @@ + + + + + + + @@ -372,7 +379,7 @@ this.dialogFormVisible = dialogFormVisible console.log(row,"=======row========"); this.backpackForm = { - backpackInfoId: row.id || row.data.id, // 背负式设备id + id: row.id || row.data.id, // 背负式设备id backpackCode: row.data.backpackCode || '', description: row.data.description || '', deptId: row.data.deptId || '', @@ -392,7 +399,7 @@ imei: row.data.imei || '', delflag: row.data.delflag || '' } - if (row.deptid && row.deptid !== '') { + if (row.deptId && row.deptId !== '') { this.fetchArea1() this.fetchArea2() this.loading = false @@ -420,7 +427,7 @@ }, // 获取区域1 fetchArea1() { - getAreaByDept(this.backpackForm.deptid).then(response => { + getAreaByDept(this.backpackForm.deptId).then(response => { if (response.code === 200) { const pid = response.data.area getAreaList(pid).then(response => { diff --git a/src/views/backpackManage/editBackpackInfo.vue b/src/views/backpackManage/editBackpackInfo.vue index dcfe763..41ba598 100644 --- a/src/views/backpackManage/editBackpackInfo.vue +++ b/src/views/backpackManage/editBackpackInfo.vue @@ -335,6 +335,7 @@ cancel: function() { this.dialogFormVisible = false this.$emit('watchChild') + // this.$emit('isShow') }, changeiot(val) { for (var i = 0; i < this.imeilist.length; i++) { diff --git a/src/api/backpack.js b/src/api/backpack.js index 789323c..67e7e2d 100644 --- a/src/api/backpack.js +++ b/src/api/backpack.js @@ -69,6 +69,19 @@ } }) } +// 删除背负式设备 +export function batchdelBackpack(backpackInfoIds) { + return request({ + url: 'backpack/batchDelete', + method: 'post', + params: { + backpackInfoIds: backpackInfoIds + }, + paramsSerializer: params => { + return qs.stringify(params, { indices: false }) + } + }) +} // 批量导入 export function batchImportBackpack(fileobj) { const param = new FormData() diff --git a/src/views/backpackManage/addBackpack.vue b/src/views/backpackManage/addBackpack.vue index 7a7dc5a..2ff263e 100644 --- a/src/views/backpackManage/addBackpack.vue +++ b/src/views/backpackManage/addBackpack.vue @@ -210,7 +210,7 @@ }, computed: { showResponseDept() { - if (this.backpackForm.deptid === '') { + if (this.backpackForm.deptId === '') { return true } else { if (this.secondDeptTreeList && this.secondDeptTreeList.length >= 1) { @@ -221,14 +221,14 @@ } }, showArea() { - if (this.backpackForm.deptid === '') { + if (this.backpackForm.deptId === '') { return true } else { return false } }, firstDept() { // 获取权属单位 - return this.backpackForm.deptid + return this.backpackForm.deptId }, qu() { // 获取区 return this.backpackForm.qu @@ -260,13 +260,13 @@ // 加载组织机构树形下拉菜单 fetchSecondDeptTree: function() { const listQuery = { - pid: this.backpackForm.deptid, + pid: this.backpackForm.deptId, deptType: '04' } getDeptTreeList(listQuery).then(response => { console.log(response.data) if (response.data.list) { - this.secondDeptTreeList = toTreeList(response.data.list, this.backpackForm.deptid) + this.secondDeptTreeList = toTreeList(response.data.list, this.backpackForm.deptId) } }) }, @@ -287,7 +287,7 @@ }, // 获取区域1 fetchArea1() { - getAreaByDept(this.backpackForm.deptid).then(response => { + getAreaByDept(this.backpackForm.deptId).then(response => { if (response.code === 200) { const pid = response.data.area getAreaList(pid).then(response => { @@ -314,19 +314,34 @@ // 重置表单 resetForm() { this.backpackForm = { - backpackCode: '', // 井编号 - backpackName: '', // 井名称 - backpackType: '', // 井类型 - deptid: '', // 权属单位 - deep: '', // 井深, - position: '', // 位置描述 - coordinateX: '', // 经度 - coordinateY: '', // 纬度 - photos: '', // 照片路径 - notes: '', // 备注, - qu: '', - area: '', // 街道 - responsibleDept: '' // 维护人员部门 + // backpackCode: '', // 井编号 + // backpackName: '', // 井名称 + // backpackType: '', // 井类型 + // deptid: '', // 权属单位 + // deep: '', // 井深, + // position: '', // 位置描述 + // coordinateX: '', // 经度 + // coordinateY: '', // 纬度 + // photos: '', // 照片路径 + // notes: '', // 备注, + // qu: '', + // area: '', // 街道 + // responsibleDept: '' // 维护人员部门 + id: '', + backpackCode: '', + description: '', + deptId: '', + brandModel: '', + userPerson: '', + userPhone: '', + chargePerson: '', + chargePhone: '', + purchaseDate: '', + registerDate: '', + remarks: '', + deviceId: '', + liquidCode: '', + electricCode: '' } // 清空上传图片 this.$refs.upload.clearFiles() @@ -352,7 +367,7 @@ this.$message.warning('必须选择维护机构') return } else { - this.backpackForm.responsibleDept = this.backpackForm.deptid + this.backpackForm.responsibleDept = this.backpackForm.deptId } } this.$refs['dataForm'].validate((valid) => { diff --git a/src/views/backpackManage/detailBackpack.vue b/src/views/backpackManage/detailBackpack.vue index ceca5b6..b7eec46 100644 --- a/src/views/backpackManage/detailBackpack.vue +++ b/src/views/backpackManage/detailBackpack.vue @@ -44,11 +44,11 @@ - - - - - + + + + + @@ -133,29 +133,29 @@ - - - - - - - - - - - - + + + + + + + + + + + + - - - - - + + + + + @@ -181,6 +181,13 @@ + + + + + + + @@ -372,7 +379,7 @@ this.dialogFormVisible = dialogFormVisible console.log(row,"=======row========"); this.backpackForm = { - backpackInfoId: row.id || row.data.id, // 背负式设备id + id: row.id || row.data.id, // 背负式设备id backpackCode: row.data.backpackCode || '', description: row.data.description || '', deptId: row.data.deptId || '', @@ -392,7 +399,7 @@ imei: row.data.imei || '', delflag: row.data.delflag || '' } - if (row.deptid && row.deptid !== '') { + if (row.deptId && row.deptId !== '') { this.fetchArea1() this.fetchArea2() this.loading = false @@ -420,7 +427,7 @@ }, // 获取区域1 fetchArea1() { - getAreaByDept(this.backpackForm.deptid).then(response => { + getAreaByDept(this.backpackForm.deptId).then(response => { if (response.code === 200) { const pid = response.data.area getAreaList(pid).then(response => { diff --git a/src/views/backpackManage/editBackpackInfo.vue b/src/views/backpackManage/editBackpackInfo.vue index dcfe763..41ba598 100644 --- a/src/views/backpackManage/editBackpackInfo.vue +++ b/src/views/backpackManage/editBackpackInfo.vue @@ -335,6 +335,7 @@ cancel: function() { this.dialogFormVisible = false this.$emit('watchChild') + // this.$emit('isShow') }, changeiot(val) { for (var i = 0; i < this.imeilist.length; i++) { diff --git a/src/views/backpackManage/listBackpack.vue b/src/views/backpackManage/listBackpack.vue index b4b211b..b685887 100644 --- a/src/views/backpackManage/listBackpack.vue +++ b/src/views/backpackManage/listBackpack.vue @@ -20,7 +20,8 @@ - + + 搜索 @@ -70,7 +71,7 @@ @@ -90,8 +91,8 @@ - - + + @@ -100,7 +101,7 @@ import editBackpackInfo from '@/views/backpackManage/editBackpackInfo' import detailBackpack from '@/views/backpackManage/detailBackpack' import SelectTree from '@/components/SelectTree/singleSelect' -import { getBackpackList, delBackpack, batchImportBackpack, batchExportBackpack } from '@/api/backpack' +import { getBackpackList, batchImportBackpack, batchExportBackpack, batchdelBackpack } from '@/api/backpack' import DeptSelect from '@/components/DeptSelect' import DownloadTemplate from '@/components/DownloadTemplate/index' @@ -109,11 +110,13 @@ components: { DownloadTemplate, SelectTree, addBackpack, detailBackpack, DeptSelect, editBackpackInfo }, data() { return { + dialogFormVisible: false, + deptShow: true, listQuery: { // keywords: '', description: '', backpackCode: '', - deptid: '', + deptId: '', offset: 1, limit: 20, sort: 'backpackCode', @@ -145,11 +148,11 @@ value: 'delflag', align: 'center' }, - { - text: '使用单位ID', - value: 'deptId', - align: 'center' - }, + // { + // text: '使用单位ID', + // value: 'deptId', + // align: 'center' + // }, { text: '使用单位', value: 'deptName', @@ -160,31 +163,31 @@ value: 'description', align: 'center' }, - { - text: '设备ID', - value: 'deviceId', - align: 'center' - }, - { - text: '电量编号', - value: 'electricCode', - align: 'center' - }, - { - text: 'id', - value: 'id', - align: 'center' - }, - { - text: 'imei', - value: 'imei', - align: 'center' - }, - { - text: 'iot', - value: 'iot', - align: 'center' - }, + // { + // text: '设备ID', + // value: 'deviceId', + // align: 'center' + // }, + // { + // text: '电量编号', + // value: 'electricCode', + // align: 'center' + // }, + // { + // text: 'id', + // value: 'id', + // align: 'center' + // }, + // { + // text: 'imei', + // value: 'imei', + // align: 'center' + // }, + // { + // text: 'iot', + // value: 'iot', + // align: 'center' + // }, { text: '液位编号', value: 'liquidCode', @@ -254,6 +257,10 @@ this.fetchData()// 获取数据 }, methods: { + changeShow(){ + this.dialogFormVisible =false + this.detailShow=false + }, // 打开详情对话框 detail(row) { const rowInfo = { data: row } @@ -269,14 +276,17 @@ }, // 新增背负式设备 add() { + console.log('add') // this.$router.push({ path: 'addBackpack', query: { type: 'create' }}) this.dialogStatus = true this.dialogFormVisible = true console.log(this.$refs.editBackpack.initDialog) this.$refs.editBackpack.initDialog('create', this.dialogFormVisible) + this.fetchData() }, // 编辑背负式设备信息 edit(row) { + console.log('edit') // this.dialogFormVisible = true // this.editShow = true // this.$refs.editbackpack.initDialog(this.dialogFormVisible, row) @@ -287,10 +297,11 @@ // 删除背负式设备 del() { if (this.checkSelection()) { - const backpackIds = [] + const backpackInfoIds = [] this.multipleSelection.forEach(function(value, index) { - backpackIds.push(value.id) + backpackInfoIds.push(value.id) }) + this.$confirm( '确定要删除所选背负式设备吗?', '确认操作', @@ -300,7 +311,7 @@ type: 'warning' } ).then(() => { - delBackpack(backpackIds).then(response => { + batchdelBackpack(backpackInfoIds).then(response => { if (response.code === 200) { this.$message.success('删除成功') this.fetchData() @@ -491,6 +502,8 @@ this.list = response.data.rows this.total = parseInt(response.data.total) this.listLoading = false + console.log(this.dialogFormVisible,"====弹框") + // this.dialogFormVisible=false }) }, fetchBackpackList() { diff --git a/src/api/backpack.js b/src/api/backpack.js index 789323c..67e7e2d 100644 --- a/src/api/backpack.js +++ b/src/api/backpack.js @@ -69,6 +69,19 @@ } }) } +// 删除背负式设备 +export function batchdelBackpack(backpackInfoIds) { + return request({ + url: 'backpack/batchDelete', + method: 'post', + params: { + backpackInfoIds: backpackInfoIds + }, + paramsSerializer: params => { + return qs.stringify(params, { indices: false }) + } + }) +} // 批量导入 export function batchImportBackpack(fileobj) { const param = new FormData() diff --git a/src/views/backpackManage/addBackpack.vue b/src/views/backpackManage/addBackpack.vue index 7a7dc5a..2ff263e 100644 --- a/src/views/backpackManage/addBackpack.vue +++ b/src/views/backpackManage/addBackpack.vue @@ -210,7 +210,7 @@ }, computed: { showResponseDept() { - if (this.backpackForm.deptid === '') { + if (this.backpackForm.deptId === '') { return true } else { if (this.secondDeptTreeList && this.secondDeptTreeList.length >= 1) { @@ -221,14 +221,14 @@ } }, showArea() { - if (this.backpackForm.deptid === '') { + if (this.backpackForm.deptId === '') { return true } else { return false } }, firstDept() { // 获取权属单位 - return this.backpackForm.deptid + return this.backpackForm.deptId }, qu() { // 获取区 return this.backpackForm.qu @@ -260,13 +260,13 @@ // 加载组织机构树形下拉菜单 fetchSecondDeptTree: function() { const listQuery = { - pid: this.backpackForm.deptid, + pid: this.backpackForm.deptId, deptType: '04' } getDeptTreeList(listQuery).then(response => { console.log(response.data) if (response.data.list) { - this.secondDeptTreeList = toTreeList(response.data.list, this.backpackForm.deptid) + this.secondDeptTreeList = toTreeList(response.data.list, this.backpackForm.deptId) } }) }, @@ -287,7 +287,7 @@ }, // 获取区域1 fetchArea1() { - getAreaByDept(this.backpackForm.deptid).then(response => { + getAreaByDept(this.backpackForm.deptId).then(response => { if (response.code === 200) { const pid = response.data.area getAreaList(pid).then(response => { @@ -314,19 +314,34 @@ // 重置表单 resetForm() { this.backpackForm = { - backpackCode: '', // 井编号 - backpackName: '', // 井名称 - backpackType: '', // 井类型 - deptid: '', // 权属单位 - deep: '', // 井深, - position: '', // 位置描述 - coordinateX: '', // 经度 - coordinateY: '', // 纬度 - photos: '', // 照片路径 - notes: '', // 备注, - qu: '', - area: '', // 街道 - responsibleDept: '' // 维护人员部门 + // backpackCode: '', // 井编号 + // backpackName: '', // 井名称 + // backpackType: '', // 井类型 + // deptid: '', // 权属单位 + // deep: '', // 井深, + // position: '', // 位置描述 + // coordinateX: '', // 经度 + // coordinateY: '', // 纬度 + // photos: '', // 照片路径 + // notes: '', // 备注, + // qu: '', + // area: '', // 街道 + // responsibleDept: '' // 维护人员部门 + id: '', + backpackCode: '', + description: '', + deptId: '', + brandModel: '', + userPerson: '', + userPhone: '', + chargePerson: '', + chargePhone: '', + purchaseDate: '', + registerDate: '', + remarks: '', + deviceId: '', + liquidCode: '', + electricCode: '' } // 清空上传图片 this.$refs.upload.clearFiles() @@ -352,7 +367,7 @@ this.$message.warning('必须选择维护机构') return } else { - this.backpackForm.responsibleDept = this.backpackForm.deptid + this.backpackForm.responsibleDept = this.backpackForm.deptId } } this.$refs['dataForm'].validate((valid) => { diff --git a/src/views/backpackManage/detailBackpack.vue b/src/views/backpackManage/detailBackpack.vue index ceca5b6..b7eec46 100644 --- a/src/views/backpackManage/detailBackpack.vue +++ b/src/views/backpackManage/detailBackpack.vue @@ -44,11 +44,11 @@ - - - - - + + + + + @@ -133,29 +133,29 @@ - - - - - - - - - - - - + + + + + + + + + + + + - - - - - + + + + + @@ -181,6 +181,13 @@ + + + + + + + @@ -372,7 +379,7 @@ this.dialogFormVisible = dialogFormVisible console.log(row,"=======row========"); this.backpackForm = { - backpackInfoId: row.id || row.data.id, // 背负式设备id + id: row.id || row.data.id, // 背负式设备id backpackCode: row.data.backpackCode || '', description: row.data.description || '', deptId: row.data.deptId || '', @@ -392,7 +399,7 @@ imei: row.data.imei || '', delflag: row.data.delflag || '' } - if (row.deptid && row.deptid !== '') { + if (row.deptId && row.deptId !== '') { this.fetchArea1() this.fetchArea2() this.loading = false @@ -420,7 +427,7 @@ }, // 获取区域1 fetchArea1() { - getAreaByDept(this.backpackForm.deptid).then(response => { + getAreaByDept(this.backpackForm.deptId).then(response => { if (response.code === 200) { const pid = response.data.area getAreaList(pid).then(response => { diff --git a/src/views/backpackManage/editBackpackInfo.vue b/src/views/backpackManage/editBackpackInfo.vue index dcfe763..41ba598 100644 --- a/src/views/backpackManage/editBackpackInfo.vue +++ b/src/views/backpackManage/editBackpackInfo.vue @@ -335,6 +335,7 @@ cancel: function() { this.dialogFormVisible = false this.$emit('watchChild') + // this.$emit('isShow') }, changeiot(val) { for (var i = 0; i < this.imeilist.length; i++) { diff --git a/src/views/backpackManage/listBackpack.vue b/src/views/backpackManage/listBackpack.vue index b4b211b..b685887 100644 --- a/src/views/backpackManage/listBackpack.vue +++ b/src/views/backpackManage/listBackpack.vue @@ -20,7 +20,8 @@ - + + 搜索 @@ -70,7 +71,7 @@ @@ -90,8 +91,8 @@ - - + + @@ -100,7 +101,7 @@ import editBackpackInfo from '@/views/backpackManage/editBackpackInfo' import detailBackpack from '@/views/backpackManage/detailBackpack' import SelectTree from '@/components/SelectTree/singleSelect' -import { getBackpackList, delBackpack, batchImportBackpack, batchExportBackpack } from '@/api/backpack' +import { getBackpackList, batchImportBackpack, batchExportBackpack, batchdelBackpack } from '@/api/backpack' import DeptSelect from '@/components/DeptSelect' import DownloadTemplate from '@/components/DownloadTemplate/index' @@ -109,11 +110,13 @@ components: { DownloadTemplate, SelectTree, addBackpack, detailBackpack, DeptSelect, editBackpackInfo }, data() { return { + dialogFormVisible: false, + deptShow: true, listQuery: { // keywords: '', description: '', backpackCode: '', - deptid: '', + deptId: '', offset: 1, limit: 20, sort: 'backpackCode', @@ -145,11 +148,11 @@ value: 'delflag', align: 'center' }, - { - text: '使用单位ID', - value: 'deptId', - align: 'center' - }, + // { + // text: '使用单位ID', + // value: 'deptId', + // align: 'center' + // }, { text: '使用单位', value: 'deptName', @@ -160,31 +163,31 @@ value: 'description', align: 'center' }, - { - text: '设备ID', - value: 'deviceId', - align: 'center' - }, - { - text: '电量编号', - value: 'electricCode', - align: 'center' - }, - { - text: 'id', - value: 'id', - align: 'center' - }, - { - text: 'imei', - value: 'imei', - align: 'center' - }, - { - text: 'iot', - value: 'iot', - align: 'center' - }, + // { + // text: '设备ID', + // value: 'deviceId', + // align: 'center' + // }, + // { + // text: '电量编号', + // value: 'electricCode', + // align: 'center' + // }, + // { + // text: 'id', + // value: 'id', + // align: 'center' + // }, + // { + // text: 'imei', + // value: 'imei', + // align: 'center' + // }, + // { + // text: 'iot', + // value: 'iot', + // align: 'center' + // }, { text: '液位编号', value: 'liquidCode', @@ -254,6 +257,10 @@ this.fetchData()// 获取数据 }, methods: { + changeShow(){ + this.dialogFormVisible =false + this.detailShow=false + }, // 打开详情对话框 detail(row) { const rowInfo = { data: row } @@ -269,14 +276,17 @@ }, // 新增背负式设备 add() { + console.log('add') // this.$router.push({ path: 'addBackpack', query: { type: 'create' }}) this.dialogStatus = true this.dialogFormVisible = true console.log(this.$refs.editBackpack.initDialog) this.$refs.editBackpack.initDialog('create', this.dialogFormVisible) + this.fetchData() }, // 编辑背负式设备信息 edit(row) { + console.log('edit') // this.dialogFormVisible = true // this.editShow = true // this.$refs.editbackpack.initDialog(this.dialogFormVisible, row) @@ -287,10 +297,11 @@ // 删除背负式设备 del() { if (this.checkSelection()) { - const backpackIds = [] + const backpackInfoIds = [] this.multipleSelection.forEach(function(value, index) { - backpackIds.push(value.id) + backpackInfoIds.push(value.id) }) + this.$confirm( '确定要删除所选背负式设备吗?', '确认操作', @@ -300,7 +311,7 @@ type: 'warning' } ).then(() => { - delBackpack(backpackIds).then(response => { + batchdelBackpack(backpackInfoIds).then(response => { if (response.code === 200) { this.$message.success('删除成功') this.fetchData() @@ -491,6 +502,8 @@ this.list = response.data.rows this.total = parseInt(response.data.total) this.listLoading = false + console.log(this.dialogFormVisible,"====弹框") + // this.dialogFormVisible=false }) }, fetchBackpackList() { diff --git a/src/views/car/listCarInfo.vue b/src/views/car/listCarInfo.vue index e03acab..c2bba13 100644 --- a/src/views/car/listCarInfo.vue +++ b/src/views/car/listCarInfo.vue @@ -83,7 +83,7 @@ listQuery: { description: '', carCode: '', - carType: '1,2', + carType: '', deptId: '', offset: 1, limit: 15