From 29cb1e44485ab76b92c40ae4e8e7c860a717da09 Mon Sep 17 00:00:00 2001 From: shijingjing <1789544664@qq.com> Date: Tue, 19 Apr 2022 14:38:12 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9B=9B=E9=82=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AppNeighborLinkage/AppNeighborLinkage.vue | 6 +- .../AppNeighborLinkage/addLinkage.vue | 60 ++++++++++++------- .../AppNeighborLinkage/familyInfo.vue | 37 +++++++++--- .../AppNeighborLinkage/myNeighborInfo.vue | 31 ++++++++-- .../AppNeighborLinkage/neighborDetail.vue | 1 + 5 files changed, 99 insertions(+), 36 deletions(-) diff --git a/project/sanjianxi/AppNeighborLinkage/AppNeighborLinkage.vue b/project/sanjianxi/AppNeighborLinkage/AppNeighborLinkage.vue index 584c869..75e930a 100644 --- a/project/sanjianxi/AppNeighborLinkage/AppNeighborLinkage.vue +++ b/project/sanjianxi/AppNeighborLinkage/AppNeighborLinkage.vue @@ -68,7 +68,11 @@ export default { }, onShow() { this.$dict.load('partyFourLinkageStatus') + uni.$on('update', ()=>{ + this.getList() + }) this.getList() + this.getUserInfo() }, methods: { search(e) { @@ -98,7 +102,7 @@ export default { this.list = this.current==1? res.data.records : [...this.list, ...res.data.records] } }) - } + }, }, onReachBottom() { this.current ++, diff --git a/project/sanjianxi/AppNeighborLinkage/addLinkage.vue b/project/sanjianxi/AppNeighborLinkage/addLinkage.vue index feac9ae..5d8e50f 100644 --- a/project/sanjianxi/AppNeighborLinkage/addLinkage.vue +++ b/project/sanjianxi/AppNeighborLinkage/addLinkage.vue @@ -3,13 +3,13 @@
*四邻对象
- +
*事件日期
- {{ form.checkTime }} + {{ form.linksageDate }} 请选择
@@ -19,9 +19,9 @@
*事件描述
- +
-
{{form.name.length}}/500
+
{{form.description.length}}/500
@@ -44,37 +44,55 @@ export default { }, isShowDate: false, form: { - type: '', - checkTime: '', - name: '', - partyId: '' + id: '', + linksageDate: '', + description: '', }, userList: [] } }, onShow() { this.$dict.load('agriculturalType') - this.getFourResident() + this.getUserList() }, methods: { onDateChange(e) { - this.form.checkTime = `${e.year}-${e.month}-${e.day}` + this.form.linksageDate = `${e.year}-${e.month}-${e.day}` }, - getFourResident() { - this.$instance.post('/app/apppartyfourresident/listFourResident', null, { - params: { - size: 10, - partyId: this.form.partyId, - }, - }).then((res) => { - if (res.code == 0) { - this.userList = res.data.records + getUserList() { + this.$instance.post('/app/apppartyfourresident/listFourResidentByApplet').then((res) => { + if(res?.data) { + res.data.map((item) => { + this.userList.push({ + label: item.name, + value: item.id, + }) + }) } }) }, confirm() { - if(!this.form.checkTime) - this.$instance.post('/app/apppartyfourlinkage/addOrUpdate') + if(!this.form.id) { + return this.$u.toast('请选择四邻对象') + } + if(!this.form.linksageDate) { + return this.$u.toast('请选择事件日期') + } + if(!this.form.description) { + return this.$u.toast('请输入事件描述') + } + + this.$instance.post('/app/apppartyfourlinkage/addOrUpdate',{ + ...this.form + }).then(res => { + if(res.code == 0) { + this.$u.toast('添加联动记录成功') + uni.$emit('update') + setTimeout(() => { + uni.navigateBack() + },600) + } + }) } } diff --git a/project/sanjianxi/AppNeighborLinkage/familyInfo.vue b/project/sanjianxi/AppNeighborLinkage/familyInfo.vue index b99fc83..fe8b847 100644 --- a/project/sanjianxi/AppNeighborLinkage/familyInfo.vue +++ b/project/sanjianxi/AppNeighborLinkage/familyInfo.vue @@ -1,16 +1,17 @@