chenrui 4 年之前
父節點
當前提交
235c198c01

+ 21 - 0
src/api/dealerRelation.js

@@ -0,0 +1,21 @@
+import { axios } from '@/utils/request'
+
+//  经销商关系绑定 列表  有分页
+export const dealerRelationList = (params) => {
+  const url = `/dealerRelation/queryPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+// //  经销商关系绑定 保存
+// export const dealerRelationSave = (params) => {
+//   return axios({
+//     url: '/dealerRelation/save',
+//     data: params,
+//     method: 'post'
+//   })
+// }

+ 26 - 26
src/config/router.config.js

@@ -441,33 +441,33 @@ export const asyncRouterMap = [
                 }
               }
             ]
+          },
+          {
+            path: '/dealerManagement/dealerRelationshipBinding',
+            redirect: '/dealerManagement/dealerRelationshipBinding/list',
+            name: 'dealerRelationshipBinding',
+            component: RouteView,
+            meta: {
+              title: '经销商关系绑定',
+              icon: 'sketch'
+              // permission: 'M_goodsManage_list'
+            },
+            hideChildrenInMenu: true,
+            children: [
+              {
+                path: 'list',
+                name: 'dealerRelationshipBindingList',
+                component: () => import(/* webpackChunkName: "shop" */ '@/views/dealerManagement/dealerRelationshipBinding/list.vue'),
+                meta: {
+                  title: '经销商关系绑定列表',
+                  icon: 'sketch',
+                  hidden: true
+                  // permission: 'M_goodsManage_list'
+                }
+              }
+            ]
           }
           // {
-          //   path: '/dealerManagement/dealerRelationshipBinding',
-          //   redirect: '/dealerManagement/dealerRelationshipBinding/list',
-          //   name: 'dealerRelationshipBinding',
-          //   component: RouteView,
-          //   meta: {
-          //     title: '经销商关系绑定',
-          //     icon: 'sketch'
-          //     // permission: 'M_goodsManage_list'
-          //   },
-          //   hideChildrenInMenu: true,
-          //   children: [
-          //     {
-          //       path: 'list',
-          //       name: 'dealerRelationshipBindingList',
-          //       component: () => import(/* webpackChunkName: "shop" */ '@/views/dealerManagement/dealerRelationshipBinding/list.vue'),
-          //       meta: {
-          //         title: '经销商关系绑定列表',
-          //         icon: 'sketch',
-          //         hidden: true
-          //         // permission: 'M_goodsManage_list'
-          //       }
-          //     }
-          //   ]
-          // },
-          // {
           //   path: '/dealerManagement/rebateSettings',
           //   redirect: '/dealerManagement/rebateSettings/list',
           //   name: 'rebateSettings',
@@ -891,7 +891,7 @@ export const asyncRouterMap = [
                 }
               }
             ]
-          },
+          }
           // {
           //   path: '/salesManagement/backorder',
           //   redirect: '/salesManagement/backorder/list',

+ 36 - 35
src/views/dealerManagement/dealerRelationshipBinding/list.vue

@@ -17,7 +17,7 @@
       </a-form>
     </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="2" tab="特约店关系绑定"></a-tab-pane>
     </a-tabs>
@@ -28,10 +28,7 @@
       :rowKey="(record) => record.id"
       :columns="columns"
       :data="loadData"
-      :showPagination="false"
-      :defaultExpandedRowKeys="defaultExpandedRowKeys"
-      :scroll="{ y: tableHeight }"
-      bordered>
+      :scroll="{ y: tableHeight }">
       <!-- 操作 -->
       <template slot="action" slot-scope="text, record">
         <a-button
@@ -41,15 +38,26 @@
           icon="plus"
           id="relationshipBindingList-addSubItem"
           @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>
+      <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>
     <!-- 关联下级 -->
     <associate-modal :openModal="openModal" :nowData="nowData" :itemId="itemId" @ok="$refs.table.refresh(true)" @close="closeModal" />
@@ -59,6 +67,7 @@
 <script>
 import { STable, VSelect } from '@/components'
 import associateModal from './associateModal.vue'
+import { dealerRelationList } from '@/api/dealerRelation'
 export default {
   components: { STable, VSelect, associateModal },
   data () {
@@ -71,7 +80,7 @@ export default {
       queryParam: {},
       disabled: false, //  查询、重置按钮是否可操作
       columns: [
-        { title: '经销商名称', dataIndex: 'productTypeName', align: 'left' },
+        { title: '经销商名称', dataIndex: 'dealerName', align: 'left' },
         { title: '操作', scopedSlots: { customRender: 'action' }, align: 'center' }
       ],
       // 加载数据方法 必须为 Promise 对象
@@ -80,36 +89,26 @@ export default {
         if (this.tableHeight == 0) {
           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
           for (var i = 0; i < data.list.length; i++) {
             data.list[i].no = no + i + 1
           }
-          _this.disabled = false
-          resolve(data)
+          this.disabled = false
+          return data
         })
       },
       defaultExpandedRowKeys: [], //  树形数据默认展开项
       openModal: false, //  新增编辑  弹框
       itemId: '', //  当前id
-      nowData: null //  当前记录数据
+      nowData: null, //  当前记录数据
+      tabInd: 1, //  tabs选中项
+      innerColumns: [
+        { title: '经销商名称', dataIndex: 'dealerName', align: 'left' },
+        { title: '操作', scopedSlots: { customRender: 'action' }, align: 'center' }
+      ],
+      innerData: []
     }
   },
   methods: {
@@ -121,6 +120,8 @@ export default {
     },
     callback (key) {
       console.log(key)
+      this.tabInd = key
+      this.$refs.table.refresh(true)
     },
     // 关联下级
     handleAssociate (row) {

+ 1 - 1
src/views/promotionRulesManagement/promotionRules/choosePriceProductsModal.vue

@@ -352,7 +352,7 @@ export default {
         return
       }
       if (this.loadData.length == 0) {
-        this.$message.warning('请选择需要批量复制的产品后再操作!')
+        this.$message.warning('请先添加产品后再批量复制起订限制规则!')
         return
       }
       this.$confirm({