|
@@ -69,26 +69,25 @@ export default {
|
|
|
const params = { ...this.cObj }
|
|
|
const disabled = false
|
|
|
if (!params.pri_image) params.pri_image = 'http://img.honglounews.com/20210429034015-4091.png'
|
|
|
- const remoteOptionsMachineList = []
|
|
|
- if (params.machineList) {
|
|
|
- params.machineList = params.machineList.map(item => {
|
|
|
- remoteOptionsMachineList.push({ keyRO: item.machineName, valRO: item.machineSn })
|
|
|
- return item.machineSn
|
|
|
+ let remoteOptionsHouse = []
|
|
|
+ if (params.estate_list && params.estate_list.length > 0) {
|
|
|
+ params.estate_id_list = params.estate_list.map(item => {
|
|
|
+ remoteOptionsHouse.push({ keyRO: item.estate_name, valRO: item.id })
|
|
|
+ return item.id
|
|
|
})
|
|
|
} else {
|
|
|
- params.machineList = []
|
|
|
+ params.estate_list = []
|
|
|
}
|
|
|
- // if (params.id) disabled = true
|
|
|
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: 'pri_image', type: 'upload' },
|
|
|
- // { label: '周边楼盘', key: 'machineList', type: 'selectRemote', multiple: true, changeHandle: this.deviceChange,
|
|
|
- // remoteParams: { skey: 'search_LIKE_machineName', api: `base.machinelist?search_EQ_status=1`, opKey: 'machineName', opVal: 'machineSn' },
|
|
|
- // remoteOptions: remoteOptionsMachineList
|
|
|
- // },
|
|
|
+ { label: '所属楼盘', key: 'estate_id_list', multiple: true, type: 'selectRemote', changeHandle: this.deviceChange,
|
|
|
+ remoteParams: { skey: 'estate_name', api: `house.admestatelist`, opKey: 'estate_name', opVal: 'id' },
|
|
|
+ remoteOptionsHouse
|
|
|
+ },
|
|
|
{ label: '学校地址', key: 'address' },
|
|
|
]
|
|
|
this.setDefaultValue(params)
|
|
@@ -100,11 +99,11 @@ export default {
|
|
|
const oldform = this.$refs.ruleForm.baseForm
|
|
|
const newForm = { ...oldform }
|
|
|
if (this.curObj.id) newForm.id = this.curObj.id
|
|
|
- // if (newForm.machineList && newForm.machineList.length > 0) {
|
|
|
- // newForm.machineList = newForm.machineList.join(',')
|
|
|
- // } else {
|
|
|
- // newForm.machineList = ''
|
|
|
- // }
|
|
|
+ if (newForm.estate_id_list && newForm.estate_id_list.length > 0) {
|
|
|
+ newForm.estate_id_list = newForm.estate_id_list.join(',')
|
|
|
+ } else {
|
|
|
+ newForm.estate_id_list = ''
|
|
|
+ }
|
|
|
newForm.longitude = this.cObj.longitude
|
|
|
newForm.latitude = this.cObj.latitude
|
|
|
if (!newForm.longitude) return this.$msgw('请选择经度!')
|