Parcourir la source

销售明细(开单统计)

chenrui il y a 3 ans
Parent
commit
dd63ba45b0

+ 28 - 0
src/api/reportData.js

@@ -223,3 +223,31 @@ export const salesReturnExport = (params) => {
     responseType: 'blob'
   })
 }
+//  销售明细(开单统计)报表
+export const reportSalesBillDetailList = (params) => {
+  const url = `/report/salesBillReport/detail/queryPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+//  销售明细(开单统计)报表  合计
+export const reportSalesBillDetailCount = (params) => {
+  return axios({
+    url: '/report/salesBillReport/detail/queryCount',
+    data: params,
+    method: 'post'
+  })
+}
+// 销售明细(开单统计)报表 导出
+export const reportSalesBillDetailExport = (params) => {
+  return axios({
+    url: '/report/salesBillReport/detail/export',
+    data: params,
+    method: 'post',
+    responseType: 'blob'
+  })
+}

+ 2 - 2
src/views/reportData/allocationDetails/list.vue

@@ -102,7 +102,7 @@
               <a-button
                 style="margin-left: 0px"
                 type="primary"
-                class="button-warning"
+                class="button-info"
                 size="small"
                 @click="handleStock"
                 id="allocationDetailsList-stockDate">盘点区间日期</a-button>
@@ -171,7 +171,7 @@ import ProductBrand from '@/views/common/productBrand.js'
 import { userQueryList } from '@/api/power-user'
 import { allocateReportDetailList, allocateReportDetailCount, allocateReportDetailExport } from '@/api/allocateReport'
 export default {
-  components: { STable, VSelect, rangeDate, subarea,ProductBrand },
+  components: { STable, VSelect, rangeDate, subarea, ProductBrand },
   data () {
     return {
       spinning: false,

+ 1 - 1
src/views/reportData/allocationOrderTotal/list.vue

@@ -55,7 +55,7 @@
             <a-col :md="7" :sm="24" style="margin-bottom: 10px;">
               <a-button
                 type="primary"
-                class="button-warning"
+                class="button-info"
                 size="small"
                 @click="handleStock"
                 id="allocationOrderTotalList-stockDate">盘点区间日期</a-button>

+ 1 - 1
src/views/reportData/hPriceDifferenceDetailReport/list.vue

@@ -77,7 +77,7 @@
             <a-col :md="7" :sm="24" style="margin-bottom: 10px;">
               <a-button
                 type="primary"
-                class="button-warning"
+                class="button-info"
                 size="small"
                 @click="handleStock"
                 id="hPriceDifferenceDetailList-stockDate">盘点区间日期</a-button>

+ 358 - 218
src/views/reportData/salesDetails/list.vue

@@ -1,178 +1,192 @@
 <template>
   <a-card size="small" :bordered="false" class="salesDetailsList-wrap">
-    <!-- 搜索条件 -->
-    <div class="table-page-search-wrapper">
-      <a-form-model
-        ref="ruleForm"
-        class="form-model-con"
-        layout="inline"
-        :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 id="salesDetailsList-productCode" v-model.trim="queryParam.productCode" allowClear placeholder="请输入销售单号"/>
-            </a-form-model-item>
-          </a-col>
-          <a-col :md="6" :sm="24">
-            <a-form-model-item label="产品编码">
-              <a-input id="salesDetailsList-queryWord" v-model.trim="queryParam.queryWord" allowClear placeholder="请输入产品编码"/>
-            </a-form-model-item>
-          </a-col>
-          <template v-if="advanced">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <!-- 搜索条件 -->
+      <div class="table-page-search-wrapper">
+        <a-form-model
+          id="salesSlipReportList-form"
+          ref="ruleForm"
+          class="form-model-con"
+          layout="inline"
+          :model="queryParam"
+          :rules="rules"
+          @keyup.enter.native="handleSearch">
+          <a-row :gutter="15">
             <a-col :md="6" :sm="24">
-              <a-form-model-item label="区域">
-                <a-select id="salesDetailsList-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-model-item label="销售日期" prop="time">
+                <rangeDateTime 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 id="salesDetailsList-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-col :md="5" :sm="24">
+              <a-form-model-item label="销售单号">
+                <a-input id="salesDetailsList-salesBillNo" v-model.trim="queryParam.salesBillNo" allowClear placeholder="请输入退货单号"/>
               </a-form-model-item>
             </a-col>
-            <a-col :md="6" :sm="24">
-              <a-form-model-item label="产品名称">
-                <a-input id="salesDetailsList-name" v-model.trim="queryParam.name" allowClear placeholder="请输入产品名称"/>
+            <a-col :md="5" :sm="24">
+              <a-form-model-item label="产品编码">
+                <a-input id="salesDetailsList-productCode" v-model.trim="queryParam.productCode" allowClear placeholder="请输入产品编码"/>
               </a-form-model-item>
             </a-col>
-            <a-col :md="6" :sm="24">
-              <a-form-model-item label="客户名称">
-                <a-input id="salesDetailsList-name" v-model.trim="queryParam.name" allowClear placeholder="请输入客户名称"/>
-              </a-form-model-item>
+            <template v-if="advanced">
+              <a-col :md="6" :sm="24">
+                <a-form-model-item label="产品名称">
+                  <a-input id="salesDetailsList-productName" v-model.trim="queryParam.productName" allowClear placeholder="请输入产品名称"/>
+                </a-form-model-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-model-item label="客户名称">
+                  <a-input id="salesDetailsList-dealerName" v-model.trim="queryParam.dealerName" allowClear placeholder="请输入客户名称"/>
+                </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="salesDetailsList-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="salesDetailsList-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="salesDetailsList-productBrandSn" v-model="queryParam.productBrandSn"></ProductBrand>
+                </a-form-model-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-model-item label="产品分类">
+                  <a-cascader
+                    @change="changeProductType"
+                    expand-trigger="hover"
+                    change-on-select
+                    :options="productTypeList"
+                    :fieldNames="{ label: 'productTypeName', value: 'productTypeSn', children: 'children' }"
+                    id="salesDetailsList-productType"
+                    placeholder="请选择产品分类"
+                    allowClear
+                    v-model="productType" />
+                </a-form-model-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-model-item label="所在区域">
+                  <subarea id="salesDetailsList-subareaSn" v-model="queryParam.subareaSn"></subarea>
+                </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="8" :sm="24" style="margin-bottom: 10px;">
+              <a-button
+                type="primary"
+                class="button-info"
+                size="small"
+                @click="handleStock"
+                id="salesDetailsList-stockDate">盘点区间日期</a-button>
+              <a-button style="margin-left: 5px" type="primary" @click="handleSearch" :disabled="disabled" id="salesDetailsList-refresh">查询</a-button>
+              <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="salesDetailsList-reset">重置</a-button>
+              <a-button
+                style="margin-left: 10px"
+                type="primary"
+                class="button-warning"
+                @click="handleExport"
+                :disabled="disabled"
+                :loading="exportLoading"
+                id="salesDetailsList-export">导出</a-button>
+              <a @click="advanced=!advanced" style="margin-left: 5px">
+                {{ advanced ? '收起' : '展开' }}
+                <a-icon :type="advanced ? 'up' : 'down'"/>
+              </a>
             </a-col>
-            <a-col :md="6" :sm="24">
-              <a-form-model-item label="产品品牌">
-                <a-select
-                  placeholder="请选择"
-                  id="salesDetailsList-productBrandSn"
-                  allowClear
-                  v-model="queryParam.productBrandSn"
-                  :showSearch="true"
-                  option-filter-prop="children"
-                  :filter-option="filterOption">
-                  <a-select-option v-for="item in productBrandList" :key="item.brandSn" :value="item.brandSn">{{ item.brandName }}</a-select-option>
-                </a-select>
-              </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: 2720 }"
+        :defaultLoadData="false"
+        bordered>
+        <template slot="footer">
+          <a-row :gutter="15">
+            <a-col :md="4" :sm="24">
+              数量:{{ (totalData && (totalData.qty || totalData.qty==0)) ? totalData.qty : '--' }}
             </a-col>
-            <a-col :md="6" :sm="24">
-              <a-form-model-item label="客户级别">
-                <a-select
-                  placeholder="请选择"
-                  id="salesDetailsList-productBrandSn"
-                  allowClear
-                  v-model="queryParam.productBrandSn"
-                  :showSearch="true"
-                  option-filter-prop="children"
-                  :filter-option="filterOption">
-                  <a-select-option v-for="item in productBrandList" :key="item.brandSn" :value="item.brandSn">{{ item.brandName }}</a-select-option>
-                </a-select>
-              </a-form-model-item>
+            <a-col :md="4" :sm="24">
+              实售价:{{ (totalData && (totalData.totalRealSaleAmount || totalData.totalRealSaleAmount==0)) ? totalData.totalRealSaleAmount : '--' }}
             </a-col>
-            <a-col :md="6" :sm="24">
-              <a-form-model-item label="品牌类别">
-                <v-select code="BRAND_TYPE" id="salesDetailsList-brandType" v-model="queryParam.brandType" allowClear placeholder="请选择品牌分类"></v-select>
-              </a-form-model-item>
+            <a-col :md="4" :sm="24">
+              开单价:{{ (totalData && (totalData.totalAmount || totalData.totalAmount==0)) ? totalData.totalAmount : '--' }}
             </a-col>
-            <a-col :md="6" :sm="24">
-              <a-form-model-item label="二级分类">
-                <a-select
-                  placeholder="请选择"
-                  id="salesDetailsList-productBrandSn"
-                  allowClear
-                  v-model="queryParam.productBrandSn"
-                  :showSearch="true"
-                  option-filter-prop="children"
-                  :filter-option="filterOption">
-                  <a-select-option v-for="item in productBrandList" :key="item.brandSn" :value="item.brandSn">{{ item.brandName }}</a-select-option>
-                </a-select>
-              </a-form-model-item>
+            <a-col :md="4" :sm="24">
+              成本:{{ (totalData && (totalData.totalRealCost || totalData.totalRealCost==0)) ? totalData.totalRealCost : '--' }}
             </a-col>
-            <a-col :md="6" :sm="24">
-              <a-form-model-item label="三级分类">
-                <a-select
-                  placeholder="请选择"
-                  id="salesDetailsList-productBrandSn"
-                  allowClear
-                  v-model="queryParam.productBrandSn"
-                  :showSearch="true"
-                  option-filter-prop="children"
-                  :filter-option="filterOption">
-                  <a-select-option v-for="item in productBrandList" :key="item.brandSn" :value="item.brandSn">{{ item.brandName }}</a-select-option>
-                </a-select>
-              </a-form-model-item>
+            <a-col :md="4" :sm="24">
+              折后金额:{{ (totalData && (totalData.discountedAmount || totalData.discountedAmount==0)) ? totalData.discountedAmount : '--' }}
             </a-col>
-            <a-col :md="6" :sm="24">
-              <a-form-model-item label="盘点区间日期">
-                <a-checkbox @change="onChange"></a-checkbox>
-              </a-form-model-item>
+            <a-col :md="4" :sm="24">
+              折扣金额:{{ (totalData && (totalData.discountAmount || totalData.discountAmount==0)) ? totalData.discountAmount : '--' }}
             </a-col>
-          </template>
-          <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
-            <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="salesDetailsList-refresh">查询</a-button>
-            <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="salesDetailsList-reset">重置</a-button>
-            <a @click="advanced=!advanced" style="margin-left: 5px">
-              {{ 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: 3500 }"
-      :defaultLoadData="false"
-      bordered>
-      <template slot="footer" slot-scope="currentPageData">
-        <a-row :gutter="15">
-          <a-col :md="4" :sm="24">
-            数量:69
-          </a-col>
-          <a-col :md="4" :sm="24">
-            实售价:1130.36
-          </a-col>
-          <a-col :md="4" :sm="24">
-            开单价:1187.11
-          </a-col>
-          <a-col :md="4" :sm="24">
-            成本:1052.30
-          </a-col>
-          <a-col :md="4" :sm="24">
-            折后金额:1187.11
-          </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 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 rangeDateTime from '@/views/common/rangeDateTime.vue'
+import subarea from '@/views/common/subarea.js'
+import custList from '@/views/common/custList.vue'
+import { getArea } from '@/api/data'
+import { productBrandQuery } from '@/api/productBrand'
+import { productTypeQuery } from '@/api/productType'
+import ProductBrand from '@/views/common/productBrand.js'
+import { hdExportExcel } from '@/libs/exportExcel'
+import { reportSalesBillDetailList, reportSalesBillDetailCount, reportSalesBillDetailExport } from '@/api/reportData'
 export default {
-  components: { STable, VSelect, rangeDate },
+  components: { STable, VSelect, rangeDateTime, custList, subarea, ProductBrand },
   data () {
     return {
+      spinning: false,
       advanced: false, // 高级搜索 展开/关闭
       tableHeight: 0,
       queryParam: { //  查询条件
@@ -182,78 +196,104 @@ export default {
         ],
         beginDate: getDate.getCurrMonthDays().starttime,
         endDate: getDate.getCurrMonthDays().endtime,
-        targetName: '', //  调往对象
-        allocateTypeSn: undefined, //  调拨类型
-        state: undefined, //  业务状态
-        allocateNo: '' //  调拨单号
+        salesBillNo: '',
+        productCode: '',
+        productName: '',
+        dealerName: '',
+        dealerLevel: undefined,
+        productBrandTypeSn: undefined,
+        productBrandSn: undefined, //  产品品牌
+        productTypeSn1: '', //  产品一级分类
+        productTypeSn2: '', //  产品二级分类
+        productTypeSn3: '', //  产品三级分类
+        subareaSn: undefined,
+        dealerProvinceSn: undefined,
+        dealerCitySn: undefined,
+        dealerCountySn: undefined
+      },
+      productType: [],
+      rules: {
+        'time': [{ required: true, message: '请选择销售日期', trigger: 'change' }]
       },
-	  rules: {
-	    'time': [{ required: true, message: '请选择调拨开单日期', trigger: 'change' }]
-	  },
       disabled: false, //  查询、重置按钮是否可操作
       exportLoading: false,
-      checkVal: '',
-      reportData: reportData.reportDataList,
       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: 200, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '省份', dataIndex: 'data3', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '客户名称', dataIndex: 'data4', width: 220, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '客户级别', dataIndex: 'data5', width: 120, 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: 200, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '开单日期', dataIndex: 'data8', width: 160, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '销售日期', dataIndex: 'data9', width: 160, 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', 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: 'data17', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '实售价', dataIndex: 'data18', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '开单价', dataIndex: 'data19', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '市级价', dataIndex: 'data20', width: 140, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '直接差价', dataIndex: 'data21', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '间接差价', dataIndex: 'data22', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '操作员', dataIndex: 'data23', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
+        { title: '序号', dataIndex: 'no', width: 60, align: 'center', fixed: 'left' },
+        { title: '区域', dataIndex: 'subareaNames', width: 150, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '销售单号', dataIndex: 'salesBillNo', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '省份', dataIndex: 'dealerProvinceName', width: 100, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '客户名称', dataIndex: 'dealerName', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '客户级别', dataIndex: 'dealerLevelDictValue', width: 150, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '直接绑定客户名称', dataIndex: 'directDealerName', width: 150, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '间接绑定客户名称', dataIndex: 'indirectDealerName', width: 150, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '开单日期', dataIndex: 'createDate', width: 130, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '销售日期', dataIndex: 'salesTime', width: 130, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '品牌', dataIndex: 'productBrandName', width: 130, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '二级分类', dataIndex: 'productTypeName2', width: 130, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'productName', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '产品编码', dataIndex: 'productCode', width: 150, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '单位', dataIndex: 'productUnit', width: 50, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '销售数量', dataIndex: 'qty', width: 70, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '成本价', dataIndex: 'totalRealCost', width: 70, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '实售价', dataIndex: 'totalRealSaleAmount', width: 70, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '开单价', dataIndex: 'totalAmount', width: 70, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '市级价', dataIndex: 'totalCityAmount', width: 70, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '直接差价', dataIndex: 'directRebateAmount', width: 70, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '间接差价', dataIndex: 'indirectRebateAmount', width: 70, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '折后单价', dataIndex: 'discountedPrice', width: 70, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '折扣金额', dataIndex: 'discountAmount', width: 70, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '操作员', dataIndex: 'operatorName', 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.salesDetailsList,
-            count: 10
-          }
+        this.spinning = true
+        const params = Object.assign(parameter, this.queryParam)
+        delete params.time
+        return reportSalesBillDetailList(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: [], //  区下拉
+      productBrandList: [], //  品牌下拉数据
+      productTypeList: [] //  分类下拉数据
     }
   },
   methods: {
-    handleFooterShow (currentPageData) {
-      console.log(currentPageData, '[=currentPageData]')
+    // 盘点库存日期
+    handleStock () {
+      this.$message.info('无盘点区间的起始/终止时间,请自行选择日期区间查询!')
+    },
+    // 总计
+    getCount (params) {
+      reportSalesBillDetailCount(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) {
@@ -261,12 +301,9 @@ export default {
       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.queryParam.time = [
@@ -276,14 +313,117 @@ export default {
       this.$refs.rangeDate.resetDate(this.queryParam.time)
       this.queryParam.beginDate = getDate.getCurrMonthDays().starttime
       this.queryParam.endDate = getDate.getCurrMonthDays().endtime
-      this.queryParam.targetName = ''
-      this.queryParam.allocateTypeSn = undefined
-      this.queryParam.state = undefined
-      this.queryParam.allocateNo = ''
-      this.$refs.table.refresh(true)
+      this.queryParam.salesBillNo = ''
+      this.queryParam.productCode = ''
+      this.queryParam.productName = ''
+      this.queryParam.dealerName = ''
+      this.queryParam.dealerLevel = undefined
+      this.queryParam.productBrandTypeSn = undefined
+      this.queryParam.productBrandSn = undefined
+      this.queryParam.productTypeSn1 = ''
+      this.queryParam.productTypeSn2 = ''
+      this.queryParam.productTypeSn3 = ''
+      this.queryParam.subareaSn = undefined
+      this.queryParam.dealerProvinceSn = undefined
+      this.queryParam.dealerCitySn = undefined
+      this.queryParam.dealerCountySn = undefined
+      this.productType = []
+      this.totalData = null
+      this.$refs.ruleForm.resetFields()
+      this.$refs.table.clearTable()
+    },
+    //  导出
+    handleExport () {
+      const _this = this
+      const params = this.queryParam
+      this.exportLoading = true
+      this.spinning = true
+      hdExportExcel(reportSalesBillDetailExport, params, '销售明细(开单统计)报表', function () {
+        _this.exportLoading = false
+        _this.spinning = false
+      })
+    },
+    filterOption (input, option) {
+      return (
+        option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
+      )
+    },
+    //  产品分类  change
+    changeProductType (val, opt) {
+      this.queryParam.productTypeSn1 = val[0] ? val[0] : ''
+      this.queryParam.productTypeSn2 = val[1] ? val[1] : ''
+      this.queryParam.productTypeSn3 = val[2] ? val[2] : ''
+    },
+    //  产品品牌  列表
+    getProductBrand () {
+      productBrandQuery({}).then(res => {
+        if (res.status == 200) {
+          this.productBrandList = res.data
+        } else {
+          this.productBrandList = []
+        }
+      })
+    },
+    //  产品分类  列表
+    getProductType () {
+      productTypeQuery({}).then(res => {
+        if (res.status == 200) {
+          this.productTypeList = res.data
+        } else {
+          this.productTypeList = []
+        }
+      })
+    },
+    // 获取城市列表
+    getCityList (val) {
+      this.addrCityList = []
+      this.addrDistrictList = []
+      this.queryParam.dealerCitySn = undefined
+      this.queryParam.dealerCountySn = undefined
+      if (val) {
+        this.getArea('city', val)
+      }
+    },
+    // 获取区县列表
+    getAreaList (val) {
+      this.addrDistrictList = []
+      this.queryParam.dealerCountySn = undefined
+      if (val) {
+        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 = []
+          }
+        }
+      })
     },
     pageInit () {
-
+      this.getProductBrand()
+      this.getProductType()
+      this.getArea('province')
     }
   },
   mounted () {