Commit 78970ca6 by 胡悦
2 parents edc3cbf5 7a1d1b8d
......@@ -17,7 +17,7 @@
<span>收起</span>
</div>
</div>
<div class="firstRowBtn" v-if="!expande && isShowBtns">
<div class="firstRowBtn" v-if="!expande && isShowBtns && isNeedThreeBtns">
<el-button plain @click="resetTable" size="small">重置</el-button>
<el-button type="primary" @click="searchTable" size="small">查询</el-button>
<!-- v-if="(merchantModel == 1 && accountLevel == 1) || (merchantModel == 2 && accountLevel == 4)" -->
......@@ -103,6 +103,10 @@ export default {
showDefaultTime: {
type: Boolean,
default: false
},
isNeedThreeBtns:{
type: Boolean,
default: true
}
},
data() {
......
......@@ -47,15 +47,14 @@
<span>客户列表</span>
<span>{{ clientTableDataNum || 0 }}个</span>
</p>
<search-form class="searchTop border-shadow" :showDefaultTime="false" :formModel="searchForm" :formList="clientGroupFormList" @setTableHeightEvent="setTableHeightEvent">
<search-form class="searchTop border-shadow" :isNeedThreeBtns="false" :showDefaultTime="true" :formModel="searchForm" :formList="clientGroupFormList" @setTableHeightEvent="setTableHeightEvent">
<span class="inline-b" slot="form-slot">
<!-- :size="btn_size" -->
<el-button plain @click="resetTable">重置</el-button>
<el-button type="primary" @click="searchTable">查询</el-button>
</span>
</search-form>
<!-- :tableId="$route.query.id" 去掉,表格组件也应该去掉 -->
<GLTable ref="clientGroupDetail" @setTableFinishFun="setTableFinishFun" :hasNum="true" :pageConf="pageConf" :getListApi="getListApi" :beforeSearchFn="beforeSearchFn" :searchForm="searchForm" :tableParams="tableParams" :headerStyle="{ height: '54px', background: '#F4F6FC', color: '#333333', fontSize: '14px' }" :noDataImg="url">
<GLTable ref="clientGroupDetail" @setTableFinishFun="setTableFinishFun" :hasNum="true" :pageConf="pageConf" :getListApi="getListApi" :beforeSearchFn="beforeSearchFn" :searchForm="searchFormTable" :tableParams="tableParams" :headerStyle="{ height: '54px', background: '#F4F6FC', color: '#333333', fontSize: '14px' }" :noDataImg="url">
<span slot="customerName" slot-scope="scope">
<el-tooltip effect="dark" :content="scope.scope.customerName" placement="top">
<span class="ellipsis-1" style="display: inline-block; max-width: 70px; text-align: left">{{ scope.scope.customerName }}</span>
......@@ -89,6 +88,7 @@ export default {
url: url,
leftPanelList: {},
searchForm: {},
searchFormTable:{},
clientGroupFormList: [
{
type: 'daterange',
......@@ -198,6 +198,19 @@ export default {
// this.searchTable()
// })
},
watch: {
'searchForm.daterange':{
deep: true,
// immediate:true,
handler(val) {
console.log('val值:',val)
if(val){
console.log('7777777777777')
this.searchTable()
}
}
}
},
methods: {
async getTableDetail(id = this.$route.query.id) {
......@@ -208,16 +221,18 @@ export default {
}
this.leftPanelList = res
},
beforeSearchFn() {
beforeSearchFn() {
return new Promise((resolve, reject) => {
console.log(this.searchForm)
if (this.searchForm.daterange) {
this.searchForm.beginTime = this.searchForm.daterange[0]
this.searchForm.endTime = this.searchForm.daterange[1]
delete this.searchForm.daterange
this.searchFormTable = JSON.parse(JSON.stringify(this.searchForm))
// console.log(this.searchForm,'数据')
// console.log(this.searchForm.daterange,this.searchForm.id,this.searchFormTable,'时间选择器')
// console.log(this.searchForm)
if (this.searchFormTable.daterange) {
this.searchFormTable.beginTime = this.searchForm.daterange[0]
this.searchFormTable.endTime = this.searchForm.daterange[1]
delete this.searchFormTable.daterange
} else {
if (this.searchForm.beginTime) delete this.searchForm.beginTime && delete this.searchForm.endTime
if (this.searchFormTable.beginTime) delete this.searchFormTable.beginTime && delete this.searchFormTable.endTime
}
resolve()
})
......@@ -229,12 +244,6 @@ export default {
//content是第一页的数据
console.log(content)
this.clientTableDataNum = this.$refs.clientGroupDetail.total
if (!this.flushTime) {
this.flushTime = true
// setTimeout(() => {
// this.searchTable()
// }, 3000)
}
//接收到的数据为空
if (!this.$refs.clientGroupDetail.data.length) {
this.$refs.clientGroupDetail.setTableHeightFun()
......
......@@ -134,6 +134,17 @@ export default {
this.accountLevel = this.$globalState.session.accountLevel
}
},
// watch: {
// 'searchForm.daterange':{
// deep: true,
// handler(val) {
// console.log('val值:',val)
// if(val){
// this.searchTable()
// }
// }
// }
// },
mounted() {},
methods: {
syncClick() {
......@@ -176,10 +187,10 @@ export default {
if (this.searchFormTable.daterange) {
this.searchFormTable.beginTime = this.searchForm.daterange[0]
this.searchFormTable.endTime = this.searchForm.daterange[1]
delete this.searchFormTable.daterange
} else {
if (this.searchFormTable.beginTime) delete this.searchFormTable.beginTime && delete this.searchFormTable.endTime
}
delete this.searchFormTable.daterange
resolve()
})
},
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!