diff --git a/src/api/modules/api.js b/src/api/modules/api.js index 08bde12..d6eb60c 100644 --- a/src/api/modules/api.js +++ b/src/api/modules/api.js @@ -562,3 +562,28 @@ export function equipmentbind(data) { data }) } + +// 获取设备状态检测 +export function equipmentZxOn(data) { + return request({ + url: 'autoSR/zk/equipment/zxOn', + method:'post', + data + }) +} +// 设备删除 +export function equipmentZxOnDelete(query) { + return request({ + url: 'autoSR/zk/equipment/delete', + method:'get', + params:query + }) +} +// 设备状态监控列表 +export function equipmentZxOnFindByPage(data) { + return request({ + url: 'autoSR/zk/equipment/findByPage', + method:'post', + data + }) +} diff --git a/src/views/Equipment/index.vue b/src/views/Equipment/index.vue index d68b15b..0341f46 100644 --- a/src/views/Equipment/index.vue +++ b/src/views/Equipment/index.vue @@ -247,6 +247,25 @@ --> + + + + + + @@ -294,6 +313,7 @@ --> + 归还 + 转写方式 + 自动转写 绑定 - 修改 + 删除 @@ -578,6 +605,55 @@ 保存 + + + + + + + + + + + + + + + + + + @@ -690,6 +766,7 @@ export default { dialogVisible3: false, dialogVisible4: false, dialogVisible5: false, + receiveVisible: false, ruleForm: { areaName: "", provinceItem: [], @@ -710,6 +787,11 @@ export default { desc: "", acceptanceStatus: "0", }, + receiveForm: {}, + receiveRules: { + houseId: [{ required: true, message: "请选择楼盘", trigger: "blur" }], + batchId: { required: true, message: "请选择顾问", trigger: "blur" }, + }, addRules: { imei: [{ required: true, message: "请填写设备号", trigger: "blur" }], batchId: { required: true, message: "请选择批次号", trigger: "blur" }, @@ -747,6 +829,12 @@ export default { console.log(row); this[e](row); }, + receive(row) { + this.receiveVisible = true; + // this.bindForm.imeis = row.imei; + }, + saveReceive() {}, + resetReceive() {}, selChange() { this.changeValue = ""; this.searchForm.imei = ""; @@ -862,13 +950,13 @@ export default { this.$refs.allbindForm.validate((valid) => { if (valid) { console.log(this.bindForm); - let arr=[] - this.multipleSelection.map(item=>arr.push(item.imei)) - let obj={ - houseId:this.bindForm.houseId, - orgCode:this.bindForm.orgCode, - imeis:arr.join(',') - } + let arr = []; + this.multipleSelection.map((item) => arr.push(item.imei)); + let obj = { + houseId: this.bindForm.houseId, + orgCode: this.bindForm.orgCode, + imeis: arr.join(","), + }; this.$api.api.equipmentbind(obj).then((res) => { console.log(res); this.$message.success("绑定成功"); @@ -1030,6 +1118,38 @@ export default { }); }); }, + // 自动转写开关 + isAutoSwitch(row) { + this.$confirm( + `确认${row.autoSwitch == 0 ? "开启" : "关闭"}自动转写?`, + "提示", + { + confirmButtonText: "确定", + cancelButtonText: "取消", + type: "warning", + } + ) + .then(() => { + this.$api.api + .equipmentZxOn({ + id: row.id, + autoSwitch: row.autoSwitch == 0 ? 1 : 0, + }) + .then((res) => { + this.$message({ + type: "success", + message: "修改成功!", + }); + this.equipmentManagement(); + }); + }) + .catch(() => { + this.$message({ + type: "info", + message: "已取消", + }); + }); + }, // 转写开关 infotranscription(row) { this.$confirm( @@ -1045,7 +1165,7 @@ export default { ) .then(() => { this.$api.api - .equipmentUnbind({ + .updateTranslationMethod({ id: row.id, defaultTransliteration: row.defaultTransliteration == 0 ? 1 : 0, }) @@ -1092,17 +1212,24 @@ export default { }); }, //删除 - toinifodelete() { + toinifodelete(row) { this.$confirm("此操作将永久删除, 是否继续?", "提示", { confirmButtonText: "确定", cancelButtonText: "取消", type: "warning", }) .then(() => { - this.$message({ - type: "success", - message: "删除成功!", - }); + this.$api.api + .equipmentZxOnDelete({ + id: row.id, + }) + .then((res) => { + this.$message({ + type: "success", + message: "删除成功!", + }); + this.equipmentManagement(); + }); }) .catch(() => { this.$message({ diff --git a/src/views/Equipment/state.vue b/src/views/Equipment/state.vue index 0c29d61..d199af9 100644 --- a/src/views/Equipment/state.vue +++ b/src/views/Equipment/state.vue @@ -1,42 +1,189 @@ @@ -179,79 +348,256 @@ export default { label: "离线", }, ], - currentPage4:4, - value: "", - input: "", - tableData: [ + onlineList: [ + { + value: "0", + label: "在线", + }, + { + value: "1", + label: "离线", + }, + ], + audioStatusList: [ + { + value: true, + label: "开启", + }, + { + value: false, + label: "关闭", + }, + ], + uploadStatusList: [ { - date: "2016-05-03", - name: "王小虎", - address: " 1518 弄", + value: true, + label: "无上传", }, { - date: "2016-05-02", - name: "王小虎", - address: " 1518 弄", + value: false, + label: "上传中", }, + ], + equipmentStatusList: [ { - date: "2016-05-04", - name: "王小虎", - address: " 1518 弄", + value: "0", + label: "已验收", }, { - date: "2016-05-01", - name: "王小虎", - address: " 1518 弄", + value: "1", + label: "未验收", }, { - date: "2016-05-08", - name: "王小虎", - address: " 1518 弄", + value: "2", + label: "维修中", }, { - date: "2016-05-06", - name: "王小虎", - address: " 1518 弄", + value: "3", + label: "更换中", }, { - date: "2016-05-07", - name: "王小虎", - address: " 1518 弄", + value: "4", + label: "已报损", }, ], - multipleSelection:[], - + offStatusList: [ + { + value: "1", + label: "正常关机", + }, + { + value: "2", + label: "低电关机", + }, + { + value: "3", + label: "异常关机", + }, + ], + receiveTypeList: [ + { + value: "1", + label: "未领用", + }, + { + value: "2", + label: "使用中", + }, + { + value: "3", + label: "已归还", + }, + ], + options1: [], + houseList: [], + searchForm: { + name: "", + imei: "", //设备号 + batchId: "", //批次号 + // equipmentType: "", //设备类型 + receiveType: "", //领用状态 + defaultTransliteration: "", //转写方式 + startDate: "", //开始时间 + endDate: "", //结束时间 + agentName: "", //代理商名称 + orgName: "", //公司名称 + houseName: "", //楼盘名称 + acceptanceStatus: "", //设备状态 + audioStatus: "", //录音状态 + uploadStatus: "", //上传状态 + offStatus: "", //关机状态 + online: "", + }, + receiveForm: {}, + receiveRules: {}, + addRules: { + houseId: [{ required: true, message: "请选择楼盘", trigger: "blur" }], + batchId: { required: true, message: "请选择顾问", trigger: "blur" }, + }, + receiveVisible: false, + currentPage: 1, + size: 10, + total: 10, + value: "", + input: "", + time: [], + selflag: "1", + changeValue: "", + tableData: [], + multipleSelection: [], }; }, - mounted() {}, + mounted() { + this.getTableList(); + }, methods: { - //批量归还 - toinifoThereturn(){ - this.$confirm('确认更改吗?', '提示', { - confirmButtonText: '确定', - cancelButtonText: '取消', - type: 'warning' - }).then(() => { - this.$message({ - type: 'success', - message: '更改成功!' + getTableList() { + this.$api.api + .equipmentZxOnFindByPage({ + size: this.size, + current: this.currentPage, + orgType: localStorage.getItem("orgType"), + orgCode: localStorage.getItem("orgCode"), + agentId: localStorage.getItem("agentId"), + houseId: localStorage.getItem("houseId"), + ...this.searchForm, + }) + .then((res) => { + // console.log(res); + this.tableData = res.data.records; + this.total = res.data.total; }); - }).catch(() => { - this.$message({ - type: 'info', - message: '更改归还' + }, + receive(row) { + this.receiveVisible = true; + // this.bindForm.imeis = row.imei; + }, + saveReceive() {}, + resetReceive() {}, + handleCommand(e, row) { + console.log(row); + this[e](row); + }, + //归还 + toinifoThereturn(row) { + this.$confirm("确认归还吗?", "提示", { + confirmButtonText: "确定", + cancelButtonText: "取消", + type: "warning", + }) + .then(() => { + this.$api.api + .equipmentUnbind({ + imeis: row.imei, + }) + .then((res) => { + this.$message({ + type: "success", + message: "归还成功!", + }); + this.equipmentManagement(); + }); + }) + .catch(() => { + this.$message({ + type: "info", + message: "已取消归还", + }); }); - }); }, - handleSelectionChange(val) { - this.multipleSelection = val; - }, - handleSizeChange(val) { - console.log(`每页 ${val} 条`); - }, - handleCurrentChange(val) { - console.log(`当前页: ${val}`); + timeChange(e) { + if (e) { + this.searchForm.startDate = e[0]; + this.searchForm.endDate = e[1]; + } + }, + selChange() { + this.changeValue = ""; + this.searchForm.imei = ""; + this.searchForm.batchId = ""; + this.searchForm.agentName = ""; + this.searchForm.orgName = ""; + this.searchForm.houseName = ""; + }, + selectChange(e) { + this.searchForm.imei = ""; + this.searchForm.batchId = ""; + this.searchForm.agentName = ""; + this.searchForm.orgName = ""; + this.searchForm.houseName = ""; + if (!e) retun; + if (this.selflag == 1) { + // 设备编号 + this.searchForm.imei = e; + } + if (this.selflag == 3) { + // 批次号 + this.searchForm.batchId = e; } + if (this.selflag == 4) { + // 代理商名称 + this.searchForm.agentName = e; + } + if (this.selflag == 5) { + // 公司名称 + this.searchForm.orgName = e; + } + if (this.selflag == 6) { + // 楼盘名称 + this.searchForm.houseName = e; + } + }, + //批量归还 + toinifoThereturn() { + this.$confirm("确认更改吗?", "提示", { + confirmButtonText: "确定", + cancelButtonText: "取消", + type: "warning", + }) + .then(() => { + this.$message({ + type: "success", + message: "更改成功!", + }); + }) + .catch(() => { + this.$message({ + type: "info", + message: "更改归还", + }); + }); + }, + handleSelectionChange(val) { + this.multipleSelection = val; + }, + handleSizeChange(val) { + console.log(`每页 ${val} 条`); + this.size = val; + }, + handleCurrentChange(val) { + console.log(`当前页: ${val}`); + this.currentPage = val; + }, }, }; @@ -263,15 +609,15 @@ export default { min-width: 1200px; padding-bottom: 100px; } -.tongji{ +.tongji { padding-bottom: 10px; font-size: 16px; color: red; } -.cen-tab{ +.cen-tab { width: 100%; padding: 15px; - background: #FFFFFF; + background: #ffffff; margin-top: 15px; } .tophove { @@ -289,12 +635,14 @@ export default { width: 100%; display: flex; align-items: center; + flex-wrap: wrap; .label { font-size: 14px; font-weight: 400; color: #32363d; - line-height: 14px; + line-height: 32px; margin-left: 15px; + min-width: 100px; } .toptimeqhuan { height: 30px; @@ -314,4 +662,11 @@ export default { } } } +.div-lab { + display: flex; + margin: 5px; +} +.div-inp { + width: 250px; +} diff --git a/vue.config.js b/vue.config.js index 1d69475..367e9d3 100644 --- a/vue.config.js +++ b/vue.config.js @@ -4,8 +4,8 @@ */ // const url = 'http://pigx-gateway' // const url = 'http://39.97.167.65:9999' //测试 -const url = 'http://192.168.31.160:9999' //长龙 -// const url = 'http://192.168.31.129:9999' //嘉豪 +// const url = 'http://192.168.31.160:9999' //长龙 +const url = 'http://192.168.31.133:9999' //嘉豪 // const url = 'http://192.168.31.100:9999' //王笑 const CompressionWebpackPlugin = require('compression-webpack-plugin')