Browse Source

init

newStyle
lancer 2 years ago
parent
commit
e88eb5a5f8
4 changed files with 245 additions and 76 deletions
  1. +8
    -0
      src/api/modules/api.js
  2. +208
    -53
      src/views/Equipment/index.vue
  3. +26
    -23
      src/views/admin/log/index.vue
  4. +3
    -0
      src/views/admin/log/log.vue

+ 8
- 0
src/api/modules/api.js View File

@@ -554,3 +554,11 @@ export function updateTranslationMethod(data) {
data
})
}
// 绑定
export function equipmentbind(data) {
return request({
url: 'autoSR/zk/equipment/bind',
method:'post',
data
})
}

+ 208
- 53
src/views/Equipment/index.vue View File

@@ -21,17 +21,19 @@

<div class="div-lab">
<el-input
v-model="searchForm.name"
v-model="changeValue"
clearable
placeholder="请输入"
@change="selectChange"
style="width: 363px"
>
<el-select
v-model="searchForm.flag"
v-model="selflag"
slot="prepend"
class="input-with-select"
style="width: 115px"
placeholder="请选择"
@change="selChange"
>
<el-option label="设备编号" value="1"></el-option>
<!-- <el-option label="版本号" value="2"></el-option> -->
@@ -47,7 +49,6 @@
<div class="label">设备状态</div>
<el-select
class="div-inp"
multiple
clearable
collapse-tags
v-model="searchForm.acceptanceStatus"
@@ -87,7 +88,6 @@
<div class="label">领用状态</div>
<el-select
class="div-inp"
multiple
clearable
collapse-tags
v-model="searchForm.receiveType"
@@ -166,12 +166,10 @@
<div class="app-titel" style="margin-top: 15px">
<!-- <div class="label" style="color: #ffffff">筛选相关:</div> -->
<div style="margin-left: 20px">
<el-button style="background: #2671e2; color: #ffffff"
>筛选</el-button
>
<el-button type="primary" @click="screen">筛选</el-button>
</div>
<div style="margin-left: 20px">
<el-button>清空筛选条件</el-button>
<el-button @click="reset">清空筛选条件</el-button>
</div>
</div>
<div class="app-titel" style="margin-top: 15px">
@@ -179,30 +177,29 @@
<div style="margin-left: 20px">
<el-button
@click="Batchreturn()"
style="background: #2671e2; color: #ffffff"
type="primary"
:disabled="multipleSelection.length == 0"
>批量归还</el-button
>
</div>
<div style="margin-left: 20px">
<el-button
@click="infoMasstransfer()"
style="background: #2671e2; color: #ffffff"
type="primary"
:disabled="multipleSelection.length == 0"
>批量转移</el-button
>
</div>
<div style="margin-left: 20px">
<el-button
@click="infoBulkbinding()"
style="background: #2671e2; color: #ffffff"
type="primary"
:disabled="multipleSelection.length == 0"
>批量绑定批次号</el-button
>
</div>
<div style="margin-left: 20px">
<el-button
@click="infoadd()"
style="background: #2671e2; color: #ffffff"
>添加</el-button
>
<el-button @click="infoadd()" type="primary">添加</el-button>
</div>
</div>
</div>
@@ -227,11 +224,11 @@
</el-table-column>
<el-table-column prop="orgName" label="公司" align="center">
</el-table-column>
<el-table-column prop="propertyName" label="楼盘" align="center">
<el-table-column prop="houseName" label="楼盘" align="center">
</el-table-column>
<el-table-column prop="accountName" label="领用人" align="center">
<el-table-column prop="userName" label="领用人" align="center">
</el-table-column>
<el-table-column prop="accountPhone" label="领用人手机" align="center">
<el-table-column prop="userPhone" label="领用人手机" align="center">
</el-table-column>
<el-table-column prop="receiveType" label="领用状态" align="center">
<template slot-scope="{ row }">
@@ -313,13 +310,13 @@
width="150"
>
</el-table-column>
<el-table-column
<!-- <el-table-column
prop="name"
label="绑定代理时间"
align="center"
width="150"
>
</el-table-column>
</el-table-column> -->
<!-- scope -->
<el-table-column label="操作" align="center" fixed="right" width="200">
<template slot-scope="{ row }">
@@ -355,7 +352,7 @@
v-if="row.acceptanceStatus != (1 || 0)"
>恢复正常</el-dropdown-item
>
<el-dropdown-item command="toinfobinding"
<el-dropdown-item command="toinfobinding" v-if="orgType == 0"
>绑定</el-dropdown-item
>
<el-dropdown-item command="infoeditor">修改</el-dropdown-item>
@@ -381,7 +378,11 @@
</div>
</div>

<el-dialog title="新增设备" :visible.sync="dialogVisible">
<el-dialog
title="新增设备"
:visible.sync="dialogVisible"
@close="resetImei"
>
<el-form
:model="addForm"
label-position="labelPosition"
@@ -466,24 +467,27 @@
</div>
</el-dialog>

<el-dialog title="绑定" :visible.sync="dialogVisible3">
<el-dialog title="绑定" :visible.sync="dialogVisible3" @close="resetBind">
<el-form
:model="bindForm"
label-position="labelPosition"
ref="bindForm"
:rules="bindRules"
label-width="100px"
>
<el-form-item label="绑定" prop="choic">
<!-- <el-form-item label="绑定" prop="choic">
<el-radio-group v-model="bindForm.choic">
<el-radio label="3">楼盘</el-radio>
<el-radio label="6">代理商</el-radio>
</el-radio-group>
</el-form-item>
</el-form-item> -->
<el-form-item label="楼盘" prop="houseId">
<el-select
filterable
v-model="bindForm.houseId"
style="width: 80%"
placeholder="请选择"
@change="houseChange"
>
<el-option
v-for="item in houseList"
@@ -509,21 +513,24 @@
</div>
</el-dialog>

<el-dialog title="批量绑定批次号" :visible.sync="dialogVisible4">
<el-dialog
title="批量绑定批次号"
width="40%"
:visible.sync="dialogVisible4"
>
<el-form
:model="ruleForm"
label-position="labelPosition"
ref="ruleForm"
label-width="140px"
style="width: 60%; margin: 0 auto"
>
<el-form-item label="批次号:" prop="areaName">
<el-select v-model="value" placeholder="请选择">
<el-form-item label="批次号" prop="batchId">
<el-select v-model="value" style="width: 80%" placeholder="请选择">
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value"
v-for="item in batchList"
:key="item.id"
:label="item.batchId"
:value="item.batchId"
>
</el-option>
</el-select>
@@ -535,21 +542,32 @@
</div>
</el-dialog>

<el-dialog title="批量转移" :visible.sync="dialogVisible5">
<el-dialog
title="批量转移"
width="40%"
:visible.sync="dialogVisible5"
@close="resetBind"
>
<el-form
:model="ruleForm"
:model="bindForm"
label-position="labelPosition"
ref="ruleForm"
ref="allbindForm"
:rules="bindRules"
label-width="140px"
style="width: 60%; margin: 0 auto"
>
<el-form-item label="楼盘:" prop="areaName">
<el-select v-model="value" placeholder="请选择">
<el-form-item label="楼盘" prop="houseId">
<el-select
filterable
v-model="bindForm.houseId"
style="width: 80%"
placeholder="请选择"
@change="houseChange"
>
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value"
v-for="item in houseList"
:key="item.id"
:label="item.propertyName"
:value="item.id"
>
</el-option>
</el-select>
@@ -568,6 +586,8 @@ export default {
data() {
return {
time: [],
changeValue: "",
selflag: "1",
searchForm: {
name: "",
imei: "", //设备号
@@ -661,6 +681,7 @@ export default {
total: 10,
value: "",
input: "",
orgType: localStorage.getItem("orgType"),
tableData: [],
houseList: [],
batchList: [],
@@ -682,7 +703,7 @@ export default {
bindForm: {
remark: "",
houseId: "",
choic: "3",
// choic: "3",
},
editForm: {
imei: "123",
@@ -693,6 +714,9 @@ export default {
imei: [{ required: true, message: "请填写设备号", trigger: "blur" }],
batchId: { required: true, message: "请选择批次号", trigger: "blur" },
},
bindRules: {
houseId: [{ required: true, message: "请选择楼盘", trigger: "blur" }],
},
multipleSelection: [],
customColors: [
{ color: "#f56c6c", percentage: 20 },
@@ -723,11 +747,96 @@ export default {
console.log(row);
this[e](row);
},
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;
}
},
reset() {
this.searchForm = {
name: "",
imei: "", //设备号
batchId: "", //批次号
// equipmentType: "", //设备类型
receiveType: "", //领用状态
defaultTransliteration: "", //转写方式
startDate: "", //开始时间
endDate: "", //结束时间
agentName: "", //代理商名称
orgName: "", //公司名称
houseName: "", //楼盘名称
acceptanceStatus: "", //设备状态
audioStatus: "", //录音状态
uploadStatus: "", //上传状态
offStatus: "", //关机状态
};
},
resetImei() {
this.addForm = {
imei: "",
// defaultTransliteration: "",
batchId: "",
remark: "",
};
},
resetBind() {
this.bindForm = {
remark: "",
houseId: "",
};
},
houseChange(e) {
console.log(e);
let idx = this.houseList.findIndex((item) => item.id == e);
if (idx != -1) {
this.bindForm.orgCode = this.houseList[idx].orgCode;
}
},
screen() {
this.currentPage = 1;
console.log(this.searchForm);
this.equipmentManagement();
},
equipmentManagement() {
this.$api.api
.equipmentManagement({
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) => {
@@ -750,9 +859,31 @@ export default {
},
//批量转移确认
Masstransfer() {
this.dialogVisible5 = false;
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(',')
}
this.$api.api.equipmentbind(obj).then((res) => {
console.log(res);
this.$message.success("绑定成功");
this.equipmentManagement();
this.dialogVisible5 = false;
});
}
});
},
timeChange(e) {
if (e) {
this.searchForm.startDate = e[0];
this.searchForm.endDate = e[1];
}
},
timeChange() {},
//批量归还
Batchreturn() {
this.$confirm("确认批量归还吗?", "提示", {
@@ -761,10 +892,23 @@ export default {
type: "warning",
})
.then(() => {
this.$message({
type: "success",
message: "批量归还成功!",
let str = [];
this.multipleSelection.map((item) => {
if (item.receiveType == 2) {
str.push(item.imei);
}
});
this.$api.api
.equipmentUnbind({
imeis: str.join(","),
})
.then((res) => {
this.$message({
type: "success",
message: "批量归还成功!",
});
this.equipmentManagement();
});
})
.catch(() => {
this.$message({
@@ -774,18 +918,29 @@ export default {
});
},
handleSelectionChange(val) {
// this.multipleSelection = [];
// val.map((item) => {
// this.multipleSelection.push(item.id);
// });
this.multipleSelection = val;
console.log(this.multipleSelection);
},
//绑定
toinfobinding() {
toinfobinding(row) {
this.dialogVisible3 = true;
this.bindForm.imeis = row.imei;
},
//确认绑定
binding() {
this.$refs.bindForm.validate((valid) => {
if (valid) {
console.log(this.bindForm);
this.dialogVisible3 = false;
this.$api.api.equipmentbind(this.bindForm).then((res) => {
console.log(res);
this.$message.success("绑定成功");
this.equipmentManagement();
this.dialogVisible3 = false;
});
}
});
},
@@ -919,7 +1074,7 @@ export default {
.then(() => {
this.$api.api
.equipmentUnbind({
id: row.id,
imeis: row.imei,
})
.then((res) => {
this.$message({


+ 26
- 23
src/views/admin/log/index.vue View File

@@ -22,7 +22,7 @@
<div class="div-lab">
<el-input
v-model="value"
@change='valueChange'
@change="valueChange"
clearable
placeholder="请输入"
style="width: 363px"
@@ -134,28 +134,31 @@ export default {
methods: {
selChange(e) {
this.value = "";
this.searchForm.name = "";
this.searchForm.params = "";
this.searchForm.remoteAddr = "";
},
valueChange(e){
if(e){
if (this.searchForm.flag == 1) {
// 用户名称
this.searchForm.name = this.value;
// this.value = "";
this.searchForm.params = "";
this.searchForm.remoteAddr = "";
} else if (this.searchForm.flag == 2) {
// 登陆手机
this.searchForm.params = this.value;
// this.value = "";
this.searchForm.name = "";
this.searchForm.remoteAddr = "";
} else {
// 登陆Ip
this.searchForm.remoteAddr = this.value;
// this.value = "";
this.searchForm.params = "";
this.searchForm.name = "";
}
valueChange(e) {
if (e) {
if (this.searchForm.flag == 1) {
// 用户名称
this.searchForm.name = this.value;
// this.value = "";
this.searchForm.params = "";
this.searchForm.remoteAddr = "";
} else if (this.searchForm.flag == 2) {
// 登陆手机
this.searchForm.params = this.value;
// this.value = "";
this.searchForm.name = "";
this.searchForm.remoteAddr = "";
} else {
// 登陆Ip
this.searchForm.remoteAddr = this.value;
// this.value = "";
this.searchForm.params = "";
this.searchForm.name = "";
}
}
},
screen() {
@@ -188,7 +191,7 @@ export default {
orgType: localStorage.getItem("orgType"),
orgCode: localStorage.getItem("orgCode"),
agentId: localStorage.getItem("agentId"),
houseId:localStorage.getItem("houseId"),
houseId: localStorage.getItem("houseId"),
},
params,
this.searchForm


+ 3
- 0
src/views/admin/log/log.vue View File

@@ -133,6 +133,9 @@ export default {
methods: {
selChange(e) {
this.value = "";
this.searchForm.name = "";
this.searchForm.params = "";
this.searchForm.remoteAddr = "";
},
valueChange(e) {
if (e) {


Loading…
Cancel
Save