Files
pj_admin_cloud/src/views/hard/hard-door-manager/index.vue
T
2025-04-10 09:57:09 +08:00

141 lines
3.5 KiB
Vue

<template>
<div class="layout-padding">
<div v-loading="loading" class="layout-padding-auto layout-padding-view" style="overflow: scroll !important">
<el-descriptions border :column="4" title="经营信息">
<template #extra>
<el-tooltip class="item" effect="dark" :content="$t('queryTree.refresh')" placement="top">
<el-button circle icon="Refresh" @click="doRefresh" />
</el-tooltip>
</template>
<el-descriptions-item label="今日交易金额:"> {{ displayPrice(0) }} </el-descriptions-item>
<el-descriptions-item label="本月交易金额:"> {{ displayPrice(0) }} </el-descriptions-item>
<el-descriptions-item label="本年交易金额:" :span="2"> {{ displayPrice(0) }} </el-descriptions-item>
</el-descriptions>
<el-descriptions :column="4" title="智能柜设置">
<template #extra>
<div class="flex justify-center items-center">
<el-button icon="Edit" type="primary" @click="doBind"> 修改 </el-button>
</div>
</template>
<el-descriptions-item label="商户名称"> {{}}</el-descriptions-item>
<el-descriptions-item label="设备编号"> {{ doorSetting.id }}</el-descriptions-item>
<el-descriptions-item label="设备名称"> {{}}</el-descriptions-item>
<el-descriptions-item label="机器编号"> {{}}</el-descriptions-item>
<el-descriptions-item label="外部设备编号"> {{}}</el-descriptions-item>
<el-descriptions-item label="SIM卡号"> {{}}</el-descriptions-item>
<el-descriptions-item label="地址"> {{}}</el-descriptions-item>
</el-descriptions>
</div>
</div>
</template>
<script setup lang="ts" name="systemHardDoorManager">
import { useMessage } from "/@/hooks/message"
import { displayPrice } from "/@/utils/formatMoney"
import * as hardDoorManager from "/@/api/hard/hard-door-manager"
const { query } = useRoute()
const doorSetting = ref<any>({})
const loading = ref(false)
const state = reactive<any>({
queryForm: {},
})
onMounted(async () => {
await getDetail()
})
const getDetail = async () => {
const id = query.id as unknown as any
if (!id) return
state.queryForm.orderId = id
const { data: orderData } = await hardDoorManager.getByHardId({ hardId: id })
if (orderData) {
doorSetting.value = orderData
}
if (!doorSetting.value.hardId) {
doorSetting.value.hardId = id
}
}
// 绑定
const doBind = async () => {
const pa = {
id: doorSetting.value.id,
hardId: doorSetting.value.hardId,
imei: doorSetting.value.imei,
deviceCode: doorSetting.value.deviceCode,
}
loading.value = true
try {
await hardDoorManager.bind(pa)
useMessage().success("绑定成功")
} catch (e: any) {
useMessage().error(e.msg)
} finally {
loading.value = false
}
}
// 重启
const doRestart = async () => {
const pa = {}
}
// 刷新
const doRefresh = async () => {
try {
loading.value = true
await getDetail()
} finally {
loading.value = false
}
}
</script>
<style lang="scss" scoped>
:deep(.el-descriptions) {
&:not(:nth-child(1)) {
margin-top: 20px;
}
.el-descriptions__cell.is-bordered-label {
width: 150px;
background-color: transparent;
border: none;
}
.el-descriptions__cell.is-bordered-content {
width: 200px;
border: none;
}
.el-descriptions__title {
display: flex;
align-items: center;
&::before {
display: inline-block;
width: 3px;
height: 20px;
margin-right: 10px;
background-color: #409eff;
content: "";
}
}
.el-descriptions-item__container {
margin: 0 10px;
.no-colon {
margin: 0;
&::after {
content: "";
}
}
}
}
</style>