|
@@ -17,25 +17,25 @@
|
|
|
class="form-model-con"
|
|
|
layout="inline"
|
|
|
:model="queryParam"
|
|
|
- @keyup.enter.native="handleSearch">
|
|
|
+ @keyup.enter.native="$refs.table.refresh()">
|
|
|
<a-row :gutter="15">
|
|
|
<a-col :md="6" :sm="24">
|
|
|
- <a-form-model-item label="品牌" prop="goodsBrand">
|
|
|
+ <a-form-model-item label="品牌" prop="productBrandSn">
|
|
|
<ProductBrand id="chooseProducts-productBrandSn" v-model="queryParam.productBrandSn"></ProductBrand>
|
|
|
</a-form-model-item>
|
|
|
</a-col>
|
|
|
<a-col :md="6" :sm="24">
|
|
|
- <a-form-model-item label="产品分类" prop="goodsType">
|
|
|
- <productTypeAll placeholder="请选择产品分类" @change="changeProductType" v-model="queryParam.productType" id="chooseProducts-productType"></productTypeAll>
|
|
|
+ <a-form-model-item label="产品分类" prop="productType">
|
|
|
+ <productTypeAll placeholder="请选择产品分类" @change="changeProductType" v-model="productType" id="chooseProducts-productType"></productTypeAll>
|
|
|
</a-form-model-item>
|
|
|
</a-col>
|
|
|
<a-col :md="6" :sm="24">
|
|
|
- <a-form-model-item label="价格级别" prop="goodsCode">
|
|
|
- <v-select code="PRODUCT_LEVEL" id="productLevelEdit-level" v-model="queryParam.level" allowClear placeholder="请选择价格级别"></v-select>
|
|
|
+ <a-form-model-item label="价格级别" prop="priceLevel">
|
|
|
+ <v-select code="PRICE_LEVEL" id="productLevelEdit-priceLevel" v-model="queryParam.priceLevel" allowClear placeholder="请选择价格级别"></v-select>
|
|
|
</a-form-model-item>
|
|
|
</a-col>
|
|
|
<a-col :md="6" :sm="24" style="margin-bottom: 10px;">
|
|
|
- <a-button type="primary" @click="handleSearch" :disabled="disabled" id="permissionSetting-refresh">查询</a-button>
|
|
|
+ <a-button type="primary" @click="$refs.table.refresh()" :disabled="disabled" id="permissionSetting-refresh">查询</a-button>
|
|
|
<a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="permissionSetting-reset">重置</a-button>
|
|
|
</a-col>
|
|
|
</a-row>
|
|
@@ -66,7 +66,9 @@
|
|
|
</a-card>
|
|
|
</a-spin>
|
|
|
<!-- 选择产品分类 -->
|
|
|
- <chooseTypeModal :openModal="openTypeModal" :dataList="detailDataList" @close="openTypeModal=false" @ok="handleTypeOk" />
|
|
|
+ <chooseTypeModal :openModal="openTypeModal" @close="openTypeModal=false" @ok="handleTypeOk" />
|
|
|
+ <!-- 修改价格等级 -->
|
|
|
+ <editPriceLevelModal :priceLevelVal="itemPriceLevel" :openModal="openPriceLevelModal" @close="closePriceLevelModal" @ok="handlePriceLevelOk" />
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -74,36 +76,35 @@
|
|
|
import { commonMixin } from '@/utils/mixin'
|
|
|
import { STable, VSelect } from '@/components'
|
|
|
import ChooseTypeModal from './chooseTypeModal.vue'
|
|
|
+import editPriceLevelModal from './priceLevelModal.vue'
|
|
|
import productTypeAll from '@/views/common/productTypeAll.js'
|
|
|
import ProductBrand from '@/views/common/productBrand.js'
|
|
|
-import { dealerScopeList, dealerScopeSave, dealerScopeDel, dealerScopeQueryList } from '@/api/dealerScope'
|
|
|
+import { dealerScopeList, dealerScopeModifyPriceLevel, dealerScopeDelete } from '@/api/dealerScope'
|
|
|
export default {
|
|
|
name: 'MerchantInfoManagementSet',
|
|
|
mixins: [commonMixin],
|
|
|
- components: { STable, VSelect, ChooseTypeModal, productTypeAll, ProductBrand },
|
|
|
+ components: { STable, VSelect, ChooseTypeModal, productTypeAll, ProductBrand, editPriceLevelModal },
|
|
|
data () {
|
|
|
return {
|
|
|
spinning: false,
|
|
|
tableHeight: 0,
|
|
|
queryParam: { // 查询条件
|
|
|
- goodsType: undefined,
|
|
|
- goodsName: '',
|
|
|
- goodsCode: '',
|
|
|
productBrandSn: undefined, // 产品品牌
|
|
|
- productType: [],
|
|
|
productTypeSn1: '', // 产品一级分类
|
|
|
productTypeSn2: '', // 产品二级分类
|
|
|
- productTypeSn3: '' // 产品三级分类
|
|
|
+ productTypeSn3: '', // 产品三级分类
|
|
|
+ priceLevel: undefined
|
|
|
},
|
|
|
+ productType: [],
|
|
|
disabled: false, // 查询、重置按钮是否可操作
|
|
|
loading: false, // 表格加载中
|
|
|
columns: [
|
|
|
{ title: '序号', dataIndex: 'no', width: '5%', align: 'center' },
|
|
|
- { title: '品牌', dataIndex: 'createDate', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
- { title: '一级分类', dataIndex: 'type', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
- { title: '二级分类', dataIndex: 'goodsName', align: 'left', width: '20%', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
|
- { title: '三级分类', dataIndex: 'product.name', align: 'left', width: '20%', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
|
- { title: '价格级别', dataIndex: 'product.code', width: '15%', align: 'left', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '品牌', dataIndex: 'productBrandName', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '一级分类', dataIndex: 'productTypeName1', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '二级分类', dataIndex: 'productTypeName2', align: 'left', width: '20%', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
|
+ { title: '三级分类', dataIndex: 'productTypeName3', align: 'left', width: '20%', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
|
+ { title: '价格级别', dataIndex: 'priceLevelDictValue', width: '15%', align: 'left', customRender: function (text) { return text || '--' } },
|
|
|
{ title: '操作', scopedSlots: { customRender: 'action' }, width: '15%', align: 'center' }
|
|
|
],
|
|
|
// 加载数据方法 必须为 Promise 对象
|
|
@@ -117,8 +118,6 @@ export default {
|
|
|
const no = (data.pageNo - 1) * data.pageSize
|
|
|
for (var i = 0; i < data.list.length; i++) {
|
|
|
data.list[i].no = no + i + 1
|
|
|
- const goodsType = data.list[i].goodsType
|
|
|
- data.list[i].type = goodsType == 'PRODUCT' ? '产品' : goodsType == 'BRAND' ? '品牌' : goodsType == 'CATEGORY' ? '分类' : '--'
|
|
|
}
|
|
|
this.disabled = false
|
|
|
}
|
|
@@ -126,92 +125,53 @@ export default {
|
|
|
return data
|
|
|
})
|
|
|
},
|
|
|
- openBrandModal: false, // 选择产品品牌
|
|
|
openTypeModal: false, // 选择产品分类
|
|
|
- openProductsModal: false, // 选择产品
|
|
|
- chooseBrand: [], // 所选品牌
|
|
|
- chooseProducts: [], // 所选产品
|
|
|
- chooseType: [] // 所选分类
|
|
|
+ chooseType: [], // 所选分类
|
|
|
+ openPriceLevelModal: false,
|
|
|
+ itemSn: null,
|
|
|
+ itemPriceLevel: ''
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
- // 查询
|
|
|
- handleSearch () {
|
|
|
- const _this = this
|
|
|
- this.$refs.ruleForm.validate(valid => {
|
|
|
- if (valid) {
|
|
|
- _this.$refs.table.refresh(true)
|
|
|
- } else {
|
|
|
- return false
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
// 选择品类
|
|
|
chooseTModal () {
|
|
|
this.openTypeModal = true
|
|
|
},
|
|
|
- handleEdit () {
|
|
|
-
|
|
|
- },
|
|
|
- // 产品分类 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] : ''
|
|
|
- },
|
|
|
- // 分类
|
|
|
- handleTypeOk (obj) {
|
|
|
- this.chooseType = obj
|
|
|
- this.changeData('CATEGORY')
|
|
|
- },
|
|
|
- changeData (type) {
|
|
|
- const _this = this
|
|
|
- if (type == 'PRODUCT') { // 选择产品
|
|
|
- if (_this.chooseProducts.length > 0) {
|
|
|
- const snList = []
|
|
|
- _this.chooseProducts.map(item => {
|
|
|
- const productSn = item.productSn ? item.productSn : item.product.productSn ? item.product.productSn : ''
|
|
|
- snList.push(productSn)
|
|
|
- })
|
|
|
- this.setData(snList, type)
|
|
|
- }
|
|
|
- } else if (type == 'BRAND') { // 选择品牌
|
|
|
- if (_this.chooseBrand.length > 0) {
|
|
|
- const snList = []
|
|
|
- _this.chooseBrand.map(item => {
|
|
|
- snList.push(item.brandSn)
|
|
|
- })
|
|
|
- this.setData(snList, type)
|
|
|
- }
|
|
|
- } else if (type == 'CATEGORY') { // 选择分类
|
|
|
- if (_this.chooseType.length > 0) {
|
|
|
- const snList = []
|
|
|
- _this.chooseType.map(item => {
|
|
|
- snList.push(item.productTypeSn)
|
|
|
- })
|
|
|
- this.setData(snList, type)
|
|
|
- }
|
|
|
- }
|
|
|
+ // 编辑价格等级
|
|
|
+ handleEdit (row) {
|
|
|
+ this.itemSn = row.dealerScopeSn
|
|
|
+ this.itemPriceLevel = row.priceLevel
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.openPriceLevelModal = true
|
|
|
+ })
|
|
|
},
|
|
|
- // 添加经销权
|
|
|
- setData (snList, type) {
|
|
|
+ handlePriceLevelOk (val) {
|
|
|
const _this = this
|
|
|
- const params = {
|
|
|
- dealerSn: _this.$route.params.sn,
|
|
|
- goodsType: type,
|
|
|
- goodsSnList: snList
|
|
|
- }
|
|
|
- _this.spinning = true
|
|
|
- dealerScopeSave(params).then(res => {
|
|
|
+ dealerScopeModifyPriceLevel({ dealerScopeSn: this.itemSn, priceLevel: val }).then(res => {
|
|
|
if (res.status == 200) {
|
|
|
_this.$message.success(res.message)
|
|
|
- _this.$refs.table.refresh(true)
|
|
|
+ _this.$refs.table.refresh()
|
|
|
_this.spinning = false
|
|
|
} else {
|
|
|
_this.spinning = false
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
+ closePriceLevelModal () {
|
|
|
+ this.itemPriceLevel = ''
|
|
|
+ this.itemSn = null
|
|
|
+ this.openPriceLevelModal = false
|
|
|
+ },
|
|
|
+ // 选择分类 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] : ''
|
|
|
+ },
|
|
|
+ // 选择品类完成
|
|
|
+ handleTypeOk (obj) {
|
|
|
+ this.$refs.table.refresh(true)
|
|
|
+ },
|
|
|
// 删除
|
|
|
handleDel (row) {
|
|
|
const _this = this
|
|
@@ -221,7 +181,7 @@ export default {
|
|
|
centered: true,
|
|
|
onOk () {
|
|
|
_this.spinning = true
|
|
|
- dealerScopeDel({ sn: row.dealerScopeSn }).then(res => {
|
|
|
+ dealerScopeDelete({ dealerScopeSn: row.dealerScopeSn }).then(res => {
|
|
|
if (res.status == 200) {
|
|
|
_this.$message.success(res.message)
|
|
|
_this.$refs.table.refresh()
|
|
@@ -235,20 +195,18 @@ export default {
|
|
|
},
|
|
|
// 重置表单
|
|
|
resetSearchForm () {
|
|
|
- this.queryParam.goodsType = undefined
|
|
|
- this.queryParam.goodsName = ''
|
|
|
- this.queryParam.goodsCode = ''
|
|
|
+ this.queryParam.productBrandSn = undefined
|
|
|
+ this.queryParam.productTypeSn1 = ''
|
|
|
+ this.queryParam.productTypeSn2 = ''
|
|
|
+ this.queryParam.productTypeSn3 = ''
|
|
|
+ this.queryParam.priceLevel = undefined
|
|
|
+ this.productType.productType = []
|
|
|
this.$refs.table.refresh(true)
|
|
|
},
|
|
|
// 返回
|
|
|
handleBack () {
|
|
|
this.$router.push({ path: '/dealerManagement/merchantInfoManagement/list', query: { closeLastOldTab: true } })
|
|
|
},
|
|
|
- filterOption (input, option) {
|
|
|
- return (
|
|
|
- option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
|
|
|
- )
|
|
|
- },
|
|
|
pageInit () {
|
|
|
const _this = this
|
|
|
this.$nextTick(() => { // 页面渲染完成后的回调
|