liujq 4 年之前
父节点
当前提交
dce551f03c
共有 1 个文件被更改,包括 37 次插入4 次删除
  1. 37 4
      src/views/house/components/popup/OldEdit.vue

+ 37 - 4
src/views/house/components/popup/OldEdit.vue

@@ -130,7 +130,15 @@ export default {
           { label: '区域', key: 'area_type', class: 'c-3', type: 'select', options: this.$dictData.area_type},
           { label: '产品类型', key: 'product_type', class: 'c-3', type: 'select', options: this.$dictData.product_type},
           { label: `产品户型`, label2: `快捷选择工具`, key: `HT`, class: 'c-3', type: 'select', options: this.roomAreaList, changeHandle: this.htChange,},
-          { label: '面积', key: 'area', class: 'c-3', type: 'inputFont', appendFont: '㎡'},
+          { label: '面积', key: 'area', class: 'c-3', type: 'inputFont', appendFont: '㎡', rules: [
+            { validator: (rule, value, callback) => {
+              if (Number(value) < 0 || isNaN(Number(value))) {
+                callback(new Error('请输入数字'))
+              } else {
+                callback()
+              }
+            }, trigger: 'blur' },
+          ]},
           { label: '房源户型', key: 'house_type', class: 'c-3', type: 'select', options: this.$dictData.house_type},
           { label: '房源标题', key: 'title'},
           { label: '户型图', key: 'house_img', class: 'c-3', type: 'upload' },
@@ -142,10 +150,35 @@ export default {
             }
           }, 
           { label: '房源地址', key: 'address' },
-          { label: '详细地址', label2: '如:1栋2单元305室', class: 'c-3s', key: 'detail_address' },
+          { label: '总价', key: 'price', class: 'c-3', type: 'inputFont', appendFont: '万元', rules: [
+            { validator: (rule, value, callback) => {
+              if (Number(value) < 0 || isNaN(Number(value))) {
+                callback(new Error('请输入数字'))
+              } else {
+                callback()
+              }
+            }, trigger: 'blur' },
+          ]},
+          { label: '层高', class: 'c-3', key: 'floor_height', rules: [
+            { validator: (rule, value, callback) => {
+              if (Number(value) < 0 || isNaN(Number(value))) {
+                callback(new Error('请输入数字'))
+              } else {
+                callback()
+              }
+            }, trigger: 'blur' },
+          ] },
+          { label: '总层数', class: 'c-3', key: 'height', rules: [
+            { validator: (rule, value, callback) => {
+              if (Number(value) < 0 || isNaN(Number(value))) {
+                callback(new Error('请输入数字'))
+              } else {
+                callback()
+              }
+            }, trigger: 'blur' },
+          ] },
+          { label: '详细地址', label2: '如:1栋2单元305室', class: 'c-3', key: 'detail_address' },
           { label: '满几年', key: 'how_many_year', class: 'c-3', type: 'select', options: this.$dictData.house_room_year },
-          { label: '总价', key: 'price', class: 'c-3', type: 'inputFont', appendFont: '万元'},
-          { label: '层高', label2: '如:6/7', class: 'c-3', key: 'floor_height' },
           { label: '是否装修', key: 'is_dec', class: 'c-3', type: 'select', options: this.$dictData.sys_yesno },
           { label: '业主称呼', class: 'c-3', key: 'owner' },
           { label: '业主电话', class: 'c-3', key: 'phone' },