|
@@ -9,58 +9,35 @@
|
|
<a-card size="small" :bordered="false" class="permissionSetting-main">
|
|
<a-card size="small" :bordered="false" class="permissionSetting-main">
|
|
<!-- 搜索条件 -->
|
|
<!-- 搜索条件 -->
|
|
<div class="table-page-search-wrapper">
|
|
<div class="table-page-search-wrapper">
|
|
- <a-form layout="inline" @keyup.enter.native="getProductList(1)">
|
|
|
|
|
|
+ <a-form-model
|
|
|
|
+ id="permissionSetting-form"
|
|
|
|
+ ref="ruleForm"
|
|
|
|
+ :model="queryParam"
|
|
|
|
+ :rules="rules"
|
|
|
|
+ layout="inline"
|
|
|
|
+ @keyup.enter.native="handleSearch">
|
|
<a-row :gutter="15">
|
|
<a-row :gutter="15">
|
|
<a-col :md="6" :sm="24">
|
|
<a-col :md="6" :sm="24">
|
|
- <a-form-item label="产品名称">
|
|
|
|
- <a-input id="permissionSetting-name" v-model.trim="queryParam.name" allowClear placeholder="请输入产品名称"/>
|
|
|
|
- </a-form-item>
|
|
|
|
|
|
+ <a-form-model-item label="类型" prop="goodsType">
|
|
|
|
+ <v-select code="DEALER_GOODS_TYPE" id="permissionSetting-goodsType" v-model="queryParam.goodsType" allowClear placeholder="请选择类型"></v-select>
|
|
|
|
+ </a-form-model-item>
|
|
</a-col>
|
|
</a-col>
|
|
<a-col :md="6" :sm="24">
|
|
<a-col :md="6" :sm="24">
|
|
- <a-form-item label="产品编码">
|
|
|
|
- <a-input id="permissionSetting-productCode" v-model.trim="queryParam.productCode" allowClear placeholder="请输入产品编码"/>
|
|
|
|
- </a-form-item>
|
|
|
|
|
|
+ <a-form-model-item label="类型名称" prop="goodsName">
|
|
|
|
+ <a-input id="permissionSetting-goodsName" v-model.trim="queryParam.goodsName" allowClear placeholder="请输入类型名称"/>
|
|
|
|
+ </a-form-model-item>
|
|
</a-col>
|
|
</a-col>
|
|
<a-col :md="6" :sm="24">
|
|
<a-col :md="6" :sm="24">
|
|
- <a-form-item label="品牌">
|
|
|
|
- <a-select
|
|
|
|
- placeholder="请选择"
|
|
|
|
- id="permissionSetting-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-item>
|
|
|
|
|
|
+ <a-form-model-item label="产品编码" prop="goodsCode">
|
|
|
|
+ <a-input id="permissionSetting-goodsCode" v-model.trim="queryParam.goodsCode" allowClear placeholder="请输入产品编码"/>
|
|
|
|
+ </a-form-model-item>
|
|
</a-col>
|
|
</a-col>
|
|
- <template v-if="advanced">
|
|
|
|
- <a-col :md="6" :sm="24">
|
|
|
|
- <a-form-item label="产品分类">
|
|
|
|
- <a-cascader
|
|
|
|
- @change="changeProductType"
|
|
|
|
- expand-trigger="hover"
|
|
|
|
- change-on-select
|
|
|
|
- :options="productTypeList"
|
|
|
|
- :fieldNames="{ label: 'productTypeName', value: 'id', children: 'children' }"
|
|
|
|
- id="permissionSetting-productType"
|
|
|
|
- placeholder="请选择产品分类"
|
|
|
|
- allowClear
|
|
|
|
- v-model="productType" />
|
|
|
|
- </a-form-item>
|
|
|
|
- </a-col>
|
|
|
|
- </template>
|
|
|
|
<a-col :md="6" :sm="24">
|
|
<a-col :md="6" :sm="24">
|
|
- <a-button style="margin-bottom: 18px;" type="primary" @click="getProductList(1)" :disabled="disabled" id="permissionSetting-refresh">查询</a-button>
|
|
|
|
|
|
+ <a-button style="margin-bottom: 18px;" type="primary" @click="handleSearch" :disabled="disabled" id="permissionSetting-refresh">查询</a-button>
|
|
<a-button style="margin: 0 0 18px 8px" @click="resetSearchForm" :disabled="disabled" id="permissionSetting-reset">重置</a-button>
|
|
<a-button style="margin: 0 0 18px 8px" @click="resetSearchForm" :disabled="disabled" id="permissionSetting-reset">重置</a-button>
|
|
- <a @click="advanced=!advanced" style="margin-left: 8px">
|
|
|
|
- {{ advanced ? '收起' : '展开' }}
|
|
|
|
- <a-icon :type="advanced ? 'up' : 'down'"/>
|
|
|
|
- </a>
|
|
|
|
</a-col>
|
|
</a-col>
|
|
</a-row>
|
|
</a-row>
|
|
- </a-form>
|
|
|
|
|
|
+ </a-form-model>
|
|
</div>
|
|
</div>
|
|
<!-- 操作按钮 -->
|
|
<!-- 操作按钮 -->
|
|
<div class="table-operator">
|
|
<div class="table-operator">
|
|
@@ -106,8 +83,6 @@ import { STable, VSelect } from '@/components'
|
|
import ChooseProductsModal from '@/views/common/chooseProductsModal.vue'
|
|
import ChooseProductsModal from '@/views/common/chooseProductsModal.vue'
|
|
import ChooseBrandModal from '@/views/common/chooseBrandModal.vue'
|
|
import ChooseBrandModal from '@/views/common/chooseBrandModal.vue'
|
|
import ChooseTypeModal from '@/views/common/chooseTypeModal.vue'
|
|
import ChooseTypeModal from '@/views/common/chooseTypeModal.vue'
|
|
-import { productBrandQuery } from '@/api/productBrand'
|
|
|
|
-import { productTypeQuery } from '@/api/productType'
|
|
|
|
import { dealerScopeList, dealerScopeSave, dealerScopeDel, dealerScopeQueryList } from '@/api/dealerScope'
|
|
import { dealerScopeList, dealerScopeSave, dealerScopeDel, dealerScopeQueryList } from '@/api/dealerScope'
|
|
export default {
|
|
export default {
|
|
components: { STable, VSelect, ChooseProductsModal, ChooseBrandModal, ChooseTypeModal },
|
|
components: { STable, VSelect, ChooseProductsModal, ChooseBrandModal, ChooseTypeModal },
|
|
@@ -116,14 +91,13 @@ export default {
|
|
advanced: false, // 高级搜索 展开/关闭
|
|
advanced: false, // 高级搜索 展开/关闭
|
|
tableHeight: 0,
|
|
tableHeight: 0,
|
|
queryParam: { // 查询条件
|
|
queryParam: { // 查询条件
|
|
- name: '', // 产品名称
|
|
|
|
- productCode: '', // 产品编码
|
|
|
|
- productBrandSn: undefined, // 产品品牌
|
|
|
|
- productTypeSn1: '', // 产品一级分类
|
|
|
|
- productTypeSn2: '', // 产品二级分类
|
|
|
|
- productTypeSn3: '' // 产品三级分类
|
|
|
|
|
|
+ goodsType: undefined,
|
|
|
|
+ goodsName: '',
|
|
|
|
+ goodsCode: ''
|
|
|
|
+ },
|
|
|
|
+ rules: {
|
|
|
|
+ goodsType: [ { required: true, message: '请选择类型', trigger: 'change' } ]
|
|
},
|
|
},
|
|
- productType: [],
|
|
|
|
disabled: false, // 查询、重置按钮是否可操作
|
|
disabled: false, // 查询、重置按钮是否可操作
|
|
loading: false, // 表格加载中
|
|
loading: false, // 表格加载中
|
|
columns: [
|
|
columns: [
|
|
@@ -145,8 +119,6 @@ export default {
|
|
onShowSizeChange: (current, pageSize) => this.changePageSize(current, pageSize),
|
|
onShowSizeChange: (current, pageSize) => this.changePageSize(current, pageSize),
|
|
onChange: (current) => this.changePage(current)
|
|
onChange: (current) => this.changePage(current)
|
|
},
|
|
},
|
|
- productBrandList: [], // 品牌下拉数据
|
|
|
|
- productTypeList: [], // 分类下拉数据
|
|
|
|
openBrandModal: false, // 选择产品品牌
|
|
openBrandModal: false, // 选择产品品牌
|
|
openTypeModal: false, // 选择产品分类
|
|
openTypeModal: false, // 选择产品分类
|
|
openProductsModal: false, // 选择产品
|
|
openProductsModal: false, // 选择产品
|
|
@@ -156,6 +128,17 @@ export default {
|
|
}
|
|
}
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
|
|
+ // 查询
|
|
|
|
+ handleSearch () {
|
|
|
|
+ const _this = this
|
|
|
|
+ this.$refs.ruleForm.validate(valid => {
|
|
|
|
+ if (valid) {
|
|
|
|
+ _this.getProductList(1)
|
|
|
|
+ } else {
|
|
|
|
+ return false
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ },
|
|
// 经销权 列表
|
|
// 经销权 列表
|
|
getProductList (pageNo) {
|
|
getProductList (pageNo) {
|
|
this.pageNo = pageNo || this.pageNo
|
|
this.pageNo = pageNo || this.pageNo
|
|
@@ -309,13 +292,9 @@ export default {
|
|
},
|
|
},
|
|
// 重置表单
|
|
// 重置表单
|
|
resetSearchForm () {
|
|
resetSearchForm () {
|
|
- this.queryParam.name = ''
|
|
|
|
- this.queryParam.productCode = ''
|
|
|
|
- this.queryParam.productBrandSn = undefined
|
|
|
|
- this.queryParam.productTypeSn1 = ''
|
|
|
|
- this.queryParam.productTypeSn2 = ''
|
|
|
|
- this.queryParam.productTypeSn3 = ''
|
|
|
|
- this.productType = []
|
|
|
|
|
|
+ this.queryParam.goodsType = undefined
|
|
|
|
+ this.queryParam.goodsName = ''
|
|
|
|
+ this.queryParam.goodsCode = ''
|
|
this.getProductList(1)
|
|
this.getProductList(1)
|
|
},
|
|
},
|
|
// 返回
|
|
// 返回
|
|
@@ -326,39 +305,11 @@ export default {
|
|
return (
|
|
return (
|
|
option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
|
|
option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
|
|
)
|
|
)
|
|
- },
|
|
|
|
- // 产品分类 change
|
|
|
|
- changeProductType (val, opt) {
|
|
|
|
- this.queryParam.productTypeSn1 = val[0] ? val[0] : ''
|
|
|
|
- this.queryParam.productTypeSn2 = val[1] ? val[1] : ''
|
|
|
|
- this.queryParam.productTypeSn3 = val[2] ? val[2] : ''
|
|
|
|
- },
|
|
|
|
- // 产品品牌 列表
|
|
|
|
- getProductBrand () {
|
|
|
|
- productBrandQuery({}).then(res => {
|
|
|
|
- if (res.status == 200) {
|
|
|
|
- this.productBrandList = res.data
|
|
|
|
- } else {
|
|
|
|
- this.productBrandList = []
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
- },
|
|
|
|
- // 产品分类 列表
|
|
|
|
- getProductType () {
|
|
|
|
- productTypeQuery({}).then(res => {
|
|
|
|
- if (res.status == 200) {
|
|
|
|
- this.productTypeList = res.data
|
|
|
|
- } else {
|
|
|
|
- this.productTypeList = []
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
}
|
|
}
|
|
},
|
|
},
|
|
beforeRouteEnter (to, from, next) {
|
|
beforeRouteEnter (to, from, next) {
|
|
next(vm => {
|
|
next(vm => {
|
|
vm.getProductList(1)
|
|
vm.getProductList(1)
|
|
- vm.getProductBrand()
|
|
|
|
- vm.getProductType()
|
|
|
|
})
|
|
})
|
|
}
|
|
}
|
|
}
|
|
}
|