|
@@ -16,8 +16,7 @@
|
|
ref="ruleForm"
|
|
ref="ruleForm"
|
|
class="form-model-con"
|
|
class="form-model-con"
|
|
layout="inline"
|
|
layout="inline"
|
|
- :model="queryParam"
|
|
|
|
- @keyup.enter.native="$refs.table.refresh()">
|
|
|
|
|
|
+ :model="queryParam">
|
|
<a-row :gutter="15">
|
|
<a-row :gutter="15">
|
|
<a-col :md="6" :sm="24">
|
|
<a-col :md="6" :sm="24">
|
|
<a-form-model-item label="品牌" prop="productBrandSn">
|
|
<a-form-model-item label="品牌" prop="productBrandSn">
|
|
@@ -35,7 +34,7 @@
|
|
</a-form-model-item>
|
|
</a-form-model-item>
|
|
</a-col>
|
|
</a-col>
|
|
<a-col :md="6" :sm="24" style="margin-bottom: 10px;">
|
|
<a-col :md="6" :sm="24" style="margin-bottom: 10px;">
|
|
- <a-button type="primary" @click="$refs.table.refresh()" :disabled="disabled" id="permissionSetting-refresh">查询</a-button>
|
|
|
|
|
|
+ <a-button type="primary" @click="getData" :disabled="disabled" id="permissionSetting-refresh">查询</a-button>
|
|
<a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="permissionSetting-reset">重置</a-button>
|
|
<a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="permissionSetting-reset">重置</a-button>
|
|
</a-col>
|
|
</a-col>
|
|
</a-row>
|
|
</a-row>
|
|
@@ -46,24 +45,23 @@
|
|
<a-button id="permissionSetting-brand" type="primary" class="button-error" @click="chooseTModal">选择品类</a-button>
|
|
<a-button id="permissionSetting-brand" type="primary" class="button-error" @click="chooseTModal">选择品类</a-button>
|
|
</div>
|
|
</div>
|
|
<!-- 列表 -->
|
|
<!-- 列表 -->
|
|
- <s-table
|
|
|
|
- class="sTable fixPagination"
|
|
|
|
- ref="table"
|
|
|
|
- :style="{ height: tableHeight+84.5+'px' }"
|
|
|
|
- size="small"
|
|
|
|
- :rowKey="(record) => record.id"
|
|
|
|
- :columns="columns"
|
|
|
|
- :data="loadData"
|
|
|
|
- :scroll="{ y: tableHeight }"
|
|
|
|
- :defaultLoadData="false"
|
|
|
|
- :showPagination="false"
|
|
|
|
- bordered>
|
|
|
|
- <!-- 操作 -->
|
|
|
|
- <template slot="action" slot-scope="text, record">
|
|
|
|
- <a-button v-if="$route.params.dealerLevel != 'special'" size="small" type="link" class="button-info" @click="handleEdit(record)">编辑</a-button>
|
|
|
|
- <a-button size="small" type="link" class="button-error" @click="handleDel(record)">删除</a-button>
|
|
|
|
- </template>
|
|
|
|
- </s-table>
|
|
|
|
|
|
+ <div :style="{height:tableHeight+'px'}">
|
|
|
|
+ <ve-table
|
|
|
|
+ border-y
|
|
|
|
+ v-show="!showEmpty"
|
|
|
|
+ :scroll-width="0"
|
|
|
|
+ :max-height="(tableHeight)"
|
|
|
|
+ :show-header="showTableHead"
|
|
|
|
+ :row-style-option="{clickHighlight: true}"
|
|
|
|
+ :cellSelectionOption="{enable: false}"
|
|
|
|
+ :virtual-scroll-option="{enable: true}"
|
|
|
|
+ :columns="columns"
|
|
|
|
+ :table-data="dataSource"
|
|
|
|
+ row-key-field-name="no"
|
|
|
|
+ :checkbox-option="checkboxOption"
|
|
|
|
+ />
|
|
|
|
+ <div v-show="showEmpty" class="empty-data"><a-empty description="暂无产品" :image="simpleImage"/></div>
|
|
|
|
+ </div>
|
|
</a-card>
|
|
</a-card>
|
|
</a-spin>
|
|
</a-spin>
|
|
<!-- 选择产品分类 -->
|
|
<!-- 选择产品分类 -->
|
|
@@ -80,6 +78,7 @@ import ChooseTypeModal from './chooseTypeModal.vue'
|
|
import editPriceLevelModal from './priceLevelModal.vue'
|
|
import editPriceLevelModal from './priceLevelModal.vue'
|
|
import productTypeAll from '@/views/common/productTypeAll.js'
|
|
import productTypeAll from '@/views/common/productTypeAll.js'
|
|
import ProductBrand from '@/views/common/productBrand.js'
|
|
import ProductBrand from '@/views/common/productBrand.js'
|
|
|
|
+import { Empty } from 'ant-design-vue'
|
|
import { dealerScopeModifyPriceLevel, dealerScopeDelete, dealerScopeQueryList } from '@/api/dealerScope'
|
|
import { dealerScopeModifyPriceLevel, dealerScopeDelete, dealerScopeQueryList } from '@/api/dealerScope'
|
|
export default {
|
|
export default {
|
|
name: 'MerchantInfoManagementSet',
|
|
name: 'MerchantInfoManagementSet',
|
|
@@ -94,51 +93,88 @@ export default {
|
|
productTypeSn1: '', // 产品一级分类
|
|
productTypeSn1: '', // 产品一级分类
|
|
productTypeSn2: '', // 产品二级分类
|
|
productTypeSn2: '', // 产品二级分类
|
|
productTypeSn3: '', // 产品三级分类
|
|
productTypeSn3: '', // 产品三级分类
|
|
- priceLevel: undefined,
|
|
|
|
- goodsType: 'CATEGORY'
|
|
|
|
|
|
+ priceLevel: undefined
|
|
},
|
|
},
|
|
productType: [],
|
|
productType: [],
|
|
disabled: false, // 查询、重置按钮是否可操作
|
|
disabled: false, // 查询、重置按钮是否可操作
|
|
loading: false, // 表格加载中
|
|
loading: false, // 表格加载中
|
|
- columns: [
|
|
|
|
- { title: '序号', dataIndex: 'no', width: '5%', align: 'center' },
|
|
|
|
- { 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: 'center', width: '20%', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
|
|
- { title: '三级分类', dataIndex: 'productTypeName3', align: 'center', width: '20%', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
|
|
- { title: '价格级别', dataIndex: 'priceLevelDictValue', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
|
- { title: '操作', scopedSlots: { customRender: 'action' }, width: '15%', align: 'center' }
|
|
|
|
- ],
|
|
|
|
- // 加载数据方法 必须为 Promise 对象
|
|
|
|
- loadData: parameter => {
|
|
|
|
- this.disabled = true
|
|
|
|
- this.spinning = true
|
|
|
|
- return dealerScopeQueryList(Object.assign(parameter, this.queryParam, { dealerSn: this.$route.params.sn })).then(res => {
|
|
|
|
- let data
|
|
|
|
- if (res.status == 200) {
|
|
|
|
- data = res.data
|
|
|
|
- for (var i = 0; i < data.length; i++) {
|
|
|
|
- data[i].no = i + 1
|
|
|
|
- }
|
|
|
|
- this.disabled = false
|
|
|
|
- }
|
|
|
|
- this.spinning = false
|
|
|
|
- return data
|
|
|
|
- })
|
|
|
|
- },
|
|
|
|
openTypeModal: false, // 选择产品分类
|
|
openTypeModal: false, // 选择产品分类
|
|
chooseType: [], // 所选分类
|
|
chooseType: [], // 所选分类
|
|
openPriceLevelModal: false,
|
|
openPriceLevelModal: false,
|
|
itemSn: null,
|
|
itemSn: null,
|
|
- itemPriceLevel: ''
|
|
|
|
|
|
+ itemPriceLevel: '',
|
|
|
|
+ simpleImage: Empty.PRESENTED_IMAGE_SIMPLE,
|
|
|
|
+ dataSource: [],
|
|
|
|
+ showEmpty: false,
|
|
|
|
+ showTableHead: true, // 显示表头
|
|
|
|
+ checkboxOption: {
|
|
|
|
+ // 行选择改变事件
|
|
|
|
+ selectedRowChange: ({ row, isSelected, selectedRowKeys }) => {
|
|
|
|
+ console.log(row, isSelected, selectedRowKeys)
|
|
|
|
+ },
|
|
|
|
+ // 全选改变事件
|
|
|
|
+ selectedAllChange: ({ isSelected, selectedRowKeys }) => {
|
|
|
|
+ console.log(isSelected, selectedRowKeys)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ computed: {
|
|
|
|
+ columns () {
|
|
|
|
+ const _this = this
|
|
|
|
+ // 操作按钮
|
|
|
|
+ const actionFormat = function (record, data, h) {
|
|
|
|
+ if (_this.$route.params.dealerLevel != 'special') {
|
|
|
|
+ return (
|
|
|
|
+ <div>
|
|
|
|
+ <a-button size="small" type="link" class="button-info" onClick={() => _this.handleEdit(record)}>编辑</a-button>
|
|
|
|
+ <a-button size="small" type="link" class="button-info" onClick={() => _this.handleDel(record)}>删除</a-button>
|
|
|
|
+ </div>
|
|
|
|
+ )
|
|
|
|
+ } else {
|
|
|
|
+ return (
|
|
|
|
+ <div>
|
|
|
|
+ <a-button
|
|
|
|
+ size="small"
|
|
|
|
+ type="link"
|
|
|
|
+ class="button-info"
|
|
|
|
+ onClick={() => _this.handleDel(record)}
|
|
|
|
+ >删除</a-button>
|
|
|
|
+ </div>
|
|
|
|
+ )
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ const arr = [
|
|
|
|
+ { title: '', field: '', key: 'acheck', width: 60, type: 'checkbox', align: 'center' },
|
|
|
|
+ { title: '品牌', field: 'productBrandName', key: 'a', align: 'center', width: 160, operationColumn: false, renderBodyCell: ({ row, column }) => { return row[column.field] || '--' } },
|
|
|
|
+ { title: '一级分类', field: 'productTypeName1', key: 'b', width: 160, align: 'center', operationColumn: false, renderBodyCell: ({ row, column }) => { return row[column.field] || '--' } },
|
|
|
|
+ { title: '二级分类', field: 'productTypeName2', key: 'c', width: 160, align: 'center', operationColumn: false, renderBodyCell: ({ row, column }) => { return row[column.field] || '--' } },
|
|
|
|
+ { title: '三级分类', field: 'productTypeName3', key: 'd', width: 160, align: 'center', operationColumn: false, renderBodyCell: ({ row, column }) => { return row[column.field] || '--' } },
|
|
|
|
+ { title: '操作', field: 'action', width: 100, key: 'e', align: 'center', fixed: 'right', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return actionFormat(row, row[column.field], h) } }
|
|
|
|
+ ]
|
|
|
|
+ return arr
|
|
}
|
|
}
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
|
|
+ getData () {
|
|
|
|
+ const _this = this
|
|
|
|
+ _this.disabled = true
|
|
|
|
+ _this.spinning = true
|
|
|
|
+ _this.queryParam.dealerSn = _this.$route.params.sn
|
|
|
|
+ dealerScopeQueryList(_this.queryParam).then(res => {
|
|
|
|
+ if (res.status == 200) {
|
|
|
|
+ _this.dataSource = res.data
|
|
|
|
+ }
|
|
|
|
+ _this.showEmpty = _this.dataSource.length <= 0
|
|
|
|
+ _this.disabled = false
|
|
|
|
+ _this.spinning = false
|
|
|
|
+ })
|
|
|
|
+ },
|
|
// 选择品类
|
|
// 选择品类
|
|
chooseTModal () {
|
|
chooseTModal () {
|
|
this.openTypeModal = true
|
|
this.openTypeModal = true
|
|
},
|
|
},
|
|
- // 编辑价格等级
|
|
|
|
|
|
+ // 打开编辑弹窗
|
|
handleEdit (row) {
|
|
handleEdit (row) {
|
|
this.itemSn = row.dealerScopeSn
|
|
this.itemSn = row.dealerScopeSn
|
|
this.itemPriceLevel = row.priceLevel
|
|
this.itemPriceLevel = row.priceLevel
|
|
@@ -146,12 +182,12 @@ export default {
|
|
this.openPriceLevelModal = true
|
|
this.openPriceLevelModal = true
|
|
})
|
|
})
|
|
},
|
|
},
|
|
|
|
+ // 编辑价格等级
|
|
handlePriceLevelOk (val) {
|
|
handlePriceLevelOk (val) {
|
|
const _this = this
|
|
const _this = this
|
|
dealerScopeModifyPriceLevel({ dealerScopeSn: this.itemSn, priceLevel: val }).then(res => {
|
|
dealerScopeModifyPriceLevel({ dealerScopeSn: this.itemSn, priceLevel: val }).then(res => {
|
|
if (res.status == 200) {
|
|
if (res.status == 200) {
|
|
_this.$message.success(res.message)
|
|
_this.$message.success(res.message)
|
|
- _this.$refs.table.refresh()
|
|
|
|
_this.spinning = false
|
|
_this.spinning = false
|
|
} else {
|
|
} else {
|
|
_this.spinning = false
|
|
_this.spinning = false
|
|
@@ -171,7 +207,7 @@ export default {
|
|
},
|
|
},
|
|
// 选择品类完成
|
|
// 选择品类完成
|
|
handleTypeOk (obj) {
|
|
handleTypeOk (obj) {
|
|
- this.$refs.table.refresh(true)
|
|
|
|
|
|
+ // this.$refs.table.refresh(true)
|
|
},
|
|
},
|
|
// 删除
|
|
// 删除
|
|
handleDel (row) {
|
|
handleDel (row) {
|
|
@@ -185,7 +221,7 @@ export default {
|
|
dealerScopeDelete({ dealerScopeSn: row.dealerScopeSn }).then(res => {
|
|
dealerScopeDelete({ dealerScopeSn: row.dealerScopeSn }).then(res => {
|
|
if (res.status == 200) {
|
|
if (res.status == 200) {
|
|
_this.$message.success(res.message)
|
|
_this.$message.success(res.message)
|
|
- _this.$refs.table.refresh()
|
|
|
|
|
|
+ // _this.$refs.table.refresh()
|
|
_this.spinning = false
|
|
_this.spinning = false
|
|
} else {
|
|
} else {
|
|
_this.spinning = false
|
|
_this.spinning = false
|
|
@@ -202,7 +238,7 @@ export default {
|
|
this.queryParam.productTypeSn3 = ''
|
|
this.queryParam.productTypeSn3 = ''
|
|
this.queryParam.priceLevel = undefined
|
|
this.queryParam.priceLevel = undefined
|
|
this.productType = []
|
|
this.productType = []
|
|
- this.$refs.table.refresh(true)
|
|
|
|
|
|
+ this.getData()
|
|
},
|
|
},
|
|
// 返回
|
|
// 返回
|
|
handleBack () {
|
|
handleBack () {
|
|
@@ -216,7 +252,7 @@ export default {
|
|
},
|
|
},
|
|
setTableH () {
|
|
setTableH () {
|
|
const tableSearchH = this.$refs.tableSearch.offsetHeight
|
|
const tableSearchH = this.$refs.tableSearch.offsetHeight
|
|
- this.tableHeight = window.innerHeight - tableSearchH - 292
|
|
|
|
|
|
+ this.tableHeight = window.innerHeight - tableSearchH - 205
|
|
}
|
|
}
|
|
},
|
|
},
|
|
watch: {
|
|
watch: {
|
|
@@ -226,15 +262,15 @@ export default {
|
|
},
|
|
},
|
|
mounted () {
|
|
mounted () {
|
|
if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
|
|
if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
|
|
- this.$refs.table.refresh(true)
|
|
|
|
this.pageInit()
|
|
this.pageInit()
|
|
|
|
+ this.resetSearchForm()
|
|
}
|
|
}
|
|
},
|
|
},
|
|
activated () {
|
|
activated () {
|
|
// 如果是新页签打开或者进入新的子页(例:存在列表第2条数据编辑页页签时再打开第4条数据的编辑页),则重置当前页面
|
|
// 如果是新页签打开或者进入新的子页(例:存在列表第2条数据编辑页页签时再打开第4条数据的编辑页),则重置当前页面
|
|
if (this.$store.state.app.isNewTab || !this.$store.state.app.isNewSubTab) {
|
|
if (this.$store.state.app.isNewTab || !this.$store.state.app.isNewSubTab) {
|
|
- this.$refs.table.refresh(true)
|
|
|
|
this.pageInit()
|
|
this.pageInit()
|
|
|
|
+ this.resetSearchForm()
|
|
}
|
|
}
|
|
},
|
|
},
|
|
beforeRouteEnter (to, from, next) {
|
|
beforeRouteEnter (to, from, next) {
|
|
@@ -248,5 +284,15 @@ export default {
|
|
.permissionSetting-cont{
|
|
.permissionSetting-cont{
|
|
margin-bottom: 6px;
|
|
margin-bottom: 6px;
|
|
}
|
|
}
|
|
|
|
+ .empty-data{
|
|
|
|
+ padding-top:100px;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ /deep/.ve-checkbox .ve-checkbox-checked .ve-checkbox-inner {
|
|
|
|
+ background-color: #ed1c24 !important;
|
|
|
|
+ border-color: #ed1c24 !important;
|
|
|
|
+ }
|
|
|
|
+ /deep/.ve-checkbox .ve-checkbox-indeterminate .ve-checkbox-inner::after{
|
|
|
|
+ background-color: #ed1c24 !important;
|
|
}
|
|
}
|
|
</style>
|
|
</style>
|