|
@@ -1,6 +1,6 @@
|
|
<template>
|
|
<template>
|
|
<div class="categoryList-wrap">
|
|
<div class="categoryList-wrap">
|
|
- <div ref="tableSearch" v-if="!showEmpty" class="table-page-search-wrapper">
|
|
|
|
|
|
+ <div ref="tableSearch" v-if="showTable" class="table-page-search-wrapper">
|
|
<a-form-model
|
|
<a-form-model
|
|
ref="ruleForm"
|
|
ref="ruleForm"
|
|
class="form-model-con"
|
|
class="form-model-con"
|
|
@@ -8,17 +8,26 @@
|
|
:model="queryParam"
|
|
:model="queryParam"
|
|
@keyup.enter.native="handleSearch">
|
|
@keyup.enter.native="handleSearch">
|
|
<a-row :gutter="15">
|
|
<a-row :gutter="15">
|
|
- <a-col :md="8" :sm="24">
|
|
|
|
|
|
+ <a-col :md="6" :sm="24">
|
|
|
|
+ <a-form-item label="品牌分类">
|
|
|
|
+ <v-select
|
|
|
|
+ code="BRAND_TYPE"
|
|
|
|
+ v-model="queryParam.productBrandType"
|
|
|
|
+ allowClear
|
|
|
|
+ placeholder="请选择品牌分类"></v-select>
|
|
|
|
+ </a-form-item>
|
|
|
|
+ </a-col>
|
|
|
|
+ <a-col :md="6" :sm="24">
|
|
<a-form-model-item label="品牌">
|
|
<a-form-model-item label="品牌">
|
|
<ProductBrand v-model="queryParam.productBrandSn"></ProductBrand>
|
|
<ProductBrand v-model="queryParam.productBrandSn"></ProductBrand>
|
|
</a-form-model-item>
|
|
</a-form-model-item>
|
|
</a-col>
|
|
</a-col>
|
|
- <a-col :md="8" :sm="24">
|
|
|
|
|
|
+ <a-col :md="6" :sm="24">
|
|
<a-form-model-item label="产品分类">
|
|
<a-form-model-item label="产品分类">
|
|
<ProductType placeholder="请选择产品分类" @change="changeProductType" v-model="productType"></ProductType>
|
|
<ProductType placeholder="请选择产品分类" @change="changeProductType" v-model="productType"></ProductType>
|
|
</a-form-model-item>
|
|
</a-form-model-item>
|
|
</a-col>
|
|
</a-col>
|
|
- <a-col :md="8" :sm="24" style="margin-bottom: 10px;">
|
|
|
|
|
|
+ <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
|
|
<a-button type="primary" @click="handleSearch">查询</a-button>
|
|
<a-button type="primary" @click="handleSearch">查询</a-button>
|
|
<a-button style="margin-left: 5px" @click="resetSearchForm">重置</a-button>
|
|
<a-button style="margin-left: 5px" @click="resetSearchForm">重置</a-button>
|
|
</a-col>
|
|
</a-col>
|
|
@@ -28,6 +37,7 @@
|
|
|
|
|
|
<a-spin :spinning="spinning" tip="Loading...">
|
|
<a-spin :spinning="spinning" tip="Loading...">
|
|
<ve-table
|
|
<ve-table
|
|
|
|
+ v-show="!showEmpty"
|
|
border-y
|
|
border-y
|
|
:scroll-width="0"
|
|
:scroll-width="0"
|
|
:max-height="tableHeight"
|
|
:max-height="tableHeight"
|
|
@@ -48,14 +58,15 @@
|
|
|
|
|
|
<script>
|
|
<script>
|
|
import { commonMixin } from '@/utils/mixin'
|
|
import { commonMixin } from '@/utils/mixin'
|
|
-import { waitDispatchDetailAllList } from '@/api/waitDispatchDetail'
|
|
|
|
|
|
+import { VSelect } from '@/components'
|
|
|
|
+import { dealerUpsPlQuery } from '@/api/dealer'
|
|
import { Empty } from 'ant-design-vue'
|
|
import { Empty } from 'ant-design-vue'
|
|
import ProductBrand from '@/views/common/productBrand.js'
|
|
import ProductBrand from '@/views/common/productBrand.js'
|
|
import ProductType from '@/views/common/productType.js'
|
|
import ProductType from '@/views/common/productType.js'
|
|
export default {
|
|
export default {
|
|
name: 'DetailProductList',
|
|
name: 'DetailProductList',
|
|
mixins: [commonMixin],
|
|
mixins: [commonMixin],
|
|
- components: { ProductType, ProductBrand },
|
|
|
|
|
|
+ components: { VSelect, ProductType, ProductBrand },
|
|
props: {
|
|
props: {
|
|
newLoading: {
|
|
newLoading: {
|
|
type: Boolean,
|
|
type: Boolean,
|
|
@@ -65,9 +76,9 @@ export default {
|
|
type: [String, Number],
|
|
type: [String, Number],
|
|
default: '300'
|
|
default: '300'
|
|
},
|
|
},
|
|
- showHeader: {
|
|
|
|
|
|
+ showTable: {
|
|
type: Boolean,
|
|
type: Boolean,
|
|
- default: true
|
|
|
|
|
|
+ default: false
|
|
}
|
|
}
|
|
},
|
|
},
|
|
data () {
|
|
data () {
|
|
@@ -95,11 +106,13 @@ export default {
|
|
selectedRowKeys: [],
|
|
selectedRowKeys: [],
|
|
productType: [],
|
|
productType: [],
|
|
queryParam: { // 查询条件
|
|
queryParam: { // 查询条件
|
|
|
|
+ productBrandType: undefined,
|
|
productBrandSn: undefined,
|
|
productBrandSn: undefined,
|
|
productTypeSn1: undefined,
|
|
productTypeSn1: undefined,
|
|
productTypeSn2: undefined,
|
|
productTypeSn2: undefined,
|
|
productTypeSn3: undefined
|
|
productTypeSn3: undefined
|
|
- }
|
|
|
|
|
|
+ },
|
|
|
|
+ dealerSn: undefined
|
|
}
|
|
}
|
|
},
|
|
},
|
|
computed: {
|
|
computed: {
|
|
@@ -119,12 +132,12 @@ export default {
|
|
},
|
|
},
|
|
columns () {
|
|
columns () {
|
|
const arr = [
|
|
const arr = [
|
|
- { title: '', field: '', key: 'acheck', width: 60, type: 'checkbox', align: 'center' },
|
|
|
|
// { title: '序号', field: 'no', key: 'a', width: 60, align: 'center', operationColumn: false },
|
|
// { title: '序号', field: 'no', key: 'a', width: 60, align: 'center', operationColumn: false },
|
|
- { title: '品牌', field: 'productCode', key: 'b', width: 150, align: 'center', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return row[column.field] || '--' } },
|
|
|
|
- { title: '一级分类', field: 'warehouseName', key: 'e', width: 150, align: 'center', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return row[column.field] || '--' } },
|
|
|
|
- { title: '二级分类', field: 'productOrigUnit', width: 150, key: 'i', align: 'center', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return row[column.field] || '--' } },
|
|
|
|
- { title: '三级分类', field: 'productName', width: 150, key: 'm', align: 'center', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return row[column.field] || '--' } }
|
|
|
|
|
|
+ { title: '', field: '', key: 'acheck', width: 40, type: 'checkbox', align: 'center' },
|
|
|
|
+ { title: '品牌', field: 'productBrandName', key: 'b', width: 100, align: 'center', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return row[column.field] || '--' } },
|
|
|
|
+ { title: '一级分类', field: 'productTypeName1', key: 'e', width: 180, align: 'center', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return row[column.field] || '--' } },
|
|
|
|
+ { title: '二级分类', field: 'productTypeName2', width: 180, key: 'i', align: 'center', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return row[column.field] || '--' } },
|
|
|
|
+ { title: '三级分类', field: 'productTypeName3', width: 180, key: 'm', align: 'center', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return row[column.field] || '--' } }
|
|
]
|
|
]
|
|
return arr
|
|
return arr
|
|
}
|
|
}
|
|
@@ -132,7 +145,11 @@ export default {
|
|
methods: {
|
|
methods: {
|
|
// 查询品类列表
|
|
// 查询品类列表
|
|
handleSearch () {
|
|
handleSearch () {
|
|
-
|
|
|
|
|
|
+ if (this.detailData && this.detailData.upsPriceLevel && this.detailData.upsDealerSn) {
|
|
|
|
+ this.searchTable()
|
|
|
|
+ } else {
|
|
|
|
+ this.$message.info('请选择上级经销商及其价格级别')
|
|
|
|
+ }
|
|
},
|
|
},
|
|
// 产品分类 change
|
|
// 产品分类 change
|
|
changeProductType (val, opt) {
|
|
changeProductType (val, opt) {
|
|
@@ -142,6 +159,7 @@ export default {
|
|
},
|
|
},
|
|
// 重置查询筛选表单
|
|
// 重置查询筛选表单
|
|
resetSearchForm () {
|
|
resetSearchForm () {
|
|
|
|
+ this.queryParam.productBrandType = undefined
|
|
this.queryParam.productBrandSn = undefined
|
|
this.queryParam.productBrandSn = undefined
|
|
this.queryParam.productTypeSn1 = undefined
|
|
this.queryParam.productTypeSn1 = undefined
|
|
this.queryParam.productTypeSn2 = undefined
|
|
this.queryParam.productTypeSn2 = undefined
|
|
@@ -149,7 +167,7 @@ export default {
|
|
this.productType = []
|
|
this.productType = []
|
|
this.dataSource = []
|
|
this.dataSource = []
|
|
this.clearSelectTable()
|
|
this.clearSelectTable()
|
|
- this.searchTable()
|
|
|
|
|
|
+ this.handleSearch()
|
|
},
|
|
},
|
|
// 清空选项
|
|
// 清空选项
|
|
clearSelectTable () {
|
|
clearSelectTable () {
|
|
@@ -162,44 +180,55 @@ export default {
|
|
},
|
|
},
|
|
// 全选行
|
|
// 全选行
|
|
selectedAllChange ({ isSelected, selectedRowKeys }) {
|
|
selectedAllChange ({ isSelected, selectedRowKeys }) {
|
|
- // console.log(isSelected, selectedRowKeys);
|
|
|
|
|
|
+ // console.log(isSelected, selectedRowKeys)
|
|
this.selectedRowKeys = selectedRowKeys
|
|
this.selectedRowKeys = selectedRowKeys
|
|
},
|
|
},
|
|
|
|
+ // 获取已选数据
|
|
|
|
+ getChooseData () {
|
|
|
|
+ const result = []
|
|
|
|
+ if (this.selectedRowKeys.length) {
|
|
|
|
+ const rows = this.dataSource.filter(item => this.selectedRowKeys.includes(item.id))
|
|
|
|
+ if (rows) {
|
|
|
|
+ rows.map(item => {
|
|
|
|
+ result.push({
|
|
|
|
+ dealerSn: item.dealerSn,
|
|
|
|
+ priceLevel: item.priceLevel,
|
|
|
|
+ parentScopeSn: item.dealerScopeSn,
|
|
|
|
+ productBrandSn: item.productBrandSn,
|
|
|
|
+ productTypeSn1: item.productTypeSn1,
|
|
|
|
+ productTypeSn2: item.productTypeSn2,
|
|
|
|
+ productTypeSn3: item.productTypeSn3
|
|
|
|
+ })
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ console.log(result)
|
|
|
|
+ return result
|
|
|
|
+ },
|
|
async searchTable () {
|
|
async searchTable () {
|
|
this.selectedRowKeys = []
|
|
this.selectedRowKeys = []
|
|
this.disableSelectedRowKeys = []
|
|
this.disableSelectedRowKeys = []
|
|
this.dataSource = []
|
|
this.dataSource = []
|
|
this.disabled = true
|
|
this.disabled = true
|
|
this.spinning = true
|
|
this.spinning = true
|
|
- const params = this.queryParam
|
|
|
|
-
|
|
|
|
- // 带下推产品
|
|
|
|
- const listData = await waitDispatchDetailAllList(params).then(res => res.data)
|
|
|
|
|
|
+ const params = { ...this.detailData }
|
|
|
|
+ params.dealerScope = { dealerSn: this.dealerSn, ...this.queryParam }
|
|
|
|
+ console.log(params)
|
|
|
|
+ // 品类列表
|
|
|
|
+ const listData = await dealerUpsPlQuery(params).then(res => res.data)
|
|
this.dataSource = listData
|
|
this.dataSource = listData
|
|
// 格式化数据
|
|
// 格式化数据
|
|
- let f = 0
|
|
|
|
this.dataSource.map((item, i) => {
|
|
this.dataSource.map((item, i) => {
|
|
- if (item.id.indexOf('promo-') >= 0) { f = f - 1 }
|
|
|
|
- item.no = i + 1 + f
|
|
|
|
- const productCode = (item.productEntity && item.productEntity.code) || (item.dealerProductEntity && item.dealerProductEntity.code)
|
|
|
|
- const productName = (item.productEntity && item.productEntity.name) || (item.dealerProductEntity && item.dealerProductEntity.name)
|
|
|
|
- const productOrigCode = (item.productEntity && item.productEntity.origCode) || (item.dealerProductEntity && item.dealerProductEntity.origCode)
|
|
|
|
- const productOrigUnit = (item.productEntity && item.productEntity.unit) || (item.dealerProductEntity && item.dealerProductEntity.unit)
|
|
|
|
- const warehouseName = item.dispatchBill && item.dispatchBill.warehouseName || ''
|
|
|
|
- item.productCode = productCode || '--'
|
|
|
|
- item.productName = productName || '--'
|
|
|
|
- item.productOrigCode = productOrigCode == ' ' ? '--' : productOrigCode
|
|
|
|
- item.productOrigUnit = productOrigUnit || '--'
|
|
|
|
- item.warehouseName = warehouseName || '--'
|
|
|
|
|
|
+ item.no = i + 1
|
|
})
|
|
})
|
|
this.showEmpty = this.dataSource.length <= 0
|
|
this.showEmpty = this.dataSource.length <= 0
|
|
- this.tableHeight = (this.showEmpty ? 300 : this.maxHeight) + 'px'
|
|
|
|
|
|
+ this.tableHeight = (this.showEmpty ? 0 : this.maxHeight) + 'px'
|
|
this.spinning = false
|
|
this.spinning = false
|
|
this.disabled = false
|
|
this.disabled = false
|
|
},
|
|
},
|
|
- pageInit (productForm, detailData) {
|
|
|
|
- this.productForm = Object.assign(this.productForm, productForm)
|
|
|
|
|
|
+ pageInit (detailData, dealerSn) {
|
|
this.detailData = detailData
|
|
this.detailData = detailData
|
|
|
|
+ this.dealerSn = dealerSn
|
|
// 获取列表
|
|
// 获取列表
|
|
this.resetSearchForm()
|
|
this.resetSearchForm()
|
|
}
|
|
}
|