From c0a4211ceea5018525f585f76389b11c3b5f847e Mon Sep 17 00:00:00 2001 From: jianjun Date: Tue, 21 Jun 2022 09:38:26 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E5=B1=85=E6=B0=91=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E8=8C=83=E5=9B=B4=20=E6=94=B9=E4=B8=BA=E7=BB=84=E7=BB=87?= =?UTF-8?q?=E6=A0=91=E6=9A=82=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/components/resiSearch.vue | 78 ++++++++++++++++++++++++----- 1 file changed, 66 insertions(+), 12 deletions(-) diff --git a/src/views/components/resiSearch.vue b/src/views/components/resiSearch.vue index 45f56bf3..29b0f6ea 100644 --- a/src/views/components/resiSearch.vue +++ b/src/views/components/resiSearch.vue @@ -4,6 +4,20 @@ +
+
所属组织
+
+ +
+
+
+
所属房屋
@@ -271,7 +285,7 @@ export default { }) let form = initForm(itemList, this.columnName) let tempFormList = itemList.map(item => { - + return { ...item, isChange: this.columnName && this.columnName === item.columnName ? true : false @@ -285,6 +299,14 @@ export default { UNIT_ID: '', HOME_ID: '' } + let orgOptionProps = { + multiple: false, + value: 'agencyId', + label: 'agencyName', + children: 'subAgencyList', + checkStrictly: true + } + return { pageLoading: false, openSearch: false, @@ -293,10 +315,14 @@ export default { optionsH: [], optionsD: [], optionsG: [], + orgOptions: [], + orgOptionProps, + agencyIdArray:[], value: '', itemList, fixedList: [], fixedForm: { + AGENCY_ID: '', GRID_ID: '', VILLAGE_ID: '', BUILD_ID: '', @@ -306,6 +332,7 @@ export default { constForm, form: { ...form, + AGENCY_ID: '', GRID_ID: '', VILLAGE_ID: '', BUILD_ID: '', @@ -391,7 +418,7 @@ export default { created() { // this.initForm() // console.log('formcccc---', this.form) - + this.getOrgTreeList() this.getGridList() this.getValiheList() if (this.columnName) this.handleChangeForm(this.columnName) @@ -428,7 +455,7 @@ export default { } } else if (typeof this.form[n] == 'object') this.form[n] = [] else this.form[n] = '' - + } // let arr3 = [...arr1, ...arr] this.$emit('search', []) @@ -444,7 +471,7 @@ export default { tableName: item.tableName, columnName: item.columnName, // columnValue: [] - columnValue: this.form[item.columnName] && + columnValue: this.form[item.columnName] && (itemTypes.includes(item.queryType) || itemTypes.includes(item.itemType) ? this.form[item.columnName] @@ -474,6 +501,16 @@ export default { this.form.BIRTHDAY = [s, e] } }, + handleChangeAgency(val) { + this.form.AGENCY_ID = this.agencyIdArray.length > 0 ? this.agencyIdArray[this.agencyIdArray.length - 1] : ''; + console.log('this.form.AGENCY_ID', this.form.AGENCY_ID) + this.form.VILLAGE_ID = '' + this.form.GRID_ID = '' + this.form.BUILD_ID = '' + this.form.UNIT_ID = '' + this.form.HOME_ID = '' + this.getValiheList() + }, handleChangeGrid(val) { console.log('val', val) this.form.VILLAGE_ID = '' @@ -503,6 +540,7 @@ export default { // 监听基础form handleChangeForm(val) { for (let n in this.fixedForm) { + debugger if (n === val) { if (this.fixedList.length > 0) { let _item = {} @@ -515,7 +553,7 @@ export default { console.log('fixedList----val', this.fixedList) } else { _item = { - queryType: 'equal', + queryType: 'like',//'equal', tableName: 'ic_resi_user', columnName: val, columnValue: [this.form[val]] @@ -527,7 +565,7 @@ export default { if (Object.keys(_item).length > 0 && !hasVal) this.fixedList.push(_item) } else { this.$set(this.fixedList, 0, { - queryType: 'equal', + queryType: 'like',//'equal', tableName: 'ic_resi_user', columnName: val, columnValue: [this.form[val]] @@ -540,6 +578,22 @@ export default { if (item.columnName === val) item.isChange = true }) }, + getOrgTreeList() { + const { user } = this.$store.state + this.$http + .post('/gov/org/customeragency/agencygridtree', {}) + .then(({ data: res }) => { + if (res.code !== 0) { + return this.$message.error(res.msg) + } else { + console.log('获取组织树成功', res.data) + this.orgOptions = res.data + } + }) + .catch(() => { + return this.$message.error('网络错误') + }) + }, getGridList() { const { user } = this.$store.state this.$http @@ -561,7 +615,7 @@ export default { this.$http .post('/gov/org/icneighborhood/neighborhoodoption', { gridId: this.form.GRID_ID, - agencyId: '' + agencyId: this.form.AGENCY_ID, // agencyId: user.agencyId }) .then(({ data: res }) => { @@ -626,10 +680,10 @@ export default { }) }, computedBirth(age) { - let now = new Date(); - let nowYear = now.getFullYear(); - let nowMonth = now.getMonth()+1; - let nowDay = now.getDate(); // 按照减法原理,先day相减,不够向month借;然后month相减,不够向year借;最后year相减。 + let now = new Date(); + let nowYear = now.getFullYear(); + let nowMonth = now.getMonth()+1; + let nowDay = now.getDate(); // 按照减法原理,先day相减,不够向month借;然后month相减,不够向year借;最后year相减。 let subYear = nowYear - age if(nowMonth < 10){ nowMonth = '0'+ nowMonth From fe977bd7b84235dc9e667a408d3a79a991d59242 Mon Sep 17 00:00:00 2001 From: jiangyy Date: Tue, 21 Jun 2022 09:53:14 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E5=B1=85=E6=B0=91=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/components/resiSearch.vue | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/views/components/resiSearch.vue b/src/views/components/resiSearch.vue index 29b0f6ea..8bfeb169 100644 --- a/src/views/components/resiSearch.vue +++ b/src/views/components/resiSearch.vue @@ -370,6 +370,10 @@ export default { } } ] + }, + + queryType:{ + 'AGENCY_ID':'like' } } }, @@ -540,7 +544,7 @@ export default { // 监听基础form handleChangeForm(val) { for (let n in this.fixedForm) { - debugger + if (n === val) { if (this.fixedList.length > 0) { let _item = {} @@ -553,7 +557,7 @@ export default { console.log('fixedList----val', this.fixedList) } else { _item = { - queryType: 'like',//'equal', + queryType: this.queryType[val]?this.queryType[val]:'equal',//'equal', tableName: 'ic_resi_user', columnName: val, columnValue: [this.form[val]] @@ -565,7 +569,7 @@ export default { if (Object.keys(_item).length > 0 && !hasVal) this.fixedList.push(_item) } else { this.$set(this.fixedList, 0, { - queryType: 'like',//'equal', + queryType: this.queryType[val]?this.queryType[val]:'equal',//'equal', tableName: 'ic_resi_user', columnName: val, columnValue: [this.form[val]] @@ -587,7 +591,8 @@ export default { return this.$message.error(res.msg) } else { console.log('获取组织树成功', res.data) - this.orgOptions = res.data + this.orgOptions=[] + this.orgOptions .push( res.data) } }) .catch(() => { From c6f20924c2acb4b0f9e7c9bd2fe471da84b3ef4c Mon Sep 17 00:00:00 2001 From: jiangyy Date: Tue, 21 Jun 2022 10:05:32 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E6=A0=91=E7=9A=84=E7=BB=84=E7=BB=87?= =?UTF-8?q?=E7=BA=A7=E5=88=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/components/resiSearch.vue | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/src/views/components/resiSearch.vue b/src/views/components/resiSearch.vue index 8bfeb169..791eb7bb 100644 --- a/src/views/components/resiSearch.vue +++ b/src/views/components/resiSearch.vue @@ -506,10 +506,22 @@ export default { } }, handleChangeAgency(val) { - this.form.AGENCY_ID = this.agencyIdArray.length > 0 ? this.agencyIdArray[this.agencyIdArray.length - 1] : ''; - console.log('this.form.AGENCY_ID', this.form.AGENCY_ID) + let obj = this.$refs["myCascader"].getCheckedNodes()[0].data + if (obj) { + if(obj.level === 'grid'){ + this.form.GRID_ID = this.agencyIdArray.length > 0 ? this.agencyIdArray[this.agencyIdArray.length - 1] : ''; + this.form.AGENCY_ID='' + }else{ + this.form.AGENCY_ID = this.agencyIdArray.length > 0 ? this.agencyIdArray[this.agencyIdArray.length - 1] : ''; + this.form.GRID_ID = '' + } + + }else{ + this.form.AGENCY_ID='' + this.form.GRID_ID = '' + } + this.form.VILLAGE_ID = '' - this.form.GRID_ID = '' this.form.BUILD_ID = '' this.form.UNIT_ID = '' this.form.HOME_ID = '' From b4bfbb92e8f4517ada81f03df46620284ee9f5c5 Mon Sep 17 00:00:00 2001 From: jianjun Date: Thu, 23 Jun 2022 18:03:42 +0800 Subject: [PATCH 4/5] =?UTF-8?q?=E5=B1=85=E6=B0=91=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E8=8C=83=E5=9B=B4=20=E9=87=8D=E7=BD=AE=E6=89=80=E5=B1=9E?= =?UTF-8?q?=E7=BB=84=E7=BB=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/components/resiSearch.vue | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/views/components/resiSearch.vue b/src/views/components/resiSearch.vue index 791eb7bb..966641c3 100644 --- a/src/views/components/resiSearch.vue +++ b/src/views/components/resiSearch.vue @@ -464,6 +464,7 @@ export default { // let arr3 = [...arr1, ...arr] this.$emit('search', []) // this.handleSearch() + this.orgOptions = []; }, handleSearch() { // console.log('formmmmm---', this.form) @@ -519,8 +520,8 @@ export default { }else{ this.form.AGENCY_ID='' this.form.GRID_ID = '' - } - + } + this.form.VILLAGE_ID = '' this.form.BUILD_ID = '' this.form.UNIT_ID = '' @@ -556,7 +557,7 @@ export default { // 监听基础form handleChangeForm(val) { for (let n in this.fixedForm) { - + if (n === val) { if (this.fixedList.length > 0) { let _item = {} From 66a717cb99246a2d84565fedfb3a79d160b66aac Mon Sep 17 00:00:00 2001 From: jiangyy Date: Fri, 24 Jun 2022 16:31:58 +0800 Subject: [PATCH 5/5] =?UTF-8?q?=E5=B1=85=E6=B0=91=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/components/resiSearch.vue | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/views/components/resiSearch.vue b/src/views/components/resiSearch.vue index 966641c3..06a81ae3 100644 --- a/src/views/components/resiSearch.vue +++ b/src/views/components/resiSearch.vue @@ -461,10 +461,11 @@ export default { else this.form[n] = '' } + this. agencyIdArray=[] // let arr3 = [...arr1, ...arr] this.$emit('search', []) // this.handleSearch() - this.orgOptions = []; + // this.orgOptions = []; }, handleSearch() { // console.log('formmmmm---', this.form)