| 
					
				 | 
			
			
				@@ -7,11 +7,11 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           <a-row :gutter="15"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             <a-col :md="6" :sm="24"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				               <a-form-item label="创建时间"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                <rangeDate :allowClear="false" :hasDisabledAreaTime="false" ref="rangeDate" :value="time" @change="dateChange" /> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                <rangeDate :allowClear="isByCustQuery" :hasDisabledAreaTime="false" ref="rangeDate" :value="time" @change="dateChange" /> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				               </a-form-item> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             </a-col> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             <a-col :md="6" :sm="24"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-              <a-form-item label="客户名称" :label-col="{ span:7 }" :wrapper-col="{ span:17}"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+              <a-form-item label="客户名称" :label-col="{ span:7 }" :wrapper-col="{ span:17}" :required="isByCustQuery"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 <custList ref="custList" @change="custChange"></custList> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				               </a-form-item> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             </a-col> 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -111,6 +111,13 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       <div class="table-operator"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         <a-button type="primary" class="button-error" v-if="$hasPermissions('B_salesNews')" @click="handleAdd(0)">新增(零售)</a-button> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         <a-button type="primary" class="button-warning" v-if="$hasPermissions('B_salesNews')" @click="handleAdd(1)">新增(铺货)</a-button> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        <a-checkbox style="margin-left:10px;" v-model="isByCustQuery" id="sales-byCustQuery">按客户查询</a-checkbox> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        <a-popover placement="right"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          <template slot="content"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            使用此查询时,时间可清空,必须选择一个客户 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          </template> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          <a-icon type="question-circle" /> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        </a-popover> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       </div> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       <a-alert type="info" style="margin-bottom:10px"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         <div slot="message"> 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -242,6 +249,7 @@ export default { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       disabled: false, //  查询、重置按钮是否可操作 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       exportLoading: false, // 导出loading 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       openModal: false, // 选择客户弹框是否显示 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      isByCustQuery: false, // 是否按客户查询 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       time: [ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         getDate.getMonthDays(12).starttime, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         getDate.getMonthDays(12).endtime 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -439,14 +447,22 @@ export default { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       }) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     searchForm () { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      const a = moment(this.queryParam.beginDate) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      const b = moment(this.queryParam.endDate) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      console.log(b.diff(a, 'days'), 365 * 2) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      if (b.diff(a, 'days') > 730) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        this.$message.info('最多只能选择2年的时间区间') 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        return false 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      if (!this.isByCustQuery) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        const a = moment(this.queryParam.beginDate) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        const b = moment(this.queryParam.endDate) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if (b.diff(a, 'days') > 730) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          this.$message.info('最多只能选择2年的时间区间') 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          return false 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        this.$refs.table.refresh(true) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if (this.queryParam.buyerSn) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          this.$refs.table.refresh(true) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          this.$message.info('请选择客户') 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          return false 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      this.$refs.table.refresh(true) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     // 重置 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     resetSearchForm () { 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -556,6 +572,11 @@ export default { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     '$store.state.app.winHeight' (newValue, oldValue) { //  窗口变更时,需同时更改表格高度 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       this.setTableH() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    isByCustQuery (newValue, oldValue) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      if (!newValue) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        this.resetSearchForm() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   activated () { 
			 |