Browse Source

初始化查询

shibei_master
13176889840 4 years ago
parent
commit
22d7c1d90c
  1. 20
      src/views/components/resiSearch.vue
  2. 16
      src/views/modules/base/resi.vue

20
src/views/components/resiSearch.vue

@ -207,10 +207,14 @@ export default {
formList: {
type: Array,
default: () => []
},
columnName: {
type: String,
default: ''
}
},
data() {
let initForm = (arr) => {
let initForm = (arr, columnName) => {
let _form = {}
// console.log('formInfo', obj)
// if (Object.keys(obj).length > 0) {
@ -218,12 +222,19 @@ export default {
// return _form
// }
arr.forEach((item) => {
_form[item.columnName] = ''
if (columnName && columnName === item.columnName) _form[item.columnName] = '1'
else _form[item.columnName] = ''
})
return _form
}
let form = initForm(this.formList)
let tempFormList = [...this.formList]
let form = initForm(this.formList, this.columnName)
let tempFormList = this.formList.map(item => {
return {
...item,
isChange: this.columnName && this.columnName === item.columnName ? true : false
}
})
let constForm = {
...form,
GRID_ID: '',
@ -339,6 +350,7 @@ export default {
// console.log('formcccc---', this.form)
this.getGridList()
this.getValiheList()
if (this.columnName) this.handleChangeForm(this.columnName)
},
methods: {
initForm() {

16
src/views/modules/base/resi.vue

@ -1,9 +1,10 @@
<template>
<div v-if="pageLoading"
<div
class="resi-container">
<resi-search v-if="searchList.length > 0"
ref="resiSearch"
:form-list="searchList"
:column-name="defaultCategotyKey"
@search="handleSearch" />
<el-card class="resi-card-table">
<div class="resi-row-btn">
@ -248,7 +249,10 @@ export default {
await this.getSearchList()
// await this.getFormList()
await this.getTableHeader()
this.getTableData()
// console.log('this.$refs.resiSearch', this)
this.$refs.resiSearch.handleSearch()
// this.handleSearch()
// this.getTableData()
this.pageLoading = true
console.log('storeoooo----0000', this.$store)
},
@ -617,8 +621,8 @@ export default {
})
this.btnLoading = false
},
getTableHeader () {
this.$http
async getTableHeader () {
await this.$http
.post('/oper/customize/icform/tableheaders', {
formCode: 'resi_base_info'
})
@ -749,8 +753,8 @@ export default {
})
return options
},
getSearchList () {
this.$http
async getSearchList () {
await this.$http
.post('/oper/customize/icform/conditionlist', {
formCode: 'resi_base_info',
dynamic: true

Loading…
Cancel
Save