|
@@ -19,22 +19,23 @@
|
|
@focus="isFocus=true"
|
|
@focus="isFocus=true"
|
|
@search="onSearch"
|
|
@search="onSearch"
|
|
/>
|
|
/>
|
|
- <a-card class="search-sub" :bordered="false" v-show="resultData.length != 0 && isFocus">
|
|
|
|
- <div class="search-sub-item" v-for="(item, index) in resultData" :key="index">
|
|
|
|
- <p>{{ item.des }}-{{ item.isBind ? '已绑定' : '未绑定' }}</p>
|
|
|
|
|
|
+ <a-card class="search-sub" :bordered="false" v-if="resultData && isFocus">
|
|
|
|
+ <div class="search-sub-item">
|
|
|
|
+ <p>{{ resultData.name }}-{{ resultData.params ? '已绑定' : '未绑定' }}</p>
|
|
<a-button
|
|
<a-button
|
|
id="equipment-bind"
|
|
id="equipment-bind"
|
|
- v-if="!item.isBind"
|
|
|
|
|
|
+ v-if="!resultData.params"
|
|
type="primary"
|
|
type="primary"
|
|
ghost
|
|
ghost
|
|
size="small"
|
|
size="small"
|
|
- @click="onBundling(item)">立即绑定</a-button>
|
|
|
|
|
|
+ @click="onBundling(resultData)">立即绑定</a-button>
|
|
|
|
+ <a-button v-else disabled type="link">已绑定</a-button>
|
|
</div>
|
|
</div>
|
|
</a-card>
|
|
</a-card>
|
|
</div>
|
|
</div>
|
|
<!-- 已绑设备 -->
|
|
<!-- 已绑设备 -->
|
|
<div class="eq-tit">已绑设备:</div>
|
|
<div class="eq-tit">已绑设备:</div>
|
|
- <s-table
|
|
|
|
|
|
+ <a-table
|
|
class="table"
|
|
class="table"
|
|
ref="table"
|
|
ref="table"
|
|
bordered
|
|
bordered
|
|
@@ -45,7 +46,7 @@
|
|
:showPagination="false">
|
|
:showPagination="false">
|
|
<div slot="expandedRowRender" slot-scope="record" style="margin: 30px 30px;">
|
|
<div slot="expandedRowRender" slot-scope="record" style="margin: 30px 30px;">
|
|
<div class="eq-subTit">设备通道(机位):</div>
|
|
<div class="eq-subTit">设备通道(机位):</div>
|
|
- <s-table
|
|
|
|
|
|
+ <a-table
|
|
ref="tables"
|
|
ref="tables"
|
|
bordered
|
|
bordered
|
|
size="small"
|
|
size="small"
|
|
@@ -55,12 +56,12 @@
|
|
<template slot="action" slot-scope="record">
|
|
<template slot="action" slot-scope="record">
|
|
<a-button type="link" id="equipment-edit" @click="onEdit(record)">编辑</a-button>
|
|
<a-button type="link" id="equipment-edit" @click="onEdit(record)">编辑</a-button>
|
|
</template>
|
|
</template>
|
|
- </s-table>
|
|
|
|
|
|
+ </a-table>
|
|
</div>
|
|
</div>
|
|
<template slot="action" slot-scope="record">
|
|
<template slot="action" slot-scope="record">
|
|
<a-button type="primary" ghost size="small" id="equipment-unBind" @click="onUnbundling(record)">解绑</a-button>
|
|
<a-button type="primary" ghost size="small" id="equipment-unBind" @click="onUnbundling(record)">解绑</a-button>
|
|
</template>
|
|
</template>
|
|
- </s-table>
|
|
|
|
|
|
+ </a-table>
|
|
<!-- 编辑 通道/机位名称 -->
|
|
<!-- 编辑 通道/机位名称 -->
|
|
<a-modal
|
|
<a-modal
|
|
class="passagewayModal"
|
|
class="passagewayModal"
|
|
@@ -87,6 +88,7 @@
|
|
<script>
|
|
<script>
|
|
import { STable, VSelect } from '@/components'
|
|
import { STable, VSelect } from '@/components'
|
|
import { findStoreVsDevice, unbindVsDevice, findVsDevice, bindVsDevice } from '@/api/storeVsDevice.js'
|
|
import { findStoreVsDevice, unbindVsDevice, findVsDevice, bindVsDevice } from '@/api/storeVsDevice.js'
|
|
|
|
+import { vsDeviceChannels, vsDeviceRename } from '@/api/vsDevice.js'
|
|
export default {
|
|
export default {
|
|
name: 'StoreAssociatedEquipmentModal',
|
|
name: 'StoreAssociatedEquipmentModal',
|
|
components: { STable, VSelect },
|
|
components: { STable, VSelect },
|
|
@@ -100,6 +102,11 @@ export default {
|
|
// 门店id
|
|
// 门店id
|
|
type: String,
|
|
type: String,
|
|
default: ''
|
|
default: ''
|
|
|
|
+ },
|
|
|
|
+ storeCode: {
|
|
|
|
+ // 门店code
|
|
|
|
+ type: String,
|
|
|
|
+ default: ''
|
|
}
|
|
}
|
|
},
|
|
},
|
|
data () {
|
|
data () {
|
|
@@ -107,8 +114,8 @@ export default {
|
|
isShow: this.openModal, // 弹框是否展示
|
|
isShow: this.openModal, // 弹框是否展示
|
|
columns: [
|
|
columns: [
|
|
{ title: '序号', dataIndex: 'no', width: '100', align: 'center' },
|
|
{ title: '序号', dataIndex: 'no', width: '100', align: 'center' },
|
|
- { title: '设备名称', dataIndex: 'name', width: '100', align: 'center' },
|
|
|
|
- { title: '设备ID', dataIndex: 'id', width: '100', align: 'center' },
|
|
|
|
|
|
+ { title: '设备名称', dataIndex: 'vsDeviceName', width: '100', align: 'center' },
|
|
|
|
+ { title: '设备ID', dataIndex: 'vsDeviceId', width: '100', align: 'center' },
|
|
{ title: '操作', scopedSlots: { customRender: 'action' }, width: '265', align: 'center' }
|
|
{ title: '操作', scopedSlots: { customRender: 'action' }, width: '265', align: 'center' }
|
|
],
|
|
],
|
|
equipmentData: [], // 已绑设备
|
|
equipmentData: [], // 已绑设备
|
|
@@ -125,7 +132,7 @@ export default {
|
|
rules: { // 表单校验规则
|
|
rules: { // 表单校验规则
|
|
name: [{ required: true, message: '请输入名称', trigger: 'blur' }]
|
|
name: [{ required: true, message: '请输入名称', trigger: 'blur' }]
|
|
},
|
|
},
|
|
- resultData: [], // 设备搜索结果
|
|
|
|
|
|
+ resultData: null, // 设备搜索结果
|
|
isFocus: false // 搜索框是否获取焦点
|
|
isFocus: false // 搜索框是否获取焦点
|
|
}
|
|
}
|
|
},
|
|
},
|
|
@@ -141,8 +148,9 @@ export default {
|
|
},
|
|
},
|
|
// 门店已绑设备
|
|
// 门店已绑设备
|
|
getStoreEquipment (id) {
|
|
getStoreEquipment (id) {
|
|
- findStoreVsDevice({ id: id }).then(res => {
|
|
|
|
|
|
+ findStoreVsDevice({ code: id }).then(res => {
|
|
if (res.status == 200) {
|
|
if (res.status == 200) {
|
|
|
|
+ console.log(res)
|
|
res.data.map((item, ind) => {
|
|
res.data.map((item, ind) => {
|
|
item.no = ind + 1
|
|
item.no = ind + 1
|
|
})
|
|
})
|
|
@@ -175,9 +183,11 @@ export default {
|
|
title: '提示',
|
|
title: '提示',
|
|
content: '确定要绑定该设备吗?',
|
|
content: '确定要绑定该设备吗?',
|
|
onOk () {
|
|
onOk () {
|
|
- bindVsDevice({ tenantId: _this.storeId, vsDeviceId: item.id }).then(res => {
|
|
|
|
|
|
+ bindVsDevice({ storeCode: _this.storeCode, vsDeviceId: item.id }).then(res => {
|
|
if (res.status == 200) {
|
|
if (res.status == 200) {
|
|
_this.$message.success(res.message)
|
|
_this.$message.success(res.message)
|
|
|
|
+ _this.resultData = null
|
|
|
|
+ _this.isFocus = false
|
|
_this.$refs.table.refresh()
|
|
_this.$refs.table.refresh()
|
|
} else {
|
|
} else {
|
|
_this.$message.error(res.message)
|
|
_this.$message.error(res.message)
|
|
@@ -227,7 +237,7 @@ export default {
|
|
|
|
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- storeId (newValue, oldValue) {
|
|
|
|
|
|
+ storeCode (newValue, oldValue) {
|
|
if (newValue && this.isShow) {
|
|
if (newValue && this.isShow) {
|
|
this.getStoreEquipment(newValue)
|
|
this.getStoreEquipment(newValue)
|
|
}
|
|
}
|