Bläddra i källkod

Merge branch 'develop_yh39' of http://git.chelingzhu.com/jianguan-web/jg-ocs-html into develop_yh39

chenrui 1 år sedan
förälder
incheckning
643bd5df20

+ 12 - 4
src/config/router.config.js

@@ -3014,7 +3014,6 @@ export const asyncRouterMap = [
                   title: '新增经销商',
                   icon: 'file-text',
                   hidden: true
-                  // permission: 'B_goodsManage_edit'
                 }
               },
               {
@@ -3025,11 +3024,10 @@ export const asyncRouterMap = [
                   title: '编辑经销商',
                   icon: 'file-text',
                   hidden: true
-                  // permission: 'B_goodsManage_edit'
                 }
               },
               {
-                path: 'permissionSetting/:sn',
+                path: 'permissionSetting/:sn/:name',
                 name: 'merchantInfoManagementSet',
                 component: () => import(/* webpackChunkName: "dealerManagement" */ '@/views/dealerManagement/merchantInfoManagement/permissionSettingNew.vue'),
                 meta: {
@@ -3037,7 +3035,17 @@ export const asyncRouterMap = [
                   icon: 'file-text',
                   replaceTab: true,
                   hidden: true
-                  // permission: 'B_goodsManage_edit'
+                }
+              },
+              {
+                path: 'rebateBinding/:sn',
+                name: 'rebateBinding',
+                component: () => import(/* webpackChunkName: "dealerManagement" */ '@/views/dealerManagement/rebateBinding/list.vue'),
+                meta: {
+                  title: '差价设置',
+                  icon: 'file-text',
+                  replaceTab: true,
+                  hidden: true
                 }
               }
             ]

+ 10 - 4
src/views/dealerManagement/merchantInfoManagement/list.vue

@@ -86,8 +86,10 @@
             <a-button size="small" type="link" class="button-warning" v-if="record.auditState == 'WAIT' && $hasPermissions('B_merchantInfo_audit')" @click="handleAudit(record)" >审核</a-button>
             <a-button size="small" type="link" class="button-info" v-if="$hasPermissions('B_merchantInfo_cooperation')" @click="handleCooperation(record)" >合作设置</a-button>
             <a-button size="small" type="link" class="button-primary" v-if="$hasPermissions('B_merchantInfo_level')" @click="handleLevel(record)">级别设置</a-button>
-            <a-button size="small" type="link" class="button-error" v-if="record.auditState != 'WAIT' && $hasPermissions('B_merchantInfo_distribution')" @click="handleDistribution(record)">经销权</a-button>
+            <br>
             <a-button size="small" type="link" class="button-info" v-if="$hasPermissions('B_merchantInfo_edit')" @click="handleEdit(record)">编辑</a-button>
+            <a-button size="small" type="link" class="button-error" v-if="record.auditState != 'WAIT'" @click="handlePriceSpread(record)">差价</a-button>
+            <a-button size="small" type="link" class="button-error" v-if="record.auditState != 'WAIT' && $hasPermissions('B_merchantInfo_distribution')" @click="handleDistribution(record)">经销权</a-button>
             <span v-if="!(record.auditState == 'WAIT' && $hasPermissions('B_merchantInfo_audit')) && !$hasPermissions('B_merchantInfo_cooperation') && !(record.auditState != 'WAIT' && $hasPermissions('B_merchantInfo_distribution')) && !$hasPermissions('B_merchantInfo_level') && !$hasPermissions('B_merchantInfo_edit')">--</span>
           </template>
         </s-table>
@@ -146,8 +148,8 @@ export default {
         { title: '创建时间', dataIndex: 'createDate', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '区域', dataIndex: 'subareaArea.subareaName', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '分区', dataIndex: 'subareaArea.subareaAreaName', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '商户名称', scopedSlots: { customRender: 'dealerName' }, width: '10%', align: 'left', ellipsis: true },
-        { title: '商户别名', dataIndex: 'dealerAlias', width: '10%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '商户名称', scopedSlots: { customRender: 'dealerName' }, width: '12%', align: 'left', ellipsis: true },
+        { title: '商户别名', dataIndex: 'dealerAlias', width: '12%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '商户类型', dataIndex: 'dealerTypeDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '商户级别', dataIndex: 'dealerLevelDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '联系人', dataIndex: 'contact', width: '6%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
@@ -156,7 +158,7 @@ export default {
         { title: '审核状态', dataIndex: 'auditStateDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '合作状态', dataIndex: 'cooperateFlagDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '生效时间', dataIndex: 'cooperateEffectiveTime', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '操作', scopedSlots: { customRender: 'action' }, width: '16%', align: 'center' }
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: '12%', align: 'center' }
       ],
       loading: false,
       // 加载数据方法 必须为 Promise 对象
@@ -236,6 +238,10 @@ export default {
     handleDistribution (row) {
       this.$router.push({ name: `merchantInfoManagementSet`, params: { sn: row.dealerSn, name: row.dealerName } })
     },
+    // 差价
+    handlePriceSpread (row) {
+      this.$router.push({ name: `rebateBinding`, params: { sn: row.dealerSn, name: row.dealerName } })
+    },
     // 审核
     handleAudit (row) {
       this.itemId = row.dealerSn

+ 232 - 0
src/views/dealerManagement/rebateBinding/categoryList.vue

@@ -0,0 +1,232 @@
+<template>
+  <div class="categoryList-wrap">
+    <div ref="tableSearch" v-if="!showEmpty" class="table-page-search-wrapper">
+      <a-form-model
+        ref="ruleForm"
+        class="form-model-con"
+        layout="inline"
+        :model="queryParam"
+        @keyup.enter.native="handleSearch">
+        <a-row :gutter="15">
+          <a-col :md="8" :sm="24">
+            <a-form-model-item label="品牌">
+              <ProductBrand v-model="queryParam.productBrandSn"></ProductBrand>
+            </a-form-model-item>
+          </a-col>
+          <a-col :md="8" :sm="24">
+            <a-form-model-item label="产品分类">
+              <ProductType placeholder="请选择产品分类" @change="changeProductType" v-model="productType"></ProductType>
+            </a-form-model-item>
+          </a-col>
+          <a-col :md="8" :sm="24" style="margin-bottom: 10px;">
+            <a-button type="primary" @click="handleSearch">查询</a-button>
+            <a-button style="margin-left: 5px" @click="resetSearchForm">重置</a-button>
+          </a-col>
+        </a-row>
+      </a-form-model>
+    </div>
+
+    <a-spin :spinning="spinning" tip="Loading...">
+      <ve-table
+        border-y
+        v-show="!showEmpty"
+        :scroll-width="0"
+        :max-height="tableHeight"
+        :row-style-option="{clickHighlight: true}"
+        :cellSelectionOption="{enable: false}"
+        :virtual-scroll-option="{enable: true}"
+        :columns="columns"
+        :table-data="dataSource"
+        row-key-field-name="id"
+        :cell-style-option="cellStyleOption"
+        :checkbox-option="checkboxOption"
+      />
+      <div v-show="showEmpty" class="empty-data"><a-empty description="暂无品类" :image="simpleImage"/></div>
+    </a-spin>
+
+  </div>
+</template>
+
+<script>
+import { commonMixin } from '@/utils/mixin'
+import { waitDispatchDetailAllList } from '@/api/waitDispatchDetail'
+import { Empty } from 'ant-design-vue'
+import ProductBrand from '@/views/common/productBrand.js'
+import ProductType from '@/views/common/productType.js'
+export default {
+  name: 'DetailProductList',
+  mixins: [commonMixin],
+  components: { ProductType, ProductBrand },
+  props: {
+    newLoading: {
+      type: Boolean,
+      default: false
+    },
+    maxHeight: {
+      type: [String, Number],
+      default: '300'
+    },
+    showHeader: {
+      type: Boolean,
+      default: true
+    }
+  },
+  data () {
+    return {
+      disabled: false, //  查询、重置按钮是否可操作
+      spinning: false,
+      simpleImage: Empty.PRESENTED_IMAGE_SIMPLE,
+      dataSource: [],
+      tableHeight: this.maxHeight,
+      cellStyleOption: {
+        bodyCellClass: ({ row, column, rowIndex }) => {
+          if (row.id.indexOf('promo-') >= 0 && column.field === 'no') {
+            return 'table-body-cell-no'
+          }
+        }
+      },
+      columnWidthResizeOption: {
+        // default false
+        enable: true,
+        // column resize min width
+        minWidth: 50
+      },
+      showEmpty: true,
+      disableSelectedRowKeys: [],
+      selectedRowKeys: [],
+      productType: [],
+      queryParam: { //  查询条件
+        productBrandSn: undefined,
+        productTypeSn1: undefined,
+        productTypeSn2: undefined,
+        productTypeSn3: undefined
+      }
+    }
+  },
+  computed: {
+    checkboxOption () {
+      return {
+        disableSelectedRowKeys: this.disableSelectedRowKeys,
+        selectedRowKeys: this.selectedRowKeys,
+        // 行选择改变事件
+        selectedRowChange: ({ row, isSelected, selectedRowKeys }) => {
+          this.selectedRowChange({ row, isSelected, selectedRowKeys })
+        },
+        // 全选改变事件
+        selectedAllChange: ({ isSelected, selectedRowKeys }) => {
+          this.selectedAllChange({ isSelected, selectedRowKeys })
+        }
+      }
+    },
+    columns () {
+      const arr = [
+        { title: '', field: '', key: 'acheck', width: 60, type: 'checkbox', align: 'center' },
+        // { title: '序号', field: 'no', key: 'a', width: 60, align: 'center', operationColumn: false },
+        { title: '品牌', field: 'productCode', key: 'b', width: 150, align: 'center', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return row[column.field] || '--' } },
+        { title: '一级分类', field: 'warehouseName', key: 'e', width: 150, align: 'center', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return row[column.field] || '--' } },
+        { title: '二级分类', field: 'productOrigUnit', width: 150, key: 'i', align: 'center', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return row[column.field] || '--' } },
+        { title: '三级分类', field: 'productName', width: 150, key: 'm', align: 'center', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return row[column.field] || '--' } }
+      ]
+      return arr
+    }
+  },
+  methods: {
+    // 查询品类列表
+    handleSearch () {
+
+    },
+    //  产品分类  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] : ''
+    },
+    // 重置查询筛选表单
+    resetSearchForm () {
+      this.queryParam.productBrandSn = undefined
+      this.queryParam.productTypeSn1 = undefined
+      this.queryParam.productTypeSn2 = undefined
+      this.queryParam.productTypeSn3 = undefined
+      this.productType = []
+      this.dataSource = []
+      this.clearSelectTable()
+      this.searchTable()
+    },
+    // 清空选项
+    clearSelectTable () {
+      this.selectedRowKeys = []
+    },
+    // 选择单元格
+    selectedRowChange ({ row, isSelected, selectedRowKeys }) {
+      // console.log(row, isSelected, selectedRowKeys);
+      this.selectedRowKeys = selectedRowKeys
+    },
+    // 全选行
+    selectedAllChange ({ isSelected, selectedRowKeys }) {
+      // console.log(isSelected, selectedRowKeys);
+      this.selectedRowKeys = selectedRowKeys
+    },
+    async searchTable () {
+      this.selectedRowKeys = []
+      this.disableSelectedRowKeys = []
+      this.dataSource = []
+      this.disabled = true
+      this.spinning = true
+      const params = this.queryParam
+
+      // 带下推产品
+      const listData = await waitDispatchDetailAllList(params).then(res => res.data)
+      this.dataSource = listData
+      // 格式化数据
+      let f = 0
+      this.dataSource.map((item, i) => {
+        if (item.id.indexOf('promo-') >= 0) { f = f - 1 }
+        item.no = i + 1 + f
+        const productCode = (item.productEntity && item.productEntity.code) || (item.dealerProductEntity && item.dealerProductEntity.code)
+        const productName = (item.productEntity && item.productEntity.name) || (item.dealerProductEntity && item.dealerProductEntity.name)
+        const productOrigCode = (item.productEntity && item.productEntity.origCode) || (item.dealerProductEntity && item.dealerProductEntity.origCode)
+        const productOrigUnit = (item.productEntity && item.productEntity.unit) || (item.dealerProductEntity && item.dealerProductEntity.unit)
+        const warehouseName = item.dispatchBill && item.dispatchBill.warehouseName || ''
+        item.productCode = productCode || '--'
+        item.productName = productName || '--'
+        item.productOrigCode = productOrigCode == ' ' ? '--' : productOrigCode
+        item.productOrigUnit = productOrigUnit || '--'
+        item.warehouseName = warehouseName || '--'
+      })
+      this.showEmpty = this.dataSource.length <= 0
+      this.tableHeight = (this.showEmpty ? 300 : this.maxHeight) + 'px'
+      this.spinning = false
+      this.disabled = false
+    },
+    pageInit (productForm, detailData) {
+      this.productForm = Object.assign(this.productForm, productForm)
+      this.detailData = detailData
+      // 获取列表
+      this.resetSearchForm()
+    }
+  }
+}
+</script>
+  <style lang="less">
+  .empty-data{
+        color: #999;
+        text-align: center;
+        padding: 20px;
+    }
+    .ve-table-body-td{
+      .active-title{
+        display: flex;
+        align-items: center;
+        justify-content: space-between;
+        padding: 10px;
+        background: #f3f8fa;
+      }
+    }
+    .ve-table .ve-table-container .ve-table-content-wrapper table.ve-table-content tbody.ve-table-body tr.ve-table-body-tr td.table-body-cell-no,
+    .ve-table .ve-table-container .ve-table-content-wrapper table.ve-table-content tbody.ve-table-body tr.ve-table-expand-tr td.table-body-cell-no{
+      padding: 0;
+    }
+    .ve-table .ve-table-container .ve-table-content-wrapper{
+      border-bottom: 1px solid #ddd;
+    }
+  </style>

+ 231 - 0
src/views/dealerManagement/rebateBinding/list.vue

@@ -0,0 +1,231 @@
+<template>
+  <div class="rebateBinding-wrap">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <a-page-header :ghost="false" :backIcon="false" @back="handleBack" class="rebateBinding-cont">
+        <!-- 自定义的二级文字标题 -->
+        <template slot="subTitle">
+          <a id="rebateBinding-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
+          <span style="margin-left: 20px;color: #666;" v-if="detail">经销商:{{ detail.dealerName }}</span>
+        </template>
+      </a-page-header>
+      <a-card size="small" :bordered="false" class="rebateBinding-main">
+        <!-- 搜索条件 -->
+        <div ref="tableSearch" class="table-page-search-wrapper">
+          <a-form-model
+            id="rebateBinding-form"
+            ref="ruleForm"
+            class="form-model-con"
+            layout="inline"
+            :model="queryParam"
+            @keyup.enter.native="handleSearch">
+            <a-row :gutter="15">
+              <a-col :md="6" :sm="24">
+                <a-form-model-item label="品牌">
+                  <ProductBrand v-model="queryParam.productBrandSn"></ProductBrand>
+                </a-form-model-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-model-item label="产品分类">
+                  <ProductType placeholder="请选择产品分类" @change="changeProductType" v-model="productType"></ProductType>
+                </a-form-model-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-model-item label="价格级别">
+                  <v-select code="DEALER_GOODS_TYPE" v-model="queryParam.goodsType" allowClear placeholder="请选择类型"></v-select>
+                </a-form-model-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-model-item label="经销商">
+                  <a-input v-model.trim="queryParam.dealerName" allowClear placeholder="请输入经销商名称"/>
+                </a-form-model-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-model-item label="差价归属方">
+                  <v-select code="DEALER_GOODS_TYPE" v-model="queryParam.goodsType" 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="rebateBinding-refresh">查询</a-button>
+                <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="rebateBinding-reset">重置</a-button>
+              </a-col>
+            </a-row>
+          </a-form-model>
+        </div>
+        <!-- 操作按钮 -->
+        <div class="table-operator">
+          <a-button id="rebateBinding-brand" type="primary" class="button-error" @click="openGlModal">差价设置</a-button>
+        </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"
+          bordered>
+          <!-- 操作 -->
+          <template slot="action" slot-scope="text, record">
+            <a-button size="small" type="link" class="button-error" @click="handleEdit(record)">编辑</a-button>
+          </template>
+        </s-table>
+      </a-card>
+    </a-spin>
+
+    <!-- 差价设置 -->
+    <priceDiffModal :openModal="openModal" @close="openModal=false"></pricediffmodal>
+  </div>
+</template>
+
+<script>
+import { commonMixin } from '@/utils/mixin'
+import { STable, VSelect } from '@/components'
+import { dealerScopeList } from '@/api/dealerScope'
+import { dealerDetailBySn } from '@/api/dealer'
+import ProductType from '@/views/common/productType.js'
+import ProductBrand from '@/views/common/productBrand.js'
+import priceDiffModal from './priceDiffModal.vue'
+export default {
+  name: 'RebateBinding',
+  mixins: [commonMixin],
+  components: { STable, VSelect, ProductType, ProductBrand, priceDiffModal },
+  data () {
+    return {
+      spinning: false,
+      tableHeight: 0,
+      disabled: false, //  查询、重置按钮是否可操作
+      loading: false, //  表格加载中
+      columns: [
+        { title: '序号', dataIndex: 'no', width: '6%', align: 'center' },
+        { title: '品牌', dataIndex: 'productBrand', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '一级分类', dataIndex: 'productType1', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '二级分类', dataIndex: 'productType2', align: 'left', width: '12%', customRender: function (text) { return text || '--' } },
+        { title: '三级分类', dataIndex: 'productType3', align: 'left', width: '12%', customRender: function (text) { return text || '--' } },
+        { title: '价格', dataIndex: 'productPrice', width: '10%', align: 'left', customRender: function (text) { return text || '--' } },
+        { title: '经销商', dataIndex: 'dealerName', width: '15%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '差价归属方', dataIndex: 'cjgsf', width: '15%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: '10%', align: 'center' }
+      ],
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.disabled = true
+        this.spinning = true
+        return dealerScopeList(Object.assign(parameter, this.queryParam, { dealerSn: this.$route.params.sn })).then(res => {
+          let data
+          if (res.status == 200) {
+            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
+          }
+          this.spinning = false
+          return data
+        })
+      },
+      openModal: false,
+      detail: null,
+      productType: [],
+      queryParam: { //  查询条件
+        rebateDealerSn: undefined,
+        productBrandSn: undefined,
+        productTypeSn1: undefined,
+        productTypeSn2: undefined,
+        productTypeSn3: undefined,
+        dealerName: ''
+      }
+    }
+  },
+  methods: {
+    // 返回
+    handleBack () {
+      this.$router.push({ name: 'merchantInfoManagementList', query: { closeLastOldTab: true } })
+    },
+    // 查询
+    handleSearch () {
+      this.$refs.table.refresh(true)
+    },
+    //  产品分类  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] : ''
+    },
+    // 重置表单
+    resetSearchForm () {
+      this.queryParam.dealerName = ''
+      this.queryParam.productBrandSn = undefined
+      this.queryParam.productTypeSn1 = undefined
+      this.queryParam.productTypeSn2 = undefined
+      this.queryParam.productTypeSn3 = undefined
+      this.productType = []
+      this.queryParam.rebateDealerSn = undefined
+      this.$refs.table.refresh(true)
+    },
+    // 打开关联弹框
+    openGlModal () {
+      this.openModal = true
+    },
+    // 编辑
+    handleEdit (row) {
+      this.openModal = true
+    },
+    handleDisassociate (val) {
+      this.queryParam.rebateDealerSn = val ? val.key : ''
+    },
+    // 详情编辑
+    getDetail () {
+      this.spinning = true
+      dealerDetailBySn({ sn: this.$route.params.sn }).then(res => {
+        if (res.status == 200) {
+          this.detail = res.data
+        }
+        this.spinning = false
+      })
+    },
+    pageInit () {
+      const _this = this
+      this.getDetail()
+      this.handleSearch()
+      this.$nextTick(() => { // 页面渲染完成后的回调
+        _this.setTableH()
+      })
+    },
+    setTableH () {
+      const tableSearchH = this.$refs.tableSearch.offsetHeight
+      this.tableHeight = window.innerHeight - tableSearchH - 292
+    }
+  },
+  watch: {
+    '$store.state.app.winHeight' (newValue, oldValue) { //  窗口变更时,需同时更改表格高度
+      this.setTableH()
+    }
+  },
+  mounted () {
+    if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
+      this.pageInit()
+    }
+  },
+  activated () {
+    // 如果是新页签打开或者进入新的子页(例:存在列表第2条数据编辑页页签时再打开第4条数据的编辑页),则重置当前页面
+    if (this.$store.state.app.isNewTab || !this.$store.state.app.isNewSubTab) {
+      this.pageInit()
+    }
+  },
+  beforeRouteEnter (to, from, next) {
+    next(vm => {})
+  }
+}
+</script>
+
+<style lang="less" scoped>
+  .rebateBinding-wrap{
+    .rebateBinding-cont{
+      margin-bottom: 6px;
+    }
+  }
+</style>

+ 232 - 0
src/views/dealerManagement/rebateBinding/priceDiffModal.vue

@@ -0,0 +1,232 @@
+<template>
+  <a-modal
+    v-drag
+    centered
+    class="priceDifference-modal"
+    :footer="null"
+    :maskClosable="false"
+    :title="title"
+    v-model="isShow"
+    @cancel="isShow=false"
+    :width="960">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <div>
+        <a-form-model
+          id="dealerAccountEdit-form"
+          ref="ruleForm"
+          :model="form"
+          :rules="rules"
+          :label-col="formItemLayout.labelCol"
+          :wrapper-col="formItemLayout.wrapperCol"
+        >
+          <a-form-model-item label="关联经销商">
+            <a-row :gutter="10">
+              <a-col :span="17">
+                <custList ref="custList" @change="custChange" placeholder="请输入经销商名称搜索"></custList>
+              </a-col>
+              <a-col :span="6">
+              </a-col>
+            </a-row>
+          </a-form-model-item>
+          <a-form-model-item label="差价归属方" prop="cjgsf">
+            <a-row :gutter="10">
+              <a-col :span="17">
+                <a-select
+                  v-model="form.cjgsf"
+                  placeholder="请选择差价归属方"
+                  mode="multiple"
+                  allowClear
+                  @change="cjgsgChange"
+                  style="width: 100%">
+                  <a-select-option v-for="item in cjgsfList" :key="item.code" :value="item.code">{{ item.name }}</a-select-option>
+                </a-select>
+              </a-col>
+              <a-col :span="6">
+              </a-col>
+            </a-row>
+          </a-form-model-item>
+          <a-form-model-item label="已绑经销商" v-if="form.cjgsf.indexOf('0')>=0">
+            <a-row :gutter="10">
+              <a-col :span="17">
+                <a-input v-model.trim="form.name" disabled />
+              </a-col>
+              <a-col :span="6" v-if="showPercent">
+                <a-input-number :min="0" :max="100"/> %
+              </a-col>
+            </a-row>
+          </a-form-model-item>
+          <a-form-model-item label="指定经销商" v-if="form.cjgsf.indexOf('1')>=0">
+            <a-row :gutter="10" v-for="(item,index) in zdDealearList" :key="item.id">
+              <a-col :span="17">
+                <custList ref="custList" @change="custChange" placeholder="请输入经销商名称搜索"></custList>
+              </a-col>
+              <a-col :span="5" v-if="showPercent||showPercent1">
+                <a-input-number :min="0" :max="100"/> %
+              </a-col>
+              <a-col :span="2">
+                <a-button @click="addOrDel(item,index)" size="small" shape="circle" :icon="index==zdDealearList.length-1?'plus':'minus'" style="margin-left: 10px;" />
+              </a-col>
+            </a-row>
+          </a-form-model-item>
+          <a-form-model-item label="箭冠总公司" v-if="form.cjgsf.indexOf('2')>=0">
+            <a-row :gutter="10">
+              <a-col :span="17">
+                <a-input v-model.trim="form.name" disabled />
+              </a-col>
+              <a-col :span="6" v-if="showPercent">
+                <a-input-number :min="0" :max="100"/> %
+              </a-col>
+            </a-row>
+          </a-form-model-item>
+        </a-form-model>
+      </div>
+      <div style="padding:10px 10px 10px 90px;">
+        <div style="padding-bottom:10px;">选择品类:</div>
+        <!-- 品类表格 -->
+        <categoryList ref="categoryList"></categoryList>
+      </div>
+      <div class="btn-cont">
+        <a-button size="large" @click="isShow = false" style="font-size: 12px;">取消</a-button>
+        <a-button
+          size="large"
+          type="primary"
+          class="button-primary"
+          style="margin-left: 50px;"
+          @click="handleSave"
+        >确定</a-button>
+      </div>
+    </a-spin>
+  </a-modal>
+</template>
+
+<script>
+import custList from '@/views/common/custList.vue'
+import { VSelect } from '@/components'
+import categoryList from './categoryList.vue'
+
+export default {
+  name: 'PriceDiffModal',
+  components: { VSelect, custList, categoryList },
+  props: {
+    openModal: { //  弹框显示状态
+      type: Boolean,
+      default: false
+    }
+  },
+  data () {
+    return {
+      spinning: false,
+      isShow: this.openModal, //  是否打开弹框
+      title: '差价设置',
+      formItemLayout: {
+        labelCol: { span: 4 },
+        wrapperCol: { span: 18 }
+      },
+      form: {
+        dealerSn: undefined,
+        cjgsf: []
+      },
+      rules: {
+        cjgsf: [{ required: true, message: '请选择差价归属方', trigger: 'change' }]
+      },
+      cjgsfList: [
+        { code: '0', name: '已绑经销商' },
+        { code: '1', name: '指定经销商' },
+        { code: '2', name: '箭冠总公司' }
+      ],
+      zdDealearList: []
+    }
+  },
+  computed: {
+    showPercent () {
+      return this.form.cjgsf.length > 1
+    },
+    showPercent1 () {
+      return this.zdDealearList.length > 1
+    }
+  },
+  methods: {
+    // 关联经销商变更
+    custChange (val) {
+      this.form.dealerSn = val.key
+    },
+    // 差价归属变更
+    cjgsgChange (val) {
+      if (val.indexOf('1') >= 0) {
+        if (this.zdDealearList.length == 0) {
+          this.zdDealearList.push({ id: new Date().getTime(), dealerSn: '', percent: '' })
+        }
+      } else {
+        this.zdDealearList = []
+      }
+    },
+    // 增加或删除指定经销商
+    addOrDel (row, index) {
+      // 加
+      if ((this.zdDealearList.length - 1) == index) {
+        this.zdDealearList.push({ id: new Date().getTime(), dealerSn: '', percent: '' })
+      } else {
+        const i = this.zdDealearList.findIndex(item => item.id == row.id)
+        if (i >= 0) {
+          this.zdDealearList.splice(i, 1)
+        }
+      }
+    },
+    // 重置表单
+    resetForm () {
+      this.form.dealerSn = undefined
+      this.form.cjgsf = []
+      this.zdDealearList = []
+      this.$refs.custList.resetForm()
+    },
+    // 保存
+    handleSave () {
+      const _this = this
+      _this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          const formData = _this.form
+          _this.spinning = true
+          dealerUserSave(formData).then(res => {
+            if (res.status == 200) {
+              _this.$message.success(res.message)
+              _this.$emit('ok')
+              _this.isShow = false
+            }
+            _this.spinning = false
+          })
+        } else {
+          return false
+        }
+      })
+    }
+  },
+  watch: {
+    //  父页面传过来的弹框状态
+    openModal (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    //  重定义的弹框状态
+    isShow (newValue, oldValue) {
+      if (!newValue) {
+        this.resetForm()
+        this.$emit('close')
+      }
+    }
+  }
+}
+</script>
+
+<style lang="less">
+  .priceDifference-modal{
+    .ant-modal-body {
+      padding: 24px!important;
+    }
+    .btn-cont {
+      text-align: center;
+      margin: 15px 0 10px;
+      button{
+        width: 120px;
+      }
+    }
+  }
+</style>