8/4 更新 输入限制,修复收银台
This commit is contained in:
@@ -31,7 +31,7 @@
|
||||
<el-col :span="2"></el-col>
|
||||
<el-col :span="11">
|
||||
<el-form-item label="建筑面积" prop="houseArea">
|
||||
<el-input maxlength="8" v-model="form.houseArea" placeholder="请输入建筑面积">
|
||||
<el-input maxlength="8" v-model.trim="form.houseArea" placeholder="请输入建筑面积">
|
||||
<template #append>
|
||||
<span>㎡</span>
|
||||
</template>
|
||||
@@ -42,7 +42,7 @@
|
||||
<el-row>
|
||||
<el-col :span="11">
|
||||
<el-form-item label="公摊面积" prop="shareArea">
|
||||
<el-input maxlength="8" v-model="form.shareArea" placeholder="请输入公摊面积">
|
||||
<el-input maxlength="8" v-model.trim="form.shareArea" placeholder="请输入公摊面积">
|
||||
<template #append>
|
||||
<span>㎡</span>
|
||||
</template>
|
||||
@@ -52,7 +52,7 @@
|
||||
<el-col :span="2"></el-col>
|
||||
<el-col :span="11">
|
||||
<el-form-item label="实用面积" prop="internalArea">
|
||||
<el-input maxlength="8" v-model="form.internalArea" placeholder="请输入实用面积">
|
||||
<el-input maxlength="8" v-model.trim="form.internalArea" placeholder="请输入实用面积">
|
||||
<template #append>
|
||||
<span>㎡</span>
|
||||
</template>
|
||||
@@ -61,7 +61,7 @@
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input type="textarea" maxlength="200" show-word-limit :rows="5" v-model="form.remark" placeholder="请输入备注" />
|
||||
<el-input type="textarea" maxlength="200" show-word-limit :rows="5" v-model.trim="form.remark" placeholder="请输入备注" />
|
||||
</el-form-item>
|
||||
<el-form-item style="margin-top: 30px">
|
||||
<el-button type="primary" @click="submitForm">提交</el-button>
|
||||
@@ -80,6 +80,7 @@ import { getBuildinglists } from '@/api/system/house';
|
||||
import { addStoreroom, getStoreroom, updateStoreroom } from '@/api/system/storeroom';
|
||||
import { StoreroomVO } from '@/api/system/storeroom/types';
|
||||
import { getByBUildingidtoUnitNo } from '@/api/system/houseUnit';
|
||||
import { validator } from '@/utils/Reg';
|
||||
|
||||
const route = useRoute();
|
||||
const router = useRouter();
|
||||
@@ -100,7 +101,17 @@ const form = ref<StoreroomVO>({
|
||||
const rules = ref({
|
||||
buildingId: [{ required: true, message: '请选择楼栋', trigger: 'blur' }],
|
||||
unitNoId: [{ required: true, message: '请选择单元', trigger: 'blur' }],
|
||||
storeroomNo: [{ required: true, message: '请输入储藏室号', trigger: 'blur' }],
|
||||
storeroomNo: [
|
||||
{ required: true, message: '请输入储藏室号', trigger: 'blur' },
|
||||
{
|
||||
validator: (_: any, val: string | number, callback: (arg0?: Error) => void) => {
|
||||
if (val === '' || val === null || val === undefined) {
|
||||
return callback(new Error('请输入储藏室号'));
|
||||
}
|
||||
return validator(val, 'Character') ? callback() : callback(new Error('请输入中文,字母,数字,-,_等字符'));
|
||||
}
|
||||
}
|
||||
],
|
||||
houseArea: [
|
||||
{ required: true, message: '请输入建筑面积', trigger: 'blur' },
|
||||
{
|
||||
@@ -112,7 +123,7 @@ const rules = ref({
|
||||
if (Number.isNaN(val)) {
|
||||
return callback(new Error('请输入数字'));
|
||||
}
|
||||
if (val <= 0) {
|
||||
if (val < 0) {
|
||||
return callback(new Error('请输入大于0的数字'));
|
||||
}
|
||||
return callback();
|
||||
@@ -130,7 +141,7 @@ const rules = ref({
|
||||
if (Number.isNaN(val)) {
|
||||
return callback(new Error('请输入数字'));
|
||||
}
|
||||
if (val <= 0) {
|
||||
if (val < 0) {
|
||||
return callback(new Error('请输入大于0的数字'));
|
||||
}
|
||||
return callback();
|
||||
@@ -148,7 +159,7 @@ const rules = ref({
|
||||
if (Number.isNaN(val)) {
|
||||
return callback(new Error('请输入数字'));
|
||||
}
|
||||
if (val <= 0) {
|
||||
if (val < 0) {
|
||||
return callback(new Error('请输入大于0的数字'));
|
||||
}
|
||||
return callback();
|
||||
|
||||
Reference in New Issue
Block a user