更新
This commit is contained in:
parent
14648957f7
commit
c7197c7183
|
@ -88,3 +88,23 @@ export function transferDevice(data) {
|
|||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 设备解绑所属用户
|
||||
export function unbindDeviceMch(ids) {
|
||||
return request({
|
||||
url: '/bst/device/unbindMch',
|
||||
method: 'put',
|
||||
data: ids
|
||||
})
|
||||
}
|
||||
|
||||
// 设备解绑运营区
|
||||
export function unbindDeviceArea(ids) {
|
||||
return request({
|
||||
url: '/bst/device/unbindArea',
|
||||
method: 'put',
|
||||
data: ids
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -53,3 +53,12 @@ export function refreshDevice(data) {
|
|||
params: data
|
||||
})
|
||||
}
|
||||
|
||||
// 管理员设置声音
|
||||
export function setDeviceMusic(data) {
|
||||
return request({
|
||||
url: '/bst/device/iot/music',
|
||||
method: 'put',
|
||||
params: data
|
||||
})
|
||||
}
|
||||
|
|
|
@ -295,3 +295,21 @@
|
|||
.el-table__cell:has(.expand-container):hover {
|
||||
background-color: #f5f7fa !important;
|
||||
}
|
||||
|
||||
.tag-orange {
|
||||
background-color: #fdf2e2;
|
||||
border-color: rgb(255, 225, 209);
|
||||
color: rgb(255, 116, 41);
|
||||
}
|
||||
|
||||
.tag-purple {
|
||||
background-color: #f6e3ff;
|
||||
border-color: hsl(280, 100%, 92%);
|
||||
color: #b54ce9;
|
||||
}
|
||||
|
||||
.tag-yellow {
|
||||
background-color: #fff8e1;
|
||||
border-color: rgb(255, 245, 208);
|
||||
color: #f5a524;
|
||||
}
|
||||
|
|
|
@ -190,6 +190,28 @@
|
|||
v-has-permi="['bst:device:transfer']"
|
||||
>一键划拨</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="info"
|
||||
plain
|
||||
icon="el-icon-connection"
|
||||
size="mini"
|
||||
@click="handleUnbindMch(null)"
|
||||
:disabled="multiple"
|
||||
v-has-permi="['bst:device:unbindMch']"
|
||||
>一键解绑商户</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="info"
|
||||
plain
|
||||
icon="el-icon-map-location"
|
||||
size="mini"
|
||||
@click="handleUnbindArea(null)"
|
||||
:disabled="multiple"
|
||||
v-has-permi="['bst:device:unbindArea']"
|
||||
>一键解绑运营区</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList(true)" :columns="columns"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
|
@ -246,8 +268,11 @@
|
|||
<template v-else-if="column.key === 'voltage'">
|
||||
{{d.row.voltage | fix2 | dv}} V
|
||||
</template>
|
||||
<template v-else-if="column.key === 'isSound'">
|
||||
<boolean-tag :value="d.row[column.key]" size="mini" true-text="有声" false-text="静音"/>
|
||||
<template v-else-if="column.key === 'music'">
|
||||
<dict-tag :options="dict.type.device_music" :value="d.row[column.key]" size="mini"/>
|
||||
</template>
|
||||
<template v-else-if="column.key === 'hardwareVersion'">
|
||||
{{d.row.hardwareVersion | dv}} | {{d.row.softwareVersion | dv}}
|
||||
</template>
|
||||
<template v-else>
|
||||
{{d.row[column.key]}}
|
||||
|
@ -354,6 +379,22 @@
|
|||
@click="handleTransfer(scope.row)"
|
||||
v-has-permi="['bst:device:transfer']"
|
||||
>划拨</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-connection"
|
||||
@click="handleUnbindMch(scope.row)"
|
||||
v-has-permi="['bst:device:unbindMch']"
|
||||
v-show="scope.row.mchId != null"
|
||||
>解绑商户</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-map-location"
|
||||
@click="handleUnbindArea(scope.row)"
|
||||
v-has-permi="['bst:device:unbindArea']"
|
||||
v-show="scope.row.areaId != null"
|
||||
>解绑运营区</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
|
@ -389,7 +430,7 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import { listDevice, delDevice, inDevice, outDevice, disableDevice, enableDevice} from "@/api/bst/device";
|
||||
import { listDevice, delDevice, inDevice, outDevice, disableDevice, enableDevice, unbindDeviceMch, unbindDeviceArea} from "@/api/bst/device";
|
||||
import { unlockDevice, lockDevice, ringDevice, rebootDevice, unlockSeatDevice, refreshDevice} from "@/api/bst/deviceIot";
|
||||
import { $showColumns } from '@/utils/mixins';
|
||||
import FormCol from "@/components/FormCol/index.vue";
|
||||
|
@ -409,7 +450,7 @@ const defaultSort = {
|
|||
export default {
|
||||
name: "Device",
|
||||
mixins: [$showColumns, $device],
|
||||
dicts: ['device_status', 'device_lock_status', 'device_iot_status', 'device_online_status', 'device_quality'],
|
||||
dicts: ['device_status', 'device_lock_status', 'device_iot_status', 'device_online_status', 'device_quality', 'device_music'],
|
||||
components: {FormCol, DeviceEditDialog, BooleanTag, DeviceTransferDialog, DeviceSn},
|
||||
props: {
|
||||
query: {
|
||||
|
@ -433,7 +474,7 @@ export default {
|
|||
{key: 'lockStatus', visible: true, label: '锁状态', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
{key: 'voltage', visible: true, label: '电压', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
{key: 'remainingPower', visible: true, label: '续航', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
{key: 'isSound', visible: true, label: '声音', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
{key: 'music', visible: true, label: '声音', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
{key: 'remark', visible: true, label: '备注', minWidth: null, sortable: true, overflow: true, align: 'center', width: null},
|
||||
{key: 'orderNo', visible: true, label: '订单', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
{key: 'createTime', visible: true, label: '创建', minWidth: null, sortable: true, overflow: false, align: 'center', width: "90"},
|
||||
|
@ -759,7 +800,49 @@ export default {
|
|||
this.download('bst/device/export', {
|
||||
...this.queryParams
|
||||
}, `device_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
},
|
||||
// 一键解绑商户
|
||||
handleUnbindMch(row) {
|
||||
let msg = '是否确认一键解绑商户?';
|
||||
let ids = this.ids;
|
||||
if (row != null) {
|
||||
ids = [row.id];
|
||||
msg = '是否确认解绑设备【' + row.sn + '】的商户?';
|
||||
}
|
||||
this.$confirm(msg, {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
unbindDeviceMch(ids).then((res) => {
|
||||
if (res.code === 200) {
|
||||
this.$message.success("操作成功,共解绑" + res.data + "台设备");
|
||||
this.getList(true);
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
// 一键解绑运营区
|
||||
handleUnbindArea(row) {
|
||||
let msg = '是否确认一键解绑运营区?';
|
||||
let ids = this.ids;
|
||||
if (row != null) {
|
||||
ids = [row.id];
|
||||
msg = '是否确认解绑设备【' + row.sn + '】的运营区?';
|
||||
}
|
||||
this.$confirm(msg, {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
unbindDeviceArea(ids).then((res) => {
|
||||
if (res.code === 200) {
|
||||
this.$message.success("操作成功,共解绑" + res.data + "台设备");
|
||||
this.getList(true);
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
|
|
@ -30,6 +30,7 @@
|
|||
<el-descriptions-item label="状态">
|
||||
<dict-tag :options="dict.type.device_status" :value="detail.status" size="small"/>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="版本">{{ detail.hardwareVersion | dv }} | {{ detail.softwareVersion | dv }}</el-descriptions-item>
|
||||
<el-descriptions-item label="锁状态">
|
||||
<dict-tag :options="dict.type.device_lock_status" :value="detail.lockStatus" size="small"/>
|
||||
</el-descriptions-item>
|
||||
|
@ -43,7 +44,7 @@
|
|||
<dict-tag :options="dict.type.device_iot_status" :value="detail.iotStatus" size="small"/>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="声音">
|
||||
<boolean-tag :value="detail.isSound" size="small" true-text="有声" false-text="静音"/>
|
||||
<dict-tag :options="dict.type.device_music" :value="detail.music" size="small"/>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="创建时间">{{ detail.createTime | dv }}</el-descriptions-item>
|
||||
<el-descriptions-item label="最后上线时间">{{ detail.lastOnlineTime | dv }}</el-descriptions-item>
|
||||
|
@ -135,7 +136,7 @@ import DeviceSn from '@/views/bst/device/components/DeviceSn.vue';
|
|||
export default {
|
||||
name: 'DeviceView',
|
||||
mixins: [$device],
|
||||
dicts: ['device_status', 'device_lock_status', 'device_online_status', 'device_quality', 'device_iot_status', 'order_status', 'order_device_status'],
|
||||
dicts: ['device_status', 'device_lock_status', 'device_online_status', 'device_quality', 'device_iot_status', 'order_status', 'order_device_status', 'device_music'],
|
||||
components: {
|
||||
CollapsePanel,
|
||||
BooleanTag,
|
||||
|
|
|
@ -78,19 +78,15 @@
|
|||
:row-class-name="tableRowClassName">
|
||||
:tree-props="{children: 'children', hasChildren: 'hasChildren'}">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="版本号" align="center" prop="version" />
|
||||
<el-table-column label="生产时间" align="center" prop="productionTime" width="180">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.productionTime, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="版本号" align="left" prop="version" />
|
||||
<el-table-column label="生产时间" align="center" prop="productionTime" width="180"/>
|
||||
<el-table-column label="总量" width="80" align="center" prop="quantity" :formatter="formatNum" class-name="bold-text"/><!-- 手动 -->
|
||||
<el-table-column label="已录入" width="80" align="center" prop="enteredNum" :formatter="formatNum" class-name="bold-text"/>
|
||||
<el-table-column label="已绑定" width="80" align="center" prop="bound" :formatter="formatNum" class-name="bold-text"/>
|
||||
<el-table-column label="未绑定" width="80" align="center" prop="unBound" :formatter="formatNum" class-name="bold-text"/>
|
||||
<el-table-column label="未录入" width="80" align="center" prop="notEnteredNum" :formatter="formatNum" class-name="bold-text"/><!-- 手动 -->
|
||||
<el-table-column label="丢损" width="80" align="center" prop="lost" :formatter="formatNum" class-name="bold-text"/>
|
||||
<el-table-column label="版本说明" width="280" align="center" prop="instructions" />
|
||||
<el-table-column label="版本说明" width="280" align="center" prop="instructions" show-overflow-tooltip/>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
|
@ -103,7 +99,7 @@
|
|||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
icon="el-icon-plus"
|
||||
v-if="scope.row.parentId == 0"
|
||||
@click="handleAddChild(scope.row)"
|
||||
v-hasPermi="['bst:hardwareVersion:edit']"
|
||||
|
@ -134,21 +130,23 @@
|
|||
<el-input v-model="form.version" placeholder="请输入版本号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="生产时间" prop="productionTime">
|
||||
<el-date-picker clearable
|
||||
v-model="form.productionTime"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
placeholder="请选择生产时间">
|
||||
<el-date-picker
|
||||
clearable
|
||||
style="width: 100%"
|
||||
v-model="form.productionTime"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
placeholder="请选择生产时间">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="form.parentId == 0" label="数量" prop="quantity">
|
||||
<el-input v-model="form.quantity" placeholder="请输入数量" />
|
||||
<el-input v-model="form.quantity" placeholder="请输入数量" type="number"/>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="form.parentId == 0" label="未录入" prop="notEnteredNum">
|
||||
<el-input v-model="form.notEnteredNum" placeholder="请输入未录入数" />
|
||||
<el-input v-model="form.notEnteredNum" placeholder="请输入未录入数" type="number"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="版本说明" prop="instructions">
|
||||
<el-input v-model="form.instructions" type="textarea" placeholder="请输入内容" />
|
||||
<el-input v-model="form.instructions" type="textarea" placeholder="请输入内容" maxlength="5000" show-word-limit />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
|
@ -198,6 +196,9 @@ export default {
|
|||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
version: [
|
||||
{ required: true, message: "版本号不能为空", trigger: "blur" },
|
||||
],
|
||||
}
|
||||
};
|
||||
},
|
||||
|
@ -206,7 +207,7 @@ export default {
|
|||
},
|
||||
methods: {
|
||||
tableRowClassName({row, rowIndex}) {
|
||||
if (row.parentId === 0) {
|
||||
if (row.parentId === "0") {
|
||||
return 'success-row';
|
||||
}
|
||||
return '';
|
||||
|
@ -324,7 +325,7 @@ export default {
|
|||
</script>
|
||||
<style lang="scss">
|
||||
.el-table .success-row {
|
||||
background: oldlace !important;
|
||||
background: rgb(239, 246, 253) !important;
|
||||
}
|
||||
.bold-text .cell {
|
||||
font-weight: bold;
|
||||
|
|
Loading…
Reference in New Issue
Block a user