| 
					
				 | 
			
			
				@@ -37,7 +37,7 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             </a-col> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           </div> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           <a-col :md="pageType!='viewDealers'?8:6" :sm="24" style="margin-bottom: 10px;"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="chooseDealer-refresh">查询</a-button> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            <a-button type="primary" @click="searchForm(true)" :disabled="disabled" id="chooseDealer-refresh">查询</a-button> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="chooseDealer-reset">重置</a-button> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           </a-col> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         </a-row> 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -46,7 +46,7 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       <div style="margin-bottom: 10px"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         <a-button type="primary" ghost :loading="loading" @click="handleBatchAudit">批量添加</a-button> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         <span style="margin-left: 5px"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-          <template v-if="rowSelectionInfo&&rowSelectionInfo.selectedRowKeys.length>0"> {{ `已选 ${rowSelectionInfo.selectedRowKeys.length} 项` }} </template> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          <template v-if="selectCount"> {{ `已选 ${selectCount} 项` }} </template> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         </span> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       </div> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     </div> 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -54,9 +54,9 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       class="sTable" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       ref="table" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       size="small" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      :rowKey="(record) => record.stockPutSn" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      rowKeyName="stockPutSn" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      :row-selection="$hasPermissions('B_warehousingConfirmationpl') ? { columnWidth: 40, getCheckboxProps: record => ({ props: { disabled: record.auditState != 'WAIT' } }) } : null" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      :rowKey="(record) => record.dealerSn" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      rowKeyName="dealerSn" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      :row-selection="{ columnWidth: 40, getCheckboxProps: record => ({ props: { disabled: !!record.subareaAreaSn } }) }" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       @rowSelection="rowSelectionFun" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       :columns="columns" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       :data="loadData" 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -64,13 +64,19 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       :scroll="{ y: tableHeight }" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       :defaultLoadData="false" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       bordered> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      <template slot="areas" slot-scope="text, record"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        <span v-if="record.subareaNameSet">{{ record.subareaNameSet[0] }}</span> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        <span v-else>--</span> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      </template> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       <template slot="action" slot-scope="text, record"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         <a-button 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           size="small" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           type="link" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           class="button-error" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           @click="handleAdd(record)" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          v-if="record.subareaAreaSn != parentData.subareaAreaSn" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           id="marketingDivisionSetNew-del-btn">添加</a-button> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        <span style="color:#666" v-else>已添加</span> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       </template> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     </s-table> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   </a-spin> 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -90,6 +96,12 @@ export default { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     pageType: { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       type: String, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       default: '' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    parentData: { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      type: Object, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      default: function(){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        return null 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   data () { 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -97,22 +109,27 @@ export default { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       spinning: false, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       queryParam: { //  查询条件 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         nameLike: '', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        dealerType: undefined, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        dealerLevel: undefined, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        subareaSn: undefined 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        dealerType: null, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        dealerLevel: null, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        auditState: undefined, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        provinceSn: undefined, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        citySn: undefined, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        districtSn: undefined 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       tableHeight: 0, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       disabled: false, //  查询、重置按钮是否可操作 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       loading: false, // 批量添加loading 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       // 加载数据方法 必须为 Promise 对象 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       loadData: parameter => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        this.disabled = true 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         this.spinning = true 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         return queryDealerPageList(Object.assign(parameter, this.queryParam)).then(res => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           let data 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           if (res.status == 200) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             data = res.data 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            this.disabled = false 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            const no = 0 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            for (var i = 0; i < data.length; i++) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+              data[i].no = no + i + 1 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           this.spinning = false 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           return data 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -125,20 +142,23 @@ export default { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     columns () { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       const _this = this 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       const arr = [ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        { title: '经销商名称', dataIndex: 'putTime', width: '30%', align: 'center', customRender: function (text) { return text || '--' } }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        { title: '商户别名', dataIndex: 'providerName', align: 'left', width: '30%', customRender: function (text) { return text || '--' }, ellipsis: true }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        { title: '商户类型', dataIndex: 'putBizTypeDictValue', width: '15%', align: 'center', customRender: function (text) { return text || '--' } }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        { title: '商户级别', dataIndex: 'auditStateDictValue', width: '15%', align: 'center', customRender: function (text) { return text || '--' } } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        { title: '经销商名称', dataIndex: 'dealerName', width: '30%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true  }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        { title: '商户别名', dataIndex: 'dealerAlias', align: 'left', width: '30%', customRender: function (text) { return text || '--' }}, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        { title: '商户类型', dataIndex: 'dealerTypeDictValue', width: '15%', align: 'center', customRender: function (text) { return text || '--' } }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        { title: '商户级别', dataIndex: 'dealerLevelDictValue', width: '15%', align: 'center', customRender: function (text) { return text || '--' } } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       ] 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       if (_this.pageType == 'viewDealers') { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        arr.splice(4, 0, { title: '审核状态', dataIndex: 'remark', width: '20%', align: 'left', customRender: function (text) { return text || '--' } }) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        arr.splice(5, 0, { title: '当前所属区域', dataIndex: 'remark', width: '20%', align: 'left', customRender: function (text) { return text || '--' } }) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        arr.splice(6, 0, { title: '操作', scopedSlots: { customRender: 'action' }, width: '30%', align: 'center' }) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        arr.splice(4, 0, { title: '审核状态', dataIndex: 'auditStateDictValue', width: '20%', align: 'center', customRender: function (text) { return text || '--' } }) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        arr.splice(5, 0, { title: '当前所属区域', scopedSlots: { customRender: 'areas' }, width: '30%', align: 'center' }) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        arr.splice(6, 0, { title: '操作', scopedSlots: { customRender: 'action' }, width: '20%', align: 'center' }) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        arr.splice(4, 0, { title: '所在区域', dataIndex: 'remark', width: '20%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true }) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        arr.splice(5, 0, { title: '所在分区', dataIndex: 'remark', width: '20%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true }) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        arr.splice(4, 0, { title: '所在区域', dataIndex: 'subareaName', width: '20%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true }) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        arr.splice(5, 0, { title: '所在分区', dataIndex: 'subareaAreaName', width: '20%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true }) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       return arr 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    selectCount(){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      return this.rowSelectionInfo && this.rowSelectionInfo.selectedRowKeys.length 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   methods: { 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -151,10 +171,24 @@ export default { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       this.queryParam.citySn = val[1] ? val[1] : '' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       this.queryParam.districtSn = val[2] ? val[2] : '' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    searchForm(flag){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      this.$refs.table.refresh(flag) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      this.$refs.table.clearSelected() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      this.spinning = false 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     //  重置 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     resetSearchForm () { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      this.queryParam = { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        nameLike: '', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        dealerType: null, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        dealerLevel: null, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        auditState: undefined, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        provinceSn: undefined, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        citySn: undefined, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        districtSn: undefined 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       this.$refs.table.refresh(true) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      this.rowSelectionInfo = null 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      this.$refs.table.clearSelected() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     clearTable(){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       this.rowSelectionInfo = null 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -167,11 +201,26 @@ export default { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         _this.$message.warning('请在列表勾选后再进行批量操作!') 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         return 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      this.isBatch = true 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      this.confirmationModal = true 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      const dealerSnList = _this.rowSelectionInfo.selectedRowKeys 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      this.spinning = true 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      this.$emit("plAdd",dealerSnList) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     handleAdd(row){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      if(row.subareaNameSet&&row.subareaNameSet.length){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        const _this = this 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        this.$confirm({ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          title: '提示', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          content: '当前经销商已被其他区域分区绑定,确定要更新绑定关系吗?', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          centered: true, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          onOk () { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            _this.spinning = true 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            _this.$emit("add", row) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        }) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      }else{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        this.spinning = true 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        this.$emit("add", row) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     pageInit () { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       const _this = this 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -182,24 +231,16 @@ export default { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     setTableH () { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       const tableSearchH = this.$refs.tableSearch.offsetHeight 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      this.tableHeight = window.innerHeight - tableSearchH - 165 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      this.tableHeight = window.innerHeight - tableSearchH - 245 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  mounted () { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    this.pageInit() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   watch: { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     '$store.state.app.winHeight' (newValue, oldValue) { //  窗口变更时,需同时更改表格高度 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       this.setTableH() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-  }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-  mounted () { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    if (!this.$store.state.app.isNewTab) { // 页签刷新时调用 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      this.resetSearchForm() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-  }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-  activated () { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    this.pageInit() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-  }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-  beforeRouteEnter (to, from, next) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    next(vm => {}) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 </script> 
			 |