From 3ab293fc3c9fed67759cd69b0642a21eb796c5d3 Mon Sep 17 00:00:00 2001 From: lancer <1905818361@qq.com> Date: Mon, 11 Oct 2021 15:21:59 +0800 Subject: [PATCH] init --- src/api/modules/api.js | 17 + src/page/check/chose.vue | 63 +- src/views/Equipment/index.vue | 1031 ++++++++++++++++++++------------- 3 files changed, 691 insertions(+), 420 deletions(-) diff --git a/src/api/modules/api.js b/src/api/modules/api.js index 39299b2..61aed5d 100644 --- a/src/api/modules/api.js +++ b/src/api/modules/api.js @@ -480,3 +480,20 @@ export function lifeTrackDefineAdd(data) { }) } + +// 设备列表 +export function equipmentManagement(query) { + return request({ + url: 'autoSR/zk/equipment/equipmentManagement', + method:'get', + params:query + }) +} + +export function findByUserName(query) { + return request({ + url: 'admin/user/findByUserName', + method:'post', + params:query + }) +} diff --git a/src/page/check/chose.vue b/src/page/check/chose.vue index 41e1f8d..f4f2ce3 100644 --- a/src/page/check/chose.vue +++ b/src/page/check/chose.vue @@ -223,7 +223,7 @@ export default { }, flag: 1, provice: [], - area:'', + area: "", provinceId: "", //省id cityId: "", //市id currentPage: 1, @@ -242,7 +242,7 @@ export default { this.flag = this.$route.query.flag; // 获取用户信息 this.info = getStore({ name: "userInfo" }); - + // this.info.selectHouseType=1 // 获取数据 if (this.flag == 1) { // 获取代理商 @@ -252,10 +252,7 @@ export default { // 获取公司 this.getCompanyList(); } else { - // 获取楼盘 - this.zkhousePage(); - // 获取区域列表 - this.findArea() + this.findByUserName(); } }, computed: {}, @@ -274,6 +271,20 @@ export default { this.total = res.data.total; }); }, + findByUserName() { + this.$api.api + .findByUserName({ + managerPhone: this.info.username, + }) + .then((res) => { + // console.log(res); + this.info.selectHouseType=res.selectHouseType + // 获取楼盘 + this.zkhousePage(); + // 获取区域列表 + this.findArea(); + }); + }, getCompanyList() { this.$api.api .zkorg({ @@ -288,12 +299,11 @@ export default { this.total = res.data.total; }); }, - findArea(){ - this.$api.api.findArea() - .then(res=>{ - console.log(res) - this.options=res.data.records - }) + findArea() { + this.$api.api.findArea().then((res) => { + console.log(res); + this.options = res.data.records; + }); }, zkhousePage() { let obj = { @@ -301,23 +311,24 @@ export default { size: this.size, propertyName: this.propertyName, }; - if(this.info.selectHouseType == 1){ + if (this.info.selectHouseType == 1) { this.$api.api.zkhousePage(obj).then((res) => { - // console.log(res) - this.list = res.data.records; - this.total = res.data.total; - }); + // console.log(res) + this.list = res.data.records; + this.total = res.data.total; + }); } - if(this.info.selectHouseType == 2){ - this.$api.api.findHouseByArea({ - id:this.area - }).then((res) => { - // console.log(res) - this.list = res.data.records; - this.total = res.data.total; - }); + if (this.info.selectHouseType == 2) { + this.$api.api + .findHouseByArea({ + id: this.area, + }) + .then((res) => { + // console.log(res) + this.list = res.data.records; + this.total = res.data.total; + }); } - }, chose(item) { console.log(item); diff --git a/src/views/Equipment/index.vue b/src/views/Equipment/index.vue index e35db47..4edca3c 100644 --- a/src/views/Equipment/index.vue +++ b/src/views/Equipment/index.vue @@ -1,16 +1,170 @@ @@ -322,214 +494,285 @@ export default { data() { return { - options: [ + time: [], + searchForm: { + name: "", + imei: "", //设备号 + batchId: "", //批次号 + // equipmentType: "", //设备类型 + receiveType: "", //领用状态 + defaultTransliteration: "", //转写方式 + startDate: "", //开始时间 + endDate: "", //结束时间 + agentName: "", //代理商名称 + orgName: "", //公司名称 + houseName: "", //楼盘名称 + acceptanceStatus: "", //设备状态 + audioStatus: "", //录音状态 + uploadStatus: "", //上传状态 + offStatus: "", //关机状态 + }, + options: [], + audioStatusList: [ + { + value: true, + label: "开启", + }, + { + value: false, + label: "关闭", + }, + ], + uploadStatusList: [ + { + value: true, + label: "无上传", + }, + { + value: false, + label: "上传中", + }, + ], + equipmentStatusList: [ + { + value: "0", + label: "已验收", + }, { value: "1", - label: "全部", + label: "未验收", }, { value: "2", - label: "服务器内", + label: "维修中", }, { value: "3", - label: "已失效", + label: "更换中", }, - ], - currentPage4:4, - value: "", - input: "", - tableData: [ { - date: "2016-05-03", - name: "王小虎", - address: " 1518 弄", + value: "4", + label: "已报损", }, + ], + offStatusList: [ { - date: "2016-05-02", - name: "王小虎", - address: " 1518 弄", + value: "1", + label: "正常关机", }, { - date: "2016-05-04", - name: "王小虎", - address: " 1518 弄", + value: "2", + label: "低电关机", }, { - date: "2016-05-01", - name: "王小虎", - address: " 1518 弄", + value: "3", + label: "异常关机", }, + ], + receiveTypeList: [ { - date: "2016-05-08", - name: "王小虎", - address: " 1518 弄", + value: "1", + label: "未领用", }, { - date: "2016-05-06", - name: "王小虎", - address: " 1518 弄", + value: "2", + label: "使用中", }, { - date: "2016-05-07", - name: "王小虎", - address: " 1518 弄", + value: "3", + label: "已归还", }, ], - dialogVisible:false, - dialogVisible2:false, - dialogVisible3:false, - dialogVisible4:false, - dialogVisible5:false, - ruleForm:{ - areaName:'', - provinceItem:[], - }, - multipleSelection:[], - + currentPage: 4, + size: 10, + total: 10, + value: "", + input: "", + tableData: [], + dialogVisible: false, + dialogVisible2: false, + dialogVisible3: false, + dialogVisible4: false, + dialogVisible5: false, + ruleForm: { + areaName: "", + provinceItem: [], + }, + multipleSelection: [], }; }, - mounted() {}, + mounted() { + // 获取设备列表 + this.equipmentManagement(); + }, methods: { + equipmentManagement() { + this.$api.api + .equipmentManagement({ + size: this.size, + current: this.currentPage, + ...this.searchForm, + }) + .then((res) => { + // console.log(res); + this.tableData = res.data.records; + this.total = res.data.total; + }); + }, //批量绑定 - infoBulkbinding(){ - this.dialogVisible4=true + infoBulkbinding() { + this.dialogVisible4 = true; }, //批量绑定确认 - Bulkbinding(){ - this.dialogVisible4=false + Bulkbinding() { + this.dialogVisible4 = false; }, //批量转移 - infoMasstransfer(){ - this.dialogVisible5=true + infoMasstransfer() { + this.dialogVisible5 = true; }, //批量转移确认 - Masstransfer(){ - this.dialogVisible5=false + Masstransfer() { + this.dialogVisible5 = false; }, + timeChange() {}, //批量归还 - Batchreturn(){ - this.$confirm('确认批量归还吗?', '提示', { - confirmButtonText: '确定', - cancelButtonText: '取消', - type: 'warning' - }).then(() => { - this.$message({ - type: 'success', - message: '批量归还成功!' - }); - }).catch(() => { - this.$message({ - type: 'info', - message: '已取消批量归还' + Batchreturn() { + this.$confirm("确认批量归还吗?", "提示", { + confirmButtonText: "确定", + cancelButtonText: "取消", + type: "warning", + }) + .then(() => { + this.$message({ + type: "success", + message: "批量归还成功!", + }); + }) + .catch(() => { + this.$message({ + type: "info", + message: "已取消批量归还", + }); }); - }); }, - handleSelectionChange(val) { - this.multipleSelection = val; - }, + handleSelectionChange(val) { + this.multipleSelection = val; + }, //绑定 - toinfobinding(){ - this.dialogVisible3=true + toinfobinding() { + this.dialogVisible3 = true; }, //确认绑定 - binding(){ - this.dialogVisible3=false + binding() { + this.dialogVisible3 = false; }, //编辑 - infoeditor(){ - this.dialogVisible2=true + infoeditor() { + this.dialogVisible2 = true; }, //确认编辑 - editor(){ - this.dialogVisible2=false + editor() { + this.dialogVisible2 = false; }, //新增 - infoadd(){ - this.dialogVisible=true + infoadd() { + this.dialogVisible = true; }, //确认新增 - add(){ - this.dialogVisible=false + add() { + this.dialogVisible = false; }, //验收 - acceptance(){ - this.$confirm('确认验收吗?', '提示', { - confirmButtonText: '确定', - cancelButtonText: '取消', - type: 'warning' - }).then(() => { - this.$message({ - type: 'success', - message: '验收成功!' - }); - }).catch(() => { - this.$message({ - type: 'info', - message: '已取消验收' + acceptance() { + this.$confirm("确认验收吗?", "提示", { + confirmButtonText: "确定", + cancelButtonText: "取消", + type: "warning", + }) + .then(() => { + this.$message({ + type: "success", + message: "验收成功!", + }); + }) + .catch(() => { + this.$message({ + type: "info", + message: "已取消验收", + }); }); - }); }, // 转写开关 - infotranscription(){ - this.$confirm('确认开启或关闭吗?', '提示', { - confirmButtonText: '确定', - cancelButtonText: '取消', - type: 'warning' - }).then(() => { + infotranscription() { + this.$confirm("确认开启或关闭吗?", "提示", { + confirmButtonText: "确定", + cancelButtonText: "取消", + type: "warning", + }) + .then(() => { this.$message({ - type: 'success', - message: '成功!' + type: "success", + message: "成功!", }); - }).catch(() => { + }) + .catch(() => { this.$message({ - type: 'info', - message: '已取消' + type: "info", + message: "已取消", }); }); }, //归还 - toinifoThereturn(){ - this.$confirm('确认归还吗?', '提示', { - confirmButtonText: '确定', - cancelButtonText: '取消', - type: 'warning' - }).then(() => { + toinifoThereturn() { + this.$confirm("确认归还吗?", "提示", { + confirmButtonText: "确定", + cancelButtonText: "取消", + type: "warning", + }) + .then(() => { this.$message({ - type: 'success', - message: '归还成功!' + type: "success", + message: "归还成功!", }); - }).catch(() => { + }) + .catch(() => { this.$message({ - type: 'info', - message: '已取消归还' + type: "info", + message: "已取消归还", }); }); }, - //删除 - toinifodelete(){ - this.$confirm('此操作将永久删除, 是否继续?', '提示', { - confirmButtonText: '确定', - cancelButtonText: '取消', - type: 'warning' - }).then(() => { + //删除 + toinifodelete() { + this.$confirm("此操作将永久删除, 是否继续?", "提示", { + confirmButtonText: "确定", + cancelButtonText: "取消", + type: "warning", + }) + .then(() => { this.$message({ - type: 'success', - message: '删除成功!' + type: "success", + message: "删除成功!", }); - }).catch(() => { + }) + .catch(() => { this.$message({ - type: 'info', - message: '已取消删除' + type: "info", + message: "已取消删除", }); }); }, - handleSizeChange(val) { - console.log(`每页 ${val} 条`); - }, - handleCurrentChange(val) { - console.log(`当前页: ${val}`); - } + handleSizeChange(val) { + console.log(`每页 ${val} 条`); + this.size = val; + this.equipmentManagement(); + }, + handleCurrentChange(val) { + console.log(`当前页: ${val}`); + this.currentPage = val; + this.equipmentManagement(); + }, }, }; @@ -541,10 +784,10 @@ export default { min-width: 1200px; padding-bottom: 100px; } -.cen-tab{ +.cen-tab { width: 100%; padding: 15px; - background: #FFFFFF; + background: #ffffff; margin-top: 15px; } .tophove { @@ -567,7 +810,7 @@ export default { font-size: 14px; font-weight: 400; color: #32363d; - line-height: 14px; + line-height: 32px; margin-left: 15px; min-width: 100px; }