123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497 |
- <template>
- <a-card size="small" :bordered="false" class="actualSalesReportList-wrap">
- <a-spin :spinning="spinning" tip="Loading...">
-
- <div class="table-page-search-wrapper newTableSearchName">
- <a-form-model
- id="actualSalesReportList-form"
- ref="ruleForm"
- class="form-model-con"
- layout="inline"
- :model="queryParam"
- :rules="rules"
- @keyup.enter.native="handleSearch">
- <a-row :gutter="15">
- <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>
- </a-col>
- <a-col :md="6" :sm="24">
- <a-form-model-item label="客户名称">
- <custList id="actualSalesReportList-allocateTypeSn" ref="custList" @change="custChange"></custList>
- </a-form-model-item>
- </a-col>
- <a-col :md="6" :sm="24">
- <a-form-model-item label="客户级别">
- <v-select
- v-model="queryParam.dealer.dealerLevel"
- ref="dealerLevel"
- id="actualSalesReportList-allocateTypeSn"
- code="DEALER_LEVEL"
- placeholder="请选择客户级别"
- allowClear></v-select>
- </a-form-model-item>
- </a-col>
- <a-col :md="6" :sm="24">
- <a-form-model-item label="所在区域">
- <subarea id="actualSalesReportList-allocateTypeSn" v-model="queryParam.dealer.subareaSn"></subarea>
- </a-form-model-item>
- </a-col>
- <template v-if="advanced">
- <a-col :md="6" :sm="24">
- <a-form-model-item label="地区">
- <AreaList id="actualSalesReportList-areaList" changeOnSelect ref="areaList" @change="areaChange" defValKey="id"></AreaList>
- </a-form-model-item>
- </a-col>
- </template>
- <a-col :md="24" :sm="24" style="margin-bottom:10px;text-align:center;">
- <a-button type="primary" @click="handleSearch" :disabled="disabled" id="actualSalesReportList-refresh">查询</a-button>
- <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="actualSalesReportList-reset">重置</a-button>
- <a-button
- style="margin-left: 10px"
- type="primary"
- class="button-warning"
- @click="handleExport"
- :disabled="disabled"
- :loading="exportLoading"
- v-if="$hasPermissions('B_actualSalesReport_export')"
- id="actualSalesReportList-export">导出</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>
-
- <s-table
- class="sTable"
- ref="table"
- size="small"
- :rowKey="(record) => record.id"
- :columns="columns"
- :data="loadData"
- :scroll="{ x: 2250 }"
- :defaultLoadData="false"
- bordered>
- <template slot="footer">
- <a-row>
- <a-col span="2">合计:</a-col>
- <a-col span="22">
- <a-row>
- <a-col span="4">箭牌滤清器:{{ (totalData && (totalData.jpLqqAmount || totalData.jpLqqAmount==0)) ? toThousands(totalData.jpLqqAmount) : '--' }}</a-col>
- <a-col span="4">箭牌变速箱滤清器:{{ (totalData && (totalData.jpBsxLqqAmount || totalData.jpBsxLqqAmount==0)) ? toThousands(totalData.jpBsxLqqAmount) : '--' }}</a-col>
- <a-col span="4">箭牌雨刮片:{{ (totalData && (totalData.jpYgpAmount || totalData.jpYgpAmount==0)) ? toThousands(totalData.jpYgpAmount) : '--' }}</a-col>
- <a-col span="4">箭牌喇叭:{{ (totalData && (totalData.jpLbAmount || totalData.jpLbAmount==0)) ? toThousands(totalData.jpLbAmount) : '--' }}</a-col>
- <a-col span="4">箭牌刹车片:{{ (totalData && (totalData.jpScpAmount || totalData.jpScpAmount==0)) ? toThousands(totalData.jpScpAmount) : '--' }}</a-col>
- <a-col span="4">箭牌感应线:{{ (totalData && (totalData.jpGyxAmount || totalData.jpGyxAmount==0)) ? toThousands(totalData.jpGyxAmount) : '--' }}</a-col>
- <a-col span="4">冠牌滤清器:{{ (totalData && (totalData.gpLqqAmount || totalData.gpLqqAmount==0)) ? toThousands(totalData.gpLqqAmount) : '--' }}</a-col>
- <a-col span="4">冠牌雨刮片:{{ (totalData && (totalData.gpYgpAmount || totalData.gpYgpAmount==0)) ? toThousands(totalData.gpYgpAmount) : '--' }}</a-col>
- <a-col span="4">冠牌刹车片:{{ (totalData && (totalData.gpScpAmount || totalData.gpScpAmount==0)) ? toThousands(totalData.gpScpAmount) : '--' }}</a-col>
- <a-col span="4">稳升点火线圈:{{ (totalData && (totalData.wsDhxqAmount || totalData.wsDhxqAmount==0)) ? toThousands(totalData.wsDhxqAmount) : '--' }}</a-col>
- <a-col span="4">稳升灯泡:{{ (totalData && (totalData.wsDpAmount || totalData.wsDpAmount==0)) ? toThousands(totalData.wsDpAmount) : '--' }}</a-col>
- <a-col span="4">汇箭:{{ (totalData && (totalData.hjAmount || totalData.hjAmount==0)) ? toThousands(totalData.hjAmount) : '--' }}</a-col>
- <a-col span="4">德路斯:{{ (totalData && (totalData.dlsAmount || totalData.dlsAmount==0)) ? toThousands(totalData.dlsAmount) : '--' }}</a-col>
- <a-col span="4">TBU:{{ (totalData && (totalData.tbuAmount || totalData.tbuAmount==0)) ? toThousands(totalData.tbuAmount) : '--' }}</a-col>
- <a-col span="4">TBU-P:{{ (totalData && (totalData.tbupAmount || totalData.tbupAmount==0)) ? toThousands(totalData.tbupAmount) : '--' }}</a-col>
- <a-col span="4">布瑞斯:{{ (totalData && (totalData.brsAmount || totalData.brsAmount==0)) ? toThousands(totalData.brsAmount) : '--' }}</a-col>
- <a-col span="4">NGK:{{ (totalData && (totalData.ngkAmount || totalData.ngkAmount==0)) ? toThousands(totalData.ngkAmount) : '--' }}</a-col>
- <a-col span="4">飞利浦:{{ (totalData && (totalData.flpAmount || totalData.flpAmount==0)) ? toThousands(totalData.flpAmount) : '--' }}</a-col>
- <a-col span="4">车仆:{{ (totalData && (totalData.cpAmount || totalData.cpAmount==0)) ? toThousands(totalData.cpAmount) : '--' }}</a-col>
- <a-col span="4">瓦尔塔:{{ (totalData && (totalData.wetAmount || totalData.wetAmount==0)) ? toThousands(totalData.wetAmount) : '--' }}</a-col>
- <a-col span="4">雷贝斯托:{{ (totalData && (totalData.lbstAmount || totalData.lbstAmount==0)) ? toThousands(totalData.lbstAmount) : '--' }}</a-col>
- <a-col span="4">德尔福:{{ (totalData && (totalData.defAmount || totalData.defAmount==0)) ? toThousands(totalData.defAmount) : '--' }}</a-col>
- <a-col span="4">巴诺德:{{ (totalData && (totalData.bndAmount || totalData.bndAmount==0)) ? toThousands(totalData.bndAmount) : '--' }}</a-col>
- <a-col span="6">实售销售合计金额:{{ (totalData && (totalData.totalAmount || totalData.totalAmount==0)) ? toThousands(totalData.totalAmount) : '--' }}</a-col>
- </a-row>
- </a-col>
- </a-row>
- </template>
- </s-table>
- </a-spin>
-
- <reportModal :visible="showExport" @close="showExport=false"></reportModal>
- </a-card>
- </template>
- <script>
- import { commonMixin } from '@/utils/mixin'
- import getDate from '@/libs/getDate.js'
- import { STable, VSelect } from '@/components'
- import rangeDate from '@/views/common/rangeDate.vue'
- import custList from '@/views/common/custList.vue'
- import reportModal from '@/views/common/reportModal.vue'
- import subarea from '@/views/common/subarea.js'
- import AreaList from '@/views/common/areaList.js'
- import { hdExportExcel } from '@/libs/exportExcel'
- import { salesBillRealAmountQueryPageList, salesBillRealReportCount } from '@/api/salesBillReport'
- import { actualSalesExport } from '@/api/reportData'
- export default {
- name: 'ActualSalesReportList',
- mixins: [commonMixin],
- components: { STable, VSelect, rangeDate, subarea, custList, reportModal, AreaList },
- data () {
- return {
- spinning: false,
- advanced: true,
- tableHeight: 0,
- showExport: false,
- queryParam: {
- time: [
- getDate.getCurrMonthDays().starttime,
- getDate.getCurrMonthDays().endtime
- ],
- beginDate: getDate.getCurrMonthDays().starttime,
- endDate: getDate.getCurrMonthDays().endtime,
- dealer: {
- 'dealerSn': undefined,
- 'provinceSn': undefined,
- 'citySn': undefined,
- 'districtSn': undefined,
- 'subareaSn': undefined,
- 'dealerLevel': undefined
- }
- },
- rules: {
- 'time': [{ required: true, message: '请选择销售日期', trigger: 'change' }]
- },
- disabled: false,
- exportLoading: false,
-
- loadData: parameter => {
- this.disabled = true
- this.spinning = true
- if (this.tableHeight == 0) {
- this.tableHeight = window.innerHeight - 380
- }
- const paramsPage = Object.assign(this.queryParam, { pageNo: parameter.pageNo, pageSize: parameter.pageSize })
- return salesBillRealAmountQueryPageList(paramsPage).then(res => {
- let data
- if (res.status == 200) {
- data = res.data
- this.getCount(paramsPage)
- 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
- })
- },
- totalData: null,
- addrProvinceList: [],
- addrCityList: [],
- addrDistrictList: []
- }
- },
- computed: {
- columns () {
- const _this = this
- const arr = [
- { title: '区域', dataIndex: 'dealer.subareaNameSet', width: 90, align: 'center', customRender: function (text) { return (text && text.length > 0) ? text.join('/') : '--' } },
- { title: '省份', dataIndex: 'dealer.provinceName', width: 90, align: 'center', customRender: function (text) { return text || '--' } },
- { title: '客户名称', dataIndex: 'dealer.dealerName', width: 100, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
- { title: '客户级别', dataIndex: 'dealer.dealerLevelDictValue', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
- { title: '品牌',
- align: 'center',
- children: [
- {
- title: '箭牌',
- align: 'center',
- children: [
- {
- title: '滤清器',
- dataIndex: 'jpLqqAmount',
- align: 'right',
- width: 80,
- customRender: function (text) { return (text || text == 0) ? _this.toThousands(text) : '--' }
- },
- {
- title: '变速箱滤清器',
- dataIndex: 'jpBsxLqqAmount',
- align: 'right',
- width: 80,
- customRender: function (text) { return (text || text == 0) ? _this.toThousands(text) : '--' }
- },
- {
- title: '雨刮片',
- dataIndex: 'jpYgpAmount',
- align: 'right',
- width: 80,
- customRender: function (text) { return (text || text == 0) ? _this.toThousands(text) : '--' }
- },
- {
- title: '喇叭',
- dataIndex: 'jpLbAmount',
- align: 'right',
- width: 80,
- customRender: function (text) { return (text || text == 0) ? _this.toThousands(text) : '--' }
- },
- {
- title: '刹车片',
- dataIndex: 'jpScpAmount',
- align: 'right',
- width: 80,
- customRender: function (text) { return (text || text == 0) ? _this.toThousands(text) : '--' }
- },
- {
- title: '感应线',
- dataIndex: 'jpGyxAmount',
- align: 'right',
- width: 80,
- customRender: function (text) { return (text || text == 0) ? _this.toThousands(text) : '--' }
- }
- ]
- },
- {
- title: '冠牌',
- align: 'center',
- children: [
- {
- title: '滤清器',
- dataIndex: 'gpLqqAmount',
- align: 'right',
- width: 80,
- customRender: function (text) { return (text || text == 0) ? _this.toThousands(text) : '--' }
- },
- {
- title: '雨刮片',
- dataIndex: 'gpYgpAmount',
- align: 'right',
- width: 80,
- customRender: function (text) { return (text || text == 0) ? _this.toThousands(text) : '--' }
- },
- {
- title: '刹车片',
- dataIndex: 'gpScpAmount',
- align: 'right',
- width: 80,
- customRender: function (text) { return (text || text == 0) ? _this.toThousands(text) : '--' }
- }
- ]
- },
- {
- title: '稳升',
- align: 'center',
- children: [
- {
- title: '点火线圈',
- dataIndex: 'wsDhxqAmount',
- align: 'right',
- width: 80,
- customRender: function (text) { return (text || text == 0) ? _this.toThousands(text) : '--' }
- },
- {
- title: '灯泡',
- dataIndex: 'wsDpAmount',
- align: 'right',
- width: 80,
- customRender: function (text) { return (text || text == 0) ? _this.toThousands(text) : '--' }
- }
- ]
- },
- {
- title: '汇箭',
- dataIndex: 'hjAmount',
- align: 'right',
- width: 80,
- customRender: function (text) { return (text || text == 0) ? _this.toThousands(text) : '--' }
- },
- {
- title: '德路斯',
- dataIndex: 'dlsAmount',
- align: 'right',
- width: 80,
- customRender: function (text) { return (text || text == 0) ? _this.toThousands(text) : '--' }
- },
- {
- title: 'TBU',
- dataIndex: 'tbuAmount',
- align: 'right',
- width: 80,
- customRender: function (text) { return (text || text == 0) ? _this.toThousands(text) : '--' }
- },
- {
- title: 'TBU-P',
- dataIndex: 'tbupAmount',
- align: 'right',
- width: 80,
- customRender: function (text) { return (text || text == 0) ? _this.toThousands(text) : '--' }
- },
- {
- title: '布瑞斯',
- dataIndex: 'brsAmount',
- align: 'right',
- width: 80,
- customRender: function (text) { return (text || text == 0) ? _this.toThousands(text) : '--' }
- }
- ]
- },
- { title: '代理品牌',
- align: 'center',
- children: [
- {
- title: 'NGK',
- dataIndex: 'ngkAmount',
- align: 'right',
- width: 80,
- customRender: function (text) { return (text || text == 0) ? _this.toThousands(text) : '--' }
- },
- {
- title: '飞利浦',
- dataIndex: 'flpAmount',
- align: 'right',
- width: 80,
- customRender: function (text) { return (text || text == 0) ? _this.toThousands(text) : '--' }
- },
- {
- title: '车仆',
- dataIndex: 'cpAmount',
- align: 'right',
- width: 80,
- customRender: function (text) { return (text || text == 0) ? _this.toThousands(text) : '--' }
- },
- {
- title: '瓦尔塔',
- dataIndex: 'wetAmount',
- align: 'right',
- width: 80,
- customRender: function (text) { return (text || text == 0) ? _this.toThousands(text) : '--' }
- },
- {
- title: '雷贝斯托',
- dataIndex: 'lbstAmount',
- align: 'right',
- width: 80,
- customRender: function (text) { return (text || text == 0) ? _this.toThousands(text) : '--' }
- },
- {
- title: '德尔福',
- dataIndex: 'defAmount',
- align: 'right',
- width: 80,
- customRender: function (text) { return (text || text == 0) ? _this.toThousands(text) : '--' }
- },
- {
- title: '巴诺德',
- dataIndex: 'bndAmount',
- align: 'right',
- width: 80,
- customRender: function (text) { return (text || text == 0) ? _this.toThousands(text) : '--' }
- }
- ]
- }
-
- ]
- if (this.$hasPermissions('M_actualSalesReportList_salesPrice')) {
- arr.splice(arr.length, 0, { title: '实售销售合计金额', width: 90, dataIndex: 'totalAmount', align: 'right', customRender: function (text) { return (text || text == 0) ? _this.toThousands(text) : '--' } })
- }
- return arr
- }
- },
- methods: {
-
- handleExport () {
- const _this = this
- this.$refs.ruleForm.validate(valid => {
- if (valid) {
- _this.showExport = true
- const params = _this.queryParam
- _this.$store.state.app.curActionPermission = 'B_actualSalesReport_export'
- _this.exportLoading = true
- _this.spinning = true
- hdExportExcel(actualSalesExport, params, '实售销售报表', function () {
- _this.exportLoading = false
- _this.spinning = false
- _this.$store.state.app.curActionPermission = ''
- })
- } else {
- return false
- }
- })
- },
-
- getCount (params) {
- salesBillRealReportCount(params).then(res => {
- if (res.status == 200 && res.data) {
- this.totalData = res.data
- } else {
- this.totalData = null
- }
- })
- },
- handleSearch () {
- const _this = this
- this.$refs.ruleForm.validate(valid => {
- if (valid) {
- _this.$refs.table.refresh(true)
- } else {
- _this.$message.error('请选择销售日期')
- return false
- }
- })
- },
-
- dateChange (date) {
- if (date[0] && date[1]) {
- this.queryParam.time = date
- } else {
- this.queryParam.time = []
- }
- this.queryParam.beginDate = date[0] || ''
- this.queryParam.endDate = date[1] || ''
- },
- custChange (val) {
- this.queryParam.dealer.dealerSn = val.key
- },
-
- resetSearchForm () {
- this.queryParam.time = [
- getDate.getCurrMonthDays().starttime,
- getDate.getCurrMonthDays().endtime
- ]
- this.$refs.rangeDate.resetDate(this.queryParam.time)
- this.queryParam.beginDate = getDate.getCurrMonthDays().starttime
- this.queryParam.endDate = getDate.getCurrMonthDays().endtime
- this.queryParam.dealer = {
- 'dealerSn': undefined,
- 'provinceSn': undefined,
- 'citySn': undefined,
- 'districtSn': undefined,
- 'subareaSn': undefined,
- 'dealerLevel': undefined
- }
- this.totalData = null
- if (this.advanced) {
- this.$refs.areaList.clearData()
- }
- this.$refs.custList.resetForm()
- this.$refs.ruleForm.resetFields()
- this.$refs.table.clearTable()
- },
- areaChange (val) {
- this.queryParam.dealer.provinceSn = val[0] ? val[0] : ''
- this.queryParam.dealer.citySn = val[1] ? val[1] : ''
- this.queryParam.dealer.districtSn = val[2] ? val[2] : ''
- }
- },
- mounted () {
- if (!this.$store.state.app.isNewTab) {
- this.resetSearchForm()
- }
- },
- activated () {
-
- if (this.$store.state.app.isNewTab) {
- this.resetSearchForm()
- }
- },
- beforeRouteEnter (to, from, next) {
- next(vm => {})
- }
- }
- </script>
|