diff --git a/src/api/modules/api.js b/src/api/modules/api.js
index dfdbdab..e9ee38b 100644
--- a/src/api/modules/api.js
+++ b/src/api/modules/api.js
@@ -523,9 +523,33 @@ export function zkequipmentbatchList(query) {
}
// 添加设备
-export function zkequipmentbatchInsert(data) {
+export function equipmentAdd(data) {
return request({
- url: '/autoSR/zkequipmentbatch/insert',
+ url: 'autoSR/zk/equipment/add',
+ method:'post',
+ data
+ })
+}
+// 归还设备
+export function equipmentUnbind(data) {
+ return request({
+ url: 'autoSR/zk/equipment/unbind',
+ method:'post',
+ data
+ })
+}
+// 恢复正常
+export function backToNormal(data) {
+ return request({
+ url: 'autoSR/zk/equipment/backToNormal',
+ method:'post',
+ data
+ })
+}
+//转写方式修改
+export function updateTranslationMethod(data) {
+ return request({
+ url: 'autoSR/zk/equipment/updateTranslationMethod',
method:'post',
data
})
diff --git a/src/views/Equipment/equipmentOnlineRecordList.vue b/src/views/Equipment/equipmentOnlineRecordList.vue
index add08d3..8e23dd5 100644
--- a/src/views/Equipment/equipmentOnlineRecordList.vue
+++ b/src/views/Equipment/equipmentOnlineRecordList.vue
@@ -310,7 +310,7 @@ export default {
};
},
mounted() {
- return
+ // return
let theRequest=this.$route.query
console.log(theRequest, "123"); //此时的theRequest就是我们需要的参数;
if (theRequest.houseId) {
@@ -378,6 +378,7 @@ export default {
},
goinfo(row) {
console.log(row);
+ return
location.href = "${jypath}/zk/file/receptionDetails";
localStorage.setItem("AudioListId", row.id);
localStorage.setItem("AudioIdx", 0);
@@ -419,14 +420,14 @@ export default {
//获取楼盘数据
getHouseList() {
axios({
- url: `${jypath}/equipment/onlinerecord/findAllProperties`,
+ url: `/autoSR/zkhouse/findHouseByUser?orgType=0`,
method: "get",
}).then((res) => {
// console.log(res.data.obj)
- if (res.data.res == 1) {
- this.houseList = res.data.obj;
+
+ this.houseList = res.data;
if (!this.flag) {
- this.page.houseName = res.data.obj[0].id;
+ this.page.houseName = res.data[0].id;
}
this.getTableList();
// res.data.obj.results.forEach((item,index)=>{
@@ -434,7 +435,7 @@ export default {
// })
// this.tableData=res.data.obj.results;
// this.page.total = res.data.obj.totalRecord;
- }
+
});
},
//获取table数据、
@@ -448,13 +449,13 @@ export default {
};
this.tableData = [];
if (this.activeTotal == 0) {
- url = `${jypath}/equipment/onlinerecord/findByPage`;
+ url = `autoSR/zk/equipment/onlineRecordList`;
obj.openTime = this.page.openTime;
obj.closeTime = this.page.closeTime;
obj.houseId = this.page.houseName;
obj.accountName = this.page.accountName;
} else {
- url = `${jypath}/equipment/onlinerecord/assignmentRecord`;
+ url = `autoSR/zk/equipment/assignmentRecordList`;
obj.staDate = this.page.openTime;
obj.endDate = this.page.closeTime;
obj.projectId = this.page.houseName;
@@ -463,18 +464,18 @@ export default {
}
axios({
url: url,
- method: "post",
- data: obj,
+ method: "get",
+ params: obj,
}).then((res) => {
// console.log(res)
- if (res.data.res == 1) {
- if (!res.data.obj.results) return;
- res.data.obj.results.forEach((item, index) => {
+
+ if (!res.data.records) return;
+ res.data.records.forEach((item, index) => {
item.index = index + 1;
});
- this.tableData = res.data.obj.results;
- this.page.total = res.data.obj.totalRecord;
- }
+ this.tableData = res.data.records;
+ this.page.total = res.data.total;
+
});
},
},
diff --git a/src/views/Equipment/index.vue b/src/views/Equipment/index.vue
index c110444..1a5833d 100644
--- a/src/views/Equipment/index.vue
+++ b/src/views/Equipment/index.vue
@@ -102,7 +102,7 @@
-
-
+
- {{row.acceptanceStatus==0?'已验收':row.acceptanceStatus==1?'未验收':row.acceptanceStatus==2?'维修中':row.acceptanceStatus==3?'维修中':'已报损'}}
+ {{
+ row.acceptanceStatus == 0
+ ? "已验收"
+ : row.acceptanceStatus == 1
+ ? "未验收"
+ : row.acceptanceStatus == 2
+ ? "维修中"
+ : row.acceptanceStatus == 3
+ ? "维修中"
+ : "已报损"
+ }}
@@ -277,18 +297,33 @@
-->
-
+
-
+
-
+
- 归还
+
-
+
更多
- 归还
转写开关转写方式
+ 验收
+ 恢复正常
- 验收
绑定
@@ -361,7 +407,7 @@
>
@@ -402,7 +448,11 @@
报损
-
+
{
+ zkequipmentbatchList() {
+ this.$api.api.zkequipmentbatchList().then((res) => {
// console.log(res)
- this.batchList=res.data
- })
+ this.batchList = res.data;
+ });
},
- handleCommand(e) {
- this[e]();
+ handleCommand(e, row) {
+ console.log(row);
+ this[e](row);
},
equipmentManagement() {
this.$api.api
@@ -769,10 +819,42 @@ export default {
this.$refs.addForm.validate((valid) => {
if (valid) {
console.log(this.addForm);
- // this.dialogVisible = false;
+ this.$api.api.equipmentAdd(this.addForm).then((res) => {
+ console.log(res);
+ this.$message.success("添加成功");
+ this.dialogVisible = false;
+ this.equipmentManagement();
+ });
}
});
},
+ // 回复正常
+ getRight(row) {
+ this.$confirm("确认恢复么?", "提示", {
+ confirmButtonText: "确定",
+ cancelButtonText: "取消",
+ type: "warning",
+ })
+ .then(() => {
+ this.$api.api
+ .backToNormal({
+ id: row.id,
+ })
+ .then((res) => {
+ this.$message({
+ type: "success",
+ message: "成功!",
+ });
+ this.equipmentManagement();
+ });
+ })
+ .catch(() => {
+ this.$message({
+ type: "info",
+ message: "已取消",
+ });
+ });
+ },
//验收
acceptance() {
this.$confirm("确认验收吗?", "提示", {
@@ -794,17 +876,31 @@ export default {
});
},
// 转写开关
- infotranscription() {
- this.$confirm("确认开启或关闭吗?", "提示", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning",
- })
+ infotranscription(row) {
+ this.$confirm(
+ `确认修改转写方式为${
+ row.defaultTransliteration == 0 ? "思必驰" : "科大讯飞"
+ }?`,
+ "提示",
+ {
+ confirmButtonText: "确定",
+ cancelButtonText: "取消",
+ type: "warning",
+ }
+ )
.then(() => {
- this.$message({
- type: "success",
- message: "成功!",
- });
+ this.$api.api
+ .equipmentUnbind({
+ id: row.id,
+ defaultTransliteration: row.defaultTransliteration == 0 ? 1 : 0,
+ })
+ .then((res) => {
+ this.$message({
+ type: "success",
+ message: "修改成功!",
+ });
+ this.equipmentManagement();
+ });
})
.catch(() => {
this.$message({
@@ -814,17 +910,24 @@ export default {
});
},
//归还
- toinifoThereturn() {
+ toinifoThereturn(row) {
this.$confirm("确认归还吗?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
- this.$message({
- type: "success",
- message: "归还成功!",
- });
+ this.$api.api
+ .equipmentUnbind({
+ id: row.id,
+ })
+ .then((res) => {
+ this.$message({
+ type: "success",
+ message: "归还成功!",
+ });
+ this.equipmentManagement();
+ });
})
.catch(() => {
this.$message({