فهرست منبع

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

lilei 1 سال پیش
والد
کامیت
af3d9f9607

+ 60 - 4
src/api/serviceCenter.js

@@ -17,9 +17,8 @@ export const serviceCenterList = (params) => {
 
 // 省仓新增
 export const serviceCenterAdd = (params) => {
-  const url = '/serviceCenter/insert'
   return axios({
-    url: url,
+    url: '/serviceCenter/insert',
     data: params,
     method: 'post',
     headers: {
@@ -30,10 +29,67 @@ export const serviceCenterAdd = (params) => {
 
 // 启用禁用
 export const provincialWarehouseEnable = (params) => {
-  const url = '/serviceCenter/enableflag'
+  return axios({
+    url: '/serviceCenter/enableflag',
+    data: params,
+    method: 'post',
+    headers: {
+      'module': encodeURIComponent(params.enableFlag == 1 ? '启用' : '禁用')
+    }
+  })
+}
+
+// 关联经销商
+export const serviceCenterBinding = (params) => {
+  return axios({
+    url: '/serviceCenter/binding',
+    data: params,
+    method: 'post',
+    headers: {
+      'module': encodeURIComponent('关联经销商')
+    }
+  })
+}
+
+// 省仓客户
+export const queryServiceCenterDealerPage = (params) => {
+  const url = `/serviceCenter/queryServiceCenterDealerPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
   return axios({
     url: url,
     data: params,
-    method: 'post'
+    method: 'post',
+    headers: {
+      'module': encodeURIComponent('省仓客户')
+    }
   })
 }
+
+// 省仓客户  解绑
+export const serviceCenterUnbinding = (params) => {
+  return axios({
+    url: '/serviceCenter/unbinding',
+    data: params,
+    method: 'post',
+    headers: {
+      'module': encodeURIComponent('解绑省仓客户')
+    }
+  })
+}
+ 
+   
+  
+ 
+//省仓客户  导出
+export const serviceCenterExport = (params) => {
+  return axios({
+    url: '/serviceCenter/excel',
+    data: params,
+    method: 'post',
+    responseType: 'blob',
+    headers:{
+      'module': encodeURIComponent('导出')
+    }
+  })
+}

+ 49 - 84
src/views/dealerManagement/provincialWarehouseManagement/chooseDealer.vue

@@ -43,21 +43,25 @@
         </span>
       </div>
     </div>
-    <a-table
+    <s-table
+      class="sTable fixPagination"
+      ref="table"
       style="height: 320px;"
       :scroll="{ y: 230 }"
-      :bordered="true"
-      :pagination="pagination"
-      :row-key="record => record.dealerSn"
-      :row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
+      size="small"
+      :rowKey="(record) => record.dealerSn"
+      rowKeyName="dealerSn"
       :columns="columns"
-      :data-source="dealerList"
-      @change="handlePage"
-    >
+      :data="loadData"
+      :row-selection="{ columnWidth: 40 }"
+      @rowSelection="rowSelectionFun"
+      :defaultLoadData="false"
+      bordered>
+      <!-- 地区 -->
       <template slot="addressInfo" slot-scope="text, record">
         {{ record.provinceName }}{{ '-'+ record.cityName }}{{ '-'+ record.districtName }}
       </template>
-    </a-table>
+    </s-table>
   </a-spin>
 </template>
 
@@ -66,20 +70,17 @@ import { commonMixin } from '@/utils/mixin'
 import { STable, VSelect } from '@/components'
 import AreaList from '@/views/common/areaList.js'
 import subarea from '@/views/common/subarea.js'
-import { queryDealerPage } from '@/api/promotion'
-import { getDealerListInfo } from '@/api/dealer'
+import { getDealerListInfo, dealerQueryList } from '@/api/dealer'
 export default {
   name: 'ChooseDealer',
   mixins: [commonMixin],
   components: { STable, VSelect, subarea, AreaList },
   props: {
-    parentData: {
-      type: Object,
-      default: function () {
-        return null
-      }
+    pageType: {
+      type: String,
+      default: 'dealerPromotion'
     },
-    promotionSn: {
+    itemSn: {
       type: String,
       default: ''
     }
@@ -100,18 +101,9 @@ export default {
         citySn: undefined,
         districtSn: undefined
       },
-      pagination: {
-        pageSize: 20,
-        showSizeChanger: true,
-        pageSizeOptions: ['20', '50', '100', '200', '500']
-      },
-      pageFlag: false,
-      chooseInfo: [],
-      selectedRowKeys: [],
-      dealerList: [],
-      tableHeight: 0,
       disabled: false, //  查询、重置按钮是否可操作
       loading: false, // 批量添加loading,
+      rowSelectionInfo: null,
       columns: [
         { title: '地区', scopedSlots: { customRender: 'addressInfo' }, width: '30%', align: 'center', ellipsis: true },
         { title: '经销商名称', dataIndex: 'dealerName', width: '30%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
@@ -120,50 +112,35 @@ export default {
         { title: '商户级别', dataIndex: 'dealerLevelDictValue', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '所在区域', dataIndex: 'subareaArea.subareaName', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '所在分区', dataIndex: 'subareaArea.subareaAreaName', width: '20%', align: 'center', customRender: function (text) { return text || '--' } }
-      ]
+      ],
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.disabled = true
+        this.spinning = true
+        this.queryParam.serviceCenterSn = this.itemSn
+        this.queryParam.pageType = this.pageType
+        return dealerQueryList(Object.assign(parameter, this.queryParam)).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
+        })
+      }
     }
   },
   computed: {
     selectCount () {
-      return this.selectedRowKeys && this.selectedRowKeys.length
+      return this.rowSelectionInfo && this.rowSelectionInfo.selectedRowKeys.length
     }
   },
   methods: {
-    onSelectChange (selectedRowKeys) {
-      this.selectedRowKeys = selectedRowKeys
-    },
-    handlePage (pagination, filters, sorter) {
-      const pager = { ...this.pagination }
-      pager.pageNo = pagination.pageSize != pager.pageSize ? 1 : pagination.current
-      pager.pageSize = pagination.pageSize
-      pager.current = pager.pageNo
-      this.pagination = pager
-      this.loadData()
-    },
-    loadData () {
-      this.spinning = true
-      const params = { pageSize: 20, pageNo: 1, ...this.pagination, promotionSn: this.promotionSn }
-
-      queryDealerPage(Object.assign(params, this.queryParam)).then(res => {
-        let data
-        if (res.status == 200) {
-          data = res.data
-          const pagination = { ...this.pagination }
-          pagination.total = Number(data.count)
-          const no = 0
-          for (var i = 0; i < data.list.length; i++) {
-            data.list[i].no = no + i + 1
-          }
-          this.dealerList = data.list
-          this.pagination = pagination
-          if (this.chooseInfo.length > 0 && !this.pageFlag) {
-            this.pageFlag = true
-            this.selectedRowKeys = this.chooseInfo
-          }
-        }
-        this.spinning = false
-      })
-    },
     // 表格选中项
     rowSelectionFun (obj) {
       this.rowSelectionInfo = obj || null
@@ -174,8 +151,7 @@ export default {
       this.queryParam.districtSn = val[2] ? val[2] : ''
     },
     searchForm () {
-      this.loadData()
-      this.spinning = false
+      this.$refs.table.refresh()
     },
     subareaChange (val) {
       this.queryParam.subareaArea.subareaSn = val[0] ? val[0] : undefined
@@ -198,34 +174,23 @@ export default {
       }
       this.$refs.subarea.clearData()
       this.$refs.areaList.clearData()
-      this.pagination.pageNo = 1
-      this.pagination.current = 1
-      this.loadData()
-      this.pageFlag = false
+      this.$refs.table.refresh()
+    },
+    clearSelect () {
+      this.$refs.table.clearSelected()
     },
     // 批量添加
     async handleBatchAudit () {
       const _this = this
-      if (_this.selectedRowKeys && _this.selectedRowKeys.length < 1) {
+      if (_this.rowSelectionInfo && _this.rowSelectionInfo.selectedRowKeys && _this.rowSelectionInfo.selectedRowKeys.length < 1) {
         _this.$message.warning('请在列表勾选后再进行批量操作!')
         return
       }
-      const dealerInfoList = await getDealerListInfo({ dealerSnList: _this.selectedRowKeys })
-      this.spinning = false
+      const dealerInfoList = await getDealerListInfo({ dealerSnList: _this.rowSelectionInfo.selectedRowKeys })
       this.$emit('plAdd', dealerInfoList.data)
     },
     pageInit (data) {
-      const _this = this
-      this.$nextTick(() => { // 页面渲染完成后的回调
-        _this.setTableH()
-      })
-      this.selectedRowKeys = []
-      this.chooseInfo = data || []
-      this.resetSearchForm()
-    },
-    setTableH () {
-      const tableSearchH = this.$refs.tableSearch.offsetHeight
-      this.tableHeight = window.innerHeight - tableSearchH - 285
+      this.$refs.table.refresh()
     }
   },
   watch: {

+ 69 - 49
src/views/dealerManagement/provincialWarehouseManagement/list.vue

@@ -48,8 +48,10 @@
           :defaultLoadData="false"
           bordered>
           <!-- 省仓客户 -->
-          <template slot="customNum" slot-scope="text, record" @click="openCustomerModal = true">
-            共有<span style="color:#39f;vertical-align:top;">{{ record.customerNum }}</span>个客户
+          <template slot="customNum" slot-scope="text, record">
+            <span @click="handleCustomer(record)" style="cursor: pointer;">
+              共有<span style="color:#39f;vertical-align:top;">{{ record.customerNum }}</span>个客户
+            </span>
           </template>
           <!-- 省仓状态 -->
           <template slot="loginFlag" slot-scope="text, record">
@@ -58,7 +60,7 @@
               v-if="$hasPermissions('B_dealerAccount_enable')"
               checkedChildren="启用"
               unCheckedChildren="禁用"
-              @change="changeStatus(record)"
+              @change="openStatusModal(record)"
               :checked="record.enableFlag == 1 ? true : false" />
             <span v-else :style="{color:(record.enableFlag==1?'#00aa00':'#999')}"> {{ record.enableFlag==1? '已启用': '已禁用' }} </span>
           </template>
@@ -85,13 +87,9 @@
         @close="closeModal" />
       <!-- 省仓客户 -->
       <lookUp-customers-modal
-        :itemSn="itemPromotionSn"
-        :showType="itemStatusType"
+        :itemSn="notDealerSn"
         ref="lookUpCustomers"
         :openModal="openCustomerModal"
-        :chooseDealerList="chooseDealerArr"
-        @submitAudit="editCustomerOk"
-        @handleAudit="auditCustomerOk"
         @close="closeCustomer"></lookUp-customers-modal>
       <!-- 关联经销商 -->
       <a-modal
@@ -100,11 +98,11 @@
         :footer="null"
         centered
         class="lookUpCustomers-modal"
-        @cancel="openDealerModal = false"
+        @cancel="closeDealerModal"
         width="60%"
       >
         <div class="dealerModalCon">
-          <chooseDealer ref="dealerChoose" pageType="dealerPromotion" :itemSn="notDealerSn" @plAdd="handleAddDealer"></chooseDealer>
+          <chooseDealer ref="dealerChoose" :itemSn="notDealerSn" @plAdd="handleAddDealer"></chooseDealer>
         </div>
       </a-modal>
     </a-card>
@@ -116,9 +114,8 @@ import { commonMixin } from '@/utils/mixin'
 import { STable, VSelect } from '@/components'
 import provincialWarehouseAddModal from './addModal.vue'
 import lookUpCustomersModal from './lookUpCustomersModal.vue'
-import chooseDealer from '../../promotionRulesManagement/promotionManagement/chooseDealer.vue'
-import { dealerUserEnable, dealerUserResetP } from '@/api/dealer'
-import { serviceCenterList, provincialWarehouseEnable } from '@/api/serviceCenter'
+import chooseDealer from './chooseDealer.vue'
+import { serviceCenterList, provincialWarehouseEnable, serviceCenterBinding } from '@/api/serviceCenter'
 export default {
   name: 'DealerAccountManagementList',
   mixins: [commonMixin],
@@ -173,20 +170,48 @@ export default {
     }
   },
   methods: {
-    editCustomerOk () {
-
-    },
-    auditCustomerOk () {
-
-    },
+    // 关闭省仓客户列表弹窗
     closeCustomer () {
-
+      this.notDealerSn = null
+      this.openCustomerModal = false
+      this.$refs.table.refresh()
     },
-    // 关联经销商
+    // 省仓客户
+    handleCustomer (item) {
+      this.openCustomerModal = true
+      this.$refs.lookUpCustomers.pageInit({
+        itemSn: item.serviceCenterSn,
+        name: item.serviceCenterName
+      })
+    },
+    // 打开关联经销商弹窗
     handleDealer (row) {
       this.notDealerSn = row.serviceCenterSn
+      this.openDealerModal = true
       this.$nextTick(() => {
-        this.openDealerModal = true
+        this.$refs.dealerChoose.pageInit()
+      })
+    },
+    // 关闭关联经销商弹窗
+    closeDealerModal () {
+      this.openDealerModal = false
+      this.notDealerSn = null
+      this.$refs.dealerChoose.clearSelect()
+    },
+    // 关联经销商
+    handleAddDealer (list) {
+      this.spinning = true
+      const params = {
+        serviceCenterSn: this.notDealerSn,
+        dealerList: list
+      }
+      serviceCenterBinding(params).then(res => {
+        if (res.status == 200) {
+          this.$message.success(res.message)
+        }
+        this.spinning = false
+        this.closeDealerModal()
+        this.$refs.table.refresh()
       })
     },
     //  重置
@@ -194,6 +219,7 @@ export default {
       this.queryParam.serviceCenterName = ''
       this.queryParam.dealerName = ''
       this.queryParam.enableFlag = undefined
+      this.notDealerSn = null
       this.$refs.table.refresh(true)
     },
     //  新增/编辑
@@ -202,11 +228,6 @@ export default {
       // this.nowData = row || null
       this.openModal = true
     },
-    // 详情
-    handleDetail (row) {
-      this.itemId = row ? row.id : ''
-      this.openDetailModal = true
-    },
     //  关闭弹框
     closeModal () {
       this.itemId = ''
@@ -218,33 +239,32 @@ export default {
       this.itemId = ''
       this.openDetailModal = false
     },
-    // 重置密码
-    handleReset (row) {
+    // 打开启用 禁用 弹窗
+    openStatusModal (record) {
       const _this = this
-      this.$confirm({
-        title: '提示',
-        content: '重置密码后,新的密码会以短信形式发送到【管理员手机】,确定要重置吗?',
-        centered: true,
-        onOk () {
-          _this.spinning = true
-          dealerUserResetP({ id: row.id }).then(res => {
-            if (res.status == 200) {
-              _this.$message.success(res.message)
-              _this.$refs.table.refresh()
-              _this.spinning = false
-            } else {
-              _this.spinning = false
+      if (record.enableFlag == 1) {
+        this.$confirm({
+          title: '提示',
+          content: '禁用省仓后,省仓客户无法向省仓采购,确定禁用省仓吗?',
+          centered: true,
+          onOk () {
+            const ajaxData = {
+              serviceCenterSn: record.serviceCenterSn,
+              enableFlag: '0'
             }
-          })
+            _this.changeStatus(ajaxData)
+          }
+        })
+      } else {
+        const params = {
+          serviceCenterSn: record.serviceCenterSn,
+          enableFlag: '1'
         }
-      })
+        _this.changeStatus(params)
+      }
     },
     // 启用 禁用
-    changeStatus (record) {
-      const params = {
-        serviceCenterSn: record.serviceCenterSn,
-        enableFlag: record.enableFlag == 1 ? '0' : '1'
-      }
+    changeStatus (params) {
       this.spinning = true
       provincialWarehouseEnable(params).then(res => {
         if (res.status == 200) {

+ 70 - 156
src/views/dealerManagement/provincialWarehouseManagement/lookUpCustomersModal.vue

@@ -4,7 +4,7 @@
     class="lookUpCustomers-modal"
     :footer="null"
     :maskClosable="false"
-    title="参与客户"
+    title="省仓客户"
     v-model="isShow"
     @cancel="isShow = false"
     width="60%">
@@ -16,29 +16,17 @@
             <a-row :gutter="15">
               <a-col :md="6" :sm="24">
                 <a-form-model-item label="地区">
-                  <AreaList id="lookUpCustomers-areaList" changeOnSelect ref="areaList" @change="areaChange" defValKey="id"></AreaList>
+                  <AreaList id="actualSalesReportList-areaList" changeOnSelect ref="areaList" @change="areaChange" defValKey="id"></AreaList>
                 </a-form-model-item>
               </a-col>
               <a-col :md="6" :sm="24">
                 <a-form-model-item label="区域/分区">
-                  <subarea ref="subarea" id="lookUpCustomers-subarea" @change="subareaChange"></subarea>
+                  <subarea ref="subarea" id="salesManagementList-subarea" @change="subareaChange"></subarea>
                 </a-form-model-item>
               </a-col>
               <a-col :md="6" :sm="24">
                 <a-form-item label="经销商名称">
-                  <a-input id="lookUpCustomers-purchaseBillNo" v-model="queryParam.dealerName" placeholder="请输入经销商名称" allowClear/>
-                </a-form-item>
-              </a-col>
-              <a-col :md="6" :sm="24">
-                <a-form-item label="客户状态">
-                  <v-select
-                    v-model="queryParam.state"
-                    ref="state"
-                    id="lookUpCustomers-state"
-                    code="PROMOTION_STATE"
-                    placeholder="请选择客户状态"
-                    allowClear
-                  ></v-select>
+                  <a-input id="salesManagementList-purchaseBillNo" v-model.trim="queryParam.dealerName" allowClear placeholder="请输入经销商名称"/>
                 </a-form-item>
               </a-col>
               <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
@@ -67,88 +55,48 @@
           :data="loadData"
           :defaultLoadData="false"
           :scroll="{ y: 450 }"
-          :rowClassName="(record, index) => record.dataActType ==='CREATE'? 'fontRed':record.dataActType ==='DELETE'?'fontGreen':''"
+          :rowClassName="(record, index) => record.checkProfitLossQty < 0 ? 'redBg-row':''"
           bordered>
           <!-- 地区 -->
           <template slot="address" slot-scope="text, record">
             {{ record.provinceName }}/{{ record.cityName }}/{{ record.districtName }}
           </template>
-          <!-- 经销商名称 -->
-          <template slot="dealerName" slot-scope="text, record">
-            <span>{{ record.dealerName ||'--' }}</span>
-            <a-badge count="未" :number-style="{ zoom:'80%' }"></a-badge>
-          </template>
-          <!-- 客户状态 -->
-          <template slot="dealerState" slot-scope="text, record">
-            <a-switch checkedChildren="启用" unCheckedChildren="禁用" :checked="record.isEnable" @change="changeStatus"/>
+          <!-- 操作 -->
+          <template slot="action" slot-scope="text, record">
+            <a-button
+              size="small"
+              type="link"
+              v-if="$hasPermissions('B_dealerAccount_edit')"
+              class="button-info"
+              @click="handleDelete(record)"
+              id="provincialWarehouse-edit-btn">解绑</a-button>
+            <span v-else>--</span>
           </template>
         </s-table>
       </a-card>
-      <div style="text-align:right;color:#666;" v-if="showType ==='isEdit' || showType === 'isAudit'"><span v-if="showType === 'isAudit'">待审核,</span>增加的客户显示红色,删除的客户显示绿色</div>
-      <div class="btn-cont" v-if="showType ==='isEdit'">
-        <a-button type="primary" class="button-warning" @click="editDealerModal">修改</a-button>
-        <a-button type="primary" style="margin-left: 15px;" :loading="spinning" id="promotion-modal-save" @click="submitAudit">提交审核</a-button>
-      </div>
-      <div class="btn-cont" v-if="showType === 'isAudit'&& $hasPermissions('B_dealerAudit')">
-        <a-button @click="handleAudit('AUDIT_REJECT')">审核不通过</a-button>
-        <a-button type="primary" style="margin-left: 15px;" :loading="spinning" id="promotion-modal-save" @click="handleAudit('AUDIT_PASS')">审核通过</a-button>
-      </div>
-      <div class="btn-cont" v-if="showType === 'isAudit' && !$hasPermissions('B_dealerAudit')">
-        <a-button id="lookUpCustomers-modal-back" @click="isShow = false">关闭</a-button>
-      </div>
-      <div class="btn-cont" v-if="showType === 'isClose'">
+      <div class="btn-cont">
         <a-button id="lookUpCustomers-modal-back" @click="isShow = false">关闭</a-button>
       </div>
     </a-spin>
-    <!-- 选择参与客户 -->
-    <a-modal
-      title="选择经销商"
-      :visible="openDealerModal"
-      :footer="null"
-      centered
-      class="lookUpCustomers-modal"
-      @cancel="openDealerModal = false"
-      width="60%"
-    >
-      <div class="dealerModalCon">
-        <chooseDealer ref="dealerChoose" :promotionSn="itemSn" @plAdd="handleAddDealer"></chooseDealer>
-      </div>
-    </a-modal>
   </a-modal>
 </template>
 
 <script>
 import { commonMixin } from '@/utils/mixin'
 import { STable } from '@/components'
+import ProductType from '@/views/common/productType.js'
 import subarea from '@/views/common/subarea.js'
 import AreaList from '@/views/common/areaList.js'
 import { hdExportExcel } from '@/libs/exportExcel'
-import { dealerExport } from '@/api/promoTerminal'
-import { queryAuditPageList, dealerMidwayUpdate } from '@/api/promotion'
-import chooseDealer from './chooseDealer'
-
+import { queryServiceCenterDealerPage, serviceCenterUnbinding, serviceCenterExport } from '@/api/serviceCenter'
 export default {
   name: 'LookUpCustomersModal',
-  components: { STable, subarea, AreaList, chooseDealer },
+  components: { STable, ProductType, subarea, AreaList },
   mixins: [commonMixin],
   props: {
     openModal: { //  弹框显示状态
       type: Boolean,
       default: false
-    },
-    itemSn: {// 促销sn
-      type: String,
-      default: ''
-    },
-    showType: {
-      type: String,
-      default: ''
-    },
-    chooseDealerList: {
-      type: Array,
-      default: () => {
-        return []
-      }
     }
   },
   data () {
@@ -165,22 +113,22 @@ export default {
         provinceSn: undefined,
         citySn: undefined,
         districtSn: undefined,
-        dealerName: '',
-        state: undefined
+        dealerName: undefined,
+        serviceCenterSn: '',
+        relationType: 'PURCHASE'
       },
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
         this.spinning = true
-        this.queryParam.promotionSn = this.itemSn
-        const params = Object.assign(parameter, this.queryParam)
-        return queryAuditPageList(params).then(res => {
+        return queryServiceCenterDealerPage(Object.assign(parameter, this.queryParam)).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
+              data.list[i].loginFlag = Number(data.list[i].loginFlag)
             }
             this.disabled = false
           }
@@ -188,112 +136,87 @@ export default {
           return data
         })
       },
+      basicInfoData: null, //  基本信息
+      productTotal: null,
+      productType: [],
+      snObj: undefined, // 经销商列表
+      warehouseList: [], //  仓库  下拉数据
+      localDataSource: [],
+      isPrice: false, //  仅显示盈亏
+      openPrintModal: false,
+      nowType: null,
+      printerType: 'NEEDLE', //  打印机类型
       columns: [
         { title: '序号', dataIndex: 'no', width: '8%', align: 'center' },
         { title: '地区', scopedSlots: { customRender: 'address' }, width: '20%', align: 'center', ellipsis: true },
         { title: '区域', dataIndex: 'subareaArea.subareaName', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '分区', dataIndex: 'subareaArea.subareaAreaName', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '经销商名称', dataIndex: 'dealerName', scopedSlots: { customRender: 'dealerName' }, width: '20%', align: 'center', ellipsis: true },
+        { title: '经销商名称', dataIndex: 'dealerName', width: '20%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '商户类型', dataIndex: 'dealerLevelDictValue', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '商户级别', dataIndex: 'dealerTypeDictValue', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '客户状态', scopedSlots: { customRender: 'dealerState' }, width: '10%', align: 'center' }
-      ],
-      openDealerModal: false, // 修改弹窗
-      updateFlag: false
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: '12%', align: 'center' }
+      ]
     }
   },
   methods: {
-    // 客户状态
-    changeStatus (e) {
-
+    areaChange (val) {
+      this.queryParam.provinceSn = val[0] ? val[0] : ''
+      this.queryParam.citySn = val[1] ? val[1] : ''
+      this.queryParam.districtSn = val[2] ? val[2] : ''
     },
-    // 修改参与客户
-    editDealerModal () {
-      const _this = this
-      _this.openDealerModal = true
-      const arr = _this.chooseDealerList
-      // 选择参与客户回显
-      _this.$nextTick(() => {
-        _this.$refs.dealerChoose.pageInit(arr)
-      })
+    subareaChange (val) {
+      this.queryParam.subareaArea.subareaSn = val[0] ? val[0] : undefined
+      this.queryParam.subareaArea.subareaAreaSn = val[1] ? val[1] : undefined
     },
-    // 添加经销商
-    handleAddDealer (list) {
-      const newArr = []
-      const dealerSnArr = []
-      list.forEach(item => {
-        const obj = {
-          dealerScope: this.itemSn ? 'SOME_DEALER' : 'ALL_DEALER',
-          dealerSn: item.dealerSn
-        }
-        newArr.push(obj)
-        dealerSnArr.push(item.dealerSn)
+    pageInit (item) {
+      this.queryParam.serviceCenterSn = item.itemSn
+      this.serviceCenterName = item.name
+      const _this = this
+      this.$nextTick(() => {
+        _this.$refs.table.refresh(true)
       })
-      this.openDealerModal = false
-      this.chooseDealerList = dealerSnArr
-      this.updateDataList(newArr)
     },
-    // 更新列表显示状态
-    updateDataList (list) {
+    // 解绑
+    handleDelete (row) {
       const ajaxData = {
-        promotionSn: this.itemSn ? this.itemSn : undefined,
-        promotionDealerList: list
+        serviceCenterSn: this.queryParam.serviceCenterSn,
+        dealerSn: row.dealerSn
       }
-      dealerMidwayUpdate(ajaxData).then(res => {
+      this.spinning = true
+      serviceCenterUnbinding(ajaxData).then(res => {
         if (res.status == 200) {
-          this.$message.success(res.message)
-          this.$refs.table.refresh()
+          this.$message.success('解绑成功')
+          this.$refs.table.refresh(true)
         }
+        this.spinning = false
       })
     },
-    areaChange (val) {
-      this.queryParam.provinceSn = val[0] ? val[0] : ''
-      this.queryParam.citySn = val[1] ? val[1] : ''
-      this.queryParam.districtSn = val[2] ? val[2] : ''
-    },
-    subareaChange (val) {
-      this.queryParam.subareaArea.subareaSn = val[0] ? val[0] : undefined
-      this.queryParam.subareaArea.subareaAreaSn = val[1] ? val[1] : undefined
-    },
     //  重置
     resetSearchForm () {
-      this.queryParam = Object.assign({
-        provinceSn: undefined,
-        citySn: undefined,
-        districtSn: undefined,
+      this.queryParam = {
         subareaArea: {
           subareaSn: undefined,
           subareaAreaSn: undefined
         },
-        dealerName: '',
-        state: undefined
-      }, this.snObj)
-      this.updateFlag = false
+        provinceSn: undefined,
+        citySn: undefined,
+        districtSn: undefined,
+        dealerName: undefined,
+        relationType: 'PURCHASE'
+      }
       this.$refs.areaList.clearData()
       this.$refs.subarea.clearData()
-      this.$refs.table.refresh(true)
     },
     //  导出
     handleExport () {
       const _this = this
       _this.exportLoading = true
       _this.spinning = true
-      _this.queryParam.dealerSnList = this.chooseDealerList
-      const paramsData = _this.queryParam
-      hdExportExcel(dealerExport, paramsData, '促销经销商列表导出', function () {
+      _this.queryParam.serviceCenterName = _this.serviceCenterName
+      hdExportExcel(serviceCenterExport, _this.queryParam, '省仓客户列表导出', function () {
         _this.exportLoading = false
         _this.spinning = false
-        _this.showExport = true
       })
-    },
-    // 提交审核
-    submitAudit () {
-      this.$emit('submitAudit')
-      this.isShow = false
-    },
-    handleAudit (statusInfo) {
-      this.$emit('handleAudit', statusInfo)
-      this.isShow = false
     }
   },
   watch: {
@@ -305,10 +228,8 @@ export default {
     isShow (newValue, oldValue) {
       if (!newValue) {
         this.$emit('close')
-      } else {
-        this.$nextTick(() => {
-          this.resetSearchForm()
-        })
+        this.queryParam.serviceCenterSn = ''
+        this.resetSearchForm()
       }
     }
   }
@@ -343,12 +264,5 @@ export default {
         }
       }
     }
-   /deep/.fontRed{
-     color:red;
-   }
-   /deep/.fontGreen{
-     color:green;
-   }
   }
-
 </style>