chenrui 3 年之前
父节点
当前提交
ef491ef255
共有 2 个文件被更改,包括 213 次插入382 次删除
  1. 19 0
      src/api/reportData.js
  2. 194 382
      src/views/reportData/priceDifferenceDetailReport/list.vue

+ 19 - 0
src/api/reportData.js

@@ -104,3 +104,22 @@ export const reportSalesReturnDetailExport = (params) => {
     responseType: 'blob'
   })
 }
+//  总部差价明细报表
+export const headRebateDetailReportList = (params) => {
+  const url = `/report/headRebateDetailReport/queryPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+//  总部差价明细报表  合计
+export const headRebateDetailReportCount = (params) => {
+  return axios({
+    url: '/report/headRebateDetailReport/querySum',
+    data: params,
+    method: 'post'
+  })
+}

+ 194 - 382
src/views/reportData/priceDifferenceDetailReport/list.vue

@@ -1,123 +1,131 @@
 <template>
-  <a-card size="small" :bordered="false" class="shortageStatisticsCList-wrap">
-    <!-- 搜索条件 -->
-    <div class="table-page-search-wrapper">
-      <a-form-model
-        id="priceDifferenceDetailReport-form"
-        layout="inline"
-        ref="ruleForm"
-        :model="queryParam"
-        :rules="rules"
-        @keyup.enter.native="$refs.table.refresh(true)">
-        <a-row :gutter="15">
-          <a-col :md="6" :sm="24">
-            <a-form-model-item label="日期" prop="time">
-              <rangeDate ref="rangeDate" :value="queryParam.time" @change="dateChange" />
-            </a-form-model-item>
-          </a-col>
-          <a-col :md="6" :sm="24">
-            <a-form-model-item label="单号">
-              <a-input placeholder="请输入单号" />
-            </a-form-model-item>
-          </a-col>
-          <a-col :md="6" :sm="24">
-            <a-form-model-item label="客户名称">
-              <custList ref="custList" id="shortageStatisticsCList-buyerSn" @change="custChange"></custList>
-            </a-form-model-item>
-          </a-col>
-          <template v-if="advanced">
-            <a-col :md="6" :sm="24">
-              <a-form-model-item label="客户类型">
-                <custList ref="custList" id="shortageStatisticsCList-buyerSn" @change="custChange"></custList>
+  <a-card size="small" :bordered="false" class="priceDifferenceDetailList-wrap">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <!-- 搜索条件 -->
+      <div class="table-page-search-wrapper">
+        <a-form-model
+          id="priceDifferenceDetailList-form"
+          layout="inline"
+          ref="ruleForm"
+          :model="queryParam"
+          :rules="rules"
+          @keyup.enter.native="handleSearch">
+          <a-row :gutter="15">
+            <a-col :md="7" :sm="24">
+              <a-form-model-item label="日期" prop="time">
+                <rangeDate ref="rangeDate" :value="queryParam.time" @change="dateChange" />
               </a-form-model-item>
             </a-col>
-            <a-col :md="6" :sm="24">
-              <a-form-model-item label="品牌类别">
-                <a-select placeholder="选择品牌类别">
-                </a-select>
+            <a-col :md="5" :sm="24">
+              <a-form-model-item label="单号">
+                <a-input id="priceDifferenceDetailList-allocateNo" v-model.trim="queryParam.allocateNo" allowClear placeholder="请输入单号"/>
               </a-form-model-item>
             </a-col>
-            <a-col :md="6" :sm="24">
-              <a-form-model-item label="产品品牌">
-                <ProductBrand id="productInfoList-productBrandSn" v-model="queryParam.brandSn"></ProductBrand>
+            <a-col :md="5" :sm="24">
+              <a-form-model-item label="客户名称">
+                <custList id="priceDifferenceDetailList-custList" ref="custList" @change="custChange"></custList>
               </a-form-model-item>
             </a-col>
-            <a-col :md="6" :sm="24">
-              <a-form-model-item label="二级品类">
-                <ProductType id="productInfoList-productType" v-model="productType" @change="changeProductType"></ProductType>
-              </a-form-model-item>
+            <template v-if="advanced">
+              <a-col :md="6" :sm="24">
+                <a-form-model-item label="客户级别">
+                  <v-select
+                    v-model="queryParam.dealer.dealerLevel"
+                    ref="dealerLevel"
+                    id="priceDifferenceDetailList-dealerLevel"
+                    code="DEALER_LEVEL"
+                    placeholder="请选择客户级别"
+                    allowClear></v-select>
+                </a-form-model-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-model-item label="品牌分类">
+                  <v-select code="BRAND_TYPE" id="priceDifferenceDetailList-productBrandTypeSn" v-model="queryParam.productBrandTypeSn" allowClear placeholder="请选择品牌分类"></v-select>
+                </a-form-model-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-model-item label="产品品牌">
+                  <ProductBrand id="priceDifferenceDetailList-productBrandSn" v-model="queryParam.brandSn"></ProductBrand>
+                </a-form-model-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-model-item label="产品分类">
+                  <ProductType id="priceDifferenceDetailList-productType" v-model="productType" @change="changeProductType"></ProductType>
+                </a-form-model-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-model-item label="所在区域">
+                  <subarea id="priceDifferenceDetailList-subareaSn" v-model="queryParam.dealer.subareaSn"></subarea>
+                </a-form-model-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-model-item label="省级区域" prop="provinceSn">
+                  <a-select id="priceDifferenceDetailList-provinceSn" allowClear @change="getCityList" v-model="queryParam.provinceSn" placeholder="请选择省">
+                    <a-select-option v-for="item in addrProvinceList" :value="item.areaSn" :key="item.areaSn + 'a'">{{ item.name }}</a-select-option>
+                  </a-select>
+                </a-form-model-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-model-item label="类型">
+                  <a-select id="priceDifferenceDetailList-bizType" allowClear v-model="queryParam.bizType" placeholder="请选择类型">
+                    <a-select-option v-for="item in bizTypeList" :value="item.value" :key="item.value">{{ item.name }}</a-select-option>
+                  </a-select>
+                </a-form-model-item>
+              </a-col>
+            </template>
+            <a-col :md="7" :sm="24">
+              <a-button
+                style="margin-bottom: 18px;"
+                type="primary"
+                class="button-warning"
+                size="small"
+                @click="handleStock"
+                id="priceDifferenceDetailList-stockDate">盘点区间日期</a-button>
+              <a-button style="margin: 0 0 18px 8px" type="primary" @click="handleSearch" :disabled="disabled" id="priceDifferenceDetailList-refresh">查询</a-button>
+              <a-button style="margin: 0 0 18px 8px" @click="resetSearchForm" :disabled="disabled" id="priceDifferenceDetailList-reset">重置</a-button>
+              <a @click="advanced=!advanced" style="margin-left: 8px">
+                {{ advanced ? '收起' : '展开' }}
+                <a-icon :type="advanced ? 'up' : 'down'"/>
+              </a>
             </a-col>
-            <a-col :md="6" :sm="24">
-              <a-form-model-item label="所在区域">
-                <subarea id="shortageStatisticsCList-subarea" v-model="queryParam.subareaSn"></subarea>
-              </a-form-model-item>
+          </a-row>
+        </a-form-model>
+      </div>
+      <!-- 列表 -->
+      <s-table
+        class="sTable"
+        ref="table"
+        size="small"
+        :rowKey="(record) => record.id"
+        :columns="columns"
+        :data="loadData"
+        :scroll="{ x: 2800, y: tableHeight }"
+        bordered>
+        <template slot="footer">
+          <a-row :gutter="15">
+            <a-col :md="4" :sm="24">
+              分公司金额:{{ (totalData && (totalData.totalQty || totalData.totalQty==0)) ? totalData.totalQty : '--' }}
             </a-col>
-            <a-col :md="6" :sm="24">
-              <a-form-model-item label="省级区域" prop="provinceSn">
-                <a-select id="supplierInfoEdit-provinceSn" @change="getCityList" v-model="queryParam.provinceSn" placeholder="请选择省">
-                  <a-select-option v-for="item in addrProvinceList" :value="item.areaSn" :key="item.areaSn + 'a'">{{ item.name }}</a-select-option>
-                </a-select>
-              </a-form-model-item>
+            <a-col :md="4" :sm="24">
+              加盟商金额:{{ (totalData && (totalData.totalQty || totalData.totalQty==0)) ? totalData.totalQty : '--' }}
             </a-col>
-            <a-col :md="6" :sm="24">
-              <a-form-model-item label="类型">
-                <subarea id="shortageStatisticsCList-subarea" v-model="queryParam.subareaSn"></subarea>
-              </a-form-model-item>
+            <a-col :md="4" :sm="24">
+              特约加盟店金额:{{ (totalData && (totalData.totalQty || totalData.totalQty==0)) ? totalData.totalQty : '--' }}
             </a-col>
-            <a-col :md="6" :sm="24">
-              <a-form-model-item label="">
-                <a-checkbox>
-                  盘点区间日期
-                </a-checkbox>
-              </a-form-model-item>
+            <a-col :md="4" :sm="24">
+              直接差价金额:{{ (totalData && (totalData.totalQty || totalData.totalQty==0)) ? totalData.totalQty : '--' }}
+            </a-col>
+            <a-col :md="4" :sm="24">
+              间接差价金额:{{ (totalData && (totalData.totalQty || totalData.totalQty==0)) ? totalData.totalQty : '--' }}
             </a-col>
-          </template>
-          <a-col :md="6" :sm="24">
-            <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="shortageStatisticsCList-refresh">查询</a-button>
-            <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="shortageStatisticsCList-reset">重置</a-button>
-            <a @click="advanced=!advanced" style="margin-left: 8px">
-              {{ advanced ? '收起' : '展开' }}
-              <a-icon :type="advanced ? 'up' : 'down'"/>
-            </a>
-          </a-col>
-        </a-row>
-      </a-form-model>
-    </div>
-    <!-- 列表 -->
-    <s-table
-      class="sTable"
-      ref="table"
-      size="small"
-      :rowKey="(record) => record.id"
-      :columns="columns"
-      :data="loadData"
-      :scroll="{ x: 2250, y: tableHeight }"
-      bordered>
-      <template slot="footer" slot-scope="currentPageData">
-        <a-row :gutter="15">
-          <a-col :md="4" :sm="24">
-            分公司金额:11175.40
-          </a-col>
-          <a-col :md="4" :sm="24">
-            加盟商金额:12182.40
-          </a-col>
-          <a-col :md="4" :sm="24">
-            特约加盟店金额:--
-          </a-col>
-          <a-col :md="4" :sm="24">
-            直接差价金额:1007.00
-          </a-col>
-          <a-col :md="4" :sm="24">
-            间接差价金额:0
-          </a-col>
-        </a-row>
-      </template>
-    </s-table>
+          </a-row>
+        </template>
+      </s-table>
+    </a-spin>
   </a-card>
 </template>
 
 <script>
-import moment from 'moment'
 import getDate from '@/libs/getDate.js'
 import { STable, VSelect } from '@/components'
 import rangeDate from '@/views/common/rangeDate.vue'
@@ -126,13 +134,13 @@ import subarea from '@/views/common/subarea.js'
 import { getArea } from '@/api/data'
 import ProductBrand from '@/views/common/productBrand.js'
 import ProductType from '@/views/common/productType.js'
-// import { oosBuyerList, oosBuyerDetailCount, oosBuyerDetailPageCount, oosDetailExport } from '@/api/oos'
+import { headRebateDetailReportList, headRebateDetailReportCount } from '@/api/reportData'
 export default {
   components: { STable, VSelect, custList, subarea, rangeDate, ProductBrand, ProductType },
   data () {
     return {
+      spinning: false,
       advanced: false, // 高级搜索 展开/关闭
-      tableHeight: 0,
       queryParam: { //  查询条件
         time: [
           getDate.getCurrMonthDays().starttime,
@@ -140,237 +148,108 @@ export default {
         ],
         beginDate: getDate.getCurrMonthDays().starttime,
         endDate: getDate.getCurrMonthDays().endtime,
-        buyerSn: undefined,
-        subareaSn: undefined, //  区域
+        dealer: {
+          dealerLevel: undefined,
+          subareaSn: undefined //  区域
+        },
+        dealerSn: undefined,
         provinceSn: undefined,
-        citySn: undefined,
-        districtSn: undefined
+        productBrandTypeSn: undefined,
+        productBrandSn: undefined, //  产品品牌
+        productTypeSn1: '', //  产品一级分类
+        productTypeSn2: '', //  产品二级分类
+        productTypeSn3: '', //  产品三级分类
+        dealerLevel: undefined,
+        subareaSn: undefined,
+        dealerProvinceSn: undefined
+      },
+      rules: {
+        'time': [{ required: true, message: '请选择日期', trigger: 'change' }]
       },
-	  rules: {
-	    'time': [{ required: true, message: '请选择销售日期', trigger: 'change' }]
-	  },
       disabled: false, //  查询、重置按钮是否可操作
-      exportLoading: false, // 导出loading
       addrProvinceList: [], //  省下拉
-      addrCityList: [], //  市下拉
-      addrDistrictList: [], //  区下拉
       columns: [
-        { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
-        { title: '区域',
-          dataIndex: 'area',
-          width: 150,
-          align: 'center',
-          customRender: function (text) { return text || '--' }
-        },
-        { title: '订单号',
-          dataIndex: 'orderNo',
-          width: 150,
-          align: 'center',
-          customRender: function (text) { return text || '--' }
-        },
-        { title: '日期',
-          dataIndex: 'creatDate',
-          width: 200,
-          align: 'center',
-          customRender: function (text) { return text || '--' }
-        },
-        { title: '省份',
-          dataIndex: 'provinceName',
-          width: 100,
-          align: 'center',
-          customRender: function (text) { return text || '--' }
-        },
-        { title: '直接绑定客户名称',
-          dataIndex: 'zjCustName',
-          width: 200,
-          align: 'center',
-          customRender: function (text) { return text || '--' }
-        },
-        { title: '间接绑定客户名称',
-          dataIndex: 'djCustName',
-          width: 200,
-          align: 'center',
-          customRender: function (text) { return text || '--' }
-        },
-        { title: '客户名称',
-          dataIndex: 'custName',
-          width: 200,
-          align: 'center',
-          customRender: function (text) { return text || '--' }
-        },
-        { title: '客户类型',
-          dataIndex: 'custType',
-          width: 150,
-          align: 'center',
-          customRender: function (text) { return text || '--' }
-        },
-        { title: '品牌',
-          dataIndex: 'brand',
-          width: 100,
-          align: 'center',
-          customRender: function (text) { return text || '--' }
-        },
-        { title: '二级分类',
-          dataIndex: 'proCls',
-          width: 100,
-          align: 'center',
-          customRender: function (text) { return text || '--' }
-        },
-        { title: '数量',
-          dataIndex: 'nums',
-          width: 100,
-          align: 'center',
-          customRender: function (text) { return text || '--' }
-        },
-        { title: '分公司金额', width: 100, dataIndex: 'p1', align: 'center', customRender: function (text) { return text ? ('¥' + text) : '--' } },
-        { title: '加盟商金额', width: 100, dataIndex: 'p2', align: 'center', customRender: function (text) { return text ? ('¥' + text) : '--' } },
-        { title: '特约加盟商金额', width: 100, dataIndex: 'p3', align: 'center', customRender: function (text) { return text ? ('¥' + text) : '--' } },
-        { title: '直接差价', width: 100, dataIndex: 'p4', align: 'center', customRender: function (text) { return text ? ('¥' + text) : '--' } },
-        { title: '间接差价', width: 100, dataIndex: 'p5', align: 'center', customRender: function (text) { return text ? ('¥' + text) : '--' } },
-        { title: '类型', width: 100, dataIndex: 'type', align: 'center', customRender: function (text) { return text || '--' } }
+        { title: '序号', dataIndex: 'no', width: 80, align: 'center', fixed: 'left' },
+        { title: '区域', dataIndex: 'dealer.subareaNameSet', width: 220, align: 'center', customRender: function (text) { return (text && text.length > 0) ? text.join('/') : '--' } },
+        { title: '订单号', dataIndex: 'allocateNo', width: 200, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '日期', dataIndex: 'allocateDate', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '省份', dataIndex: 'dealer.provinceName', width: 200, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '直接绑定客户名称', dataIndex: 'directDealerName', width: 200, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '间接绑定客户名称', dataIndex: 'indirectDealerName', width: 200, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '客户名称', dataIndex: 'dealer.dealerName', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '客户级别', dataIndex: 'dealer.dealerLevelDictValue', width: 200, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '品牌', dataIndex: 'productBrandName', width: 200, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '二级分类', dataIndex: 'productTypeName2', width: 200, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '数量', dataIndex: 'qty', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '分公司金额', dataIndex: 'price', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '加盟商金额', dataIndex: 'price', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '特约加盟店金额', dataIndex: 'price', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '直接差价', dataIndex: 'price', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '间接差价', dataIndex: 'price', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '类型', dataIndex: 'allocateTypeName', width: 100, align: 'center', customRender: function (text) { return text || '--' } }
       ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
-        // this.disabled = true
-        // if (this.tableHeight == 0) {
-        //   this.tableHeight = window.innerHeight - 380
-        // }
-        // const paramsPage = Object.assign(this.queryParam, { pageNo: parameter.pageNo, pageSize: parameter.pageSize }) //  有分页
-        // const params = Object.assign(parameter, this.queryParam) //  无分页
-        // return oosBuyerList(params).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: [
-              {
-                area: 'A区',
-                orderNo: 'XS2106210000118',
-                creatDate: '2021/6/21 19:16:18',
-                provinceName: '浙江省',
-                zjCustName: '剪冠汽配杭州金球店',
-                djCustName: '',
-                custName: '剪冠汽配丽水龙泉店',
-                custType: '市级加盟商',
-                brand: '箭牌',
-                proCls: '滤清器',
-                nums: '100',
-                p1: '700.00',
-                p2: '780.00',
-                p3: '',
-                p4: '80.00',
-                p5: '0.00',
-                type: '采购差价'
-              },
-              {
-                area: 'B区/04区',
-                orderNo: 'XS2106210000168',
-                creatDate: '2021/6/21 16:23:06',
-                provinceName: '广西区',
-                zjCustName: '剪冠汽配南宁兴宁店',
-                djCustName: '',
-                custName: '剪冠汽配梧州万秀店',
-                custType: '市级加盟商',
-                brand: '冠牌',
-                proCls: '滤清器',
-                nums: '44',
-                p1: '362.00',
-                p2: '406.00',
-                p3: '',
-                p4: '44.00',
-                p5: '0.00',
-                type: '采购差价'
-              },
-              {
-                area: 'B区/04区',
-                orderNo: 'XS2106210000168',
-                creatDate: '2021/6/21 16:23:06',
-                provinceName: '广西区',
-                zjCustName: '剪冠汽配南宁兴宁店',
-                djCustName: '',
-                custName: '剪冠汽配梧州万秀店',
-                custType: '市级加盟商',
-                brand: '汇箭',
-                proCls: '蓄电池',
-                nums: '19',
-                p1: '3942.40',
-                p2: '4126.40',
-                p3: '',
-                p4: '184.00',
-                p5: '0.00',
-                type: '采购差价'
-              },
-              {
-                area: 'B区/04区',
-                orderNo: 'XS2106210000168',
-                creatDate: '2021/6/21 16:23:06',
-                provinceName: '广西区',
-                zjCustName: '剪冠汽配南宁兴宁店',
-                djCustName: '',
-                custName: '剪冠汽配梧州万秀店',
-                custType: '市级加盟商',
-                brand: '箭牌',
-                proCls: '滤清器',
-                nums: '186',
-                p1: '1691.00',
-                p2: '1886.00',
-                p3: '',
-                p4: '195.00',
-                p5: '0.00',
-                type: '采购差价'
-              },
-              {
-                area: 'D区/06区',
-                orderNo: 'XS2106210000045',
-                creatDate: '2021/6/21 16:00:37',
-                provinceName: '内蒙古',
-                zjCustName: '剪冠汽配锡林浩特快驰店',
-                djCustName: '',
-                custName: '剪冠汽配锡林浩特快驰店1',
-                custType: '市级加盟商',
-                brand: '箭牌',
-                proCls: '滤清器',
-                nums: '525',
-                p1: '4480.00',
-                p2: '4984.00',
-                p3: '',
-                p4: '504.00',
-                p5: '0.00',
-                type: '采购差价'
-              }
-            ],
-            count: 1
-          }
+        this.disabled = true
+        const params = Object.assign(parameter, this.queryParam)
+        delete params.time
+        this.spinning = true
+        return headRebateDetailReportList(params).then(res => {
+          // 总计
+          this.getCount(params)
+          const data = res.data
+          const no = (data.pageNo - 1) * data.pageSize
           for (var i = 0; i < data.list.length; i++) {
-            data.list[i].no = i + 1
+            data.list[i].no = no + i + 1
           }
-          _this.disabled = false
-          resolve(data)
+          this.disabled = false
+          this.spinning = false
+          return data
         })
       },
       productType: [],
-      productTotal: null,
-      currentTotal: null
+      bizTypeList: [
+        { value: 'SALES', name: '采购差价' },
+        { value: 'SALES_RETURN', name: '退货差价' }
+      ],
+      totalData: null
     }
   },
   methods: {
+    // 盘点库存日期
+    handleStock () {
+      this.$message.info('无盘点区间的起始/终止时间,请自行选择日期区间查询!')
+    },
     //  创建时间  change
     dateChange (date) {
       this.queryParam.time = date
       this.queryParam.beginDate = date[0] || ''
       this.queryParam.endDate = date[1] || ''
     },
-    custChange (obj) {
-      this.queryParam.buyerSn = obj.key
+    // 合计
+    getCount (params) {
+      headRebateDetailReportCount(params).then(res => {
+        if (res.status == 200) {
+          this.totalData = res.data
+        } else {
+          this.totalData = null
+        }
+      })
+    },
+    //  查询
+    handleSearch () {
+      const _this = this
+      // this.$refs.ruleForm.validate(valid => {
+      //   if (valid) {
+      _this.$refs.table.refresh(true)
+      //   } else {
+      //     console.log('error submit!!')
+      //     return false
+      //   }
+      // })
+    },
+    custChange (val) {
+      this.queryParam.dealerSn = val.key
     },
     //  产品分类  change
     changeProductType (val, opt) {
@@ -378,41 +257,6 @@ export default {
       this.queryParam.productTypeSn2 = val[1] ? val[1] : ''
       this.queryParam.productTypeSn3 = val[2] ? val[2] : ''
     },
-    // 获取城市列表
-    getCityList (val) {
-      this.addrCityList = []
-      this.addrDistrictList = []
-      this.queryParam.citySn = undefined
-      this.queryParam.districtSn = undefined
-      this.queryParam.address = ''
-      if (val) {
-        this.getArea('city', val)
-        this.queryParam.provinceName = this.addrProvinceList.find(item => item.areaSn == val).name
-      } else {
-        this.queryParam.provinceName = ''
-      }
-    },
-    // 获取区县列表
-    getAreaList (val) {
-      this.addrDistrictList = []
-      this.queryParam.districtSn = undefined
-      this.queryParam.address = ''
-      if (val) {
-        this.getArea('district', val)
-        this.queryParam.cityName = this.addrCityList.find(item => item.areaSn == val).name
-      } else {
-        this.queryParam.cityName = ''
-      }
-    },
-    // 区县变更
-    areaCharged (val) {
-      this.queryParam.address = ''
-      if (val) {
-        this.queryParam.districtName = this.addrDistrictList.find(item => item.areaSn == val).name
-      } else {
-        this.queryParam.districtName = ''
-      }
-    },
     //  省/市/区
     getArea (leve, sn) {
       let params
@@ -460,38 +304,6 @@ export default {
       this.queryParam.salesBillNo = ''
       this.productType = []
       this.$refs.table.refresh(true)
-    },
-    // 详情
-    handleDetail (row) {
-      this.$router.push({ name: 'salesDetail', params: { sn: row.salesBillSn } })
-    },
-    //  导出
-    handleExport () {
-      const params = this.queryParam
-      if (this.time && this.time.length) {
-        params.beginDate = moment(this.time[0]).format('YYYY-MM-DD')
-        params.endDate = moment(this.time[1]).format('YYYY-MM-DD')
-      } else {
-        params.beginDate = ''
-        params.endDate = ''
-      }
-      this.exportLoading = true
-      oosDetailExport(params).then(res => {
-        this.exportLoading = false
-        this.download(res)
-      })
-    },
-    download (data) {
-      if (!data) { return }
-      const url = window.URL.createObjectURL(new Blob([data]))
-      const link = document.createElement('a')
-      link.style.display = 'none'
-      link.href = url
-      const a = moment().format('YYYYMMDDHHmmss')
-      const fname = '缺货统计(按客户)' + a
-      link.setAttribute('download', fname + '.xlsx')
-      document.body.appendChild(link)
-      link.click()
     }
   },
   beforeRouteEnter (to, from, next) {