Bläddra i källkod

对接销售退货报表

chenrui 3 år sedan
förälder
incheckning
439ef0f0da

+ 19 - 0
src/api/reportData.js

@@ -33,3 +33,22 @@ export const salesReportReturnRebateList = (params) => {
     method: 'post'
   })
 }
+//  销售退货单报表
+export const reportSalesReturnList = (params) => {
+  const url = `/report/reportSalesReturn/queryPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+//  销售退货单报表  合计
+export const reportSalesReturnCount = (params) => {
+  return axios({
+    url: '/report/reportSalesReturn/queryCount',
+    data: params,
+    method: 'post'
+  })
+}

+ 14 - 7
src/views/reportData/allocationOrderTotal/list.vue

@@ -91,6 +91,7 @@
 </template>
 
 <script>
+import getDate from '@/libs/getDate.js'
 import { STable, VSelect } from '@/components'
 import rangeDate from '@/views/common/rangeDate.vue'
 import { allocateTypeAllList } from '@/api/allocateType'
@@ -103,9 +104,12 @@ export default {
       spinning: false,
       advanced: false, // 高级搜索 展开/关闭
       queryParam: { //  查询条件
-        time: [],
-        beginDate: '',
-        endDate: '',
+        time: [
+          getDate.getCurrMonthDays().starttime,
+          getDate.getCurrMonthDays().endtime
+        ],
+        beginDate: getDate.getCurrMonthDays().starttime,
+        endDate: getDate.getCurrMonthDays().endtime,
         allocateNo: '',
         creatorId: undefined,
         allocateCategory: undefined,
@@ -192,10 +196,13 @@ export default {
     },
     //  重置
     resetSearchForm () {
-      this.$refs.rangeDate.resetDate()
-      this.queryParam.time = []
-      this.queryParam.beginDate = ''
-      this.queryParam.endDate = ''
+      this.queryParam.time = [
+        getDate.getCurrMonthDays().starttime,
+        getDate.getCurrMonthDays().endtime
+      ]
+      this.$refs.rangeDate.resetDate(this.queryParam.time)
+      this.queryParam.beginDate = getDate.getCurrMonthDays().starttime
+      this.queryParam.endDate = getDate.getCurrMonthDays().endtime
       this.queryParam.allocateNo = ''
       this.queryParam.creatorId = undefined
       this.queryParam.allocateCategory = undefined

+ 271 - 164
src/views/reportData/salesReturnsReport/list.vue

@@ -1,211 +1,318 @@
 <template>
   <a-card size="small" :bordered="false" class="provinceTypeSalesDetailsList-wrap">
-    <!-- 搜索条件 -->
-    <div class="table-page-search-wrapper">
-      <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
-        <a-row :gutter="15">
-          <a-col :md="6" :sm="24">
-            <a-form-item label="退货完成日期">
-              <rangeDate ref="rangeDate" @change="dateChange" />
-            </a-form-item>
-          </a-col>
-          <a-col :md="6" :sm="24">
-            <a-form-item label="退货单号">
-              <a-input id="bulkWarehousingOrderList-productCode" v-model.trim="queryParam.productCode" allowClear placeholder="请输入销售单号"/>
-            </a-form-item>
-          </a-col>
-          <a-col :md="6" :sm="24">
-            <a-form-item label="产品编码">
-              <a-input id="productPricingList-queryWord" v-model.trim="queryParam.queryWord" allowClear placeholder="请输入产品编码"/>
-            </a-form-item>
-          </a-col>
-          <template v-if="advanced">
-            <a-col :md="6" :sm="24">
-              <a-form-item label="区域">
-                <a-select id="provinceTypeSalesDetailsList-allocateTypeSn" v-model="queryParam.allocateTypeSn" placeholder="请选择区域" allowClear >
-                  <a-select-option v-for="item in allocateTypeList" :key="item.allocateTypeSn" :value="item.allocateTypeSn">{{ item.name }}</a-select-option>
-                </a-select>
-              </a-form-item>
+    <a-spin :spinning="spinning" tip="Loading...">
+      <!-- 搜索条件 -->
+      <div class="table-page-search-wrapper">
+        <a-form-model
+          id="salesSlipReportList-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-item label="省份">
-                <a-select id="provinceTypeSalesDetailsList-state" v-model="queryParam.state" placeholder="请选择省份" allowClear >
-                  <a-select-option v-for="item in allocateTypeList" :key="item.allocateTypeSn" :value="item.allocateTypeSn">{{ item.name }}</a-select-option>
-                </a-select>
-              </a-form-item>
+            <a-col :md="5" :sm="24">
+              <a-form-model-item label="退货单号">
+                <a-input id="bulkWarehousingOrderList-salesReturnBillNo" v-model.trim="queryParam.salesReturnBillNo" allowClear placeholder="请输入退货单号"/>
+              </a-form-model-item>
             </a-col>
-            <a-col :md="6" :sm="24">
-              <a-form-item label="客户名称">
-                <a-input id="productPricingList-name" v-model.trim="queryParam.name" allowClear placeholder="请输入客户名称"/>
-              </a-form-item>
+            <a-col :md="5" :sm="24">
+              <a-form-model-item label="所在区域">
+                <subarea id="productPricingList-subareaSn" v-model="queryParam.subareaSn"></subarea>
+              </a-form-model-item>
             </a-col>
-            <a-col :md="6" :sm="24">
-              <a-form-item label="客户级别">
-                <a-select
-                  placeholder="请选择"
-                  id="productPricingList-productBrandSn"
-                  allowClear
-                  v-model="queryParam.productBrandSn">
-                  <a-select-option v-for="item in allocateTypeList" :key="item.brandSn" :value="item.brandSn">{{ item.brandName }}</a-select-option>
-                </a-select>
-              </a-form-item>
+            <template v-if="advanced">
+              <a-col :md="6" :sm="24">
+                <a-form-model-item label="客户名称">
+                  <custList id="salesSlipReportList-dealerName" ref="custList" @change="custChange"></custList>
+                </a-form-model-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-model-item label="客户类型">
+                  <v-select
+                    v-model="queryParam.dealerLevel"
+                    ref="dealerLevel"
+                    id="salesSlipReportList-dealerLevel"
+                    code="DEALER_LEVEL"
+                    placeholder="请选择客户类型"
+                    allowClear></v-select>
+                </a-form-model-item>
+              </a-col>
+              <a-col :md="12" :sm="24">
+                <a-row>
+                  <a-form-model-item label="地区">
+                    <a-col span="7">
+                      <a-form-model-item prop="dealerProvinceSn" style="margin: 0;">
+                        <a-select v-model="queryParam.dealerProvinceSn" allowClear @change="getCityList" placeholder="请选择省">
+                          <a-select-option v-for="item in addrProvinceList" :value="item.id" :key="item.id + 'a'">{{ item.name }}</a-select-option>
+                        </a-select>
+                      </a-form-model-item>
+                    </a-col>
+                    <a-col span="7" offset="1">
+                      <a-form-model-item prop="dealerCitySn" style="margin: 0;">
+                        <a-select v-model="queryParam.dealerCitySn" allowClear @change="getAreaList" placeholder="请选择市">
+                          <a-select-option v-for="item in addrCityList" :value="item.id" :key="item.id + 'b'">{{ item.name }}</a-select-option>
+                        </a-select>
+                      </a-form-model-item>
+                    </a-col>
+                    <a-col span="7" offset="1">
+                      <a-form-model-item prop="dealerCountySn" style="margin: 0;">
+                        <a-select v-model="queryParam.dealerCountySn" allowClear placeholder="请选择区/县">
+                          <a-select-option v-for="item in addrDistrictList" :value="item.id" :key="item.id + 'c'">{{ item.name }}</a-select-option>
+                        </a-select>
+                      </a-form-model-item>
+                    </a-col>
+                  </a-form-model-item>
+                </a-row>
+              </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="productPricingList-stockDate">盘点区间日期</a-button>
+              <a-button style="margin: 0 0 18px 8px" type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="productPricingList-refresh">查询</a-button>
+              <a-button style="margin: 0 0 18px 8px" @click="resetSearchForm" :disabled="disabled" id="productPricingList-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-item label="盘点区间日期">
-                <a-checkbox @change="onChange"></a-checkbox>
-              </a-form-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: 2510 }"
+        :defaultLoadData="false"
+        bordered>
+        <template slot="footer">
+          <a-row :gutter="15">
+            <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 style="margin-bottom: 18px;" type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="productPricingList-refresh">查询</a-button>
-            <a-button style="margin: 0 0 18px 8px" @click="resetSearchForm" :disabled="disabled" id="productPricingList-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>
-    </div>
-    <!-- 列表 -->
-    <s-table
-      class="sTable"
-      ref="table"
-      size="small"
-      :rowKey="(record) => record.id"
-      :columns="columns"
-      :data="loadData"
-      :scroll="{ x: 2380 }"
-      bordered>
-      <template slot="footer" slot-scope="currentPageData">
-        <a-row :gutter="15">
-          <a-col :md="4" :sm="24">
-            总数量:130
-          </a-col>
-          <a-col :md="4" :sm="24">
-            开单退货金额:1688.50
-          </a-col>
-          <a-col :md="4" :sm="24">
-            实售退货金额:1476.50
-          </a-col>
-          <a-col :md="4" :sm="24">
-            经销商金额:1688.50
-          </a-col>
-          <a-col :md="4" :sm="24">
-            服务中心金额:55.50
-          </a-col>
-          <a-col :md="4" :sm="24">
-            特约加盟店金额:1856.00
-          </a-col>
-        </a-row>
-      </template>
-    </s-table>
+            <a-col :md="4" :sm="24">
+              开单退货金额:{{ (totalData && (totalData.totalAmount || totalData.totalAmount==0)) ? totalData.totalAmount : '--' }}
+            </a-col>
+            <a-col :md="4" :sm="24">
+              实售退货金额:{{ (totalData && (totalData.totalRealAmount || totalData.totalRealAmount==0)) ? totalData.totalRealAmount : '--' }}
+            </a-col>
+            <a-col :md="4" :sm="24">
+              经销商金额:{{ (totalData && (totalData.totalWholesalePrice1 || totalData.totalWholesalePrice1==0)) ? totalData.totalWholesalePrice1 : '--' }}
+            </a-col>
+            <a-col :md="4" :sm="24">
+              服务中心金额:{{ (totalData && (totalData.totalWholesalePrice2 || totalData.totalWholesalePrice2==0)) ? totalData.totalWholesalePrice2 : '--' }}
+            </a-col>
+            <a-col :md="4" :sm="24">
+              特约加盟店金额:{{ (totalData && (totalData.totalWholesalePrice3 || totalData.totalWholesalePrice3==0)) ? totalData.totalWholesalePrice3 : '--' }}
+            </a-col>
+          </a-row>
+        </template>
+      </s-table>
+    </a-spin>
   </a-card>
 </template>
 
 <script>
+import getDate from '@/libs/getDate.js'
 import { STable, VSelect } from '@/components'
-import reportData from '@/libs/reportData'
 import rangeDate from '@/views/common/rangeDate.vue'
-// import { allocateBillList, allocateBillDel, allocateBillAudit, allocateBillExport } from '@/api/allocateBill'
-// import { allocateTypeAllList } from '@/api/allocateType'
+import subarea from '@/views/common/subarea.js'
+import custList from '@/views/common/custList.vue'
+import { getArea } from '@/api/data'
+import { reportSalesReturnList, reportSalesReturnCount } from '@/api/reportData'
 export default {
-  components: { STable, VSelect, rangeDate },
+  components: { STable, VSelect, rangeDate, subarea, custList },
   data () {
     return {
+      spinning: false,
       advanced: false, // 高级搜索 展开/关闭
       tableHeight: 0,
       queryParam: { //  查询条件
-        beginDate: '',
-        endDate: '',
-        targetName: '', //  调往对象
-        allocateTypeSn: undefined, //  调拨类型
-        state: undefined, //  业务状态
-        allocateNo: '' //  调拨单号
+        time: [
+          getDate.getCurrMonthDays().starttime,
+          getDate.getCurrMonthDays().endtime
+        ],
+        beginDate: getDate.getCurrMonthDays().starttime,
+        endDate: getDate.getCurrMonthDays().endtime,
+        salesReturnBillNo: '',
+        subareaSn: undefined,
+        dealerSn: '',
+        dealerLevel: undefined,
+        dealerProvinceSn: undefined,
+        dealerCitySn: undefined,
+        dealerCountySn: undefined
+      },
+      rules: {
+        'time': [{ required: true, message: '请选择退货完成日期', trigger: 'change' }]
       },
       disabled: false, //  查询、重置按钮是否可操作
-      exportLoading: false,
-      checkVal: '',
-      reportData: reportData.salesReturnsReportList,
       columns: [
         { title: '序号', dataIndex: 'no', width: 80, align: 'center', fixed: 'left' },
-        { title: '退货单号', dataIndex: 'data1', width: 200, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '退货完成日期', dataIndex: 'data2', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '客户名称', dataIndex: 'data3', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '客户类型', dataIndex: 'data4', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '直接绑定客户类型', dataIndex: 'data5', width: 200, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '间接绑定客户类型', dataIndex: 'data6', width: 200, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '退货数量', dataIndex: 'data7', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '开单退货金额', dataIndex: 'data8', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '经销商价', dataIndex: 'data9', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '服务中心价', dataIndex: 'data10', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '特约加盟价', dataIndex: 'data11', width: 120, align: 'center', ellipsis: true, customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '实售退货价', dataIndex: 'data12', width: 120, align: 'center', ellipsis: true, customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '直接差价', dataIndex: 'data13', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '间接差价', dataIndex: 'data14', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '坏件数量', dataIndex: 'data15', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '操作员', dataIndex: 'data16', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
+        { title: '退货单号', dataIndex: 'salesReturnBillNo', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '退货完成日期', dataIndex: 'salesReturnDate', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '客户名称', dataIndex: 'dealerName', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '客户类型', dataIndex: 'dealerLevelDictValue', width: 200, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '直接绑定客户名称', dataIndex: 'directDealerName', width: 200, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '间接绑定客户名称', dataIndex: 'indirectDealerName', width: 200, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '退货数量', dataIndex: 'totalQty', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '开单退货金额', dataIndex: 'totalAmount', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '经销商价', dataIndex: 'totalWholesalePrice1', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '服务中心价', dataIndex: 'totalWholesalePrice2', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '特约加盟店价', dataIndex: 'totalWholesalePrice3', width: 120, align: 'center', ellipsis: true, customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '实售退货金额', dataIndex: 'totalRealAmount', width: 120, align: 'center', ellipsis: true, customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '直接差价', dataIndex: 'totalDirectRebate', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '间接差价', dataIndex: 'totalIndirectRebate', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '坏件数量', dataIndex: 'totalBadQty', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '操作员', dataIndex: 'operatorName', width: 150, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true }
       ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
-        // return allocateBillList(Object.assign(parameter, this.queryParam)).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: reportData.salesReturnsReportList,
-            count: 10
-          }
+        this.spinning = true
+        const params = Object.assign(parameter, this.queryParam)
+        delete params.time
+        return reportSalesReturnList(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
         })
       },
-      allocateTypeList: [], //  调拨类型
-      openModal: false //  新增编辑  弹框
+      totalData: null,
+      addrProvinceList: [], //  省下拉
+      addrCityList: [], //  市下拉
+      addrDistrictList: [] //  区下拉
     }
   },
   methods: {
-    handleFooterShow (currentPageData) {
-      console.log(currentPageData, '[=currentPageData]')
+    // 盘点库存日期
+    handleStock () {
+      this.$message.info('无盘点区间的起始/终止时间,请自行选择日期区间查询!')
+    },
+    // 总计
+    getCount (params) {
+      reportSalesReturnCount(params).then(res => {
+        if (res.status == 200 && res.data) {
+          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 {
+          return false
+        }
+      })
     },
     //  创建时间  change
     dateChange (date) {
-      this.queryParam.beginDate = date[0]
-      this.queryParam.endDate = date[1]
+      if (date.length) {
+        if (date[0] == '' && date[1] == '') {
+          this.resetSearchForm()
+        } else {
+          this.queryParam.time = date
+        }
+      }
+      this.queryParam.beginDate = date[0] || ''
+      this.queryParam.endDate = date[1] || ''
     },
-    // 选择盘点日期
-    onChange (e) {
-      console.log(e)
-      // this.checkVal
+    custChange (val) {
+      this.queryParam.dealerSn = val.key
     },
-
     //  重置
     resetSearchForm () {
-      this.$refs.rangeDate.resetDate()
-      this.queryParam.beginDate = ''
-      this.queryParam.endDate = ''
-      this.queryParam.targetName = ''
-      this.queryParam.allocateTypeSn = undefined
-      this.queryParam.state = undefined
-      this.queryParam.allocateNo = ''
-      this.$refs.table.refresh(true)
+      this.queryParam.time = [
+        getDate.getCurrMonthDays().starttime,
+        getDate.getCurrMonthDays().endtime
+      ]
+      this.$refs.rangeDate.resetDate(this.queryParam.time)
+      this.queryParam.beginDate = getDate.getCurrMonthDays().starttime
+      this.queryParam.endDate = getDate.getCurrMonthDays().endtime
+      this.queryParam.salesReturnBillNo = ''
+      this.queryParam.subareaSn = undefined
+      this.queryParam.dealerSn = undefined
+      this.queryParam.dealerLevel = undefined
+      this.queryParam.dealerProvinceSn = undefined
+      this.queryParam.dealerCitySn = undefined
+      this.queryParam.dealerCountySn = undefined
+      if (this.advanced) {
+        this.$refs.custList.resetForm()
+      }
+      this.$refs.ruleForm.resetFields()
+      this.$refs.table.clearTable()
+    },
+    // 获取城市列表
+    getCityList (val) {
+      this.addrCityList = []
+      this.addrDistrictList = []
+      this.queryParam.dealerCitySn = undefined
+      this.queryParam.dealerCountySn = undefined
+      this.getArea('city', val)
+    },
+    // 获取区县列表
+    getAreaList (val) {
+      this.addrDistrictList = []
+      this.queryParam.dealerCountySn = undefined
+      this.getArea('district', val)
+    },
+    //  省/市/区
+    getArea (leve, sn) {
+      let params
+      if (leve == 'province') {
+        params = { type: '2' }
+      } else {
+        params = { parentId: sn, type: leve == 'city' ? '3' : '4' }
+      }
+      getArea(params).then(res => {
+        if (res.status == 200) {
+          if (leve == 'province') {
+            this.addrProvinceList = res.data || []
+          } else if (leve == 'city') {
+            this.addrCityList = res.data || []
+          } else if (leve == 'district') {
+            this.addrDistrictList = res.data || []
+          }
+        } else {
+          if (leve == 'province') {
+            this.addrProvinceList = []
+          } else if (leve == 'city') {
+            this.addrCityList = []
+          } else if (leve == 'district') {
+            this.addrDistrictList = []
+          }
+        }
+      })
     }
   },
   beforeRouteEnter (to, from, next) {
-    next(vm => {})
+    next(vm => {
+      vm.getArea('province')
+    })
   }
 }
 </script>

+ 5 - 4
src/views/reportData/salesSlipReport/list.vue

@@ -9,7 +9,7 @@
           ref="ruleForm"
           :model="queryParam"
           :rules="rules"
-          @keyup.enter.native="$refs.table.refresh(true)">
+          @keyup.enter.native="handleSearch">
           <a-row :gutter="15">
             <a-col :md="6" :sm="24">
               <a-form-model-item label="销售日期" prop="time">
@@ -334,6 +334,7 @@ export default {
           this.tableHeight = window.innerHeight - 380
         }
         const paramsPage = Object.assign(this.queryParam, { pageNo: parameter.pageNo, pageSize: parameter.pageSize }) //  有分页
+        delete paramsPage.time
         return salesBillReportList(paramsPage).then(res => {
           this.getCount(paramsPage)
           const data = res.data
@@ -414,14 +415,14 @@ export default {
     getCityList (val) {
       this.addrCityList = []
       this.addrDistrictList = []
-      this.queryParam.dealerCitySn = undefined
-      this.queryParam.dealerCountySn = undefined
+      this.queryParam.dealer.citySn = undefined
+      this.queryParam.dealer.districtSn = undefined
       this.getArea('city', val)
     },
     // 获取区县列表
     getAreaList (val) {
       this.addrDistrictList = []
-      this.queryParam.dealerCountySn = undefined
+      this.queryParam.dealer.districtSn = undefined
       this.getArea('district', val)
     },
     //  省/市/区