Sfoglia il codice sorgente

客户销售明细报表、连锁销售明细合计报表、门店收发存汇总报表

chenrui 3 anni fa
parent
commit
129c5623c9

+ 20 - 0
src/api/reportData.js

@@ -335,3 +335,23 @@ export const reportChainReceivingBillDetailCount = (params) => {
     method: 'post'
   })
 }
+// 客户销售明细报表  列表 分页
+export const reportCustomerSalesBillDetailList = (params) => {
+  const url = `/report/reportCustomerSalesBillDetail/report`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+// 客户销售明细报表  导出
+export const reportCustomerSalesBillDetailExport = params => {
+  return axios.request({
+    url: `/report/reportCustomerSalesBillDetail/export`,
+    data: params,
+    method: 'post',
+    responseType: 'blob'
+  })
+}

+ 75 - 0
src/config/router.config.js

@@ -1748,6 +1748,31 @@ export const asyncRouterMap = [
               }
             ]
           },
+          // {
+          //   path: '/reportData/storeReceivedSendStorageReport',
+          //   redirect: '/reportData/storeReceivedSendStorageReport/list',
+          //   name: 'storeReceivedSendStorageReport',
+          //   component: BlankLayout,
+          //   meta: {
+          //     title: '门店收发存汇总报表',
+          //     icon: 'profile'
+          //     // permission: 'M_storeReceivedSendStorageReportList'
+          //   },
+          //   hideChildrenInMenu: true,
+          //   children: [
+          //     {
+          //       path: 'list',
+          //       name: 'storeReceivedSendStorageReportList',
+          //       component: () => import(/* webpackChunkName: "reportData" */ '@/views/reportData/storeReceivedSendStorageReport/list.vue'),
+          //       meta: {
+          //         title: '门店收发存汇总列表',
+          //         icon: 'profile',
+          //         hidden: true
+          //         // permission: 'M_storeReceivedSendStorageReportList'
+          //       }
+          //     }
+          //   ]
+          // },
           {
             path: '/reportData/inventoryReport',
             redirect: '/reportData/inventoryReport/list',
@@ -1773,6 +1798,56 @@ export const asyncRouterMap = [
               }
             ]
           }
+          // {
+          //   path: '/reportData/chainSalesDetailsCountReport',
+          //   redirect: '/reportData/chainSalesDetailsCountReport/list',
+          //   name: 'chainSalesDetailsCountReport',
+          //   component: BlankLayout,
+          //   meta: {
+          //     title: '连锁销售明细合计报表',
+          //     icon: 'profile'
+          //     // permission: 'M_chainSalesDetailsCountReportList'
+          //   },
+          //   hideChildrenInMenu: true,
+          //   children: [
+          //     {
+          //       path: 'list',
+          //       name: 'chainSalesDetailsCountReportList',
+          //       component: () => import(/* webpackChunkName: "reportData" */ '@/views/reportData/chainSalesDetailsCountReport/list.vue'),
+          //       meta: {
+          //         title: '连锁销售明细合计列表',
+          //         icon: 'profile',
+          //         hidden: true
+          //         // permission: 'M_chainSalesDetailsCountReportList'
+          //       }
+          //     }
+          //   ]
+          // },
+          // {
+          //   path: '/reportData/customerSalesDetailsReport',
+          //   redirect: '/reportData/customerSalesDetailsReport/list',
+          //   name: 'customerSalesDetailsReport',
+          //   component: BlankLayout,
+          //   meta: {
+          //     title: '客户销售明细报表',
+          //     icon: 'profile'
+          //     // permission: 'M_customerSalesDetailsReportList'
+          //   },
+          //   hideChildrenInMenu: true,
+          //   children: [
+          //     {
+          //       path: 'list',
+          //       name: 'customerSalesDetailsReportList',
+          //       component: () => import(/* webpackChunkName: "reportData" */ '@/views/reportData/customerSalesDetailsReport/list.vue'),
+          //       meta: {
+          //         title: '客户销售明细列表',
+          //         icon: 'profile',
+          //         hidden: true
+          //         // permission: 'M_customerSalesDetailsReportList'
+          //       }
+          //     }
+          //   ]
+          // }
         ]
       },
       // 客户管理

+ 246 - 0
src/views/reportData/chainSalesDetailsCountReport/list.vue

@@ -0,0 +1,246 @@
+<template>
+  <a-card size="small" :bordered="false" class="chainSalesDetailsCountReportList-wrap">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <!-- 搜索条件 -->
+      <div class="table-page-search-wrapper">
+        <a-form-model
+          id="chainSalesDetailsCountReportList-form"
+          ref="ruleForm"
+          class="form-model-con"
+          layout="inline"
+          :model="queryParam"
+          :rules="rules"
+          :labelCol="labelCol"
+          :wrapperCol="wrapperCol"
+          @keyup.enter.native="handleSearch" >
+          <a-row :gutter="15">
+            <a-col :md="6" :sm="24">
+              <a-form-model-item label="连锁店" prop="tenantId">
+                <a-select
+                  placeholder="请选择连锁店"
+                  id="chainSalesDetailsCountReportList-tenantId"
+                  allowClear
+                  v-model="queryParam.tenantId"
+                  :showSearch="true"
+                  option-filter-prop="children"
+                  :filter-option="filterOption">
+                  <a-select-option v-for="item in linkageGroupData" :key="item.dealerSn" :value="item.dealerSn">{{ item.dealerName }}</a-select-option>
+                </a-select>
+              </a-form-model-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-model-item label="审核日期" prop="time">
+                <rangeDate ref="rangeDate" @change="dateChange" />
+              </a-form-model-item>
+            </a-col>
+            <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
+              <a-button type="primary" @click="handleSearch" :disabled="disabled" id="chainSalesDetailsCountReportList-refresh">查询</a-button>
+              <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="chainSalesDetailsCountReportList-reset">重置</a-button>
+              <a-button
+                style="margin-left: 5px"
+                type="primary"
+                class="button-warning"
+                @click="handleExport"
+                :disabled="disabled"
+                :loading="exportLoading"
+                id="chainSalesDetailsCountReportList-export">导出</a-button>
+            </a-col>
+          </a-row>
+        </a-form-model>
+      </div>
+      <!-- 列表 -->
+      <s-table
+        class="sTable"
+        ref="table"
+        size="small"
+        :rowKey="(record) => record.id"
+        :columns="columns"
+        :data="loadData"
+        :defaultLoadData="false"
+        bordered>
+        <template slot="footer">
+          <a-row>
+            <a-col span="2">合计:</a-col>
+            <a-col span="22">
+              <a-row>
+                <a-col span="4">滤清器:{{ (totalData && (totalData.jpLqqAmount || totalData.jpLqqAmount==0)) ? totalData.jpLqqAmount : '--' }}</a-col>
+                <a-col span="4">雨刮片:{{ (totalData && (totalData.jpYgpAmount || totalData.jpYgpAmount==0)) ? totalData.jpYgpAmount : '--' }}</a-col>
+                <a-col span="4">刹车片:{{ (totalData && (totalData.jpScpAmount || totalData.jpScpAmount==0)) ? totalData.jpScpAmount : '--' }}</a-col>
+                <a-col span="4">蓄电池:{{ (totalData && (totalData.jpGyxAmount || totalData.jpGyxAmount==0)) ? totalData.jpGyxAmount : '--' }}</a-col>
+                <a-col span="4">润滑油:{{ (totalData && (totalData.gpLqqAmount || totalData.gpLqqAmount==0)) ? totalData.gpLqqAmount : '--' }}</a-col>
+                <a-col span="4">火花塞:{{ (totalData && (totalData.gpYgpAmount || totalData.gpYgpAmount==0)) ? totalData.gpYgpAmount : '--' }}</a-col>
+                <a-col span="4">点火线圈:{{ (totalData && (totalData.gpScpAmount || totalData.gpScpAmount==0)) ? totalData.gpScpAmount : '--' }}</a-col>
+                <a-col span="4">稳升LED灯:{{ (totalData && (totalData.hjAmount || totalData.hjAmount==0)) ? totalData.hjAmount : '--' }}</a-col>
+                <a-col span="4">其他:{{ (totalData && (totalData.dlsAmount || totalData.dlsAmount==0)) ? totalData.dlsAmount : '--' }}</a-col>
+                <a-col span="4">合计:{{ (totalData && (totalData.wsAmount || totalData.wsAmount==0)) ? totalData.wsAmount : '--' }}</a-col>
+              </a-row>
+            </a-col>
+          </a-row>
+        </template>
+      </s-table>
+    </a-spin>
+  </a-card>
+</template>
+
+<script>
+import { STable, VSelect } from '@/components'
+import rangeDate from '@/views/common/rangeDate.vue'
+import { downloadExcel } from '@/libs/JGPrint.js'
+import { reportChainSalesBillDetailList, linkageGroupList } from '@/api/reportData'
+export default {
+  components: { STable, VSelect, rangeDate },
+  data () {
+    return {
+      spinning: false,
+      labelCol: { span: 8 },
+      wrapperCol: { span: 16 },
+      tableHeight: 0,
+      queryParam: { //  查询条件
+        tenantId: undefined,
+        time: [],
+        beginDate: '',
+        endDate: ''
+      },
+      rules: {
+        'tenantId': [{ required: true, message: '请选择连锁店', trigger: 'change' }],
+        'time': [{ required: true, message: '请选择审核日期', trigger: 'change' }]
+      },
+      disabled: false, //  查询、重置按钮是否可操作
+      exportLoading: false,
+      columns: [
+        { title: '门店', dataIndex: 'salesTargetName', width: '16%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '滤清器', dataIndex: 'settleStyleName', width: '8.4%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '雨刮片', dataIndex: 'productEntity.code', width: '8.4%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '刹车片', dataIndex: 'productEntity.name', width: '8.4%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '蓄电池', dataIndex: 'productEntity.unit', width: '8.4%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '润滑油', dataIndex: 'productEntity.unsit', width: '8.4%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '火花塞', dataIndex: 'productEntity.unsist', width: '8.4%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '点火线圈', dataIndex: 'productQty', width: '8.4%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '稳升LED灯', dataIndex: 'productCost', width: '8.4%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '其他', dataIndex: 'productPrice', width: '8.4%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '合计', dataIndex: 'productProfit', width: '8.4%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
+      ],
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.disabled = true
+        const params = Object.assign(parameter, this.queryParam)
+        this.spinning = true
+        delete params.time
+        return reportChainSalesBillDetailList(params).then(res => {
+          let data
+          if (res.status == 200) {
+            data = res.data
+            // 总计
+            this.getCount(params)
+            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
+          }
+          this.spinning = false
+          return data
+        })
+      },
+      linkageGroupData: [],
+      totalData: null
+    }
+  },
+  methods: {
+    //  创建时间  change
+    dateChange (date) {
+      this.queryParam.time = date
+      this.queryParam.beginDate = date[0] || ''
+      this.queryParam.endDate = date[1] || ''
+    },
+    // 合计
+    getCount (params) {
+      reportRebateCount(params).then(res => {
+        if (res.status == 200) {
+          this.totalData = res.data
+        } else {
+          this.totalData = null
+        }
+      })
+    },
+    //  查询
+    handleSearch () {
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          this.$refs.table.refresh(true)
+        } else {
+          console.log('error submit!!')
+          return false
+        }
+      })
+    },
+    //  重置
+    resetSearchForm () {
+      this.queryParam.tenantId = undefined
+      this.$refs.rangeDate.resetDate()
+      this.queryParam.time = []
+      this.queryParam.beginDate = ''
+      this.queryParam.endDate = ''
+      this.$refs.ruleForm.resetFields()
+      this.$refs.table.clearTable()
+    },
+    //  导出
+    handleExport () {
+      const _this = this
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          const params = _this.queryParam
+          _this.exportLoading = true
+          _this.spinning = true
+          reportReceivingBillExport(params).then(res => {
+            downloadExcel(res, '连锁门店销售明细合计报表')
+            _this.exportLoading = false
+            _this.spinning = false
+          })
+        } else {
+          return false
+        }
+      })
+    },
+    // 连锁店
+    getLinkageGroup () {
+      linkageGroupList({}).then(res => {
+        if (res.status == 200) {
+          const data = res.data || []
+          if (data.length > 0) {
+            this.linkageGroupData = data
+          } else {
+            this.linkageGroupData = []
+          }
+        } else {
+          this.linkageGroupData = []
+        }
+      })
+    },
+    filterOption (input, option) {
+      return (
+        option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
+      )
+    },
+    pageInit () {
+      this.getLinkageGroup()
+    }
+  },
+  mounted () {
+    if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
+      this.pageInit()
+      this.resetSearchForm()
+    }
+  },
+  activated () {
+    // 如果是新页签打开,则重置当前页面
+    if (this.$store.state.app.isNewTab) {
+      this.pageInit()
+      this.resetSearchForm()
+    }
+  },
+  beforeRouteEnter (to, from, next) {
+    next(vm => {})
+  }
+}
+</script>

+ 179 - 0
src/views/reportData/customerSalesDetailsReport/list.vue

@@ -0,0 +1,179 @@
+<template>
+  <a-card size="small" :bordered="false" class="customerSalesDetailsReportList-wrap">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <!-- 搜索条件 -->
+      <div class="table-page-search-wrapper">
+        <a-form-model
+          id="customerSalesDetailsReportList-form"
+          ref="ruleForm"
+          class="form-model-con"
+          layout="inline"
+          :model="queryParam"
+          :rules="rules"
+          :labelCol="labelCol"
+          :wrapperCol="wrapperCol"
+          @keyup.enter.native="handleSearch" >
+          <a-row :gutter="15">
+            <a-col :md="6" :sm="24">
+              <a-form-model-item label="审核日期" prop="time">
+                <rangeDate ref="rangeDate" @change="dateChange" />
+              </a-form-model-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-model-item label="客户名称">
+                <a-input id="customerSalesDetailsReportList-salesTargetName" v-model.trim="queryParam.salesTargetName" allowClear placeholder="请输入客户名称"/>
+              </a-form-model-item>
+            </a-col>
+            <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
+              <a-button type="primary" @click="handleSearch" :disabled="disabled" id="customerSalesDetailsReportList-refresh">查询</a-button>
+              <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="customerSalesDetailsReportList-reset">重置</a-button>
+              <a-button
+                style="margin-left: 5px"
+                type="primary"
+                class="button-warning"
+                @click="handleExport"
+                :disabled="disabled"
+                :loading="exportLoading"
+                id="customerSalesDetailsReportList-export">导出</a-button>
+            </a-col>
+          </a-row>
+        </a-form-model>
+      </div>
+      <!-- 列表 -->
+      <s-table
+        class="sTable"
+        ref="table"
+        size="small"
+        :rowKey="(record) => record.id"
+        :columns="columns"
+        :data="loadData"
+        :defaultLoadData="false"
+        :showPagination="false"
+        bordered>
+      </s-table>
+    </a-spin>
+  </a-card>
+</template>
+
+<script>
+import { STable, VSelect } from '@/components'
+import rangeDate from '@/views/common/rangeDate.vue'
+import { downloadExcel } from '@/libs/JGPrint.js'
+import { reportCustomerSalesBillDetailList, reportCustomerSalesBillDetailExport } from '@/api/reportData'
+export default {
+  components: { STable, VSelect, rangeDate },
+  data () {
+    return {
+      spinning: false,
+      labelCol: { span: 8 },
+      wrapperCol: { span: 16 },
+      tableHeight: 0,
+      queryParam: { //  查询条件
+        salesTargetName: '',
+        time: [],
+        beginDate: '',
+        endDate: ''
+      },
+      rules: {
+        'time': [{ required: true, message: '请选择审核日期', trigger: 'change' }]
+      },
+      disabled: false, //  查询、重置按钮是否可操作
+      exportLoading: false,
+      columns: [
+        { title: '客户名称', dataIndex: 'salesTargetName', width: '16%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '滤清器', dataIndex: 'lqqAmount', width: '8.4%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '雨刮片', dataIndex: 'ygpAmount', width: '8.4%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '刹车片', dataIndex: 'scpAmount', width: '8.4%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '蓄电池', dataIndex: 'xdcAmount', width: '8.4%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '润滑油', dataIndex: 'rhyAmount', width: '8.4%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '火花塞', dataIndex: 'hhsAmount', width: '8.4%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '点火线圈', dataIndex: 'dhxqAmount', width: '8.4%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '稳升LED灯', dataIndex: 'ledAmount', width: '8.4%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '其他', dataIndex: 'otherAmount', width: '8.4%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '合计', dataIndex: 'totalAmount', width: '8.4%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
+      ],
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.disabled = true
+        const params = Object.assign(parameter, this.queryParam)
+        this.spinning = true
+        delete params.time
+        return reportCustomerSalesBillDetailList(params).then(res => {
+          let data
+          if (res.status == 200) {
+            data = res.data
+            this.disabled = false
+          }
+          this.spinning = false
+          return data
+        })
+      },
+      linkageGroupData: []
+    }
+  },
+  methods: {
+    //  创建时间  change
+    dateChange (date) {
+      this.queryParam.time = date
+      this.queryParam.beginDate = date[0] || ''
+      this.queryParam.endDate = date[1] || ''
+    },
+    //  查询
+    handleSearch () {
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          this.$refs.table.refresh(true)
+        } else {
+          console.log('error submit!!')
+          return false
+        }
+      })
+    },
+    //  重置
+    resetSearchForm () {
+      this.queryParam.salesTargetName = ''
+      this.$refs.rangeDate.resetDate()
+      this.queryParam.time = []
+      this.queryParam.beginDate = ''
+      this.queryParam.endDate = ''
+      this.$refs.ruleForm.resetFields()
+      this.$refs.table.clearTable()
+    },
+    //  导出
+    handleExport () {
+      const _this = this
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          const params = _this.queryParam
+          _this.exportLoading = true
+          _this.spinning = true
+          reportCustomerSalesBillDetailExport(params).then(res => {
+            downloadExcel(res, '客户销售明细报表')
+            _this.exportLoading = false
+            _this.spinning = false
+          })
+        } else {
+          return false
+        }
+      })
+    },
+    pageInit () {}
+  },
+  mounted () {
+    if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
+      this.pageInit()
+      this.resetSearchForm()
+    }
+  },
+  activated () {
+    // 如果是新页签打开,则重置当前页面
+    if (this.$store.state.app.isNewTab) {
+      this.pageInit()
+      this.resetSearchForm()
+    }
+  },
+  beforeRouteEnter (to, from, next) {
+    next(vm => {})
+  }
+}
+</script>

+ 265 - 0
src/views/reportData/storeReceivedSendStorageReport/list.vue

@@ -0,0 +1,265 @@
+<template>
+  <a-card size="small" :bordered="false" class="storeReceivedSendStorageReportList-wrap">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <!-- 搜索条件 -->
+      <div class="table-page-search-wrapper">
+        <a-form-model
+          id="storeReceivedSendStorageReportList-form"
+          ref="ruleForm"
+          class="form-model-con"
+          layout="inline"
+          :model="queryParam"
+          :rules="rules"
+          :labelCol="labelCol"
+          :wrapperCol="wrapperCol"
+          @keyup.enter.native="handleSearch" >
+          <a-row :gutter="15">
+            <a-col :md="6" :sm="24">
+              <a-form-model-item label="日期" prop="month">
+                <a-month-picker
+                  v-model="queryParam.month"
+                  :disabled-date="disabledDate"
+                  :allowClear="false"
+                  @change="onChange"
+                  :defaultValue="moment().subtract(1, 'month')"
+                  style="width: 100%;" />
+              </a-form-model-item>
+            </a-col>
+            <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
+              <a-button type="primary" @click="handleSearch" :disabled="disabled" id="storeReceivedSendStorageReportList-refresh">查询</a-button>
+              <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="storeReceivedSendStorageReportList-reset">重置</a-button>
+              <a-button
+                style="margin-left: 5px"
+                type="primary"
+                class="button-warning"
+                @click="handleExport"
+                :disabled="disabled"
+                :loading="exportLoading"
+                id="storeReceivedSendStorageReportList-export">导出</a-button>
+            </a-col>
+          </a-row>
+        </a-form-model>
+      </div>
+      <!-- 列表 -->
+      <s-table
+        class="sTable"
+        ref="table"
+        size="small"
+        :rowKey="(record) => record.id"
+        :columns="columns"
+        :data="loadData"
+        :defaultLoadData="false"
+        bordered>
+        <template slot="footer">
+          <a-row :gutter="15">
+            <a-col :md="6" :sm="24">期初余额成本:{{ (totalData && (totalData.totalRealAmount || totalData.totalRealAmount==0)) ? totalData.totalRealAmount : '--' }}</a-col>
+            <a-col :md="6" :sm="24">入库成本:{{ (totalData && (totalData.totalAmount || totalData.totalAmount==0)) ? totalData.totalAmount : '--' }}</a-col>
+            <a-col :md="6" :sm="24">出库成本:{{ (totalData && (totalData.rebateAmount || totalData.rebateAmount==0)) ? totalData.rebateAmount : '--' }}</a-col>
+            <a-col :md="6" :sm="24">月末余额:{{ (totalData && (totalData.rebateAmount || totalData.rebateAmount==0)) ? totalData.rebateAmount : '--' }}</a-col>
+          </a-row>
+        </template>
+      </s-table>
+    </a-spin>
+  </a-card>
+</template>
+
+<script>
+import moment from 'moment'
+import { STable, VSelect } from '@/components'
+import rangeDate from '@/views/common/rangeDate.vue'
+import { downloadExcel } from '@/libs/JGPrint.js'
+import { reportChainSalesBillDetailList, linkageGroupList } from '@/api/reportData'
+export default {
+  components: { STable, VSelect, rangeDate },
+  data () {
+    return {
+      moment,
+      spinning: false,
+      labelCol: { span: 8 },
+      wrapperCol: { span: 16 },
+      tableHeight: 0,
+      queryParam: { //  查询条件
+        month: moment().subtract(1, 'month').format('YYYY-MM')
+      },
+      rules: {
+        'month': [{ required: true, message: '请选择月份', trigger: 'change' }]
+      },
+      disabled: false, //  查询、重置按钮是否可操作
+      exportLoading: false,
+      columns: [
+        { title: '序号', dataIndex: 'no', width: '4%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '期初余额',
+          align: 'center',
+          children: [
+            {
+              title: '明细',
+              dataIndex: 'ngkAmount',
+              align: 'center',
+              width: '12%',
+              customRender: function (text) { return text || '--' }
+            },
+            {
+              title: '成本',
+              dataIndex: 'flpAmount',
+              align: 'center',
+              width: '12%',
+              customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
+            }
+          ]
+        },
+        { title: '入库',
+          align: 'center',
+          children: [
+            {
+              title: '明细',
+              dataIndex: 'ngkAmo3unt',
+              align: 'center',
+              width: '12%',
+              customRender: function (text) { return text || '--' }
+            },
+            {
+              title: '成本',
+              dataIndex: 'flpAmo4unt',
+              align: 'center',
+              width: '12%',
+              customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
+            }
+          ]
+        },
+        { title: '出库',
+          align: 'center',
+          children: [
+            {
+              title: '明细',
+              dataIndex: 'ngkwAmount',
+              align: 'center',
+              width: '12%',
+              customRender: function (text) { return text || '--' }
+            },
+            {
+              title: '成本',
+              dataIndex: 'flpAmrount',
+              align: 'center',
+              width: '12%',
+              customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
+            }
+          ]
+        },
+        { title: '结存余额',
+          align: 'center',
+          children: [
+            {
+              title: '明细',
+              dataIndex: 'ngkAtmount',
+              align: 'center',
+              width: '12%',
+              customRender: function (text) { return text || '--' }
+            },
+            {
+              title: '成本',
+              dataIndex: 'flpAmouunt',
+              align: 'center',
+              width: '12%',
+              customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
+            }
+          ]
+        }
+      ],
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.disabled = true
+        const params = Object.assign(parameter, this.queryParam)
+        this.spinning = true
+        return reportChainSalesBillDetailList(params).then(res => {
+          let data
+          if (res.status == 200) {
+            data = res.data
+            // 总计
+            this.getCount(params)
+            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
+          }
+          this.spinning = false
+          return data
+        })
+      },
+      totalData: null
+    }
+  },
+  methods: {
+    disabledDate (current) {
+      return current && current > moment().subtract(1, 'month')
+    },
+    // 月份  change
+    onChange (date, dateString) {
+      this.queryParam.month = dateString || null
+    },
+    // 合计
+    getCount (params) {
+      reportRebateCount(params).then(res => {
+        if (res.status == 200) {
+          this.totalData = res.data
+        } else {
+          this.totalData = null
+        }
+      })
+    },
+    //  查询
+    handleSearch () {
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          this.$refs.table.refresh(true)
+        } else {
+          console.log('error submit!!')
+          return false
+        }
+      })
+    },
+    //  重置
+    resetSearchForm () {
+      this.queryParam.month = moment().format('YYYY-MM')
+      this.totalData = null
+      this.$refs.ruleForm.resetFields()
+      this.$refs.table.clearTable()
+    },
+    //  导出
+    handleExport () {
+      const _this = this
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          const params = _this.queryParam
+          _this.exportLoading = true
+          _this.spinning = true
+          reportReceivingBillExport(params).then(res => {
+            downloadExcel(res, '门店收发存汇总报表')
+            _this.exportLoading = false
+            _this.spinning = false
+          })
+        } else {
+          return false
+        }
+      })
+    },
+    pageInit () {}
+  },
+  mounted () {
+    if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
+      this.pageInit()
+      this.resetSearchForm()
+    }
+  },
+  activated () {
+    // 如果是新页签打开,则重置当前页面
+    if (this.$store.state.app.isNewTab) {
+      this.pageInit()
+      this.resetSearchForm()
+    }
+  },
+  beforeRouteEnter (to, from, next) {
+    next(vm => {})
+  }
+}
+</script>