diff --git a/src/apps/AppFourNeighbor/Add.vue b/src/apps/AppFourNeighbor/Add.vue index 3fdc3782..256c19f6 100644 --- a/src/apps/AppFourNeighbor/Add.vue +++ b/src/apps/AppFourNeighbor/Add.vue @@ -5,16 +5,17 @@ *党员信息
- 请选择 - + + +
*四邻对象
-
- 请选择 +
+ {{form.residentName || '请选择'}}
@@ -22,8 +23,8 @@
*事件日期
-
- 请选择 +
+ {{form.linksageDate || '请选择'}}
@@ -33,12 +34,14 @@
- -
{{ value.length }}/500
+ +
{{ form.description.length }}/500
- @@ -49,7 +52,19 @@ export default { name: 'Add', data() { return { - value: '' + value: '', + form: { + partyName: '', + partyId: '', + residentName: '', + residentId: '', + linksageDate: '', + description: '' + }, + showTimeSelect: false, + userList: [], + showUserSelect: false, + params: {year: true, month: true, day: true, hour: false, minute: false, second: false}, } }, computed: { @@ -61,10 +76,65 @@ export default { }, onShow() { document.title = '新增' - }, methods: { - + rules() { + return { + partyId: '请选择党员信息', + residentId: '请选择四邻对象', + linksageDate: '请选择事件日期', + description: '请输入事件描述', + } + }, + confirm() { + const rules = this.rules() + for (let v of Object.keys(rules)) { + if (!this.form[v]) { + return this.$u.toast(rules[v]) + } + } + this.$http.post('/app/apppartyfourlinkage/addOrUpdate', {...this.form}).then(res => { + if (res.code == 0) { + this.$u.toast('提交成功') + uni.$emit('reload') + uni.navigateBack({ + delta: 1 + }) + } + }).catch((err) => { + this.$u.toast(err) + }) + }, + confirmSelectTime(e) { + this.form.linksageDate = e.year + '-' + e.month + '-' + e.day + }, + selectUser() { + if(!this.form.partyId) { + return this.$u.toast('请先选择党员信息') + } + this.showUserSelect = true + }, + confirmSelectUser(e) { + this.form.residentId = e[0].value + this.form.residentName = e[0].label + }, + handlePartySelect(e) { + this.form.partyId = e[0].id + this.form.partyName = e[0].name + this.getUserList() + }, + getUserList() { + this.$http.post('/app/apppartyfourresident/listFourResident', null, { + params: { + size: 10, + partyId: this.form.partyId, + }, + }).then((res) => { + if (res.code == 0) { + this.userList = res.data.records + } + }) + } }, } diff --git a/src/apps/AppFourNeighbor/AppFourNeighbor.vue b/src/apps/AppFourNeighbor/AppFourNeighbor.vue index 501cec2b..82dc3a06 100644 --- a/src/apps/AppFourNeighbor/AppFourNeighbor.vue +++ b/src/apps/AppFourNeighbor/AppFourNeighbor.vue @@ -4,38 +4,28 @@
- {{search.time || '日期选择' }} - + {{search.linksageDate || '日期选择' }} +
- +
-
-
+
+
-

帮助赵顺伟咨询户口迁移问题帮助赵顺伟咨询户口迁移问题

-
党员信息张三
-
四邻对象张三
-
事件日期2022-04-15
+

{{item.description}}

+
党员信息{{item.partyName}}
+
四邻对象{{item.residentName}}
+
事件日期{{item.linksageDate}}
- 待审核 -
-
-
-
-

帮助赵顺伟咨询户口迁移问题帮助赵顺伟咨询户口迁移问题

-
党员信息张三
-
四邻对象张三
-
事件日期2022-04-15
-
-
- 待审核 + {{$dict.getLabel('partyFourLinkageStatus', item.status)}}
+ @@ -51,9 +41,11 @@ export default { appName: '四邻联动', data() { return { - search: {title: '', time: ''}, + search: {title: '', linksageDate: ''}, showTimeSelect: false, params: {year: true, month: true, day: true, hour: false, minute: false, second: false}, + current: 1, + list: [] } }, computed: { @@ -61,26 +53,53 @@ export default { }, created() { - this.$dict.load('appSpecialTypeFive') + this.$dict.load('partyFourLinkageStatus').then(() => { + this.getList() + }) + uni.$on('reload', () => { + this.getListInit() + }) }, onShow() { document.title = '四邻联动' - }, methods: { + getList() { + this.$http.post('/app/apppartyfourlinkage/list', null, { + params: { + size: 20, + current: this.current, + linksageDate: this.search.linksageDate + }, + }) + .then((res) => { + if (res.code == 0) { + this.list = this.current > 1 ? [...this.list, ...res.data.records] : res.data.records + } + }) + }, + getListInit() { + this.current = 1 + this.datas = [] + this.getList() + }, clearTime() { - this.search.time = '' + this.search.linksageDate = '' }, selectTime(e) { - this.search.time = e.year + '-' + e.month + '-' + e.day + this.search.linksageDate = e.year + '-' + e.month + '-' + e.day }, toAdd() { uni.navigateTo({url: './Add'}) }, - toDetail() { - uni.navigateTo({url: './Detail'}) + toDetail(id) { + uni.navigateTo({url: `./Detail?id=${id}`}) } }, + onReachBottom() { + this.current = this.current + 1 + this.getList() + }, } diff --git a/src/apps/AppFourNeighbor/Content.vue b/src/apps/AppFourNeighbor/Content.vue index 726606a2..d7a342ab 100644 --- a/src/apps/AppFourNeighbor/Content.vue +++ b/src/apps/AppFourNeighbor/Content.vue @@ -6,10 +6,10 @@
- -
{{ value.length }}/500
+ +
{{ remark.length }}/500
- @@ -22,22 +22,34 @@ export default { name: 'Add', data() { return { - value: '' + id: '', + remark: '' } }, computed: { ...mapState(['user']), - }, - created() { - this.$dict.load('appSpecialTypeFive') + onLoad(option) { + this.id = option.id }, onShow() { document.title = '新增' - }, methods: { - + pass() { + if(!this.remark) { + return this.$u.toast('请输入审核意见') + } + this.$http.post(`/app/apppartyfourlinkage/auditById?id=${this.id}&status=0&remark=${this.remark}`).then((res) => { + if (res.code == 0) { + this.$u.toast('审核成功') + uni.navigateBack({ + delta: 1 + }) + uni.$emit('reload') + } + }) + } }, } diff --git a/src/apps/AppFourNeighbor/Detail.vue b/src/apps/AppFourNeighbor/Detail.vue index 678bbaad..1d48870c 100644 --- a/src/apps/AppFourNeighbor/Detail.vue +++ b/src/apps/AppFourNeighbor/Detail.vue @@ -2,23 +2,23 @@
党员信息
-
待审核
+
{{form.partyName}}
四邻对象
-
张三
+
{{form.residentName}}
事件日期
-
2022-04-15
+
{{form.linksageDate}}
事件描述
-
帮助赵顺伟咨询户口迁移问题
- @@ -30,24 +30,47 @@ export default { name: 'detail', data() { return { - value: '' + id: '', + form: {} } }, computed: { ...mapState(['user']), }, - created() { - this.$dict.load('appSpecialTypeFive') + onLoad(option) { + this.id = option.id + this.getDetail() + uni.$on('reload', () => { + this.getDetail() + }) }, onShow() { document.title = '四邻联动' - }, methods: { toContent() { - uni.navigateTo({url: './Content'}) + uni.navigateTo({url: `./Content?id=${this.id}`}) + }, + getDetail() { + this.$http.post(`/app/apppartyfourlinkage/queryDetailById?id=${this.id}`).then((res) => { + if (res.code == 0) { + this.form = res.data + } + }) + }, + pass() { + this.$confirm('是否确认审核通过?').then(() => { + this.$http.post(`/app/apppartyfourlinkage/auditById?id=${this.id}&status=1`).then((res) => { + if (res.code == 0) { + this.$u.toast('审核成功') + this.getDetail() + uni.$emit('reload') + } + }) + }) } + }, } diff --git a/src/apps/AppPartyPoints/AppPartyPoints.vue b/src/apps/AppPartyPoints/AppPartyPoints.vue index 61f6682c..3e5841c9 100644 --- a/src/apps/AppPartyPoints/AppPartyPoints.vue +++ b/src/apps/AppPartyPoints/AppPartyPoints.vue @@ -37,8 +37,11 @@ export default { computed: { ...mapState(['user']), }, - created() { + onLoad() { this.getList() + uni.$on('reload', () => { + this.getListInit() + }) }, onShow() { document.title = '党员积分'