完成房产模块功能

This commit is contained in:
gxwebsoft
2023-08-23 13:09:58 +08:00
parent 93e0876e13
commit 9e931e9f6b
10 changed files with 149 additions and 74 deletions

View File

@@ -196,7 +196,7 @@
dateFormat
} from '@/utils/util.js'
import * as UserApi from '@/api/user'
import { updateHouseInfo,getHouseInfo } from '@/api/house-info.js'
import { updateHouseInfo,getHouseInfo,addHouseInfo } from '@/api/house-info.js'
import * as UploadApi from '@/api/upload'
import * as DictApi from '@/api/dict.js'
@@ -225,7 +225,8 @@
// 表单数据
form: {
houseTitle: '',
area: ''
area: '',
status: 10
},
fileList1: [],
loading: false,
@@ -288,7 +289,12 @@
// 微信小程序需要用此写法
// this.$refs.datetimePicker.setFormatter(this.formatter)
},
onUnload() {
const eventChannel = this.getOpenerEventChannel();
eventChannel.emit('reload', {
status: true
});
},
methods: {
getDict() {
DictApi.listDictionary().then(res => {
@@ -409,15 +415,20 @@
if (app.disabled === true) return
console.log("app.tempFile: ", app.tempFile);
this.$refs.uForm.validate().then(() => {
app.disabled = true
app.form.houseLabel = JSON.stringify(app.houseLabel)
app.form.files = JSON.stringify(app.fileList1)
const saveOrUpdate = app.selectId > 0 ? updateHouseInfo : addHouseInfo;
saveOrUpdate(app.form).then(result => {
app.$toast('保存成功')
setTimeout(() => {
uni.navigateBack()
},1000)
}).catch(err => {
uni.$u.toast(err)
})
}).catch(errors => {
console.log('errors: ',errors);
uni.$u.toast('校验失败')
})