设备详情
This commit is contained in:
parent
17256e8807
commit
7a757572a6
|
@ -91,7 +91,8 @@
|
||||||
<div slot="header" class="card-header">
|
<div slot="header" class="card-header">
|
||||||
<span>归属信息</span>
|
<span>归属信息</span>
|
||||||
<div class="header-buttons">
|
<div class="header-buttons">
|
||||||
<el-button type="success" icon="el-icon-connection" plain size="small" @click="openBindUserDialog">绑定商户</el-button>
|
<el-button type="success" icon="el-icon-connection" plain size="small"
|
||||||
|
@click="openBindUserDialog">绑定商户</el-button>
|
||||||
<el-button type="success" icon="el-icon-connection" plain size="small"
|
<el-button type="success" icon="el-icon-connection" plain size="small"
|
||||||
@click="openBindFacilityDialog">绑定设施</el-button>
|
@click="openBindFacilityDialog">绑定设施</el-button>
|
||||||
</div>
|
</div>
|
||||||
|
@ -271,33 +272,7 @@
|
||||||
<el-tabs v-model="activeTab" class="detail-tabs">
|
<el-tabs v-model="activeTab" class="detail-tabs">
|
||||||
<el-tab-pane label="套餐列表" name="packages">
|
<el-tab-pane label="套餐列表" name="packages">
|
||||||
<!-- 套餐列表搜索表单 -->
|
<!-- 套餐列表搜索表单 -->
|
||||||
<el-form :inline="true" :model="searchForm" class="search-form">
|
<Role :userId="deviceData.userId"></Role>
|
||||||
<el-form-item label="用户名称">
|
|
||||||
<el-input v-model="searchForm.userName" placeholder="请输入用户名称"></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="用户手机">
|
|
||||||
<el-input v-model="searchForm.userPhone" placeholder="请输入用户手机号"></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="套餐名称">
|
|
||||||
<el-input v-model="searchForm.packageName" placeholder="请输入套餐名称"></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="收费模式">
|
|
||||||
<el-select v-model="searchForm.chargeMode" placeholder="请选择收费模式">
|
|
||||||
<el-option label="模式1" value="1"></el-option>
|
|
||||||
<el-option label="模式2" value="2"></el-option>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="收费类型">
|
|
||||||
<el-select v-model="searchForm.chargeType" placeholder="请选择收费类型">
|
|
||||||
<el-option label="类型1" value="1"></el-option>
|
|
||||||
<el-option label="类型2" value="2"></el-option>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item>
|
|
||||||
<el-button type="primary" icon="el-icon-search">搜索</el-button>
|
|
||||||
<el-button type="info" icon="el-icon-refresh">重置</el-button>
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<el-tab-pane label="订单列表" name="orders">订单列表内容</el-tab-pane>
|
<el-tab-pane label="订单列表" name="orders">订单列表内容</el-tab-pane>
|
||||||
<el-tab-pane label="命令日志" name="logs">命令日志内容</el-tab-pane>
|
<el-tab-pane label="命令日志" name="logs">命令日志内容</el-tab-pane>
|
||||||
|
@ -340,6 +315,26 @@
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
<!-- 绑定商户对话框 -->
|
<!-- 绑定商户对话框 -->
|
||||||
<el-dialog title="绑定商户" :visible.sync="bindUserDialogVisible" width="900px" append-to-body>
|
<el-dialog title="绑定商户" :visible.sync="bindUserDialogVisible" width="900px" append-to-body>
|
||||||
|
<el-form :model="userQueryParams" ref="queryForm" :inline="true" class="search-form">
|
||||||
|
<el-form-item label="用户名称" prop="userName">
|
||||||
|
<el-input v-model="userQueryParams.userName" placeholder="请输入用户名称" clearable size="small"
|
||||||
|
@keyup.enter.native="handleUserQuery" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="手机号码" prop="phonenumber">
|
||||||
|
<el-input v-model="userQueryParams.phonenumber" placeholder="请输入手机号码" clearable size="small"
|
||||||
|
@keyup.enter.native="handleUserQuery" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="状态" prop="status">
|
||||||
|
<el-select v-model="userQueryParams.status" placeholder="用户状态" clearable size="small">
|
||||||
|
<el-option label="正常" value="0" />
|
||||||
|
<el-option label="停用" value="1" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleUserQuery">搜索</el-button>
|
||||||
|
<el-button icon="el-icon-refresh" size="mini" @click="resetUserQuery">重置</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
<el-table v-loading="userTableLoading" :data="userList" style="width: 100%" height="500">
|
<el-table v-loading="userTableLoading" :data="userList" style="width: 100%" height="500">
|
||||||
<el-table-column label="用户编号" prop="userId" align="center" />
|
<el-table-column label="用户编号" prop="userId" align="center" />
|
||||||
<el-table-column label="用户名称" prop="userName" align="center" />
|
<el-table-column label="用户名称" prop="userName" align="center" />
|
||||||
|
@ -385,11 +380,13 @@ import { listData } from '@/api/system/dict/data'
|
||||||
import { listEquipment } from "@/api/system/equipment"
|
import { listEquipment } from "@/api/system/equipment"
|
||||||
import QrCode from '@/components/QrCode/index.vue'
|
import QrCode from '@/components/QrCode/index.vue'
|
||||||
import QRCode from 'qrcode'
|
import QRCode from 'qrcode'
|
||||||
|
import Role from '@/views/system/rule/index.vue'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "DeviceDetail",
|
name: "DeviceDetail",
|
||||||
components: {
|
components: {
|
||||||
QrCode
|
QrCode,
|
||||||
|
Role
|
||||||
},
|
},
|
||||||
dicts: ['ss_equipment_type', 'ss_equipment_status', 'ss_user_type'],
|
dicts: ['ss_equipment_type', 'ss_equipment_status', 'ss_user_type'],
|
||||||
data() {
|
data() {
|
||||||
|
@ -460,11 +457,12 @@ export default {
|
||||||
return this.deviceData.sn || ''
|
return this.deviceData.sn || ''
|
||||||
},
|
},
|
||||||
modelTags() {
|
modelTags() {
|
||||||
// 确保返回数组类型
|
return this.deviceData.modelTags ? this.deviceData.modelTags.map(tag => {
|
||||||
if (!this.deviceData.modelTags) return []
|
const modelTag = this.modelTagOptions.find(option => option.dictValue === tag);
|
||||||
return Array.isArray(this.deviceData.modelTags)
|
|
||||||
? this.deviceData.modelTags
|
|
||||||
: this.deviceData.modelTags.split(',').filter(Boolean)
|
return modelTag ? modelTag.dictLabel : tag;
|
||||||
|
}) : [];
|
||||||
},
|
},
|
||||||
facilityTag() {
|
facilityTag() {
|
||||||
return this.deviceData.facilityName || '--'
|
return this.deviceData.facilityName || '--'
|
||||||
|
@ -472,13 +470,19 @@ export default {
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
const deviceId = this.$route.params.deviceId
|
const deviceId = this.$route.params.deviceId
|
||||||
|
|
||||||
|
this.fetchFacilityOptions()
|
||||||
|
this.fetchModelTagOptions()
|
||||||
if (deviceId) {
|
if (deviceId) {
|
||||||
this.fetchDeviceData(deviceId)
|
this.fetchDeviceData(deviceId)
|
||||||
}
|
}
|
||||||
this.fetchFacilityOptions()
|
|
||||||
this.fetchModelTagOptions()
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
toUserDetail(){
|
||||||
|
if (this.deviceData.userId) {
|
||||||
|
this.$router.push(`/user/detail/${this.deviceData.userId}`);
|
||||||
|
}
|
||||||
|
},
|
||||||
fetchDeviceData(deviceId) {
|
fetchDeviceData(deviceId) {
|
||||||
this.loading = true
|
this.loading = true
|
||||||
getDevice(deviceId).then(response => {
|
getDevice(deviceId).then(response => {
|
||||||
|
@ -512,8 +516,9 @@ export default {
|
||||||
},
|
},
|
||||||
|
|
||||||
fetchModelTagOptions() {
|
fetchModelTagOptions() {
|
||||||
listData({ dictType: 'ss_model_tags' }).then(response => {
|
listData({ dictType: 'sm_model_tag' }).then(response => {
|
||||||
this.modelTagOptions = response.rows || []
|
this.modelTagOptions = response.rows || []
|
||||||
|
console.log(this.modelTagOptions, 'this.modelTagOptions');
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
this.$message.error("获取型号功能数据失败")
|
this.$message.error("获取型号功能数据失败")
|
||||||
})
|
})
|
||||||
|
@ -669,7 +674,25 @@ export default {
|
||||||
this.userTableLoading = false
|
this.userTableLoading = false
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
// 搜索按钮操作
|
||||||
|
handleUserQuery() {
|
||||||
|
this.userQueryParams.pageNum = 1;
|
||||||
|
this.getUserList();
|
||||||
|
},
|
||||||
|
|
||||||
|
// 重置按钮操作
|
||||||
|
resetUserQuery() {
|
||||||
|
this.$refs["queryForm"].resetFields();
|
||||||
|
this.userQueryParams = {
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
userName: undefined,
|
||||||
|
phonenumber: undefined,
|
||||||
|
status: undefined,
|
||||||
|
userType: '01'
|
||||||
|
};
|
||||||
|
this.handleUserQuery();
|
||||||
|
},
|
||||||
handleBindUser(row) {
|
handleBindUser(row) {
|
||||||
this.$modal.confirm('确认要将该设备绑定到商户"' + row.userName + '"吗?').then(() => {
|
this.$modal.confirm('确认要将该设备绑定到商户"' + row.userName + '"吗?').then(() => {
|
||||||
return bindDeviceUser({
|
return bindDeviceUser({
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||||
<el-form-item label="商户" prop="merchantId">
|
<el-form-item label="商户" prop="merchantId" v-if="!userId">
|
||||||
<el-select v-model="queryParams.merchantId" placeholder="请选择商户" clearable @change="handleQuery">
|
<el-select v-model="queryParams.merchantId" placeholder="请选择商户" clearable @change="handleMerchantChange">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in merchantOptions"
|
v-for="item in merchantOptions"
|
||||||
:key="item.userId"
|
:key="item.userId"
|
||||||
|
@ -142,7 +142,7 @@
|
||||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
||||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||||
<el-form-item label="商户" prop="merchantId">
|
<el-form-item label="商户" prop="merchantId">
|
||||||
<el-select v-model="form.merchantId" placeholder="请选择商户" clearable @change="handleQuery">
|
<el-select v-model="form.merchantId" placeholder="请选择商户" clearable @change="handleMerchantChangeInForm">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in merchantOptions"
|
v-for="item in merchantOptions"
|
||||||
:key="item.userId"
|
:key="item.userId"
|
||||||
|
@ -152,7 +152,7 @@
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="房间" prop="roomId">
|
<el-form-item label="房间" prop="roomId">
|
||||||
<el-select v-model="form.roomId" placeholder="请选择房间" clearable @change="handleQuery">
|
<el-select v-model="form.roomId" placeholder="请选择房间" clearable>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in roomOptions"
|
v-for="item in roomOptions"
|
||||||
:key="item.roomId"
|
:key="item.roomId"
|
||||||
|
@ -205,6 +205,7 @@ export default {
|
||||||
name: "Rule",
|
name: "Rule",
|
||||||
mixins: [$showColumns],
|
mixins: [$showColumns],
|
||||||
dicts: ['ss_fee_rule_mode'],
|
dicts: ['ss_fee_rule_mode'],
|
||||||
|
props: ['userId'],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
// 字段列表
|
// 字段列表
|
||||||
|
@ -258,25 +259,73 @@ export default {
|
||||||
form: {},
|
form: {},
|
||||||
// 表单校验
|
// 表单校验
|
||||||
rules: {
|
rules: {
|
||||||
|
merchantId: [
|
||||||
|
{ required: true, message: "商户不能为空", trigger: "change" }
|
||||||
|
],
|
||||||
|
roomId: [
|
||||||
|
{ required: true, message: "房间不能为空", trigger: "change" }
|
||||||
|
],
|
||||||
|
mode: [
|
||||||
|
{ required: true, message: "收费模式不能为空", trigger: "change" }
|
||||||
|
],
|
||||||
|
price: [
|
||||||
|
{ required: true, message: "售价不能为空", trigger: "blur" }
|
||||||
|
]
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.getList();
|
|
||||||
this.getRoomList();
|
|
||||||
this.getMerchantList();
|
this.getMerchantList();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
getMerchantList() {
|
getMerchantList() {
|
||||||
listUser({pageNum:1,pageSize:999 ,userType: '01'}).then(response => {
|
let params = {
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 999,
|
||||||
|
userType: '01'
|
||||||
|
}
|
||||||
|
if(this.userId) {
|
||||||
|
params.userId = this.userId
|
||||||
|
}
|
||||||
|
listUser(params).then(response => {
|
||||||
this.merchantOptions = response.rows;
|
this.merchantOptions = response.rows;
|
||||||
|
if(this.userId) {
|
||||||
|
// 在merchantOptions中查找匹配userId的商户
|
||||||
|
const merchant = this.merchantOptions.find(item => item.userId === this.userId);
|
||||||
|
if(merchant) {
|
||||||
|
this.queryParams.merchantId = merchant.userId;
|
||||||
|
// 获取该商户的房间列表
|
||||||
|
this.getList();
|
||||||
|
this.getRoomList(merchant.userId);
|
||||||
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
getRoomList() {
|
getRoomList(merchantId) {
|
||||||
listRoom({pageNum:1,pageSize:999 }).then(response => {
|
const params = {
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 999
|
||||||
|
};
|
||||||
|
if (merchantId) {
|
||||||
|
params.merchantId = merchantId;
|
||||||
|
}
|
||||||
|
listRoom(params).then(response => {
|
||||||
this.roomOptions = response.rows;
|
this.roomOptions = response.rows;
|
||||||
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
// 商户选择改变时触发(搜索表单)
|
||||||
|
handleMerchantChange(merchantId) {
|
||||||
|
this.queryParams.roomId = null; // 清空房间选择
|
||||||
|
this.getRoomList(merchantId);
|
||||||
|
this.handleQuery();
|
||||||
|
},
|
||||||
|
// 商户选择改变时触发(编辑表单)
|
||||||
|
handleMerchantChangeInForm(merchantId) {
|
||||||
|
this.form.roomId = null; // 清空房间选择
|
||||||
|
this.getRoomList(merchantId);
|
||||||
|
},
|
||||||
/** 当排序按钮被点击时触发 **/
|
/** 当排序按钮被点击时触发 **/
|
||||||
onSortChange(column) {
|
onSortChange(column) {
|
||||||
if (column.order == null) {
|
if (column.order == null) {
|
||||||
|
@ -326,6 +375,7 @@ export default {
|
||||||
/** 重置按钮操作 */
|
/** 重置按钮操作 */
|
||||||
resetQuery() {
|
resetQuery() {
|
||||||
this.resetForm("queryForm");
|
this.resetForm("queryForm");
|
||||||
|
this.roomOptions = []; // 清空房间选项
|
||||||
this.handleQuery();
|
this.handleQuery();
|
||||||
},
|
},
|
||||||
// 多选框选中数据
|
// 多选框选中数据
|
||||||
|
@ -346,6 +396,8 @@ export default {
|
||||||
const ruleId = row.ruleId || this.ids
|
const ruleId = row.ruleId || this.ids
|
||||||
getRule(ruleId).then(response => {
|
getRule(ruleId).then(response => {
|
||||||
this.form = response.data;
|
this.form = response.data;
|
||||||
|
// 获取对应商户的房间列表
|
||||||
|
this.getRoomList(this.form.merchantId);
|
||||||
this.open = true;
|
this.open = true;
|
||||||
this.title = "修改收费模板";
|
this.title = "修改收费模板";
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue
Block a user