NONGJINGQUANXIAOCHENGXU/pages/baseinfo/index.js

99 lines
2.1 KiB
JavaScript
Raw Normal View History

2025-03-24 10:28:28 +08:00
Component({
behaviors: [],
properties: {},
data: {
dataObjParam: {},
familyMember:{},
cbfbm: '',
errordialog: false,
errorCorrection: '纠错'
}, // 私有数据,可用于模板渲染
lifetimes: {
// 生命周期函数,可以为函数,或一个在 methods 段中定义的方法名
attached: function () {
this.cbfbm = getApp().globalData.cbfbm
this.getFamilyMemberData()
},
moved: function () { },
detached: function () { },
},
pageLifetimes: {
// 组件所在页面的生命周期函数
show: function () { },
hide: function () { },
resize: function () { },
},
methods: {
getFamilyMemberData(){
var that = this;
let url = getApp().globalData.API + '/api/LandContract/GetCbfData'
let param = {
cbfbm: this.cbfbm
}
wx.request({
url: url,
data: param,
method: 'GET',
header: {
'content-type': 'application/json' // 默认值
},
success (res) {
console.log('res',res)
that.setData({
dataObjParam: res.data.result.cbf,
familyMember: res.data.result.jtcy_list
})
}
})
},
submitSure(){
let param = {
cbfbm: this.cbfbm,
isconfirm: 1
}
this.submitInfo(param)
},
submitError(){
this.setData({
errordialog: true
})
},
handleClose(){
this.setData({
errordialog: false
})
},
handleSure(){
this.setData({
errordialog: false
})
let param = {
cbfbm: this.cbfbm,
remark: this.errorCorrection
}
this.submitInfo(param)
},
submitInfo(param){
let url = getApp().globalData.API + '/api/CbfInfo/ConfirmCbfInfo'
wx.request({
url: url,
data: param,
method: 'POST',
header: {
'content-type': 'application/json' // 默认值
},
success (res) {
wx.showToast({
title: '操作成功',
icon: 'success',
duration: 2000
})
}
})
}
}
})