From 14f8b7b32ed9133152780eb072adbc32df2eb242 Mon Sep 17 00:00:00 2001 From: zhanghua <314079846@qq.com> Date: 星期一, 07 十一月 2022 17:42:16 +0800 Subject: [PATCH] 音柱、手持设备修改 --- src/views/systemSetting/device/handheldTerminal/index.vue | 62 +++++++++++++++++++------------ 1 files changed, 38 insertions(+), 24 deletions(-) diff --git a/src/views/systemSetting/device/handheldTerminal/index.vue b/src/views/systemSetting/device/handheldTerminal/index.vue index 03d856f..6e2fd98 100644 --- a/src/views/systemSetting/device/handheldTerminal/index.vue +++ b/src/views/systemSetting/device/handheldTerminal/index.vue @@ -23,10 +23,7 @@ <main> <div class="main-content"> <div class="main-title"> - <el-button - class="el-icon-plus" - type="primary" - @click="dialogCreate = true" + <el-button class="el-icon-plus" type="primary" @click="handleAdd" >娣诲姞</el-button > </div> @@ -53,7 +50,7 @@ </el-table-column> <el-table-column prop="phone" label="鑱旂郴鏂瑰紡" min-width="10"> </el-table-column> - <el-table-column prop="pDepartName" label="鎵�灞為儴闂�" min-width="10"> + <el-table-column prop="pdepartName" label="鎵�灞為儴闂�" min-width="10"> </el-table-column> <el-table-column prop="departName" label="鎵�灞炲ぇ闃�" min-width="10"> </el-table-column> @@ -68,7 +65,7 @@ <el-table-column prop="operation" label="鎿嶄綔" min-width="20"> <template slot-scope="scope"> - <div class="btn"> + <div class="operation"> <span @click="handleEdit(scope.row)">缂栬緫</span> <span class="line">|</span> <span @click="handleDelete(scope.row)">鍒犻櫎</span> @@ -105,7 +102,7 @@ width="60%" :before-close="handleClose" > - <MyForm :info="handheldTerminal" :closeDialog="setTableData"></MyForm> + <MyForm :info="handheldTerminal" @closeDialog="handleCallBack"></MyForm> </el-dialog> </footer> </div> @@ -142,31 +139,47 @@ pageSize: 10, currentPage: 1, renderFlag: false, - handheldTerminal: { - id: 0, - name: "", - code: "", - user: "", - phone: "", - departId: 0, - }, + handheldTerminal: {}, }; }, created() { this.setTableData(); }, methods: { - ...mapActions([ - "getHandheldTerminalList", - "saveHandheldTerminal", - "updateHandheldTerminal", - ]), + ...mapActions(["getHandheldTerminalList", "deleteHandheldTerminal"]), + handleAdd() { + this.handheldTerminal = { + id: 0, + name: "", + code: "", + user: "", + phone: "", + departId: 0, + departName: "", + }; + this.dialogCreate = true; + }, handleEdit(row) { - this.handheldTerminal = row; this.dialogCreate = true; }, - handleDelete(row) {}, + handleDelete(row) { + this.$confirm("纭鍒犻櫎锛�").then((_) => { + this.deleteHandheldTerminal(row.id).then((res) => { + this.$message({ + type: "success", + message: "鍒犻櫎鎴愬姛锛�", + }); + this.setTableData(); + }); + }); + }, + + handleCallBack(e) { + this.currentPage = 1; + this.dialogCreate = false; + this.setTableData(); + }, formatSate(row, column) { return row.state == 1 ? "鍦ㄧ嚎" : "绂荤嚎"; }, @@ -183,6 +196,7 @@ // 寮圭獥鍏抽棴 handleClose(done) { this.$confirm("纭鍏抽棴?").then((_) => { + this.dialogCreate = false; done(); }); }, @@ -194,8 +208,8 @@ pageSize, state: context, }).then((res) => { - this.list = res.records; - this.totalNum = res.total; + this.list = res.records; + this.totalNum = res.total; }); }, handleStateChange(e) { -- Gitblit v1.8.0