29187
This commit is contained in:
@@ -34,7 +34,7 @@
|
||||
<script>
|
||||
export default {
|
||||
name: "addLinkage",
|
||||
appName: "添加联动记录",
|
||||
appName: "添加联动记录", // :"修改联动记录"
|
||||
data() {
|
||||
return {
|
||||
params: {
|
||||
@@ -48,17 +48,37 @@ export default {
|
||||
linksageDate: '',
|
||||
description: '',
|
||||
},
|
||||
userList: []
|
||||
userList: [],
|
||||
id: '',
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
this.$dict.load('agriculturalType')
|
||||
this.getUserList()
|
||||
},
|
||||
onLoad(o) {
|
||||
if (o?.id) {
|
||||
this.id = o.id
|
||||
this.getDetail()
|
||||
this.form = JSON.parse(JSON.stringify(this.data))
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
onDateChange(e) {
|
||||
this.form.linksageDate = `${e.year}-${e.month}-${e.day}`
|
||||
},
|
||||
getDetail() {
|
||||
this.$instance.post('/app/apppartyfourlinkage/queryDetailById',null,{
|
||||
params: {
|
||||
id: this.id,
|
||||
}
|
||||
}).then(res => {
|
||||
if(res.code == 0) {
|
||||
// this.data = res.data
|
||||
this.form = JSON.parse(JSON.stringify(res.data))
|
||||
}
|
||||
})
|
||||
},
|
||||
getUserList() {
|
||||
this.$instance.post('/app/apppartyfourresident/listFourResidentByApplet').then((res) => {
|
||||
if(res?.data) {
|
||||
@@ -71,6 +91,7 @@ export default {
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
confirm() {
|
||||
if(!this.form.residentId) {
|
||||
return this.$u.toast('请选择四邻对象')
|
||||
@@ -83,14 +104,23 @@ export default {
|
||||
}
|
||||
|
||||
this.$instance.post('/app/apppartyfourlinkage/addByWxApplet',{
|
||||
...this.form
|
||||
...this.form,
|
||||
id: this.id || '',
|
||||
}).then(res => {
|
||||
if(res.code == 0) {
|
||||
this.$u.toast('添加联动记录成功')
|
||||
this.$u.toast('提交成功')
|
||||
uni.$emit('update')
|
||||
setTimeout(() => {
|
||||
uni.navigateBack()
|
||||
},600)
|
||||
if (!this.id) {
|
||||
setTimeout(() => {
|
||||
uni.navigateBack()
|
||||
},600)
|
||||
} else {
|
||||
setTimeout(() => {
|
||||
uni.navigateBack({
|
||||
delta: 2
|
||||
})
|
||||
},600)
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user