From e35e88d0d80672c7b2832d2f9baebb01e687b172 Mon Sep 17 00:00:00 2001 From: dzq Date: Sat, 19 Jul 2025 17:43:46 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E6=99=BA=E8=83=BD=E6=9F=9C):=20=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E5=BD=92=E8=BF=98=E6=9C=9F=E9=99=90=E5=AD=97=E6=AE=B5?= =?UTF-8?q?=E5=8F=8A=E8=A1=A8=E5=8D=95=E5=B1=95=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 在智能柜DTO中新增returnDeadline字段表示归还期限 在详情页和编辑表单中添加归还期限的显示和输入功能 0表示不限制归还期限,正整数表示具体天数 --- src/api/cabinet/smart-cabinet.ts | 2 ++ src/views/cabinet/smart-cabinet-card/detail.vue | 1 + .../smart-cabinet-card/edit-cabinet-drawer.vue | 17 ++++++++++++++--- 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/src/api/cabinet/smart-cabinet.ts b/src/api/cabinet/smart-cabinet.ts index 3a0507d..9c66543 100644 --- a/src/api/cabinet/smart-cabinet.ts +++ b/src/api/cabinet/smart-cabinet.ts @@ -49,6 +49,8 @@ export interface SmartCabinetDTO { mode?: number; /** 借呗支付(1-正常使用 0-禁止使用) */ balanceEnable?: number; + /** 归还期限(天),0表示不限制 */ + returnDeadline?: number; } /** diff --git a/src/views/cabinet/smart-cabinet-card/detail.vue b/src/views/cabinet/smart-cabinet-card/detail.vue index 7e47c28..a8c4fcf 100644 --- a/src/views/cabinet/smart-cabinet-card/detail.vue +++ b/src/views/cabinet/smart-cabinet-card/detail.vue @@ -370,6 +370,7 @@ onMounted(() => { + {{ cabinetInfo.returnDeadline === 0 ? '不限制' : cabinetInfo.returnDeadline + '天' }} diff --git a/src/views/cabinet/smart-cabinet-card/edit-cabinet-drawer.vue b/src/views/cabinet/smart-cabinet-card/edit-cabinet-drawer.vue index 8d7982b..6ea91f3 100644 --- a/src/views/cabinet/smart-cabinet-card/edit-cabinet-drawer.vue +++ b/src/views/cabinet/smart-cabinet-card/edit-cabinet-drawer.vue @@ -2,7 +2,7 @@ import { ref, reactive, watch } from "vue"; import { ElMessage } from "element-plus"; import { useRenderIcon } from "@/components/ReIcon/src/hooks"; -import { updateSmartCabinet } from "@/api/cabinet/smart-cabinet"; +import { SmartCabinetDTO, updateSmartCabinet } from "@/api/cabinet/smart-cabinet"; import Confirm from "@iconify-icons/ep/check"; import type { FormRules } from 'element-plus'; import { CabinetImgMap } from "@/utils/cabinetImgMap"; @@ -22,7 +22,7 @@ const props = defineProps({ const emit = defineEmits(["update:modelValue", "refresh"]); const formRef = ref(); -const formData = reactive({ +const formData = reactive({ cabinetName: "", cabinetType: 1, templateNo: "", @@ -30,7 +30,8 @@ const formData = reactive({ location: 0, belongType: 0, mode: 0, - balanceEnable: 1 + balanceEnable: 1, + returnDeadline: 0 }); const rules = reactive({ @@ -52,6 +53,10 @@ const rules = reactive({ ], balanceEnable: [ { required: true, message: "请选择借呗支付状态", trigger: "change" } + ], + returnDeadline: [ + { required: true, message: "请输入归还期限", trigger: "blur" }, + { type: 'number', min: 0, message: '归还期限不能为负数', trigger: 'blur' } ] }); @@ -112,6 +117,12 @@ watch(() => props.cabinetInfo, (newVal) => { + +
+ + +
+