|
@@ -65,8 +65,11 @@ export default {
|
|
|
},
|
|
|
},
|
|
|
methods: {
|
|
|
- getDef() {
|
|
|
- const params = { ...this.cObj }
|
|
|
+ getDef (str) {
|
|
|
+ let params = { ...this.cObj }
|
|
|
+ if (str === 'school_type') {
|
|
|
+ params = {...this.$refs.ruleForm.baseForm}
|
|
|
+ }
|
|
|
const disabled = false
|
|
|
if (!params.pri_image) params.pri_image = 'http://img.honglounews.com/20210429034015-4091.png'
|
|
|
let remoteOptionsHouse = []
|
|
@@ -78,24 +81,48 @@ export default {
|
|
|
} else {
|
|
|
params.estate_list = []
|
|
|
}
|
|
|
- this.formData = [
|
|
|
- { label: '学校名称', key: 'school_name', class: 'c-2' },
|
|
|
- { label: '所属区域', key: 'area_type', type: 'select', class: 'c-2', options: this.$dictData.area_type },
|
|
|
- { label: '学校属性', key: 'school_attrib', type: 'select', class: 'c-2', options: this.$dictData.school_attrib },
|
|
|
- { label: '学校类型', key: 'school_type', type: 'select', class: 'c-2', options: this.$dictData.school_type },
|
|
|
- { label: '学校分类', key: 'school_cate', type: 'select', class: 'c-2', options: this.$dictData. school_cate },
|
|
|
- { label: '学校预警', key: 'school_warn', type: 'select', class: 'c-2', options: this.$dictData.school_warn },
|
|
|
- { label: '主图', key: 'pri_image', type: 'upload', class: 'c-2' },
|
|
|
- { label: '学区范围图', key: 'district_img', type: 'upload', class: 'c-2' },
|
|
|
- { label: '学区范围', key: 'district',type: 'textarea' },
|
|
|
- { label: '所属楼盘', key: 'estate_id_list', multiple: true, type: 'selectRemote', changeHandle: this.deviceChange,
|
|
|
- remoteParams: { skey: 'estate_name', api: `house.admestatelist`, opKey: 'estate_name', opVal: 'id' },
|
|
|
- remoteOptions: remoteOptionsHouse
|
|
|
- },
|
|
|
- { label: '学校地址', key: 'address' },
|
|
|
- ]
|
|
|
+ if (params.school_type === '2') {
|
|
|
+ this.formData = [
|
|
|
+ { label: '学校名称', key: 'school_name', class: 'c-2' },
|
|
|
+ { label: '所属区域', key: 'area_type', type: 'select', class: 'c-2', options: this.$dictData.area_type },
|
|
|
+ { label: '学校属性', key: 'school_attrib', type: 'select', class: 'c-2', options: this.$dictData.school_attrib },
|
|
|
+ { label: '学校类型', key: 'school_type', type: 'select', class: 'c-2', options: this.$dictData.school_type, changeHandle: this.typeChange },
|
|
|
+ { label: '学校分类', key: 'school_cate', type: 'select', class: 'c-2', options: this.$dictData.school_cate },
|
|
|
+ { label: '学校预警', key: 'school_warn', type: 'select', class: 'c-2', options: this.$dictData.school_warn },
|
|
|
+ { label: '主图', key: 'pri_image', type: 'upload', class: 'c-2' },
|
|
|
+ { label: '学区范围图', key: 'district_img', type: 'upload', class: 'c-2' },
|
|
|
+ { label: '学区范围', key: 'district',type: 'textarea' },
|
|
|
+ { label: '所属楼盘', key: 'estate_id_list', multiple: true, type: 'selectRemote',
|
|
|
+ remoteParams: { skey: 'estate_name', api: `house.admestatelist`, opKey: 'estate_name', opVal: 'id' },
|
|
|
+ remoteOptions: remoteOptionsHouse
|
|
|
+ },
|
|
|
+ { label: '学校地址', key: 'address' },
|
|
|
+ { label: '学费', key: 'tuition', class: 'c-2', type: 'inputFont', appendFont: '元/年' },
|
|
|
+ { label: '是否住宿', key: 'is_live', type: 'select', class: 'c-2', options: this.$dictData.sys_yesno },
|
|
|
+ ]
|
|
|
+ } else {
|
|
|
+ this.formData = [
|
|
|
+ { label: '学校名称', key: 'school_name', class: 'c-2' },
|
|
|
+ { label: '所属区域', key: 'area_type', type: 'select', class: 'c-2', options: this.$dictData.area_type },
|
|
|
+ { label: '学校属性', key: 'school_attrib', type: 'select', class: 'c-2', options: this.$dictData.school_attrib },
|
|
|
+ { label: '学校类型', key: 'school_type', type: 'select', class: 'c-2', options: this.$dictData.school_type, changeHandle: this.typeChange },
|
|
|
+ { label: '学校分类', key: 'school_cate', type: 'select', class: 'c-2', options: this.$dictData.school_cate },
|
|
|
+ { label: '学校预警', key: 'school_warn', type: 'select', class: 'c-2', options: this.$dictData.school_warn },
|
|
|
+ { label: '主图', key: 'pri_image', type: 'upload', class: 'c-2' },
|
|
|
+ { label: '学区范围图', key: 'district_img', type: 'upload', class: 'c-2' },
|
|
|
+ { label: '学区范围', key: 'district',type: 'textarea' },
|
|
|
+ { label: '所属楼盘', key: 'estate_id_list', multiple: true, type: 'selectRemote',
|
|
|
+ remoteParams: { skey: 'estate_name', api: `house.admestatelist`, opKey: 'estate_name', opVal: 'id' },
|
|
|
+ remoteOptions: remoteOptionsHouse
|
|
|
+ },
|
|
|
+ { label: '学校地址', key: 'address' },
|
|
|
+ ]
|
|
|
+ }
|
|
|
this.setDefaultValue(params)
|
|
|
},
|
|
|
+ typeChange () {
|
|
|
+ this.getDef('school_type')
|
|
|
+ },
|
|
|
close(str) {
|
|
|
if (str === 'confirm') {
|
|
|
this.$refs['ruleForm'].$refs['baseForm'].validate((valid) => {
|