|
@@ -29,39 +29,21 @@
|
|
|
</a-form-model-item>
|
|
|
</a-col>
|
|
|
<a-col :md="6" :sm="24">
|
|
|
- <a-form-model-item label="产品品牌" :prop="type=='dealership'?'productBrandSn':''">
|
|
|
- <a-select
|
|
|
- placeholder="请选择产品品牌"
|
|
|
- id="chooseProducts-productBrandSn"
|
|
|
- allowClear
|
|
|
- v-model="queryParam.productBrandSn"
|
|
|
- :showSearch="true"
|
|
|
- option-filter-prop="children"
|
|
|
- :filter-option="filterOption">
|
|
|
- <a-select-option v-for="item in productBrandList" :key="item.brandSn" :value="item.brandSn">{{ item.brandName }}</a-select-option>
|
|
|
- </a-select>
|
|
|
- </a-form-model-item>
|
|
|
+ <a-form-item label="产品品牌" :prop="type=='dealership'?'productBrandSn':''">
|
|
|
+ <ProductBrand id="chooseProducts-productBrandSn" v-model="queryParam.productBrandSn"></ProductBrand>
|
|
|
+ </a-form-item>
|
|
|
</a-col>
|
|
|
<a-col :md="6" :sm="24">
|
|
|
- <a-form-model-item label="产品分类" :prop="type=='dealership'?'productType':''">
|
|
|
- <a-cascader
|
|
|
- @change="changeProductType"
|
|
|
- change-on-select
|
|
|
- v-model="queryParam.productType"
|
|
|
- expand-trigger="hover"
|
|
|
- :options="productTypeList"
|
|
|
- :fieldNames="{ label: 'productTypeName', value: 'productTypeSn', children: 'children' }"
|
|
|
- id="chooseProducts-productType"
|
|
|
- placeholder="请选择产品分类"
|
|
|
- allowClear />
|
|
|
- </a-form-model-item>
|
|
|
+ <a-form-item label="产品分类" :prop="type=='dealership'?'productType':''">
|
|
|
+ <productTypeAll :isAll="type!='default'" placeholder="请选择产品分类" @change="changeProductType" v-model="queryParam.productType" id="chooseProducts-productType"></productTypeAll>
|
|
|
+ </a-form-item>
|
|
|
</a-col>
|
|
|
<a-col :md="6" :sm="24" style="margin-bottom: 10px;">
|
|
|
<a-button type="primary" @click="handleSearch" :disabled="disabled" id="chooseProducts-refresh">查询</a-button>
|
|
|
<a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="chooseProducts-reset">重置</a-button>
|
|
|
</a-col>
|
|
|
</a-row>
|
|
|
- </a-form-model></a-form>
|
|
|
+ </a-form-model>
|
|
|
</div>
|
|
|
<p style="font-weight: bold;">当前已选:{{ rowSelectionInfo&&rowSelectionInfo.selectedRowKeys.length }}个</p>
|
|
|
<!-- 列表 -->
|
|
@@ -103,13 +85,13 @@
|
|
|
<script>
|
|
|
import { STable } from '@/components'
|
|
|
import tablePagination from '@/views/common/tablePagination.vue'
|
|
|
-import { productBrandQuery } from '@/api/productBrand'
|
|
|
-import { productTypeQuery, productTypeQueryAll } from '@/api/productType'
|
|
|
+import ProductBrand from '@/views/common/productBrand.js'
|
|
|
+import productTypeAll from '@/views/common/productTypeAll.js'
|
|
|
import { dealerScopeValidProduct } from '@/api/dealerScope'
|
|
|
import { productPricedList, productPricingList } from '@/api/product'
|
|
|
export default {
|
|
|
name: 'ChooseProductsModal',
|
|
|
- components: { STable, tablePagination },
|
|
|
+ components: { STable, tablePagination, ProductBrand, productTypeAll },
|
|
|
props: {
|
|
|
openModal: { // 弹框显示状态
|
|
|
type: Boolean,
|
|
@@ -123,7 +105,7 @@ export default {
|
|
|
},
|
|
|
type: { // 类型,经销权设置dealership, 供应商添加产品supplier
|
|
|
type: String,
|
|
|
- default: ''
|
|
|
+ default: 'default'
|
|
|
},
|
|
|
dealerSn: {
|
|
|
type: String || Number,
|
|
@@ -183,8 +165,6 @@ export default {
|
|
|
return data
|
|
|
})
|
|
|
},
|
|
|
- productBrandList: [], // 品牌下拉数据
|
|
|
- productTypeList: [], // 分类下拉数据
|
|
|
rowSelectionInfo: null
|
|
|
}
|
|
|
},
|
|
@@ -282,41 +262,6 @@ export default {
|
|
|
this.queryParam.productTypeSn1 = val[0] ? val[0] : ''
|
|
|
this.queryParam.productTypeSn2 = val[1] ? val[1] : ''
|
|
|
this.queryParam.productTypeSn3 = val[2] ? val[2] : ''
|
|
|
- },
|
|
|
- filterOption (input, option) {
|
|
|
- return (
|
|
|
- option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
|
|
|
- )
|
|
|
- },
|
|
|
- // 产品品牌 列表
|
|
|
- getProductBrand () {
|
|
|
- productBrandQuery({}).then(res => {
|
|
|
- if (res.status == 200) {
|
|
|
- this.productBrandList = res.data
|
|
|
- } else {
|
|
|
- this.productBrandList = []
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
- // 产品分类 列表
|
|
|
- getProductType () {
|
|
|
- if (this.type != 'supplier' && this.type != 'dealership') { // 促销
|
|
|
- productTypeQueryAll({}).then(res => {
|
|
|
- if (res.status == 200) {
|
|
|
- this.productTypeList = res.data
|
|
|
- } else {
|
|
|
- this.productTypeList = []
|
|
|
- }
|
|
|
- })
|
|
|
- } else {
|
|
|
- productTypeQuery({}).then(res => {
|
|
|
- if (res.status == 200) {
|
|
|
- this.productTypeList = res.data
|
|
|
- } else {
|
|
|
- this.productTypeList = []
|
|
|
- }
|
|
|
- })
|
|
|
- }
|
|
|
}
|
|
|
},
|
|
|
watch: {
|
|
@@ -347,12 +292,6 @@ export default {
|
|
|
this.$nextTick(() => { // 页面渲染完成后的回调
|
|
|
_this.$refs.table.setTableSelected(selectedRowKeys, selectedRows) // 设置表格选中项
|
|
|
})
|
|
|
- if (this.productBrandList.length == 0) {
|
|
|
- this.getProductBrand()
|
|
|
- }
|
|
|
- if (this.productTypeList.length == 0) {
|
|
|
- this.getProductType()
|
|
|
- }
|
|
|
}
|
|
|
}
|
|
|
}
|