feat(智能柜): 添加归属类型字段并更新相关逻辑
在智能柜模块中添加归属类型字段,包括表单、详情页和API接口的更新,以支持区分借还柜和固资通两种类型
This commit is contained in:
parent
b1f4216df6
commit
c01a01519a
src
api/cabinet
views/cabinet/smart-cabinet-card
|
@ -2,47 +2,97 @@ import { http } from '@/utils/http';
|
|||
import { CabinetCellDTO } from './cabinet-cell';
|
||||
|
||||
export interface SmartCabinetQuery extends BasePageQuery {
|
||||
/** 柜机名称 */
|
||||
cabinetName?: string;
|
||||
/** 柜机类型(0主柜 1副柜) */
|
||||
cabinetType?: number;
|
||||
/** 柜机模版编号 */
|
||||
templateNo?: string;
|
||||
/** 归属类型(0-借还柜 1-固资通) */
|
||||
belongType?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 智能柜信息
|
||||
* @description 智能柜信息表
|
||||
*/
|
||||
export interface SmartCabinetDTO {
|
||||
/** 柜机唯一ID */
|
||||
cabinetId?: number;
|
||||
/** 柜机名称 */
|
||||
cabinetName: string;
|
||||
/** 柜机类型(0主柜 1副柜) */
|
||||
cabinetType: number;
|
||||
/** 归属主柜ID */
|
||||
mainCabinet?: number;
|
||||
/** 归属主柜名称 */
|
||||
mainCabinetName?: string;
|
||||
/** MQTT服务ID */
|
||||
mqttServerId?: number;
|
||||
/** 商店ID */
|
||||
shopId?: number;
|
||||
/** 商店名称 */
|
||||
shopName?: string;
|
||||
/** 柜机模版编号 */
|
||||
templateNo: string;
|
||||
/** 锁控板序号 */
|
||||
lockControlNo: number;
|
||||
/** 柜机位置 */
|
||||
location: number;
|
||||
/** 操作人 */
|
||||
operator?: string;
|
||||
/** 归属类型(0-借还柜 1-固资通) */
|
||||
belongType?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加智能柜命令
|
||||
*/
|
||||
export interface AddSmartCabinetCommand {
|
||||
/** 柜机名称 */
|
||||
cabinetName: string;
|
||||
/** 柜机类型(0主柜 1副柜) */
|
||||
cabinetType: number;
|
||||
/** 归属主柜ID */
|
||||
mainCabinet?: number;
|
||||
/** MQTT服务ID */
|
||||
mqttServerId?: number;
|
||||
/** 商店ID */
|
||||
shopId?: number;
|
||||
/** 柜机模版编号 */
|
||||
templateNo: string;
|
||||
/** 锁控板序号 */
|
||||
lockControlNo: number;
|
||||
/** 柜机位置 */
|
||||
location: number;
|
||||
/** 归属类型(0-借还柜 1-固资通) */
|
||||
belongType: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新智能柜命令
|
||||
*/
|
||||
export interface UpdateSmartCabinetCommand {
|
||||
/** 柜机唯一ID */
|
||||
cabinetId: number;
|
||||
/** 柜机名称 */
|
||||
cabinetName?: string;
|
||||
/** 柜机类型(0主柜 1副柜) */
|
||||
cabinetType?: number;
|
||||
/** 归属主柜ID */
|
||||
mainCabinet?: number;
|
||||
/** MQTT服务ID */
|
||||
mqttServerId?: number;
|
||||
/** 商店ID */
|
||||
shopId?: number;
|
||||
/** 柜机模版编号 */
|
||||
templateNo?: string;
|
||||
/** 锁控板序号 */
|
||||
lockControlNo?: number;
|
||||
/** 柜机位置 */
|
||||
location?: number;
|
||||
/** 归属类型(0-借还柜 1-固资通) */
|
||||
belongType?: number;
|
||||
}
|
||||
|
||||
export interface AllCabinetDataDTO {
|
||||
|
|
|
@ -295,6 +295,9 @@ onMounted(() => {
|
|||
<el-descriptions :column="2" border>
|
||||
<el-descriptions-item label="主柜ID">{{ cabinetInfo.mainCabinet || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="主柜名称">{{ cabinetInfo.mainCabinetName || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="归属类型">
|
||||
{{ cabinetInfo.belongType === 0 ? '借还柜' : '固资通' }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="MQTT服务器ID">{{ cabinetInfo.mqttServerId || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="操作员">{{ cabinetInfo.operator || '-' }}</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
|
@ -343,7 +346,7 @@ onMounted(() => {
|
|||
</el-table-column>
|
||||
<el-table-column label="操作" width="150" fixed="right">
|
||||
<template #default="{ row }">
|
||||
<el-button type="success" link :icon="useRenderIcon(AddFill)" @click="handleConfigure(row)">
|
||||
<el-button v-if="cabinetInfo.belongType === 0" type="success" link :icon="useRenderIcon(AddFill)" @click="handleConfigure(row)">
|
||||
配置商品
|
||||
</el-button>
|
||||
|
||||
|
|
|
@ -26,7 +26,8 @@ const formData = reactive({
|
|||
cabinetType: 1,
|
||||
templateNo: "",
|
||||
lockControlNo: 0,
|
||||
location: 0
|
||||
location: 0,
|
||||
belongType: 0
|
||||
});
|
||||
|
||||
const rules = reactive<FormRules>({
|
||||
|
@ -39,6 +40,9 @@ const rules = reactive<FormRules>({
|
|||
location: [
|
||||
{ required: true, message: "位置信息必填", trigger: "blur" },
|
||||
{ type: 'number', min: 0, message: '位置编号不能为负数', trigger: 'blur' }
|
||||
],
|
||||
belongType: [
|
||||
{ required: true, message: "请选择归属类型", trigger: "change" }
|
||||
]
|
||||
});
|
||||
|
||||
|
@ -91,6 +95,14 @@ watch(() => props.cabinetInfo, (newVal) => {
|
|||
<el-option v-for="option in templateOptions" :key="option.value" :label="option.label" :value="option.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="归属类型" prop="belongType">
|
||||
<el-select v-model="formData.belongType" placeholder="请选择归属类型">
|
||||
<el-option label="借还柜" :value="0" />
|
||||
<el-option label="固资通" :value="1" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item>
|
||||
<el-button type="primary" :icon="useRenderIcon(Confirm)" @click="handleConfirm">
|
||||
确认
|
||||
|
|
|
@ -13,6 +13,7 @@ export interface FormDTO {
|
|||
templateNo: string;
|
||||
lockControlNo: number;
|
||||
location: number;
|
||||
belongType: number;
|
||||
}
|
||||
|
||||
const props = defineProps({
|
||||
|
@ -30,7 +31,8 @@ const formData = reactive<FormDTO>({
|
|||
cabinetType: 1,
|
||||
templateNo: "",
|
||||
lockControlNo: 0,
|
||||
location: 0
|
||||
location: 0,
|
||||
belongType: 0
|
||||
});
|
||||
|
||||
const rules = reactive<FormRules>({
|
||||
|
@ -43,6 +45,9 @@ const rules = reactive<FormRules>({
|
|||
location: [
|
||||
{ required: true, message: "位置信息必填", trigger: "blur" },
|
||||
{ type: 'number', min: 0, message: '位置编号不能为负数', trigger: 'blur' }
|
||||
],
|
||||
belongType: [
|
||||
{ required: true, message: "请选择归属类型", trigger: "change" }
|
||||
]
|
||||
});
|
||||
|
||||
|
@ -87,6 +92,14 @@ const templateOptions = Object.entries(CabinetImgMap).map(([value, item]) => ({
|
|||
<el-option v-for="option in templateOptions" :key="option.value" :label="option.label" :value="option.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="归属类型" prop="belongType">
|
||||
<el-select v-model="formData.belongType" placeholder="请选择归属类型">
|
||||
<el-option label="借还柜" :value="0" />
|
||||
<el-option label="固资通" :value="1" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item>
|
||||
<el-button type="primary" :icon="useRenderIcon(Confirm)" @click="handleConfirm">
|
||||
确认
|
||||
|
|
Loading…
Reference in New Issue