feat(智能柜): 添加归还期限字段及表单展示
在智能柜DTO中新增returnDeadline字段表示归还期限 在详情页和编辑表单中添加归还期限的显示和输入功能 0表示不限制归还期限,正整数表示具体天数
This commit is contained in:
parent
994e4c9538
commit
e35e88d0d8
|
@ -49,6 +49,8 @@ export interface SmartCabinetDTO {
|
|||
mode?: number;
|
||||
/** 借呗支付(1-正常使用 0-禁止使用) */
|
||||
balanceEnable?: number;
|
||||
/** 归还期限(天),0表示不限制 */
|
||||
returnDeadline?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -370,6 +370,7 @@ onMounted(() => {
|
|||
<!-- <el-descriptions-item label="商品模式">
|
||||
{{ cabinetInfo.belongType === 0 ? '借还模式' : '固资模式' }}
|
||||
</el-descriptions-item> -->
|
||||
<el-descriptions-item label="归还期限">{{ cabinetInfo.returnDeadline === 0 ? '不限制' : cabinetInfo.returnDeadline + '天' }}</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -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<SmartCabinetDTO>({
|
||||
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<FormRules>({
|
||||
|
@ -52,6 +53,10 @@ const rules = reactive<FormRules>({
|
|||
],
|
||||
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) => {
|
|||
<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="returnDeadline">
|
||||
<div style="width: 200px; display: flex; align-items: center;">
|
||||
<el-input v-model.number="formData.returnDeadline" :min="0" type="number" placeholder="0表示不限制" style="margin-right: 8px;" />
|
||||
<span>天</span>
|
||||
</div>
|
||||
</el-form-item>
|
||||
|
||||
<!-- <el-form-item label="商品模式" prop="belongType">
|
||||
<el-select v-model="formData.belongType" placeholder="请选择商品模式">
|
||||
|
|
Loading…
Reference in New Issue