From bc0de4533221f17a65124f4812cad6290c2a8c93 Mon Sep 17 00:00:00 2001 From: lancer <1905818361@qq.com> Date: Wed, 10 Nov 2021 11:25:49 +0800 Subject: [PATCH] init --- src/api/modules/api.js | 8 ++++ src/views/Equipment/index.vue | 79 +++++++++++++++++++---------------- src/views/Equipment/state.vue | 10 ++--- vue.config.js | 2 +- 4 files changed, 57 insertions(+), 42 deletions(-) diff --git a/src/api/modules/api.js b/src/api/modules/api.js index 0d0ead5..c0d5e37 100644 --- a/src/api/modules/api.js +++ b/src/api/modules/api.js @@ -572,6 +572,14 @@ export function equipmentAdd(data) { data }) } +// 验收设备 +export function equipmentAcceptance(data) { + return request({ + url: 'autoSR/zk/equipment/acceptance', + method:'post', + data + }) +} // 归还设备 export function equipmentUnbind(data) { return request({ diff --git a/src/views/Equipment/index.vue b/src/views/Equipment/index.vue index 7366c6e..95ae9a3 100644 --- a/src/views/Equipment/index.vue +++ b/src/views/Equipment/index.vue @@ -367,37 +367,38 @@ 归还 - 转写方式 - 自动转写 验收 恢复正常 - 绑定 - 删除 @@ -1199,23 +1200,31 @@ export default { }); }, //验收 - acceptance() { + acceptance(row) { this.$confirm("确认验收吗?", "提示", { confirmButtonText: "确定", cancelButtonText: "取消", type: "warning", }) .then(() => { - this.$message({ - type: "success", - message: "验收成功!", - }); + this.$api.api + .equipmentAcceptance({ + imeis: row.imei, + }) + .then((res) => { + this.$message({ + type: "success", + message: "验收成功!", + }); + this.equipmentManagement(); + }); }) - .catch(() => { - this.$message({ - type: "info", - message: "已取消验收", - }); + .catch((err) => { + // this.$message({ + // type: "info", + // message: "已取消验收", + // }); + console.log(err); }); }, // 自动转写开关 @@ -1244,10 +1253,10 @@ export default { }); }) .catch(() => { - this.$message({ - type: "info", - message: "已取消", - }); + // this.$message({ + // type: "info", + // message: "已取消", + // }); }); }, // 转写开关 @@ -1278,10 +1287,10 @@ export default { }); }) .catch(() => { - this.$message({ - type: "info", - message: "已取消", - }); + // this.$message({ + // type: "info", + // message: "已取消", + // }); }); }, //归还 @@ -1305,10 +1314,10 @@ export default { }); }) .catch(() => { - this.$message({ - type: "info", - message: "已取消归还", - }); + // this.$message({ + // type: "info", + // message: "已取消归还", + // }); }); }, //删除 @@ -1332,10 +1341,10 @@ export default { }); }) .catch(() => { - this.$message({ - type: "info", - message: "已取消删除", - }); + // this.$message({ + // type: "info", + // message: "已取消删除", + // }); }); }, handleSizeChange(val) { diff --git a/src/views/Equipment/state.vue b/src/views/Equipment/state.vue index 037d8fd..184d33e 100644 --- a/src/views/Equipment/state.vue +++ b/src/views/Equipment/state.vue @@ -280,7 +280,7 @@ align="center" > @@ -330,11 +330,9 @@ diff --git a/vue.config.js b/vue.config.js index 87daeff..5a08e91 100644 --- a/vue.config.js +++ b/vue.config.js @@ -7,7 +7,7 @@ const url = 'http://39.97.167.65:9999' //测试 // const url = 'http://192.168.31.169:9999' //长龙 // const url = 'http://192.168.31.134:9999' //嘉豪 // const url = 'http://192.168.31.100:9999' //王笑 -// const url = 'http://jrcd6b.natappfree.cc' //王笑 +// const url = 'http://yuuapd.natappfree.cc' //王笑 const CompressionWebpackPlugin = require('compression-webpack-plugin') const productionGzipExtensions = ['js', 'css']