|
@@ -1,24 +1,39 @@
|
|
<template>
|
|
<template>
|
|
- <a-card size="small" :bordered="false" class="customerReportList-wrap">
|
|
|
|
- <a-spin :spinning="spinning" tip="Loading...">
|
|
|
|
|
|
+ <div class="jg-page-wrap customerReportList-wrap">
|
|
|
|
+ <a-card size="small" :bordered="false" class="table-page-search-wrapper">
|
|
<!-- 搜索条件 -->
|
|
<!-- 搜索条件 -->
|
|
- <div class="table-page-search-wrapper">
|
|
|
|
- <a-form-model
|
|
|
|
- id="customerReportList-form"
|
|
|
|
- ref="ruleForm"
|
|
|
|
- class="form-model-con"
|
|
|
|
- layout="inline"
|
|
|
|
- :model="queryParam"
|
|
|
|
- :rules="rules"
|
|
|
|
- :labelCol="labelCol"
|
|
|
|
- :wrapperCol="wrapperCol"
|
|
|
|
- @keyup.enter.native="handleSearch" >
|
|
|
|
- <a-row :gutter="15">
|
|
|
|
- <a-col :md="6" :sm="24">
|
|
|
|
- <a-form-model-item label="添加时间" prop="time">
|
|
|
|
- <rangeDate ref="rangeDate" @change="dateChange" />
|
|
|
|
- </a-form-model-item>
|
|
|
|
- </a-col>
|
|
|
|
|
|
+ <a-form-model
|
|
|
|
+ id="customerReportList-form"
|
|
|
|
+ ref="ruleForm"
|
|
|
|
+ class="form-model-con"
|
|
|
|
+ layout="inline"
|
|
|
|
+ :model="queryParam"
|
|
|
|
+ :rules="rules"
|
|
|
|
+ :labelCol="labelCol"
|
|
|
|
+ :wrapperCol="wrapperCol"
|
|
|
|
+ @keyup.enter.native="handleSearch" >
|
|
|
|
+ <a-row :gutter="15">
|
|
|
|
+ <a-col :md="6" :sm="24">
|
|
|
|
+ <a-form-model-item label="添加时间" prop="time">
|
|
|
|
+ <rangeDate ref="rangeDate" @change="dateChange" />
|
|
|
|
+ </a-form-model-item>
|
|
|
|
+ </a-col>
|
|
|
|
+ <a-col :md="6" :sm="24">
|
|
|
|
+ <a-form-model-item label="客户名称">
|
|
|
|
+ <custList id="chainSalesReportList-salesTargetName" ref="custSatelliteList" @change="custSatelliteChange"></custList>
|
|
|
|
+ </a-form-model-item>
|
|
|
|
+ </a-col>
|
|
|
|
+ <a-col :md="6" :sm="24">
|
|
|
|
+ <a-form-item label="客户类型">
|
|
|
|
+ <custType v-model="queryParam.customerTypeSn" allowClear placeholder="请选择客户类型" style="max-width: 240px;"></custType>
|
|
|
|
+ </a-form-item>
|
|
|
|
+ </a-col>
|
|
|
|
+ <a-col :md="6" :sm="24">
|
|
|
|
+ <a-form-item label="客户所在区">
|
|
|
|
+ <AreaList id="chainSalesReportList-areaList" changeOnSelect ref="areaList" @change="areaChange" defValKey="id"></AreaList>
|
|
|
|
+ </a-form-item>
|
|
|
|
+ </a-col>
|
|
|
|
+ <template v-if="advanced">
|
|
<a-col :md="6" :sm="24">
|
|
<a-col :md="6" :sm="24">
|
|
<a-form-model-item label="产品分类">
|
|
<a-form-model-item label="产品分类">
|
|
<a-cascader
|
|
<a-cascader
|
|
@@ -33,87 +48,59 @@
|
|
allowClear />
|
|
allowClear />
|
|
</a-form-model-item>
|
|
</a-form-model-item>
|
|
</a-col>
|
|
</a-col>
|
|
- <template v-if="advanced">
|
|
|
|
- <a-col :md="12" :sm="24">
|
|
|
|
- <a-row>
|
|
|
|
- <a-form-model-item label="客户所在区" :labelCol="{span: 4}" :wrapperCol="{ span: 20 }">
|
|
|
|
- <a-col span="7">
|
|
|
|
- <a-form-model-item prop="provinceSn" style="margin: 0!important;">
|
|
|
|
- <a-select v-model="queryParam.provinceSn" allowClear @change="getCityList" placeholder="请选择省">
|
|
|
|
- <a-select-option v-for="item in addrProvinceList" :value="item.areaSn" :key="item.areaSn + 'a'">{{ item.name }}</a-select-option>
|
|
|
|
- </a-select>
|
|
|
|
- </a-form-model-item>
|
|
|
|
- </a-col>
|
|
|
|
- <a-col span="7" offset="1">
|
|
|
|
- <a-form-model-item prop="citySn" style="margin: 0!important;">
|
|
|
|
- <a-select v-model="queryParam.citySn" allowClear @change="getAreaList" placeholder="请选择市">
|
|
|
|
- <a-select-option v-for="item in addrCityList" :value="item.areaSn" :key="item.areaSn + 'b'">{{ item.name }}</a-select-option>
|
|
|
|
- </a-select>
|
|
|
|
- </a-form-model-item>
|
|
|
|
- </a-col>
|
|
|
|
- <a-col span="7" offset="1">
|
|
|
|
- <a-form-model-item prop="countySn" style="margin: 0!important;">
|
|
|
|
- <a-select v-model="queryParam.countySn" allowClear placeholder="请选择区/县">
|
|
|
|
- <a-select-option v-for="item in addrDistrictList" :value="item.areaSn" :key="item.areaSn + 'c'">{{ item.name }}</a-select-option>
|
|
|
|
- </a-select>
|
|
|
|
- </a-form-model-item>
|
|
|
|
- </a-col>
|
|
|
|
- </a-form-model-item>
|
|
|
|
- </a-row>
|
|
|
|
- </a-col>
|
|
|
|
- <a-col :md="6" :sm="24">
|
|
|
|
- <a-form-item label="客户类型">
|
|
|
|
- <custType v-model="queryParam.customerTypeSn" allowClear placeholder="请选择客户类型" style="max-width: 240px;"></custType>
|
|
|
|
- </a-form-item>
|
|
|
|
- </a-col>
|
|
|
|
- </template>
|
|
|
|
- <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
|
|
|
|
- <a-button type="primary" @click="handleSearch" :disabled="disabled" id="customerReportList-refresh">查询</a-button>
|
|
|
|
- <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="customerReportList-reset">重置</a-button>
|
|
|
|
- <a @click="advanced=!advanced" style="margin-left: 8px">
|
|
|
|
- {{ advanced ? '收起' : '展开' }}
|
|
|
|
- <a-icon :type="advanced ? 'up' : 'down'"/>
|
|
|
|
- </a>
|
|
|
|
- </a-col>
|
|
|
|
- </a-row>
|
|
|
|
- </a-form-model>
|
|
|
|
- </div>
|
|
|
|
- <!-- 合计 -->
|
|
|
|
- <a-alert type="info" style="margin-bottom:10px">
|
|
|
|
- <div class="ftext" slot="message">
|
|
|
|
- 总交易金额:<strong>{{ (totalData && (totalData.discountedAmount || totalData.discountedAmount==0)) ? toThousands(totalData.discountedAmount) : '--' }}</strong>;
|
|
|
|
- <div style="display: inline-block;" v-if="$hasPermissions('M_ShowAllCost')">
|
|
|
|
- 总毛利:<strong>{{ (totalData && totalData.totalGrossProfit) ? toThousands(totalData.totalGrossProfit) : '--' }}</strong>;
|
|
|
|
- 总毛利率:<strong>{{ (totalData && totalData.percentage) ? totalData.percentage+'%' : '--' }}</strong>;
|
|
|
|
|
|
+ </template>
|
|
|
|
+ <a-col :md="24" :sm="24" style="margin-bottom: 10px;text-align:center;">
|
|
|
|
+ <a-button type="primary" @click="handleSearch" :disabled="disabled" id="customerReportList-refresh">查询</a-button>
|
|
|
|
+ <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="customerReportList-reset">重置</a-button>
|
|
|
|
+ <a @click="advanced=!advanced" style="margin-left: 8px">
|
|
|
|
+ {{ advanced ? '收起' : '展开' }}
|
|
|
|
+ <a-icon :type="advanced ? 'up' : 'down'"/>
|
|
|
|
+ </a>
|
|
|
|
+ </a-col>
|
|
|
|
+ </a-row>
|
|
|
|
+ </a-form-model>
|
|
|
|
+ </a-card>
|
|
|
|
+ <a-card size="small" :bordered="false">
|
|
|
|
+ <a-spin :spinning="spinning" tip="Loading...">
|
|
|
|
+ <!-- 合计 -->
|
|
|
|
+ <div class="table-operator">
|
|
|
|
+ <div class="alert-message">
|
|
|
|
+ 总交易金额:<strong>{{ (totalData && (totalData.discountedAmount || totalData.discountedAmount==0)) ? toThousands(totalData.discountedAmount) : '--' }}</strong>;
|
|
|
|
+ <div style="display: inline-block;" v-if="$hasPermissions('M_ShowAllCost')">
|
|
|
|
+ 总毛利:<strong>{{ (totalData && totalData.totalGrossProfit) ? toThousands(totalData.totalGrossProfit) : '--' }}</strong>;
|
|
|
|
+ 总毛利率:<strong>{{ (totalData && totalData.percentage) ? totalData.percentage+'%' : '--' }}</strong>;
|
|
|
|
+ </div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
- </a-alert>
|
|
|
|
- <!-- 列表 -->
|
|
|
|
- <s-table
|
|
|
|
- class="sTable"
|
|
|
|
- ref="table"
|
|
|
|
- size="small"
|
|
|
|
- :rowKey="(record) => record.salesTargetSn"
|
|
|
|
- :columns="columns"
|
|
|
|
- :data="loadData"
|
|
|
|
- :defaultLoadData="false"
|
|
|
|
- bordered>
|
|
|
|
- </s-table>
|
|
|
|
- </a-spin>
|
|
|
|
- </a-card>
|
|
|
|
|
|
+ <!-- 列表 -->
|
|
|
|
+ <s-table
|
|
|
|
+ class="sTable"
|
|
|
|
+ ref="table"
|
|
|
|
+ size="small"
|
|
|
|
+ :rowKey="(record) => record.salesTargetSn"
|
|
|
|
+ :columns="columns"
|
|
|
|
+ :data="loadData"
|
|
|
|
+ :defaultLoadData="false"
|
|
|
|
+ bordered>
|
|
|
|
+ </s-table>
|
|
|
|
+ </a-spin>
|
|
|
|
+ </a-card>
|
|
|
|
+ </div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
import { commonMixin } from '@/utils/mixin'
|
|
import { commonMixin } from '@/utils/mixin'
|
|
import { STable, VSelect } from '@/components'
|
|
import { STable, VSelect } from '@/components'
|
|
import rangeDate from '@/views/common/rangeDate.vue'
|
|
import rangeDate from '@/views/common/rangeDate.vue'
|
|
|
|
+import custList from '@/views/common/custList.vue'
|
|
|
|
+import AreaList from '@/views/common/areaList.js'
|
|
import custType from '@/views/common/custType.js'
|
|
import custType from '@/views/common/custType.js'
|
|
-import { getArea } from '@/api/data'
|
|
|
|
|
|
+// import { getArea } from '@/api/data'
|
|
import { dealerProductTypeList } from '@/api/dealerProductType'
|
|
import { dealerProductTypeList } from '@/api/dealerProductType'
|
|
import { reportBigCustomerList, reportBigCustomerCount } from '@/api/reportData'
|
|
import { reportBigCustomerList, reportBigCustomerCount } from '@/api/reportData'
|
|
export default {
|
|
export default {
|
|
mixins: [commonMixin],
|
|
mixins: [commonMixin],
|
|
- components: { STable, VSelect, rangeDate, custType },
|
|
|
|
|
|
+ components: { STable, VSelect, rangeDate, custType, custList, AreaList },
|
|
data () {
|
|
data () {
|
|
return {
|
|
return {
|
|
spinning: false,
|
|
spinning: false,
|
|
@@ -202,6 +189,11 @@ export default {
|
|
}
|
|
}
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
|
|
+ areaChange (val) {
|
|
|
|
+ this.queryParam.provinceSn = val[0] ? val[0] : ''
|
|
|
|
+ this.queryParam.citySn = val[1] ? val[1] : ''
|
|
|
|
+ this.queryParam.districtSn = val[2] ? val[2] : ''
|
|
|
|
+ },
|
|
// 合计
|
|
// 合计
|
|
getCount (params) {
|
|
getCount (params) {
|
|
reportBigCustomerCount(params).then(res => {
|
|
reportBigCustomerCount(params).then(res => {
|
|
@@ -218,6 +210,15 @@ export default {
|
|
this.queryParam.beginDate = date[0] || ''
|
|
this.queryParam.beginDate = date[0] || ''
|
|
this.queryParam.endDate = date[1] || ''
|
|
this.queryParam.endDate = date[1] || ''
|
|
},
|
|
},
|
|
|
|
+ custSatelliteChange (v, row) {
|
|
|
|
+ if (row && row.customerSn) {
|
|
|
|
+ this.queryParam.customer.customerSn = row.customerSn
|
|
|
|
+ this.queryParam.customer.customerNameCurrent = undefined
|
|
|
|
+ } else {
|
|
|
|
+ this.queryParam.customer.customerNameCurrent = v
|
|
|
|
+ this.queryParam.customer.customerSn = undefined
|
|
|
|
+ }
|
|
|
|
+ },
|
|
// 查询
|
|
// 查询
|
|
handleSearch () {
|
|
handleSearch () {
|
|
this.$refs.ruleForm.validate(valid => {
|
|
this.$refs.ruleForm.validate(valid => {
|
|
@@ -268,54 +269,7 @@ export default {
|
|
}
|
|
}
|
|
})
|
|
})
|
|
},
|
|
},
|
|
- // 获取城市列表
|
|
|
|
- getCityList (val) {
|
|
|
|
- this.addrCityList = []
|
|
|
|
- this.addrDistrictList = []
|
|
|
|
- this.queryParam.citySn = undefined
|
|
|
|
- this.queryParam.countySn = undefined
|
|
|
|
- if (val) {
|
|
|
|
- this.getArea('city', val)
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- // 获取区县列表
|
|
|
|
- getAreaList (val) {
|
|
|
|
- this.addrDistrictList = []
|
|
|
|
- this.queryParam.countySn = undefined
|
|
|
|
- if (val) {
|
|
|
|
- this.getArea('district', val)
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- // 省/市/区
|
|
|
|
- getArea (leve, sn) {
|
|
|
|
- let params
|
|
|
|
- if (leve == 'province') {
|
|
|
|
- params = { type: '2' }
|
|
|
|
- } else {
|
|
|
|
- params = { parentId: sn, type: leve == 'city' ? '3' : '4' }
|
|
|
|
- }
|
|
|
|
- getArea(params).then(res => {
|
|
|
|
- if (res.status == 200) {
|
|
|
|
- if (leve == 'province') {
|
|
|
|
- this.addrProvinceList = res.data || []
|
|
|
|
- } else if (leve == 'city') {
|
|
|
|
- this.addrCityList = res.data || []
|
|
|
|
- } else if (leve == 'district') {
|
|
|
|
- this.addrDistrictList = res.data || []
|
|
|
|
- }
|
|
|
|
- } else {
|
|
|
|
- if (leve == 'province') {
|
|
|
|
- this.addrProvinceList = []
|
|
|
|
- } else if (leve == 'city') {
|
|
|
|
- this.addrCityList = []
|
|
|
|
- } else if (leve == 'district') {
|
|
|
|
- this.addrDistrictList = []
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
- },
|
|
|
|
pageInit () {
|
|
pageInit () {
|
|
- this.getArea('province')
|
|
|
|
this.getProductType()
|
|
this.getProductType()
|
|
}
|
|
}
|
|
},
|
|
},
|