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) => {
+
+
+
+ 天
+
+