Commit 85f27ef4 by 怪兽?别跑

获客助手统计调试

1 parent c597eefd
...@@ -9,72 +9,76 @@ ...@@ -9,72 +9,76 @@
</div> </div>
<div class="item" v-if="active === 3"> <div class="item" v-if="active === 3">
<el-date-picker <el-date-picker
style="width: 250px" style="width: 250px;"
@change="setTime" @change="setTime"
clearable clearable
v-model="value" v-model="value"
type="daterange" type="daterange"
range-separator="至" range-separator="至"
start-placeholder="开始日期" start-placeholder="开始日期"
end-placeholder="结束日期"></el-date-picker> end-placeholder="结束日期"
></el-date-picker>
</div>
<div>
<slot></slot>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
import moment from 'moment' import moment from 'moment'
export default { export default {
name: 'search-title-group', name: 'search-title-group',
props: {}, props: {},
data() { data() {
return { return {
active: 1, active: 1,
value: [], value: [],
data: { data: {
beginTime: '', beginTime: '',
endTime: '', endTime: ''
}, }
}
},
methods: {
submit() {
this.$emit('search', this.data)
},
setTime(e) {
if (e) {
this.data.beginTime = moment(e[0]).format('YYYY-MM-DD')
this.data.endTime = moment(e[1]).format('YYYY-MM-DD')
} else {
this.data.beginTime = ''
this.data.endTime = ''
} }
this.submit()
}, },
setType(type) { methods: {
this.active = type submit() {
if (type === 1) { this.$emit('search', this.data)
const weekStart = moment().subtract(6, 'days').format('YYYY-MM-DD') },
const weekEnd = moment().format('YYYY-MM-DD') setTime(e) {
this.data.beginTime = weekStart if (e) {
this.data.endTime = weekEnd this.data.beginTime = moment(e[0]).format('YYYY-MM-DD')
this.submit() this.data.endTime = moment(e[1]).format('YYYY-MM-DD')
} else if (type === 2) { } else {
this.data.endTime = moment().format('YYYY-MM-DD') this.data.beginTime = ''
this.data.beginTime = moment().subtract(29, 'days').format('YYYY-MM-DD') this.data.endTime = ''
}
this.submit() this.submit()
},
setType(type) {
this.active = type
if (type === 1) {
const weekStart = moment().subtract(6, 'days').format('YYYY-MM-DD')
const weekEnd = moment().format('YYYY-MM-DD')
this.data.beginTime = weekStart
this.data.endTime = weekEnd
this.submit()
} else if (type === 2) {
this.data.endTime = moment().format('YYYY-MM-DD')
this.data.beginTime = moment().subtract(29, 'days').format('YYYY-MM-DD')
this.submit()
}
} }
}, },
}, created() {
created() { this.setType(1)
this.setType(1) }
}, }
}
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.search { .search {
display: flex; display: flex;
align-items: center; align-items: center;
.item { .item {
margin-right: 20px; margin-right: 20px;
}
} }
}
</style> </style>
<template> <template>
<div>1111</div> <div class="g-card">
<search-title>
<template v-slot>
<el-input :model-value="userNames" readonly @click="dialogVisible = true" placeholder="请选择添加员工" />
</template>
</search-title>
<SelectUser
v-model:visible="dialogVisible"
title="组织架构"
:defaultValues="userArray"
@success="getSelectUser"
></SelectUser>
</div>
</template> </template>
<script>
import SearchTitle from '../components/SearchTitle.vue'
export default {
data() {
return {
manList: [],
query: {
pageSize: 10,
pageNum: 1,
userIds: ''
},
userNames: '',
dialogVisible: false,
userArray: []
}
},
components: {
SearchTitle
},
methods: {
getSelectUser(data) {
this.userArray = data
this.userNames = this.userArray
.map(function (obj, index) {
return obj.name
})
.join(',')
this.query.userIds = this.userArray
.map(function (obj, index) {
return obj.userId
})
.join(',')
}
},
created() {}
}
</script>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!