|
@@ -1,59 +1,95 @@
|
|
<template>
|
|
<template>
|
|
- <a-card size="small" :bordered="false" class="chainStockReportList-wrap">
|
|
|
|
- <!-- 搜索条件 -->
|
|
|
|
- <div class="table-page-search-wrapper">
|
|
|
|
- <a-form-model
|
|
|
|
- id="chainStockReportList-form"
|
|
|
|
- ref="ruleForm"
|
|
|
|
- :model="queryParam"
|
|
|
|
- :rules="rules"
|
|
|
|
- :labelCol="labelCol"
|
|
|
|
- :wrapperCol="wrapperCol"
|
|
|
|
- @keyup.enter.native="handleSearch" >
|
|
|
|
- <a-row :gutter="15">
|
|
|
|
- <a-col :md="6" :sm="24">
|
|
|
|
- <a-form-item label="添加时间">
|
|
|
|
- <rangeDate ref="rangeDate" @change="dateChange" />
|
|
|
|
- </a-form-item>
|
|
|
|
- </a-col>
|
|
|
|
- <a-col :md="6" :sm="24">
|
|
|
|
- <a-form-item label="产品分类">
|
|
|
|
- <a-select id="chainStockReportList-targetName" v-model="queryParam.allocateTypeSn" placeholder="请选择产品分类" allowClear >
|
|
|
|
- <a-select-option v-for="item in allocateTypeList" :key="item.allocateTypeSn" :value="item.allocateTypeSn">{{ item.name }}</a-select-option>
|
|
|
|
- </a-select>
|
|
|
|
- </a-form-item>
|
|
|
|
- </a-col>
|
|
|
|
- <a-col :md="6" :sm="24">
|
|
|
|
- <a-form-item label="区域">
|
|
|
|
- <a-select id="chainStockReportList-targetName" v-model="queryParam.allocateTypeSn" placeholder="请选择" allowClear >
|
|
|
|
- <a-select-option v-for="item in allocateTypeList" :key="item.allocateTypeSn" :value="item.allocateTypeSn">{{ item.name }}</a-select-option>
|
|
|
|
- </a-select>
|
|
|
|
- </a-form-item>
|
|
|
|
- </a-col>
|
|
|
|
- <a-col :md="6" :sm="24">
|
|
|
|
- <a-button type="primary" @click="handleSearch" :disabled="disabled" id="chainStockReportList-refresh">查询</a-button>
|
|
|
|
- <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="chainStockReportList-reset">重置</a-button>
|
|
|
|
- </a-col>
|
|
|
|
- </a-row>
|
|
|
|
- </a-form-model>
|
|
|
|
- </div>
|
|
|
|
- <!-- 合计 -->
|
|
|
|
- <a-alert type="info" showIcon style="margin-bottom:15px">
|
|
|
|
- <div class="ftext" slot="message">
|
|
|
|
- 总交易金额:<strong>3638.55</strong>;
|
|
|
|
- 总毛利率:<strong>54.97%</strong>
|
|
|
|
|
|
+ <a-card size="small" :bordered="false" class="customerReportList-wrap">
|
|
|
|
+ <a-spin :spinning="spinning" tip="Loading...">
|
|
|
|
+ <!-- 搜索条件 -->
|
|
|
|
+ <div class="table-page-search-wrapper">
|
|
|
|
+ <a-form-model
|
|
|
|
+ id="customerReportList-form"
|
|
|
|
+ ref="ruleForm"
|
|
|
|
+ :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="产品分类">
|
|
|
|
+ <a-cascader
|
|
|
|
+ @change="changeProductType"
|
|
|
|
+ change-on-select
|
|
|
|
+ v-model="productType"
|
|
|
|
+ expand-trigger="hover"
|
|
|
|
+ :options="productTypeList"
|
|
|
|
+ :fieldNames="{ label: 'productTypeName', value: 'productTypeSn', children: 'children' }"
|
|
|
|
+ id="productInfoList-productType"
|
|
|
|
+ placeholder="请选择产品分类"
|
|
|
|
+ allowClear />
|
|
|
|
+ </a-form-model-item>
|
|
|
|
+ </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;">
|
|
|
|
+ <a-select v-model="queryParam.provinceSn" @change="getCityList" placeholder="请选择省">
|
|
|
|
+ <a-select-option v-for="item in addrProvinceList" :value="item.id" :key="item.id + '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;">
|
|
|
|
+ <a-select v-model="queryParam.citySn" @change="getAreaList" placeholder="请选择市">
|
|
|
|
+ <a-select-option v-for="item in addrCityList" :value="item.id" :key="item.id + '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;">
|
|
|
|
+ <a-select v-model="queryParam.countySn" placeholder="请选择区/县">
|
|
|
|
+ <a-select-option v-for="item in addrDistrictList" :value="item.id" :key="item.id + 'c'">{{ item.name }}</a-select-option>
|
|
|
|
+ </a-select>
|
|
|
|
+ </a-form-model-item>
|
|
|
|
+ </a-col>
|
|
|
|
+ </a-form-model-item>
|
|
|
|
+ </a-row>
|
|
|
|
+ </a-col>
|
|
|
|
+ </template>
|
|
|
|
+ <a-col :md="6" :sm="24" style="margin-bottom: 15px;">
|
|
|
|
+ <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>
|
|
</div>
|
|
- </a-alert>
|
|
|
|
- <!-- 列表 -->
|
|
|
|
- <s-table
|
|
|
|
- class="sTable"
|
|
|
|
- ref="table"
|
|
|
|
- size="small"
|
|
|
|
- :rowKey="(record) => record.id"
|
|
|
|
- :columns="columns"
|
|
|
|
- :data="loadData"
|
|
|
|
- bordered>
|
|
|
|
- </s-table>
|
|
|
|
|
|
+ <!-- 合计 -->
|
|
|
|
+ <a-alert type="info" showIcon style="margin-bottom:15px">
|
|
|
|
+ <div class="ftext" slot="message">
|
|
|
|
+ 总交易金额:<strong>{{ (totalData && (totalData.totalAmount || totalData.totalAmount==0)) ? totalData.totalAmount : '--' }}</strong>;
|
|
|
|
+ 总毛利率:<strong>{{ (totalData && totalData.percentage) ? totalData.percentage : '--' }}</strong>
|
|
|
|
+ </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>
|
|
</a-card>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
@@ -61,82 +97,98 @@
|
|
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 { getArea } from '@/api/data'
|
|
import { getArea } from '@/api/data'
|
|
-// import { allocateBillList, allocateBillDel, allocateBillAudit, allocateBillExport } from '@/api/allocateBill'
|
|
|
|
-// import { allocateTypeAllList } from '@/api/allocateType'
|
|
|
|
|
|
+import { dealerProductTypeList } from '@/api/dealerProductType'
|
|
|
|
+import { reportBigCustomerList, reportBigCustomerCount } from '@/api/reportData'
|
|
export default {
|
|
export default {
|
|
components: { STable, VSelect, rangeDate },
|
|
components: { STable, VSelect, rangeDate },
|
|
data () {
|
|
data () {
|
|
return {
|
|
return {
|
|
|
|
+ spinning: false,
|
|
labelCol: { span: 8 },
|
|
labelCol: { span: 8 },
|
|
wrapperCol: { span: 16 },
|
|
wrapperCol: { span: 16 },
|
|
advanced: false, // 高级搜索 展开/关闭
|
|
advanced: false, // 高级搜索 展开/关闭
|
|
tableHeight: 0,
|
|
tableHeight: 0,
|
|
queryParam: { // 查询条件
|
|
queryParam: { // 查询条件
|
|
|
|
+ time: [],
|
|
beginDate: '',
|
|
beginDate: '',
|
|
endDate: '',
|
|
endDate: '',
|
|
- targetName: undefined,
|
|
|
|
- code: '', // 产品编码
|
|
|
|
- name: '', // 产品名称
|
|
|
|
- origCode: '', // 原厂编码
|
|
|
|
- productBrandSn: undefined, // 产品品牌
|
|
|
|
productTypeSn1: '', // 产品一级分类
|
|
productTypeSn1: '', // 产品一级分类
|
|
productTypeSn2: '', // 产品二级分类
|
|
productTypeSn2: '', // 产品二级分类
|
|
- productTypeSn3: '' // 产品三级分类
|
|
|
|
|
|
+ productTypeSn3: '', // 产品三级分类
|
|
|
|
+ provinceSn: undefined, // 省
|
|
|
|
+ citySn: undefined, // 市
|
|
|
|
+ countySn: undefined // 区
|
|
},
|
|
},
|
|
|
|
+ productType: [],
|
|
rules: {
|
|
rules: {
|
|
- 'targetName': [{ required: true, message: '请选择连锁店', trigger: 'change' }]
|
|
|
|
|
|
+ 'time': [{ required: true, message: '请选择添加时间', trigger: 'change' }]
|
|
},
|
|
},
|
|
disabled: false, // 查询、重置按钮是否可操作
|
|
disabled: false, // 查询、重置按钮是否可操作
|
|
exportLoading: false,
|
|
exportLoading: false,
|
|
columns: [
|
|
columns: [
|
|
{ title: '序号', dataIndex: 'no', width: 80, align: 'center', fixed: 'left' },
|
|
{ title: '序号', dataIndex: 'no', width: 80, align: 'center', fixed: 'left' },
|
|
- { title: '客户名称', dataIndex: 'name', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
|
|
- { title: '交易金额', dataIndex: 'currentStockCost', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
|
- { title: '毛利率', dataIndex: 'totalCategory', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
|
|
|
|
|
|
+ { title: '客户名称', dataIndex: 'salesTargetName', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true, sorter: true },
|
|
|
|
+ { title: '交易金额', dataIndex: 'totalAmount', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') }, sorter: true },
|
|
|
|
+ { title: '毛利率', dataIndex: 'percentage', align: 'center', customRender: function (text) { return text || '--' }, sorter: true }
|
|
],
|
|
],
|
|
// 加载数据方法 必须为 Promise 对象
|
|
// 加载数据方法 必须为 Promise 对象
|
|
loadData: parameter => {
|
|
loadData: parameter => {
|
|
this.disabled = true
|
|
this.disabled = true
|
|
- // return allocateBillList(Object.assign(parameter, this.queryParam)).then(res => {
|
|
|
|
- // const data = res.data
|
|
|
|
- // const no = (data.pageNo - 1) * data.pageSize
|
|
|
|
- // for (var i = 0; i < data.list.length; i++) {
|
|
|
|
- // data.list[i].no = no + i + 1
|
|
|
|
- // }
|
|
|
|
- // this.disabled = false
|
|
|
|
- // return data
|
|
|
|
- // })
|
|
|
|
- const _this = this
|
|
|
|
- return new Promise(function (resolve, reject) {
|
|
|
|
- const data = {
|
|
|
|
- pageNo: 1,
|
|
|
|
- pageSize: 10,
|
|
|
|
- list: [
|
|
|
|
- { id: '1', code: '159177', name: '测试修理厂', currentStockCost: '¥1729.55', totalCategory: '44.58%' },
|
|
|
|
- { id: '2', code: '159177', name: '常青二路总店', currentStockCost: '¥395.00', totalCategory: '45.32%' },
|
|
|
|
- { id: '3', code: '159177', name: '支持市级', currentStockCost: '¥1136.00', totalCategory: '90.05%' },
|
|
|
|
- { id: '4', code: '159177', name: '支持特约测试', currentStockCost: '¥378.00', totalCategory: '7.04%' }
|
|
|
|
- ],
|
|
|
|
- count: 10
|
|
|
|
- }
|
|
|
|
- for (var i = 0; i < data.list.length; i++) {
|
|
|
|
- data.list[i].no = i + 1
|
|
|
|
- }
|
|
|
|
- _this.disabled = false
|
|
|
|
- resolve(data)
|
|
|
|
- })
|
|
|
|
|
|
+ const params = Object.assign(parameter, this.queryParam)
|
|
|
|
+ this.spinning = true
|
|
|
|
+ delete params.time
|
|
|
|
+ if (params.beginDate) {
|
|
|
|
+ return reportBigCustomerList(params).then(res => {
|
|
|
|
+ // 总计
|
|
|
|
+ this.getCount(params)
|
|
|
|
+ const data = res.data
|
|
|
|
+ const no = (data.pageNo - 1) * data.pageSize
|
|
|
|
+ for (var i = 0; i < data.list.length; i++) {
|
|
|
|
+ data.list[i].no = no + i + 1
|
|
|
|
+ }
|
|
|
|
+ this.disabled = false
|
|
|
|
+ this.spinning = false
|
|
|
|
+ return data
|
|
|
|
+ })
|
|
|
|
+ } else {
|
|
|
|
+ const _this = this
|
|
|
|
+ return new Promise(function (resolve, reject) {
|
|
|
|
+ const data = {
|
|
|
|
+ pageNo: 1,
|
|
|
|
+ pageSize: 10,
|
|
|
|
+ list: [],
|
|
|
|
+ count: 0
|
|
|
|
+ }
|
|
|
|
+ _this.disabled = false
|
|
|
|
+ _this.spinning = false
|
|
|
|
+ _this.$message.info('请选择添加时间')
|
|
|
|
+ resolve(data)
|
|
|
|
+ })
|
|
|
|
+ }
|
|
},
|
|
},
|
|
|
|
+ totalData: null, // 合计
|
|
addrProvinceList: [], // 省下拉
|
|
addrProvinceList: [], // 省下拉
|
|
addrCityList: [], // 市下拉
|
|
addrCityList: [], // 市下拉
|
|
addrDistrictList: [], // 区下拉
|
|
addrDistrictList: [], // 区下拉
|
|
- allocateTypeList: [] // 调拨类型
|
|
|
|
|
|
+ productTypeList: [] // 分类下拉数据
|
|
}
|
|
}
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
|
|
+ // 合计
|
|
|
|
+ getCount (params) {
|
|
|
|
+ reportBigCustomerCount(params).then(res => {
|
|
|
|
+ if (res.status == 200) {
|
|
|
|
+ this.totalData = res.data
|
|
|
|
+ } else {
|
|
|
|
+ this.totalData = null
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ },
|
|
// 创建时间 change
|
|
// 创建时间 change
|
|
dateChange (date) {
|
|
dateChange (date) {
|
|
- this.queryParam.beginDate = date[0]
|
|
|
|
- this.queryParam.endDate = date[1]
|
|
|
|
|
|
+ this.queryParam.time = date
|
|
|
|
+ this.queryParam.beginDate = date[0] || ''
|
|
|
|
+ this.queryParam.endDate = date[1] || ''
|
|
},
|
|
},
|
|
// 查询
|
|
// 查询
|
|
handleSearch () {
|
|
handleSearch () {
|
|
@@ -151,34 +203,54 @@ export default {
|
|
},
|
|
},
|
|
// 重置
|
|
// 重置
|
|
resetSearchForm () {
|
|
resetSearchForm () {
|
|
- this.queryParam.targetName = undefined
|
|
|
|
- this.queryParam.code = ''
|
|
|
|
- this.queryParam.name = ''
|
|
|
|
- this.queryParam.origCode = ''
|
|
|
|
- this.queryParam.productBrandSn = undefined
|
|
|
|
|
|
+ this.$refs.rangeDate.resetDate()
|
|
|
|
+ this.queryParam.time = []
|
|
|
|
+ this.queryParam.beginDate = ''
|
|
|
|
+ this.queryParam.endDate = ''
|
|
this.queryParam.productTypeSn1 = ''
|
|
this.queryParam.productTypeSn1 = ''
|
|
this.queryParam.productTypeSn2 = ''
|
|
this.queryParam.productTypeSn2 = ''
|
|
this.queryParam.productTypeSn3 = ''
|
|
this.queryParam.productTypeSn3 = ''
|
|
|
|
+ this.queryParam.provinceSn = undefined
|
|
|
|
+ this.queryParam.citySn = undefined
|
|
|
|
+ this.queryParam.countySn = undefined
|
|
this.productType = []
|
|
this.productType = []
|
|
- this.$refs.table.refresh(true)
|
|
|
|
|
|
+ this.$refs.ruleForm.resetFields()
|
|
|
|
+ this.totalData = null
|
|
|
|
+ this.$refs.table.clearTable()
|
|
},
|
|
},
|
|
filterOption (input, option) {
|
|
filterOption (input, option) {
|
|
return (
|
|
return (
|
|
option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
|
|
option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
|
|
)
|
|
)
|
|
},
|
|
},
|
|
|
|
+ // 产品分类 change
|
|
|
|
+ changeProductType (val, opt) {
|
|
|
|
+ this.queryParam.productTypeSn1 = val[0] ? val[0] : ''
|
|
|
|
+ this.queryParam.productTypeSn2 = val[1] ? val[1] : ''
|
|
|
|
+ this.queryParam.productTypeSn3 = val[2] ? val[2] : ''
|
|
|
|
+ },
|
|
|
|
+ // 产品分类 列表
|
|
|
|
+ getProductType () {
|
|
|
|
+ dealerProductTypeList({}).then(res => {
|
|
|
|
+ if (res.status == 200) {
|
|
|
|
+ this.productTypeList = res.data
|
|
|
|
+ } else {
|
|
|
|
+ this.productTypeList = []
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ },
|
|
// 获取城市列表
|
|
// 获取城市列表
|
|
getCityList (val) {
|
|
getCityList (val) {
|
|
this.addrCityList = []
|
|
this.addrCityList = []
|
|
this.addrDistrictList = []
|
|
this.addrDistrictList = []
|
|
- this.queryParam.dealerCitySn = undefined
|
|
|
|
- this.queryParam.dealerCountySn = undefined
|
|
|
|
|
|
+ this.queryParam.citySn = undefined
|
|
|
|
+ this.queryParam.countySn = undefined
|
|
this.getArea('city', val)
|
|
this.getArea('city', val)
|
|
},
|
|
},
|
|
// 获取区县列表
|
|
// 获取区县列表
|
|
getAreaList (val) {
|
|
getAreaList (val) {
|
|
this.addrDistrictList = []
|
|
this.addrDistrictList = []
|
|
- this.queryParam.dealerCountySn = undefined
|
|
|
|
|
|
+ this.queryParam.countySn = undefined
|
|
this.getArea('district', val)
|
|
this.getArea('district', val)
|
|
},
|
|
},
|
|
// 省/市/区
|
|
// 省/市/区
|
|
@@ -213,6 +285,7 @@ export default {
|
|
beforeRouteEnter (to, from, next) {
|
|
beforeRouteEnter (to, from, next) {
|
|
next(vm => {
|
|
next(vm => {
|
|
vm.getArea('province')
|
|
vm.getArea('province')
|
|
|
|
+ vm.getProductType()
|
|
})
|
|
})
|
|
}
|
|
}
|
|
}
|
|
}
|