11
This commit is contained in:
1 parent
24b5dfe141
commit
0b3614077f
6 files changed
+64
-93
No files matched your search
@@ -1,59 +1,29 @@
|
||||
<template>
|
||||
<div class="layout-padding">
|
||||
<div v-loading="loading" class="layout-padding-auto layout-padding-view" style="overflow: scroll !important">
|
||||
<el-descriptions :column="3" border title="智能柜设置">
|
||||
<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="设备IMEI卡号">
|
||||
<el-input v-model="doorSetting.imei" style="width: 100%" placeholder="请输入设备IMEI卡号" clearable />
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="设备编号"> {{ doorSetting.id }} </el-descriptions-item>
|
||||
<el-descriptions-item label="操作">
|
||||
<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="Paperclip" type="primary" @click="doBind"> 绑定 </el-button>
|
||||
<el-button icon="Edit" type="primary" @click="doBind"> 修改 </el-button>
|
||||
</div>
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
<el-descriptions :column="3" border title="智能柜详情">
|
||||
<el-descriptions-item label="货柜数量"> {{ doorSetting.cabinetNum }} </el-descriptions-item>
|
||||
<el-descriptions-item label="摄像头数量"> {{ doorSetting.cabinetCameraNum }} </el-descriptions-item>
|
||||
<el-descriptions-item label="称重单元数量"> {{ doorSetting.cabinetWeightUnitNum }} </el-descriptions-item>
|
||||
<el-descriptions-item :span="3" label="智能柜" labelClassName="no-colon">
|
||||
<el-table border>
|
||||
<el-table-column label="货柜号" align="center" prop="cabinetNo" />
|
||||
<el-table-column label="锁在线" align="center" prop="isLockOnline" />
|
||||
<el-table-column label="是否开锁" align="center" prop="lockStatus" />
|
||||
<el-table-column label="门状态" align="center" prop="lockStatus" />
|
||||
<el-table-column label="货柜售卖状态" align="center" prop="lockStatus" />
|
||||
</el-table>
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
<el-descriptions :column="3" border title="智能柜状态">
|
||||
<el-descriptions-item label="通电状态"> {{ doorSetting.powerStatus }} </el-descriptions-item>
|
||||
<el-descriptions-item label="设备是否在线"> {{ doorSetting.cabinetNum }} </el-descriptions-item>
|
||||
<el-descriptions-item label="是否在售"> {{ doorSetting.cabinetNum }} </el-descriptions-item>
|
||||
</el-descriptions>
|
||||
<el-descriptions :column="3" border title="sim卡信号">
|
||||
<el-descriptions-item label="sim卡信号强度"> {{ doorSetting.signalIntensity }} </el-descriptions-item>
|
||||
<el-descriptions-item label="sim卡信号更新时间"> {{ doorSetting.signalTime }} </el-descriptions-item>
|
||||
<el-descriptions-item label=""></el-descriptions-item>
|
||||
</el-descriptions>
|
||||
<el-descriptions :column="3" border title="信噪信息">
|
||||
<el-descriptions-item label="信噪比"> {{ doorSetting.signalRatio }} </el-descriptions-item>
|
||||
<el-descriptions-item label=""></el-descriptions-item>
|
||||
<el-descriptions-item label=""></el-descriptions-item>
|
||||
</el-descriptions>
|
||||
<el-descriptions :column="3" border title="重启设置">
|
||||
<el-descriptions-item label="最后重启时间"> {{ doorSetting.restartTime }} </el-descriptions-item>
|
||||
<el-descriptions-item label=""> </el-descriptions-item>
|
||||
<el-descriptions-item label="操作">
|
||||
<div class="flex justify-center items-center">
|
||||
<el-button icon="RefreshRight" type="primary" @click="doRestart"> 重启 </el-button>
|
||||
</div>
|
||||
</el-descriptions-item>
|
||||
</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>
|
||||
@@ -61,6 +31,7 @@
|
||||
|
||||
<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"
|
||||
|
||||
@@ -93,7 +64,12 @@ const getDetail = async () => {
|
||||
|
||||
// 绑定
|
||||
const doBind = async () => {
|
||||
const pa = { id: doorSetting.value.id, hardId: doorSetting.value.hardId, imei: doorSetting.value.imei }
|
||||
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)
|
||||
@@ -129,10 +105,13 @@ const doRefresh = async () => {
|
||||
|
||||
.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 {
|
||||
|
||||
@@ -2,11 +2,6 @@
|
||||
<el-dialog :title="form.id ? '编辑' : '新增'" width="30%" v-model="visible" :close-on-click-modal="false" draggable>
|
||||
<el-form ref="dataFormRef" :model="form" :rules="dataRules" formDialogRef label-width="90px" v-loading="loading">
|
||||
<el-row :gutter="24">
|
||||
<el-col :span="24" class="mb20">
|
||||
<el-form-item label="商户" prop="mchId">
|
||||
<select-mch v-model="form.mchId" :apiParams="{ types: '2' }" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24" class="mb20">
|
||||
<el-form-item label="分类名" prop="name">
|
||||
<el-input v-model="form.name" placeholder="请输入分类名" />
|
||||
@@ -54,7 +49,6 @@ const form = reactive({
|
||||
|
||||
// 定义校验规则
|
||||
const dataRules = ref({
|
||||
mchId: [{ required: true, message: "请选择商户", trigger: "change" }],
|
||||
name: [{ required: true, message: "分类名不能为空", trigger: "blur" }],
|
||||
sort: [{ required: true, message: "商户不能为空", trigger: "blur" }],
|
||||
})
|
||||
|
||||
@@ -51,11 +51,6 @@
|
||||
<el-table-column type="selection" width="40" align="center" />
|
||||
<el-table-column type="index" label="#" width="40" />
|
||||
<el-table-column prop="name" label="分类名" show-overflow-tooltip />
|
||||
<el-table-column label="商户" show-overflow-tooltip>
|
||||
<template #default="{ row }">
|
||||
<span>{{ row.merchantName }} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="sort" label="排序" show-overflow-tooltip />
|
||||
<el-table-column label="操作" width="150">
|
||||
<template #default="scope">
|
||||
|
||||
@@ -2,20 +2,6 @@
|
||||
<el-dialog :title="form.id ? '编辑' : '新增'" width="40%" v-model="visible" :close-on-click-modal="false" draggable>
|
||||
<el-form ref="dataFormRef" :model="form" :rules="dataRules" formDialogRef label-width="100px" v-loading="loading">
|
||||
<el-row :gutter="24">
|
||||
<el-col :span="24" class="mb20">
|
||||
<el-form-item label="设备" prop="hardId">
|
||||
<select-hard v-model="form.hardId" :apiParams="{ type: '4' }" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24" class="mb20">
|
||||
<el-form-item prop="hardDoorNumber">
|
||||
<template #label>
|
||||
<span>放置层数</span>
|
||||
<tip content="商品在智能柜的层数,按层数放置会提高识别率" />
|
||||
</template>
|
||||
<el-input-number :min="0" :step="1" v-model="form.hardDoorNumber" placeholder="" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24" class="mb20">
|
||||
<el-form-item label="商品名" prop="name">
|
||||
<el-input v-model="form.name" placeholder="请输入商品名" />
|
||||
@@ -31,6 +17,21 @@
|
||||
<upload-imgs v-model="form.pic" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24" class="mb20">
|
||||
<el-form-item label="口味" prop="specsTaste">
|
||||
<el-input v-model="form.specsTaste" placeholder="" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24" class="mb20">
|
||||
<el-form-item label="容量" prop="specsCapacity">
|
||||
<el-input v-model="form.specsCapacity" placeholder="" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24" class="mb20">
|
||||
<el-form-item label="重量" prop="specsWeight">
|
||||
<el-input v-model="form.specsWeight" placeholder="" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24" class="mb20">
|
||||
<el-form-item label="单价" prop="price">
|
||||
<el-input-number :precision="2" :min="0" :step="1" v-model="form.price" placeholder="" />
|
||||
@@ -79,6 +80,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts" name="HardSpuDialog">
|
||||
import { storePrice, displayPrice } from "/@/utils/formatMoney"
|
||||
import { useDict } from "/@/hooks/dict"
|
||||
import { useMessage } from "/@/hooks/message"
|
||||
import * as hardSpu from "/@/api/hard/hard-spu"
|
||||
@@ -97,6 +99,9 @@ const form = reactive({
|
||||
spuCategoryId: "",
|
||||
name: "",
|
||||
pic: "",
|
||||
specsTaste: "",
|
||||
specsCapacity: "",
|
||||
specsWeight: "",
|
||||
price: 0,
|
||||
salesCount: 0,
|
||||
repertoryCount: 0,
|
||||
@@ -142,7 +147,8 @@ const onSubmit = async () => {
|
||||
|
||||
try {
|
||||
loading.value = true
|
||||
form.id ? await hardSpu.putObj(form) : await hardSpu.addObj(form)
|
||||
const _pa = { ...form, price: storePrice(form.price) }
|
||||
form.id ? await hardSpu.putObj(_pa) : await hardSpu.addObj(_pa)
|
||||
useMessage().success(form.id ? "修改成功" : "添加成功")
|
||||
visible.value = false
|
||||
emit("refresh")
|
||||
@@ -160,7 +166,7 @@ const gethardSpuData = (id: string) => {
|
||||
hardSpu
|
||||
.getObj(id)
|
||||
.then((res: any) => {
|
||||
Object.assign(form, res.data)
|
||||
Object.assign(form, res.data, { price: displayPrice(res.data.price, "", 0) })
|
||||
})
|
||||
.finally(() => {
|
||||
loading.value = false
|
||||
|
||||
@@ -37,26 +37,26 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="categoryName" width="120" label="分类" />
|
||||
<el-table-column width="150" label="商户">
|
||||
<template #default="{ row }">
|
||||
<span>{{ row.merchantName }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column width="150" label="放置层数">
|
||||
<template #default="{ row }">
|
||||
<span>{{ row.hardDoorNumber }}层</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column width="150" label="设备名">
|
||||
<template #default="{ row }">
|
||||
<span>{{ row.hardName }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="price" label="单价">
|
||||
<template #default="{ row }">
|
||||
<span class="color-success">{{ displayPrice(row.price) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="类型">
|
||||
<template #default="{ row }">
|
||||
<dict-tag :options="hard_ks_sku_type" :value="row.skuType" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="price" width="240" label="规格">
|
||||
<template #default="{ row }">
|
||||
<span>口味:</span>
|
||||
<span class="color-primary">{{ row.specsTaste }}</span>
|
||||
<span>容量:</span>
|
||||
<span class="color-primary">{{ row.specsCapacity }}</span>
|
||||
<span>重量:</span>
|
||||
<span class="color-primary">{{ row.specsWeight }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="salesCount" label="销量">
|
||||
<template #default="{ row }">
|
||||
<span class="color-primary">{{ row.salesCount }}</span>
|
||||
@@ -107,7 +107,7 @@ import { displayPrice } from "/@/utils/formatMoney"
|
||||
// 引入组件
|
||||
const FormDialog = defineAsyncComponent(() => import("./form.vue"))
|
||||
// 定义查询字典
|
||||
const { yes_no_type } = useDict("yes_no_type")
|
||||
const { yes_no_type, hard_ks_sku_type } = useDict("yes_no_type", "hard_ks_sku_type")
|
||||
// 定义变量内容
|
||||
const formDialogRef = ref()
|
||||
// 搜索变量
|
||||
|
||||
Reference in new issue
Block a user