|
@@ -17,7 +17,7 @@
|
|
</a-form>
|
|
</a-form>
|
|
</div>
|
|
</div>
|
|
<!-- 列表 -->
|
|
<!-- 列表 -->
|
|
- <a-tabs type="card" @change="callback">
|
|
|
|
|
|
+ <a-tabs type="card" @change="callback" v-model="tabInd" defaultActiveKey="1">
|
|
<a-tab-pane key="1" tab="省市级关系绑定"></a-tab-pane>
|
|
<a-tab-pane key="1" tab="省市级关系绑定"></a-tab-pane>
|
|
<a-tab-pane key="2" tab="特约店关系绑定"></a-tab-pane>
|
|
<a-tab-pane key="2" tab="特约店关系绑定"></a-tab-pane>
|
|
</a-tabs>
|
|
</a-tabs>
|
|
@@ -28,10 +28,7 @@
|
|
:rowKey="(record) => record.id"
|
|
:rowKey="(record) => record.id"
|
|
:columns="columns"
|
|
:columns="columns"
|
|
:data="loadData"
|
|
:data="loadData"
|
|
- :showPagination="false"
|
|
|
|
- :defaultExpandedRowKeys="defaultExpandedRowKeys"
|
|
|
|
- :scroll="{ y: tableHeight }"
|
|
|
|
- bordered>
|
|
|
|
|
|
+ :scroll="{ y: tableHeight }">
|
|
<!-- 操作 -->
|
|
<!-- 操作 -->
|
|
<template slot="action" slot-scope="text, record">
|
|
<template slot="action" slot-scope="text, record">
|
|
<a-button
|
|
<a-button
|
|
@@ -41,15 +38,26 @@
|
|
icon="plus"
|
|
icon="plus"
|
|
id="relationshipBindingList-addSubItem"
|
|
id="relationshipBindingList-addSubItem"
|
|
@click="handleAssociate(record)">关联下级</a-button>
|
|
@click="handleAssociate(record)">关联下级</a-button>
|
|
- <a-button
|
|
|
|
- type="link"
|
|
|
|
- class="button-error"
|
|
|
|
- size="small"
|
|
|
|
- icon="rollback"
|
|
|
|
- id="relationshipBindingList-edit"
|
|
|
|
- @click="handleDisassociate(record)">取消关联</a-button>
|
|
|
|
- <!-- <span v-if="record.sysFlag != 0">--</span> -->
|
|
|
|
</template>
|
|
</template>
|
|
|
|
+ <a-table
|
|
|
|
+ slot="expandedRowRender"
|
|
|
|
+ slot-scope="text, record, index"
|
|
|
|
+ size="small"
|
|
|
|
+ :columns="innerColumns"
|
|
|
|
+ :data-source="innerData"
|
|
|
|
+ :pagination="false"
|
|
|
|
+ :bordered="false">
|
|
|
|
+ <!-- 操作 -->
|
|
|
|
+ <template slot="action" slot-scope="text, record">
|
|
|
|
+ <a-button
|
|
|
|
+ type="link"
|
|
|
|
+ class="button-error"
|
|
|
|
+ size="small"
|
|
|
|
+ icon="rollback"
|
|
|
|
+ id="relationshipBindingList-edit"
|
|
|
|
+ @click="handleDisassociate(record)">取消关联</a-button>
|
|
|
|
+ </template>
|
|
|
|
+ </a-table>
|
|
</s-table>
|
|
</s-table>
|
|
<!-- 关联下级 -->
|
|
<!-- 关联下级 -->
|
|
<associate-modal :openModal="openModal" :nowData="nowData" :itemId="itemId" @ok="$refs.table.refresh(true)" @close="closeModal" />
|
|
<associate-modal :openModal="openModal" :nowData="nowData" :itemId="itemId" @ok="$refs.table.refresh(true)" @close="closeModal" />
|
|
@@ -59,6 +67,7 @@
|
|
<script>
|
|
<script>
|
|
import { STable, VSelect } from '@/components'
|
|
import { STable, VSelect } from '@/components'
|
|
import associateModal from './associateModal.vue'
|
|
import associateModal from './associateModal.vue'
|
|
|
|
+import { dealerRelationList } from '@/api/dealerRelation'
|
|
export default {
|
|
export default {
|
|
components: { STable, VSelect, associateModal },
|
|
components: { STable, VSelect, associateModal },
|
|
data () {
|
|
data () {
|
|
@@ -71,7 +80,7 @@ export default {
|
|
queryParam: {},
|
|
queryParam: {},
|
|
disabled: false, // 查询、重置按钮是否可操作
|
|
disabled: false, // 查询、重置按钮是否可操作
|
|
columns: [
|
|
columns: [
|
|
- { title: '经销商名称', dataIndex: 'productTypeName', align: 'left' },
|
|
|
|
|
|
+ { title: '经销商名称', dataIndex: 'dealerName', align: 'left' },
|
|
{ title: '操作', scopedSlots: { customRender: 'action' }, align: 'center' }
|
|
{ title: '操作', scopedSlots: { customRender: 'action' }, align: 'center' }
|
|
],
|
|
],
|
|
// 加载数据方法 必须为 Promise 对象
|
|
// 加载数据方法 必须为 Promise 对象
|
|
@@ -80,36 +89,26 @@ export default {
|
|
if (this.tableHeight == 0) {
|
|
if (this.tableHeight == 0) {
|
|
this.tableHeight = window.innerHeight - 380
|
|
this.tableHeight = window.innerHeight - 380
|
|
}
|
|
}
|
|
- // return dealerProductList(Object.assign(parameter, this.queryParam)).then(res => {
|
|
|
|
- // const data = res.data
|
|
|
|
- // const no = (data.pageNo - 1) * data.pageSize
|
|
|
|
- // for (var i = 0; i < data.list.length; i++) {
|
|
|
|
- // data.list[i].no = no + i + 1
|
|
|
|
- // }
|
|
|
|
- // this.disabled = false
|
|
|
|
- // return data
|
|
|
|
- // })
|
|
|
|
- const _this = this
|
|
|
|
- return new Promise(function (resolve, reject) {
|
|
|
|
- const data = {
|
|
|
|
- pageNo: 1,
|
|
|
|
- pageSize: 10,
|
|
|
|
- list: [
|
|
|
|
- { id: '1', productNum: 'jgqp11111111111', productName: '产品1', productPic: ['https://gw.alipayobjects.com/zos/rmsportal/KDpgvguMpGfqaHPjicRK.svg', 'https://qn.antdv.com/vue.png'], productOldNum: 'jgqp111123545', productBrand: '箭冠品牌', productType: '产品分类1', inventoryNum: '5', inventoryMoney: '122' }
|
|
|
|
- ]
|
|
|
|
- }
|
|
|
|
|
|
+ return dealerRelationList(Object.assign(parameter, this.queryParam, { dealerLevelList: this.tabInd == 1 ? ['PROVINCE'] : ['PROVINCE', 'CITY'] })).then(res => {
|
|
|
|
+ const data = res.data
|
|
const no = (data.pageNo - 1) * data.pageSize
|
|
const no = (data.pageNo - 1) * data.pageSize
|
|
for (var i = 0; i < data.list.length; i++) {
|
|
for (var i = 0; i < data.list.length; i++) {
|
|
data.list[i].no = no + i + 1
|
|
data.list[i].no = no + i + 1
|
|
}
|
|
}
|
|
- _this.disabled = false
|
|
|
|
- resolve(data)
|
|
|
|
|
|
+ this.disabled = false
|
|
|
|
+ return data
|
|
})
|
|
})
|
|
},
|
|
},
|
|
defaultExpandedRowKeys: [], // 树形数据默认展开项
|
|
defaultExpandedRowKeys: [], // 树形数据默认展开项
|
|
openModal: false, // 新增编辑 弹框
|
|
openModal: false, // 新增编辑 弹框
|
|
itemId: '', // 当前id
|
|
itemId: '', // 当前id
|
|
- nowData: null // 当前记录数据
|
|
|
|
|
|
+ nowData: null, // 当前记录数据
|
|
|
|
+ tabInd: 1, // tabs选中项
|
|
|
|
+ innerColumns: [
|
|
|
|
+ { title: '经销商名称', dataIndex: 'dealerName', align: 'left' },
|
|
|
|
+ { title: '操作', scopedSlots: { customRender: 'action' }, align: 'center' }
|
|
|
|
+ ],
|
|
|
|
+ innerData: []
|
|
}
|
|
}
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
@@ -121,6 +120,8 @@ export default {
|
|
},
|
|
},
|
|
callback (key) {
|
|
callback (key) {
|
|
console.log(key)
|
|
console.log(key)
|
|
|
|
+ this.tabInd = key
|
|
|
|
+ this.$refs.table.refresh(true)
|
|
},
|
|
},
|
|
// 关联下级
|
|
// 关联下级
|
|
handleAssociate (row) {
|
|
handleAssociate (row) {
|