Forráskód Böngészése

开单退货单报表

lilei 2 éve
szülő
commit
0f18f2fe42
3 módosított fájl, 48 hozzáadás és 256 törlés
  1. 10 3
      src/api/reportData.js
  2. 36 251
      src/views/reportData/returnSlipReport/list.vue
  3. 2 2
      vue.config.js

+ 10 - 3
src/api/reportData.js

@@ -1,8 +1,15 @@
 import { axios } from '@/utils/request'
-
+// 获取开单退货单表头
+export const salesReportReturnTitle = (params) => {
+  return axios({
+    url: '/report/salesReturnBillReport/reportTitle',
+    data: params,
+    method: 'get'
+  })
+}
 //  开单退货单报表
 export const salesReportReturnBillList = (params) => {
-  const url = `/report/salesReturnBillReport/returnBillQueryPage/${params.pageNo}/${params.pageSize}`
+  const url = `/report/salesReturnBillReport/reportPage/${params.pageNo}/${params.pageSize}`
   delete params.pageNo
   delete params.pageSize
   return axios({
@@ -14,7 +21,7 @@ export const salesReportReturnBillList = (params) => {
 //  开单退货单报表  合计
 export const salesReportReturnBillCount = (params) => {
   return axios({
-    url: '/report/salesReturnBillReport/returnBillQuerySum',
+    url: '/report/salesReturnBillReport/reportCount',
     data: params,
     method: 'post'
   })

+ 36 - 251
src/views/reportData/returnSlipReport/list.vue

@@ -75,10 +75,11 @@
         class="sTable"
         ref="table"
         size="small"
-        :rowKey="(record) => record.id"
+        :rowKey="(record) => record.no"
+        rowKeyName = 'no'
         :columns="columns"
         :data="loadData"
-        :scroll="{ x: 2410, y: tableHeight }"
+        :scroll="{ x: tableWidth, y: tableHeight }"
         :defaultLoadData="false"
         bordered>
         <template slot="footer">
@@ -86,32 +87,9 @@
             <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.jpBsxLqqAmount || totalData.jpBsxLqqAmount==0)) ? totalData.jpBsxLqqAmount : '--' }}</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.wsDhxqAmount || totalData.wsDhxqAmount==0)) ? totalData.wsDhxqAmount : '--' }}</a-col>
-                <a-col span="4">稳升灯泡:{{ (totalData && (totalData.wsDpAmount || totalData.wsDpAmount==0)) ? totalData.wsDpAmount : '--' }}</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">TBU刹车片:{{ (totalData && (totalData.tbuScpAmount || totalData.tbuScpAmount==0)) ? totalData.tbuScpAmount : '--' }}</a-col>
-                <a-col span="4">TBU刹车油:{{ (totalData && (totalData.tbuScyAmount || totalData.tbuScyAmount==0)) ? totalData.tbuScyAmount : '--' }}</a-col>
-                <a-col span="4">TBU-P:{{ (totalData && (totalData.tbupAmount || totalData.tbupAmount==0)) ? totalData.tbupAmount : '--' }}</a-col>
-                <a-col span="4">布瑞斯:{{ (totalData && (totalData.brsAmount || totalData.brsAmount==0)) ? totalData.brsAmount : '--' }}</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>
-                <!-- v-if="$hasPermissions('B_isShowPrice')" -->
-                <a-col span="6">开单退货单合计金额:{{ (totalData && (totalData.totalAmount || totalData.totalAmount==0)) ? toThousands(totalData.totalAmount) : '--' }}</a-col>
+                <a-col span="4" v-for="item in countLabel" :key="item.key">
+                  {{ item.title }}:{{ totalData?totalData[item.dataIndex]:'--' }}
+                </a-col>
               </a-row>
             </a-col>
           </a-row>
@@ -133,7 +111,7 @@ import subarea from '@/views/common/subarea.js'
 import reportModal from '@/views/common/reportModal.vue'
 import AreaList from '@/views/common/areaList.js'
 import { hdExportExcel } from '@/libs/exportExcel'
-import { salesReportReturnBillList, salesReportReturnBillCount, returnSlipExport } from '@/api/reportData'
+import { salesReportReturnTitle, salesReportReturnBillList, salesReportReturnBillCount, returnSlipExport } from '@/api/reportData'
 export default {
   name: 'ReturnSlipReportList',
   mixins: [commonMixin],
@@ -191,228 +169,13 @@ export default {
           return data
         })
       },
-      totalData: null
-    }
-  },
-  computed: {
-    columns () {
-      const _this = this
-      const arr = [
-        { title: '区域', dataIndex: 'dealer.subareaNameSet', width: 120, align: 'center', customRender: function (text) { return (text && text.length > 0) ? text.join('/') : '--' } },
-        { title: '退货单号', dataIndex: 'salesReturnBillNo', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '省份', dataIndex: 'dealer.provinceName', width: 90, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '客户名称', dataIndex: 'dealer.dealerName', width: 120, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '客户级别', dataIndex: 'dealer.dealerLevelDictValue', width: 120, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '品牌',
-          align: 'right',
-          children: [
-            {
-              title: '箭牌',
-              align: 'right',
-              children: [
-                {
-                  title: '滤清器',
-                  dataIndex: 'jpLqqAmount',
-                  align: 'right',
-                  width: 80,
-                  customRender: function (text) { return (text || text == 0) ? _this.toThousands(text) : '--' }
-                },
-                {
-                  title: '变速箱滤清器',
-                  dataIndex: 'jpBsxLqqAmount',
-                  align: 'right',
-                  width: 80,
-                  customRender: function (text) { return (text || text == 0) ? _this.toThousands(text) : '--' }
-                },
-                {
-                  title: '雨刮片',
-                  dataIndex: 'jpYgpAmount',
-                  align: 'right',
-                  width: 80,
-                  customRender: function (text) { return (text || text == 0) ? _this.toThousands(text) : '--' }
-                },
-                {
-                  title: '喇叭',
-                  dataIndex: 'jpLbAmount',
-                  align: 'right',
-                  width: 80,
-                  customRender: function (text) { return (text || text == 0) ? _this.toThousands(text) : '--' }
-                },
-                {
-                  title: '刹车片',
-                  dataIndex: 'jpScpAmount',
-                  align: 'right',
-                  width: 80,
-                  customRender: function (text) { return (text || text == 0) ? _this.toThousands(text) : '--' }
-                },
-                {
-                  title: '感应线',
-                  dataIndex: 'jpGyxAmount',
-                  align: 'right',
-                  width: 80,
-                  customRender: function (text) { return (text || text == 0) ? _this.toThousands(text) : '--' }
-                }
-              ]
-            },
-            {
-              title: '冠牌',
-              align: 'right',
-              children: [
-                {
-                  title: '滤清器',
-                  dataIndex: 'gpLqqAmount',
-                  align: 'right',
-                  width: 80,
-                  customRender: function (text) { return (text || text == 0) ? _this.toThousands(text) : '--' }
-                },
-                {
-                  title: '雨刮片',
-                  dataIndex: 'gpYgpAmount',
-                  align: 'right',
-                  width: 80,
-                  customRender: function (text) { return (text || text == 0) ? _this.toThousands(text) : '--' }
-                },
-                {
-                  title: '刹车片',
-                  dataIndex: 'gpScpAmount',
-                  align: 'right',
-                  width: 80,
-                  customRender: function (text) { return (text || text == 0) ? _this.toThousands(text) : '--' }
-                }
-              ]
-            },
-            {
-              title: '稳升',
-              align: 'right',
-              children: [
-                {
-                  title: '点火线圈',
-                  dataIndex: 'wsDhxqAmount',
-                  align: 'right',
-                  width: 80,
-                  customRender: function (text) { return (text || text == 0) ? _this.toThousands(text) : '--' }
-                },
-                {
-                  title: '灯泡',
-                  dataIndex: 'wsDpAmount',
-                  align: 'right',
-                  width: 80,
-                  customRender: function (text) { return (text || text == 0) ? _this.toThousands(text) : '--' }
-                }
-              ]
-            },
-            {
-              title: '汇箭',
-              dataIndex: 'hjAmount',
-              align: 'right',
-              width: 80,
-              customRender: function (text) { return (text || text == 0) ? _this.toThousands(text) : '--' }
-            },
-            {
-              title: '德路斯',
-              dataIndex: 'dlsAmount',
-              align: 'right',
-              width: 80,
-              customRender: function (text) { return (text || text == 0) ? _this.toThousands(text) : '--' }
-            },
-            {
-              title: 'TBU',
-              align: 'right',
-              children: [
-                {
-                  title: '刹车片',
-                  dataIndex: 'tbuScpAmount',
-                  align: 'right',
-                  width: 80,
-                  customRender: function (text) { return (text || text == 0) ? _this.toThousands(text) : '--' }
-                },
-                {
-                  title: '刹车油',
-                  dataIndex: 'tbuScyAmount',
-                  align: 'right',
-                  width: 80,
-                  customRender: function (text) { return (text || text == 0) ? _this.toThousands(text) : '--' }
-                }
-              ]
-            },
-            {
-              title: 'TBU-P',
-              dataIndex: 'tbupAmount',
-              align: 'right',
-              width: 80,
-              customRender: function (text) { return (text || text == 0) ? _this.toThousands(text) : '--' }
-            },
-            {
-              title: '布瑞斯',
-              dataIndex: 'brsAmount',
-              align: 'right',
-              width: 80,
-              customRender: function (text) { return (text || text == 0) ? _this.toThousands(text) : '--' }
-            }
-          ]
-        },
-        { title: '代理品牌',
-          align: 'right',
-          children: [
-            {
-              title: 'NGK',
-              dataIndex: 'ngkAmount',
-              align: 'right',
-              width: 80,
-              customRender: function (text) { return (text || text == 0) ? _this.toThousands(text) : '--' }
-            },
-            {
-              title: '飞利浦',
-              dataIndex: 'flpAmount',
-              align: 'right',
-              width: 80,
-              customRender: function (text) { return (text || text == 0) ? _this.toThousands(text) : '--' }
-            },
-            {
-              title: '车仆',
-              dataIndex: 'cpAmount',
-              align: 'right',
-              width: 80,
-              customRender: function (text) { return (text || text == 0) ? _this.toThousands(text) : '--' }
-            },
-            {
-              title: '瓦尔塔',
-              dataIndex: 'wetAmount',
-              align: 'right',
-              width: 80,
-              customRender: function (text) { return (text || text == 0) ? _this.toThousands(text) : '--' }
-            },
-            {
-              title: '雷贝斯托',
-              dataIndex: 'lbstAmount',
-              align: 'right',
-              width: 80,
-              customRender: function (text) { return (text || text == 0) ? _this.toThousands(text) : '--' }
-            },
-            {
-              title: '德尔福',
-              dataIndex: 'defAmount',
-              align: 'right',
-              width: 80,
-              customRender: function (text) { return (text || text == 0) ? _this.toThousands(text) : '--' }
-            },
-            {
-              title: '巴诺德',
-              dataIndex: 'bndAmount',
-              align: 'right',
-              width: 80,
-              customRender: function (text) { return (text || text == 0) ? _this.toThousands(text) : '--' }
-            }
-          ]
-        }
-        // { title: '开单退货单合计金额', width: 90, dataIndex: 'totalAmount', align: 'center', customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' } }
-      ]
-      // if (this.$hasPermissions('B_isShowPrice')) { //  售价权限
-      arr.splice(arr.length, 0, { title: '开单退货单合计金额', width: 90, dataIndex: 'totalAmount', align: 'right', customRender: function (text) { return (text || text == 0) ? _this.toThousands(text) : '--' } })
-      // }
-      return arr
+      totalData: null,
+      columns: [],
+      countLabel:[],
+      tableWidth: 0
     }
   },
+  
   methods: {
     //  导出
     handleExport () {
@@ -497,16 +260,38 @@ export default {
       this.queryParam.citySn = val[1] ? val[1] : ''
       this.queryParam.districtSn = val[2] ? val[2] : ''
     },
+    // 获取表头
+    async getTableTitle(){
+      const _this = this
+      const tableTitle = await salesReportReturnTitle().then(res => res.data)
+      this.columns = tableTitle.list
+      this.countLabel = tableTitle.count
+      this.columns.map(item => {
+        let mw = 40
+        if(item.customRender == 'amount'){
+          mw = 15
+          item.customRender = function (text) { return (text || text == 0) ? _this.toThousands(text) : '--' }
+        }
+        const w = item.title.length * mw
+        const tw = w <= 80 && item.customRender != 'amount' ? w*2: (w>=360?200:w)
+        item.width = tw + 'px'
+        this.tableWidth = this.tableWidth + tw
+      })
+      this.resetSearchForm()
+    },
+    pageInit(){
+      this.getTableTitle()
+    }
   },
   mounted () {
     if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
-      this.resetSearchForm()
+      this.pageInit()
     }
   },
   activated () {
     // 如果是新页签打开,则重置当前页面
     if (this.$store.state.app.isNewTab) {
-      this.resetSearchForm()
+      this.pageInit()
     }
   },
   beforeRouteEnter (to, from, next) {

+ 2 - 2
vue.config.js

@@ -107,9 +107,9 @@ const vueConfig = {
     // If you want to turn on the proxy, please remove the mockjs /src/main.jsL11
     proxy: {
       '/api': {
-        // target: 'http://192.168.0.183/ocs-admin',
+        target: 'http://192.168.0.216/ocs-admin',
         // target: 'https://t.ocs.360arrow.com/ocs-admin', //  练习
-        target: 'http://p.ocs.360arrow.com/ocs-admin', //  预发布
+        // target: 'http://p.ocs.360arrow.com/ocs-admin', //  预发布
         ws: false,
         changeOrigin: true,
         pathRewrite: {