From cb78b4fbcd31bbee7ed7882c7b5f6f660f20c511 Mon Sep 17 00:00:00 2001
From: doum <doum>
Date: 星期一, 20 十月 2025 09:56:19 +0800
Subject: [PATCH] 最新版本541200007
---
admin/src/components/business/cabinetDetails.vue | 62 ++++++++++++++++++++++++++-----
1 files changed, 52 insertions(+), 10 deletions(-)
diff --git a/admin/src/components/business/cabinetDetails.vue b/admin/src/components/business/cabinetDetails.vue
index 8e324d7..f08a6ba 100644
--- a/admin/src/components/business/cabinetDetails.vue
+++ b/admin/src/components/business/cabinetDetails.vue
@@ -6,8 +6,8 @@
:withFooter="false"
>
<el-form ref="searchForm" :model="searchForm" label-width="100px" inline>
- <el-form-item label="閽ュ寵" prop="keyId">
- <el-input v-model="searchForm.keyId" placeholder="璇疯緭鍏ラ挜鍖欑紪鐮佹垨鍚嶇О" @keypress.enter.native="getList"></el-input>
+ <el-form-item label="閽ュ寵" prop="keyCode">
+ <el-input v-model="searchForm.keyCode" placeholder="璇疯緭鍏ラ挜鍖欑紪鐮佹垨鍚嶇О" @keypress.enter.native="getList"></el-input>
</el-form-item>
<el-form-item label="鐘舵��" prop="status">
<el-select v-model="searchForm.status" placeholder="璇烽�夋嫨" @change="getList">
@@ -31,7 +31,7 @@
</el-form-item>
</el-form>
<ul class="toolbar">
- <li><el-button type="primary">鎵归噺瑙g粦</el-button></li>
+ <li><el-button type="primary" @click="bathUnBindKeys">鎵归噺瑙g粦</el-button></li>
</ul>
<el-table
v-loading="loading"
@@ -42,24 +42,25 @@
<el-table-column prop="cabinetName" label="鎵�灞為挜鍖欐煖" min-width="100px"></el-table-column>
<el-table-column prop="keyId" label="缁戝畾閽ュ寵" min-width="100px">
<template slot-scope="{row}">
- <el-select v-model="row.keyId" placeholder="璇烽�夋嫨">
+ <el-select v-model="row.keyId" placeholder="璇烽�夋嫨" @change="blurFunc($event, row, 1)">
<el-option
v-for="item in keysAll"
:key="item.id"
- :label="item.name"
- :value="item.id">
+ :label="item.code"
+ :value="item.id"
+ :disabled="item.isBinding === 1">
</el-option>
</el-select>
</template>
</el-table-column>
<el-table-column label="鏉垮彿" min-width="100px">
<template slot-scope="{row}">
- <el-input v-model="row.boardCode" placeholder="璇疯緭鍏ユ澘鍙�"></el-input>
+ <el-input v-model="row.boardCode" @blur="blurFunc($event, row, 2)" placeholder="璇疯緭鍏ユ澘鍙�"></el-input>
</template>
</el-table-column>
<el-table-column label="閫氶亾鍙�" min-width="100px">
<template slot-scope="{row}">
- <el-input v-model="row.channelCode" placeholder="璇疯緭鍏ラ�氶亾鍙�"></el-input>
+ <el-input v-model="row.channelCode" @blur="blurFunc($event, row, 3)" placeholder="璇疯緭鍏ラ�氶亾鍙�"></el-input>
</template>
</el-table-column>
<el-table-column label="鐘舵��" min-width="100px">
@@ -93,7 +94,8 @@
<script>
import BaseOpera from '@/components/base/BaseOpera'
import GlobalWindow from '@/components/common/GlobalWindow'
- import { fetchList, updateStatusById } from '@/api/business/jkCabinetGrid'
+ import { fetchList, updateStatusById, unBindKeys, updateById } from '@/api/business/jkCabinetGrid'
+ import { list } from '@/api/business/jkKeys'
export default {
name: 'cabinetDetails',
extends: BaseOpera,
@@ -103,7 +105,7 @@
id: null,
info: null,
searchForm: {
- keyId: '',
+ keyCode: '',
status: '',
bindStatus: ''
},
@@ -117,8 +119,48 @@
this.title = title
this.id = id
this.getList()
+ this.getKeysAll()
this.visible = true
},
+ getKeysAll() {
+ list({ })
+ .then(res => {
+ this.keysAll = res
+ })
+ },
+ blurFunc(e, row, type) {
+ let obj = {
+ id: row.id
+ }
+ if (type === 1) {
+ obj.keyId = row.keyId
+ } else if (type === 2) {
+ obj.boardCode = row.boardCode
+ } else if (type === 3) {
+ obj.channelCode = row.channelCode
+ }
+ updateById(obj)
+ .then(res => {
+ this.getList()
+ if (type === 1) {
+ this.getKeysAll()
+ }
+ })
+ },
+ bathUnBindKeys() {
+ this.$confirm('纭鎵归噺瑙g粦鍚�?', '鎻愮ず', {
+ confirmButtonText: '纭畾',
+ cancelButtonText: '鍙栨秷',
+ type: 'warning'
+ }).then(() => {
+ unBindKeys(this.list.map(item => item.id))
+ .then(res => {
+ this.getList()
+ })
+ }).catch(() => {
+
+ });
+ },
changeStatus(status, id) {
updateStatusById({ id, status })
.then(res => {
--
Gitblit v1.9.3