Commit 6480c2c3 authored by daywrite's avatar daywrite

销售任务

parent 3eede311
...@@ -19,5 +19,8 @@ export default { ...@@ -19,5 +19,8 @@ export default {
}, },
getImplement: { getImplement: {
url: '/vue/analysis/get-implement' url: '/vue/analysis/get-implement'
},
getFilterSalesGoal: {
url: '/vue/analysis/get-filter-sales-goal'
} }
} }
<template> <template>
<section> <section>
<div class="content"> <div class="content">
<search-header
ref="searchHeader"
:title="'销售数据'"
@update:headerClear="() => searchClear()">
</search-header>
<time-search-form <time-search-form
ref="timeSearchForm" ref="timeSearchForm"
:filter=filter
formSearchKey="projectSearch" formSearchKey="projectSearch"
@update:list="search => timeSearchForm(search)"> @update:form="search => timeSearchForm(search)">
</time-search-form> </time-search-form>
<search-form
ref="clientForm"
:filter="filter"
@update:clientList="form =>{ updateForm(form) }">
</search-form>
<div class="page-body-content"> <div class="page-body-content">
<div class="mb10"> <div class="mb10">
<singleRadioTool <singleRadioTool
...@@ -41,7 +32,7 @@ ...@@ -41,7 +32,7 @@
import SearchHeader from '../../common/searchHeader' import SearchHeader from '../../common/searchHeader'
import SearchForm from '../../common/SearchForm' import SearchForm from '../../common/SearchForm'
import countArr from '../analysis/countArr' import countArr from '../analysis/countArr'
import TimeSearchForm from '../analysis/searchForm' import TimeSearchForm from './searchForm'
import singleRadioTool from '../../common/singleRadioTool' import singleRadioTool from '../../common/singleRadioTool'
import salesGoal from './salesGoal.js' import salesGoal from './salesGoal.js'
import { import {
...@@ -85,9 +76,9 @@ export default { ...@@ -85,9 +76,9 @@ export default {
this.getSalesChart() this.getSalesChart()
}, },
getSalesChart () { getSalesChart (params) {
let t = this let t = this
requestAPI(api.getSalesGoal, {}) requestAPI(api.getSalesGoal, params)
.then(res => { .then(res => {
res.data.list.forEach(item => { res.data.list.forEach(item => {
this.chartTypeArray.push({ this.chartTypeArray.push({
...@@ -105,14 +96,8 @@ export default { ...@@ -105,14 +96,8 @@ export default {
// 1.查询条件 // 1.查询条件
getFilter () { getFilter () {
requestAPI(api.getFilterSalesChart).then(res => { requestAPI(api.getFilterSalesGoal).then(res => {
this.filter = res this.filter = res
// let _inx = res.findIndex(item => item.key === 'CaseSearch[case_status]')
// let _newRes = res.splice(_inx, 1)
// this.filter = res
// let _navArray = _newRes[0].value
// _navArray.unshift({key: 'all', name: '全部'})
// this.navArray = _navArray
}) })
}, },
...@@ -128,22 +113,9 @@ export default { ...@@ -128,22 +113,9 @@ export default {
searchClear () { searchClear () {
}, },
// 5.1查询条件
updateForm (search) {
let ret = this.setParams({
...this.form,
page: this.pagenation.thispage
}, search)
this.getList(ret)
},
// 5.3 TimeSearchForm // 5.3 TimeSearchForm
timeSearchForm (search) { timeSearchForm (search) {
let ret = this.setParams({ this.getSalesChart(search)
...this.form,
page: this.pagenation.thispage
}, search)
this.getList(ret)
} }
} }
......
<template>
<section class="analysis-client">
<el-row :gutter="10" class="header-title">
<el-col :span="14">
<h2>销售任务</h2>
</el-col>
<el-col :span="10">
<el-form ref="clientForm" size="mini" label-width="0" label-position="top">
<el-col :span="12">
<el-form-item>
<el-select v-model="form.year" style="width:100%">
<el-option v-for="sItem in yearArr"
:key="sItem.key"
:label="sItem.name"
:value="sItem.key"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item>
<el-select v-model="form.dataUserId" style="width:100%">
<el-option v-for="sItem in userArr"
:key="sItem.key"
:label="sItem.name"
:value="sItem.key"></el-option>
</el-select>
</el-form-item>
</el-col>
</el-form>
</el-col>
</el-row>
</section>
</template>
<script>
export default {
name: 'timeSearchForm',
props: ['filter'],
data () {
return {
form: {
dataUserId: ''
}
}
},
created () {
},
computed: {
yearArr () {
let _ret = this.filter
if (_ret && _ret.length !== 0) {
let _userArr = _ret.find(item => item.key === 'year').value
this.form.year = _userArr[0].key
return _userArr
} else {
return []
}
},
userArr () {
let _ret = this.filter
if (_ret && _ret.length !== 0) {
let _userArr = _ret.find(item => item.key === 'dataUserId').value
this.form.dataUserId = _userArr[0].key
return _userArr
} else {
return []
}
}
},
methods: {
},
watch: {
'form': {
handler (val) {
let _val = JSON.parse(JSON.stringify(val))
this.$emit('update:form', _val)
},
deep: true,
immediate: true
}
}
}
</script>
<style scoped>
.form-content-time-top {
background: #FFF;
}
.form-content-time-top .el-form-item {
margin: 7px 0 9px;
}
.form-content-time-top .el-col {
padding: 0 15px;
}
.el-dropdown {
top: -1px;
}
.analysis-client .el-button-group > .el-button {
color: #333;
background-color: #fff;
border: 1px solid #ccc;
}
.analysis-client .el-dropdown > .el-button {
padding-left: 6px;
padding-right: 6px;
border-left-width: 1px;
border-left-color: #ccc;
}
.analysis-client .trigger-year {
color: #333;
background-color: #fff;
border-color: #ccc;
border-right: 1px solid #ccc !important;
}
.analysis-client .head-date-button {
color: #fff;
background-color: #333744;
border-color: #282b35;
}
.analysis-client .check-year {
color: #fff !important;
background-color: #17a2b8 !important;
border-color: #17a2b8 !important;
}
</style>
...@@ -203,9 +203,6 @@ export default { ...@@ -203,9 +203,6 @@ export default {
'form': { 'form': {
handler (val) { handler (val) {
let _val = JSON.parse(JSON.stringify(val)) let _val = JSON.parse(JSON.stringify(val))
if (this.checkYear !== '') {
_val.period = this.checkYear
}
this.$emit('update:form', _val) this.$emit('update:form', _val)
}, },
deep: true, deep: true,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment