From fc44cfa54d5d71db31905f47370eab4eedd5a395 Mon Sep 17 00:00:00 2001 From: douzhuo <17611323298@163.com> Date: Tue, 23 Aug 2022 13:41:48 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A1=A8=E6=A0=BC=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/Equipment/batch.vue | 604 ++++++++++++++++++------------ src/views/Equipment/index.vue | 491 ++++++------------------- src/views/Equipment/record.vue | 110 ++++-- src/views/Equipment/state.vue | 555 +++++++++++----------------- src/views/Equipment/table.js | 330 +++++++++++++++++ src/views/File/index.vue | 342 ++++++++++------- src/views/File/table.js | 51 +++ src/views/admin/user/index.vue | 654 +++++++++++++++++++-------------- src/views/admin/user/table.js | 112 ++++++ 9 files changed, 1837 insertions(+), 1412 deletions(-) create mode 100644 src/views/Equipment/table.js create mode 100644 src/views/File/table.js create mode 100644 src/views/admin/user/table.js diff --git a/src/views/Equipment/batch.vue b/src/views/Equipment/batch.vue index e73b0f2..95af24a 100644 --- a/src/views/Equipment/batch.vue +++ b/src/views/Equipment/batch.vue @@ -1,24 +1,37 @@ @@ -134,148 +250,176 @@ import { mapGetters } from "vuex"; export default { data() { return { - dialogVisible:false, - batchId:'', + tableIdName: "EquipmentBatch", // 当前页面需要的变量 + tableOption: this.$tableOption.EquipmentBatch, // 当前table配置项 + tableLoading: false, // 是否显示加载中 + showColumn: [], // 监听的显示列的变量 + page: { + total: 0, // 总页数 + currentPage: 1, // 当前页数 + pageSize: 10, // 每页显示多少条 + }, + + dialogVisible: false, + batchId: "", tableData: [], - currentPage4:1, - addagentobj:{ - id:'', - batchId:'',// 批次号 - realityEquipmentCount:'',// 应收数 - receivableEquipmentCount:'',// 实收数 - deviceNoStart:'',// 开头 - deviceNoEnd:'',// 结尾 - remark:''//备注 + currentPage4: 1, + addagentobj: { + id: "", + batchId: "", // 批次号 + realityEquipmentCount: "", // 应收数 + receivableEquipmentCount: "", // 实收数 + deviceNoStart: "", // 开头 + deviceNoEnd: "", // 结尾 + remark: "", //备注 }, - rules:{ - batchId: [ - { required: true, message: '请输入批次号', trigger: 'blur' }, - ], - realityEquipmentCount: [ - { required: true, message: '请输入应收设备数量', trigger: 'blur' }, - ], - receivableEquipmentCount: [ - { required: true, message: '请输入实收设备数量', trigger: 'blur' }, - ], - deviceNoStart: [ - { required: true, message: '请输入设备号开头', trigger: 'blur' }, - ], - deviceNoEnd: [ - { required: true, message: '请输入设备号结尾', trigger: 'blur' }, - ], + rules: { + batchId: [{ required: true, message: "请输入批次号", trigger: "blur" }], + realityEquipmentCount: [ + { required: true, message: "请输入应收设备数量", trigger: "blur" }, + ], + receivableEquipmentCount: [ + { required: true, message: "请输入实收设备数量", trigger: "blur" }, + ], + deviceNoStart: [ + { required: true, message: "请输入设备号开头", trigger: "blur" }, + ], + deviceNoEnd: [ + { required: true, message: "请输入设备号结尾", trigger: "blur" }, + ], }, - total:0,//总条数 - pageNum:1, - pageSize:30, - isshow:'绑定' - + total: 0, //总条数 + pageNum: 1, + pageSize: 30, + isshow: "绑定", }; }, - computed: { + computed: { ...mapGetters(["permissions"]), }, + + watch: { + showColumn(nowV) { + let params = { + tableIdName: this.tableIdName, + optionData: nowV, + }; + this.$db.upDate(params); + }, + }, created() { + // 获取显隐的列表 + this.setTableOption(); this.equ_batch_add = this.permissions["equ_batch_add"]; this.equ_batch_edit = this.permissions["equ_batch_edit"]; }, mounted() { - this.getcompanyList() + this.getcompanyList(); }, methods: { + + // 获取当前页面的显隐 + setTableOption() { + this.$db.getDataByKey(this.tableIdName).then((res) => { + if (res.tableIdName == this.tableIdName) { + this.showColumn = res.optionData; + } + }); + }, //編輯 - clickbianji(row){ - this.addagentobj.id=row.id; - this.addagentobj.batchId=row.batchId; - this.addagentobj.realityEquipmentCount=row.realityEquipmentCount; - this.addagentobj.receivableEquipmentCount=row.receivableEquipmentCount; - this.addagentobj.deviceNoStart=row.deviceNoStart; - this.addagentobj.deviceNoEnd=row.deviceNoEnd; - this.addagentobj.remark=row.remark; - this.isshow='编辑'; - this.dialogVisible=true; + clickbianji(row) { + this.addagentobj.id = row.id; + this.addagentobj.batchId = row.batchId; + this.addagentobj.realityEquipmentCount = row.realityEquipmentCount; + this.addagentobj.receivableEquipmentCount = row.receivableEquipmentCount; + this.addagentobj.deviceNoStart = row.deviceNoStart; + this.addagentobj.deviceNoEnd = row.deviceNoEnd; + this.addagentobj.remark = row.remark; + this.isshow = "编辑"; + this.dialogVisible = true; }, - clear(){ + clear() { this.$refs.addagentobj.resetFields(); }, //添加 - editorinfo(){ - this.isshow='绑定'; - this.addagentobj.id=''; - this.addagentobj.batchId=''; - this.addagentobj.realityEquipmentCount=''; - this.addagentobj.receivableEquipmentCount=''; - this.addagentobj.deviceNoStart=''; - this.addagentobj.deviceNoEnd=''; - this.addagentobj.remark=''; - this.dialogVisible=true; + editorinfo() { + this.isshow = "绑定"; + this.addagentobj.id = ""; + this.addagentobj.batchId = ""; + this.addagentobj.realityEquipmentCount = ""; + this.addagentobj.receivableEquipmentCount = ""; + this.addagentobj.deviceNoStart = ""; + this.addagentobj.deviceNoEnd = ""; + this.addagentobj.remark = ""; + this.dialogVisible = true; }, //确认添加 - editor(){ - this.$refs.addagentobj.validate((valid) => { - if (valid) { - if(this.isshow=='绑定'){ - this.$api.http.insert(this.addagentobj).then((res) => { - if(res.code==0){ - this.dialogVisible=false; - this.$refs.addagentobj.resetFields(); - this.Screeningofempty() - }else{ - this.$message.error(res.message); - } - }); - }else{ - this.$api.http.insertupdate(this.addagentobj).then((res) => { - if(res.code==0){ - this.dialogVisible=false; - this.$refs.addagentobj.resetFields(); - this.Screeningofempty() - }else{ - this.$message.error(res.message); - } - }); - } + editor() { + this.$refs.addagentobj.validate((valid) => { + if (valid) { + if (this.isshow == "绑定") { + this.$api.http.insert(this.addagentobj).then((res) => { + if (res.code == 0) { + this.dialogVisible = false; + this.$refs.addagentobj.resetFields(); + this.Screeningofempty(); + } else { + this.$message.error(res.message); + } + }); } else { - return false; + this.$api.http.insertupdate(this.addagentobj).then((res) => { + if (res.code == 0) { + this.dialogVisible = false; + this.$refs.addagentobj.resetFields(); + this.Screeningofempty(); + } else { + this.$message.error(res.message); + } + }); } - }); + } else { + return false; + } + }); }, - //清空筛选 - Screeningofempty(){ - this.batchId=''; - this.pageNum=1 - this.getcompanyList() + //清空筛选 + Screeningofempty() { + this.batchId = ""; + this.page.currentPage = 1; + this.getcompanyList(); }, //筛选 - Screening(){ - this.pageNum=1 - this.getcompanyList() + Screening() { + this.page.currentPage = 1; + this.getcompanyList(); }, - // 获取列表 + // 获取列表 getcompanyList() { - this.tableData=[]; - let parmest={ - current: this.pageNum, - size: this.pageSize, - batchId:this.batchId - } + this.tableData = []; + let parmest = { + current: this.page.currentPage, + size: this.page.pageSize, + batchId: this.batchId, + }; this.$api.http.getequipmentbatch(parmest).then((res) => { - console.log(res.data); - this.tableData=res.data.records; - this.total=res.data.total - // 表格中设置ref属性,在数据渲染之后或者updated()之后 - this.$nextTick(() => { - this.$refs.table.doLayout(); - }); + console.log(res.data); + this.tableData = res.data.records; + this.page.total = res.data.total; + // 表格中设置ref属性,在数据渲染之后或者updated()之后 + this.$nextTick(() => { + this.$refs.crud.doLayout(); }); + }); + }, + handleSizeChange(val) { + this.page.pageSize = val; + this.getcompanyList(); + }, + handleCurrentChange(val) { + this.page.currentPage = val; + this.getcompanyList(); }, - handleSizeChange(val) { - this.pageSize=val; - this.getcompanyList() - }, - handleCurrentChange(val) { - this.pageNum=val; - this.getcompanyList() - }, }, }; @@ -287,10 +431,10 @@ export default { min-width: 1000px; padding-bottom: 40px; } -.cen-tab{ +.cen-tab { width: 100%; padding: 15px; - background: #FFFFFF; + background: #ffffff; margin-top: 15px; } .tophove { @@ -333,27 +477,27 @@ export default { } } } -/deep/ .el-table__header-wrapper{ - thead{ - tr{ - th{ - background: #F5F7FA; +/deep/ .el-table__header-wrapper { + thead { + tr { + th { + background: #f5f7fa; color: #333333; } } } } -/deep/ .el-dialog--center{ +/deep/ .el-dialog--center { border-radius: 8px; - .el-dialog__title{ + .el-dialog__title { font-weight: bold; } } -/deep/ .el-button--primary{ - background: #2671E2 !important; - border: 1px solid #2671E2 !important; +/deep/ .el-button--primary { + background: #2671e2 !important; + border: 1px solid #2671e2 !important; } -/deep/ .el-button--text{ - color: #2671E2; +/deep/ .el-button--text { + color: #2671e2; } diff --git a/src/views/Equipment/index.vue b/src/views/Equipment/index.vue index 1074122..677a35b 100644 --- a/src/views/Equipment/index.vue +++ b/src/views/Equipment/index.vue @@ -66,26 +66,6 @@ - -
领用状态:
- - - - -
@@ -177,15 +97,6 @@
- -
-
- - - - - - +
{ + if (res.tableIdName == this.tableIdName) { + this.showColumn = res.optionData; + } + }); + }, downLoad() { let obj = { timeType: 1, @@ -1190,7 +910,7 @@ export default { uploadStatus: "", //上传状态 offStatus: "", //关机状态 }; - this.currentPage = 1; + this.page.currentPage = 1; this.equipmentManagement(); }, resetImei() { @@ -1216,15 +936,15 @@ export default { } }, screen() { - this.currentPage = 1; + this.page.currentPage = 1; console.log(this.searchForm); this.equipmentManagement(); }, equipmentManagement() { this.$api.api .equipmentManagement({ - size: this.size, - current: this.currentPage, + size: this.page.pageSize, + current: this.page.currentPage, timeType: 1, orgType: localStorage.getItem("orgType"), orgCode: localStorage.getItem("orgCode"), @@ -1235,7 +955,11 @@ export default { .then((res) => { // console.log(res); this.tableData = res.data.records; - this.total = res.data.total; + this.page.total = res.data.total; + // 表格中设置ref属性,在数据渲染之后或者updated()之后 + this.$nextTick(() => { + this.$refs.crud.doLayout(); + }); }); }, //批量绑定 @@ -1648,12 +1372,12 @@ export default { }, handleSizeChange(val) { console.log(`每页 ${val} 条`); - this.size = val; + this.page.pageSize = val; this.equipmentManagement(); }, handleCurrentChange(val) { console.log(`当前页: ${val}`); - this.currentPage = val; + this.page.currentPage = val; this.equipmentManagement(); }, }, @@ -1672,7 +1396,6 @@ export default { } .cen-tab { width: 100%; - height: calc(100% - 94px - 30px); flex-grow: 1; padding: 15px; background: #ffffff; diff --git a/src/views/Equipment/record.vue b/src/views/Equipment/record.vue index 28e82c7..f698416 100644 --- a/src/views/Equipment/record.vue +++ b/src/views/Equipment/record.vue @@ -50,15 +50,28 @@
清空筛选条件
-
- 导出 +
+ 导出
- + + + -
-
+
-->
@@ -121,7 +131,16 @@ export default { data() { return { - currentPage: 4, + tableIdName: "EquipmentRecord", // 当前页面需要的变量 + tableOption: this.$tableOption.EquipmentRecord, // 当前table配置项 + tableLoading: false, // 是否显示加载中 + showColumn: [], // 监听的显示列的变量 + page: { + total: 0, // 总页数 + currentPage: 1, // 当前页数 + pageSize: 10, // 每页显示多少条 + }, + value: "", input: "", tableData: [], @@ -168,11 +187,35 @@ export default { }, }; }, + + watch: { + showColumn(nowV) { + let params = { + tableIdName: this.tableIdName, + optionData: nowV, + }; + this.$db.upDate(params); + }, + }, + + created() { + // 获取显隐的列表 + this.setTableOption(); + }, + mounted() { // 获取项目列表 this.equipReceiveFindByPage(); }, methods: { + // 获取当前页面的显隐 + setTableOption() { + this.$db.getDataByKey(this.tableIdName).then((res) => { + if (res.tableIdName == this.tableIdName) { + this.showColumn = res.optionData; + } + }); + }, selectChange(e) { this.searchForm.equipImei = ""; this.searchForm.userName = ""; @@ -192,18 +235,22 @@ export default { this.searchForm.userName = ""; }, screen() { - this.currentPage = 1; + this.page.currentPage = 1; this.equipReceiveFindByPage(); }, exportFile() { - this.exportMethodPost("autoSR/equipReceive/pageExport", "领用记录",this.searchForm); + this.exportMethodPost( + "autoSR/equipReceive/pageExport", + "领用记录", + this.searchForm + ); }, // 导出.Excel公用方法 exportMethodPost(url, name, data = {}) { axios({ method: "get", url: url, - params:data, + params: data, responseType: "blob", }) .then((res) => { @@ -234,7 +281,7 @@ export default { }); }, clascreen() { - this.currentPage = 1; + this.page.currentPage = 1; this.searchForm.equipImei = ""; this.searchForm.userName = ""; this.searchForm.receiveType = ""; @@ -243,18 +290,18 @@ export default { // 获取常错词列表 equipReceiveFindByPage() { let obj = { - current: this.currentPage, - size: this.size, + current: this.page.currentPage, + size: this.page.pageSize, ...this.searchForm, }; this.$api.api.equipReceiveFindByPage(obj).then((res) => { // console.log(res); this.tableData = res.data.records; - this.total = res.data.total; - // 表格中设置ref属性,在数据渲染之后或者updated()之后 - this.$nextTick(() => { - this.$refs.table.doLayout(); - }); + this.page.total = res.data.total; + // 表格中设置ref属性,在数据渲染之后或者updated()之后 + this.$nextTick(() => { + this.$refs.crud.doLayout(); + }); }); }, handleSelectionChange(val) { @@ -262,12 +309,12 @@ export default { }, handleSizeChange(val) { console.log(`每页 ${val} 条`); - this.size = val; + this.page.pageSize = val; this.equipReceiveFindByPage(); }, handleCurrentChange(val) { console.log(`当前页: ${val}`); - this.currentPage = val; + this.page.currentPage = val; this.equipReceiveFindByPage(); }, }, @@ -299,6 +346,7 @@ export default { padding-top: 15px; padding-bottom: 15px; .app-titel { + padding: 0 20px; width: 100%; display: flex; align-items: center; @@ -336,21 +384,21 @@ export default { .div-inp { width: 250px; } -/deep/ .el-table__header-wrapper{ - thead{ - tr{ - th{ - background: #F5F7FA; +/deep/ .el-table__header-wrapper { + thead { + tr { + th { + background: #f5f7fa; color: #333333; } } } } -/deep/ .el-button--primary{ - background: #2671E2 !important; - border: 1px solid #2671E2 !important; +/deep/ .el-button--primary { + background: #2671e2 !important; + border: 1px solid #2671e2 !important; } -/deep/ .el-button--text{ - color: #2671E2; +/deep/ .el-button--text { + color: #2671e2; } diff --git a/src/views/Equipment/state.vue b/src/views/Equipment/state.vue index 4e73686..ca52e3a 100644 --- a/src/views/Equipment/state.vue +++ b/src/views/Equipment/state.vue @@ -116,35 +116,10 @@ @change="selChange" > - - - - -
领用状态:
- - -
关机状态:
领用人:
- - -
筛选
- 清空筛选条件 - {{isOpen?'收起':'展开'}} -
-
-
+ 清空筛选条件 批量开启指示灯 -
-
- 批量关闭指示灯 -
-
- 批量归还 -
-
- 批量转移 + style="margin-left: 10px" + @click="isSystoleForm" + type="text" + >{{ isOpen ? "收起" : "展开" + }}
-
- 批量解绑 -
+
+
+ 批量开启指示灯 +
+
+ 批量关闭指示灯 +
+
+ 批量归还 +
+
+ 批量转移 +
+
+ 批量解绑 +
-
- 导出 -
+
+ 导出 +
@@ -340,189 +279,85 @@ }} 离线设备:{{ offLineCount || 0 }} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - -
- - -
+ 领用 + {{ + row.lightStatus == "on" ? "关闭" : "开启" + }}指示灯 + WiFi管理 + 录音{{ + row.recCmd == "start" ? "关闭" : "开启" + }} + 设备日志 + + + + -