|
@@ -19,15 +19,43 @@
|
|
|
<custList ref="custList" id="shortageStatisticsCList-buyerSn" @change="custChange"></custList>
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
- <a-col :md="6" :sm="24">
|
|
|
- <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="shortageStatisticsCList-refresh">查询</a-button>
|
|
|
- <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="shortageStatisticsCList-reset">重置</a-button>
|
|
|
- </a-col>
|
|
|
+ </a-row>
|
|
|
+ <a-row :gutter="15">
|
|
|
<a-col :md="6" :sm="24">
|
|
|
<a-form-item label="所在区域">
|
|
|
<subarea id="shortageStatisticsCList-subarea" v-model="queryParam.subareaSn"></subarea>
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
+ <a-col :md="12" :sm="24">
|
|
|
+ <a-row :gutter="15">
|
|
|
+ <!-- 地址 -->
|
|
|
+ <a-col span="8">
|
|
|
+ <a-form-item prop="provinceSn">
|
|
|
+ <a-select id="supplierInfoEdit-provinceSn" @change="getCityList" v-model="queryParam.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-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col span="8">
|
|
|
+ <a-form-item prop="citySn">
|
|
|
+ <a-select id="supplierInfoEdit-citySn" @change="getAreaList" v-model="queryParam.citySn" 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-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col span="8">
|
|
|
+ <a-form-item prop="districtSn">
|
|
|
+ <a-select id="supplierInfoEdit-districtSn" @change="areaCharged" v-model="queryParam.districtSn" 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-item>
|
|
|
+ </a-col>
|
|
|
+ </a-row>
|
|
|
+ </a-col>
|
|
|
+ <a-col :md="6" :sm="24">
|
|
|
+ <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="shortageStatisticsCList-refresh">查询</a-button>
|
|
|
+ <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="shortageStatisticsCList-reset">重置</a-button>
|
|
|
+ </a-col>
|
|
|
</a-row>
|
|
|
</a-form>
|
|
|
</div>
|
|
@@ -39,12 +67,8 @@
|
|
|
:rowKey="(record) => record.id"
|
|
|
:columns="columns"
|
|
|
:data="loadData"
|
|
|
- :scroll="{ x: 1210, y: tableHeight }"
|
|
|
+ :scroll="{ x: 2880, y: tableHeight }"
|
|
|
bordered>
|
|
|
- <!-- 单号 -->
|
|
|
- <template slot="salesBillNo" slot-scope="text, record">
|
|
|
- <span style="color: #ed1c24;cursor: pointer;" @click="handleDetail(record)">{{ record.salesBillNo }}</span>
|
|
|
- </template>
|
|
|
</s-table>
|
|
|
</a-card>
|
|
|
</template>
|
|
@@ -56,7 +80,7 @@ import { STable, VSelect } from '@/components'
|
|
|
import rangeDate from '@/views/common/rangeDate.vue'
|
|
|
import custList from '@/views/common/custList.vue'
|
|
|
import subarea from '@/views/common/subarea.js'
|
|
|
-import { productTypeQuery } from '@/api/productType'
|
|
|
+import { getArea } from '@/api/data'
|
|
|
import { oosBuyerList, oosBuyerDetailCount, oosBuyerDetailPageCount, oosDetailExport } from '@/api/oos'
|
|
|
export default {
|
|
|
components: { STable, VSelect, custList, subarea, rangeDate },
|
|
@@ -65,50 +89,319 @@ export default {
|
|
|
advanced: false, // 高级搜索 展开/关闭
|
|
|
tableHeight: 0,
|
|
|
queryParam: { // 查询条件
|
|
|
- beginDate: getDate.getThreeMonthDays().starttime,
|
|
|
- endDate: getDate.getCurrMonthDays().endtime,
|
|
|
+ beginDate: '',
|
|
|
+ endDate: '',
|
|
|
buyerSn: undefined,
|
|
|
subareaSn: undefined, // 区域
|
|
|
- productName: '',
|
|
|
- productCode: '',
|
|
|
- productTypeSn1: '', // 产品一级分类
|
|
|
- productTypeSn2: '', // 产品二级分类
|
|
|
- productTypeSn3: '', // 产品三级分类
|
|
|
- salesBillNo: ''
|
|
|
+ provinceSn: undefined,
|
|
|
+ citySn: undefined,
|
|
|
+ districtSn: undefined
|
|
|
},
|
|
|
disabled: false, // 查询、重置按钮是否可操作
|
|
|
exportLoading: false, // 导出loading
|
|
|
- time: [
|
|
|
- moment(getDate.getThreeMonthDays().starttime, 'YYYY-MM-DD'),
|
|
|
- moment(getDate.getCurrMonthDays().endtime, 'YYYY-MM-DD')
|
|
|
- ], // 创建时间
|
|
|
+ addrProvinceList: [], // 省下拉
|
|
|
+ addrCityList: [], // 市下拉
|
|
|
+ addrDistrictList: [], // 区下拉
|
|
|
+ time: [], // 创建时间
|
|
|
columns: [
|
|
|
{ title: '序号', dataIndex: 'no', width: 80, align: 'center' },
|
|
|
- { title: '创建时间', dataIndex: 'createDate', width: 160, align: 'center' },
|
|
|
- { title: '销售单号', scopedSlots: { customRender: 'salesBillNo' }, align: 'center' },
|
|
|
- { title: '产品编码', dataIndex: 'productCode', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
- { title: '产品名称', dataIndex: 'productName', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
|
- { title: '缺货数量', dataIndex: 'qty', width: 110, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
- { title: '客户名称', dataIndex: 'buyerName', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true }
|
|
|
+ { title: '区域',
|
|
|
+ dataIndex: 'area',
|
|
|
+ width: 150,
|
|
|
+ align: 'center',
|
|
|
+ customRender: (text, row, index) => {
|
|
|
+ if (text == '合计') {
|
|
|
+ return {
|
|
|
+ children: <span>{ text }</span>,
|
|
|
+ attrs: {
|
|
|
+ colSpan: 4
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return text
|
|
|
+ }
|
|
|
+ },
|
|
|
+ { title: '省份',
|
|
|
+ dataIndex: 'provinceName',
|
|
|
+ width: 150,
|
|
|
+ align: 'center',
|
|
|
+ customRender: function (text, row, index) {
|
|
|
+ if (text == '合计') {
|
|
|
+ return {
|
|
|
+ children: <span>{ text }</span>,
|
|
|
+ attrs: {
|
|
|
+ colSpan: 0
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return text || '--'
|
|
|
+ } },
|
|
|
+ { title: '客户名称',
|
|
|
+ dataIndex: 'custName',
|
|
|
+ width: 200,
|
|
|
+ align: 'center',
|
|
|
+ customRender: function (text, row, index) {
|
|
|
+ if (text == '合计') {
|
|
|
+ return {
|
|
|
+ children: <span>{ text }</span>,
|
|
|
+ attrs: {
|
|
|
+ colSpan: 0
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return text || '--'
|
|
|
+ } },
|
|
|
+ { title: '客户类型',
|
|
|
+ dataIndex: 'custType',
|
|
|
+ width: 200,
|
|
|
+ align: 'center',
|
|
|
+ customRender: function (text, row, index) {
|
|
|
+ if (text == '合计') {
|
|
|
+ return {
|
|
|
+ children: <span>{ text }</span>,
|
|
|
+ attrs: {
|
|
|
+ colSpan: 0
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return text || '--'
|
|
|
+ } },
|
|
|
+ { title: '品牌',
|
|
|
+ align: 'center',
|
|
|
+ children: [
|
|
|
+ {
|
|
|
+ title: '箭牌',
|
|
|
+ align: 'center',
|
|
|
+ children: [
|
|
|
+ {
|
|
|
+ title: '滤清器',
|
|
|
+ dataIndex: 'pp1',
|
|
|
+ align: 'center',
|
|
|
+ width: 100,
|
|
|
+ customRender: function (text) { return text ? ('¥' + text) : '--' }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '雨刮片',
|
|
|
+ dataIndex: 'pp2',
|
|
|
+ align: 'center',
|
|
|
+ width: 100,
|
|
|
+ customRender: function (text) { return text ? ('¥' + text) : '--' }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '喇叭',
|
|
|
+ dataIndex: 'pp3',
|
|
|
+ align: 'center',
|
|
|
+ width: 100,
|
|
|
+ customRender: function (text) { return text ? ('¥' + text) : '--' }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '刹车片',
|
|
|
+ dataIndex: 'pp4',
|
|
|
+ align: 'center',
|
|
|
+ width: 100,
|
|
|
+ customRender: function (text) { return text ? ('¥' + text) : '--' }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '感应线',
|
|
|
+ dataIndex: 'pp5',
|
|
|
+ align: 'center',
|
|
|
+ width: 100,
|
|
|
+ customRender: function (text) { return text ? ('¥' + text) : '--' }
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '冠牌',
|
|
|
+ align: 'center',
|
|
|
+ children: [
|
|
|
+ {
|
|
|
+ title: '滤清器',
|
|
|
+ dataIndex: 'pp6',
|
|
|
+ align: 'center',
|
|
|
+ width: 100,
|
|
|
+ customRender: function (text) { return text ? ('¥' + text) : '--' }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '雨刮片',
|
|
|
+ dataIndex: 'pp7',
|
|
|
+ align: 'center',
|
|
|
+ width: 100,
|
|
|
+ customRender: function (text) { return text ? ('¥' + text) : '--' }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '刹车片',
|
|
|
+ dataIndex: 'pp8',
|
|
|
+ align: 'center',
|
|
|
+ width: 100,
|
|
|
+ customRender: function (text) { return text ? ('¥' + text) : '--' }
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '汇箭',
|
|
|
+ dataIndex: 'pp9',
|
|
|
+ align: 'center',
|
|
|
+ width: 100,
|
|
|
+ customRender: function (text) { return text ? ('¥' + text) : '--' }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '德路斯',
|
|
|
+ dataIndex: 'pp10',
|
|
|
+ align: 'center',
|
|
|
+ width: 100,
|
|
|
+ customRender: function (text) { return text ? ('¥' + text) : '--' }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '稳升',
|
|
|
+ dataIndex: 'pp11',
|
|
|
+ align: 'center',
|
|
|
+ width: 100,
|
|
|
+ customRender: function (text) { return text ? ('¥' + text) : '--' }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: 'TBU',
|
|
|
+ dataIndex: 'pp12',
|
|
|
+ align: 'center',
|
|
|
+ width: 100,
|
|
|
+ customRender: function (text) { return text ? ('¥' + text) : '--' }
|
|
|
+ }
|
|
|
+ ] },
|
|
|
+ { title: '代理品牌',
|
|
|
+ align: 'center',
|
|
|
+ children: [
|
|
|
+ {
|
|
|
+ title: 'NGK',
|
|
|
+ dataIndex: 'pp13',
|
|
|
+ align: 'center',
|
|
|
+ width: 100,
|
|
|
+ customRender: function (text) { return text ? ('¥' + text) : '--' }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '飞利浦',
|
|
|
+ dataIndex: 'pp14',
|
|
|
+ align: 'center',
|
|
|
+ width: 100,
|
|
|
+ customRender: function (text) { return text ? ('¥' + text) : '--' }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '车仆',
|
|
|
+ dataIndex: 'pp15',
|
|
|
+ align: 'center',
|
|
|
+ width: 100,
|
|
|
+ customRender: function (text) { return text ? ('¥' + text) : '--' }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '瓦尔塔',
|
|
|
+ dataIndex: 'pp16',
|
|
|
+ align: 'center',
|
|
|
+ width: 100,
|
|
|
+ customRender: function (text) { return text ? ('¥' + text) : '--' }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '雷贝斯托',
|
|
|
+ dataIndex: 'pp17',
|
|
|
+ align: 'center',
|
|
|
+ width: 100,
|
|
|
+ customRender: function (text) { return text ? ('¥' + text) : '--' }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '德尔福',
|
|
|
+ dataIndex: 'pp18',
|
|
|
+ align: 'center',
|
|
|
+ width: 100,
|
|
|
+ customRender: function (text) { return text ? ('¥' + text) : '--' }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '巴诺德',
|
|
|
+ dataIndex: 'pp19',
|
|
|
+ align: 'center',
|
|
|
+ width: 100,
|
|
|
+ customRender: function (text) { return text ? ('¥' + text) : '--' }
|
|
|
+ }
|
|
|
+ ] },
|
|
|
+ { title: '实际销售合计金额', width: 200, dataIndex: 'totalAmount', align: 'center', customRender: function (text) { return text ? ('¥' + text) : '--' } }
|
|
|
],
|
|
|
// 加载数据方法 必须为 Promise 对象
|
|
|
loadData: parameter => {
|
|
|
- this.disabled = true
|
|
|
- if (this.tableHeight == 0) {
|
|
|
- this.tableHeight = window.innerHeight - 380
|
|
|
- }
|
|
|
- const paramsPage = Object.assign(this.queryParam, { pageNo: parameter.pageNo, pageSize: parameter.pageSize }) // 有分页
|
|
|
- const params = Object.assign(parameter, this.queryParam) // 无分页
|
|
|
- return oosBuyerList(params).then(res => {
|
|
|
- const data = res.data
|
|
|
- const no = (data.pageNo - 1) * data.pageSize
|
|
|
+ // this.disabled = true
|
|
|
+ // if (this.tableHeight == 0) {
|
|
|
+ // this.tableHeight = window.innerHeight - 380
|
|
|
+ // }
|
|
|
+ // const paramsPage = Object.assign(this.queryParam, { pageNo: parameter.pageNo, pageSize: parameter.pageSize }) // 有分页
|
|
|
+ // const params = Object.assign(parameter, this.queryParam) // 无分页
|
|
|
+ // return oosBuyerList(params).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: [{
|
|
|
+ area: 'A区',
|
|
|
+ provinceName: '广东省',
|
|
|
+ custName: '支持省级',
|
|
|
+ custType: '省级服务中心',
|
|
|
+ pp1: '125.02',
|
|
|
+ pp2: '73.00',
|
|
|
+ pp3: '0',
|
|
|
+ pp4: '0',
|
|
|
+ pp5: '0',
|
|
|
+ pp6: '0',
|
|
|
+ pp7: '0',
|
|
|
+ pp8: '0',
|
|
|
+ pp9: '0',
|
|
|
+ pp10: '0',
|
|
|
+ pp11: '0',
|
|
|
+ pp12: '0',
|
|
|
+ pp13: '0',
|
|
|
+ pp14: '0',
|
|
|
+ pp15: '0',
|
|
|
+ pp16: '0',
|
|
|
+ pp17: '0',
|
|
|
+ pp18: '0',
|
|
|
+ pp19: '0',
|
|
|
+ totalAmount: '198.02'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ area: '合计',
|
|
|
+ provinceName: '合计',
|
|
|
+ custName: '合计',
|
|
|
+ custType: '合计',
|
|
|
+ pp1: '125.02',
|
|
|
+ pp2: '73.00',
|
|
|
+ pp3: '0',
|
|
|
+ pp4: '0',
|
|
|
+ pp5: '0',
|
|
|
+ pp6: '0',
|
|
|
+ pp7: '0',
|
|
|
+ pp8: '0',
|
|
|
+ pp9: '0',
|
|
|
+ pp10: '0',
|
|
|
+ pp11: '0',
|
|
|
+ pp12: '0',
|
|
|
+ pp13: '0',
|
|
|
+ pp14: '0',
|
|
|
+ pp15: '0',
|
|
|
+ pp16: '0',
|
|
|
+ pp17: '0',
|
|
|
+ pp18: '0',
|
|
|
+ pp19: '0',
|
|
|
+ totalAmount: '198.02'
|
|
|
+ }],
|
|
|
+ count: 1
|
|
|
+ }
|
|
|
for (var i = 0; i < data.list.length; i++) {
|
|
|
- data.list[i].no = no + i + 1
|
|
|
+ data.list[i].no = i + 1
|
|
|
}
|
|
|
- this.disabled = false
|
|
|
- this.getCount(params)
|
|
|
- this.getCurrentCount(paramsPage)
|
|
|
- return data
|
|
|
+ _this.disabled = false
|
|
|
+ resolve(data)
|
|
|
})
|
|
|
},
|
|
|
productType: [],
|
|
@@ -125,23 +418,63 @@ export default {
|
|
|
custChange (obj) {
|
|
|
this.queryParam.buyerSn = obj.key
|
|
|
},
|
|
|
- // 合计
|
|
|
- getCount (params) {
|
|
|
- oosBuyerDetailCount(params).then(res => {
|
|
|
- if (res.status == 200) {
|
|
|
- this.productTotal = res.data
|
|
|
- } else {
|
|
|
- this.productTotal = null
|
|
|
- }
|
|
|
- })
|
|
|
+ // 获取城市列表
|
|
|
+ getCityList (val) {
|
|
|
+ const index = this.addrProvinceList.findIndex(item => item.areaSn == val)
|
|
|
+ if (index >= 0) {
|
|
|
+ this.queryParam.provinceName = this.addrProvinceList[index].name
|
|
|
+ }
|
|
|
+ this.addrCityList = []
|
|
|
+ this.addrDistrictList = []
|
|
|
+ this.queryParam.citySn = undefined
|
|
|
+ this.queryParam.districtSn = undefined
|
|
|
+ this.queryParam.address = ''
|
|
|
+ this.getArea('city', val)
|
|
|
+ },
|
|
|
+ // 获取区县列表
|
|
|
+ getAreaList (val) {
|
|
|
+ const index = this.addrCityList.findIndex(item => item.areaSn == val)
|
|
|
+ if (index >= 0) {
|
|
|
+ this.queryParam.cityName = this.addrCityList[index].name
|
|
|
+ }
|
|
|
+ this.addrDistrictList = []
|
|
|
+ this.queryParam.districtSn = undefined
|
|
|
+ this.queryParam.address = ''
|
|
|
+ this.getArea('district', val)
|
|
|
},
|
|
|
- // 本页合计
|
|
|
- getCurrentCount (params) {
|
|
|
- oosBuyerDetailPageCount(params).then(res => {
|
|
|
+ // 区县变更
|
|
|
+ areaCharged (val) {
|
|
|
+ const index = this.addrDistrictList.findIndex(item => item.areaSn == val)
|
|
|
+ if (index >= 0) {
|
|
|
+ this.queryParam.districtName = this.addrDistrictList[index].name
|
|
|
+ }
|
|
|
+ this.queryParam.address = ''
|
|
|
+ },
|
|
|
+ // 省/市/区
|
|
|
+ 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) {
|
|
|
- this.currentTotal = res.data
|
|
|
+ if (leve == 'province') {
|
|
|
+ this.addrProvinceList = res.data || []
|
|
|
+ } else if (leve == 'city') {
|
|
|
+ this.addrCityList = res.data || []
|
|
|
+ } else if (leve == 'district') {
|
|
|
+ this.addrDistrictList = res.data || []
|
|
|
+ }
|
|
|
} else {
|
|
|
- this.currentTotal = null
|
|
|
+ if (leve == 'province') {
|
|
|
+ this.addrProvinceList = []
|
|
|
+ } else if (leve == 'city') {
|
|
|
+ this.addrCityList = []
|
|
|
+ } else if (leve == 'district') {
|
|
|
+ this.addrDistrictList = []
|
|
|
+ }
|
|
|
}
|
|
|
})
|
|
|
},
|
|
@@ -196,6 +529,7 @@ export default {
|
|
|
},
|
|
|
beforeRouteEnter (to, from, next) {
|
|
|
next(vm => {
|
|
|
+ vm.getArea('province')
|
|
|
})
|
|
|
}
|
|
|
}
|