Переглянути джерело

Merge commit '44d0802932f6cd4825966dc863bbfff296777631' into HEAD

gitadmin 2 місяців тому
батько
коміт
f1b976ef31
29 змінених файлів з 2160 додано та 481 видалено
  1. BIN
      public/templ/产品批量导入模板.xlsx
  2. 1 1
      public/version.json
  3. 54 0
      src/api/productForeign.js
  4. 41 0
      src/api/reportData.js
  5. 25 0
      src/config/productManagement.js
  6. 402 402
      src/config/report/salesReport.js
  7. 1 0
      src/utils/request.js
  8. 1 0
      src/utils/util.js
  9. 181 0
      src/views/productManagement/foreignTradeGoods/chooseImportModal.vue
  10. 190 0
      src/views/productManagement/foreignTradeGoods/importGuideModal.vue
  11. 226 0
      src/views/productManagement/foreignTradeGoods/list.vue
  12. 2 2
      src/views/productManagement/productInfo/chooseImportModal.vue
  13. 2 1
      src/views/productManagement/productInfo/detailModal.vue
  14. 10 7
      src/views/productManagement/productInfo/edit.vue
  15. 51 8
      src/views/reportData/salesDetails/list.vue
  16. 5 1
      src/views/reportData/tireSubsidyReport/index.vue
  17. 375 0
      src/views/reportData/tireSubsidyReport/supplierRebateList.vue
  18. 6 2
      src/views/salesManagement/pushOrderManagement/detail.vue
  19. 2 2
      src/views/salesManagement/pushOrderManagement/list.vue
  20. 24 5
      src/views/salesManagement/salesQueryNew/comps/detailProductList.vue
  21. 1 1
      src/views/salesManagement/salesQueryNew/comps/productList.vue
  22. 1 1
      src/views/salesManagement/salesQueryNew/comps/productNormalList.vue
  23. 51 21
      src/views/salesManagement/salesQueryNew/detail.vue
  24. 43 20
      src/views/salesManagement/salesQueryNew/detailAll.vue
  25. 0 1
      src/views/salesManagement/salesQueryNew/list.vue
  26. 19 5
      src/views/salesManagement/salesQueryNew/printModal.vue
  27. 5 1
      src/views/setting/tireSubsidySetting/index.vue
  28. 236 0
      src/views/setting/tireSubsidySetting/rebateAddModal.vue
  29. 205 0
      src/views/setting/tireSubsidySetting/rebateAmountList.vue

BIN
public/templ/产品批量导入模板.xlsx


+ 1 - 1
public/version.json

@@ -1,4 +1,4 @@
 {
-    "version": "2.2.551",
+    "version": "2.2.55222222",
     "message": "发现有新版本发布,确定更新系统?"
 }

+ 54 - 0
src/api/productForeign.js

@@ -0,0 +1,54 @@
+import { axios } from '@/utils/request'
+
+//  外贸产品  列表  有分页
+export const productForeignList = (params) => {
+  const url = `/productForeign/queryPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post',
+    headers: {
+      'module': encodeURIComponent('列表查询')
+    }
+  })
+}
+
+// 外贸产品  查询列表
+export const productForeignQueryList = params => {
+  return axios({
+    url: '/productForeign/queryList',
+    data: params,
+    method: 'post',
+    headers: {
+      'module': encodeURIComponent('导入产品列表')
+    }
+  })
+}
+
+// 外贸产品  导出查询项
+export const productForeignExport = (params) => {
+  return axios({
+    url: '/productForeign/productExport',
+    data: params,
+    method: 'post',
+    responseType: 'blob',
+    headers: {
+      'module': encodeURIComponent('导出查询项')
+    }
+  })
+}
+
+// 外贸产品  列表导出
+export const foreignProductListExport = (params) => {
+  return axios({
+    url: '/productForeign/productListExport',
+    data: params,
+    method: 'post',
+    responseType: 'blob',
+    headers: {
+      'module': encodeURIComponent('导出')
+    }
+  })
+}

+ 41 - 0
src/api/reportData.js

@@ -1464,6 +1464,47 @@ export const tireFeeListExport = (params) => {
   })
 }
 
+/*
+*  轮胎补贴配置   供应商轮胎补贴返利报表
+*/
+
+// 补贴返利列表   有分页
+export const subsidyTireList = (params) => {
+  const url = `/report/subsidyTire/queryPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post',
+    headers: {
+      'module': encodeURIComponent('列表查询')
+    }
+  })
+}
+
+// 补贴返利列表   统计
+export const subsidyTireCount = (params) => {
+  return axios({
+    url: '/report/subsidyTire/queryCount',
+    data: params,
+    method: 'post'
+  })
+}
+
+// 补贴返利列表   导出
+export const subsidyTireExport = (params) => {
+  return axios({
+    url: '/report/subsidyTire/export',
+    data: params,
+    method: 'post',
+    responseType: 'blob',
+    headers: {
+      'module': encodeURIComponent('导出')
+    }
+  })
+}
+
 // 促销销售单报表(统计)
 export const brandTypeReportList = (params) => {
   const url = `/report/brandTypeReport/queryPage/${params.pageNo}/${params.pageSize}`

+ 25 - 0
src/config/productManagement.js

@@ -362,6 +362,31 @@ export default {
           }
         }
       ]
+    },
+    {
+      path: '/productManagement/foreignTradeGoods',
+      redirect: '/productManagement/foreignTradeGoods/list',
+      name: 'foreignTradeGoods',
+      component: BlankLayout,
+      meta: {
+        title: '外贸产品',
+        icon: 'radar-chart',
+        permission: 'M_foreignTradeGoodsList'
+      },
+      hideChildrenInMenu: true,
+      children: [
+        {
+          path: 'list',
+          name: 'foreignTradeGoodsList',
+          component: () => import(/* webpackChunkName: "productManagement" */ '@/views/productManagement/foreignTradeGoods/list.vue'),
+          meta: {
+            title: '外贸产品',
+            icon: 'radar-chart',
+            hidden: true,
+            permission: 'M_foreignTradeGoodsList'
+          }
+        }
+      ]
     }
   ]
 }

+ 402 - 402
src/config/report/salesReport.js

@@ -7,406 +7,406 @@ import {
 } from '@/layouts'
 
 export default {
-        path: '/salesReport',
-        redirect: '/reportData/salesOrderTotal',
-        component: PageView,
+  path: '/salesReport',
+  redirect: '/reportData/salesOrderTotal',
+  component: PageView,
+  meta: {
+    title: '销售报表',
+    icon: 'project',
+    permission: 'M_salesReport'
+  },
+  children: [
+    {
+      path: '/reportData/salesOrderTotal',
+      redirect: '/reportData/salesOrderTotal/list',
+      name: 'salesOrderTotal',
+      component: BlankLayout,
+      meta: {
+        title: '销售(开单统计)',
+        icon: 'profile',
+        permission: 'M_salesOrderTotalList'
+      },
+      hideChildrenInMenu: true,
+      children: [
+        {
+          path: 'list',
+          name: 'salesOrderTotalList',
+          component: () => import(/* webpackChunkName: "reportData" */ '@/views/reportData/salesOrderTotal/list.vue'),
+          meta: {
+            title: '销售(开单统计)列表',
+            icon: 'profile',
+            hidden: true,
+            permission: 'M_salesOrderTotalList'
+          }
+        }
+      ]
+    },
+    {
+      path: '/reportData/salesDetails',
+      redirect: '/reportData/salesDetails/list',
+      name: 'salesDetails',
+      component: BlankLayout,
+      meta: {
+        title: '销售明细(下推统计)',
+        icon: 'profile',
+        permission: 'M_salesDetailsList'
+      },
+      hideChildrenInMenu: true,
+      children: [
+        {
+          path: 'list',
+          name: 'salesDetailsList',
+          component: () => import(/* webpackChunkName: "reportData" */ '@/views/reportData/salesDetails/list.vue'),
+          meta: {
+            title: '销售明细(下推统计)列表',
+            icon: 'profile',
+            hidden: true,
+            permission: 'M_salesDetailsList'
+          }
+        }
+      ]
+    },
+    {
+      path: '/reportData/regionTypeBusinessReport',
+      redirect: '/reportData/regionTypeBusinessReport/list',
+      name: 'regionTypeBusinessReport',
+      component: BlankLayout,
+      meta: {
+        title: '各品类经营分析表',
+        icon: 'profile',
+        permission: 'M_regionTypeSalesReportList'
+      },
+      hideChildrenInMenu: true,
+      children: [
+        {
+          path: 'list',
+          name: 'regionTypeBusinessReportList',
+          component: () => import(/* webpackChunkName: "reportData" */ '@/views/reportData/regionTypeBusinessReport/list.vue'),
+          meta: {
+            title: '各品类经营分析表',
+            icon: 'profile',
+            hidden: true,
+            permission: 'M_regionTypeSalesReportList'
+          }
+        }
+      ]
+    },
+    {
+      path: '/reportData/actualSalesReport',
+      redirect: '/reportData/actualSalesReport/list',
+      name: 'actualSalesReport',
+      component: BlankLayout,
+      meta: {
+        title: '实售销售报表',
+        icon: 'profile',
+        permission: 'M_actualSalesReportList'
+      },
+      hideChildrenInMenu: true,
+      children: [
+        {
+          path: 'list',
+          name: 'actualSalesReportList',
+          component: () => import(/* webpackChunkName: "reportData" */ '@/views/reportData/actualSalesReport/list.vue'),
+          meta: {
+            title: '实售销售列表',
+            icon: 'profile',
+            hidden: true,
+            permission: 'M_actualSalesReportList'
+          }
+        }
+      ]
+    },
+    {
+      path: '/reportData/salesAmountReport',
+      redirect: '/reportData/salesAmountReport/list',
+      name: 'salesAmountReport',
+      component: BlankLayout,
+      meta: {
+        title: '开单销售报表',
+        icon: 'profile',
+        permission: 'M_salesAmountReportList'
+      },
+      hideChildrenInMenu: true,
+      children: [{
+        path: 'list',
+        name: 'salesAmountReportList',
+        component: () => import(/* webpackChunkName: "reportData" */ '@/views/reportData/salesAmountReport/list.vue'),
         meta: {
-          title: '销售报表',
-          icon: 'project',
-          permission: 'M_salesReport'
-        },
-        children: [
-          {
-            path: '/reportData/salesOrderTotal',
-            redirect: '/reportData/salesOrderTotal/list',
-            name: 'salesOrderTotal',
-            component: BlankLayout,
-            meta: {
-              title: '销售(开单统计)',
-              icon: 'profile',
-              permission: 'M_salesOrderTotalList'
-            },
-            hideChildrenInMenu: true,
-            children: [
-              {
-                path: 'list',
-                name: 'salesOrderTotalList',
-                component: () => import(/* webpackChunkName: "reportData" */ '@/views/reportData/salesOrderTotal/list.vue'),
-                meta: {
-                  title: '销售(开单统计)列表',
-                  icon: 'profile',
-                  hidden: true,
-                  permission: 'M_salesOrderTotalList'
-                }
-              }
-            ]
-          },
-          {
-            path: '/reportData/salesDetails',
-            redirect: '/reportData/salesDetails/list',
-            name: 'salesDetails',
-            component: BlankLayout,
-            meta: {
-              title: '销售明细(下推统计)',
-              icon: 'profile',
-              permission: 'M_salesDetailsList'
-            },
-            hideChildrenInMenu: true,
-            children: [
-              {
-                path: 'list',
-                name: 'salesDetailsList',
-                component: () => import(/* webpackChunkName: "reportData" */ '@/views/reportData/salesDetails/list.vue'),
-                meta: {
-                  title: '销售明细(下推统计)列表',
-                  icon: 'profile',
-                  hidden: true,
-                  permission: 'M_salesDetailsList'
-                }
-              }
-            ]
-          },
-          {
-            path: '/reportData/actualSalesReport',
-            redirect: '/reportData/actualSalesReport/list',
-            name: 'actualSalesReport',
-            component: BlankLayout,
-            meta: {
-              title: '实售销售报表',
-              icon: 'profile',
-              permission: 'M_actualSalesReportList'
-            },
-            hideChildrenInMenu: true,
-            children: [
-              {
-                path: 'list',
-                name: 'actualSalesReportList',
-                component: () => import(/* webpackChunkName: "reportData" */ '@/views/reportData/actualSalesReport/list.vue'),
-                meta: {
-                  title: '实售销售列表',
-                  icon: 'profile',
-                  hidden: true,
-                  permission: 'M_actualSalesReportList'
-                }
-              }
-            ]
-          },
-          {
-            path: '/reportData/salesAmountReport',
-            redirect: '/reportData/salesAmountReport/list',
-            name: 'salesAmountReport',
-            component: BlankLayout,
-            meta: {
-              title: '开单销售报表',
-              icon: 'profile',
-              permission: 'M_salesAmountReportList'
-            },
-            hideChildrenInMenu: true,
-            children: [{
-              path: 'list',
-              name: 'salesAmountReportList',
-              component: () => import(/* webpackChunkName: "reportData" */ '@/views/reportData/salesAmountReport/list.vue'),
-              meta: {
-                title: '开单销售报表列表',
-                icon: 'profile',
-                hidden: true,
-                permission: 'M_salesAmountReportList'
-              }
-            }]
-          },
-          {
-            path: '/reportData/salesSlipReport',
-            redirect: '/reportData/salesSlipReport/list',
-            name: 'salesSlipReport',
-            component: BlankLayout,
-            meta: {
-              title: '开单销售单报表',
-              icon: 'profile',
-              permission: 'M_salesSlipReportList'
-            },
-            hideChildrenInMenu: true,
-            children: [{
-              path: 'list',
-              name: 'salesSlipReportList',
-              component: () => import(/* webpackChunkName: "reportData" */ '@/views/reportData/salesSlipReport/list.vue'),
-              meta: {
-                title: '开单销售单报表列表',
-                icon: 'profile',
-                hidden: true,
-                permission: 'M_salesSlipReportList'
-              }
-            }]
-          },
-          {
-            path: '/reportData/promotionSalesRealTimeReport',
-            redirect: '/reportData/promotionSalesRealTimeReport/index',
-            name: 'promotionSalesRealTimeReport',
-            component: BlankLayout,
-            meta: {
-              title: '促销销售单报表',
-              icon: 'profile',
-              permission: 'M_promotionSalesRealTimeReportList'
-            },
-            hideChildrenInMenu: true,
-            children: [
-              {
-                path: 'index',
-                name: 'promotionSalesRealTimeReportIndex',
-                component: () => import(/* webpackChunkName: "reportData" */ '@/views/reportData/promotionSalesRealTimeReport/index.vue'),
-                meta: {
-                  title: '促销销售单报表',
-                  icon: 'profile',
-                  hidden: true,
-                  permission: 'M_promotionSalesRealTimeReportList'
-                }
-              }
-            ]
-          },
-          {
-            path: '/reportData/promotionSalesOrderReport',
-            redirect: '/reportData/promotionSalesOrderReport/list',
-            name: 'promotionSalesOrderReport',
-            component: BlankLayout,
-            meta: {
-              title: '促销销售单报表(统计)',
-              icon: 'profile',
-              permission: 'M_promotionSalesOrderReport'
-            },
-            hideChildrenInMenu: true,
-            children: [{
-              path: 'list',
-              name: 'promotionSalesOrderReportList',
-              component: () => import(/* webpackChunkName: "reportData" */ '@/views/reportData/promotionSalesOrderReport/list.vue'),
-              meta: {
-                title: '促销销售单报表(统计)',
-                icon: 'profile',
-                hidden: true,
-                permission: 'M_promotionSalesOrderReportList'
-              }
-            }]
-          },
-          {
-            path: '/reportData/salesReturnsReport',
-            redirect: '/reportData/salesReturnsReport/list',
-            name: 'salesReturnsReport',
-            component: BlankLayout,
-            meta: {
-              title: '销售退货单报表',
-              icon: 'profile',
-              permission: 'M_salesReturnsReportList'
-            },
-            hideChildrenInMenu: true,
-            children: [
-              {
-                path: 'list',
-                name: 'salesReturnsReportList',
-                component: () => import(/* webpackChunkName: "reportData" */ '@/views/reportData/salesReturnsReport/list.vue'),
-                meta: {
-                  title: '销售退货单报表列表',
-                  icon: 'profile',
-                  hidden: true,
-                  permission: 'M_salesReturnsReportList'
-                }
-              }
-            ]
-          },
-          {
-            path: '/reportData/salesReturnDetailReport',
-            redirect: '/reportData/salesReturnDetailReport/list',
-            name: 'salesReturnDetailReport',
-            component: BlankLayout,
-            meta: {
-              title: '销售退货明细报表',
-              icon: 'profile',
-              permission: 'M_salesReturnDetailReportList'
-            },
-            hideChildrenInMenu: true,
-            children: [{
-              path: 'list',
-              name: 'salesReturnDetailReportList',
-              component: () => import(/* webpackChunkName: "reportData" */
-                '@/views/reportData/salesReturnDetailReport/list.vue'),
-              meta: {
-                title: '销售退货明细报表列表',
-                icon: 'profile',
-                hidden: true,
-                permission: 'M_salesReturnDetailReportList'
-              }
-            }]
-          },
-          {
-            path: '/reportData/salesReturnReport',
-            redirect: '/reportData/salesReturnReport/list',
-            name: 'salesReturnReport',
-            component: BlankLayout,
-            meta: {
-              title: '实售退货报表',
-              icon: 'profile',
-              permission: 'M_salesReturnReportList'
-            },
-            hideChildrenInMenu: true,
-            children: [
-              {
-                path: 'list',
-                name: 'salesReturnReportList',
-                component: () => import(/* webpackChunkName: "reportData" */ '@/views/reportData/salesReturnReport/list.vue'),
-                meta: {
-                  title: '实售退货列表',
-                  icon: 'profile',
-                  hidden: true,
-                  permission: 'M_salesReturnReportList'
-                }
-              }
-            ]
-          },
-          {
-            path: '/reportData/billingReturnReport',
-            redirect: '/reportData/billingReturnReport/list',
-            name: 'billingReturnReport',
-            component: BlankLayout,
-            meta: {
-              title: '开单退货报表',
-              icon: 'profile',
-              permission: 'M_billingReturnReportList'
-            },
-            hideChildrenInMenu: true,
-            children: [
-              {
-                path: 'list',
-                name: 'billingReturnReportList',
-                component: () => import(/* webpackChunkName: "reportData" */ '@/views/reportData/billingReturnReport/list.vue'),
-                meta: {
-                  title: '开单退货列表',
-                  icon: 'profile',
-                  hidden: true,
-                  permission: 'M_billingReturnReportList'
-                }
-              }
-            ]
-          },
-          {
-            path: '/reportData/returnSlipReport',
-            redirect: '/reportData/returnSlipReport/list',
-            name: 'returnSlipReport',
-            component: BlankLayout,
-            meta: {
-              title: '开单退货单报表',
-              icon: 'profile',
-              permission: 'M_returnSlipReportList'
-            },
-            hideChildrenInMenu: true,
-            children: [{
-              path: 'list',
-              name: 'returnSlipReportList',
-              component: () => import(/* webpackChunkName: "reportData" */
-                '@/views/reportData/returnSlipReport/list.vue'),
-              meta: {
-                title: '开单退货单报表列表',
-                icon: 'profile',
-                hidden: true,
-                permission: 'M_returnSlipReportList'
-              }
-            }]
-          },
-          {
-            path: '/reportData/regionTypeSalesReport',
-            redirect: '/reportData/regionTypeSalesReport/list',
-            name: 'regionTypeSalesReport',
-            component: BlankLayout,
-            meta: {
-              title: '各分区品类实售明细',
-              icon: 'profile',
-              permission: 'M_regionTypeSalesReportList'
-            },
-            hideChildrenInMenu: true,
-            children: [
-              {
-                path: 'list',
-                name: 'regionTypeSalesReportList',
-                component: () => import(/* webpackChunkName: "reportData" */ '@/views/reportData/regionTypeSalesReport/list.vue'),
-                meta: {
-                  title: '各分区品类实售明细',
-                  icon: 'profile',
-                  hidden: true,
-                  permission: 'M_regionTypeSalesReportList'
-                }
-              }
-            ]
-          },
-          {
-            path: '/reportData/regionTypeBusinessReport',
-            redirect: '/reportData/regionTypeBusinessReport/list',
-            name: 'regionTypeBusinessReport',
-            component: BlankLayout,
-            meta: {
-              title: '各品类经营分析表',
-              icon: 'profile',
-              permission: 'M_regionTypeSalesReportList'
-            },
-            hideChildrenInMenu: true,
-            children: [
-              {
-                path: 'list',
-                name: 'regionTypeBusinessReportList',
-                component: () => import(/* webpackChunkName: "reportData" */ '@/views/reportData/regionTypeBusinessReport/list.vue'),
-                meta: {
-                  title: '各品类经营分析表',
-                  icon: 'profile',
-                  hidden: true,
-                  permission: 'M_regionTypeSalesReportList'
-                }
-              }
-            ]
-          },
-          {
-            path: '/reportData/salesPresentation',
-            redirect: '/reportData/salesPresentation/list',
-            name: 'salesPresentation',
-            component: BlankLayout,
-            meta: {
-              title: '销售交单报表',
-              icon: 'profile',
-              permission: 'M_salesPresentationList'
-            },
-            hideChildrenInMenu: true,
-            children: [
-              {
-                path: 'list',
-                name: 'salesPresentationList',
-                component: () => import(/* webpackChunkName: "reportData" */ '@/views/reportData/salesPresentation/list.vue'),
-                meta: {
-                  title: '销售交单报表列表',
-                  icon: 'profile',
-                  hidden: true,
-                  permission: 'M_salesPresentationList'
-                }
-              }
-            ]
-          },
-          {
-            path: '/reportData/returnGoodsPresentation',
-            redirect: '/reportData/returnGoodsPresentation/list',
-            name: 'returnGoodsPresentation',
-            component: BlankLayout,
-            meta: {
-              title: '退货交单报表',
-              icon: 'profile',
-              permission: 'M_returnGoodsPresentationList'
-            },
-            hideChildrenInMenu: true,
-            children: [
-              {
-                path: 'list',
-                name: 'returnGoodsPresentationList',
-                component: () => import(/* webpackChunkName: "reportData" */ '@/views/reportData/returnGoodsPresentation/list.vue'),
-                meta: {
-                  title: '退货交单报表列表',
-                  icon: 'profile',
-                  hidden: true,
-                  permission: 'M_returnGoodsPresentationList'
-                }
-              }
-            ]
-          },
-        ]
-      }
+          title: '开单销售报表列表',
+          icon: 'profile',
+          hidden: true,
+          permission: 'M_salesAmountReportList'
+        }
+      }]
+    },
+    {
+      path: '/reportData/salesSlipReport',
+      redirect: '/reportData/salesSlipReport/list',
+      name: 'salesSlipReport',
+      component: BlankLayout,
+      meta: {
+        title: '开单销售单报表',
+        icon: 'profile',
+        permission: 'M_salesSlipReportList'
+      },
+      hideChildrenInMenu: true,
+      children: [{
+        path: 'list',
+        name: 'salesSlipReportList',
+        component: () => import(/* webpackChunkName: "reportData" */ '@/views/reportData/salesSlipReport/list.vue'),
+        meta: {
+          title: '开单销售单报表列表',
+          icon: 'profile',
+          hidden: true,
+          permission: 'M_salesSlipReportList'
+        }
+      }]
+    },
+    {
+      path: '/reportData/promotionSalesRealTimeReport',
+      redirect: '/reportData/promotionSalesRealTimeReport/index',
+      name: 'promotionSalesRealTimeReport',
+      component: BlankLayout,
+      meta: {
+        title: '促销销售单报表',
+        icon: 'profile',
+        permission: 'M_promotionSalesRealTimeReportList'
+      },
+      hideChildrenInMenu: true,
+      children: [
+        {
+          path: 'index',
+          name: 'promotionSalesRealTimeReportIndex',
+          component: () => import(/* webpackChunkName: "reportData" */ '@/views/reportData/promotionSalesRealTimeReport/index.vue'),
+          meta: {
+            title: '促销销售单报表',
+            icon: 'profile',
+            hidden: true,
+            permission: 'M_promotionSalesRealTimeReportList'
+          }
+        }
+      ]
+    },
+    {
+      path: '/reportData/promotionSalesOrderReport',
+      redirect: '/reportData/promotionSalesOrderReport/list',
+      name: 'promotionSalesOrderReport',
+      component: BlankLayout,
+      meta: {
+        title: '促销销售单报表(统计)',
+        icon: 'profile',
+        permission: 'M_promotionSalesOrderReport'
+      },
+      hideChildrenInMenu: true,
+      children: [{
+        path: 'list',
+        name: 'promotionSalesOrderReportList',
+        component: () => import(/* webpackChunkName: "reportData" */ '@/views/reportData/promotionSalesOrderReport/list.vue'),
+        meta: {
+          title: '促销销售单报表(统计)',
+          icon: 'profile',
+          hidden: true,
+          permission: 'M_promotionSalesOrderReportList'
+        }
+      }]
+    },
+    {
+      path: '/reportData/salesReturnsReport',
+      redirect: '/reportData/salesReturnsReport/list',
+      name: 'salesReturnsReport',
+      component: BlankLayout,
+      meta: {
+        title: '销售退货单报表',
+        icon: 'profile',
+        permission: 'M_salesReturnsReportList'
+      },
+      hideChildrenInMenu: true,
+      children: [
+        {
+          path: 'list',
+          name: 'salesReturnsReportList',
+          component: () => import(/* webpackChunkName: "reportData" */ '@/views/reportData/salesReturnsReport/list.vue'),
+          meta: {
+            title: '销售退货单报表列表',
+            icon: 'profile',
+            hidden: true,
+            permission: 'M_salesReturnsReportList'
+          }
+        }
+      ]
+    },
+    {
+      path: '/reportData/salesReturnDetailReport',
+      redirect: '/reportData/salesReturnDetailReport/list',
+      name: 'salesReturnDetailReport',
+      component: BlankLayout,
+      meta: {
+        title: '销售退货明细报表',
+        icon: 'profile',
+        permission: 'M_salesReturnDetailReportList'
+      },
+      hideChildrenInMenu: true,
+      children: [{
+        path: 'list',
+        name: 'salesReturnDetailReportList',
+        component: () => import(/* webpackChunkName: "reportData" */
+          '@/views/reportData/salesReturnDetailReport/list.vue'),
+        meta: {
+          title: '销售退货明细报表列表',
+          icon: 'profile',
+          hidden: true,
+          permission: 'M_salesReturnDetailReportList'
+        }
+      }]
+    },
+    {
+      path: '/reportData/salesReturnReport',
+      redirect: '/reportData/salesReturnReport/list',
+      name: 'salesReturnReport',
+      component: BlankLayout,
+      meta: {
+        title: '实售退货报表',
+        icon: 'profile',
+        permission: 'M_salesReturnReportList'
+      },
+      hideChildrenInMenu: true,
+      children: [
+        {
+          path: 'list',
+          name: 'salesReturnReportList',
+          component: () => import(/* webpackChunkName: "reportData" */ '@/views/reportData/salesReturnReport/list.vue'),
+          meta: {
+            title: '实售退货列表',
+            icon: 'profile',
+            hidden: true,
+            permission: 'M_salesReturnReportList'
+          }
+        }
+      ]
+    },
+    {
+      path: '/reportData/billingReturnReport',
+      redirect: '/reportData/billingReturnReport/list',
+      name: 'billingReturnReport',
+      component: BlankLayout,
+      meta: {
+        title: '开单退货报表',
+        icon: 'profile',
+        permission: 'M_billingReturnReportList'
+      },
+      hideChildrenInMenu: true,
+      children: [
+        {
+          path: 'list',
+          name: 'billingReturnReportList',
+          component: () => import(/* webpackChunkName: "reportData" */ '@/views/reportData/billingReturnReport/list.vue'),
+          meta: {
+            title: '开单退货列表',
+            icon: 'profile',
+            hidden: true,
+            permission: 'M_billingReturnReportList'
+          }
+        }
+      ]
+    },
+    {
+      path: '/reportData/returnSlipReport',
+      redirect: '/reportData/returnSlipReport/list',
+      name: 'returnSlipReport',
+      component: BlankLayout,
+      meta: {
+        title: '开单退货单报表',
+        icon: 'profile',
+        permission: 'M_returnSlipReportList'
+      },
+      hideChildrenInMenu: true,
+      children: [{
+        path: 'list',
+        name: 'returnSlipReportList',
+        component: () => import(/* webpackChunkName: "reportData" */
+          '@/views/reportData/returnSlipReport/list.vue'),
+        meta: {
+          title: '开单退货单报表列表',
+          icon: 'profile',
+          hidden: true,
+          permission: 'M_returnSlipReportList'
+        }
+      }]
+    },
+    {
+      path: '/reportData/regionTypeSalesReport',
+      redirect: '/reportData/regionTypeSalesReport/list',
+      name: 'regionTypeSalesReport',
+      component: BlankLayout,
+      meta: {
+        title: '各分区品类实售明细',
+        icon: 'profile',
+        permission: 'M_regionTypeSalesReportList'
+      },
+      hideChildrenInMenu: true,
+      children: [
+        {
+          path: 'list',
+          name: 'regionTypeSalesReportList',
+          component: () => import(/* webpackChunkName: "reportData" */ '@/views/reportData/regionTypeSalesReport/list.vue'),
+          meta: {
+            title: '各分区品类实售明细',
+            icon: 'profile',
+            hidden: true,
+            permission: 'M_regionTypeSalesReportList'
+          }
+        }
+      ]
+    },
+    {
+      path: '/reportData/salesPresentation',
+      redirect: '/reportData/salesPresentation/list',
+      name: 'salesPresentation',
+      component: BlankLayout,
+      meta: {
+        title: '销售交单报表',
+        icon: 'profile',
+        permission: 'M_salesPresentationList'
+      },
+      hideChildrenInMenu: true,
+      children: [
+        {
+          path: 'list',
+          name: 'salesPresentationList',
+          component: () => import(/* webpackChunkName: "reportData" */ '@/views/reportData/salesPresentation/list.vue'),
+          meta: {
+            title: '销售交单报表列表',
+            icon: 'profile',
+            hidden: true,
+            permission: 'M_salesPresentationList'
+          }
+        }
+      ]
+    },
+    {
+      path: '/reportData/returnGoodsPresentation',
+      redirect: '/reportData/returnGoodsPresentation/list',
+      name: 'returnGoodsPresentation',
+      component: BlankLayout,
+      meta: {
+        title: '退货交单报表',
+        icon: 'profile',
+        permission: 'M_returnGoodsPresentationList'
+      },
+      hideChildrenInMenu: true,
+      children: [
+        {
+          path: 'list',
+          name: 'returnGoodsPresentationList',
+          component: () => import(/* webpackChunkName: "reportData" */ '@/views/reportData/returnGoodsPresentation/list.vue'),
+          meta: {
+            title: '退货交单报表列表',
+            icon: 'profile',
+            hidden: true,
+            permission: 'M_returnGoodsPresentationList'
+          }
+        }
+      ]
+    }
+  ]
+}

+ 1 - 0
src/utils/request.js

@@ -111,6 +111,7 @@ const err = (error) => {
 
 // request interceptor
 service.interceptors.request.use(config => {
+  console.log(store.state.app.curActionPermission)
   const authPrice = getAuthPriceCode(config, router, store)
   const token = store.getters.token
   if (token) {

+ 1 - 0
src/utils/util.js

@@ -266,6 +266,7 @@ export function getAuthPriceCode (config, router, store) {
   // 手动指定的权限code,如打开的弹框页面或导出、打印
   // 手动指定的权限在使用完后需要清空,如在关闭弹框或导出、打印接口调用完成后清空
   const curActionPermission = store.state.app.curActionPermission
+  console.log(curActionPermission)
   // 价格权限的所有选项,销售价、成本价、省、市、特约价
   const priceOptions = store.state.app.priceAuthOptions
   // 最终获取的权限code,手动指定的优先级高于路由打开的页面权限code

+ 181 - 0
src/views/productManagement/foreignTradeGoods/chooseImportModal.vue

@@ -0,0 +1,181 @@
+<template>
+  <a-modal
+    centered
+    class="chooseImport-modal"
+    :footer="null"
+    :maskClosable="false"
+    title="导入"
+    v-model="isShow"
+    @cancel="isShow=false"
+    width="75%">
+    <div class="chooseImport-con">
+      <p class="">查询数据{{ loadData.length }}条</p>
+      <a-table
+        class="sTable"
+        ref="table"
+        size="small"
+        :rowKey="(record) => record.allocateSn"
+        :columns="nowColumns"
+        :dataSource="loadData"
+        :loading="loading"
+        :scroll="{ y: 500 }"
+        :pagination="false"
+        bordered>
+      </a-table>
+      <!-- 按钮 -->
+      <div class="btn-con">
+        <a-button
+          id="chooseImport-cancel"
+          size="large"
+          class="button-cancel"
+          @click="isShow=false"
+          style="padding: 0 40px;margin-left: 15px;">取消</a-button>
+        <a-button
+          type="primary"
+          id="chooseImport-error"
+          size="large"
+          class="button-error"
+          @click="handleExport"
+          style="padding: 0 40px;margin-left: 15px;">导出</a-button>
+      </div>
+    </div>
+  </a-modal>
+</template>
+
+<script>
+import { commonMixin } from '@/utils/mixin'
+// 组件
+import { hdExportExcel } from '@/libs/exportExcel'
+// 接口
+import { productForeignQueryList, productForeignExport } from '@/api/productForeign'
+export default {
+  name: 'ChooseImportModal',
+  mixins: [commonMixin],
+  props: {
+    openModal: { //  弹框显示状态
+      type: Boolean,
+      default: false
+    },
+    paramsData: {
+      type: Object,
+      default: () => {
+        return {}
+      }
+    }
+  },
+  data () {
+    const _this = this
+    return {
+      isShow: this.openModal, //  是否打开弹框
+      nowColumns: [
+        { title: '序号', dataIndex: 'no', width: '6%', align: 'center' },
+        { title: '查询码', dataIndex: 'queryCode', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '外贸产品编码', dataIndex: 'foreignCode', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '箭冠产品编码', dataIndex: 'productCode', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: 'OE码', dataIndex: 'oeCode', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '大厂码',
+          children: [
+            {
+              title: 'MANN No.', dataIndex: 'mannCode', width: '10%', align: 'center', customRender: function (text) { return text || '--' }
+            },
+            {
+              title: 'MAHLE No.', dataIndex: 'mahleCode', width: '10%', align: 'center', customRender: function (text) { return text || '--' }
+            },
+            {
+              title: 'VIC No.', dataIndex: 'vicCode', width: '10%', align: 'center', customRender: function (text) { return text || '--' }
+            },
+            {
+              title: 'FRAM NO.', dataIndex: 'framCode', width: '10%', align: 'center', customRender: function (text) { return text || '--' }
+            },
+            {
+              title: 'WIX No.', dataIndex: 'wixCode', width: '10%', align: 'center', customRender: function (text) { return text || '--' }
+            }
+          ]
+        },
+        { title: '产品尺寸', dataIndex: 'size', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '主材料', dataIndex: 'material', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '含盒报价', dataIndex: 'priceFreeBox', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        { title: '无盒报价', dataIndex: 'priceWithBox', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } }
+      ],
+      loadData: [],
+      loading: false
+    }
+  },
+  methods: {
+    getData () {
+      const _this = this
+      _this.loading = true
+      const params = {
+        path: _this.paramsData.path
+      }
+      productForeignQueryList(params).then(res => {
+        _this.loading = false
+        if (res.status == 200) {
+          if (res.data && res.data.length > 0) {
+            res.data.map((item, index) => {
+              item.no = index + 1
+            })
+          }
+          _this.loadData = res.data || []
+        }
+      })
+    },
+    // 导出
+    handleExport () {
+      const _this = this
+      if (_this.loadData.length < 1) {
+        _this.$message.info('暂无可导出的产品~')
+        return
+      }
+      _this.spinning = true
+      const newLoadData = _this.loadData.map(item => {
+        if (item.productEntity) {
+          item.productName = item.productEntity.name
+          item.productCode = item.productEntity.code
+          item.productOrigCode = item.productEntity.origCode
+          item.productTypeName1 = item.productEntity.productTypeName1
+          item.productTypeName2 = item.productEntity.productTypeName2
+          item.productTypeName3 = item.productEntity.productTypeName3
+        }
+        return item
+      })
+      hdExportExcel(productForeignExport, newLoadData, '外贸产品', function () {
+        _this.spinning = false
+      })
+    }
+  },
+  watch: {
+    //  父页面传过来的弹框状态
+    openModal (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    //  重定义的弹框状态
+    isShow (newValue, oldValue) {
+      if (!newValue) {
+        this.$emit('close')
+        this.loadData = []
+      } else {
+        this.getData()
+      }
+    }
+  }
+}
+</script>
+
+<style lang="less" scoped>
+
+  .chooseImport-modal{
+    .chooseImport-con{
+      /deep/.sTable td{
+        white-space: pre-line;
+      }
+      .btn-con{
+        text-align: center;
+        margin: 30px 0 20px;
+        .button-cancel,.button-error{
+          font-size: 12px;
+        }
+      }
+    }
+  }
+</style>

+ 190 - 0
src/views/productManagement/foreignTradeGoods/importGuideModal.vue

@@ -0,0 +1,190 @@
+<template>
+  <a-modal
+    centered
+    class="importGuide-modal"
+    :footer="null"
+    :maskClosable="false"
+    title="批量查询"
+    v-model="isShow"
+    @cancel="isShow=false"
+    :width="750">
+    <div class="importGuide-con">
+      <div class="explain-con">
+        <div class="explain-item">
+          <div class="explain-tit">
+            <span>1</span>准备导入
+          </div>
+          <ul>
+            <li>1)请先下载查询模板,输入查询码</li>
+            <li>2)最多可查询500条数据</li>
+            <li>
+              <a :href="filePath" style="margin: 5px 0 0;display: block;">
+                <a-icon type="download" style="padding-right: 5px;" />下载导入模板
+              </a>
+            </li>
+          </ul>
+        </div>
+        <div class="explain-item">
+          <div class="explain-tit">
+            <span>2</span>上传数据文件
+          </div>
+          <p>目前支持的文件类型*.xls,*.xlsx.</p>
+          <div style="overflow: hidden;padding-left: 23px;">
+            <Upload
+              id="importGuide-attachList"
+              ref="importUpload"
+              :maxNums="1"
+              fileType="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.ms-excel"
+              uploadType="import"
+              :action="attachAction"
+              :uploadParams="uploadParams"
+              upText="添加文件"
+              @change="changeImport"></Upload>
+          </div>
+        </div>
+      </div>
+      <!-- 按钮 -->
+      <div class="btn-con">
+        <a-button
+          type="primary"
+          id="importGuide-nextStep"
+          size="large"
+          class="button-primary"
+          @click="handlerNextStep"
+          style="padding: 0 60px;">查询</a-button>
+        <a-button
+          id="importGuide-cancel"
+          size="large"
+          class="button-cancel"
+          @click="isShow=false"
+          style="padding: 0 60px;margin-left: 15px;">取消</a-button>
+      </div>
+    </div>
+    <!-- 导入 -->
+    <chooseImportModal :openModal="openImportModal" :paramsData="paramsData" @close="handleClose" @ok="hanldeOk" />
+  </a-modal>
+</template>
+
+<script>
+import ChooseImportModal from './chooseImportModal.vue'
+import { Upload } from '@/components'
+export default {
+  name: 'ImportGuideModal',
+  components: { ChooseImportModal, Upload },
+  props: {
+    openModal: { //  弹框显示状态
+      type: Boolean,
+      default: false
+    },
+    params: {
+      type: Object,
+      default: null
+    }
+  },
+  data () {
+    return {
+      isShow: this.openModal, //  是否打开弹框
+      openImportModal: false, //  导入
+      attachAction: process.env.VUE_APP_API_BASE_URL + '/upload',
+      paramsData: null,
+      uploadParams: {
+        savePathType: 'local'
+      },
+      exportLoading: false,
+      filePath: location.protocol + '//' + location.host + '/templ/外贸产品查询模板.xlsx'
+    }
+  },
+  methods: {
+    // 查询
+    handlerNextStep () {
+      if (this.paramsData) {
+        this.openImportModal = true
+      } else {
+        this.$message.warning('添加文件后再进行查询操作!')
+      }
+    },
+    // 上传文件  change
+    changeImport (file) {
+      if (file) {
+        this.paramsData = {
+          path: file
+        }
+      }
+    },
+    // 导入
+    hanldeOk (obj) {
+      if (obj && obj.length > 0) {
+        this.$emit('ok', obj)
+        this.isShow = false
+      }
+    },
+    // 关闭
+    handleClose () {
+      this.openImportModal = false
+      this.isShow = false
+    }
+  },
+  watch: {
+    //  父页面传过来的弹框状态
+    openModal (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    //  重定义的弹框状态
+    isShow (newValue, oldValue) {
+      if (!newValue) {
+        this.$emit('close')
+        this.paramsData = null
+        this.$refs.importUpload.setFileList('')
+      }
+    }
+  }
+}
+</script>
+
+<style lang="less" scoped>
+  .importGuide-modal{
+    .importGuide-con{
+      .explain-con{
+        .explain-item{
+          margin-bottom: 10px;
+          .explain-tit{
+            font-weight: bold;
+            span{
+              display: inline-block;
+              width: 18px;
+              height: 18px;
+              line-height: 16px;
+              text-align: center;
+              margin-right: 5px;
+              border-radius: 50%;
+              border: 1px solid rgba(0, 0, 0, 0.3);
+            }
+          }
+          p{
+            margin: 8px 0;
+            padding-left: 23px;
+          }
+          ul{
+            list-style: none;
+            padding: 0;
+            padding-left: 23px;
+            margin: 0;
+            li{
+              line-height: 26px;
+            }
+          }
+        }
+        #importGuide-attachList{
+          width: 100%;
+        }
+      }
+      .btn-con{
+        margin: 10px 0 20px;
+        text-align: center;
+        .button-cancel{
+          font-size: 12px;
+        }
+      }
+    }
+  }
+</style>

+ 226 - 0
src/views/productManagement/foreignTradeGoods/list.vue

@@ -0,0 +1,226 @@
+<template>
+  <div>
+    <a-card size="small" :bordered="false" class="foreignTradeGoods-wrap searchBoxNormal">
+      <!-- 搜索条件 -->
+      <div ref="tableSearch" class="table-page-search-wrapper">
+        <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
+          <a-row :gutter="15">
+            <a-col :md="6" :sm="24">
+              <a-form-item label="外贸产品编码/箭冠产品编码">
+                <a-input id="foreignTradeGoods-productCode" v-model.trim="queryParam.productCode" allowClear placeholder="请输入外贸产品编码/箭冠产品编码"/>
+              </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-item label="OE码">
+                <a-input id="foreignTradeGoods-oeCode" v-model.trim="queryParam.oeCode" allowClear placeholder="请输入OE码"/>
+              </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-item label="大厂码">
+                <a-input id="foreignTradeGoods-queryBigCode " v-model.trim="queryParam.queryBigCode " allowClear placeholder="请输入大厂码"/>
+              </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
+              <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="foreignTradeGoods-refresh">查询</a-button>
+              <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="foreignTradeGoods-reset">重置</a-button>
+              <a-button
+                style="margin-left: 5px;"
+                v-if="$hasPermissions('B_foreignTradeGood_export')"
+                type="primary"
+                class="button-warning"
+                @click="handleExport"
+                :disabled="disabled"
+                :loading="exportLoading"
+                id="foreignTradeGoods-export">导出</a-button>
+            </a-col>
+          </a-row>
+        </a-form>
+      </div>
+    </a-card>
+    <a-card size="small" :bordered="false">
+      <a-spin :spinning="spinning" tip="Loading...">
+        <!-- 操作按钮-->
+        <div class="table-operator">
+          <a-button
+            v-if="$hasPermissions('B_foreignTradeGood_search')"
+            id="foreignTradeGoods-batchAudit"
+            type="primary"
+            @click="openGuideModal = true"
+          >批量查询</a-button>
+        </div>
+        <s-table
+          class="sTable fixPagination"
+          ref="table"
+          :style="{ height: tableHeight+70+'px' }"
+          size="small"
+          :rowKey="(record) => record.no"
+          rowKeyName="no"
+          :columns="columns"
+          :data="loadData"
+          :pageSize="30"
+          :scroll="{ y: tableHeight-30 }"
+          :defaultLoadData="false"
+          bordered>
+        </s-table>
+      </a-spin>
+      <!-- 批量查询 -->
+      <importGuideModal :openModal="openGuideModal" @close="openGuideModal=false" />
+      <!-- 导出提示框 -->
+      <reportModal :visible="showExport" @close="showExport=false"></reportModal>
+    </a-card>
+  </div>
+</template>
+
+<script>
+import { commonMixin } from '@/utils/mixin'
+// 组件
+import { STable, VSelect } from '@/components'
+import productTypeAll from '@/views/common/productTypeAll.js'
+import { hdExportExcel } from '@/libs/exportExcel'
+import ImportGuideModal from './importGuideModal.vue'
+import reportModal from '@/views/common/reportModal.vue'
+// 接口
+import { productForeignList, foreignProductListExport } from '@/api/productForeign'
+export default {
+  name: 'ForeignTradeGoods',
+  mixins: [commonMixin],
+  components: { STable, VSelect, productTypeAll, ImportGuideModal, reportModal },
+  data () {
+    const _this = this
+    return {
+      spinning: false,
+      openGuideModal: false, // 批量查询  弹窗
+      disabled: false, //  查询、重置按钮是否可操作
+      tableHeight: 0, // 表格高度
+      queryParam: { //  查询条件
+        productName: undefined, //  产品名称
+        productCode: undefined, // 产品编码
+        productTypeSn1: undefined, //  产品一级分类
+        productTypeSn2: undefined, //  产品二级分类
+        productTypeSn3: undefined, //  产品三级分类
+        oeCode: undefined, // oe码
+        queryBigCode: undefined, // 大厂码
+        material: undefined// 主材料
+      },
+      productType: [], // 产品分类
+      exportLoading: false, // 导出 loading
+      showExport: false, // 导出弹窗
+      columns: [
+        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
+        { title: '外贸产品编码', dataIndex: 'foreignCode', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '箭冠产品编码', dataIndex: 'productCode', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: 'OE码', dataIndex: 'oeCode', width: '9%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '大厂码',
+          children: [
+            {
+              title: 'MANN No.', dataIndex: 'mannCode', width: '10%', align: 'center', customRender: function (text) { return text || '--' }
+            },
+            {
+              title: 'MAHLE No.', dataIndex: 'mahleCode', width: '10%', align: 'center', customRender: function (text) { return text || '--' }
+            },
+            {
+              title: 'VIC No.', dataIndex: 'vicCode', width: '10%', align: 'center', customRender: function (text) { return text || '--' }
+            },
+            {
+              title: 'FRAM NO.', dataIndex: 'framCode', width: '10%', align: 'center', customRender: function (text) { return text || '--' }
+            },
+            {
+              title: 'WIX No.', dataIndex: 'wixCode', width: '10%', align: 'center', customRender: function (text) { return text || '--' }
+            }
+          ]
+        },
+        { title: '产品尺寸', dataIndex: 'size', width: '9%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '主材料', dataIndex: 'material', width: '9%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '含盒报价', dataIndex: 'priceFreeBox', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        { title: '无盒报价', dataIndex: 'priceWithBox', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } }
+      ],
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.disabled = true
+        this.spinning = true
+        return productForeignList(Object.assign(parameter, this.queryParam)).then(res => {
+          let data
+          if (res.status == 200) {
+            data = res.data
+            const no = (data.pageNo - 1) * data.pageSize
+            for (var i = 0; i < data.list.length; i++) {
+              data.list[i].no = no + i + 1
+            }
+            this.disabled = false
+          }
+          this.spinning = false
+          return data
+        })
+      }
+    }
+  },
+  methods: {
+    //  重置
+    resetSearchForm () {
+      this.queryParam = {
+        productName: undefined, //  产品名称
+        productCode: undefined, // 产品编码
+        productTypeSn1: undefined, //  产品一级分类
+        productTypeSn2: undefined, //  产品二级分类
+        productTypeSn3: undefined, //  产品三级分类
+        oeCode: undefined, // oe码
+        queryBigCode: undefined, // 大厂码
+        material: undefined// 主材料
+      }
+      this.productType = []
+      this.$refs.table.refresh(true)
+    },
+    //  导出
+    handleExport () {
+      const _this = this
+      const params = this.queryParam
+      _this.spinning = true
+      _this.exportLoading = true
+      _this.showExport = true
+      hdExportExcel(foreignProductListExport, params, '外贸产品', function () {
+        _this.spinning = false
+        _this.exportLoading = false
+      })
+    },
+    //  产品分类  change
+    changeProductType (val, opt) {
+      this.queryParam.productTypeSn1 = val[0] ? val[0] : undefined
+      this.queryParam.productTypeSn2 = val[1] ? val[1] : undefined
+      this.queryParam.productTypeSn3 = val[2] ? val[2] : undefined
+    },
+    pageInit () {
+      const _this = this
+      this.$nextTick(() => { // 页面渲染完成后的回调
+        _this.setTableH()
+      })
+    },
+    setTableH () {
+      const tableSearchH = this.$refs.tableSearch.offsetHeight
+      this.tableHeight = window.innerHeight - tableSearchH - 240
+    }
+  },
+  mounted () {
+    if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
+      this.pageInit()
+      this.resetSearchForm()
+    }
+  },
+  activated () {
+    // 如果是新页签打开,则重置当前页面
+    if (this.$store.state.app.isNewTab) {
+      this.pageInit()
+      this.resetSearchForm()
+    }
+  },
+  beforeRouteEnter (to, from, next) {
+    next(vm => {
+      vm.pageFromInfo = from
+    })
+  }
+}
+</script>
+<style lang="less" scoped>
+    /deep/.sTable td{
+        white-space: pre-line;
+      }
+</style>

+ 2 - 2
src/views/productManagement/productInfo/chooseImportModal.vue

@@ -104,7 +104,7 @@ export default {
         { title: '是否箭冠产品', dataIndex: 'arrow', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '条形码', dataIndex: 'qrCode', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '产品尺寸', dataIndex: 'size', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '产品重量', dataIndex: 'weight', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '产品重量(g)', dataIndex: 'weight', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '颜色', dataIndex: 'color', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '产品内盒尺寸', dataIndex: 'boxSize', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '产品说明', dataIndex: 'description', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
@@ -129,7 +129,7 @@ export default {
         { title: '是否箭冠产品', dataIndex: 'arrow', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '条形码', dataIndex: 'qrCode', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '产品尺寸', dataIndex: 'size', width: '4%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '产品重量', dataIndex: 'weight', width: '4%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '产品重量(g)', dataIndex: 'weight', width: '4%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '颜色', dataIndex: 'color', width: '4%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '产品内盒尺寸', dataIndex: 'boxSize', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '产品说明', dataIndex: 'description', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },

+ 2 - 1
src/views/productManagement/productInfo/detailModal.vue

@@ -37,7 +37,8 @@
         <a-descriptions-item label="单位:">{{ detailsData&&detailsData.unit || '--' }}</a-descriptions-item>
         <a-descriptions-item label="产品尺寸:">{{ detailsData&&detailsData.size || '--' }}</a-descriptions-item>
         <a-descriptions-item label="产品内盒尺寸:">{{ detailsData&&detailsData.boxSize || '--' }}</a-descriptions-item>
-        <a-descriptions-item label="产品重量:">{{ detailsData&&detailsData.weight || '--' }}</a-descriptions-item>
+        <a-descriptions-item label="产品重量(g):" v-if="detailsData&&(detailsData.weight||detailsData.weight==0)">{{ detailsData.weight }}({{ detailsData.weight/1000 }}kg)</a-descriptions-item>
+        <a-descriptions-item label="产品重量(g):" v-else>--</a-descriptions-item>
         <a-descriptions-item label="颜色:" span="2">{{ detailsData&&detailsData.color || '--' }}</a-descriptions-item>
         <a-descriptions-item label="产品说明:" span="2">
           <div v-html="detailsData.description" v-if="detailsData&&detailsData.description" style="overflow-y: scroll;height: 300px;"></div>

+ 10 - 7
src/views/productManagement/productInfo/edit.vue

@@ -170,13 +170,16 @@
               </a-form-model-item>
             </a-col>
             <a-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
-              <a-form-model-item label="产品重量" prop="weight">
-                <a-input
-                  v-model.trim="form.weight"
+              <a-form-model-item label="产品重量(g)" prop="weight">
+                <a-input-number
+                  style="width:80%;"
+                  :precision="0"
                   id="productInfoEdit-weight"
-                  :maxLength="50"
-                  allowClear
-                  placeholder="请输入产品重量(最多50个字符)" />
+                  v-model="form.weight"
+                  :min="1"
+                  :max="999999"
+                  placeholder="请输入产品重量,注意单位为g(正整数)"/>
+                <span v-if="form.weight">({{ form.weight/1000 }}kg)</span>
               </a-form-model-item>
             </a-col>
             <a-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
@@ -264,7 +267,7 @@ export default {
         qrCode: '', // 条形码
         productMsg: '', //  产品图片
         size: '', // 产品尺寸
-        weight: '', // 产品重量
+        weight: undefined, // 产品重量
         color: undefined, // 颜色
         boxSize: '', // 内核尺寸
         description: '', // 产品说明

+ 51 - 8
src/views/reportData/salesDetails/list.vue

@@ -151,6 +151,9 @@
     </a-card>
     <a-card size="small" :bordered="false">
       <a-spin :spinning="spinning" tip="Loading...">
+        <div style="margin-bottom:12px;text-align: right;">
+          <a-checkbox id="salesDetailsList-cityPrice" v-model="isAveragePrice" v-if="$hasPermissions('B_salesDetails_avgprice')"><span style="display: inline-block;margin-top: 1px;">平均公斤单价</span></a-checkbox>
+        </div>
         <!-- 列表 -->
         <s-table
           class="sTable fixPagination"
@@ -178,18 +181,16 @@
               <a-col :md="4" :sm="24" v-if="$hasPermissions('M_salesDetailsList_costPrice')">成本金额:{{ (totalData && (totalData.totalCost || totalData.totalCost==0)) ? toThousands(totalData.totalCost) : '--' }}</a-col>
               <a-col :md="4" :sm="24" v-if="$hasPermissions('M_salesDetailsList_salesPrice')">总优惠金额(含特价):{{ (totalData && (totalData.discountAmount || totalData.discountAmount==0)) ? toThousands(totalData.discountAmount) : '--' }}</a-col>
               <a-col :md="4" :sm="24">毛利率(减促销费用):{{ (totalData && (totalData.grossMargin || totalData.grossMargin==0)) ? (totalData.grossMargin*100).toFixed(2)+'%' : '--' }}</a-col>
-              <a-col :md="4" :sm="24"></a-col>
-              <a-col :md="4" :sm="24"></a-col>
+              <a-col :md="4" :sm="24" v-if="isAveragePrice"><label>合计重量(kg):</label>{{ (totalData && (totalData.totalWeight || totalData.totalWeight==0)) ? totalData.totalWeight : '--' }}</a-col>
+              <a-col :md="4" :sm="24" v-if="$hasPermissions('M_salesDetailsList_costPrice')&&isAveragePrice"><label>平均成本公斤单价:</label>{{ (totalData && (totalData.weightAvgCost || totalData.weightAvgCost==0)) ? toThousands(totalData.weightAvgCost) : '--' }}</a-col>
             </a-row>
             <a-row :gutter="15">
               <a-col :md="4" :sm="24" v-if="$hasPermissions('M_salesDetailsList_salesPrice')">开单金额:{{ (totalData && (totalData.totalAmount || totalData.totalAmount==0)) ? toThousands(totalData.totalAmount) : '--' }}</a-col>
               <a-col :md="4" :sm="24" v-if="$hasPermissions('M_salesDetailsList_salesPrice')">实售金额:{{ (totalData && (totalData.totalRealAmount || totalData.totalRealAmount==0)) ? toThousands(totalData.totalRealAmount) : '--' }}</a-col>
               <a-col :md="4" :sm="24" v-if="$hasPermissions('M_salesDetailsList_salesPrice')">&nbsp;&nbsp;特价产品优惠金额:{{ (totalData && (totalData.specialDiscountAmount || totalData.specialDiscountAmount==0)) ? toThousands(totalData.specialDiscountAmount) : '--' }}</a-col>
               <a-col :md="4" :sm="24">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;实际毛利率:{{ (totalData && (totalData.realGrossMargin || totalData.realGrossMargin==0)) ? (totalData.realGrossMargin*100).toFixed(2)+'%' : '--' }}</a-col>
-              <a-col :md="4" :sm="24"></a-col>
-              <a-col :md="4" :sm="24"></a-col>
-            <!--  <a-col :md="4" :sm="24" v-if="$hasPermissions('M_salesDetailsList_salesPrice')">折后金额:{{ (totalData && (totalData.discountedAmount || totalData.discountedAmount==0)) ? toThousands(totalData.discountedAmount) : '--' }}</a-col>
-            <a-col :md="4" :sm="24" v-if="$hasPermissions('M_salesDetailsList_salesPrice')">折扣金额:{{ (totalData && (totalData.discountAmount || totalData.discountAmount==0)) ? toThousands(totalData.discountAmount) : '--' }}</a-col> -->
+              <a-col :md="4" :sm="24" v-if="$hasPermissions('M_salesDetailsList_costPrice')&&isAveragePrice"><label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;返利金额:</label>{{ (totalData && (totalData.totalFactoryRebateAmount || totalData.totalFactoryRebateAmount==0)) ? toThousands(totalData.totalFactoryRebateAmount) : '--' }}</a-col>
+              <a-col :md="4" :sm="24" v-if="$hasPermissions('M_salesDetailsList_salesPrice')&&isAveragePrice"><label>平均售价公斤单价:</label>{{ (totalData && (totalData.weightAvgPrice || totalData.weightAvgPrice==0)) ? toThousands(totalData.weightAvgPrice) : '--' }}</a-col>
             </a-row>
           </template></s-table>
       </a-spin>
@@ -262,6 +263,7 @@ export default {
         promotionFlag: undefined, // 产品类型
         bizUserSn: undefined // 客服
       },
+      isAveragePrice: false, // 平均公斤单价
       productType: [], // 产品分类
       totalData: null, // 统计数据
       rules: {
@@ -289,7 +291,23 @@ export default {
           this.spinning = false
           return data
         })
-      }
+      },
+      // 列表列显示
+      colsArr: [
+        {
+          title: '单重',
+          value: 'directRebateAmountInfo',
+          key: 'directRebateAmountInfo',
+          disabled: !this.$hasPermissions('M_salesOrderTotalList_salesPrice')
+        },
+        {
+          title: '平均公斤单价',
+          value: 'indirectRebateAmountInfo',
+          key: 'indirectRebateAmountInfo',
+          disabled: !this.$hasPermissions('M_salesOrderTotalList_salesPrice')
+        }
+      ],
+      showCols: []// 已勾选显示的列
     }
   },
   computed: {
@@ -325,11 +343,26 @@ export default {
         // { title: '折后单价', dataIndex: 'discountedPrice', width: 70, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         // { title: '折扣金额', dataIndex: 'discountAmount', width: 70, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
       ]
+      if (this.isAveragePrice) {
+        arr.push({ title: '单重(kg)', dataIndex: 'weight', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+        arr.push({ title: '合计重量(kg)', dataIndex: 'totalWeight', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+      }
       if (this.$hasPermissions('M_salesDetailsList_costPrice')) { //  成本价权限
-        arr.splice(21, 0, { title: '成本金额', dataIndex: 'totalCost', width: 70, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+        arr.push({ title: '成本金额', dataIndex: 'totalCost', width: 70, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+        if (this.isAveragePrice) {
+          arr.push({ title: '平均成本公斤单价', dataIndex: 'weightAvgCost', width: 70, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+        }
       }
       if (this.$hasPermissions('M_salesDetailsList_salesPrice')) { //  售价权限
         arr.push({ title: '实售金额', dataIndex: 'totalRealAmount', width: 70, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+        if (this.isAveragePrice) {
+          arr.push({ title: '平均售价公斤单价', dataIndex: 'weightAvgPrice', width: 70, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+        }
+      }
+      if (this.$hasPermissions('M_salesDetailsList_costPrice') && this.isAveragePrice) {
+        arr.push({ title: '返利金额', dataIndex: 'totalFactoryRebateAmount', width: 70, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+      }
+      if (this.$hasPermissions('M_salesDetailsList_salesPrice')) {
         arr.push({ title: '开单金额', dataIndex: 'totalAmount', width: 70, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
       }
       if (this.$hasPermissions('M_salesDetailsList_cityPrice')) { //  市级价权限
@@ -501,3 +534,13 @@ export default {
   }
 }
 </script>
+<style lang="less" scoped>
+  .footerBox{
+    /deep/ label{
+      display: inline-block;
+      width: 135px;
+      text-align: right;
+    }
+
+  }
+</style>

+ 5 - 1
src/views/reportData/tireSubsidyReport/index.vue

@@ -14,6 +14,9 @@
         <a-tab-pane key="4" tab="增量补贴报表(年度)" force-render>
           <incrementalSubsidyYearList ref="tableList4"></incrementalSubsidyYearList>
         </a-tab-pane>
+        <a-tab-pane key="5" tab="供应商轮胎补贴返利报表" force-render>
+          <supplierRebateList ref="tableList5"></supplierRebateList>
+        </a-tab-pane>
       </a-tabs>
     </a-card>
   </div>
@@ -25,10 +28,11 @@ import serviceFreightList from './serviceFreightList.vue'
 import incrementalSubsidyList from './incrementalSubsidyList.vue'
 import incrementalSubsidyYearList from './incrementalSubsidyYearList.vue'
 import serviceFreightDetailList from './serviceFreightDetailList.vue'
+import supplierRebateList from './supplierRebateList.vue'
 export default {
   name: 'TireFeeReportIndex',
   mixins: [commonMixin],
-  components: { serviceFreightList, incrementalSubsidyList, incrementalSubsidyYearList, serviceFreightDetailList },
+  components: { serviceFreightList, incrementalSubsidyList, incrementalSubsidyYearList, serviceFreightDetailList, supplierRebateList },
   data () {
     return {
       tabVal: 1 // tab值

+ 375 - 0
src/views/reportData/tireSubsidyReport/supplierRebateList.vue

@@ -0,0 +1,375 @@
+<template>
+  <div>
+    <a-card size="small" :bordered="false" class="sRebateList-wrap searchBoxNormal">
+      <!-- 搜索条件 -->
+      <div class="table-page-search-wrapper" ref="tableSearch">
+        <a-form-model
+          id="sRebateList-form"
+          ref="ruleForm"
+          class="form-model-con"
+          layout="inline"
+          :rules="rules"
+          :model="queryParam">
+          <a-row :gutter="15">
+            <a-col :md="6" :sm="24">
+              <a-form-model-item prop="queryDate">
+                <div style="display: inline;" slot="label">
+                  <a-popover placement="top">
+                    <template slot="content">
+                      <p>1、销售单(非转单)下推时间</p>
+                    </template>
+                    查询月份 <a-icon type="question-circle" />
+                  </a-popover>
+                </div>
+                <a-month-picker
+                  id="sRebateList-monthBox"
+                  class="monthBox"
+                  :disabled-date="disabledDate"
+                  v-model="queryParam.queryDate"
+                  placeholder="请选择月份"
+                  @change="onChangeMonth" />
+              </a-form-model-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-item label="销售单号">
+                <a-input id="sRebateList-salesBillNo" v-model.trim="queryParam.salesBillNo" allowClear placeholder="请输入销售单号"/>
+              </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-item label="备货单号">
+                <a-input id="sRebateList-dispatchBillNo" v-model.trim="queryParam.dispatchBillNo" allowClear placeholder="请输入备货单号"/>
+              </a-form-item>
+            </a-col>
+            <template v-if="advanced">
+              <a-col :md="6" :sm="24">
+                <a-form-model-item label="客户名称">
+                  <custList id="sRebateList-dealerName" dataAuthFlag="0" placeholder="请输入客户名称" ref="custList" @change="custChange" />
+                </a-form-model-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-model-item label="客户级别">
+                  <v-select
+                    v-model="queryParam.dealerLevel"
+                    ref="dealerLevel"
+                    id="sRebateList-dealerLevel"
+                    code="DEALER_LEVEL"
+                    placeholder="请选择客户级别"
+                    allowClear></v-select>
+                </a-form-model-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-item label="所在区域">
+                  <subarea id="sRebateList-subarea" ref="subarea" @change="subareaChange"></subarea>
+                </a-form-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-model-item label="地区">
+                  <Area id="sRebateList-provinceSn" v-model="queryParam.provinceSn" placeholder="请选择省份"></Area>
+                </a-form-model-item>
+              </a-col>
+            </template>
+            <a-col :md="6" :sm="24">
+              <a-button
+                type="primary"
+                @click="handleSearch"
+                :disabled="disabled"
+                id="sRebateList-refresh">查询</a-button>
+              <a-button
+                style="margin-left: 8px"
+                @click="resetSearchForm"
+                :disabled="disabled"
+                id="sRebateList-reset">重置</a-button>
+              <a-button
+                style="margin-left: 10px"
+                type="primary"
+                class="button-warning"
+                @click="handleExport"
+                :disabled="disabled"
+                :loading="exportLoading"
+                v-if="$hasPermissions('M_tireSubsidyExport')"
+                id="sRebateList-export">导出</a-button>
+              <a @click="advanced=!advanced" style="margin-left: 5px">
+                {{ advanced ? '收起' : '展开' }}
+                <a-icon :type="advanced ? 'up' : 'down'" />
+              </a>
+            </a-col>
+          </a-row>
+        </a-form-model>
+      </div>
+    </a-card>
+    <a-card size="small" :bordered="false">
+      <a-spin :spinning="spinning" tip="Loading...">
+        <!-- 列表 -->
+        <s-table
+          class="sTable fixPagination"
+          ref="table"
+          size="small"
+          :rowKey="(record) => record.no"
+          rowKeyName="no"
+          :style="{ height: tableHeight+70+'px' }"
+          :columns="columns"
+          :data="loadData"
+          :pageSize="30"
+          :scroll="{ x: 2200, y: tableHeight-50}"
+          :defaultLoadData="false"
+          bordered>
+          <template slot="footer">
+            <a-row :gutter="15">
+              <a-col :md="6" :sm="24">下推数量:{{ (totalData && (totalData.totalQty || totalData.totalQty==0)) ?totalData.totalQty: '--' }}</a-col>
+              <a-col :md="6" :sm="24" v-if="$hasPermissions('M_tireSubsidyList_costPrice')">平均成本公斤单价:{{ (totalData && (totalData.averageCost || totalData.averageCost==0)) ? toThousands(totalData.averageCost): '--' }}</a-col>
+              <a-col :md="6" :sm="24" v-if="$hasPermissions('M_tireSubsidyList_costPrice')">成本金额:{{ (totalData && (totalData.totalCost || totalData.totalCost==0)) ? toThousands(totalData.totalCost): '--' }}</a-col>
+              <a-col :md="6" :sm="24">合计重量(kg):{{ (totalData && (totalData.totalWeight || totalData.totalWeight==0)) ?totalData.totalWeight: '--' }}</a-col>
+              <a-col :md="6" :sm="24" v-if="$hasPermissions('M_tireSubsidyList_salesPrice')">实售金额:{{ (totalData && (totalData.totalRealAmount || totalData.totalRealAmount==0)) ? toThousands(totalData.totalRealAmount): '--' }}</a-col>
+              <a-col :md="6" :sm="24" v-if="$hasPermissions('M_tireSubsidyList_salesPrice')">平均售价公斤单价:{{ (totalData && (totalData.averageRealAmount || totalData.averageRealAmount==0)) ? toThousands(totalData.averageRealAmount): '--' }}</a-col>
+              <a-col :md="6" :sm="24" v-if="$hasPermissions('M_tireSubsidyList_costPrice')">返利金额:{{ (totalData && (totalData.totalFactoryRebate || totalData.totalFactoryRebate==0)) ? toThousands(totalData.totalFactoryRebate): '--' }}</a-col>
+            </a-row>
+          </template>
+        </s-table>
+      </a-spin>
+    </a-card>
+  </div>
+</template>
+
+<script>
+import { commonMixin } from '@/utils/mixin'
+import { hdExportExcel } from '@/libs/exportExcel'
+import moment from 'moment'
+// 组件
+import { STable, VSelect } from '@/components'
+import subarea from '@/views/common/subarea.js'
+import Area from '@/views/common/area.js'
+import custList from '@/views/common/custList.vue'
+// 接口
+import { subsidyTireList, subsidyTireCount, subsidyTireExport } from '@/api/reportData'
+export default {
+  name: 'SupplierRebateList',
+  mixins: [commonMixin],
+  components: { STable, VSelect, subarea, Area, custList },
+  data () {
+    return {
+      spinning: false,
+      disabled: false, //  查询、重置按钮是否可操作
+      advanced: true, // 高级搜索 展开/关闭
+      tableHeight: 0, // 表格高度
+      exportLoading: false, // 导出按钮加载状态
+      //  查询条件
+      queryParam: {
+        beginDate: moment().startOf('month').format('YYYY-MM-DD') + ' 00:00:00', // 开始月份
+        endDate: moment().endOf('month').format('YYYY-MM-DD') + ' 23:59:59', // 结束月份
+        queryDate: moment().format('YYYY-MM'), // 选择月份
+        salesBillNo: undefined, // 销售单号
+        dispatchBillNo: undefined, // 备货单号
+        subareaArea: {
+          subareaSn: undefined, // 区域
+          subareaAreaSn: undefined // 分区
+        },
+        provinceSn: undefined, // 省份sn
+        dealerName: undefined, // 客户名称
+        dealerSn: undefined, // 客户名称sn
+        dealerLevel: undefined// 客户等级
+      },
+      totalData: null, // 合计
+      rules: {
+        'queryDate': [{ required: true, message: '请选择查询月份', trigger: 'change' }]
+      },
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.disabled = true
+        this.spinning = true
+        const params = Object.assign(parameter, this.queryParam)
+        const newParams = JSON.parse(JSON.stringify(params))
+        delete newParams.queryDate
+        // 获取列表数据  有分页
+        return subsidyTireList(newParams).then(res => {
+          let data
+          if (res.status == 200) {
+            data = res.data
+            // 计算表格序号
+            const no = (data.pageNo - 1) * data.pageSize
+            for (var i = 0; i < data.list.length; i++) {
+              data.list[i].no = no + i + 1
+            }
+            this.disabled = false
+            // 获取统计数据
+            this.getCount(newParams)
+          }
+          this.spinning = false
+          return data
+        })
+      }
+    }
+  },
+  watch: {
+    advanced (newValue, oldValue) {
+      const _this = this
+      this.$nextTick(() => { // 页面渲染完成后的回调
+        _this.setTableH()
+      })
+    },
+    '$store.state.app.winHeight' (newValue, oldValue) { //  窗口变更时,需同时更改表格高度
+      this.setTableH()
+    }
+  },
+  computed: {
+    columns () {
+      const _this = this
+      const arr = [
+        { title: '序号', dataIndex: 'no', width: '40px', align: 'center' },
+        { title: '区域', dataIndex: 'subareaArea.subareaName', width: '90px', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '分区', dataIndex: 'subareaArea.subareaAreaName', width: '90px', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '销售单号', dataIndex: 'salesBillNo', width: '110px', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '备货单号', dataIndex: 'dispatchBillNo', width: '100px', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '省份', dataIndex: 'provinceName', width: '80px', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '客户名称', dataIndex: 'dealerName', width: '150px', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '客户级别', dataIndex: 'dealerLevelDictValue', width: '80px', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '下推时间', dataIndex: 'pushedDate', width: '110px', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '下推数量', dataIndex: 'totalQty', width: '80px', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '单重(kg)', dataIndex: 'weight', width: '80px', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '合计重量(kg)', dataIndex: 'totalWeight', width: '80px', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
+      ]
+      // 成本权限
+      if (_this.$hasPermissions('M_tireSubsidyList_costPrice')) {
+        arr.push({ title: '成本金额', dataIndex: 'totalCost', width: '80px', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+        arr.push({ title: '平均成本公斤单价', dataIndex: 'averageCost', width: '100px', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+      }
+      // 售价权限
+      if (_this.$hasPermissions('M_tireSubsidyList_salesPrice')) {
+        arr.push({ title: '实售金额', dataIndex: 'totalRealAmount', width: '80px', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+        arr.push({ title: '平均售价公斤单价', dataIndex: 'averageRealAmount', width: '100px', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+      }
+      if (_this.$hasPermissions('M_tireSubsidyList_costPrice')) {
+        arr.push({ title: '返利金额', dataIndex: 'totalFactoryRebate', width: '80px', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+      }
+      return arr
+    }
+  },
+  methods: {
+    // 选择月份  禁用选择当月以后日期
+    disabledDate (current) {
+      return current && current >= moment().endOf('day')
+    },
+    // 选择月份 change
+    onChangeMonth (date, dateString) {
+      this.monthVal = dateString
+      if (date && dateString != '') {
+        this.queryParam.beginDate = moment(dateString).startOf('month').format('YYYY-MM-DD') + ' 00:00:00'
+        this.queryParam.endDate = moment(dateString).endOf('month').format('YYYY-MM-DD') + ' 23:59:59'
+      } else {
+        this.queryParam.beginDate = void 0
+        this.queryParam.endDate = void 0
+      }
+    },
+    // 查询
+    handleSearch () {
+      const _this = this
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          _this.$refs.table.refresh(true)
+        } else {
+          _this.$message.error('请选择查询月份')
+          return false
+        }
+      })
+    },
+    // 客户名称 change
+    custChange (val) {
+      this.queryParam.dealerSn = val.key
+      this.queryParam.dealerName = val && val.label ? val.label.replace(/\s+/g, '') : undefined
+    },
+    // 统计
+    getCount (params) {
+      subsidyTireCount(params).then(res => {
+        if (res.status == 200 && res.data) {
+          this.totalData = res.data
+        } else {
+          this.totalData = null
+        }
+      })
+    },
+    // 区域分区  change
+    subareaChange (val) {
+      this.queryParam.subareaArea.subareaSn = val[0] ? val[0] : undefined
+      this.queryParam.subareaArea.subareaAreaSn = val[1] ? val[1] : undefined
+    },
+    //  重置
+    resetSearchForm () {
+      this.queryParam.beginDate = moment().startOf('month').format('YYYY-MM-DD') + ' 00:00:00' // 开始月份
+      this.queryParam.endDate = moment().endOf('month').format('YYYY-MM-DD') + ' 23:59:59' // 结束月份
+      this.queryParam.queryDate = moment().format('YYYY-MM')// 选择月份
+      this.queryParam.salesBillNo = undefined
+      this.queryParam.dispatchBillNo = undefined
+      this.queryParam.subareaArea.subareaSn = undefined
+      this.queryParam.provinceSn = undefined
+      this.queryParam.dealerName = undefined
+      this.queryParam.dealerSn = undefined
+      this.queryParam.dealerLevel = undefined
+      if (this.advanced) {
+        this.$refs.custList.resetForm()
+        this.$refs.subarea.clearData()
+      }
+      this.totalData = null
+      this.$refs.table.clearTable()
+      this.$refs.ruleForm.resetFields()
+    },
+    //  导出  必填判断
+    handleExport () {
+      const _this = this
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          _this.exportList()
+        } else {
+          _this.$message.error('请选择查询月份')
+          return false
+        }
+      })
+    },
+    // 导出
+    exportList () {
+      const _this = this
+      const params = JSON.parse(JSON.stringify(_this.queryParam))
+      _this.$store.state.app.curActionPermission = 'M_tireSubsidyExport'
+      _this.exportLoading = true
+      _this.spinning = true
+      hdExportExcel(subsidyTireExport, params, '供应商轮胎补贴返利报表-', function () {
+        _this.exportLoading = false
+        _this.spinning = false
+        _this.$store.state.app.curActionPermission = ''
+      })
+    },
+    // 初始化
+    pageInit () {
+      this.$nextTick(() => { // 页面渲染完成后的回调
+        this.setTableH()
+      })
+      this.resetSearchForm()
+    },
+    // 计算表格高度
+    setTableH () {
+      const tableSearchH = this.$refs.tableSearch.offsetHeight
+      this.tableHeight = window.innerHeight - tableSearchH - 280
+    }
+  },
+  mounted () {
+    if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
+      this.pageInit()
+    }
+  },
+  activated () {
+    // 如果是新页签打开,则重置当前页面
+    if (this.$store.state.app.isNewTab) {
+      this.pageInit()
+    }
+  }
+}
+</script>
+<style lang="less" scoped>
+  .monthBox{
+    width: 100%;
+    /deep/.ant-calendar-picker-icon{
+      display:none !important;
+    }
+    /deep/.ant-calendar-picker input{
+      text-align:center;
+    }
+  }
+</style>

+ 6 - 2
src/views/salesManagement/pushOrderManagement/detail.vue

@@ -105,6 +105,9 @@
             <span v-if="$route.params.type!='stockOut'&&$hasPermissions('B_dispatchDetail_cityPrice')">
               本次下推市级价金额:<strong>{{ detailData&&(detailData.totalCityAmount || detailData.totalCityAmount==0) ? toThousands(detailData.totalCityAmount) : '--' }}</strong>;
             </span>
+            <span v-if="$route.params.type!='stockOut'&&$hasPermissions('B_dispatchDetail_cityPrice')">
+              合计重量(kg):<strong>{{ detailData&&(detailData.totalWeight || detailData.totalWeight==0) ? detailData.totalWeight : '--' }}</strong>;
+            </span>
           </div>
         </a-alert>
         <!-- 列表 -->
@@ -235,12 +238,13 @@ export default {
         // { title: '销售价格', dataIndex: 'price', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         // { title: '市级销售价格', dataIndex: 'cityPrice', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '销售数量', dataIndex: 'salesQty', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '本次下推数', dataIndex: 'qty', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
+        { title: '本次下推数', dataIndex: 'qty', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '合计重量(kg)', dataIndex: 'totalWeight', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
         // { title: '本次下推金额', dataIndex: 'totalAmount', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
       ]
       if (this.$hasPermissions('B_dispatchDetail_salesPrice')) { //  售价权限
         arr.splice(5, 0, { title: '销售价格', dataIndex: 'price', width: '8%', align: 'right', scopedSlots: { customRender: 'price' } })
-        arr.splice(9, 0, { title: '本次下推金额', dataIndex: 'totalAmount', width: '8%', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') })
+        arr.splice(8, 0, { title: '本次下推金额', dataIndex: 'totalAmount', width: '8%', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') })
       }
       if (this.$hasPermissions('B_dispatchDetail_cityPrice')) { //  市级权限
         arr.splice(6, 0, { title: '市级销售价格', dataIndex: 'cityPrice', width: '10%', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') })

+ 2 - 2
src/views/salesManagement/pushOrderManagement/list.vue

@@ -182,11 +182,11 @@
         <commonModal
           modalTit="销售单详情"
           bodyPadding="10px"
-          width="70%"
+          width="75%"
           :showFooter="false"
           :openModal="showDetailModal"
           @cancel="closeDetailModal">
-          <salesDetail v-if="showDetailModal" ref="salesDetail" :bizSn="bizSn"></salesDetail>
+          <salesDetail v-if="showDetailModal" pageTypeAuth="B_salesDetail" ref="salesDetail" :bizSn="bizSn"></salesDetail>
         </commonModal>
 
         <!-- 发货说明 -->

+ 24 - 5
src/views/salesManagement/salesQueryNew/comps/detailProductList.vue

@@ -69,6 +69,11 @@ export default {
       type: Boolean,
       default: false
     },
+    // 是否显示平均公斤单价
+    showAveragePrice: {
+      type: Boolean,
+      default: false
+    },
     // 权限码
     authCode: {
       type: String,
@@ -222,9 +227,9 @@ export default {
       // 列定义
       let arr = [
         { title: '序号', field: 'no', key: 'a', width: 50, align: 'center', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return noFormat(row, row[column.field], h) } },
-        { title: '产品编码', field: 'productCode', key: 'b', width: 150, align: 'left', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return codeFormat(row, row[column.field], h) } },
-        { title: '产品名称', field: 'productName', key: 'c', width: 250, align: 'left', operationColumn: false, ellipsis: { showTitle: true }, renderBodyCell: ({ row, column, rowIndex }, h) => { return row[column.field] || '--' } },
-        { title: '原厂编码', field: 'productOrigCode', key: 'd', width: 150, align: 'left', operationColumn: false, ellipsis: { showTitle: true }, renderBodyCell: ({ row, column, rowIndex }, h) => { return row[column.field] || '--' } },
+        { title: '产品编码', field: 'productCode', key: 'b', width: 120, align: 'left', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return codeFormat(row, row[column.field], h) } },
+        { title: '产品名称', field: 'productName', key: 'c', width: 180, align: 'left', operationColumn: false, ellipsis: { showTitle: true }, renderBodyCell: ({ row, column, rowIndex }, h) => { return row[column.field] || '--' } },
+        { title: '原厂编码', field: 'productOrigCode', key: 'd', width: 120, align: 'left', operationColumn: false, ellipsis: { showTitle: true }, renderBodyCell: ({ row, column, rowIndex }, h) => { return row[column.field] || '--' } },
         { title: '出库仓库', field: 'warehouseName', key: 'e', width: 100, align: 'center', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return row[column.field] || '--' } }
       ]
       // 计算可合并单元格数
@@ -235,7 +240,7 @@ export default {
       }
       this.colspanNums = this.colspanNums + 2
       arr = arr.concat([
-        { title: '单位', field: 'productOrigUnit', key: 'g', width: 80, align: 'center', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return row[column.field] || '--' } },
+        { title: '单位', field: 'productOrigUnit', key: 'g', width: 70, align: 'center', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return row[column.field] || '--' } },
         { title: '销售数量', field: 'qty', width: 80, key: 'h', align: 'center', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return numsFormat(row[column.field]) } }
       ])
 
@@ -281,6 +286,17 @@ export default {
         arr.push({ title: '转采购额数量', field: 'convertPromoGiftsQty', width: 100, key: 'z', align: 'center', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return row.convertPromoGiftsFlag ? numsFormat(row[column.field]) : '--' } })
       }
       arr.push({ title: '已取消数', field: 'cancelQty', width: 80, key: 'q', align: 'center', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return numsFormat(row[column.field]) } })
+      if (this.showAveragePrice) {
+        this.colspanNums = this.colspanNums + 4
+        arr.push({ title: '单重(kg)', field: 'weightKg', width: 80, key: 'q1', align: 'center', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return numsFormat(row[column.field]) } })
+        arr.push({ title: '合计重量(kg)', field: 'totalWeightKg', width: 98, key: 'q2', align: 'center', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return numsFormat(row[column.field]) } })
+        if (this.$hasPermissions(this.authCode + '_costPrice')) {
+          arr.push({ title: '平均成本公斤单价', field: 'weightAvgCost', width: 105, key: 'q3', align: 'right', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return numsFormat(row[column.field]) } })
+        }
+        if (this.$hasPermissions(this.authCode + '_salesPrice')) {
+          arr.push({ title: '平均售价公斤单价', field: 'weightAvgPrice', width: 105, key: 'q4', align: 'right', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return numsFormat(row[column.field]) } })
+        }
+      }
       return arr
     },
     // 是否有可转采购额
@@ -481,7 +497,7 @@ export default {
 }
 </script>
 
-  <style lang="less">
+  <style lang="less" scoped>
     .empty-data{
         color: #999;
         text-align: center;
@@ -503,4 +519,7 @@ export default {
     .ve-table .ve-table-container .ve-table-content-wrapper{
       border-bottom: 1px solid #ddd;
     }
+    /deep/.ve-table-header-th{
+      text-align: center !important;
+    }
   </style>

+ 1 - 1
src/views/salesManagement/salesQueryNew/comps/productList.vue

@@ -150,7 +150,7 @@
       :rowKey="(record) => record.id"
       :columns="columns"
       :data="loadData"
-      :row-selection="{ columnWidth: 40, getCheckboxProps: record => ({ props: { disabled: record.promotionFlag == 'GIFT'&&!!record.salesPromoDetailParentSn } }) }"
+      :row-selection="{ columnWidth: '4%', getCheckboxProps: record => ({ props: { disabled: record.promotionFlag == 'GIFT'&&!!record.salesPromoDetailParentSn } }) }"
       @rowSelection="rowSelectionFun"
       :defaultLoadData="false"
       :pageSize="10"

+ 1 - 1
src/views/salesManagement/salesQueryNew/comps/productNormalList.vue

@@ -99,7 +99,7 @@
       :rowKey="(record) => record.id"
       :columns="columns"
       :data="loadData"
-      :row-selection="{ columnWidth: 40 }"
+      :row-selection="{ columnWidth: '4%' }"
       @rowSelection="rowSelectionFun"
       :pageSize="showTotal?10:30"
       :defaultLoadData="false"

+ 51 - 21
src/views/salesManagement/salesQueryNew/detail.vue

@@ -71,24 +71,47 @@
         <!-- 统计信息 -->
         <a-alert type="info" style="margin-bottom: 10px;">
           <div slot="message">
-            <div>
-              总销售数量:<strong>{{ detailData&&(detailData.totalQty || detailData.totalQty==0) ? detailData.totalQty : '--' }}</strong>;
-              已取消数量:<strong>{{ detailData&&(detailData.totalCancelQty || detailData.totalCancelQty==0) ? detailData.totalCancelQty : '--' }}</strong>;
-              已下推数量:<strong>{{ detailData&&(detailData.totalPushedQty || detailData.totalPushedQty==0) ? detailData.totalPushedQty : '--' }}</strong>;
-              待下推数量:<strong>{{ detailData&&(detailData.totalUnpushedQty || detailData.totalUnpushedQty==0) ? detailData.totalUnpushedQty : '--' }}</strong>;
-              已发货数量:<strong>{{ detailData&&(detailData.totalDispatchQty || detailData.totalDispatchQty==0) ? detailData.totalDispatchQty : '--' }}</strong>;
-              待发货数量:<strong>{{ detailData&&(detailData.totalUndispatchQty || detailData.totalUndispatchQty==0) ? detailData.totalUndispatchQty : '--' }}</strong>;<br/>
-              <span v-if="$hasPermissions(authCode + '_salesPrice')">总售价:<strong>{{ detailData&&(detailData.totalAmount || detailData.totalAmount==0) ? toThousands(detailData.totalAmount) : '--' }}</strong>;</span>
-              <span v-if="$hasPermissions(authCode + '_costPrice')">总成本:<strong>{{ detailData&&(detailData.totalCost || detailData.totalCost==0) ? toThousands(detailData.totalCost) : '--' }}</strong>;</span>
-              <span v-if="$hasPermissions(authCode + '_costPrice')">总毛利:<strong>{{ detailData&&(detailData.grossProfit || detailData.grossProfit==0) ? toThousands(detailData.grossProfit) : '--' }}</strong>;</span>
-              <span v-if="$hasPermissions(authCode + '_salesPrice')">已取消金额:<strong>{{ detailData&&(detailData.totalCancelAmount || detailData.totalCancelAmount==0) ? toThousands(detailData.totalCancelAmount) : '--' }}</strong>;</span>
-              <span v-if="$hasPermissions(authCode + '_salesPrice')">已下推金额:<strong>{{ detailData&&(detailData.totalPushedAmount || detailData.totalPushedAmount==0) ? toThousands(detailData.totalPushedAmount) : '--' }}</strong>;</span>
-              <span v-if="$hasPermissions(authCode + '_salesPrice')">待下推金额:<strong>{{ detailData&&(detailData.totalUnpushedAmount || detailData.totalUnpushedAmount==0) ? toThousands(detailData.totalUnpushedAmount) : '--' }}</strong>;</span>
-              <span v-if="$hasPermissions(authCode + '_salesPrice')">已发货金额:<strong>{{ detailData&&(detailData.totalDispatchAmount || detailData.totalDispatchAmount==0) ? toThousands(detailData.totalDispatchAmount) : '--' }}</strong>;</span>
-              <span v-if="$hasPermissions(authCode + '_salesPrice')">待发货金额:<strong>{{ detailData&&(detailData.totalUndispatchAmount || detailData.totalUndispatchAmount==0) ? toThousands(detailData.totalUndispatchAmount) : '--' }}</strong>;</span>
-              <span v-if="isCityPrice">市级总售价:<strong>{{ detailData&&(detailData.totalCityAmount || detailData.totalCityAmount==0) ? toThousands(detailData.totalCityAmount) : '--' }}</strong>;</span>
-              <span v-if="$hasPermissions(authCode + '_salesPrice')&&detailData&&detailData.totalDiscountAmount" style="color: red;">优惠金额:<strong>{{ Number(detailData.totalDiscountAmount).toFixed(2) }}</strong>;</span>
-              <span v-if="$hasPermissions(authCode + '_salesPrice')&&detailData&&detailData.totalConvertPromoGiftsAmount" style="color: red;">促销产品转采购额金额:<strong>{{ Number(detailData.totalConvertPromoGiftsAmount).toFixed(2) }}</strong>;</span>
+            <div class="form-grid">
+              <div class="tongji-bar-col">
+                <div v-if="$hasPermissions(authCode + '_costPrice')">总成本:<strong>{{ detailData&&(detailData.totalCost || detailData.totalCost==0) ? toThousands(detailData.totalCost) : '--' }}</strong>;</div>
+                <div v-if="$hasPermissions(authCode + '_costPrice')">总毛利:<strong>{{ detailData&&(detailData.grossProfit || detailData.grossProfit==0) ? toThousands(detailData.grossProfit) : '--' }}</strong>;</div>
+              </div>
+              <div class="tongji-bar-col">
+                <div>总数量:<strong>{{ detailData&&(detailData.totalQty || detailData.totalQty==0) ? detailData.totalQty : '--' }}</strong>;</div>
+                <div v-if="$hasPermissions(authCode + '_salesPrice')">总售价:<strong>{{ detailData&&(detailData.totalAmount || detailData.totalAmount==0) ? toThousands(detailData.totalAmount) : '--' }}</strong>;</div>
+              </div>
+              <div class="tongji-bar-col">
+                <div>已取消数量:<strong>{{ detailData&&(detailData.totalCancelQty || detailData.totalCancelQty==0) ? detailData.totalCancelQty : '--' }}</strong>;</div>
+                <div v-if="$hasPermissions(authCode + '_salesPrice')">已取消金额:<strong>{{ detailData&&(detailData.totalCancelAmount || detailData.totalCancelAmount==0) ? toThousands(detailData.totalCancelAmount) : '--' }}</strong>;</div>
+              </div>
+              <div class="tongji-bar-col">
+                <div>已下推数量:<strong>{{ detailData&&(detailData.totalPushedQty || detailData.totalPushedQty==0) ? detailData.totalPushedQty : '--' }}</strong>;</div>
+                <div v-if="$hasPermissions(authCode + '_salesPrice')">已下推金额:<strong>{{ detailData&&(detailData.totalPushedAmount || detailData.totalPushedAmount==0) ? toThousands(detailData.totalPushedAmount) : '--' }}</strong>;</div>
+              </div>
+              <div class="tongji-bar-col">
+                <div>待下推数量:<strong>{{ detailData&&(detailData.totalUnpushedQty || detailData.totalUnpushedQty==0) ? detailData.totalUnpushedQty : '--' }}</strong>;</div>
+                <div v-if="$hasPermissions(authCode + '_salesPrice')"> 待下推金额:<strong>{{ detailData&&(detailData.totalUnpushedAmount || detailData.totalUnpushedAmount==0) ? toThousands(detailData.totalUnpushedAmount) : '--' }}</strong>;</div>
+              </div>
+              <div class="tongji-bar-col">
+                <div>已发货数量:<strong>{{ detailData&&(detailData.totalDispatchQty || detailData.totalDispatchQty==0) ? detailData.totalDispatchQty : '--' }}</strong>;</div>
+                <div v-if="$hasPermissions(authCode + '_salesPrice')">已发货金额:<strong>{{ detailData&&(detailData.totalDispatchAmount || detailData.totalDispatchAmount==0) ? toThousands(detailData.totalDispatchAmount) : '--' }}</strong>;</div>
+              </div>
+              <div class="tongji-bar-col">
+                <div>待发货数量:<strong>{{ detailData&&(detailData.totalUndispatchQty || detailData.totalUndispatchQty==0) ? detailData.totalUndispatchQty : '--' }}</strong>;</div>
+                <div v-if="$hasPermissions(authCode + '_salesPrice')">待发货金额:<strong>{{ detailData&&(detailData.totalUndispatchAmount || detailData.totalUndispatchAmount==0) ? toThousands(detailData.totalUndispatchAmount) : '--' }}</strong>;</div>
+              </div>
+              <div class="tongji-bar-col">
+                <div v-if="$hasPermissions(authCode + '_costPrice')&&isAveragePrice"><label style="width:108px;">平均成本公斤单价:<strong>{{ detailData&&(detailData.totalWeightAvgCost || detailData.totalWeightAvgCost==0) ? toThousands(detailData.totalWeightAvgCost) : '--' }}</strong>;</label></div>
+                <div v-if="$hasPermissions(authCode + '_salesPrice')&&isAveragePrice"><label style="width:108px;">平均售价公斤单价:<strong>{{ detailData&&(detailData.totalWeightAvgPrice || detailData.totalWeightAvgPrice==0) ? toThousands(detailData.totalWeightAvgPrice) : '--' }}</strong>;</label></div>
+              </div>
+              <div class="tongji-bar-col">
+                <div v-if="isAveragePrice">合计重量(kg):<strong>{{ detailData&&(detailData.totalWeightKg || detailData.totalWeightKg==0) ? detailData.totalWeightKg : '--' }}</strong>;</div>
+                <div v-if="isCityPrice">&nbsp;&nbsp;市级总售价:<strong>{{ detailData&&(detailData.totalCityAmount || detailData.totalCityAmount==0) ? toThousands(detailData.totalCityAmount) : '--' }}</strong>;</div>
+              </div>
+              <div class="tongji-bar-col">
+                <div v-if="$hasPermissions(authCode + '_salesPrice')&&detailData&&detailData.totalDiscountAmount" style="color: red;">优惠金额:<strong>{{ Number(detailData.totalDiscountAmount).toFixed(2) }}</strong>;</div>
+                <div v-if="$hasPermissions(authCode + '_salesPrice')&&detailData&&detailData.totalConvertPromoGiftsAmount" style="color: red;width:170px;">促销产品转采购额金额:<strong>{{ Number(detailData.totalConvertPromoGiftsAmount).toFixed(2) }}</strong>;</div>
+              </div>
             </div>
           </div>
         </a-alert>
@@ -157,6 +180,7 @@
               <a-button id="salesDetail-updateStock" type="primary" v-if="showStock" @click="getThreeStock" class="button-info">第三方库存</a-button>
               <a-button id="salesDetail-stockOut" v-if="detailData && (detailData.billStatus == 'WAIT_AUDIT' || detailData.billStatus == 'HQ_CHANGE')" type="link" @click="openStockOut">缺货明细</a-button>
               <a-checkbox id="salesDetail-cityPrice" v-model="isCityPrice" v-if="$hasPermissions(authCode + '_cityPrice')"><span style="display: inline-block;margin-top: 1px;">市级价</span></a-checkbox>
+              <a-checkbox id="salesDetail-cityPrice" v-model="isAveragePrice" v-if="$hasPermissions(authCode + '_avgprice')"><span style="display: inline-block;margin-top: 1px;">平均公斤单价</span></a-checkbox>
             </div>
           </div>
         </div>
@@ -173,6 +197,7 @@
             :chooseList="chooseDealerList"
             :transferQty="transferQty"
             :showCityPrice="isCityPrice"
+            :showAveragePrice="isAveragePrice"
             :showTransferDealer="showTransferDealer">
           </detailProductList>
         </div>
@@ -317,6 +342,7 @@ export default {
       detailData: null, //  详情数据
       nowType: null, // 打印导出类型
       isCityPrice: false, //  是否显示市级价
+      isAveragePrice: false, // 是否显示
       visibleAudit: false, // 审核弹框
       spinningAudit: false, // 审核loading
       auditText: null, // 审核备注信息
@@ -683,7 +709,7 @@ export default {
         _this.spinning = true
         exportExcel(salesDetailTypeExcel, params, '销售分类' + moment().format('YYYYMMDDHHmmss'), () => {
           _this.spinning = false
-          _this.$store.state.app.curActionPermission = ''
+          _this.closePrint()
         })
       } else {
         this.detailData.authCode = authCode
@@ -706,13 +732,13 @@ export default {
       if (this.nowType == 'export') { //  导出
         exportExcel(salesDetailExcel, params, '销售' + moment().format('YYYYMMDDHHmmss'), () => {
           _this.spinning = false
-          _this.$store.state.app.curActionPermission = ''
+          _this.closePrint()
         })
       } else { //  打印
         const taskName = this.nowType == 'SALES_BILL' ? '销售单' : '销售分类'
         printFun(salesDetailPrint, params, objs.type, taskName, () => {
           _this.spinning = false
-          _this.$store.state.app.curActionPermission = ''
+          _this.closePrint()
         })
       }
     }
@@ -770,5 +796,9 @@ export default {
       font-weight: bold;
       color: red;
     }
+    .form-grid{
+      display: flex;
+      flex:1;
+    }
   }
 </style>

+ 43 - 20
src/views/salesManagement/salesQueryNew/detailAll.vue

@@ -67,8 +67,6 @@
         <a-alert type="info" style="margin: 10px 0;">
           <div slot="message">
             <div>
-              总销售数量:<strong>{{ detailData&&(detailData.totalQty || detailData.totalQty==0) ? detailData.totalQty : '--' }}</strong>;
-              已取消数量:<strong>{{ detailData&&(detailData.totalCancelQty || detailData.totalCancelQty==0) ? detailData.totalCancelQty : '--' }}</strong>;
               已下推数量:<strong>{{ detailData&&(detailData.totalPushedQty || detailData.totalPushedQty==0) ? detailData.totalPushedQty : '--' }}</strong>;
               待下推数量:<strong>{{ detailData&&(detailData.totalUnpushedQty || detailData.totalUnpushedQty==0) ? detailData.totalUnpushedQty : '--' }}</strong>;
               已发货数量:<strong>{{ detailData&&(detailData.totalDispatchQty || detailData.totalDispatchQty==0) ? detailData.totalDispatchQty : '--' }}</strong>;
@@ -83,6 +81,9 @@
               <span v-if="$hasPermissions(authCode + '_salesPrice')">待发货金额:<strong>{{ detailData&&(detailData.totalUndispatchAmount || detailData.totalUndispatchAmount==0) ? toThousands(detailData.totalUndispatchAmount) : '--' }}</strong>;</span>
               <span v-if="isCityPrice">市级总售价:<strong>{{ detailData&&(detailData.totalCityAmount || detailData.totalCityAmount==0) ? toThousands(detailData.totalCityAmount) : '--' }}</strong>;</span>
               <span v-if="$hasPermissions(authCode + '_salesPrice')&&detailData&&detailData.totalDiscountAmount" style="color: red;">优惠金额:<strong>{{ toThousands(detailData.totalDiscountAmount) }}</strong>;</span>
+              <span v-if="isAveragePrice">合计重量(kg):<strong>{{ detailData&&(detailData.totalWeightKg || detailData.totalWeightKg==0) ? detailData.totalWeightKg : '--' }}</strong>;</span>
+              <span v-if="isAveragePrice&&$hasPermissions(pageTypeAuth + '_costPrice')">平均成本公斤单价:<strong>{{ detailData&&(detailData.totalWeightAvgCost || detailData.totalWeightAvgCost==0) ? toThousands(detailData.totalWeightAvgCost) : '--' }}</strong>;</span>
+              <span v-if="isAveragePrice&&$hasPermissions(pageTypeAuth + '_salesPrice')">平均售价公斤单价:<strong>{{ detailData&&(detailData.totalWeightAvgPrice || detailData.totalWeightAvgPrice==0) ? toThousands(detailData.totalWeightAvgPrice) : '--' }}</strong>;</span>
             </div>
           </div>
         </a-alert>
@@ -107,6 +108,7 @@
             <div>
               <a-button v-if="detailData && (detailData.billStatus == 'WAIT_AUDIT' || detailData.billStatus == 'HQ_CHANGE')" type="link" @click="openStockOut">缺货明细</a-button>
               <a-checkbox v-model="isCityPrice" v-if="$hasPermissions(authCode + '_cityPrice')"><span style="display: inline-block;margin-top: 1px;">市级价</span></a-checkbox>
+              <a-checkbox v-model="isAveragePrice" v-if="$hasPermissions(pageTypeAuth + '_avgprice')"><span style="display: inline-block;margin-top: 1px;">平均公斤单价</span></a-checkbox>
             </div>
           </div>
         </div>
@@ -231,6 +233,10 @@ export default {
     bizSn: { //  有值则为弹框,无值则为页面
       type: [Number, String],
       default: ''
+    },
+    pageTypeAuth: { // 页面权限显示
+      type: String,
+      default: ''
     }
   },
   data () {
@@ -293,7 +299,8 @@ export default {
       spinningAudit: false, // 审核loading
       outStockStr: '', // 缺货产品信息说明
       auditText: null, // 审核备注
-      authCode: '' // 当前权限码
+      authCode: '', // 当前权限码
+      isAveragePrice: false// 平均公斤单价
     }
   },
   computed: {
@@ -317,40 +324,52 @@ export default {
         { title: '产品编码', dataIndex: 'productCode', width: '10%', scopedSlots: { customRender: 'productCode' }, align: 'left' },
         { title: '产品名称', dataIndex: 'productName', width: '20%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '原厂编码', dataIndex: 'productOrigCode', width: '10%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '出库仓库', dataIndex: 'warehouseName', width: '8%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '出库仓库', dataIndex: 'warehouseName', width: '8%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true }
         // { title: '成本价', dataIndex: 'showCost', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         // { title: '省级价', dataIndex: 'provincePrice', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         // { title: '市级价', dataIndex: 'cityPrice', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         // { title: '销售价', dataIndex: 'price', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '单位', dataIndex: 'productOrigUnit', width: '4%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '销售数量', dataIndex: 'qty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+
         // { title: '库存', dataIndex: 'stockQty', scopedSlots: { customRender: 'stockQty' }, width: '6%', align: 'center' },
-        { title: '待下推数', dataIndex: 'unpushedQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '已下推数', dataIndex: 'pushedQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '已取消数', dataIndex: 'cancelQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
+        // { title: '待下推数', dataIndex: 'unpushedQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '已下推数', dataIndex: 'pushedQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '已取消数', dataIndex: 'cancelQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
       ]
       if (this.$hasPermissions(this.authCode + '_costPrice')) { //  成本价权限
-        arr.splice(5, 0, { title: '成本价', dataIndex: 'showCost', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+        arr.push({ title: '成本价', dataIndex: 'showCost', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
       }
-
-      const ind = this.$hasPermissions(this.authCode + '_costPrice') ? 6 : 5
       if (this.$hasPermissions(this.authCode + '_provincePrice')) {
-        arr.splice(ind, 0, { title: '省级价', dataIndex: 'provincePrice', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+        arr.push({ title: '省级价', dataIndex: 'provincePrice', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
       }
       // 是否勾选市级价格
       if (this.isCityPrice) {
-        arr.splice(ind + 1, 0, { title: '市级价', dataIndex: 'cityPrice', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+        arr.push({ title: '市级价', dataIndex: 'cityPrice', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
         if (this.$hasPermissions(this.authCode + '_salesPrice')) { //  售价权限
-          arr.splice(ind + 2, 0, { title: '销售价', dataIndex: 'price', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+          arr.push({ title: '销售价', dataIndex: 'price', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
         }
       } else {
         if (this.$hasPermissions(this.authCode + '_salesPrice')) { //  售价权限
-          arr.splice(ind + 1, 0, { title: '销售价', dataIndex: 'price', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+          arr.push({ title: '销售价', dataIndex: 'price', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
         }
       }
+      arr.push({ title: '单位', dataIndex: 'productOrigUnit', width: '4%', align: 'center', customRender: function (text) { return text || '--' } })
+      arr.push({ title: '销售数量', dataIndex: 'qty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
       //  审核,需用到库存
       if (this.detailData && (this.detailData.billStatus == 'WAIT_AUDIT' || this.detailData.billStatus == 'HQ_CHANGE') && this.$hasPermissions('B_salesAudit')) {
-        arr.splice(arr.length - 3, 0, { title: '库存', dataIndex: 'stockQty', scopedSlots: { customRender: 'stockQty' }, width: '6%', align: 'center' })
+        arr.push({ title: '库存', dataIndex: 'stockQty', scopedSlots: { customRender: 'stockQty' }, width: '6%', align: 'center' })
+      }
+      arr.push({ title: '待下推数', dataIndex: 'unpushedQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+      arr.push({ title: '已下推数', dataIndex: 'pushedQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+      arr.push({ title: '已取消数', dataIndex: 'cancelQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+      if (this.isAveragePrice) {
+        arr.push({ title: '单重(kg)', dataIndex: 'weightKg', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+        arr.push({ title: '合计重量(kg)', dataIndex: 'totalWeightKg', width: '9%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+      }
+      if (this.$hasPermissions(this.pageTypeAuth + '_costPrice') && this.isAveragePrice) {
+        arr.push({ title: '平均成本公斤单价', dataIndex: 'weightAvgCost', width: '10%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+      }
+      if (this.$hasPermissions(this.pageTypeAuth + '_salesPrice') && this.isAveragePrice) {
+        arr.push({ title: '平均售价公斤单价', dataIndex: 'weightAvgPrice', width: '10%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
       }
       return arr
     }
@@ -470,7 +489,7 @@ export default {
         _this.spinning = true
         exportExcel(salesDetailTypeExcel, params, '销售分类' + moment().format('YYYYMMDDHHmmss'), () => {
           _this.spinning = false
-          _this.$store.state.app.curActionPermission = ''
+          _this.closePrint()
         })
       } else {
         this.detailData.authCode = authCode
@@ -493,13 +512,13 @@ export default {
       if (this.nowType == 'export') { //  导出
         exportExcel(salesDetailExcel, params, '销售' + moment().format('YYYYMMDDHHmmss'), () => {
           _this.spinning = false
-          _this.$store.state.app.curActionPermission = ''
+          _this.closePrint()
         })
       } else { //  打印
         const taskName = this.nowType == 'SALES_BILL' ? '销售单' : '销售分类'
         printFun(salesDetailPrint, params, objs.type, taskName, () => {
           _this.spinning = false
-          _this.$store.state.app.curActionPermission = ''
+          _this.closePrint()
         })
       }
     }
@@ -542,5 +561,9 @@ export default {
         font-weight: bold;
         color: red;
       }
+      .form-grid{
+        display:flex;
+        flex:1;
+      }
     }
   </style>

+ 0 - 1
src/views/salesManagement/salesQueryNew/list.vue

@@ -915,7 +915,6 @@ export default {
     .tongji-bar{
       flex:1;
       display: flex;
-      align-items: center;
     }
   }
 </style>

+ 19 - 5
src/views/salesManagement/salesQueryNew/printModal.vue

@@ -6,7 +6,7 @@
     class="sales-print-type-modal"
     :title="modalTit"
     v-model="isShow"
-    @cancel="isShow=false"
+    @cancel="cancel"
     :width="600">
     <a-spin :spinning="spinning" tip="Loading...">
       <a-form-model
@@ -64,9 +64,16 @@
             <a-radio value="-1">不打印</a-radio>
           </a-radio-group>
         </a-form-model-item>
+        <!-- 平均公斤单价 -->
+        <a-form-model-item label="平均公斤单价" prop="averagePrice" v-if="nowType=='export'&&$hasPermissions('B_salesDetail_avgprice')">
+          <a-radio-group v-model="form.averagePrice">
+            <a-radio :value="1">导出</a-radio>
+            <a-radio :value="0">不导出</a-radio>
+          </a-radio-group>
+        </a-form-model-item>
       </a-form-model>
       <div class="btn-cont">
-        <a-button id="sales-print-back" @click="isShow = false">取消</a-button>
+        <a-button id="sales-print-back" @click="cancel">取消</a-button>
         <a-button type="primary" class="button-info" id="sales-print-save" @click="handleSave()" style="margin-left: 15px;">{{ nowType=='export' ? '导出' : '打印预览' }}</a-button>
         <a-button v-if="nowType!='export'" type="primary" id="sales-print" @click="handleSave('print')" style="margin-left: 10px;">快捷打印</a-button>
       </div>
@@ -101,14 +108,16 @@ export default {
         id: 'all',
         dataScope: 'all',
         priceType: undefined,
-        orderBy: undefined
+        orderBy: undefined,
+        averagePrice: undefined
       },
       // 选项校验
       rules: {
         id: [{ required: true, message: '请选择产品分类', trigger: 'change' }],
         dataScope: [{ required: true, message: '请选择是否缺货产品', trigger: 'change' }],
         priceType: [{ required: true, message: '请选择产品售价', trigger: 'change' }],
-        orderBy: [{ required: true, message: '请选择货位编号', trigger: 'change' }]
+        orderBy: [{ required: true, message: '请选择货位编号', trigger: 'change' }],
+        averagePrice: [{ required: true, message: '请选择平均公斤单价', trigger: 'change' }]
       },
       formItemLayout: {
         labelCol: { span: 6 },
@@ -138,6 +147,9 @@ export default {
     }
   },
   methods: {
+    cancel () {
+      this.$emit('close')
+    },
     // 确认
     handleSave (isPrint) {
       const _this = this
@@ -181,6 +193,9 @@ export default {
             if (!_this.$hasPermissions('B_salesDetailExport_salesPrice')) {
               _this.form.priceType = _this.form.dataScope == 'ENOUGH' ? 'SALES_BILL_NOT_LACK' : 'SALES_BILL'
             }
+            if (_this.form.averagePrice == '1') {
+              _this.form.priceType += '_WEIGHT'
+            }
             const obj = {
               salesBillSn: _this.itemData.salesBillSn,
               priceType: _this.form.priceType,
@@ -215,7 +230,6 @@ export default {
     //  重定义的弹框状态
     isShow (newValue, oldValue) {
       if (!newValue) {
-        this.$emit('close')
         // 重置表单选项
         this.form = {
           id: 'all',

+ 5 - 1
src/views/setting/tireSubsidySetting/index.vue

@@ -13,6 +13,9 @@
       <a-tab-pane key="SUBSIDY_YEAR_FEE" tab="增量补贴(年度)" force-render>
         <addSubsidyList pageType="SUBSIDY_YEAR_FEE"></addSubsidyList>
       </a-tab-pane>
+      <a-tab-pane key="SUBSIDY_AMOUNT" tab="返利基数" force-render>
+        <rebateAmountList pageType="SUBSIDY_AMOUNT"></rebateAmountList>
+      </a-tab-pane>
     </a-tabs>
   </div>
 </template>
@@ -21,11 +24,12 @@ import { commonMixin } from '@/utils/mixin'
 // 组件
 import costCollectionList from './costCollectionList.vue'
 import addSubsidyList from './addSubsidyList.vue'
+import rebateAmountList from './rebateAmountList.vue'
 
 export default {
   name: 'TireSubsidySetting',
   mixins: [commonMixin],
-  components: { costCollectionList, addSubsidyList },
+  components: { costCollectionList, addSubsidyList, rebateAmountList },
   data () {
     return {
       tabVal: 'SERVICE_FEE' // tab值  1轮胎月度费用报表 2轮胎季度费用报表 3轮胎年度费用报表 4轮胎费用明细报表

+ 236 - 0
src/views/setting/tireSubsidySetting/rebateAddModal.vue

@@ -0,0 +1,236 @@
+<template>
+  <a-modal
+    centered
+    class="costAdd-modal"
+    :footer="null"
+    :maskClosable="false"
+    :title="!itemSn?'新增':'编辑'"
+    v-model="isShow"
+    @cancel="isShow=false"
+    :width="700">
+    <div>
+      <a-spin :spinning="spinning" tip="Loading...">
+        <a-form-model
+          id="costAddModal-form"
+          ref="ruleForm"
+          :model="form"
+          :rules="rules"
+          :label-col="formItemLayout.labelCol"
+          :wrapper-col="formItemLayout.wrapperCol"
+        >
+          <a-form-model-item label="开始时间" v-if="itemSn&&timeInfo">
+            {{ timeInfo }}
+          </a-form-model-item>
+          <a-form-model-item label="返利基数" prop="ruleValue1">
+            <a-input-number
+              id="costAddModal-ruleValue1"
+              v-model="form.ruleValue1"
+              style="width:90%;"
+              :max="999999"
+              :precision="2"
+              placeholder="请输入返利基数"/>
+            <span style="margin-left:10px;">元</span>
+          </a-form-model-item>
+          <a-form-model-item label="当前返利基数" v-if="rebateList&&rebateList.length>0">
+            {{ (rebateList[0].ruleValue1||rebateList[0].ruleValue1==0)?toThousands(rebateList[0].ruleValue1) :'--' }}
+          </a-form-model-item>
+        </a-form-model>
+        <div class="btn-cont">
+          <a-button id="costAddModal-cancel" @click="isShow = false" style="margin-right: 15px;">取消</a-button>
+          <a-button type="primary" id="costAddModal-save" @click="handleSave">保存</a-button>
+        </div>
+      </a-spin>
+    </div>
+  </a-modal>
+</template>
+
+<script>
+import { commonMixin } from '@/utils/mixin'
+// 组件
+import { VSelect } from '@/components'
+import custList from '@/views/common/custList.vue'
+// 接口
+import { getSubsidyRuleList, subsidyRuleSave, createSubsidyRule, editSubsidyRule } from '@/api/subsidyRule'
+export default {
+  name: 'CostAddModal',
+  mixins: [commonMixin],
+  components: { VSelect, custList },
+  props: {
+    openModal: { //  弹框显示状态
+      type: Boolean,
+      default: false
+    },
+    pageType: { //  页面类型
+      type: String,
+      default: ''
+    }
+  },
+  data () {
+    return {
+      isShow: this.openModal, //  是否打开弹框
+      spinning: false, // 页面加载状态
+      formItemLayout: {// form表单中label设置
+        labelCol: { span: 4 },
+        wrapperCol: { span: 17 }
+      },
+      // 提交数据
+      form: {
+        defaultFlag: 1, // 0指定客户  1默认
+        dealerSn: undefined, // 客户名称
+        ruleValue1: undefined, // 返利基数
+        ruleType: undefined, // 弹窗类型
+        effectType: 0
+      },
+      // 必填项判断
+      rules: {
+        ruleValue1: [{ required: true, message: '请输入返利基数', trigger: 'blur' }]
+      },
+      rebateList: null, // 当前返利基数 数据
+      itemSn: null, // 当前行ruleSn
+      timeInfo: null// 开始时间
+    }
+  },
+  methods: {
+    // 获取当前返利基数  历史记录
+    getHistoryData (ajaxData) {
+      this.spinning = true
+      getSubsidyRuleList(ajaxData).then(res => {
+        if (res.status == 200) {
+          this.rebateList = res.data
+        } else {
+          this.rebateList = null
+        }
+        this.spinning = false
+      })
+    },
+    // 保存
+    handleSave () {
+      const _this = this
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          if (_this.form.ruleValue1 < 0) {
+            _this.$message.warning('请输入大于等于0的返利基数')
+            return
+          }
+          _this.form.ruleType = _this.pageType
+          _this.spinning = true
+          const ajaxName = _this.itemSn ? editSubsidyRule : subsidyRuleSave
+          _this.form.ruleSn = _this.itemSn ? _this.itemSn : undefined
+          ajaxName(_this.form).then(res => {
+            if (res.status == 200) {
+              if (!_this.itemSn) {
+                if (!res.data) {
+                  _this.isShow = false
+                  _this.$message.success(res.message)
+                  _this.$emit('ok')
+                } else {
+                  _this.openTip(res.data)
+                }
+              } else {
+                _this.isShow = false
+                _this.$message.success(res.message)
+                _this.$emit('ok')
+              }
+            }
+            _this.spinning = false
+          }).catch(err => {
+            _this.spinning = false
+          })
+        } else {
+          console.log('error submit!!')
+          return false
+        }
+      })
+    },
+    openTip (code) {
+      const _this = this
+      if (code != 'IN_USE') {
+        this.$confirm({
+          title: '提示',
+          content: '将重新生成新的返利基数,并结束当前月份的返利基数。',
+          centered: true,
+          onOk () {
+            createSubsidyRule(_this.form).then(res => {
+              if (res.status == 200) {
+                _this.isShow = false
+                _this.$message.success(res.message)
+                _this.$emit('ok')
+              }
+            })
+          }
+        })
+      } else {
+        const tipWord = '已存在【启用中】的返利基数'
+        _this.setInfoModal(tipWord)
+      }
+    },
+    // 提示弹窗
+    setInfoModal (tip) {
+      this.$info({
+        title: '提示',
+        content: tip,
+        centered: true,
+        onOk () {
+          console.log('知道了')
+        }
+      })
+    },
+    // 编辑获取数据
+    pageInit (itemData) {
+      this.itemSn = itemData.ruleSn
+      this.form.ruleValue1 = itemData.ruleValue1
+      this.timeInfo = itemData.ruleStartDate
+    },
+    // 重置
+    resetFormData () {
+      this.form.defaultFlag = 1
+      this.form.dealerSn = undefined
+      this.form.ruleValue1 = undefined
+      this.form.ruleType = undefined
+      this.itemSn = null
+      this.form.effectType = 0
+      this.rebateList = null
+      this.timeInfo = null
+      this.$refs.ruleForm.resetFields()
+    }
+  },
+  watch: {
+    //  父页面传过来的弹框状态
+    openModal (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    //  重定义的弹框状态
+    isShow (newValue, oldValue) {
+      if (!newValue) {
+        this.$emit('close')
+        this.resetFormData()
+      } else {
+        if (!this.itemSn) {
+          this.form.ruleValue1 = undefined
+          this.getHistoryData({ defaultFlag: 1, subsidyQueryStatus: 'NOT_FINISH', ruleType: this.pageType })
+        }
+      }
+    }
+  }
+}
+</script>
+
+<style lang="less">
+  .costAdd-modal{
+    .formList{
+      margin-left:42px;
+    }
+    .formBoxList{
+      div{
+        margin-bottom:5px;
+      }
+    }
+    .ant-modal-body {
+      padding: 40px 40px 24px;
+    }
+    .btn-cont {
+      text-align: center;
+      margin: 35px 0 30px;
+    }
+  }
+</style>

+ 205 - 0
src/views/setting/tireSubsidySetting/rebateAmountList.vue

@@ -0,0 +1,205 @@
+<template>
+  <div>
+    <a-card size="small" :bordered="false" class="rebateAmountList-wrap searchBoxNormal">
+      <!-- 搜索条件 -->
+      <div class="table-page-search-wrapper" ref="tableSearch">
+        <a-form-model
+          id="rebateAmountList-form"
+          ref="ruleForm"
+          class="form-model-con"
+          layout="inline"
+          :model="queryParam">
+          <a-row :gutter="15">
+            <a-col :md="5" :sm="24">
+              <a-form-model-item label="状态">
+                <v-select
+                  v-model="queryParam.subsidyQueryStatus"
+                  id="rebateAmountList-subsidyQueryStatus"
+                  code="INCREMENT_SUBSIDY_QUERY_STATUS"
+                  placeholder="请选择状态"
+                  allowClear></v-select>
+              </a-form-model-item>
+            </a-col>
+            <a-col :md="4" :sm="24">
+              <a-button
+                type="primary"
+                @click="$refs.table.refresh(true)"
+                :disabled="disabled"
+                id="rebateAmountList-refresh">查询</a-button>
+              <a-button
+                style="margin-left: 8px"
+                @click="resetSearchForm"
+                :disabled="disabled"
+                id="rebateAmountList-reset">重置</a-button>
+            </a-col>
+          </a-row>
+        </a-form-model>
+      </div>
+    </a-card>
+    <a-card size="small" :bordered="false">
+      <a-spin :spinning="spinning" tip="Loading...">
+        <!-- 操作按钮 -->
+        <div class="table-operator">
+          <a-button id="rebateAmountList-add-btn" type="primary" @click="openRebateAddModal = true">新增</a-button>
+        </div>
+        <!-- 列表 -->
+        <s-table
+          class="sTable fixPagination"
+          ref="table"
+          size="small"
+          :rowKey="(record) => record.id"
+          :style="{ height: tableHeight+70+'px' }"
+          :columns="columns"
+          :data="loadData"
+          :scroll="{ y: tableHeight}"
+          :defaultLoadData="false"
+          bordered>
+          <!-- $hasPermissions('B_tireSubsidySetting_edit')&& -->
+          <!-- 结束时间 -->
+          <template slot="endDate" slot-scope="text, record">
+            {{ record.status==='END'? record.ruleEndDate:'--' }}
+          </template>
+          <!-- 操作 -->
+          <template slot="action" slot-scope="text, record">
+            <a-button
+              size="small"
+              type="link"
+              class="button-info"
+              @click="handleEdit(record)"
+              v-if="record.status==='IN_USE'&&record.isSomeTimeFlag"
+              :id="'rebateAmountList-edit-btn'+record.id"
+            >
+              编辑
+            </a-button>
+            <span v-if="record.status==='FINISH'&&!record.isSomeTimeFlag">--</span>
+          </template>
+        </s-table>
+      </a-spin>
+    </a-card>
+    <!-- 新增 -->
+    <rebate-add-modal
+      ref="rebateAdd"
+      v-drag
+      :openModal="openRebateAddModal"
+      :pageType="pageType"
+      @ok="$refs.table.refresh(true)"
+      @close="openRebateAddModal = false" />
+  </div>
+</template>
+
+<script>
+import { commonMixin } from '@/utils/mixin'
+// 组件
+import { STable, VSelect } from '@/components'
+import rebateAddModal from './rebateAddModal.vue'
+// 接口
+import { tireSubsidyRuleList } from '@/api/subsidyRule'
+export default {
+  name: 'RebateAmountList',
+  mixins: [commonMixin],
+  components: { STable, VSelect, rebateAddModal },
+  props: {
+    pageType: { //  弹框显示状态
+      type: String,
+      default: ''
+    }
+  },
+  data () {
+    const _this = this
+    return {
+      spinning: false,
+      disabled: false, //  查询、重置按钮是否可操作
+      tableHeight: 0, // 表格高度
+      openRebateAddModal: false, // 新增弹窗
+      //  查询条件
+      queryParam: {
+        ruleType: undefined, // 页面类型
+        subsidyQueryStatus: 'NOT_FINISH'// 状态默认值
+      },
+      columns: [
+        { title: '序号', dataIndex: 'no', width: '5%', align: 'center' },
+        { title: '创建时间', dataIndex: 'createDate', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '开始时间', dataIndex: 'newRuleStartDate', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '结束时间', dataIndex: 'ruleEndDate', width: '12%', align: 'center', scopedSlots: { customRender: 'endDate' } },
+        { title: '返利基数', dataIndex: 'ruleValue1', width: '12%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        { title: '状态', dataIndex: 'statusDictValue', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: '10%', align: 'center' }
+      ],
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.disabled = true
+        this.spinning = true
+        // 获取列表数据  有分页
+        this.queryParam.ruleType = this.pageType
+        const params = Object.assign(parameter, this.queryParam)
+        return tireSubsidyRuleList(params).then(res => {
+          let data
+          if (res.status == 200) {
+            data = res.data
+            // 计算表格序号
+            const no = (data.pageNo - 1) * data.pageSize
+            for (var i = 0; i < data.list.length; i++) {
+              data.list[i].no = no + i + 1
+              data.list[i].isSomeTimeFlag = data.list[i].ruleStartDate ? this.isSameMonth(data.list[i].ruleStartDate) : false
+              data.list[i].newRuleStartDate = data.list[i].ruleStartDate ? this.formatDate(data.list[i].ruleStartDate) : '--'
+              data.list[i].ruleEndDate = data.list[i].ruleEndDate ? this.formatDate(data.list[i].ruleEndDate) : '--'
+            }
+          }
+          this.disabled = false
+          this.spinning = false
+          return data
+        })
+      }
+    }
+  },
+  methods: {
+    // 置换时间
+    formatDate (input) {
+      // 分割日期部分,提取年和月
+      const [datePart] = input.split(' ')
+      const [year, month] = datePart.split('-')
+      // 确保月份为两位数并拼接结果
+      return `${year}年${month.padStart(2, '0')}月`
+    },
+    // 判断当前时间是否和开始时间一致
+    isSameMonth (inputDateStr) {
+      // 提取输入日期的年、月
+      const [inputYear, inputMonth] = inputDateStr.split('-').map(s => parseInt(s))
+      // 获取当前年、月(月份需+1,因Date对象月份从0开始)
+      const currentDate = new Date()
+      const currentYear = currentDate.getFullYear()
+      const currentMonth = currentDate.getMonth() + 1
+      // 对比结果
+      return inputYear === currentYear && inputMonth === currentMonth
+    },
+    // 编辑
+    handleEdit (row) {
+      this.$refs.rebateAdd.pageInit(row)
+      this.$nextTick(() => {
+        this.openRebateAddModal = true
+      })
+    },
+    //  重置
+    resetSearchForm () {
+      this.queryParam.ruleType = undefined
+      this.queryParam.subsidyQueryStatus = 'NOT_FINISH'
+      this.$refs.table.refresh(true)
+    },
+    // 初始化
+    pageInit () {
+      this.$nextTick(() => { // 页面渲染完成后的回调
+        this.setTableH()
+      })
+      this.resetSearchForm()
+    },
+    // 计算表格高度
+    setTableH () {
+      const tableSearchH = this.$refs.tableSearch.offsetHeight
+      this.tableHeight = window.innerHeight - tableSearchH - 300
+    }
+  },
+  mounted () {
+    this.pageInit()
+  }
+}
+</script>