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

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

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

Loading…
Cancel
Save