chenrui 4 år sedan
förälder
incheckning
94c91ecf70

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

@@ -980,6 +980,56 @@ export const asyncRouterMap = [
                 }
               }
             ]
+          },
+          {
+            path: '/promotionRulesManagement/orderStatistics',
+            redirect: '/promotionRulesManagement/orderStatistics/list',
+            name: 'orderStatistics',
+            component: RouteView,
+            meta: {
+              title: '促销订单统计',
+              icon: 'pull-request'
+              // permission: 'M_goodsManage_list'
+            },
+            hideChildrenInMenu: true,
+            children: [
+              {
+                path: 'list',
+                name: 'orderStatisticsList',
+                component: () => import(/* webpackChunkName: "shop" */ '@/views/promotionRulesManagement/orderStatistics/list.vue'),
+                meta: {
+                  title: '订单统计列表',
+                  icon: 'pull-request',
+                  hidden: true
+                  // permission: 'M_goodsManage_list'
+                }
+              }
+            ]
+          },
+          {
+            path: '/promotionRulesManagement/productStatistics',
+            redirect: '/promotionRulesManagement/productStatistics/list',
+            name: 'productStatistics',
+            component: RouteView,
+            meta: {
+              title: '促销产品统计',
+              icon: 'pull-request'
+              // permission: 'M_goodsManage_list'
+            },
+            hideChildrenInMenu: true,
+            children: [
+              {
+                path: 'list',
+                name: 'productStatisticsList',
+                component: () => import(/* webpackChunkName: "shop" */ '@/views/promotionRulesManagement/productStatistics/list.vue'),
+                meta: {
+                  title: '产品统计列表',
+                  icon: 'pull-request',
+                  hidden: true
+                  // permission: 'M_goodsManage_list'
+                }
+              }
+            ]
           }
         ]
       },

+ 138 - 0
src/views/promotionRulesManagement/orderStatistics/detailModal.vue

@@ -0,0 +1,138 @@
+<template>
+  <a-modal
+    centered
+    class="orderStatisticsDetail-modal"
+    :footer="null"
+    :maskClosable="false"
+    title="促销品明细"
+    v-model="isShow"
+    @cancle="isShow=false"
+    width="80%">
+    <div>
+      <p>销售单号: 158907</p>
+      <!-- 列表 -->
+      <s-table
+        class="sTable"
+        ref="table"
+        size="small"
+        :rowKey="(record) => record.id"
+        :columns="columns"
+        :data="loadData"
+        :scroll="{ x: 1360, y: 400 }"
+        bordered>
+        <!-- 操作 -->
+        <template slot="action" slot-scope="text, record">
+          <a-button
+            size="small"
+            type="link"
+            @click="handleDetail(record)"
+            class="button-success"
+            id="orderStatisticsDetail-edit-btn">详情</a-button>
+          <!-- <span>--</span> -->
+        </template>
+      </s-table>
+      <div class="btn-cont"><a-button id="orderStatisticsDetail-back" @click="isShow = false">返回列表</a-button></div>
+    </div>
+  </a-modal>
+</template>
+
+<script>
+import { STable } from '@/components'
+// import { custFindById } from '@/api/customer'
+export default {
+  name: 'OrderStatisticsDetailModal',
+  components: { STable },
+  props: {
+    openModal: { //  弹框显示状态
+      type: Boolean,
+      default: false
+    },
+    itemId: {
+      type: [Number, String],
+      default: ''
+    }
+  },
+  data () {
+    return {
+      isShow: this.openModal, //  是否打开弹框
+      // 表头
+      columns: [
+        { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
+        { title: '产品编码', dataIndex: 'sparePartsPurchaseNo', width: 220, align: 'center' },
+        { title: '产品名称', dataIndex: 'supplierName', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '原价', dataIndex: 'productTotalCost', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '促销价', dataIndex: 'productTotalQty', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '数量', dataIndex: 'psroductTotalCost', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '单位', dataIndex: 'suppliersName', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '原价小计', dataIndex: 'productTotdalCost', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '促销价小计', dataIndex: 'productTdotalCost', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '节省金额小计', dataIndex: 'productTdostalCost', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '促销类型', dataIndex: 'stateDictValue', width: 100, align: 'center', customRender: function (text) { return text || '--' } }
+      ],
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        // return sparePartsPurList(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
+        //   }
+        //   return data
+        // })
+        const _this = this
+        return new Promise(function (resolve, reject) {
+          const data = {
+            pageNo: 1,
+            pageSize: 10,
+            list: [
+              { id: '1', productNum: 'jgqp11111111111', productName: '产品1', productOldNum: 'jgqp111123545', productBrand: '箭冠品牌', inventoryNumss: '0' },
+              { id: '2', productNum: 'jgqp11111111111', productName: '产品1', productOldNum: 'jgqp111123545', productBrand: '箭冠品牌', inventoryNumss: '0' },
+              { id: '3', productNum: 'jgqp11111111111', productName: '产品1', productOldNum: 'jgqp111123545', productBrand: '箭冠品牌', inventoryNumss: '0' }
+            ]
+          }
+          const no = (data.pageNo - 1) * data.pageSize
+          for (var i = 0; i < data.list.length; i++) {
+            data.list[i].no = no + i + 1
+          }
+          resolve(data)
+        })
+      }
+    }
+  },
+  methods: {
+
+  },
+  watch: {
+    //  父页面传过来的弹框状态
+    openModal (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    //  重定义的弹框状态
+    isShow (newValue, oldValue) {
+      if (!newValue) {
+        this.$emit('close')
+      }
+    },
+    itemId (newValue, oldValue) {
+      if (this.isShow && newValue) {
+        const _this = this
+        setTimeout(() => {
+          _this.$refs.table.refresh(true)
+        }, 300)
+      }
+    }
+  }
+}
+</script>
+
+<style lang="less">
+  .orderStatisticsDetail-modal{
+    .ant-modal-body {
+      padding: 40px 40px 24px;
+    }
+    .btn-cont {
+      text-align: center;
+      margin: 35px 0 10px;
+    }
+  }
+</style>

+ 259 - 0
src/views/promotionRulesManagement/orderStatistics/list.vue

@@ -0,0 +1,259 @@
+<template>
+  <a-card size="small" :bordered="false" class="orderStatisticsList-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="创建时间">
+              <a-range-picker
+                style="width:100%"
+                id="orderStatisticsList-createDate"
+                :disabledDate="disabledDate"
+                v-model="createDate"
+                :format="dateFormat"
+                :placeholder="['开始时间', '结束时间']" />
+            </a-form-item>
+          </a-col>
+          <a-col :md="6" :sm="24">
+            <a-form-item label="客户名称" :label-col="{ span:7 }" :wrapper-col="{ span:17}">
+              <a-select
+                id="orderStatisticsList-supplierSn"
+                placeholder="请选择客户名称"
+                allowClear
+                v-model="queryParam.supplierSn"
+                :showSearch="true"
+                option-filter-prop="children"
+                :filter-option="filterOption">
+                <a-select-option v-for="item in supplierList" :key="item.supplierSn" :value="item.supplierSn">{{ item.supplierName }}</a-select-option>
+              </a-select>
+            </a-form-item>
+          </a-col>
+          <a-col :md="6" :sm="24">
+            <a-form-item label="销售单号">
+              <a-input id="orderStatisticsList-sparePartsPurchaseNo" v-model.trim="queryParam.sparePartsPurchaseNo" allowClear placeholder="请输入销售单号"/>
+            </a-form-item>
+          </a-col>
+          <template v-if="advanced">
+            <a-col :md="6" :sm="24">
+              <a-form-item label="活动名称">
+                <a-input id="orderStatisticsList-sparePartsPurchaseNo" v-model.trim="queryParam.sparePartsPurchaseNo" allowClear placeholder="请输入活动名称"/>
+              </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-item label="业务状态">
+                <v-select
+                  v-model="queryParam.state"
+                  ref="state"
+                  id="orderStatisticsList-state"
+                  code="SPARE_PARTS_PURCHASE"
+                  placeholder="请选择业务状态"
+                  allowClear
+                ></v-select>
+              </a-form-item>
+            </a-col>
+          </template>
+          <a-col :md="6" :sm="24">
+            <span class="table-page-search-submitButtons" style="margin-top: 3px;">
+              <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="orderStatisticsList-refresh">查询</a-button>
+              <a-button style="margin-left: 8px" @click="resetSearchForm()" :disabled="disabled" id="orderStatisticsList-reset">重置</a-button>
+              <a @click="advanced=!advanced" style="margin-left: 8px">
+                {{ advanced ? '收起' : '展开' }}
+                <a-icon :type="advanced ? 'up' : 'down'"/>
+              </a>
+            </span>
+          </a-col>
+        </a-row>
+      </a-form>
+    </div>
+    <!-- alert -->
+    <a-alert type="info" showIcon style="margin-bottom:15px">
+      <div slot="message">促销品原价总额: <strong>{{ dataTotalCount }}</strong> ;促销品促销价总额: <strong>{{ productTotal.productTotalQty }}</strong> ;总单数:<strong>{{ productTotal.productTotalCost }}</strong>;总款数:<strong>{{ productTotal.productTotalCost }}</strong>;节省总额:<strong>{{ productTotal.productTotalCost }}</strong>;总条数:<strong>{{ productTotal.productTotalCost }}</strong>。 </div>
+    </a-alert>
+    <!-- 列表 -->
+    <s-table
+      class="sTable"
+      ref="table"
+      size="default"
+      :rowKey="(record) => record.id"
+      :columns="columns"
+      :data="loadData"
+      :scroll="{ x: 1360, y: tableHeight }"
+      bordered>
+      <!-- 操作 -->
+      <template slot="action" slot-scope="text, record">
+        <a-button
+          size="small"
+          type="link"
+          @click="handleDetail(record)"
+          class="button-success"
+          id="orderStatisticsList-edit-btn">详情</a-button>
+        <!-- <span>--</span> -->
+      </template>
+    </s-table>
+    <!-- 详情 -->
+    <orderStatisticsDetailModal :openModal="openModal" :itemId="itemId" @close="closeModal" />
+  </a-card>
+</template>
+
+<script>
+import moment from 'moment'
+import { STable, VSelect } from '@/components'
+import orderStatisticsDetailModal from './detailModal.vue'
+// import { sparePartsPurList, sparePartsPurCount } from '@/api/sparePartsPur'
+// import { supplierAllList } from '@/api/supplier'
+export default {
+  components: { STable, VSelect, orderStatisticsDetailModal },
+  data () {
+    return {
+      advanced: false, // 高级搜索 展开/关闭
+      disabled: false, //  查询、重置按钮是否可操作
+      exportLoading: false, // 导出loading
+      supplierList: [], //  供应商列表数据
+      createDate: [], //  创建时间
+      dateFormat: 'YYYY-MM-DD',
+      tableHeight: 0,
+      // 查询参数
+      queryParam: {
+        sparePartsPurchaseNo: '', //  散件单号
+        supplierSn: undefined, //  供应商
+        state: undefined, //  单据状态
+        settleState: undefined //  结算状态
+      },
+      // 表头
+      columns: [
+        { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
+        { title: '创建时间', dataIndex: 'createDate', width: 160, align: 'center' },
+        { title: '单据来源', dataIndex: 'suspplierName', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '销售单号', dataIndex: 'sparePartsPurchaseNo', width: 220, align: 'center' },
+        { title: '促销名称', dataIndex: 'supplierName', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '客户名称', dataIndex: 'productTotalCategory', width: 100, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '促销品款数', dataIndex: 'productTotalCost', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '促销品数量', dataIndex: 'productTotalQty', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '原价总额', dataIndex: 'psroductTotalCost', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '促销品总额', dataIndex: 'productTotdalCost', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '节省总额', dataIndex: 'productTdotalCost', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '业务状态', dataIndex: 'stateDictValue', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: 100, align: 'center', fixed: 'right' }
+      ],
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.disabled = true
+        if (this.tableHeight == 0) {
+          this.tableHeight = window.innerHeight - 440
+        }
+        // 创建时间
+        if (this.createDate && this.createDate.length > 0) {
+          this.queryParam.beginDate = moment(this.createDate[0]).format(this.dateFormat)
+          this.queryParam.endDate = moment(this.createDate[1]).format(this.dateFormat)
+        } else {
+          this.queryParam.beginDate = undefined
+          this.queryParam.endDate = undefined
+        }
+        // return sparePartsPurList(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
+        //   this.dataTotalCount = data.count
+        //   this.getTotal(Object.assign(parameter, this.queryParam))
+        //   return data
+        // })
+        const _this = this
+        return new Promise(function (resolve, reject) {
+          const data = {
+            pageNo: 1,
+            pageSize: 10,
+            list: [
+              { id: '1', productNum: 'jgqp11111111111', productName: '产品1', productOldNum: 'jgqp111123545', productBrand: '箭冠品牌', inventoryNumss: '0' },
+              { id: '2', productNum: 'jgqp11111111111', productName: '产品1', productOldNum: 'jgqp111123545', productBrand: '箭冠品牌', inventoryNumss: '0' },
+              { id: '3', productNum: 'jgqp11111111111', productName: '产品1', productOldNum: 'jgqp111123545', productBrand: '箭冠品牌', inventoryNumss: '0' }
+            ]
+          }
+          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
+          resolve(data)
+        })
+      },
+      openModal: false, //  弹框是否显示
+      itemId: '', //  当前id
+      productTotal: { // 合计信息
+        productTotalCost: '',
+        productTotalQty: ''
+      },
+      dataTotalCount: '' //  列表数据总条数
+    }
+  },
+  methods: {
+    // 不可选日期
+    disabledDate (date, dateStrings) {
+      return date && date.valueOf() > Date.now()
+    },
+    // 合计
+    getTotal (param) {
+      // sparePartsPurCount(param).then(res => {
+      //   if (res.status == 200 && res.data) {
+      //     this.productTotal = res.data
+      //   } else {
+      //     this.productTotal = {
+      //       // 合计信息
+      //       productTotalCost: '',
+      //       productTotalQty: ''
+      //     }
+      //   }
+      // })
+    },
+    //  详情
+    handleDetail (row) {
+      this.itemId = row.id
+      this.openModal = true
+    },
+    //  重置
+    resetSearchForm () {
+      this.queryParam.sparePartsPurchaseNo = ''
+      this.queryParam.supplierSn = undefined
+      this.queryParam.state = undefined
+      this.queryParam.settleState = undefined
+      this.createDate = undefined
+      this.$refs.table.refresh(true)
+    },
+    // 关闭弹框
+    closeModal () {
+      this.openModal = false
+      this.itemId = ''
+    },
+    filterOption (input, option) {
+      return (
+        option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
+      )
+    },
+    // 供应商下拉数据
+    getSupplierList () {
+      // supplierAllList().then(res => {
+      //   if (res.status == 200) {
+      //     this.supplierList = res.data
+      //   } else {
+      //     this.supplierList = []
+      //   }
+      // })
+    }
+  },
+  beforeRouteEnter (to, from, next) {
+    next(vm => {
+      vm.getSupplierList()
+    })
+  }
+}
+</script>
+<style lang="less">
+  .orderStatisticsList-wrap{
+    .sTable{
+      margin-top: 15px;
+    }
+  }
+</style>

+ 137 - 0
src/views/promotionRulesManagement/productStatistics/detailModal.vue

@@ -0,0 +1,137 @@
+<template>
+  <a-modal
+    centered
+    class="orderStatisticsDetail-modal"
+    :footer="null"
+    :maskClosable="false"
+    title="促销品明细"
+    v-model="isShow"
+    @cancle="isShow=false"
+    width="80%">
+    <div>
+      <p>产品信息: 产品名称(产品编码)</p>
+      <!-- 列表 -->
+      <s-table
+        class="sTable"
+        ref="table"
+        size="small"
+        :rowKey="(record) => record.id"
+        :columns="columns"
+        :data="loadData"
+        :scroll="{ x: 1360, y: 400 }"
+        bordered>
+        <!-- 操作 -->
+        <template slot="action" slot-scope="text, record">
+          <a-button
+            size="small"
+            type="link"
+            @click="handleDetail(record)"
+            class="button-success"
+            id="orderStatisticsDetail-edit-btn">详情</a-button>
+          <!-- <span>--</span> -->
+        </template>
+      </s-table>
+      <div class="btn-cont"><a-button id="orderStatisticsDetail-back" @click="isShow = false">返回列表</a-button></div>
+    </div>
+  </a-modal>
+</template>
+
+<script>
+import { STable } from '@/components'
+// import { custFindById } from '@/api/customer'
+export default {
+  name: 'OrderStatisticsDetailModal',
+  components: { STable },
+  props: {
+    openModal: { //  弹框显示状态
+      type: Boolean,
+      default: false
+    },
+    itemId: {
+      type: [Number, String],
+      default: ''
+    }
+  },
+  data () {
+    return {
+      isShow: this.openModal, //  是否打开弹框
+      // 表头
+      columns: [
+        { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
+        { title: '采购单号', dataIndex: 'supplierName', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '原价', dataIndex: 'productTotalCost', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '促销价', dataIndex: 'productTotalQty', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '数量', dataIndex: 'psroductTotalCost', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '单位', dataIndex: 'suppliersName', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '原价小计', dataIndex: 'productTotdalCost', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '促销价小计', dataIndex: 'productTdotalCost', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '节省金额小计', dataIndex: 'productTdostalCost', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '促销类型', dataIndex: 'stateDictValue', width: 100, align: 'center', customRender: function (text) { return text || '--' } }
+      ],
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        // return sparePartsPurList(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
+        //   }
+        //   return data
+        // })
+        const _this = this
+        return new Promise(function (resolve, reject) {
+          const data = {
+            pageNo: 1,
+            pageSize: 10,
+            list: [
+              { id: '1', productNum: 'jgqp11111111111', productName: '产品1', productOldNum: 'jgqp111123545', productBrand: '箭冠品牌', inventoryNumss: '0' },
+              { id: '2', productNum: 'jgqp11111111111', productName: '产品1', productOldNum: 'jgqp111123545', productBrand: '箭冠品牌', inventoryNumss: '0' },
+              { id: '3', productNum: 'jgqp11111111111', productName: '产品1', productOldNum: 'jgqp111123545', productBrand: '箭冠品牌', inventoryNumss: '0' }
+            ]
+          }
+          const no = (data.pageNo - 1) * data.pageSize
+          for (var i = 0; i < data.list.length; i++) {
+            data.list[i].no = no + i + 1
+          }
+          resolve(data)
+        })
+      }
+    }
+  },
+  methods: {
+
+  },
+  watch: {
+    //  父页面传过来的弹框状态
+    openModal (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    //  重定义的弹框状态
+    isShow (newValue, oldValue) {
+      if (!newValue) {
+        this.$emit('close')
+      }
+    },
+    itemId (newValue, oldValue) {
+      if (this.isShow && newValue) {
+        const _this = this
+        setTimeout(() => {
+          _this.$refs.table.refresh(true)
+        }, 300)
+      }
+    }
+  }
+}
+</script>
+
+<style lang="less">
+  .orderStatisticsDetail-modal{
+    .ant-modal-body {
+      padding: 40px 40px 24px;
+    }
+    .btn-cont {
+      text-align: center;
+      margin: 35px 0 10px;
+    }
+  }
+</style>

+ 264 - 0
src/views/promotionRulesManagement/productStatistics/list.vue

@@ -0,0 +1,264 @@
+<template>
+  <a-card size="small" :bordered="false" class="productStatisticsList-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="统计时间">
+              <a-range-picker
+                style="width:100%"
+                id="productStatisticsList-createDate"
+                :disabledDate="disabledDate"
+                v-model="createDate"
+                :format="dateFormat"
+                :placeholder="['开始时间', '结束时间']" />
+            </a-form-item>
+          </a-col>
+          <a-col :md="6" :sm="24">
+            <a-form-item label="产品名称">
+              <a-input id="productStatisticsList-name" v-model.trim="queryParam.name" allowClear placeholder="请输入产品名称"/>
+            </a-form-item>
+          </a-col>
+          <a-col :md="6" :sm="24">
+            <a-form-item label="产品编码">
+              <a-input id="productStatisticsList-code" v-model.trim="queryParam.code" allowClear placeholder="请输入产品编码"/>
+            </a-form-item>
+          </a-col>
+          <template v-if="advanced">
+            <a-col :md="6" :sm="24">
+              <a-form-item label="产品分类">
+                <a-cascader
+                  @change="changeProductType"
+                  change-on-select
+                  v-model="productType"
+                  expand-trigger="hover"
+                  :options="productTypeList"
+                  :fieldNames="{ label: 'productTypeName', value: 'productTypeSn', children: 'children' }"
+                  id="productStatisticsList-productType"
+                  placeholder="请选择产品分类"
+                  allowClear />
+              </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-item label="产品品牌">
+                <a-select
+                  placeholder="请选择产品品牌"
+                  id="productStatisticsList-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-item>
+            </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="productStatisticsList-refresh">查询</a-button>
+            <a-button style="margin: 0 0 18px 8px" @click="resetSearchForm" :disabled="disabled" id="productStatisticsList-reset">重置</a-button>
+            <!-- <a-button
+              style="margin: 0 0 18px 8px"
+              type="danger"
+              @click="handleExport"
+              :disabled="disabled"
+              :loading="exportLoading"
+              id="inventoryQueryList-export">导出</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>
+    <!-- alert -->
+    <a-alert type="info" showIcon style="margin-bottom:15px">
+      <div slot="message">节省总金额: <strong>{{ dataTotalCount }}</strong> ;总数量:<strong>{{ productTotal.productTotalCost }}</strong>。 </div>
+    </a-alert>
+    <!-- 列表 -->
+    <s-table
+      class="sTable"
+      ref="table"
+      size="default"
+      :rowKey="(record) => record.id"
+      :columns="columns"
+      :data="loadData"
+      :scroll="{ x: 1610, y: tableHeight }"
+      bordered>
+      <!-- 操作 -->
+      <template slot="action" slot-scope="text, record">
+        <a-button
+          size="small"
+          type="link"
+          class="button-success"
+          @click="handleDetail(record)"
+          id="productStatisticsList-detail-btn">详情</a-button>
+      </template>
+    </s-table>
+    <!-- 详情 -->
+    <productStatisticsDetailModal :openModal="openModal" :itemId="itemId" @close="closeModal" />
+  </a-card>
+</template>
+
+<script>
+import moment from 'moment'
+import { STable, VSelect } from '@/components'
+// import { dealerProductBrandQuery } from '@/api/dealerProductBrand'
+// import { dealerProductTypeList } from '@/api/dealerProductType'
+// import { dealerProductList, dealerProductUpdate, dealerProductExport } from '@/api/dealerProduct'
+import productStatisticsDetailModal from './detailModal.vue'
+export default {
+  components: { STable, VSelect, productStatisticsDetailModal },
+  data () {
+    return {
+      advanced: false, // 高级搜索 展开/关闭
+      tableHeight: 0,
+      productType: [],
+      createDate: [], //  统计时间
+      dateFormat: 'YYYY-MM-DD',
+      queryParam: { //  查询条件
+        code: '', //  产品编码
+        name: '', //  产品名称
+        productBrandSn: undefined, //  产品品牌
+        productTypeSn1: '', //  产品一级分类
+        productTypeSn2: '', //  产品二级分类
+        productTypeSn3: '' //  产品三级分类
+      },
+      disabled: false, //  查询、重置按钮是否可操作
+      exportLoading: false, // 导出loading
+      columns: [
+        { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
+        { title: '品牌', dataIndex: 'productBrandName', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'name', align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
+        { title: '产品编码', dataIndex: 'code', width: 220, align: 'center' },
+        { title: '数量', dataIndex: 'terminasslPrice', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '单位', dataIndex: 'origCode', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '节省金额', dataIndex: 'terminalPrice', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? '¥' + text : '--') } },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: 150, align: 'center', fixed: 'right' }
+      ],
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        // this.disabled = true
+        // if (this.tableHeight == 0) {
+        //   this.tableHeight = window.innerHeight - 380
+        // }
+        // // 统计时间
+        // if (this.createDate && this.createDate.length > 0) {
+        //   this.queryParam.beginDate = moment(this.createDate[0]).format(this.dateFormat)
+        //   this.queryParam.endDate = moment(this.createDate[1]).format(this.dateFormat)
+        // } else {
+        //   this.queryParam.beginDate = undefined
+        //   this.queryParam.endDate = undefined
+        // }
+        // return dealerProductList(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
+        //     const productTypeName1 = data.list[i].productTypeName1 ? data.list[i].productTypeName1 : ''
+        //     const productTypeName2 = data.list[i].productTypeName2 ? ' > ' + data.list[i].productTypeName2 : ''
+        //     const productTypeName3 = data.list[i].productTypeName3 ? ' > ' + data.list[i].productTypeName3 : ''
+        //     data.list[i].productTypeName = productTypeName1 + productTypeName2 + productTypeName3
+        //   }
+        //   this.disabled = false
+        //   return data
+        // })
+        const _this = this
+        return new Promise(function (resolve, reject) {
+          const data = {
+            pageNo: 1,
+            pageSize: 10,
+            list: [
+              { id: '1', productNum: 'jgqp11111111111', productName: '产品1', productOldNum: 'jgqp111123545', productBrand: '箭冠品牌', inventoryNumss: '0' },
+              { id: '2', productNum: 'jgqp11111111111', productName: '产品1', productOldNum: 'jgqp111123545', productBrand: '箭冠品牌', inventoryNumss: '0' },
+              { id: '3', productNum: 'jgqp11111111111', productName: '产品1', productOldNum: 'jgqp111123545', productBrand: '箭冠品牌', inventoryNumss: '0' }
+            ]
+          }
+          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
+          resolve(data)
+        })
+      },
+      openModal: false, //  查看客户详情  弹框
+      itemId: '', //  当前产品id
+      productBrandList: [], //  品牌下拉数据
+      productTypeList: [], //  分类下拉数据
+      productTotal: { // 合计信息
+        productTotalCost: '',
+        productTotalQty: ''
+      },
+      dataTotalCount: '' //  列表数据总条数
+    }
+  },
+  methods: {
+    // 不可选日期
+    disabledDate (date, dateStrings) {
+      return date && date.valueOf() > Date.now()
+    },
+    //  重置
+    resetSearchForm () {
+      this.queryParam.code = ''
+      this.queryParam.name = ''
+      this.queryParam.productBrandSn = undefined
+      this.queryParam.productTypeSn1 = ''
+      this.queryParam.productTypeSn2 = ''
+      this.queryParam.productTypeSn3 = ''
+      this.productType = []
+      this.createDate = []
+      this.$refs.table.refresh(true)
+    },
+    //  详情
+    handleDetail (row) {
+      this.itemId = row.id
+      this.openModal = true
+    },
+    //  关闭弹框
+    closeModal () {
+      this.itemId = ''
+      this.openModal = false
+    },
+    //  产品分类  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 () {
+      // dealerProductBrandQuery({ 'sysFlag': '0' }).then(res => {
+      //   if (res.status == 200) {
+      //     this.productBrandList = res.data
+      //   } else {
+      //     this.productBrandList = []
+      //   }
+      // })
+    },
+    //  产品分类  列表
+    getProductType () {
+      // dealerProductTypeList({ 'sysFlag': '0' }).then(res => {
+      //   if (res.status == 200) {
+      //     this.productTypeList = res.data
+      //   } else {
+      //     this.productTypeList = []
+      //   }
+      // })
+    },
+    filterOption (input, option) {
+      return (
+        option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
+      )
+    }
+  },
+  beforeRouteEnter (to, from, next) {
+    next(vm => {
+      vm.getProductBrand()
+      vm.getProductType()
+    })
+  }
+}
+</script>