Преглед на файлове

Merge branch 'develop_yh13' of http://git.chelingzhu.com/jianguan-web/jg-ocs-html into develop_yh13

lilei преди 2 години
родител
ревизия
921b56b989
променени са 3 файла, в които са добавени 209 реда и са изтрити 171 реда
  1. 53 0
      src/api/reportData.js
  2. 98 80
      src/views/reportData/receivedSendStorageReport/index.vue
  3. 58 91
      src/views/reportData/receivedSendStorageReport/list.vue

+ 53 - 0
src/api/reportData.js

@@ -809,3 +809,56 @@ export const billNoExport = (params) => {
     responseType: 'blob'
   })
 }
+
+/*
+**   收发存报表
+*/
+// 收发存报表  明细列表
+export const queryDetailReportPage = (params) => {
+  const url = `/report/reportStockPsi/queryDetailReportPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+// 收发存报表  导出
+export const exportDetailReport = (params) => {
+  return axios({
+    url: '/report/reportStockPsi/exportDetailReport',
+    data: params,
+    method: 'post',
+    responseType: 'blob'
+  })
+}
+// 收发存报表  汇总列表
+export const queryGroupByprodTypeReportPage = (params) => {
+  const url = `/report/reportStockPsi/queryGroupByProdTypeReportPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+// 收发存报表  进销存合计统计
+export const queryReportCount = (params) => {
+  const url = `/report/reportStockPsi/queryReportCount`
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+// 收发存报表  汇总导出
+export const exportGroupByProductTypeReport = (params) => {
+  return axios({
+    url: '/report/reportStockPsi/exportGroupByProductTypeReport',
+    data: params,
+    method: 'post',
+    responseType: 'blob'
+  })
+}

+ 98 - 80
src/views/reportData/receivedSendStorageReport/index.vue

@@ -50,13 +50,13 @@
             </a-form-model-item>
           </a-col>
           <a-col :md="24" :sm="24" style="margin-bottom: 10px;display:flex;align-item:center;justify-content:center;">
-            <a-button type="primary" @click="handleSearch" :disabled="disabled" id="receivedSendStorageReport-refresh">查询</a-button>
+            <a-button type="primary" @click="testForm('search')" :disabled="disabled" id="receivedSendStorageReport-refresh">查询</a-button>
             <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="receivedSendStorageReport-reset">重置</a-button>
             <a-button
               style="margin-left: 5px"
               type="primary"
               class="button-warning"
-              @click="handleExport"
+              @click="testForm('export')"
               :disabled="disabled"
               v-if="$hasPermissions('B_ProductPriceExoprt')"
               id="productInfoList-export">导出</a-button>
@@ -64,51 +64,48 @@
         </a-row>
       </a-form-model>
     </div>
-    <div :style="{ height: tableHeight+84.5+'px' }">
-      <a-tabs default-active-key="1" @change="handleChange">
-        <a-tab-pane key="1" tab="明细">
-          <div class="detailCon">
-            <!-- 列表 -->
-            <s-table
-              class="sTable"
-              ref="table"
-              size="small"
-              :rowKey="(record) => record.id"
-              :columns="columns"
-              :data="loadData"
-              :customRow="handleClickRow"
-              :scroll="{ y: 149 }"
-              :defaultLoadData="false"
-              bordered>
-              <template slot="footer">
+    <a-tabs default-active-key="1" @change="handleChange" :style="{ height: tableHeight+84.5+'px' }">
+      <a-tab-pane key="1" tab="明细">
+        <!-- 列表 -->
+        <s-table
+          class="sTable"
+          ref="table"
+          size="small"
+          :rowKey="(record) => record.id"
+          :columns="columns"
+          :data="loadData"
+          :scroll="{ y: tableHeight-120 }"
+          :defaultLoadData="false"
+          bordered>
+          <template slot="footer">
+            <a-row>
+              <a-col span="2">合计:</a-col>
+              <a-col span="22">
                 <a-row>
-                  <a-col span="2">合计:</a-col>
-                  <a-col span="22">
-                    <a-row>
-                      <a-col span="4">初期结存数量:{{ (totalData && (totalData.jpLqqAmount || totalData.jpLqqAmount==0)) ? toThousands(totalData.jpLqqAmount) : '--' }}</a-col>
-                      <a-col span="4">初期结存单价:{{ (totalData && (totalData.jpBsxLqqAmount || totalData.jpBsxLqqAmount==0)) ? toThousands(totalData.jpBsxLqqAmount) : '--' }}</a-col>
-                      <a-col span="4">初期结存金额:{{ (totalData && (totalData.gpLqqAmount || totalData.gpLqqAmount==0)) ? toThousands(totalData.gpLqqAmount) : '--' }}</a-col>
-                      <a-col span="4">本期收入数量:{{ (totalData && (totalData.gpLqqAmount || totalData.gpLqqAmount==0)) ? toThousands(totalData.gpLqqAmount) : '--' }}</a-col>
-                      <a-col span="4">本期收入单价:{{ (totalData && (totalData.jpYgpAmount || totalData.jpYgpAmount==0)) ? toThousands(totalData.jpYgpAmount) : '--' }}</a-col>
-                      <a-col span="4">本期收入金额:{{ (totalData && (totalData.jpYgpAmount || totalData.jpYgpAmount==0)) ? toThousands(totalData.jpYgpAmount) : '--' }}</a-col>
-                      <a-col span="4">本期发出数量:{{ (totalData && (totalData.gpYgpAmount || totalData.gpYgpAmount==0)) ? toThousands(totalData.gpYgpAmount) : '--' }}</a-col>
-                      <a-col span="4">本期发出单价:{{ (totalData && (totalData.gpYgpAmount || totalData.gpYgpAmount==0)) ? toThousands(totalData.gpYgpAmount) : '--' }}</a-col>
-                      <a-col span="4">本期发出金额:{{ (totalData && (totalData.jpLbAmount || totalData.jpLbAmount==0)) ? toThousands(totalData.jpLbAmount) : '--' }}</a-col>
-                      <a-col span="4">本期结存数量:{{ (totalData && (totalData.jpScpAmount || totalData.jpScpAmount==0)) ? toThousands(totalData.jpScpAmount) : '--' }}</a-col>
-                      <a-col span="4">本期结存单价:{{ (totalData && (totalData.gpScpAmount || totalData.gpScpAmount==0)) ? toThousands(totalData.gpScpAmount) : '--' }}</a-col>
-                      <a-col span="4">本期结存金额:{{ (totalData && (totalData.tbuAmount || totalData.tbuAmount==0)) ? toThousands(totalData.tbuAmount) : '--' }}</a-col>
-                    </a-row>
-                  </a-col>
+                  <a-col span="4">期初结存数量:{{ (totalData && (totalData.beginQty || totalData.beginQty==0)) ? totalData.beginQty : '--' }}</a-col>
+                  <a-col span="4">期初结存单价:{{ (totalData && (totalData.beginPrice || totalData.beginPrice==0)) ? toThousands(totalData.beginPrice) : '--' }}</a-col>
+                  <a-col span="4">期初结存金额:{{ (totalData && (totalData.beginAmount || totalData.beginAmount==0)) ? toThousands(totalData.beginAmount) : '--' }}</a-col>
+                  <a-col span="4">本期收入数量:{{ (totalData && (totalData.putQty || totalData.putQty==0)) ?totalData.putQty : '--' }}</a-col>
+                  <a-col span="4">本期收入单价:{{ (totalData && (totalData.putPrice || totalData.putPrice==0)) ? toThousands(totalData.putPrice) : '--' }}</a-col>
+                  <a-col span="4">本期收入金额:{{ (totalData && (totalData.putAmount || totalData.putAmount==0)) ? toThousands(totalData.putAmount) : '--' }}</a-col>
+                  <a-col span="4">本期发出数量:{{ (totalData && (totalData.outQty || totalData.outQty==0)) ? totalData.outQty : '--' }}</a-col>
+                  <a-col span="4">本期发出单价:{{ (totalData && (totalData.outPrice || totalData.outPrice==0)) ? toThousands(totalData.outPrice) : '--' }}</a-col>
+                  <a-col span="4">本期发出金额:{{ (totalData && (totalData.outAmount || totalData.outAmount==0)) ? toThousands(totalData.outAmount) : '--' }}</a-col>
+                  <a-col span="4">本期结存数量:{{ (totalData && (totalData.endQty || totalData.endQty==0)) ? totalData.endQty : '--' }}</a-col>
+                  <a-col span="4">本期结存单价:{{ (totalData && (totalData.endPrice || totalData.endPrice==0)) ? toThousands(totalData.endPrice) : '--' }}</a-col>
+                  <a-col span="4">本期结存金额:{{ (totalData && (totalData.endAmount || totalData.endAmount==0)) ? toThousands(totalData.endAmount) : '--' }}</a-col>
                 </a-row>
-              </template>
-            </s-table>
-          </div>
-        </a-tab-pane>
-        <a-tab-pane key="2" tab="汇总" force-render>
-          <gatherList></gatherList>
-        </a-tab-pane>
-      </a-tabs>
-    </div>
+              </a-col>
+            </a-row>
+          </template>
+        </s-table>
+      </a-tab-pane>
+      <a-tab-pane key="2" tab="汇总" force-render>
+        <gatherList ref="gatherBox" :tableHeight="tableHeight" :queryParam="queryParam"></gatherList>
+      </a-tab-pane>
+    </a-tabs>
+    <!-- 导出提示框 -->
+    <reportModal :visible="showExport" @close="showExport=false"></reportModal>
   </a-card>
 </template>
 
@@ -117,14 +114,15 @@ import { commonMixin } from '@/utils/mixin'
 import ProductBrand from '@/views/common/productBrand.js'
 import productTypeAll from '@/views/common/productTypeAll.js'
 import { STable, VSelect } from '@/components'
-import { queryDetailReportPage } from '@/api/reportData'
-import { hdExportExcel, exportDetailReport, exportGroupByProductTypeReport, queryReportCount } from '@/libs/exportExcel'
+import reportModal from '@/views/common/reportModal.vue'
+import { queryDetailReportPage, exportDetailReport, exportGroupByProductTypeReport, queryReportCount } from '@/api/reportData'
+import { hdExportExcel } from '@/libs/exportExcel'
 import gatherList from './list'
 import moment from 'moment'
 export default {
   name: 'PriceDifferenceDetailReportList',
   mixins: [commonMixin],
-  components: { STable, VSelect, ProductBrand, gatherList, productTypeAll },
+  components: { STable, VSelect, ProductBrand, gatherList, productTypeAll, reportModal },
   data () {
     return {
       moment,
@@ -146,45 +144,49 @@ export default {
       rules: {
         time: [{ required: true, message: '请选择月份', trigger: 'change' }]
       },
-      productType: undefined,
+      productType: [],
       disabled: false,
       tableHeight: 0,
       endOpen: false,
+      showExport: false,
       columns: [
-        { title: '产品编码', dataIndex: 'productCode', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品名称', dataIndex: 'productName', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '原厂编码', dataIndex: 'productName', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '品牌', dataIndex: 'productBrandName', width: '20%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '二级分类', dataIndex: 'productName', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '三级分类', dataIndex: 'productName', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '单位', dataIndex: 'productName', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '期初结存数量', dataIndex: 'currentStockQty', width: '12%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '期初结存单价', dataIndex: 'productPrice', width: '12%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '期初结存金额', dataIndex: 'productPrice', width: '12%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '本期收入数量', dataIndex: 'productUnit', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '本期收入单价', dataIndex: 'productPrice', width: '12%', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') },
-        { title: '本期收入金额', dataIndex: 'productPrice', width: '12%', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') },
-        { title: '本期发出数量', dataIndex: 'packQtyV', width: '12%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '本期发出单价', dataIndex: 'productPrice', width: '12%', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') },
-        { title: '本期发出金额', dataIndex: 'productPrice', width: '12%', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') },
-        { title: '期末结存数量', dataIndex: 'salesNums', scopedSlots: { customRender: 'nums' }, width: '12%', align: 'center' },
-        { title: '期末结存单价', dataIndex: 'productPrice', width: '12%', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') },
-        { title: '期末结存金额', dataIndex: 'productPrice', width: '12%', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') }
+        { title: '产品编码', dataIndex: 'productCode', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'productName', width: '30%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '原厂编码', dataIndex: 'productOrigCode', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '品牌', dataIndex: 'productBrandName', width: '15%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '二级分类', dataIndex: 'productTypeName2', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '三级分类', dataIndex: 'productTypeName3', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '单位', dataIndex: 'productUnit', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '期初结存数量', dataIndex: 'beginQty', width: '12%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '期初结存单价', dataIndex: 'beginPrice', width: '12%', align: 'center', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') },
+        { title: '期初结存金额', dataIndex: 'beginAmount', width: '12%', align: 'center', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') },
+        { title: '本期收入数量', dataIndex: 'putQty', width: '12%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '本期收入单价', dataIndex: 'putPrice', width: '12%', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') },
+        { title: '本期收入金额', dataIndex: 'putAmount', width: '12%', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') },
+        { title: '本期发出数量', dataIndex: 'outQty', width: '12%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '本期发出单价', dataIndex: 'outPrice', width: '12%', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') },
+        { title: '本期发出金额', dataIndex: 'outAmount', width: '12%', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') },
+        { title: '期末结存数量', dataIndex: 'endQty', width: '12%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '期末结存单价', dataIndex: 'endPrice', width: '12%', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') },
+        { title: '期末结存金额', dataIndex: 'endAmount', width: '12%', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') }
       ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
         const params = Object.assign(parameter, this.queryParam)
+        this.spinning = true
         return queryDetailReportPage(params).then(res => {
           let data
           if (res.status == 200) {
             data = res.data
-            data.map((item, index) => {
-              item.no = index + 1
-            })
+            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.getCount(params)
           }
-          this.disabled = false
           this.spinning = false
           return data
         })
@@ -248,8 +250,9 @@ export default {
     handleExport () {
       const _this = this
       const params = this.queryParam
-      this.exportLoading = true
-      this.spinning = true
+      _this.exportLoading = true
+      _this.spinning = true
+      _this.showExport = true
       if (this.tabVal == 1) {
         hdExportExcel(exportDetailReport, params, '进销存明细报表', function () {
           _this.exportLoading = false
@@ -262,33 +265,48 @@ export default {
         })
       }
     },
-    // 查询
-    handleSearch () {
+    // 验证表单 type值  search查询 export导出
+    testForm (type) {
       const _this = this
-      if (this.form.time.length != 2) {
+      if (_this.form.time.length != 2) {
         _this.$message.error('请选择月份')
         return
       }
-      this.$refs.ruleForm.validate(valid => {
+      _this.$refs.ruleForm.validate(valid => {
         if (valid) {
-          _this.$refs.table.refresh(true)
+          if (type == 'search') {
+            _this.handleSearch()
+          } else {
+            _this.handleExport()
+          }
         } else {
           _this.$message.error('请选择月份')
           return false
         }
       })
     },
+    // 查询
+    handleSearch () {
+      const _this = this
+      if (_this.tabVal == 1) {
+        _this.$refs.table.refresh(true)
+      } else {
+        _this.$refs.gatherBox.resetCurForm()
+      }
+    },
     // 重置
     resetSearchForm () {
       this.$refs.ruleForm.resetFields()
       this.queryParam.productCode = undefined
       this.queryParam.productName = undefined
       this.queryParam.productBrandSn = undefined
-      this.queryParam.productType = undefined
       this.queryParam.productTypeSn1 = undefined
       this.queryParam.productTypeSn2 = undefined
       this.queryParam.productTypeSn3 = undefined
       this.$refs.table.clearTable()
+      this.productType = []
+      this.$refs.table.refresh(true)
+      this.$refs.gatherBox.resetCurForm()
     },
     pageInit () {
       const _this = this

+ 58 - 91
src/views/reportData/receivedSendStorageReport/list.vue

@@ -8,8 +8,7 @@
       :rowKey="(record) => record.id"
       :columns="columns"
       :data="loadData"
-      :customRow="handleClickRow"
-      :scroll="{ y: 149 }"
+      :scroll="{ y: tableHeight-120 }"
       :defaultLoadData="false"
       bordered>
       <template slot="footer">
@@ -17,18 +16,18 @@
           <a-col span="2">合计:</a-col>
           <a-col span="22">
             <a-row>
-              <a-col span="4">初期结存数量:{{ (totalData && (totalData.jpLqqAmount || totalData.jpLqqAmount==0)) ? toThousands(totalData.jpLqqAmount) : '--' }}</a-col>
-              <a-col span="4">初期结存单价:{{ (totalData && (totalData.jpBsxLqqAmount || totalData.jpBsxLqqAmount==0)) ? toThousands(totalData.jpBsxLqqAmount) : '--' }}</a-col>
-              <a-col span="4">初期结存金额:{{ (totalData && (totalData.gpLqqAmount || totalData.gpLqqAmount==0)) ? toThousands(totalData.gpLqqAmount) : '--' }}</a-col>
-              <a-col span="4">本期收入数量:{{ (totalData && (totalData.gpLqqAmount || totalData.gpLqqAmount==0)) ? toThousands(totalData.gpLqqAmount) : '--' }}</a-col>
-              <a-col span="4">本期收入单价:{{ (totalData && (totalData.jpYgpAmount || totalData.jpYgpAmount==0)) ? toThousands(totalData.jpYgpAmount) : '--' }}</a-col>
-              <a-col span="4">本期收入金额:{{ (totalData && (totalData.jpYgpAmount || totalData.jpYgpAmount==0)) ? toThousands(totalData.jpYgpAmount) : '--' }}</a-col>
-              <a-col span="4">本期发出数量:{{ (totalData && (totalData.gpYgpAmount || totalData.gpYgpAmount==0)) ? toThousands(totalData.gpYgpAmount) : '--' }}</a-col>
-              <a-col span="4">本期发出单价:{{ (totalData && (totalData.gpYgpAmount || totalData.gpYgpAmount==0)) ? toThousands(totalData.gpYgpAmount) : '--' }}</a-col>
-              <a-col span="4">本期发出金额:{{ (totalData && (totalData.jpLbAmount || totalData.jpLbAmount==0)) ? toThousands(totalData.jpLbAmount) : '--' }}</a-col>
-              <a-col span="4">本期结存数量:{{ (totalData && (totalData.jpScpAmount || totalData.jpScpAmount==0)) ? toThousands(totalData.jpScpAmount) : '--' }}</a-col>
-              <a-col span="4">本期结存单价:{{ (totalData && (totalData.gpScpAmount || totalData.gpScpAmount==0)) ? toThousands(totalData.gpScpAmount) : '--' }}</a-col>
-              <a-col span="4">本期结存金额:{{ (totalData && (totalData.tbuAmount || totalData.tbuAmount==0)) ? toThousands(totalData.tbuAmount) : '--' }}</a-col>
+              <a-col span="4">期初结存数量:{{ (totalData && (totalData.beginQty || totalData.beginQty==0)) ? totalData.beginQty : '--' }}</a-col>
+              <a-col span="4">期初结存单价:{{ (totalData && (totalData.beginPrice || totalData.beginPrice==0)) ? toThousands(totalData.beginPrice) : '--' }}</a-col>
+              <a-col span="4">期初结存金额:{{ (totalData && (totalData.beginAmount || totalData.beginAmount==0)) ? toThousands(totalData.beginAmount) : '--' }}</a-col>
+              <a-col span="4">本期收入数量:{{ (totalData && (totalData.putQty || totalData.putQty==0)) ?totalData.putQty : '--' }}</a-col>
+              <a-col span="4">本期收入单价:{{ (totalData && (totalData.putPrice || totalData.putPrice==0)) ? toThousands(totalData.putPrice) : '--' }}</a-col>
+              <a-col span="4">本期收入金额:{{ (totalData && (totalData.putAmount || totalData.putAmount==0)) ? toThousands(totalData.putAmount) : '--' }}</a-col>
+              <a-col span="4">本期发出数量:{{ (totalData && (totalData.outQty || totalData.outQty==0)) ? totalData.outQty : '--' }}</a-col>
+              <a-col span="4">本期发出单价:{{ (totalData && (totalData.outPrice || totalData.outPrice==0)) ? toThousands(totalData.outPrice) : '--' }}</a-col>
+              <a-col span="4">本期发出金额:{{ (totalData && (totalData.outAmount || totalData.outAmount==0)) ? toThousands(totalData.outAmount) : '--' }}</a-col>
+              <a-col span="4">本期结存数量:{{ (totalData && (totalData.endQty || totalData.endQty==0)) ? totalData.endQty : '--' }}</a-col>
+              <a-col span="4">本期结存单价:{{ (totalData && (totalData.endPrice || totalData.endPrice==0)) ? toThousands(totalData.endPrice) : '--' }}</a-col>
+              <a-col span="4">本期结存金额:{{ (totalData && (totalData.endAmount || totalData.endAmount==0)) ? toThousands(totalData.endAmount) : '--' }}</a-col>
             </a-row>
           </a-col>
         </a-row>
@@ -39,63 +38,61 @@
 
 <script>
 import { commonMixin } from '@/utils/mixin'
-import { queryGroupByprodTypeReportPage } from '@/api/stock'
-import ProductType from '@/views/common/productType.js'
-import ProductBrand from '@/views/common/productBrand.js'
+import { queryGroupByprodTypeReportPage, queryReportCount } from '@/api/reportData'
 import { STable, VSelect } from '@/components'
 export default {
   name: 'QueryPart',
   mixins: [commonMixin],
-  components: { STable, VSelect, ProductBrand, ProductType },
+  components: { STable, VSelect },
   props: {
-    newLoading: Boolean
+    newLoading: Boolean,
+    queryParam: {
+      type: Object,
+      default: function () {
+        return {}
+      }
+    },
+    tableHeight: {
+      type: Number,
+      default: 0
+    }
   },
   data () {
     return {
-      advanced: false, // 高级搜索 展开/关闭
-      showSetting: false, // 设置弹框
-      productType: [],
-      buyerSn: '',
-      queryParam: { //  查询条件
-        productCode: '', //  产品编码
-        productName: '', //  产品名称
-        productOrigCode: '', //  原厂编码
-        productBrandSn: undefined, //  产品品牌
-        productTypeSn1: '', //  产品一级分类
-        productTypeSn2: '', //  产品二级分类
-        productTypeSn3: '' //  产品三级分类
-      },
       columns: [
-        { title: '二级分类', dataIndex: 'productCode', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '三级分类', dataIndex: 'productName', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '品牌', dataIndex: 'productBrandName', width: '20%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '期初结存数量', dataIndex: 'currentStockQty', width: '12%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '期初结存单价', dataIndex: 'productPrice', width: '12%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '期初结存金额', dataIndex: 'productPrice', width: '12%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '本期收入数量', dataIndex: 'productUnit', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '本期收入单价', dataIndex: 'productPrice', width: '12%', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') },
-        { title: '本期收入金额', dataIndex: 'productPrice', width: '12%', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') },
-        { title: '本期发出数量', dataIndex: 'packQtyV', width: '12%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '本期发出单价', dataIndex: 'productPrice', width: '12%', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') },
-        { title: '本期发出金额', dataIndex: 'productPrice', width: '12%', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') },
-        { title: '期末结存数量', dataIndex: 'salesNums', scopedSlots: { customRender: 'nums' }, width: '12%', align: 'center' },
-        { title: '期末结存单价', dataIndex: 'productPrice', width: '12%', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') },
-        { title: '期末结存金额', dataIndex: 'productPrice', width: '12%', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') }
+        { title: '二级分类', dataIndex: 'productTypeName2', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '三级分类', dataIndex: 'productTypeName3', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '品牌', dataIndex: 'productBrandName', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '期初结存数量', dataIndex: 'beginQty', width: '12%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '期初结存单价', dataIndex: 'beginPrice', width: '12%', align: 'center', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') },
+        { title: '期初结存金额', dataIndex: 'beginAmount', width: '12%', align: 'center', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') },
+        { title: '本期收入数量', dataIndex: 'putQty', width: '12%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '本期收入单价', dataIndex: 'putPrice', width: '12%', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') },
+        { title: '本期收入金额', dataIndex: 'putAmount', width: '12%', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') },
+        { title: '本期发出数量', dataIndex: 'outQty', width: '12%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '本期发出单价', dataIndex: 'outPrice', width: '12%', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') },
+        { title: '本期发出金额', dataIndex: 'outAmount', width: '12%', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') },
+        { title: '期末结存数量', dataIndex: 'endQty', width: '12%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '期末结存单价', dataIndex: 'endPrice', width: '12%', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') },
+        { title: '期末结存金额', dataIndex: 'endAmount', width: '12%', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') }
       ],
       disabled: false, //  查询、重置按钮是否可操作
+      totalData: null,
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
-        this.queryParam.dealerSn = this.buyerSn
-        return queryGroupByprodTypeReportPage(Object.assign(parameter, this.queryParam)).then(res => {
+        const params = Object.assign(parameter, this.queryParam)
+        return queryGroupByprodTypeReportPage(params).then(res => {
           let data
           if (res.status == 200) {
             data = res.data
-            data.map((item, index) => {
-              item.no = index + 1
-            })
+            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.getCount(params)
           }
-          this.disabled = false
           this.spinning = false
           return data
         })
@@ -103,51 +100,21 @@ export default {
     }
   },
   methods: {
-    // 双击列表
-    handleClickRow (record) {
-      const _this = this
-      return {
-        on: {
-          dblclick: (event) => {
-            if (!record.productPrice || record.productPrice <= 0) {
-              _this.$message.info('该产品暂时不能添加')
-            } else {
-              event.stopPropagation()
-              _this.$emit('add', record, 0)
-            }
-          }
+    getCount (params) {
+      queryReportCount(params).then(res => {
+        if (res.status == 200) {
+          this.totalData = res.data
+        } else {
+          this.totalData = null
         }
-      }
-    },
-    //  重置
-    resetSearchForm () {
-      this.queryParam.productCode = ''
-      this.queryParam.productName = ''
-      this.queryParam.productOrigCode = ''
-      this.queryParam.productBrandSn = undefined
-      this.queryParam.productTypeSn1 = ''
-      this.queryParam.productTypeSn2 = ''
-      this.queryParam.productTypeSn3 = ''
-      this.productType = []
-      this.$refs.table.refresh(true)
+      })
     },
     pageInit (buyerSn) {
-      this.buyerSn = buyerSn
-      this.resetSearchForm()
+      this.resetCurForm()
     },
     // 刷新当前页面
     resetCurForm () {
       this.$refs.table.refresh()
-    },
-    // 选择配件
-    handleAdd (row) {
-      this.$emit('add', row, 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] : ''
     }
   }
 }