|
@@ -46,7 +46,7 @@
|
|
|
</a-col>
|
|
|
<a-col :md="6" :sm="24">
|
|
|
<a-form-model-item label="地区">
|
|
|
- <AreaList id="salesSlipReportList-areaList" changeOnSelect ref="areaList" @change="areaChange" defValKey="id"></AreaList>
|
|
|
+ <AreaList id="salesSlipReportList-areaList" changeOnSelect ref="areaList" @change="areaChange" defValKey="id"></AreaList>
|
|
|
</a-form-model-item>
|
|
|
</a-col>
|
|
|
</template>
|
|
@@ -76,42 +76,20 @@
|
|
|
ref="table"
|
|
|
size="small"
|
|
|
:defaultLoadData="false"
|
|
|
- :rowKey="(record) => record.id"
|
|
|
+ :rowKey="(record) => record.no"
|
|
|
+ :rowKeyName="no"
|
|
|
:columns="columns"
|
|
|
:data="loadData"
|
|
|
:scroll="{ x: 2410 }"
|
|
|
bordered>
|
|
|
- <template slot="footer">
|
|
|
+ <template slot="footer" v-if="countLabel.length>0">
|
|
|
<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.tbuScpAmount || totalData.tbuScpAmount==0)) ? toThousands(totalData.tbuScpAmount) : '--' }}</a-col>
|
|
|
- <a-col span="4">TBU刹车油:{{ (totalData && (totalData.tbuScyAmount || totalData.tbuScyAmount==0)) ? toThousands(totalData.tbuScyAmount) : '--' }}</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>
|
|
|
- <!-- v-if="$hasPermissions('B_isShowPrice')" -->
|
|
|
- <a-col span="6">开单销售单合计金额:{{ (totalData && (totalData.totalAmount || totalData.totalAmount==0)) ? toThousands(totalData.totalAmount) : '--' }}</a-col>
|
|
|
+ <a-col span="4" v-for="item in countLabel" :key="item.key">
|
|
|
+ {{ item.title }}:{{ totalData?(totalData[item.dataIndex]||totalData[item.dataIndex]==0)?toThousands(totalData[item.dataIndex]):'--':'--' }}
|
|
|
+ </a-col>
|
|
|
</a-row>
|
|
|
</a-col>
|
|
|
</a-row>
|
|
@@ -133,7 +111,7 @@ import subarea from '@/views/common/subarea.js'
|
|
|
import reportModal from '@/views/common/reportModal.vue'
|
|
|
import AreaList from '@/views/common/areaList.js'
|
|
|
import { hdExportExcel } from '@/libs/exportExcel'
|
|
|
-import { salesBillReportList, salesBillReportCount } from '@/api/salesBillReport'
|
|
|
+import { salesKdxxdReportTitle, salesBillReportList, salesBillReportCount } from '@/api/salesBillReport'
|
|
|
import { salesSlipExport } from '@/api/reportData'
|
|
|
export default {
|
|
|
name: 'SalesSlipReportList',
|
|
@@ -162,6 +140,8 @@ export default {
|
|
|
'dealerLevel': undefined
|
|
|
}
|
|
|
},
|
|
|
+ columns: [],
|
|
|
+ countLabel: [],
|
|
|
rules: {
|
|
|
'time': [{ required: true, message: '请选择销售日期', trigger: 'change' }]
|
|
|
},
|
|
@@ -193,223 +173,6 @@ export default {
|
|
|
totalData: null
|
|
|
}
|
|
|
},
|
|
|
- computed: {
|
|
|
- columns () {
|
|
|
- const _this = this
|
|
|
- const arr = [
|
|
|
- { title: '区域', dataIndex: 'dealer.subareaNameSet', width: 120, align: 'center', customRender: function (text) { return (text && text.length > 0) ? text.join('/') : '--' } },
|
|
|
- { title: '销售单号', dataIndex: 'salesBillNo', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
- { title: '省份', dataIndex: 'dealer.provinceName', width: 90, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
|
- { title: '客户名称', dataIndex: 'dealer.dealerName', width: 120, align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
|
- { title: '客户级别', dataIndex: 'dealer.dealerLevelDictValue', width: 120, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
- { title: '品牌',
|
|
|
- align: 'center',
|
|
|
- children: [
|
|
|
- {
|
|
|
- title: '箭牌',
|
|
|
- align: 'center',
|
|
|
- children: [
|
|
|
- {
|
|
|
- title: '滤清器',
|
|
|
- dataIndex: 'jpLqqAmount',
|
|
|
- align: 'center',
|
|
|
- width: 80,
|
|
|
- customRender: function (text) { return (text || text == 0) ? _this.toThousands(text) : '--' }
|
|
|
- },
|
|
|
- {
|
|
|
- title: '变速箱滤清器',
|
|
|
- dataIndex: 'jpBsxLqqAmount',
|
|
|
- align: 'center',
|
|
|
- width: 80,
|
|
|
- customRender: function (text) { return (text || text == 0) ? _this.toThousands(text) : '--' }
|
|
|
- },
|
|
|
- {
|
|
|
- title: '雨刮片',
|
|
|
- dataIndex: 'jpYgpAmount',
|
|
|
- align: 'center',
|
|
|
- width: 80,
|
|
|
- customRender: function (text) { return (text || text == 0) ? _this.toThousands(text) : '--' }
|
|
|
- },
|
|
|
- {
|
|
|
- title: '喇叭',
|
|
|
- dataIndex: 'jpLbAmount',
|
|
|
- align: 'center',
|
|
|
- width: 80,
|
|
|
- customRender: function (text) { return (text || text == 0) ? _this.toThousands(text) : '--' }
|
|
|
- },
|
|
|
- {
|
|
|
- title: '刹车片',
|
|
|
- dataIndex: 'jpScpAmount',
|
|
|
- align: 'center',
|
|
|
- width: 80,
|
|
|
- customRender: function (text) { return (text || text == 0) ? _this.toThousands(text) : '--' }
|
|
|
- },
|
|
|
- {
|
|
|
- title: '感应线',
|
|
|
- dataIndex: 'jpGyxAmount',
|
|
|
- align: 'center',
|
|
|
- width: 80,
|
|
|
- customRender: function (text) { return (text || text == 0) ? _this.toThousands(text) : '--' }
|
|
|
- }
|
|
|
- ]
|
|
|
- },
|
|
|
- {
|
|
|
- title: '冠牌',
|
|
|
- align: 'center',
|
|
|
- children: [
|
|
|
- {
|
|
|
- title: '滤清器',
|
|
|
- dataIndex: 'gpLqqAmount',
|
|
|
- align: 'center',
|
|
|
- width: 80,
|
|
|
- customRender: function (text) { return (text || text == 0) ? _this.toThousands(text) : '--' }
|
|
|
- },
|
|
|
- {
|
|
|
- title: '雨刮片',
|
|
|
- dataIndex: 'gpYgpAmount',
|
|
|
- align: 'center',
|
|
|
- width: 80,
|
|
|
- customRender: function (text) { return (text || text == 0) ? _this.toThousands(text) : '--' }
|
|
|
- },
|
|
|
- {
|
|
|
- title: '刹车片',
|
|
|
- dataIndex: 'gpScpAmount',
|
|
|
- align: 'center',
|
|
|
- width: 80,
|
|
|
- customRender: function (text) { return (text || text == 0) ? _this.toThousands(text) : '--' }
|
|
|
- }
|
|
|
- ]
|
|
|
- },
|
|
|
- {
|
|
|
- title: '稳升',
|
|
|
- align: 'center',
|
|
|
- children: [
|
|
|
- {
|
|
|
- title: '点火线圈',
|
|
|
- dataIndex: 'wsDhxqAmount',
|
|
|
- align: 'center',
|
|
|
- width: 80,
|
|
|
- customRender: function (text) { return (text || text == 0) ? _this.toThousands(text) : '--' }
|
|
|
- },
|
|
|
- {
|
|
|
- title: '灯泡',
|
|
|
- dataIndex: 'wsDpAmount',
|
|
|
- align: 'center',
|
|
|
- width: 80,
|
|
|
- customRender: function (text) { return (text || text == 0) ? _this.toThousands(text) : '--' }
|
|
|
- }
|
|
|
- ]
|
|
|
- },
|
|
|
- {
|
|
|
- title: '汇箭',
|
|
|
- dataIndex: 'hjAmount',
|
|
|
- align: 'center',
|
|
|
- width: 80,
|
|
|
- customRender: function (text) { return (text || text == 0) ? _this.toThousands(text) : '--' }
|
|
|
- },
|
|
|
- {
|
|
|
- title: '德路斯',
|
|
|
- dataIndex: 'dlsAmount',
|
|
|
- align: 'center',
|
|
|
- width: 80,
|
|
|
- customRender: function (text) { return (text || text == 0) ? _this.toThousands(text) : '--' }
|
|
|
- },
|
|
|
- {
|
|
|
- title: 'TBU',
|
|
|
- align: 'center',
|
|
|
- children: [
|
|
|
- {
|
|
|
- title: '刹车片',
|
|
|
- dataIndex: 'tbuScpAmount',
|
|
|
- align: 'center',
|
|
|
- width: 80,
|
|
|
- customRender: function (text) { return (text || text == 0) ? _this.toThousands(text) : '--' }
|
|
|
- },
|
|
|
- {
|
|
|
- title: '刹车油',
|
|
|
- dataIndex: 'tbuScyAmount',
|
|
|
- align: 'center',
|
|
|
- width: 80,
|
|
|
- customRender: function (text) { return (text || text == 0) ? _this.toThousands(text) : '--' }
|
|
|
- }
|
|
|
- ]
|
|
|
- },
|
|
|
- {
|
|
|
- title: 'TBU-P',
|
|
|
- dataIndex: 'tbupAmount',
|
|
|
- align: 'center',
|
|
|
- width: 80,
|
|
|
- customRender: function (text) { return (text || text == 0) ? _this.toThousands(text) : '--' }
|
|
|
- },
|
|
|
- {
|
|
|
- title: '布瑞斯',
|
|
|
- dataIndex: 'brsAmount',
|
|
|
- align: 'center',
|
|
|
- width: 80,
|
|
|
- customRender: function (text) { return (text || text == 0) ? _this.toThousands(text) : '--' }
|
|
|
- }
|
|
|
- ] },
|
|
|
- { title: '代理品牌',
|
|
|
- align: 'center',
|
|
|
- children: [
|
|
|
- {
|
|
|
- title: 'NGK',
|
|
|
- dataIndex: 'ngkAmount',
|
|
|
- align: 'center',
|
|
|
- width: 80,
|
|
|
- customRender: function (text) { return (text || text == 0) ? _this.toThousands(text) : '--' }
|
|
|
- },
|
|
|
- {
|
|
|
- title: '飞利浦',
|
|
|
- dataIndex: 'flpAmount',
|
|
|
- align: 'center',
|
|
|
- width: 80,
|
|
|
- customRender: function (text) { return (text || text == 0) ? _this.toThousands(text) : '--' }
|
|
|
- },
|
|
|
- {
|
|
|
- title: '车仆',
|
|
|
- dataIndex: 'cpAmount',
|
|
|
- align: 'center',
|
|
|
- width: 80,
|
|
|
- customRender: function (text) { return (text || text == 0) ? _this.toThousands(text) : '--' }
|
|
|
- },
|
|
|
- {
|
|
|
- title: '瓦尔塔',
|
|
|
- dataIndex: 'wetAmount',
|
|
|
- align: 'center',
|
|
|
- width: 80,
|
|
|
- customRender: function (text) { return (text || text == 0) ? _this.toThousands(text) : '--' }
|
|
|
- },
|
|
|
- {
|
|
|
- title: '雷贝斯托',
|
|
|
- dataIndex: 'lbstAmount',
|
|
|
- align: 'center',
|
|
|
- width: 80,
|
|
|
- customRender: function (text) { return (text || text == 0) ? _this.toThousands(text) : '--' }
|
|
|
- },
|
|
|
- {
|
|
|
- title: '德尔福',
|
|
|
- dataIndex: 'defAmount',
|
|
|
- align: 'center',
|
|
|
- width: 80,
|
|
|
- customRender: function (text) { return (text || text == 0) ? _this.toThousands(text) : '--' }
|
|
|
- },
|
|
|
- {
|
|
|
- title: '巴诺德',
|
|
|
- dataIndex: 'bndAmount',
|
|
|
- align: 'center',
|
|
|
- width: 80,
|
|
|
- customRender: function (text) { return (text || text == 0) ? _this.toThousands(text) : '--' }
|
|
|
- }
|
|
|
- ] }
|
|
|
- // { title: '开单销售单合计金额', width: 90, dataIndex: 'totalAmount', align: 'center', customRender: function (text) { return (text || text == 0) ? _this.toThousands(text) : '--' } }
|
|
|
- ]
|
|
|
- // if (this.$hasPermissions('B_isShowPrice')) { // 售价权限
|
|
|
- arr.splice(7, 0, { title: '开单销售单合计金额', width: 90, dataIndex: 'totalAmount', align: 'center', customRender: function (text) { return (text || text == 0) ? _this.toThousands(text) : '--' } })
|
|
|
- // }
|
|
|
- return arr
|
|
|
- }
|
|
|
- },
|
|
|
methods: {
|
|
|
// 导出
|
|
|
handleExport () {
|
|
@@ -447,7 +210,7 @@ export default {
|
|
|
if (valid) {
|
|
|
_this.$refs.table.refresh(true)
|
|
|
} else {
|
|
|
- _this.$message.error("请选择销售日期")
|
|
|
+ _this.$message.error('请选择销售日期')
|
|
|
return false
|
|
|
}
|
|
|
})
|
|
@@ -484,28 +247,47 @@ export default {
|
|
|
'dealerLevel': undefined
|
|
|
}
|
|
|
this.totalData = null
|
|
|
- if(this.advanced){
|
|
|
+ if (this.advanced) {
|
|
|
this.$refs.areaList.clearData()
|
|
|
}
|
|
|
this.$refs.custList.resetForm()
|
|
|
this.$refs.ruleForm.resetFields()
|
|
|
this.$refs.table.clearTable()
|
|
|
},
|
|
|
- areaChange(val){
|
|
|
+ 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] : ''
|
|
|
},
|
|
|
+ // 获取表头
|
|
|
+ async getTableTitle () {
|
|
|
+ const _this = this
|
|
|
+ const tableTitle = await salesKdxxdReportTitle().then(res => res.data)
|
|
|
+ this.columns = tableTitle.list
|
|
|
+ this.countLabel = tableTitle.count
|
|
|
+ this.columns.map(item => {
|
|
|
+ let mw = 40
|
|
|
+ if (item.customRender == 'amount') {
|
|
|
+ mw = 15
|
|
|
+ item.customRender = function (text) { return (text || text == 0) ? _this.toThousands(text) : '--' }
|
|
|
+ }
|
|
|
+ const w = item.title.length * mw
|
|
|
+ const tw = w <= 80 && item.customRender != 'amount' ? w * 2 : (w >= 360 ? 200 : w)
|
|
|
+ item.width = tw + 'px'
|
|
|
+ this.tableWidth = this.tableWidth + tw
|
|
|
+ })
|
|
|
+ this.resetSearchForm()
|
|
|
+ }
|
|
|
},
|
|
|
mounted () {
|
|
|
if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
|
|
|
- this.resetSearchForm()
|
|
|
+ this.getTableTitle()
|
|
|
}
|
|
|
},
|
|
|
activated () {
|
|
|
// 如果是新页签打开,则重置当前页面
|
|
|
if (this.$store.state.app.isNewTab) {
|
|
|
- this.resetSearchForm()
|
|
|
+ this.getTableTitle()
|
|
|
}
|
|
|
},
|
|
|
beforeRouteEnter (to, from, next) {
|