|
@@ -13,76 +13,40 @@
|
|
@keyup.enter.native="handleSearch">
|
|
@keyup.enter.native="handleSearch">
|
|
<a-row :gutter="15">
|
|
<a-row :gutter="15">
|
|
<a-col :md="6" :sm="24">
|
|
<a-col :md="6" :sm="24">
|
|
- <a-form-model-item label="日期" prop="time">
|
|
|
|
- <rangeDate ref="rangeDate" :value="queryParam.time" @change="dateChange" />
|
|
|
|
|
|
+ <a-form-model-item label="日期" prop="month">
|
|
|
|
+ <a-date-picker v-model="queryParam.month" format="YYYY-MM" @change="onChange" />
|
|
</a-form-model-item>
|
|
</a-form-model-item>
|
|
</a-col>
|
|
</a-col>
|
|
<a-col :md="5" :sm="24">
|
|
<a-col :md="5" :sm="24">
|
|
- <a-form-model-item label="单号">
|
|
|
|
- <a-input id="priceDifferenceDetailList-bizNo" v-model.trim="queryParam.bizNo" allowClear placeholder="请输入单号"/>
|
|
|
|
|
|
+ <a-form-model-item label="省份" prop="provinceSn">
|
|
|
|
+ <a-select v-model="queryParam.provinceSn" allowClear 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-form-model-item>
|
|
</a-col>
|
|
</a-col>
|
|
<a-col :md="6" :sm="24">
|
|
<a-col :md="6" :sm="24">
|
|
- <a-form-model-item label="客户名称">
|
|
|
|
- <custList id="priceDifferenceDetailList-custList" ref="custList" @change="custChange"></custList>
|
|
|
|
|
|
+ <a-form-model-item label="记账门店">
|
|
|
|
+ <custList id="priceDifferenceDetailList-rebateDealer" ref="rebateDealerList" @change="rebateDealerChange"></custList>
|
|
</a-form-model-item>
|
|
</a-form-model-item>
|
|
</a-col>
|
|
</a-col>
|
|
<template v-if="advanced">
|
|
<template v-if="advanced">
|
|
- <a-col :md="7" :sm="24">
|
|
|
|
- <a-form-model-item label="客户级别">
|
|
|
|
- <v-select
|
|
|
|
- v-model="queryParam.dealer.dealerLevel"
|
|
|
|
- ref="dealerLevel"
|
|
|
|
- id="priceDifferenceDetailList-dealerLevel"
|
|
|
|
- code="DEALER_LEVEL"
|
|
|
|
- placeholder="请选择客户级别"
|
|
|
|
- allowClear></v-select>
|
|
|
|
- </a-form-model-item>
|
|
|
|
- </a-col>
|
|
|
|
- <a-col :md="6" :sm="24">
|
|
|
|
- <a-form-model-item label="品牌分类">
|
|
|
|
- <v-select code="BRAND_TYPE" id="priceDifferenceDetailList-brandType" v-model="queryParam.product.brandType" allowClear placeholder="请选择品牌分类"></v-select>
|
|
|
|
- </a-form-model-item>
|
|
|
|
- </a-col>
|
|
|
|
- <a-col :md="6" :sm="24">
|
|
|
|
- <a-form-model-item label="产品品牌">
|
|
|
|
- <ProductBrand id="priceDifferenceDetailList-productBrandSn" v-model="queryParam.product.productBrandSn"></ProductBrand>
|
|
|
|
- </a-form-model-item>
|
|
|
|
- </a-col>
|
|
|
|
- <a-col :md="6" :sm="24">
|
|
|
|
- <a-form-model-item label="产品分类">
|
|
|
|
- <ProductType id="priceDifferenceDetailList-productType" v-model="productType" @change="changeProductType"></ProductType>
|
|
|
|
- </a-form-model-item>
|
|
|
|
- </a-col>
|
|
|
|
- <a-col :md="6" :sm="24">
|
|
|
|
- <a-form-model-item label="所在区域">
|
|
|
|
- <subarea id="priceDifferenceDetailList-subareaSn" v-model="queryParam.dealer.subareaSn"></subarea>
|
|
|
|
- </a-form-model-item>
|
|
|
|
- </a-col>
|
|
|
|
- <a-col :md="6" :sm="24">
|
|
|
|
- <a-form-model-item label="省级区域">
|
|
|
|
- <a-select id="priceDifferenceDetailList-provinceSn" allowClear v-model="queryParam.dealer.provinceSn" 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 :md="6" :sm="24">
|
|
<a-col :md="6" :sm="24">
|
|
- <a-form-model-item label="类型" prop="bizType">
|
|
|
|
- <a-select id="priceDifferenceDetailList-bizType" allowClear v-model="queryParam.bizType" placeholder="请选择类型">
|
|
|
|
- <a-select-option v-for="item in bizTypeList" :value="item.value" :key="item.value">{{ item.name }}</a-select-option>
|
|
|
|
- </a-select>
|
|
|
|
|
|
+ <a-form-model-item label="客户名称">
|
|
|
|
+ <custList id="priceDifferenceDetailList-custList" ref="custList" @change="custChange"></custList>
|
|
</a-form-model-item>
|
|
</a-form-model-item>
|
|
</a-col>
|
|
</a-col>
|
|
</template>
|
|
</template>
|
|
<a-col :md="7" :sm="24" style="margin-bottom: 10px;">
|
|
<a-col :md="7" :sm="24" style="margin-bottom: 10px;">
|
|
|
|
+ <a-button type="primary" @click="handleSearch" :disabled="disabled" id="priceDifferenceDetailList-refresh">查询</a-button>
|
|
|
|
+ <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="priceDifferenceDetailList-reset">重置</a-button>
|
|
<a-button
|
|
<a-button
|
|
|
|
+ style="margin-left: 5px"
|
|
type="primary"
|
|
type="primary"
|
|
class="button-warning"
|
|
class="button-warning"
|
|
- size="small"
|
|
|
|
- @click="handleStock"
|
|
|
|
- id="priceDifferenceDetailList-stockDate">盘点区间日期</a-button>
|
|
|
|
- <a-button style="margin-left: 5px" type="primary" @click="handleSearch" :disabled="disabled" id="priceDifferenceDetailList-refresh">查询</a-button>
|
|
|
|
- <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="priceDifferenceDetailList-reset">重置</a-button>
|
|
|
|
|
|
+ @click="handleExport"
|
|
|
|
+ :disabled="disabled"
|
|
|
|
+ :loading="exportLoading"
|
|
|
|
+ id="allocationDetailsList-export">导出</a-button>
|
|
<a @click="advanced=!advanced" style="margin-left: 5px">
|
|
<a @click="advanced=!advanced" style="margin-left: 5px">
|
|
{{ advanced ? '收起' : '展开' }}
|
|
{{ advanced ? '收起' : '展开' }}
|
|
<a-icon :type="advanced ? 'up' : 'down'"/>
|
|
<a-icon :type="advanced ? 'up' : 'down'"/>
|
|
@@ -104,19 +68,13 @@
|
|
<template slot="footer">
|
|
<template slot="footer">
|
|
<a-row :gutter="15">
|
|
<a-row :gutter="15">
|
|
<a-col :md="6" :sm="24">
|
|
<a-col :md="6" :sm="24">
|
|
- 分公司金额:{{ (totalData && (totalData.wholesalePrice1 || totalData.wholesalePrice1==0)) ? totalData.wholesalePrice1 : '--' }}
|
|
|
|
- </a-col>
|
|
|
|
- <a-col :md="6" :sm="24">
|
|
|
|
- 加盟商金额:{{ (totalData && (totalData.wholesalePrice2 || totalData.wholesalePrice2==0)) ? totalData.wholesalePrice2 : '--' }}
|
|
|
|
- </a-col>
|
|
|
|
- <a-col :md="6" :sm="24">
|
|
|
|
- 特约加盟店金额:{{ (totalData && (totalData.wholesalePrice3 || totalData.wholesalePrice3==0)) ? totalData.wholesalePrice3 : '--' }}
|
|
|
|
|
|
+ 实售金额:{{ (totalData && (totalData.wholesalePrice1 || totalData.wholesalePrice1==0)) ? totalData.wholesalePrice1 : '--' }}
|
|
</a-col>
|
|
</a-col>
|
|
<a-col :md="6" :sm="24">
|
|
<a-col :md="6" :sm="24">
|
|
- 直接差价金额:{{ (totalData && (totalData.directRebateAmount || totalData.directRebateAmount==0)) ? totalData.directRebateAmount : '--' }}
|
|
|
|
|
|
+ 开单金额:{{ (totalData && (totalData.wholesalePrice2 || totalData.wholesalePrice2==0)) ? totalData.wholesalePrice2 : '--' }}
|
|
</a-col>
|
|
</a-col>
|
|
<a-col :md="6" :sm="24">
|
|
<a-col :md="6" :sm="24">
|
|
- 间接差价金额:{{ (totalData && (totalData.indirectRebateAmount || totalData.indirectRebateAmount==0)) ? totalData.indirectRebateAmount : '--' }}
|
|
|
|
|
|
+ 直接差额:{{ (totalData && (totalData.wholesalePrice3 || totalData.wholesalePrice3==0)) ? totalData.wholesalePrice3 : '--' }}
|
|
</a-col>
|
|
</a-col>
|
|
</a-row>
|
|
</a-row>
|
|
</template>
|
|
</template>
|
|
@@ -126,68 +84,42 @@
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
|
+import moment from 'moment'
|
|
import getDate from '@/libs/getDate.js'
|
|
import getDate from '@/libs/getDate.js'
|
|
import { STable, VSelect } from '@/components'
|
|
import { STable, VSelect } from '@/components'
|
|
-import rangeDate from '@/views/common/rangeDate.vue'
|
|
|
|
import custList from '@/views/common/custList.vue'
|
|
import custList from '@/views/common/custList.vue'
|
|
-import subarea from '@/views/common/subarea.js'
|
|
|
|
import { getArea } from '@/api/data'
|
|
import { getArea } from '@/api/data'
|
|
-import ProductBrand from '@/views/common/productBrand.js'
|
|
|
|
-import ProductType from '@/views/common/productType.js'
|
|
|
|
-import { headRebateDetailReportList, headRebateDetailReportCount } from '@/api/reportData'
|
|
|
|
|
|
+import { reportRebateReportList, reportRebateCount, reportRebateExport } from '@/api/reportData'
|
|
export default {
|
|
export default {
|
|
- components: { STable, VSelect, custList, subarea, rangeDate, ProductBrand, ProductType },
|
|
|
|
|
|
+ components: { STable, VSelect, custList },
|
|
data () {
|
|
data () {
|
|
return {
|
|
return {
|
|
spinning: false,
|
|
spinning: false,
|
|
advanced: false, // 高级搜索 展开/关闭
|
|
advanced: false, // 高级搜索 展开/关闭
|
|
|
|
+ exportLoading: false,
|
|
queryParam: { // 查询条件
|
|
queryParam: { // 查询条件
|
|
- time: [
|
|
|
|
- getDate.getCurrMonthDays().starttime,
|
|
|
|
- getDate.getCurrMonthDays().endtime
|
|
|
|
- ],
|
|
|
|
- beginDate: getDate.getCurrMonthDays().starttime,
|
|
|
|
- endDate: getDate.getCurrMonthDays().endtime,
|
|
|
|
- bizNo: '',
|
|
|
|
- dealer: {
|
|
|
|
- dealerSn: undefined,
|
|
|
|
- dealerLevel: undefined,
|
|
|
|
- subareaSn: undefined, // 区域
|
|
|
|
- provinceSn: undefined
|
|
|
|
- },
|
|
|
|
- product: {
|
|
|
|
- brandType: undefined,
|
|
|
|
- productBrandSn: undefined, // 产品品牌
|
|
|
|
- productTypeSn1: '', // 产品一级分类
|
|
|
|
- productTypeSn2: '', // 产品二级分类
|
|
|
|
- productTypeSn3: '' // 产品三级分类
|
|
|
|
- },
|
|
|
|
- bizType: undefined
|
|
|
|
|
|
+ month: undefined,
|
|
|
|
+ provinceSn: undefined,
|
|
|
|
+ rebateDealerSn: undefined,
|
|
|
|
+ dealerSn: undefined
|
|
},
|
|
},
|
|
rules: {
|
|
rules: {
|
|
- 'time': [{ required: true, message: '请选择日期', trigger: 'change' }]
|
|
|
|
|
|
+ 'month': [{ required: true, message: '请选择月份', trigger: 'change' }],
|
|
|
|
+ 'provinceSn': [{ required: true, message: '请选择省份', trigger: 'change' }]
|
|
},
|
|
},
|
|
disabled: false, // 查询、重置按钮是否可操作
|
|
disabled: false, // 查询、重置按钮是否可操作
|
|
addrProvinceList: [], // 省下拉
|
|
addrProvinceList: [], // 省下拉
|
|
columns: [
|
|
columns: [
|
|
- { title: '序号', dataIndex: 'no', width: 80, align: 'center', fixed: 'left' },
|
|
|
|
- { title: '区域', dataIndex: 'dealer.subareaNameSet', width: 220, align: 'center', customRender: function (text) { return (text && text.length > 0) ? text.join('/') : '--' } },
|
|
|
|
- { title: '订单号', dataIndex: 'bizNo', width: 200, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
|
- { title: '日期', dataIndex: 'bizCreateDate', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
|
- { title: '省份', dataIndex: 'dealer.provinceName', width: 200, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
|
- { title: '直接绑定客户名称', dataIndex: 'directDealerName', width: 200, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
|
|
- { title: '间接绑定客户名称', dataIndex: 'indirectDealerName', width: 200, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
|
|
- { title: '客户名称', dataIndex: 'dealer.dealerName', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
|
|
- { title: '客户级别', dataIndex: 'dealer.dealerLevelDictValue', width: 200, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
|
- { title: '品牌', dataIndex: 'productBrandName', width: 200, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
|
|
- { title: '二级分类', dataIndex: 'productTypeName2', width: 200, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
|
- { title: '数量', dataIndex: 'qty', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
|
- { title: '分公司金额', dataIndex: 'wholesalePrice1', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
|
- { title: '加盟商金额', dataIndex: 'wholesalePrice2', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
|
- { title: '特约加盟店金额', dataIndex: 'wholesalePrice3', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
|
- { title: '直接差价', dataIndex: 'directRebateAmount', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
|
- { title: '间接差价', dataIndex: 'indirectRebateAmount', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
|
- { title: '类型', dataIndex: 'bizTypeValue', width: 100, align: 'center', customRender: function (text) { return text || '--' } }
|
|
|
|
|
|
+ { title: '序号', dataIndex: 'no', width: 70, align: 'center', fixed: 'left' },
|
|
|
|
+ { title: '月份', dataIndex: 'dealer.subareaNameSet', width: 80, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
|
+ { title: '省份', dataIndex: 'bizNo', width: 80, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
|
+ { title: '记账门店', dataIndex: 'bizCreateDate', width: 180, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
|
+ { title: '客户名称', dataIndex: 'dealer.provinceName', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
|
+ { title: '产品品牌+二级分类', dataIndex: 'directDealerName', width: 200, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
|
+ { title: '实售金额', dataIndex: 'qty', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
|
+ { title: '开单金额', dataIndex: 'wholesalePrice1', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
|
+ { title: '直接差额', dataIndex: 'wholesalePrice2', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
|
+ { title: '类型', dataIndex: 'bizTypeValue', width: 80, align: 'center', customRender: function (text) { return text || '--' } }
|
|
],
|
|
],
|
|
// 加载数据方法 必须为 Promise 对象
|
|
// 加载数据方法 必须为 Promise 对象
|
|
loadData: parameter => {
|
|
loadData: parameter => {
|
|
@@ -195,34 +127,26 @@ export default {
|
|
const params = Object.assign(parameter, this.queryParam)
|
|
const params = Object.assign(parameter, this.queryParam)
|
|
delete params.time
|
|
delete params.time
|
|
this.spinning = true
|
|
this.spinning = true
|
|
- return headRebateDetailReportList(params).then(res => {
|
|
|
|
|
|
+ return reportRebateReportList(params).then(res => {
|
|
// 总计
|
|
// 总计
|
|
this.getCount(params)
|
|
this.getCount(params)
|
|
const data = res.data
|
|
const data = res.data
|
|
const no = (data.pageNo - 1) * data.pageSize
|
|
const no = (data.pageNo - 1) * data.pageSize
|
|
for (var i = 0; i < data.list.length; i++) {
|
|
for (var i = 0; i < data.list.length; i++) {
|
|
data.list[i].no = no + i + 1
|
|
data.list[i].no = no + i + 1
|
|
- if (data.list[i].bizType) {
|
|
|
|
- data.list[i].bizTypeValue = data.list[i].bizType == 'SALES' ? '采购差价' : data.list[i].bizType == 'SALES_RETURN' ? '退货差价' : ''
|
|
|
|
- }
|
|
|
|
}
|
|
}
|
|
this.disabled = false
|
|
this.disabled = false
|
|
this.spinning = false
|
|
this.spinning = false
|
|
return data
|
|
return data
|
|
})
|
|
})
|
|
},
|
|
},
|
|
- productType: [],
|
|
|
|
- bizTypeList: [
|
|
|
|
- { value: 'SALES', name: '采购差价' },
|
|
|
|
- { value: 'SALES_RETURN', name: '退货差价' }
|
|
|
|
- ],
|
|
|
|
totalData: null
|
|
totalData: null
|
|
}
|
|
}
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
- // 盘点库存日期
|
|
|
|
- handleStock () {
|
|
|
|
- this.$message.info('无盘点区间的起始/终止时间,请自行选择日期区间查询!')
|
|
|
|
|
|
+ // 月份 change
|
|
|
|
+ onChange (date, dateString) {
|
|
|
|
+ console.log(date, dateString)
|
|
},
|
|
},
|
|
// 创建时间 change
|
|
// 创建时间 change
|
|
dateChange (date) {
|
|
dateChange (date) {
|
|
@@ -232,7 +156,7 @@ export default {
|
|
},
|
|
},
|
|
// 合计
|
|
// 合计
|
|
getCount (params) {
|
|
getCount (params) {
|
|
- headRebateDetailReportCount(params).then(res => {
|
|
|
|
|
|
+ reportRebateCount(params).then(res => {
|
|
if (res.status == 200) {
|
|
if (res.status == 200) {
|
|
this.totalData = res.data
|
|
this.totalData = res.data
|
|
} else {
|
|
} else {
|
|
@@ -316,6 +240,42 @@ export default {
|
|
}
|
|
}
|
|
this.$refs.ruleForm.resetFields()
|
|
this.$refs.ruleForm.resetFields()
|
|
this.$refs.table.clearTable()
|
|
this.$refs.table.clearTable()
|
|
|
|
+ },
|
|
|
|
+ // 导出
|
|
|
|
+ handleExport () {
|
|
|
|
+ const _this = this
|
|
|
|
+ const params = this.queryParam
|
|
|
|
+ this.exportLoading = true
|
|
|
|
+ _this.spinning = true
|
|
|
|
+ reportRebateExport(params).then(res => {
|
|
|
|
+ this.exportLoading = false
|
|
|
|
+ _this.spinning = false
|
|
|
|
+ if (res.type == 'application/json') {
|
|
|
|
+ var reader = new FileReader()
|
|
|
|
+ reader.addEventListener('loadend', function () {
|
|
|
|
+ const obj = JSON.parse(reader.result)
|
|
|
|
+ _this.$notification.error({
|
|
|
|
+ message: '提示',
|
|
|
|
+ description: obj.message
|
|
|
|
+ })
|
|
|
|
+ })
|
|
|
|
+ reader.readAsText(res)
|
|
|
|
+ } else {
|
|
|
|
+ this.download(res)
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ download (data) {
|
|
|
|
+ if (!data) { return }
|
|
|
|
+ const url = window.URL.createObjectURL(new Blob([data]))
|
|
|
|
+ const link = document.createElement('a')
|
|
|
|
+ link.style.display = 'none'
|
|
|
|
+ link.href = url
|
|
|
|
+ const a = moment().format('YYYYMMDDHHmmss')
|
|
|
|
+ const fname = '差价明细报表' + a
|
|
|
|
+ link.setAttribute('download', fname + '.xlsx')
|
|
|
|
+ document.body.appendChild(link)
|
|
|
|
+ link.click()
|
|
}
|
|
}
|
|
},
|
|
},
|
|
beforeRouteEnter (to, from, next) {
|
|
beforeRouteEnter (to, from, next) {
|