diff --git a/src/views/components/resiSearch.vue b/src/views/components/resiSearch.vue index 72503bad..1c2cd549 100644 --- a/src/views/components/resiSearch.vue +++ b/src/views/components/resiSearch.vue @@ -52,6 +52,7 @@ placeholder="楼号" size="small" clearable + style="width: 120px;" class="resi-cell-select" :disabled="changeVDisabled" @clear="handleClearBuild" @@ -65,12 +66,13 @@ > - + @@ -190,6 +193,7 @@ --> 查询 + 重置
@@ -372,6 +376,12 @@ export default { this.form.UNIT_ID = '' this.form.HOME_ID = '' }, + resetForm(formName) { + for(const n in this.form) { + this.form[n] = '' + } + this.handleSearch() + }, handleSearch() { // console.log('formmmmm---', this.form) const itemTypes = ['daterange', 'timerange'] @@ -435,9 +445,13 @@ export default { if (n === val) { if (this.fixedList.length > 0) { let _item = {} + let hasVal = false this.fixedList.forEach((item, index) => { - if (item.columnName === val) { + if (item.columnName == val) { + hasVal = true item.columnValue[0] = this.form[val] + if (!this.form[val]) this.fixedList.splice(index, 1) + console.log('fixedList----val', this.fixedList) } else { _item = { queryType: 'equal', @@ -445,10 +459,11 @@ export default { columnName: val, columnValue: [this.form[val]] } + console.log('fixedList----else', _item) // this.$set(this.fixedList, index, _item) } }) - if (Object.keys(_item).length > 0) this.fixedList.push(_item) + if (Object.keys(_item).length > 0 && !hasVal) this.fixedList.push(_item) } else { this.$set(this.fixedList, 0, { queryType: 'equal', diff --git a/src/views/modules/communityParty/elegant/index.vue b/src/views/modules/communityParty/elegant/index.vue index 521aac20..a3a53089 100644 --- a/src/views/modules/communityParty/elegant/index.vue +++ b/src/views/modules/communityParty/elegant/index.vue @@ -48,6 +48,10 @@
新增 + 下载模板 {{importBtnTitle}} + {{ exportBtnTitle }} - +
新增 + 下载模板 { + // this.download(res.data, title + '.xls') + if (res.headers["content-disposition"]) { + let fileName = window.decodeURI(res.headers["content-disposition"].split(";")[1].split("=")[1]) + console.log('filename', fileName) + let blob = new Blob([res.data], { type: 'application/vnd.ms-excel' }) + var url = window.URL.createObjectURL(blob) + var aLink = document.createElement('a') + aLink.style.display = 'none' + aLink.href = url + aLink.setAttribute('download', fileName) + document.body.appendChild(aLink) + aLink.click() + document.body.removeChild(aLink) //下载完成移除元素 + window.URL.revokeObjectURL(url) //释放掉blob对象 + } else this.$message.error('下载失败') + }) + .catch(err => { + console.log('err', err) + return this.$message.error('网络错误') + }) + }, // 上传大图标成功 handleExcelSuccess(res, file) { if (res.code === 0 && res.msg === "success") {