Ver código fonte

销售报表对接合计

chenrui 3 anos atrás
pai
commit
3b495d8f0c

+ 19 - 1
src/api/salesBillReport.js

@@ -24,6 +24,15 @@ export const salesBillReportGroupByBuyerList = (params) => {
   })
 }
 
+//  开单销售单报表/开单销售报表   合计
+export const salesBillReportCount = (params) => {
+  return axios({
+    url: '/report/salesBillReport/totalSaleAmount',
+    data: params,
+    method: 'post'
+  })
+}
+
 // 实售销售报表
 export const salesBillRealAmountQueryPageList = (params) => {
   const url = `/report/salesBillReport/realAmountQueryPageGroupByBuyer/${params.pageNo}/${params.pageSize}`
@@ -34,4 +43,13 @@ export const salesBillRealAmountQueryPageList = (params) => {
     data: params,
     method: 'post'
   })
-}
+}
+
+//  实售销售报表   合计
+export const salesBillRealReportCount = (params) => {
+  return axios({
+    url: '/report/salesBillReport/totalRealAmount',
+    data: params,
+    method: 'post'
+  })
+}

+ 77 - 33
src/views/reportData/actualSalesReport/list.vue

@@ -88,18 +88,48 @@
         :data="loadData"
         :scroll="{ x: 3120 }"
         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.jpLbAmount || totalData.jpLbAmount==0)) ? totalData.jpLbAmount : '--' }}</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">汇箭:{{ (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-col span="4">TBU:{{ (totalData && (totalData.tbuAmount || totalData.tbuAmount==0)) ? totalData.tbuAmount : '--' }}</a-col>
+                <a-col span="4">NGK:{{ (totalData && (totalData.ngkAmount || totalData.ngkAmount==0)) ? totalData.ngkAmount : '--' }}</a-col>
+                <a-col span="4">飞利浦:{{ (totalData && (totalData.flpAmount || totalData.flpAmount==0)) ? totalData.flpAmount : '--' }}</a-col>
+                <a-col span="4">车仆:{{ (totalData && (totalData.cpAmount || totalData.cpAmount==0)) ? totalData.cpAmount : '--' }}</a-col>
+                <a-col span="4">瓦尔塔:{{ (totalData && (totalData.wetAmount || totalData.wetAmount==0)) ? totalData.wetAmount : '--' }}</a-col>
+                <a-col span="4">雷贝斯托:{{ (totalData && (totalData.lbstAmount || totalData.lbstAmount==0)) ? totalData.lbstAmount : '--' }}</a-col>
+                <a-col span="4">德尔福:{{ (totalData && (totalData.defAmount || totalData.defAmount==0)) ? totalData.defAmount : '--' }}</a-col>
+                <a-col span="4">巴诺德:{{ (totalData && (totalData.bndAmount || totalData.bndAmount==0)) ? totalData.bndAmount : '--' }}</a-col>
+                <a-col span="4">实售销售合计金额:{{ (totalData && (totalData.totalAmount || totalData.totalAmount==0)) ? totalData.totalAmount : '--' }}</a-col>
+              </a-row>
+            </a-col>
+          </a-row>
+        </template>
       </s-table>
     </a-spin>
   </a-card>
 </template>
 
 <script>
+import getDate from '@/libs/getDate.js'
 import { STable, VSelect } from '@/components'
 import rangeDate from '@/views/common/rangeDate.vue'
 import custList from '@/views/common/custList.vue'
 import subarea from '@/views/common/subarea.js'
 import { getArea } from '@/api/data'
-import { salesBillRealAmountQueryPageList } from '@/api/salesBillReport'
+import { salesBillRealAmountQueryPageList, salesBillRealReportCount } from '@/api/salesBillReport'
 export default {
   components: { STable, VSelect, rangeDate, subarea, custList },
   data () {
@@ -108,9 +138,12 @@ export default {
       advanced: false, // 高级搜索 展开/关闭
       tableHeight: 0,
       queryParam: { //  查询条件
-        time: [],
-        beginDate: '',
-        endDate: '',
+        time: [
+          getDate.getCurrMonthDays().starttime,
+          getDate.getCurrMonthDays().endtime
+        ],
+        beginDate: getDate.getCurrMonthDays().starttime,
+        endDate: getDate.getCurrMonthDays().endtime,
         dealer: {
           'dealerSn': undefined,
           'provinceSn': undefined,
@@ -143,35 +176,35 @@ export default {
                   dataIndex: 'jpLqqAmount',
                   align: 'center',
                   width: 100,
-                  customRender: function (text) { return text ? ('¥' + text) : '0' }
+                  customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
                 },
                 {
                   title: '雨刮片',
                   dataIndex: 'jpYgpAmount',
                   align: 'center',
                   width: 100,
-                  customRender: function (text) { return text ? ('¥' + text) : '0' }
+                  customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
                 },
                 {
                   title: '喇叭',
                   dataIndex: 'jpLbAmount',
                   align: 'center',
                   width: 100,
-                  customRender: function (text) { return text ? ('¥' + text) : '0' }
+                  customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
                 },
                 {
                   title: '刹车片',
                   dataIndex: 'pp4',
                   align: 'jpScpAmount',
                   width: 100,
-                  customRender: function (text) { return text ? ('¥' + text) : '0' }
+                  customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
                 },
                 {
                   title: '感应线',
                   dataIndex: 'jpGyxAmount',
                   align: 'center',
                   width: 100,
-                  customRender: function (text) { return text ? ('¥' + text) : '0' }
+                  customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
                 }
               ]
             },
@@ -184,21 +217,21 @@ export default {
                   dataIndex: 'gpLqqAmount',
                   align: 'center',
                   width: 100,
-                  customRender: function (text) { return text ? ('¥' + text) : '0' }
+                  customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
                 },
                 {
                   title: '雨刮片',
                   dataIndex: 'gpYgpAmount',
                   align: 'center',
                   width: 100,
-                  customRender: function (text) { return text ? ('¥' + text) : '0' }
+                  customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
                 },
                 {
                   title: '刹车片',
                   dataIndex: 'gpScpAmount',
                   align: 'center',
                   width: 100,
-                  customRender: function (text) { return text ? ('¥' + text) : '0' }
+                  customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
                 }
               ]
             },
@@ -207,28 +240,28 @@ export default {
               dataIndex: 'hjAmount',
               align: 'center',
               width: 100,
-              customRender: function (text) { return text ? ('¥' + text) : '0' }
+              customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
             },
             {
               title: '德路斯',
               dataIndex: 'dlsAmount',
               align: 'center',
               width: 100,
-              customRender: function (text) { return text ? ('¥' + text) : '0' }
+              customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
             },
             {
               title: '稳升',
               dataIndex: 'wsAmount',
               align: 'center',
               width: 100,
-              customRender: function (text) { return text ? ('¥' + text) : '0' }
+              customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
             },
             {
               title: 'TBU',
               dataIndex: 'tbuAmount',
               align: 'center',
               width: 100,
-              customRender: function (text) { return text ? ('¥' + text) : '0' }
+              customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
             }
           ] },
         { title: '代理品牌',
@@ -239,52 +272,52 @@ export default {
               dataIndex: 'ngkAmount',
               align: 'center',
               width: 100,
-              customRender: function (text) { return text ? ('¥' + text) : '0' }
+              customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
             },
             {
               title: '飞利浦',
               dataIndex: 'flpAmount',
               align: 'center',
               width: 100,
-              customRender: function (text) { return text ? ('¥' + text) : '0' }
+              customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
             },
             {
               title: '车仆',
               dataIndex: 'cpAmount',
               align: 'center',
               width: 100,
-              customRender: function (text) { return text ? ('¥' + text) : '0' }
+              customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
             },
             {
               title: '瓦尔塔',
               dataIndex: 'wetAmount',
               align: 'center',
               width: 100,
-              customRender: function (text) { return text ? ('¥' + text) : '0' }
+              customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
             },
             {
               title: '雷贝斯托',
               dataIndex: 'lbstAmount',
               align: 'center',
               width: 100,
-              customRender: function (text) { return text ? ('¥' + text) : '0' }
+              customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
             },
             {
               title: '德尔福',
               dataIndex: 'defAmount',
               align: 'center',
               width: 100,
-              customRender: function (text) { return text ? ('¥' + text) : '0' }
+              customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
             },
             {
               title: '巴诺德',
               dataIndex: 'bndAmount',
               align: 'center',
               width: 100,
-              customRender: function (text) { return text ? ('¥' + text) : '0' }
+              customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
             }
           ] },
-        { title: '实销售合计金额', width: 200, dataIndex: 'totalAmount', align: 'center', customRender: function (text) { return text ? ('¥' + text) : '0' } }
+        { title: '实销售合计金额', width: 200, dataIndex: 'totalAmount', align: 'center', customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' } }
       ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
@@ -295,27 +328,34 @@ export default {
         }
         const paramsPage = Object.assign(this.queryParam, { pageNo: parameter.pageNo, pageSize: parameter.pageSize }) //  有分页
         return salesBillRealAmountQueryPageList(paramsPage).then(res => {
+          this.getCount(paramsPage)
           const data = res.data
           const no = (data.pageNo - 1) * data.pageSize
           for (var i = 0; i < data.list.length; i++) {
-            const row = data.list[i]
-            row.no = no + i + 1
-            row.totalAmount = row.jpLqqAmount + row.jpYgpAmount + row.jpLbAmount + row.jpScpAmount
-            row.totalAmount += row.jpGyxAmount + row.gpLqqAmount + row.gpYgpAmount + row.gpScpAmount + row.hjAmount
-            row.totalAmount += row.dlsAmount + row.wsAmount + row.tbuAmount + row.ngkAmount + row.flpAmount + row.cpAmount
-            row.totalAmount += row.wetAmount + row.lbstAmount + row.defAmount + row.bndAmount
+            data.list[i].no = no + i + 1
           }
           this.disabled = false
           this.spinning = false
           return data
         })
       },
+      totalData: null,
       addrProvinceList: [], //  省下拉
       addrCityList: [], //  市下拉
       addrDistrictList: [] //  区下拉
     }
   },
   methods: {
+    // 总计
+    getCount (params) {
+      salesBillRealReportCount(params).then(res => {
+        if (res.status == 200 && res.data) {
+          this.totalData = res.data
+        } else {
+          this.totalData = null
+        }
+      })
+    },
     handleSearch () {
       const _this = this
       this.$refs.ruleForm.validate(valid => {
@@ -343,9 +383,13 @@ export default {
     },
     //  重置
     resetSearchForm () {
-      this.queryParam.time = []
-      this.queryParam.beginDate = ''
-      this.queryParam.endDate = ''
+      this.queryParam.time = [
+        getDate.getCurrMonthDays().starttime,
+        getDate.getCurrMonthDays().endtime
+      ]
+      this.$refs.rangeDate.resetDate(this.queryParam.time)
+      this.queryParam.beginDate = getDate.getCurrMonthDays().starttime
+      this.queryParam.endDate = getDate.getCurrMonthDays().endtime
       this.queryParam.dealer = {
         'dealerSn': undefined,
         'provinceSn': undefined,

+ 79 - 35
src/views/reportData/salesAmountReport/list.vue

@@ -88,18 +88,48 @@
         :data="loadData"
         :scroll="{ x: 3120 }"
         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.jpLbAmount || totalData.jpLbAmount==0)) ? totalData.jpLbAmount : '--' }}</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">汇箭:{{ (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-col span="4">TBU:{{ (totalData && (totalData.tbuAmount || totalData.tbuAmount==0)) ? totalData.tbuAmount : '--' }}</a-col>
+                <a-col span="4">NGK:{{ (totalData && (totalData.ngkAmount || totalData.ngkAmount==0)) ? totalData.ngkAmount : '--' }}</a-col>
+                <a-col span="4">飞利浦:{{ (totalData && (totalData.flpAmount || totalData.flpAmount==0)) ? totalData.flpAmount : '--' }}</a-col>
+                <a-col span="4">车仆:{{ (totalData && (totalData.cpAmount || totalData.cpAmount==0)) ? totalData.cpAmount : '--' }}</a-col>
+                <a-col span="4">瓦尔塔:{{ (totalData && (totalData.wetAmount || totalData.wetAmount==0)) ? totalData.wetAmount : '--' }}</a-col>
+                <a-col span="4">雷贝斯托:{{ (totalData && (totalData.lbstAmount || totalData.lbstAmount==0)) ? totalData.lbstAmount : '--' }}</a-col>
+                <a-col span="4">德尔福:{{ (totalData && (totalData.defAmount || totalData.defAmount==0)) ? totalData.defAmount : '--' }}</a-col>
+                <a-col span="4">巴诺德:{{ (totalData && (totalData.bndAmount || totalData.bndAmount==0)) ? totalData.bndAmount : '--' }}</a-col>
+                <a-col span="6">开单销售合计金额:{{ (totalData && (totalData.totalAmount || totalData.totalAmount==0)) ? totalData.totalAmount : '--' }}</a-col>
+              </a-row>
+            </a-col>
+          </a-row>
+        </template>
       </s-table>
     </a-spin>
   </a-card>
 </template>
 
 <script>
+import getDate from '@/libs/getDate.js'
 import { STable, VSelect } from '@/components'
 import rangeDate from '@/views/common/rangeDate.vue'
 import custList from '@/views/common/custList.vue'
 import subarea from '@/views/common/subarea.js'
 import { getArea } from '@/api/data'
-import { salesBillReportGroupByBuyerList } from '@/api/salesBillReport'
+import { salesBillReportGroupByBuyerList, salesBillReportCount } from '@/api/salesBillReport'
 export default {
   components: { STable, VSelect, rangeDate, subarea, custList },
   data () {
@@ -108,9 +138,12 @@ export default {
       advanced: false, // 高级搜索 展开/关闭
       tableHeight: 0,
       queryParam: { //  查询条件
-        time: [],
-        beginDate: '',
-        endDate: '',
+        time: [
+          getDate.getCurrMonthDays().starttime,
+          getDate.getCurrMonthDays().endtime
+        ],
+        beginDate: getDate.getCurrMonthDays().starttime,
+        endDate: getDate.getCurrMonthDays().endtime,
         dealer: {
           'dealerSn': undefined,
           'provinceSn': undefined,
@@ -127,7 +160,7 @@ export default {
       exportLoading: false,
       columns: [
         { title: '序号', dataIndex: 'no', width: 80, align: 'center', fixed: 'left' },
-        { title: '区域', dataIndex: 'dealer.subareaNameSet', width: 220, align: 'center', customRender: function (text) { return text ? text.join('/') : '--' } },
+        { title: '区域', dataIndex: 'dealer.subareaNameSet', width: 220, align: 'center', customRender: function (text) { return (text && text.length > 0) ? text.join('/') : '--' } },
         { title: '省份', dataIndex: 'dealer.provinceName', width: 200, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '客户名称', dataIndex: 'dealer.dealerName', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '客户类型', dataIndex: 'dealer.dealerLevelDictValue', width: 200, align: 'center', customRender: function (text) { return text || '--' } },
@@ -143,35 +176,35 @@ export default {
                   dataIndex: 'jpLqqAmount',
                   align: 'center',
                   width: 100,
-                  customRender: function (text) { return text ? ('¥' + text) : '0' }
+                  customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
                 },
                 {
                   title: '雨刮片',
                   dataIndex: 'jpYgpAmount',
                   align: 'center',
                   width: 100,
-                  customRender: function (text) { return text ? ('¥' + text) : '0' }
+                  customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
                 },
                 {
                   title: '喇叭',
                   dataIndex: 'jpLbAmount',
                   align: 'center',
                   width: 100,
-                  customRender: function (text) { return text ? ('¥' + text) : '0' }
+                  customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
                 },
                 {
                   title: '刹车片',
                   dataIndex: 'pp4',
                   align: 'jpScpAmount',
                   width: 100,
-                  customRender: function (text) { return text ? ('¥' + text) : '0' }
+                  customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
                 },
                 {
                   title: '感应线',
                   dataIndex: 'jpGyxAmount',
                   align: 'center',
                   width: 100,
-                  customRender: function (text) { return text ? ('¥' + text) : '0' }
+                  customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
                 }
               ]
             },
@@ -184,21 +217,21 @@ export default {
                   dataIndex: 'gpLqqAmount',
                   align: 'center',
                   width: 100,
-                  customRender: function (text) { return text ? ('¥' + text) : '0' }
+                  customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
                 },
                 {
                   title: '雨刮片',
                   dataIndex: 'gpYgpAmount',
                   align: 'center',
                   width: 100,
-                  customRender: function (text) { return text ? ('¥' + text) : '0' }
+                  customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
                 },
                 {
                   title: '刹车片',
                   dataIndex: 'gpScpAmount',
                   align: 'center',
                   width: 100,
-                  customRender: function (text) { return text ? ('¥' + text) : '0' }
+                  customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
                 }
               ]
             },
@@ -207,28 +240,28 @@ export default {
               dataIndex: 'hjAmount',
               align: 'center',
               width: 100,
-              customRender: function (text) { return text ? ('¥' + text) : '0' }
+              customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
             },
             {
               title: '德路斯',
               dataIndex: 'dlsAmount',
               align: 'center',
               width: 100,
-              customRender: function (text) { return text ? ('¥' + text) : '0' }
+              customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
             },
             {
               title: '稳升',
               dataIndex: 'wsAmount',
               align: 'center',
               width: 100,
-              customRender: function (text) { return text ? ('¥' + text) : '0' }
+              customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
             },
             {
               title: 'TBU',
               dataIndex: 'tbuAmount',
               align: 'center',
               width: 100,
-              customRender: function (text) { return text ? ('¥' + text) : '0' }
+              customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
             }
           ] },
         { title: '代理品牌',
@@ -239,52 +272,52 @@ export default {
               dataIndex: 'ngkAmount',
               align: 'center',
               width: 100,
-              customRender: function (text) { return text ? ('¥' + text) : '0' }
+              customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
             },
             {
               title: '飞利浦',
               dataIndex: 'flpAmount',
               align: 'center',
               width: 100,
-              customRender: function (text) { return text ? ('¥' + text) : '0' }
+              customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
             },
             {
               title: '车仆',
               dataIndex: 'cpAmount',
               align: 'center',
               width: 100,
-              customRender: function (text) { return text ? ('¥' + text) : '0' }
+              customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
             },
             {
               title: '瓦尔塔',
               dataIndex: 'wetAmount',
               align: 'center',
               width: 100,
-              customRender: function (text) { return text ? ('¥' + text) : '0' }
+              customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
             },
             {
               title: '雷贝斯托',
               dataIndex: 'lbstAmount',
               align: 'center',
               width: 100,
-              customRender: function (text) { return text ? ('¥' + text) : '0' }
+              customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
             },
             {
               title: '德尔福',
               dataIndex: 'defAmount',
               align: 'center',
               width: 100,
-              customRender: function (text) { return text ? ('¥' + text) : '0' }
+              customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
             },
             {
               title: '巴诺德',
               dataIndex: 'bndAmount',
               align: 'center',
               width: 100,
-              customRender: function (text) { return text ? ('¥' + text) : '0' }
+              customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
             }
           ] },
-        { title: '实际销售合计金额', width: 200, dataIndex: 'totalAmount', align: 'center', customRender: function (text) { return text ? ('¥' + text) : '0' } }
+        { title: '开单销售合计金额', width: 200, dataIndex: 'totalAmount', align: 'center', customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' } }
       ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
@@ -294,28 +327,36 @@ export default {
           this.tableHeight = window.innerHeight - 380
         }
         const paramsPage = Object.assign(this.queryParam, { pageNo: parameter.pageNo, pageSize: parameter.pageSize }) //  有分页
+        delete paramsPage.time
         return salesBillReportGroupByBuyerList(paramsPage).then(res => {
+          this.getCount(paramsPage)
           const data = res.data
           const no = (data.pageNo - 1) * data.pageSize
           for (var i = 0; i < data.list.length; i++) {
-            const row = data.list[i]
-            row.no = no + i + 1
-            row.totalAmount = row.jpLqqAmount + row.jpYgpAmount + row.jpLbAmount + row.jpScpAmount
-            row.totalAmount += row.jpGyxAmount + row.gpLqqAmount + row.gpYgpAmount + row.gpScpAmount + row.hjAmount
-            row.totalAmount += row.dlsAmount + row.wsAmount + row.tbuAmount + row.ngkAmount + row.flpAmount + row.cpAmount
-            row.totalAmount += row.wetAmount + row.lbstAmount + row.defAmount + row.bndAmount
+            data.list[i].no = no + i + 1
           }
           this.disabled = false
           this.spinning = false
           return data
         })
       },
+      totalData: null,
       addrProvinceList: [], //  省下拉
       addrCityList: [], //  市下拉
       addrDistrictList: [] //  区下拉
     }
   },
   methods: {
+    // 总计
+    getCount (params) {
+      salesBillReportCount(params).then(res => {
+        if (res.status == 200 && res.data) {
+          this.totalData = res.data
+        } else {
+          this.totalData = null
+        }
+      })
+    },
     handleSearch () {
       const _this = this
       this.$refs.ruleForm.validate(valid => {
@@ -343,10 +384,13 @@ export default {
     },
     //  重置
     resetSearchForm () {
-      this.$refs.rangeDate.resetDate()
-      this.queryParam.time = []
-      this.queryParam.beginDate = ''
-      this.queryParam.endDate = ''
+      this.queryParam.time = [
+        getDate.getCurrMonthDays().starttime,
+        getDate.getCurrMonthDays().endtime
+      ]
+      this.$refs.rangeDate.resetDate(this.queryParam.time)
+      this.queryParam.beginDate = getDate.getCurrMonthDays().starttime
+      this.queryParam.endDate = getDate.getCurrMonthDays().endtime
       this.queryParam.dealer = {
         'dealerSn': undefined,
         'provinceSn': undefined,

+ 77 - 34
src/views/reportData/salesSlipReport/list.vue

@@ -93,18 +93,48 @@
         :data="loadData"
         :scroll="{ x: 3220 }"
         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.jpLbAmount || totalData.jpLbAmount==0)) ? totalData.jpLbAmount : '--' }}</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">汇箭:{{ (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-col span="4">TBU:{{ (totalData && (totalData.tbuAmount || totalData.tbuAmount==0)) ? totalData.tbuAmount : '--' }}</a-col>
+                <a-col span="4">NGK:{{ (totalData && (totalData.ngkAmount || totalData.ngkAmount==0)) ? totalData.ngkAmount : '--' }}</a-col>
+                <a-col span="4">飞利浦:{{ (totalData && (totalData.flpAmount || totalData.flpAmount==0)) ? totalData.flpAmount : '--' }}</a-col>
+                <a-col span="4">车仆:{{ (totalData && (totalData.cpAmount || totalData.cpAmount==0)) ? totalData.cpAmount : '--' }}</a-col>
+                <a-col span="4">瓦尔塔:{{ (totalData && (totalData.wetAmount || totalData.wetAmount==0)) ? totalData.wetAmount : '--' }}</a-col>
+                <a-col span="4">雷贝斯托:{{ (totalData && (totalData.lbstAmount || totalData.lbstAmount==0)) ? totalData.lbstAmount : '--' }}</a-col>
+                <a-col span="4">德尔福:{{ (totalData && (totalData.defAmount || totalData.defAmount==0)) ? totalData.defAmount : '--' }}</a-col>
+                <a-col span="4">巴诺德:{{ (totalData && (totalData.bndAmount || totalData.bndAmount==0)) ? totalData.bndAmount : '--' }}</a-col>
+                <a-col span="4">开单销售单合计金额:{{ (totalData && (totalData.totalAmount || totalData.totalAmount==0)) ? totalData.totalAmount : '--' }}</a-col>
+              </a-row>
+            </a-col>
+          </a-row>
+        </template>
       </s-table>
     </a-spin>
   </a-card>
 </template>
 
 <script>
+import getDate from '@/libs/getDate.js'
 import { STable, VSelect } from '@/components'
 import rangeDate from '@/views/common/rangeDate.vue'
 import custList from '@/views/common/custList.vue'
 import subarea from '@/views/common/subarea.js'
 import { getArea } from '@/api/data'
-import { salesBillReportList } from '@/api/salesBillReport'
+import { salesBillReportList, salesBillReportCount } from '@/api/salesBillReport'
 export default {
   components: { STable, VSelect, rangeDate, subarea, custList },
   data () {
@@ -113,9 +143,12 @@ export default {
       advanced: false, // 高级搜索 展开/关闭
       tableHeight: 0,
       queryParam: { //  查询条件
-        time: [],
-        beginDate: '',
-        endDate: '',
+        time: [
+          getDate.getCurrMonthDays().starttime,
+          getDate.getCurrMonthDays().endtime
+        ],
+        beginDate: getDate.getCurrMonthDays().starttime,
+        endDate: getDate.getCurrMonthDays().endtime,
         salesBillNo: '', //  销售单号
         dealer: {
           'dealerSn': undefined,
@@ -150,35 +183,35 @@ export default {
                   dataIndex: 'jpLqqAmount',
                   align: 'center',
                   width: 100,
-                  customRender: function (text) { return text ? ('¥' + text) : '0' }
+                  customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
                 },
                 {
                   title: '雨刮片',
                   dataIndex: 'jpYgpAmount',
                   align: 'center',
                   width: 100,
-                  customRender: function (text) { return text ? ('¥' + text) : '0' }
+                  customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
                 },
                 {
                   title: '喇叭',
                   dataIndex: 'jpLbAmount',
                   align: 'center',
                   width: 100,
-                  customRender: function (text) { return text ? ('¥' + text) : '0' }
+                  customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
                 },
                 {
                   title: '刹车片',
                   dataIndex: 'pp4',
                   align: 'jpScpAmount',
                   width: 100,
-                  customRender: function (text) { return text ? ('¥' + text) : '0' }
+                  customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
                 },
                 {
                   title: '感应线',
                   dataIndex: 'jpGyxAmount',
                   align: 'center',
                   width: 100,
-                  customRender: function (text) { return text ? ('¥' + text) : '0' }
+                  customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
                 }
               ]
             },
@@ -191,21 +224,21 @@ export default {
                   dataIndex: 'gpLqqAmount',
                   align: 'center',
                   width: 100,
-                  customRender: function (text) { return text ? ('¥' + text) : '0' }
+                  customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
                 },
                 {
                   title: '雨刮片',
                   dataIndex: 'gpYgpAmount',
                   align: 'center',
                   width: 100,
-                  customRender: function (text) { return text ? ('¥' + text) : '0' }
+                  customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
                 },
                 {
                   title: '刹车片',
                   dataIndex: 'gpScpAmount',
                   align: 'center',
                   width: 100,
-                  customRender: function (text) { return text ? ('¥' + text) : '0' }
+                  customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
                 }
               ]
             },
@@ -214,28 +247,28 @@ export default {
               dataIndex: 'hjAmount',
               align: 'center',
               width: 100,
-              customRender: function (text) { return text ? ('¥' + text) : '0' }
+              customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
             },
             {
               title: '德路斯',
               dataIndex: 'dlsAmount',
               align: 'center',
               width: 100,
-              customRender: function (text) { return text ? ('¥' + text) : '0' }
+              customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
             },
             {
               title: '稳升',
               dataIndex: 'wsAmount',
               align: 'center',
               width: 100,
-              customRender: function (text) { return text ? ('¥' + text) : '0' }
+              customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
             },
             {
               title: 'TBU',
               dataIndex: 'tbuAmount',
               align: 'center',
               width: 100,
-              customRender: function (text) { return text ? ('¥' + text) : '0' }
+              customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
             }
           ] },
         { title: '代理品牌',
@@ -246,52 +279,52 @@ export default {
               dataIndex: 'ngkAmount',
               align: 'center',
               width: 100,
-              customRender: function (text) { return text ? ('¥' + text) : '0' }
+              customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
             },
             {
               title: '飞利浦',
               dataIndex: 'flpAmount',
               align: 'center',
               width: 100,
-              customRender: function (text) { return text ? ('¥' + text) : '0' }
+              customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
             },
             {
               title: '车仆',
               dataIndex: 'cpAmount',
               align: 'center',
               width: 100,
-              customRender: function (text) { return text ? ('¥' + text) : '0' }
+              customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
             },
             {
               title: '瓦尔塔',
               dataIndex: 'wetAmount',
               align: 'center',
               width: 100,
-              customRender: function (text) { return text ? ('¥' + text) : '0' }
+              customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
             },
             {
               title: '雷贝斯托',
               dataIndex: 'lbstAmount',
               align: 'center',
               width: 100,
-              customRender: function (text) { return text ? ('¥' + text) : '0' }
+              customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
             },
             {
               title: '德尔福',
               dataIndex: 'defAmount',
               align: 'center',
               width: 100,
-              customRender: function (text) { return text ? ('¥' + text) : '0' }
+              customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
             },
             {
               title: '巴诺德',
               dataIndex: 'bndAmount',
               align: 'center',
               width: 100,
-              customRender: function (text) { return text ? ('¥' + text) : '0' }
+              customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
             }
           ] },
-        { title: '实际销售合计金额', width: 200, dataIndex: 'totalAmount', align: 'center', customRender: function (text) { return text ? ('¥' + text) : '0' } }
+        { title: '实际销售合计金额', width: 200, dataIndex: 'totalAmount', align: 'center', customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' } }
       ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
@@ -302,27 +335,34 @@ export default {
         }
         const paramsPage = Object.assign(this.queryParam, { pageNo: parameter.pageNo, pageSize: parameter.pageSize }) //  有分页
         return salesBillReportList(paramsPage).then(res => {
+          this.getCount(paramsPage)
           const data = res.data
           const no = (data.pageNo - 1) * data.pageSize
           for (var i = 0; i < data.list.length; i++) {
-            const row = data.list[i]
-            row.no = no + i + 1
-            row.totalAmount = row.jpLqqAmount + row.jpYgpAmount + row.jpLbAmount + row.jpScpAmount
-            row.totalAmount += row.jpGyxAmount + row.gpLqqAmount + row.gpYgpAmount + row.gpScpAmount + row.hjAmount
-            row.totalAmount += row.dlsAmount + row.wsAmount + row.tbuAmount + row.ngkAmount + row.flpAmount + row.cpAmount
-            row.totalAmount += row.wetAmount + row.lbstAmount + row.defAmount + row.bndAmount
+            data.list[i].no = no + i + 1
           }
           this.disabled = false
           this.spinning = false
           return data
         })
       },
+      totalData: null,
       addrProvinceList: [], //  省下拉
       addrCityList: [], //  市下拉
       addrDistrictList: [] //  区下拉
     }
   },
   methods: {
+    // 总计
+    getCount (params) {
+      salesBillReportCount(params).then(res => {
+        if (res.status == 200 && res.data) {
+          this.totalData = res.data
+        } else {
+          this.totalData = null
+        }
+      })
+    },
     handleSearch () {
       const _this = this
       this.$refs.ruleForm.validate(valid => {
@@ -350,10 +390,13 @@ export default {
     },
     //  重置
     resetSearchForm () {
-      this.$refs.rangeDate.resetDate()
-      this.queryParam.time = []
-      this.queryParam.beginDate = ''
-      this.queryParam.endDate = ''
+      this.queryParam.time = [
+        getDate.getCurrMonthDays().starttime,
+        getDate.getCurrMonthDays().endtime
+      ]
+      this.$refs.rangeDate.resetDate(this.queryParam.time)
+      this.queryParam.beginDate = getDate.getCurrMonthDays().starttime
+      this.queryParam.endDate = getDate.getCurrMonthDays().endtime
       this.queryParam.salesBillNo = ''
       this.queryParam.dealer = {
         'dealerSn': undefined,