diff --git a/components/projectPicker.vue b/components/projectPicker.vue index c3aef62..98fd9b1 100644 --- a/components/projectPicker.vue +++ b/components/projectPicker.vue @@ -34,10 +34,14 @@ - + + + + + {{ item.name }} { - this.typeList = res.data + this.typeList = this.typeList.concat(res.data) }) }, getProject() { + if(this.typeId!=0){ + request({ + url: '/admin-api/repair/project/page', + method: 'GET', + params: { + pageNo: 1, + pageSize: 10000, + type: this.typeId + } + }).then(res => { + this.groupList = res.data.records + }) + }else{ + this.groupList = [] + } + }, + /** + * 搜搜项目名称 + */ + searchProject(){ + if(this.searchText==""){ + uni.showToast({ + icon: 'none', + title: '请输入项目名称' + }) + return + } request({ url: '/admin-api/repair/project/page', method: 'GET', params: { pageNo: 1, pageSize: 10000, - type: this.typeId + name: this.searchText } }).then(res => { this.groupList = res.data.records }) }, - confirm() { this.$emit('confirm', this.selectedProj) this.cancel() }, cancel() { this.selectedProj = [] - this.groupList = this.typeList[0].groupList + this.groupList = [] this.$refs.popup.close() } } @@ -292,8 +332,16 @@ export default { .addProj{ text-align: right; } + .search-box{ + display: flex; + align-items: center; + justify-content: center; + border-bottom: 1px solid #EEEEEE; + padding-bottom: 10rpx; + } .projItem { display: flex; + padding: 10rpx 0; align-items: center; justify-content: space-between;