Ver código fonte

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

# Conflicts:
#	src/views/allocationManagement/transferOut/chooseImportModal.vue
#	src/views/allocationManagement/transferOut/importGuideModal.vue
#	src/views/common/productBrand.js
#	src/views/common/productTypeAll.js
#	src/views/salesManagement/pushOrderManagement/list.vue
#	src/views/salesManagement/salesQueryNew/comps/detailProductList.vue
#	src/views/salesManagement/salesQueryNew/comps/productList.vue
#	src/views/salesManagement/salesQueryNew/comps/productNormalList.vue
#	src/views/salesManagement/salesQueryNew/detail.vue
#	src/views/salesManagement/salesQueryNew/list.vue
#	vue.config.js
lilei 1 mês atrás
pai
commit
5467057d97
51 arquivos alterados com 4363 adições e 930 exclusões
  1. 1 1
      .env.practice
  2. BIN
      public/templ/产品批量导入模板.xlsx
  3. BIN
      public/templ/外贸产品查询模板.xlsx
  4. 1 1
      public/version.json
  5. 15 3
      src/api/allocateReport.js
  6. 54 0
      src/api/productForeign.js
  7. 68 0
      src/api/reportData.js
  8. 381 356
      src/config/productManagement.js
  9. 402 377
      src/config/report/salesReport.js
  10. 7 0
      src/libs/getDate.js
  11. 1 0
      src/utils/request.js
  12. 1 0
      src/utils/util.js
  13. 38 7
      src/views/allocationManagement/transferOut/basicInfoModal.vue
  14. 22 17
      src/views/allocationManagement/transferOut/edit.vue
  15. 229 38
      src/views/allocationManagement/transferOut/importGuideModal.vue
  16. 11 1
      src/views/common/productBrand.js
  17. 28 12
      src/views/common/productTypeAll.js
  18. 1 1
      src/views/dealerManagement/dealerAccount/checkAccountModal.vue
  19. 13 2
      src/views/expenseManagement/expenseReimbursement/add.vue
  20. 83 7
      src/views/expenseManagement/expenseReimbursement/baseDataModal.vue
  21. 12 1
      src/views/expenseManagement/expenseReimbursement/detail.vue
  22. 7 3
      src/views/expenseManagement/expenseReimbursementDetail/list.vue
  23. 181 0
      src/views/productManagement/foreignTradeGoods/chooseImportModal.vue
  24. 190 0
      src/views/productManagement/foreignTradeGoods/importGuideModal.vue
  25. 226 0
      src/views/productManagement/foreignTradeGoods/list.vue
  26. 2 2
      src/views/productManagement/productInfo/chooseImportModal.vue
  27. 2 1
      src/views/productManagement/productInfo/detailModal.vue
  28. 10 7
      src/views/productManagement/productInfo/edit.vue
  29. 115 32
      src/views/reportData/allocationOrderTotal/list.vue
  30. 5 1
      src/views/reportData/productRebateReport/dealerList.vue
  31. 8 1
      src/views/reportData/productRebateReport/detailList.vue
  32. 5 1
      src/views/reportData/productRebateReport/list.vue
  33. 2 0
      src/views/reportData/promotionSalesRealTimeReport/index.vue
  34. 334 0
      src/views/reportData/regionTypeBusinessReport/list.vue
  35. 61 12
      src/views/reportData/salesDetails/list.vue
  36. 5 3
      src/views/reportData/tireSubsidyReport/incrementalSubsidyList.vue
  37. 2 1
      src/views/reportData/tireSubsidyReport/incrementalSubsidyYearList.vue
  38. 5 1
      src/views/reportData/tireSubsidyReport/index.vue
  39. 375 0
      src/views/reportData/tireSubsidyReport/supplierRebateList.vue
  40. 6 2
      src/views/salesManagement/pushOrderManagement/detail.vue
  41. 9 0
      src/views/salesManagement/pushOrderManagement/list.vue
  42. 28 6
      src/views/salesManagement/salesQueryNew/comps/detailProductList.vue
  43. 893 0
      src/views/salesManagement/salesQueryNew/comps/productList.vue
  44. 1 1
      src/views/salesManagement/salesQueryNew/comps/productNormalList.vue
  45. 9 3
      src/views/salesManagement/salesQueryNew/detail.vue
  46. 43 20
      src/views/salesManagement/salesQueryNew/detailAll.vue
  47. 6 3
      src/views/salesManagement/salesQueryNew/list.vue
  48. 19 5
      src/views/salesManagement/salesQueryNew/printModal.vue
  49. 5 1
      src/views/setting/tireSubsidySetting/index.vue
  50. 236 0
      src/views/setting/tireSubsidySetting/rebateAddModal.vue
  51. 205 0
      src/views/setting/tireSubsidySetting/rebateAmountList.vue

+ 1 - 1
.env.practice

@@ -1,6 +1,6 @@
 NODE_ENV=production
 VUE_APP_PREVIEW=false
-VUE_APP_API_BASE_URL=http://192.168.2.100:89/ocs-admin
+VUE_APP_API_BASE_URL=http://192.168.2.100:90/ocs-admin
 VUE_APP_WX_BASE_URL=//t.ocs.360arrow.com/ocs-admin/websocket/
 VUE_APP_VERSION=V1.0.1
 VUE_APP_ENVTIPS=练习环境

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


BIN
public/templ/外贸产品查询模板.xlsx


+ 1 - 1
public/version.json

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

+ 15 - 3
src/api/allocateReport.js

@@ -9,7 +9,7 @@ export const allocateReportList = (params) => {
     url: url,
     data: params,
     method: 'post',
-    headers:{
+    headers: {
       'module': encodeURIComponent('列表查询')
     }
   })
@@ -31,7 +31,7 @@ export const allocateReportDetailList = (params) => {
     url: url,
     data: params,
     method: 'post',
-    headers:{
+    headers: {
       'module': encodeURIComponent('列表查询')
     }
   })
@@ -51,7 +51,19 @@ export const allocateReportDetailExport = (params) => {
     data: params,
     method: 'post',
     responseType: 'blob',
-    headers:{
+    headers: {
+      'module': encodeURIComponent('导出')
+    }
+  })
+}
+
+export const allocateReportExportExcel = (params) => {
+  return axios({
+    url: '/report/allocateReport/exportExcel',
+    data: params,
+    method: 'post',
+    responseType: 'blob',
+    headers: {
       'module': encodeURIComponent('导出')
     }
   })

+ 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('导出')
+    }
+  })
+}

+ 68 - 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}`
@@ -1500,3 +1541,30 @@ export const brandTypeReportExport = (params) => {
     }
   })
 }
+
+// 经营分析报表
+export const manageAnalysisReportQuery = (params) => {
+  const url = `/report/manageAnalysis/query`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post',
+    headers: {
+      'module': encodeURIComponent('各品类经营分析报表查询')
+    }
+  })
+}
+// 经营分析报表导出
+export const manageAnalysisReportExport = (params) => {
+  return axios({
+    url: '/report/manageAnalysis/export',
+    data: params,
+    method: 'post',
+    responseType: 'blob',
+    headers: {
+      'module': encodeURIComponent('各品类经营分析报表导出')
+    }
+  })
+}

+ 381 - 356
src/config/productManagement.js

@@ -7,361 +7,386 @@ import {
 } from '@/layouts'
 
 export default {
-        path: '/productManagement',
-        redirect: '/productManagement/productInfo',
-        component: PageView,
-        meta: {
-          title: '产品管理',
-          icon: 'shopping',
-          permission: 'M_productManagement'
+  path: '/productManagement',
+  redirect: '/productManagement/productInfo',
+  component: PageView,
+  meta: {
+    title: '产品管理',
+    icon: 'shopping',
+    permission: 'M_productManagement'
+  },
+  children: [
+    {
+      path: '/productManagement/productInfo',
+      redirect: '/productManagement/productInfo/list',
+      name: 'productInfo',
+      component: BlankLayout,
+      meta: {
+        title: '产品列表',
+        icon: 'gold',
+        permission: 'M_productInfoList'
+      },
+      hideChildrenInMenu: true,
+      children: [
+        {
+          path: 'list',
+          name: 'productInfoList',
+          component: () => import(/* webpackChunkName: "productManagement" */ '@/views/productManagement/productInfo/list.vue'),
+          meta: {
+            title: '产品列表',
+            icon: 'gold',
+            hidden: true,
+            permission: 'M_productInfoList'
+          }
+        },
+        {
+          path: 'add',
+          name: 'productInfoAdd',
+          component: () => import(/* webpackChunkName: "productManagement" */ '@/views/productManagement/productInfo/edit.vue'),
+          meta: {
+            title: '新增产品',
+            icon: 'gold',
+            hidden: true
+            // permission: 'B_goodsManage_edit'
+          }
         },
-        children: [
-          {
-            path: '/productManagement/productInfo',
-            redirect: '/productManagement/productInfo/list',
-            name: 'productInfo',
-            component: BlankLayout,
-            meta: {
-              title: '产品列表',
-              icon: 'gold',
-              permission: 'M_productInfoList'
-            },
-            hideChildrenInMenu: true,
-            children: [
-              {
-                path: 'list',
-                name: 'productInfoList',
-                component: () => import(/* webpackChunkName: "productManagement" */ '@/views/productManagement/productInfo/list.vue'),
-                meta: {
-                  title: '产品列表',
-                  icon: 'gold',
-                  hidden: true,
-                  permission: 'M_productInfoList'
-                }
-              },
-              {
-                path: 'add',
-                name: 'productInfoAdd',
-                component: () => import(/* webpackChunkName: "productManagement" */ '@/views/productManagement/productInfo/edit.vue'),
-                meta: {
-                  title: '新增产品',
-                  icon: 'gold',
-                  hidden: true
-                  // permission: 'B_goodsManage_edit'
-                }
-              },
-              {
-                path: 'edit/:id/:sn',
-                name: 'productInfoEdit',
-                component: () => import(/* webpackChunkName: "productManagement" */ '@/views/productManagement/productInfo/edit.vue'),
-                meta: {
-                  title: '编辑产品',
-                  icon: 'gold',
-                  hidden: true
-                  // permission: 'B_goodsManage_edit'
-                }
-              }
-            ]
-          },
-          {
-            path: '/productManagement/productPricing',
-            redirect: '/productManagement/productPricing/list',
-            name: 'productPricing',
-            component: BlankLayout,
-            meta: {
-              title: '产品定价',
-              icon: 'transaction',
-              permission: 'M_productPricingList'
-            },
-            hideChildrenInMenu: true,
-            children: [
-              {
-                path: 'list',
-                name: 'productPricingList',
-                component: () => import(/* webpackChunkName: "productManagement" */ '@/views/productManagement/productPricing/list.vue'),
-                meta: {
-                  title: '产品定价列表',
-                  icon: 'transaction',
-                  hidden: true,
-                  permission: 'M_productPricingList'
-                }
-              }
-            ]
-          },
-          {
-            path: '/productManagement/productLaunchAudit',
-            redirect: '/productManagement/productLaunchAudit/list',
-            name: 'productLaunchAudit',
-            component: BlankLayout,
-            meta: {
-              title: '产品上线审核',
-              icon: 'rise',
-              permission: 'M_productLaunchAuditList'
-            },
-            hideChildrenInMenu: true,
-            children: [
-              {
-                path: 'list',
-                name: 'productLaunchAuditList',
-                component: () => import(/* webpackChunkName: "productManagement" */ '@/views/productManagement/productLaunchAudit/list.vue'),
-                meta: {
-                  title: '产品上线审核列表',
-                  icon: 'rise',
-                  hidden: true,
-                  permission: 'M_productLaunchAuditList'
-                }
-              }
-            ]
-          },
-          {
-            path: '/productManagement/newProduct',
-            redirect: '/productManagement/newProduct/list/onlineInfo/1',
-            name: 'productLaunchInfo',
-            component: BlankLayout,
-            meta: {
-              title: '产品上线信息',
-              icon: 'rise',
-              permission: 'M_productLaunchInfoList'
-            },
-            hideChildrenInMenu: true,
-            children: [
-              {
-                path: 'list/:type/:onlineFalg',
-                name: 'productLaunchInfoList',
-                component: () => import(/* webpackChunkName: "productManagement" */ '@/views/productManagement/newProduct/list.vue'),
-                meta: {
-                  title: '产品上线信息列表',
-                  icon: 'rise',
-                  hidden: true,
-                  permission: 'M_productLaunchInfoList'
-                }
-              }
-            ]
-          },
-          {
-            path: '/productManagement/productOfflineAudit',
-            redirect: '/productManagement/productOfflineAudit/list',
-            name: 'productOfflineAudit',
-            component: BlankLayout,
-            meta: {
-              title: '产品下线审核',
-              icon: 'fall',
-              permission: 'M_productOfflineAuditList'
-            },
-            hideChildrenInMenu: true,
-            children: [
-              {
-                path: 'list',
-                name: 'productOfflineAuditList',
-                component: () => import(/* webpackChunkName: "productManagement" */ '@/views/productManagement/productOfflineAudit/list.vue'),
-                meta: {
-                  title: '产品下线审核列表',
-                  icon: 'fall',
-                  hidden: true,
-                  permission: 'M_productOfflineAuditList'
-                }
-              }
-            ]
-          },
-          {
-            path: '/productManagement/productNotOnline',
-            redirect: '/productManagement/productNotOnline/list',
-            name: 'productNotOnline',
-            component: BlankLayout,
-            meta: {
-              title: '产品状态信息',
-              icon: 'fall',
-              permission: 'M_productNotOnlineList'
-            },
-            hideChildrenInMenu: true,
-            children: [
-              {
-                path: 'list',
-                name: 'productNotOnlineList',
-                component: () => import(/* webpackChunkName: "productManagement" */ '@/views/productManagement/productNotOnline/list.vue'),
-                meta: {
-                  title: '产品状态信息列表',
-                  icon: 'fall',
-                  hidden: true,
-                  permission: 'M_productNotOnlineList'
-                }
-              }
-            ]
-          },
-          {
-            path: '/productManagement/priceChangeRecord',
-            redirect: '/productManagement/priceChangeRecord/list',
-            name: 'priceChangeRecord',
-            component: BlankLayout,
-            meta: {
-              title: '价格变更记录',
-              icon: 'profile',
-              permission: 'M_priceChangeRecordList'
-            },
-            hideChildrenInMenu: true,
-            children: [
-              {
-                path: 'list',
-                name: 'priceChangeRecordList',
-                component: () => import(/* webpackChunkName: "productManagement" */ '@/views/productManagement/priceChangeRecord/list.vue'),
-                meta: {
-                  title: '价格变更记录列表',
-                  icon: 'profile',
-                  hidden: true,
-                  permission: 'M_priceChangeRecordList'
-                }
-              }
-            ]
-          },
-          {
-            path: '/productManagement/productUniversal',
-            redirect: '/productManagement/productUniversal/list',
-            name: 'productUniversal',
-            component: BlankLayout,
-            meta: {
-              title: '通用产品管理',
-              icon: 'deployment-unit',
-              permission: 'M_productUniversalList'
-            },
-            hideChildrenInMenu: true,
-            children: [
-              {
-                path: 'list',
-                name: 'productUniversalList',
-                component: () => import(/* webpackChunkName: "productManagement" */ '@/views/productManagement/productUniversal/list.vue'),
-                meta: {
-                  title: '通用产品列表',
-                  icon: 'deployment-unit',
-                  hidden: true,
-                  permission: 'M_productUniversalList'
-                }
-              }
-            ]
-          },
-          {
-            path: '/productManagement/productLevel',
-            redirect: '/productManagement/productLevel/list',
-            name: 'productLevel',
-            component: BlankLayout,
-            meta: {
-              title: '产品级别管理',
-              icon: 'fund',
-              permission: 'M_productLevelList'
-            },
-            hideChildrenInMenu: true,
-            children: [
-              {
-                path: 'list',
-                name: 'productLevelList',
-                component: () => import(/* webpackChunkName: "productManagement" */ '@/views/productManagement/productLevel/list.vue'),
-                meta: {
-                  title: '产品级别列表',
-                  icon: 'fund',
-                  hidden: true,
-                  permission: 'M_productLevelList'
-                }
-              }
-            ]
-          },
-          {
-            path: '/productManagement/productBrand',
-            redirect: '/productManagement/productBrand/list',
-            name: 'productBrand',
-            component: BlankLayout,
-            meta: {
-              title: '产品品牌管理',
-              icon: 'file-ppt',
-              permission: 'M_productBrandList'
-            },
-            hideChildrenInMenu: true,
-            children: [
-              {
-                path: 'list',
-                name: 'productBrandList',
-                component: () => import(/* webpackChunkName: "productManagement" */ '@/views/productManagement/productBrand/list.vue'),
-                meta: {
-                  title: '产品品牌列表',
-                  icon: 'file-ppt',
-                  hidden: true,
-                  permission: 'M_productBrandList'
-                }
-              }
-            ]
-          },
-          {
-            path: '/productManagement/productCategory',
-            redirect: '/productManagement/productCategory/list',
-            name: 'productCategory',
-            component: BlankLayout,
-            meta: {
-              title: '产品分类管理',
-              icon: 'radar-chart',
-              permission: 'M_productCategoryList'
-            },
-            hideChildrenInMenu: true,
-            children: [
-              {
-                path: 'list',
-                name: 'productCategoryList',
-                component: () => import(/* webpackChunkName: "productManagement" */ '@/views/productManagement/productCategory/list.vue'),
-                meta: {
-                  title: '产品分类列表',
-                  icon: 'radar-chart',
-                  hidden: true,
-                  permission: 'M_productCategoryList'
-                }
-              }
-            ]
-          },
-          {
-            path: '/productManagement/shelfNoManage',
-            redirect: '/productManagement/shelfNoManage/list',
-            name: 'shelfNoManage',
-            component: BlankLayout,
-            meta: {
-              title: '货位编号管理',
-              icon: 'radar-chart',
-              permission: 'M_shelfNoManageList'
-            },
-            hideChildrenInMenu: true,
-            children: [
-              {
-                path: 'list',
-                name: 'shelfNoManageList',
-                component: () => import(/* webpackChunkName: "productManagement" */ '@/views/productManagement/shelfNoManage/list.vue'),
-                meta: {
-                  title: '货位编号管理',
-                  icon: 'radar-chart',
-                  hidden: true,
-                  permission: 'M_shelfNoManageList'
-                }
-              }
-            ]
-          },
-          {
-            path: '/productManagement/productSourcePath',
-            redirect: '/productManagement/productSourcePath/list',
-            name: 'productSourcePath',
-            component: BlankLayout,
-            meta: {
-              title: '唯一码追溯列表',
-              icon: 'radar-chart',
-              permission: 'M_productSourcePathList'
-            },
-            hideChildrenInMenu: true,
-            children: [
-              {
-                path: 'list',
-                name: 'productSourcePathList',
-                component: () => import(/* webpackChunkName: "productManagement" */ '@/views/productManagement/productSourcePath/list.vue'),
-                meta: {
-                  title: '唯一码追溯列表',
-                  icon: 'radar-chart',
-                  hidden: true,
-                  permission: 'M_productSourcePathList'
-                }
-              }
-            ]
+        {
+          path: 'edit/:id/:sn',
+          name: 'productInfoEdit',
+          component: () => import(/* webpackChunkName: "productManagement" */ '@/views/productManagement/productInfo/edit.vue'),
+          meta: {
+            title: '编辑产品',
+            icon: 'gold',
+            hidden: true
+            // permission: 'B_goodsManage_edit'
+          }
+        }
+      ]
+    },
+    {
+      path: '/productManagement/productPricing',
+      redirect: '/productManagement/productPricing/list',
+      name: 'productPricing',
+      component: BlankLayout,
+      meta: {
+        title: '产品定价',
+        icon: 'transaction',
+        permission: 'M_productPricingList'
+      },
+      hideChildrenInMenu: true,
+      children: [
+        {
+          path: 'list',
+          name: 'productPricingList',
+          component: () => import(/* webpackChunkName: "productManagement" */ '@/views/productManagement/productPricing/list.vue'),
+          meta: {
+            title: '产品定价列表',
+            icon: 'transaction',
+            hidden: true,
+            permission: 'M_productPricingList'
+          }
+        }
+      ]
+    },
+    {
+      path: '/productManagement/productLaunchAudit',
+      redirect: '/productManagement/productLaunchAudit/list',
+      name: 'productLaunchAudit',
+      component: BlankLayout,
+      meta: {
+        title: '产品上线审核',
+        icon: 'rise',
+        permission: 'M_productLaunchAuditList'
+      },
+      hideChildrenInMenu: true,
+      children: [
+        {
+          path: 'list',
+          name: 'productLaunchAuditList',
+          component: () => import(/* webpackChunkName: "productManagement" */ '@/views/productManagement/productLaunchAudit/list.vue'),
+          meta: {
+            title: '产品上线审核列表',
+            icon: 'rise',
+            hidden: true,
+            permission: 'M_productLaunchAuditList'
+          }
+        }
+      ]
+    },
+    {
+      path: '/productManagement/newProduct',
+      redirect: '/productManagement/newProduct/list/onlineInfo/1',
+      name: 'productLaunchInfo',
+      component: BlankLayout,
+      meta: {
+        title: '产品上线信息',
+        icon: 'rise',
+        permission: 'M_productLaunchInfoList'
+      },
+      hideChildrenInMenu: true,
+      children: [
+        {
+          path: 'list/:type/:onlineFalg',
+          name: 'productLaunchInfoList',
+          component: () => import(/* webpackChunkName: "productManagement" */ '@/views/productManagement/newProduct/list.vue'),
+          meta: {
+            title: '产品上线信息列表',
+            icon: 'rise',
+            hidden: true,
+            permission: 'M_productLaunchInfoList'
+          }
+        }
+      ]
+    },
+    {
+      path: '/productManagement/productOfflineAudit',
+      redirect: '/productManagement/productOfflineAudit/list',
+      name: 'productOfflineAudit',
+      component: BlankLayout,
+      meta: {
+        title: '产品下线审核',
+        icon: 'fall',
+        permission: 'M_productOfflineAuditList'
+      },
+      hideChildrenInMenu: true,
+      children: [
+        {
+          path: 'list',
+          name: 'productOfflineAuditList',
+          component: () => import(/* webpackChunkName: "productManagement" */ '@/views/productManagement/productOfflineAudit/list.vue'),
+          meta: {
+            title: '产品下线审核列表',
+            icon: 'fall',
+            hidden: true,
+            permission: 'M_productOfflineAuditList'
+          }
+        }
+      ]
+    },
+    {
+      path: '/productManagement/productNotOnline',
+      redirect: '/productManagement/productNotOnline/list',
+      name: 'productNotOnline',
+      component: BlankLayout,
+      meta: {
+        title: '产品状态信息',
+        icon: 'fall',
+        permission: 'M_productNotOnlineList'
+      },
+      hideChildrenInMenu: true,
+      children: [
+        {
+          path: 'list',
+          name: 'productNotOnlineList',
+          component: () => import(/* webpackChunkName: "productManagement" */ '@/views/productManagement/productNotOnline/list.vue'),
+          meta: {
+            title: '产品状态信息列表',
+            icon: 'fall',
+            hidden: true,
+            permission: 'M_productNotOnlineList'
+          }
+        }
+      ]
+    },
+    {
+      path: '/productManagement/priceChangeRecord',
+      redirect: '/productManagement/priceChangeRecord/list',
+      name: 'priceChangeRecord',
+      component: BlankLayout,
+      meta: {
+        title: '价格变更记录',
+        icon: 'profile',
+        permission: 'M_priceChangeRecordList'
+      },
+      hideChildrenInMenu: true,
+      children: [
+        {
+          path: 'list',
+          name: 'priceChangeRecordList',
+          component: () => import(/* webpackChunkName: "productManagement" */ '@/views/productManagement/priceChangeRecord/list.vue'),
+          meta: {
+            title: '价格变更记录列表',
+            icon: 'profile',
+            hidden: true,
+            permission: 'M_priceChangeRecordList'
+          }
+        }
+      ]
+    },
+    {
+      path: '/productManagement/productUniversal',
+      redirect: '/productManagement/productUniversal/list',
+      name: 'productUniversal',
+      component: BlankLayout,
+      meta: {
+        title: '通用产品管理',
+        icon: 'deployment-unit',
+        permission: 'M_productUniversalList'
+      },
+      hideChildrenInMenu: true,
+      children: [
+        {
+          path: 'list',
+          name: 'productUniversalList',
+          component: () => import(/* webpackChunkName: "productManagement" */ '@/views/productManagement/productUniversal/list.vue'),
+          meta: {
+            title: '通用产品列表',
+            icon: 'deployment-unit',
+            hidden: true,
+            permission: 'M_productUniversalList'
+          }
+        }
+      ]
+    },
+    {
+      path: '/productManagement/productLevel',
+      redirect: '/productManagement/productLevel/list',
+      name: 'productLevel',
+      component: BlankLayout,
+      meta: {
+        title: '产品级别管理',
+        icon: 'fund',
+        permission: 'M_productLevelList'
+      },
+      hideChildrenInMenu: true,
+      children: [
+        {
+          path: 'list',
+          name: 'productLevelList',
+          component: () => import(/* webpackChunkName: "productManagement" */ '@/views/productManagement/productLevel/list.vue'),
+          meta: {
+            title: '产品级别列表',
+            icon: 'fund',
+            hidden: true,
+            permission: 'M_productLevelList'
+          }
+        }
+      ]
+    },
+    {
+      path: '/productManagement/productBrand',
+      redirect: '/productManagement/productBrand/list',
+      name: 'productBrand',
+      component: BlankLayout,
+      meta: {
+        title: '产品品牌管理',
+        icon: 'file-ppt',
+        permission: 'M_productBrandList'
+      },
+      hideChildrenInMenu: true,
+      children: [
+        {
+          path: 'list',
+          name: 'productBrandList',
+          component: () => import(/* webpackChunkName: "productManagement" */ '@/views/productManagement/productBrand/list.vue'),
+          meta: {
+            title: '产品品牌列表',
+            icon: 'file-ppt',
+            hidden: true,
+            permission: 'M_productBrandList'
+          }
+        }
+      ]
+    },
+    {
+      path: '/productManagement/productCategory',
+      redirect: '/productManagement/productCategory/list',
+      name: 'productCategory',
+      component: BlankLayout,
+      meta: {
+        title: '产品分类管理',
+        icon: 'radar-chart',
+        permission: 'M_productCategoryList'
+      },
+      hideChildrenInMenu: true,
+      children: [
+        {
+          path: 'list',
+          name: 'productCategoryList',
+          component: () => import(/* webpackChunkName: "productManagement" */ '@/views/productManagement/productCategory/list.vue'),
+          meta: {
+            title: '产品分类列表',
+            icon: 'radar-chart',
+            hidden: true,
+            permission: 'M_productCategoryList'
+          }
+        }
+      ]
+    },
+    {
+      path: '/productManagement/shelfNoManage',
+      redirect: '/productManagement/shelfNoManage/list',
+      name: 'shelfNoManage',
+      component: BlankLayout,
+      meta: {
+        title: '货位编号管理',
+        icon: 'radar-chart',
+        permission: 'M_shelfNoManageList'
+      },
+      hideChildrenInMenu: true,
+      children: [
+        {
+          path: 'list',
+          name: 'shelfNoManageList',
+          component: () => import(/* webpackChunkName: "productManagement" */ '@/views/productManagement/shelfNoManage/list.vue'),
+          meta: {
+            title: '货位编号管理',
+            icon: 'radar-chart',
+            hidden: true,
+            permission: 'M_shelfNoManageList'
+          }
+        }
+      ]
+    },
+    {
+      path: '/productManagement/productSourcePath',
+      redirect: '/productManagement/productSourcePath/list',
+      name: 'productSourcePath',
+      component: BlankLayout,
+      meta: {
+        title: '唯一码追溯列表',
+        icon: 'radar-chart',
+        permission: 'M_productSourcePathList'
+      },
+      hideChildrenInMenu: true,
+      children: [
+        {
+          path: 'list',
+          name: 'productSourcePathList',
+          component: () => import(/* webpackChunkName: "productManagement" */ '@/views/productManagement/productSourcePath/list.vue'),
+          meta: {
+            title: '唯一码追溯列表',
+            icon: 'radar-chart',
+            hidden: true,
+            permission: 'M_productSourcePathList'
+          }
+        }
+      ]
+    },
+    {
+      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 - 377
src/config/report/salesReport.js

@@ -7,381 +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/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'
+          }
+        }
+      ]
+    }
+  ]
+}

+ 7 - 0
src/libs/getDate.js

@@ -136,6 +136,13 @@ export default {
     obj.endtime = moment(moment().month(moment().month() - 2).endOf('month').valueOf()).format('YYYY-MM-DD 23:59:59')
     return obj
   },
+  // 获取某年某个月的开始和结束时间
+  getBeDateByMonth (str) {
+    return {
+      	beginDate: moment(str).startOf('month').format('YYYY-MM-DD 00:00:00'),
+      	endDate: moment(str).endOf('month').format('YYYY-MM-DD 23:59:59')
+    }
+  },
   // 获取某一年的开始和结束时间
   getBeDateByYear (year) {
     return {

+ 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

+ 38 - 7
src/views/allocationManagement/transferOut/basicInfoModal.vue

@@ -62,13 +62,27 @@
             </a-form-model-item>
           </a-col>
           <a-col :md="12" :sm="24">
-            <a-form-model-item label="费用归属品牌">
-              <ProductBrand id="allocateBill-basicInfo-productBrandSn" @change="changeBrand" v-model="form.productBrandSn" placeholder="请选择费用归属品牌(单选)"></ProductBrand>
+            <a-form-model-item
+              label="费用归属品牌"
+              prop="productBrandSn"
+              :required="form.costTypeName=='促销费用'"
+            >
+              <ProductBrand id="allocateBill-basicInfo-productBrandSn" @change="changeBrand" showAllBrand v-model="form.productBrandSn" placeholder="请选择费用归属品牌(单选)"></ProductBrand>
             </a-form-model-item>
           </a-col>
           <a-col :md="12" :sm="24">
-            <a-form-model-item label="费用归属品类">
-              <productTypeAll placeholder="请选择费用归属品类(单选,可选二级或三级)" @change="changeProductType" v-model="productType" id="allocateBill-basicInfo-productType"></productTypeAll>
+            <a-form-model-item
+              label="费用归属品类"
+              prop="productTypeSn2"
+              :required="form.costTypeName=='促销费用'"
+            >
+              <productTypeAll
+                :isAll="true"
+                placeholder="请选择费用归属品类(单选,至少选到二级或三级)"
+                showAllType
+                @change="changeProductType"
+                v-model="productType"
+                id="allocateBill-basicInfo-productType"></productTypeAll>
             </a-form-model-item>
           </a-col>
           <a-col :md="12" :sm="24">
@@ -221,6 +235,18 @@ export default {
       this.form.costTypeName = opt && opt[0] ? opt[0].name : ''
       this.form.allocateSortName = opt && opt[1] ? opt[1].name : ''
       this.form.allocateTypeName = opt && opt[2] ? opt[2].name : ''
+      // 校验规则
+      this.$refs.ruleForm.clearValidate()
+      this.valiadBranType()
+    },
+    valiadBranType () {
+      if (this.form.costTypeName == '促销费用') {
+        this.rules.productBrandSn = [{ required: true, message: '请选择归属品牌', trigger: 'change' }]
+        this.rules.productTypeSn2 = [{ required: true, message: '请选择归属分类(至少选择到2级或3级分类)', trigger: 'change' }]
+      } else {
+        this.rules.productBrandSn = []
+        this.rules.productTypeSn2 = []
+      }
     },
     //  产品分类  change
     changeProductType (val, id, opt) {
@@ -235,7 +261,6 @@ export default {
     },
     // 品牌
     changeBrand (val, id, opt) {
-      console.log(val, opt, '------------')
       this.form.productBrandName = opt ? opt.brandName : ''
     },
     fetchUser (dealerName) {
@@ -273,6 +298,11 @@ export default {
             form.productBrandSn = ''
           }
           form.attachmentList = this.attachList
+          // 判断费用归属品类  最少要选择到2级或3级分类
+          if (_this.form.productTypeSn1 && !_this.form.productTypeSn2) {
+            _this.$message.warning('请选择归属分类(至少选择到2级或3级分类)')
+            return false
+          }
           _this.spinning = true
           allocateBillSave(form).then(res => {
             if (res.status == 200) {
@@ -290,7 +320,6 @@ export default {
     },
     // 调往对象  change
     targetTypeChange (e) {
-      this.$refs.ruleForm.resetFields()
       this.form.targetSn = undefined
       this.form.targetName = ''
       this.form.warehouseSn = undefined
@@ -325,6 +354,8 @@ export default {
         this.allocateTypeVal = []
         this.productType = []
         this.attachList = []
+        this.rules.productBrandSn = []
+        this.rules.productTypeSn2 = []
         this.form.attachmentList = ''
         this.$refs.attachList.setFileList('')
         this.form = {
@@ -356,7 +387,6 @@ export default {
           this.$nextTick(() => {
             this.$refs.attachList.setFileList(this.attachList)
           })
-
           this.allocateTypeVal = [this.detailData.costTypeSn, this.detailData.allocateSortSn, this.detailData.allocateTypeSn]
           if (this.detailData.productTypeSn1) {
             this.productType = [this.detailData.productTypeSn1, this.detailData.productTypeSn2, this.detailData.productTypeSn3]
@@ -367,6 +397,7 @@ export default {
           if (!this.form.productBrandSn) {
             this.form.productBrandSn = undefined
           }
+          this.valiadBranType()
         }
       }
     }

+ 22 - 17
src/views/allocationManagement/transferOut/edit.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="allocateBillEdit-wrap">
-    <div class="ant-spin-nested-loading">
+    <a-spin :spinning="spinning" tip="Loading...">
       <a-page-header :ghost="false" :backIcon="false" class="allocateBillEdit-back" >
         <!-- 自定义的二级文字标题 -->
         <template slot="subTitle">
@@ -108,7 +108,7 @@
         </div>
       </a-card>
       <!-- 选择产品 -->
-      <a-card size="small" title="选择产品" :bordered="false" class="allocateBillEdit-cont">
+      <a-card size="small" :bordered="false" class="allocateBillEdit-cont">
         <!-- 筛选条件 -->
         <div class="table-page-search-wrapper">
           <a-form layout="inline" id="allocateBillDetail-form" @keyup.enter.native="$refs.table.refresh(true)">
@@ -327,18 +327,17 @@
           </template>
         </s-table>
       </a-card>
-    </div>
-    <div class="affix-cont" v-if="basicInfoData">
-      <a-button
-        type="primary"
-        id="allocateBillEdit-submit"
-        size="large"
-        :loading="spinning"
-        class="button-primary"
-        @click="handleOpen"
-        style="padding: 0 60px;">提交</a-button>
-    </div>
-
+      <div class="affix-cont" v-if="basicInfoData">
+        <a-button
+          type="primary"
+          id="allocateBillEdit-submit"
+          size="large"
+          :loading="spinning"
+          class="button-primary"
+          @click="handleOpen"
+          style="padding: 0 60px;">提交</a-button>
+      </div>
+    </a-spin>
     <!-- 导入产品 -->
     <importGuideModal :openModal="openGuideModal" :params="{allocateSn: $route.params.sn}" @close="openGuideModal=false" @ok="handleGuideOk" />
     <!-- 打印导出 -->
@@ -892,10 +891,13 @@ export default {
     height: 100%;
     box-sizing: border-box;
     > .ant-spin-nested-loading {
-        position: relative;
         height: 100%;
-        overflow: auto;
-        padding-bottom: 50px;
+        > .ant-spin-container{
+          position: relative;
+          height: 100%;
+          overflow: auto;
+          padding-bottom: 60px;
+        }
     }
     .allocateBillEdit-back{
       margin-bottom: 6px;
@@ -921,5 +923,8 @@ export default {
         margin-left: 15px;
       }
     }
+    .affix-cont{
+      position: fixed;
+    }
   }
 </style>

+ 229 - 38
src/views/allocationManagement/transferOut/importGuideModal.vue

@@ -4,12 +4,13 @@
     class="importGuide-modal"
     :footer="null"
     :maskClosable="false"
-    title="导入"
+    destroyOnClose
+    title="导入产品"
     v-model="isShow"
-    @cancel="isShow=false"
-    :width="750">
+    :closable="false"
+    :width="850">
     <div class="importGuide-con">
-      <div class="explain-con">
+      <div class="explain-con" v-show="step==0">
         <div class="explain-item">
           <div class="explain-tit">
             <span>1</span>准备导入
@@ -24,7 +25,7 @@
             type="link"
             icon="download"
             style="padding: 0 0 0 23px;"
-            :loading="exportLoading"
+            :loading="spinning"
             @click="handleExport">下载导入模板</a-button>
         </div>
         <div class="explain-item">
@@ -46,39 +47,97 @@
           </div>
         </div>
       </div>
+      <!-- 第二步 -->
+      <div v-show="step==1">
+        <!-- 可导入数据 -->
+        <p class="blue">可导入数据<span>{{ loadData.length }}</span>条</p>
+        <a-table
+          class="sTable"
+          ref="table"
+          size="small"
+          :rowKey="(record) => record.no"
+          :columns="nowColumns"
+          :dataSource="loadData"
+          :loading="spinning"
+          :scroll="{ y: 200 }"
+          :pagination="false"
+          bordered>
+        </a-table>
+        <!-- 不可导入数据 -->
+        <p class="red">不可导入数据<span>{{ unLoadData.length }}</span>条</p>
+        <a-table
+          class="unTable"
+          ref="unTable"
+          size="small"
+          :rowKey="(record) => record.no"
+          :columns="nowUnColumns"
+          :dataSource="unLoadData"
+          :loading="spinning"
+          :scroll="{ y: 200 }"
+          :pagination="false"
+          bordered>
+        </a-table>
+      </div>
       <!-- 按钮 -->
       <div class="btn-con">
+        <a-button
+          id="importGuide-cancel"
+          size="large"
+          class="button-cancel"
+          @click="handleCancel"
+          :disabled="spinning"
+          style="padding: 0 40px;margin-left: 15px;">取消</a-button>
         <a-button
           type="primary"
           id="importGuide-nextStep"
           size="large"
           class="button-primary"
           @click="handlerNextStep"
-          style="padding: 0 60px;">下一步</a-button>
+          v-if="step==0"
+          :disabled="spinning"
+          style="padding: 0 40px;margin-left: 15px;">下一步</a-button>
         <a-button
-          id="importGuide-cancel"
+          type="default"
+          id="importGuide-prevStep"
           size="large"
-          class="button-cancel"
-          @click="isShow=false"
-          style="padding: 0 60px;margin-left: 15px;">取消</a-button>
+          v-if="step==1"
+          class="button-primary"
+          @click="handlerPrevStep"
+          :disabled="spinning"
+          style="padding: 0 40px;margin-left: 15px;">上一步</a-button>
+        <a-button
+          type="primary"
+          id="chooseImport-submit"
+          v-if="step==1"
+          size="large"
+          class="button-primary"
+          @click="handleSubmit"
+          :disabled="spinning"
+          style="padding: 0 40px;margin-left: 15px;">确认导入</a-button>
+        <a-button
+          type="primary"
+          id="chooseImport-error"
+          v-if="step==1"
+          size="large"
+          class="button-error"
+          :disabled="spinning"
+          @click="handleError"
+          style="padding: 0 40px;margin-left: 15px;">导出错误项</a-button>
       </div>
     </div>
-    <!-- 导入 -->
-    <chooseImportModal :openModal="openImportModal" :paramsData="paramsData" @close="handleClose" @ok="hanldeOk" />
   </a-modal>
 </template>
 
 <script>
 import { commonMixin } from '@/utils/mixin'
-// 组件
-import ChooseImportModal from './chooseImportModal.vue'
+import { hdExportExcel } from '@/libs/exportExcel'
 import { Upload } from '@/components'
 // 接口
-import { allocateBillDownload } from '@/api/allocateBill'
+import { allocateBillDownload, allocateBillParseProducts, allocateBillFailExcel, allocateBillBatchInsert } from '@/api/allocateBill'
 export default {
   name: 'TransferOutImportGuideModal',
   mixins: [commonMixin],
-  components: { ChooseImportModal, Upload },
+  components: { Upload },
   props: {
     openModal: { //  弹框显示状态
       type: Boolean,
@@ -92,24 +151,35 @@ export default {
   data () {
     return {
       isShow: this.openModal, //  是否打开弹框
-      openImportModal: false, //  导入
       attachAction: process.env.VUE_APP_API_BASE_URL + '/upload', // 上传文件路径
       paramsData: null, // 上传参数
       uploadParams: { // 上传参数
         savePathType: 'local'
       },
-      exportLoading: false// 导出按钮加载状态
+      spinning: false, // 导出按钮加载状态
+      step: 0,
+      nowColumns: [ //  正品
+        { title: '序号', dataIndex: 'no', width: 70, align: 'center' },
+        { title: '产品编码', dataIndex: 'productCode', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'productName', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '数量', dataIndex: 'qtyText', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '库存', dataIndex: 'currentStockQty', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '单位', dataIndex: 'productUnit', width: 60, align: 'center', customRender: function (text) { return text || '--' } }
+      ],
+      nowUnColumns: [ //  促销品
+        { title: '序号', dataIndex: 'no', width: 70, align: 'center' },
+        { title: '产品编码', dataIndex: 'productCode', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'productName', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '数量', dataIndex: 'qtyText', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '库存', dataIndex: 'currentStockQty', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '单位', dataIndex: 'productUnit', width: 60, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '备注', dataIndex: 'errorDesc', width: 180, align: 'center', customRender: function (text) { return text || '--' } }
+      ],
+      loadData: [], // 可导入数据
+      unLoadData: [] // 错误数据
     }
   },
   methods: {
-    // 下一步
-    handlerNextStep () {
-      if (this.paramsData) {
-        this.openImportModal = true
-      } else {
-        this.$message.warning('添加文件后再进行下一步操作!')
-      }
-    },
     // 上传文件  change
     changeImport (file) {
       if (file) {
@@ -117,26 +187,129 @@ export default {
           allocateSn: this.params.allocateSn || '',
           path: file
         }
+        this.loadData = []
+        this.unLoadData = []
+        this.handlerNextStep()
+      } else {
+        this.paramsData = null
       }
     },
+<<<<<<< HEAD
     // 导入
     hanldeOk (obj) {
       this.$emit('ok', obj)
       this.isShow = false
+=======
+    // 下一步
+    handlerNextStep () {
+      if (this.paramsData) {
+        if (this.loadData.length == 0 && this.unLoadData.length == 0) {
+          this.getData()
+        }
+        this.step = 1
+      } else {
+        this.$message.warning('添加文件后再进行下一步操作!')
+      }
+>>>>>>> 748bf4e7c84780c768269fb28c2c81e9b76313df
     },
-    // 关闭
-    handleClose () {
-      this.openImportModal = false
-      this.isShow = false
+    // 上一步
+    handlerPrevStep () {
+      const _this = this
+      if (this.loadData.length) {
+        this.$confirm({
+          title: '提示',
+          content: '当前页面数据未导入,是否返回上页?',
+          centered: true,
+          cancelText: '返回上页',
+          okText: '继续导入',
+          onOk () {
+            _this.step = 1
+          },
+          onCancel () {
+            _this.step = 0
+          }
+        })
+      } else {
+        _this.step = 0
+      }
     },
-    //  导出
+    // 取消或关闭
+    handleCancel () {
+      const _this = this
+      if (_this.loadData.length) {
+        this.$confirm({
+          title: '提示',
+          content: '当前页面数据未导入,是否取消导入操作?',
+          centered: true,
+          cancelText: '确认取消',
+          okText: '继续导入',
+          onOk () {
+            _this.step = 1
+          },
+          onCancel () {
+            _this.isShow = false
+          }
+        })
+      } else {
+        _this.isShow = false
+      }
+    },
+    // 获取表格数据
+    getData () {
+      const _this = this
+      this.spinning = true
+      // 获取列表数据  无分页
+      allocateBillParseProducts(this.paramsData).then(res => {
+        this.spinning = false
+        if (res.status == 200) {
+          if (res.data.okList && res.data.okList.length > 0) {
+            res.data.okList.map((item, index) => {
+              item.no = index + 1
+            })
+          }
+          if (res.data.failList && res.data.failList.length > 0) {
+            res.data.failList.map((item, index) => {
+              item.no = index + 1
+            })
+          }
+          _this.loadData = res.data.okList || []
+          _this.unLoadData = res.data.failList || []
+        }
+      })
+    },
+    // 确认导入
+    handleSubmit () {
+      if (this.loadData.length == 0) {
+        this.$message.warning('无可导入产品!')
+      } else {
+        this.spinning = true
+        allocateBillBatchInsert(this.loadData).then(res => {
+          if (res.status == 200) {
+            this.$emit('ok')
+            this.isShow = false
+          }
+          this.spinning = false
+        })
+      }
+    },
+    // 导出
+    handleError () {
+      const _this = this
+      if (_this.unLoadData.length < 1) {
+        _this.$message.info('暂无可导出错误项~')
+        return
+      }
+      _this.spinning = true
+      hdExportExcel(allocateBillFailExcel, _this.unLoadData, '产品导入错误项', function () {
+        _this.spinning = false
+      })
+    },
+    // 下载模板
     handleExport () {
       const _this = this
       _this.spinning = true
-      _this.exportLoading = true
       allocateBillDownload({}).then(res => {
         _this.spinning = false
-        _this.exportLoading = false
         if (res.type == 'application/json') {
           var reader = new FileReader()
           reader.addEventListener('loadend', function () {
@@ -174,8 +347,15 @@ export default {
     isShow (newValue, oldValue) {
       if (!newValue) {
         this.$emit('close')
+      } else {
         this.paramsData = null
-        this.$refs.importUpload.setFileList('')
+        if (this.$refs.importUpload) {
+          this.$refs.importUpload.setFileList('')
+        }
+        this.loadData = []
+        this.unLoadData = []
+        this.step = 0
+        this.spinning = false
       }
     }
   }
@@ -219,12 +399,23 @@ export default {
           width: 100%;
         }
       }
+      .blue{
+        span{
+          color: #1890ff;
+          margin: 0 5px;
+        }
+        margin: 10px 0;
+      }
+      .red{
+        span{
+          color: #f5222d;
+          margin: 0 5px;
+        }
+        margin: 10px 0;
+      }
       .btn-con{
-        margin: 10px 0 20px;
+        margin: 30px 0 20px;
         text-align: center;
-        .button-cancel{
-          font-size: 12px;
-        }
       }
     }
   }

+ 11 - 1
src/views/common/productBrand.js

@@ -40,7 +40,12 @@ const ProductBrand = {
     size: {
       type: String,
       default: 'default'
-      }
+      },
+    // 是否显示全品牌
+    showAllBrand:{
+      type: Boolean,
+      default: false
+    }
   },
   data() {
     return {
@@ -91,6 +96,11 @@ const ProductBrand = {
       }else{
         this.productBrandList = data
       }
+      // 是否显示全品牌
+      const hasAll = this.productBrandList.find(item => item.brandSn == 'ALL')
+      if(this.showAllBrand && !hasAll){
+        this.productBrandList.unshift({brandSn:'ALL',brandName:'全品牌'})
+      }
     },
     //  产品品牌列表,
     getProductBrand () {

+ 28 - 12
src/views/common/productTypeAll.js

@@ -23,7 +23,7 @@ const ProductType = {
         return []
       }
     },
-    placeholder:{
+    placeholder: {
       type: String,
       default: '请选择产品分类'
     },
@@ -42,6 +42,11 @@ const ProductType = {
     size: {
       type: String,
       default: 'default'
+    },
+    // 是否显示全分类
+    showAllType: {
+      type: Boolean,
+      default: false
     }
   },
   data () {
@@ -58,28 +63,35 @@ const ProductType = {
   mounted () {
     const a = this.$store.state.app.productTypeAllList
     // 如果有缓存
-    if(this.isAll && a){
+    if (this.isAll && a) {
       this.productTypeList = a || []
-    }else{
+    } else {
       this.getProductType()
     }
   },
   methods: {
-    filter(inputValue, path) {
+    filter (inputValue, path) {
       console.log(inputValue, path)
-      return path.some(option => option.productTypeName.indexOf(inputValue) > -1);
+      return path.some(option => option.productTypeName.indexOf(inputValue) > -1)
     },
-    setDefValue(defaultVal,row){
-      this.handleChange(defaultVal,row)
+    setDefValue (defaultVal, row) {
+      this.handleChange(defaultVal, row)
     },
-    handleChange (value,row) {
+    handleChange (value, row) {
       this.defaultVal = value
-      this.$emit('change', this.defaultVal, this.id,row)
+      this.$emit('change', this.defaultVal, this.id, row)
       this.$emit('input', this.defaultVal)
     },
+    showALLtype () {
+      // 是否显示全分类
+      const hasAll = this.productTypeList.some(item => item.productTypeSn == 'ALL')
+      if (this.showAllType && !hasAll) {
+        this.productTypeList.unshift({ productTypeName: '全分类', productTypeSn: 'ALL', children: [{ productTypeName: '全分类', productTypeSn: 'ALL' }] })
+      }
+    },
     //  产品分类  列表
     getProductType () {
-      if(this.isAll){
+      if (this.isAll) {
         productTypeQueryAll({}).then(res => {
           if (res.status == 200) {
             if (res.data && res.data.length > 0) {
@@ -94,14 +106,18 @@ const ProductType = {
           }
           // 缓存数据
           this.$store.state.app.productTypeAllList = this.productTypeList
+          // 是否显示全分类
+          this.showALLtype()
         })
-      }else{
+      } else {
         productTypeQuery({}).then(res => {
           if (res.status == 200) {
             this.productTypeList = res.data
           } else {
             this.productTypeList = []
           }
+          // 是否显示全分类
+          this.showALLtype()
         })
       }
     },
@@ -122,7 +138,7 @@ const ProductType = {
           }
         })
       }
-    },
+    }
   }
 }
 

+ 1 - 1
src/views/dealerManagement/dealerAccount/checkAccountModal.vue

@@ -39,7 +39,7 @@
             </a-col>
             <a-col :span="12">
               <a-form-model-item label="调账后" :label-col="{span:10}" :wrapper-col="{ span: 10}">
-                {{ (dealerNum||dealerNum==0) ?(form.changeAmount||form.changeAmount==0) ?toThousands(dealerNum*1+form.changeAmount*1):'--' :'--' }}
+                {{ (dealerNum||dealerNum==0) ?((form.changeAmount||form.changeAmount==0)&&form.changeAmount!='-') ?toThousands(dealerNum*1+form.changeAmount*1):'--' :'--' }}
               </a-form-model-item>
             </a-col>
           </a-row>

+ 13 - 2
src/views/expenseManagement/expenseReimbursement/add.vue

@@ -24,6 +24,17 @@
           <a-descriptions-item label="申请人">{{ detailData&&detailData.applyPersonName || '--' }}</a-descriptions-item>
           <a-descriptions-item label="申请部门">{{ detailData&&detailData.applyDepartmentName || '--' }}</a-descriptions-item>
           <a-descriptions-item label="费用类型">{{ detailData&&detailData.expenseTypeName || '--' }}<span v-if="detailData&&detailData.expenseType2">/{{ detailData&&detailData.expenseTypeName2 || '--' }}</span><span v-if="detailData&&detailData.expenseType3">/{{ detailData&&detailData.expenseTypeName3 || '--' }}</span></a-descriptions-item>
+          <a-descriptions-item label="费用归属品牌">
+            {{ (detailData&&detailData.productBrandName) || '--' }}
+          </a-descriptions-item>
+          <a-descriptions-item label="费用归属品类">
+            <div>
+              <span v-if="detailData&&detailData.productTypeName1">{{ detailData.productTypeName1 || '--' }}</span>
+              <span v-else>--</span>
+              <span v-if="detailData&&detailData.productTypeName2">/{{ detailData.productTypeName2 || '--' }}</span>
+              <span v-if="detailData&&detailData.productTypeName3">/{{ detailData.productTypeName3 || '--' }}</span>
+            </div>
+          </a-descriptions-item>
           <a-descriptions-item label="费用发生月份">{{ detailData&&detailData.expenseDate?detailData.expenseDate.substring(0, 7) : '--' }}</a-descriptions-item>
           <a-descriptions-item label="合计金额">{{ (detailData.applyExpenseTotal || detailData.applyExpenseTotal == 0) ? toThousands(detailData.applyExpenseTotal)+' 元' : '--' }}</a-descriptions-item>
           <a-descriptions-item label="状态">{{ detailData&&detailData.stateDictValue || '--' }}</a-descriptions-item>
@@ -31,8 +42,8 @@
           <a-descriptions-item label="审核时间">{{ detailData&&detailData.finishDate || '--' }}</a-descriptions-item>
           <a-descriptions-item label="关联单号" v-if="detailData&&detailData.bizNo">{{ detailData&&detailData.bizNo || '--' }}</a-descriptions-item>
           <a-descriptions-item label="主题" :span="3">{{ detailData&&detailData.title || '--' }}</a-descriptions-item>
-          <a-descriptions-item label="详细说明" :span="3">{{ detailData&&detailData.content.join(',')||'' }}</a-descriptions-item>
-          <a-descriptions-item label="附件" :span="3">
+          <a-descriptions-item label="详细说明" :span="4">{{ detailData&&detailData.content.join(',')||'' }}</a-descriptions-item>
+          <a-descriptions-item label="附件" :span="4">
             <a
               target="_blank"
               style="color: #00aaff;text-decoration: underline;margin-right: 15px;"

+ 83 - 7
src/views/expenseManagement/expenseReimbursement/baseDataModal.vue

@@ -50,6 +50,30 @@
                 style="width: 100%;"/>
             </a-form-model-item>
           </a-col>
+          <a-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
+            <a-form-model-item
+              label="费用归属品牌"
+              prop="productBrandSn"
+              :required="form.expenseTypeName=='促销费用'"
+            >
+              <ProductBrand id="expenseReimbursementAddform-productBrandSn" @change="changeBrand" showAllBrand v-model="form.productBrandSn" placeholder="请选择费用归属品牌(单选)"></ProductBrand>
+            </a-form-model-item>
+          </a-col>
+          <a-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
+            <a-form-model-item
+              label="费用归属品类"
+              prop="productTypeSn2"
+              :required="form.expenseTypeName=='促销费用'"
+            >
+              <productTypeAll
+                :isAll="true"
+                placeholder="请选择费用归属品类(单选,至少选到二级或三级)"
+                showAllType
+                @change="changeProductType"
+                v-model="productType"
+                id="expenseReimbursementAddform-productType"></productTypeAll>
+            </a-form-model-item>
+          </a-col>
           <a-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
             <a-form-model-item label="主题" prop="title" :label-col="{span:3}" :wrapper-col="{span:19}">
               <a-textarea
@@ -106,10 +130,12 @@ import moment from 'moment'
 import department from './department.js'
 import employee from './employee.js'
 import expenseType from '@/views/common/expenseType.js'
+import ProductBrand from '@/views/common/productBrand.js'
+import productTypeAll from '@/views/common/productTypeAll.js'
 import { expenseAccountDetail, expenseAccountSave } from '@/api/expenseManagement.js'
 export default {
   name: 'BaseDataModal',
-  components: { VSelect, Upload, STable, department, employee, expenseType },
+  components: { VSelect, Upload, STable, department, employee, expenseType, ProductBrand, productTypeAll },
   props: {
     show: [Boolean],
     itemSn: {
@@ -131,6 +157,7 @@ export default {
       attachList: [], // 附件列表
       attachAction: process.env.VUE_APP_API_BASE_URL + '/uploadGetFileInfo', // 附件上传地址
       expenseTypes: [], // 费用类型值
+      productType: [],
       form: {
         applyPersonSn: undefined, // 申请人
         applyDepartmentSn: undefined, //  申请部门
@@ -140,6 +167,10 @@ export default {
         expenseTypeName: undefined, //  费用类型1
         expenseTypeName2: undefined, //  费用类型2
         expenseTypeName3: undefined, // 费用类型3
+        productBrandSn: undefined, //  产品品牌
+        productTypeSn1: '', //  产品一级分类
+        productTypeSn2: '', //  产品二级分类
+        productTypeSn3: '', //  产品三级分类
         expenseDate: moment().locale('zh-cn').format('YYYY-MM'), //  费用产生月
         title: '', // 主题
         content: '' // 费用说明
@@ -194,16 +225,38 @@ export default {
         expenseTypeName: undefined, //  费用类型1
         expenseTypeName2: undefined, //  费用类型2
         expenseTypeName3: undefined, // 费用类型3
+        productBrandSn: undefined, //  产品品牌
+        productTypeSn1: '', //  产品一级分类
+        productTypeSn2: '', //  产品二级分类
+        productTypeSn3: '', //  产品三级分类
         expenseDate: moment().locale('zh-cn').format('YYYY-MM'), //  费用产生月
         title: '', // 主题
         content: '' // 费用说明
       }
+      this.rules.productBrandSn = []
+      this.rules.productTypeSn2 = []
+      this.productType = []
       this.attachList = []
       this.form.expenseAccountFilesList = ''
       this.$refs.attachList.setFileList('')
       this.$refs.ruleForm.resetFields()
       this.expenseTypes = []
     },
+    //  产品分类  change
+    changeProductType (val, id, opt) {
+      console.log(val, opt, '------------')
+      this.form.productTypeSn1 = val && val[0] ? val[0] : ''
+      this.form.productTypeSn2 = val && val[1] ? val[1] : ''
+      this.form.productTypeSn3 = val && val[2] ? val[2] : ''
+      // 名称
+      this.form.productTypeName1 = opt && opt[0] ? opt[0].productTypeName : ''
+      this.form.productTypeName2 = opt && opt[1] ? opt[1].productTypeName : ''
+      this.form.productTypeName3 = opt && opt[2] ? opt[2].productTypeName : ''
+    },
+    // 品牌
+    changeBrand (val, id, opt) {
+      this.form.productBrandName = opt ? opt.brandName : ''
+    },
     // 申请人员
     employeeChange (v, r) {
       if (r.departmentSn) {
@@ -237,6 +290,19 @@ export default {
       this.form.expenseTypeName = opts && opts[0] ? opts[0].name : ''
       this.form.expenseTypeName2 = opts && opts[1] ? opts[1].name : ''
       this.form.expenseTypeName3 = opts && opts[2] ? opts[2].name : ''
+      // 校验规则
+      this.$refs.ruleForm.clearValidate()
+      this.setValidBrandType()
+    },
+    // 判断是否促销费用类型,必填品牌和分类
+    setValidBrandType () {
+      if (this.form.expenseTypeName == '促销费用') {
+        this.rules.productBrandSn = [{ required: true, message: '请选择归属品牌', trigger: 'change' }]
+        this.rules.productTypeSn2 = [{ required: true, message: '请选择归属分类(至少选择到2级或3级分类)', trigger: 'change' }]
+      } else {
+        this.rules.productBrandSn = []
+        this.rules.productTypeSn2 = []
+      }
     },
     //  附件上传
     changeAttach (file) {
@@ -257,9 +323,16 @@ export default {
         this.attachList = data.expenseAccountFilesList
         this.$refs.attachList.setFileList(this.attachList)
       }
+      if (data.productTypeSn1) {
+        this.productType = [data.productTypeSn1, data.productTypeSn2, data.productTypeSn3]
+      }
+      if (!data.productBrandSn) {
+        this.form.productBrandSn = undefined
+      }
       setTimeout(() => {
         this.expenseTypes = data.expenseType ? [this.form.expenseType, this.form.expenseType2, this.form.expenseType3] : []
       }, 500)
+      this.setValidBrandType()
     },
     //  获取详情
     getDetail () {
@@ -283,18 +356,21 @@ export default {
         if (valid) {
           const form = JSON.parse(JSON.stringify(_this.form))
           form.expenseDate = form.expenseDate + '-01'
-          form.expenseAccountFilesList = this.attachList
-          // console.log(form)
+          form.expenseAccountFilesList = _this.attachList
+          // 判断费用归属品类  最少要选择到2级或3级分类
+          if (_this.form.productTypeSn1 && !_this.form.productTypeSn2) {
+            _this.$message.warning('请选择归属分类(至少选择到2级或3级分类)')
+            return false
+          }
           _this.spinning = true
-
           // 从销售单转的费用,直接提交
           if (_this.fromPage == 'sales') {
-            _this.$emit('expenseSaveOk', form, this.fromPage)
+            _this.$emit('expenseSaveOk', form, _this.fromPage)
             return false
           }
           // 从销售单转的费用,合并提交
           if (_this.fromPage == 'salesMearge') {
-            _this.$emit('expenseSaveOk', form, this.fromPage)
+            _this.$emit('expenseSaveOk', form, _this.fromPage)
             return false
           }
           // 手动建的费用单
@@ -302,7 +378,7 @@ export default {
             if (res.status == 200) {
               _this.$message.success(res.message)
               setTimeout(() => {
-                if (this.expenseAccountSn) {
+                if (_this.expenseAccountSn) {
                   _this.$emit('refashData')
                 } else {
                   // 跳转到费用明细单页面

+ 12 - 1
src/views/expenseManagement/expenseReimbursement/detail.vue

@@ -35,11 +35,22 @@
       </a-page-header>
       <!-- 基础信息 -->
       <a-card size="small" :bordered="false" class="expenseManagementDetail-cont" v-show="showDetail">
-        <a-descriptions size="small" :column="{ xs: 2, sm: 3, md: 4}" v-if="detailData">
+        <a-descriptions size="small" :column="{ xs: 2, sm: 3, md: 3}" v-if="detailData">
           <a-descriptions-item label="费用单号">{{ detailData&&detailData.expenseAccountNo || '--' }}</a-descriptions-item>
           <a-descriptions-item label="申请人">{{ detailData&&detailData.applyPersonName || '--' }}</a-descriptions-item>
           <a-descriptions-item label="申请部门">{{ detailData&&detailData.applyDepartmentName || '--' }}</a-descriptions-item>
           <a-descriptions-item label="费用类型">{{ detailData&&detailData.expenseTypeName || '--' }}<span v-if="detailData&&detailData.expenseType2">/{{ detailData&&detailData.expenseTypeName2 || '--' }}</span><span v-if="detailData&&detailData.expenseType3">/{{ detailData&&detailData.expenseTypeName3 || '--' }}</span></a-descriptions-item>
+          <a-descriptions-item label="费用归属品牌">
+            {{ (detailData&&detailData.productBrandName) || '--' }}
+          </a-descriptions-item>
+          <a-descriptions-item label="费用归属品类">
+            <div>
+              <span v-if="detailData&&detailData.productTypeName1">{{ detailData.productTypeName1 || '--' }}</span>
+              <span v-else>--</span>
+              <span v-if="detailData&&detailData.productTypeName2">/{{ detailData.productTypeName2 || '--' }}</span>
+              <span v-if="detailData&&detailData.productTypeName3">/{{ detailData.productTypeName3 || '--' }}</span>
+            </div>
+          </a-descriptions-item>
           <a-descriptions-item label="费用发生月份">{{ detailData&&detailData.expenseDate?detailData.expenseDate.substring(0, 7) : '--' }}</a-descriptions-item>
           <a-descriptions-item label="合计金额">{{ (detailData.applyExpenseTotal || detailData.applyExpenseTotal == 0) ? toThousands(detailData.applyExpenseTotal)+' 元' : '--' }}</a-descriptions-item>
           <a-descriptions-item label="状态">{{ detailData&&detailData.stateDictValue || '--' }}</a-descriptions-item>

+ 7 - 3
src/views/expenseManagement/expenseReimbursementDetail/list.vue

@@ -183,7 +183,7 @@
           :columns="columns"
           :data="loadData"
           :pageSize="30"
-          :scroll="{ y: tableHeight,x:2250 }"
+          :scroll="{ y: tableHeight,x:2750 }"
           :defaultLoadData="false"
           bordered>
         </s-table>
@@ -303,11 +303,15 @@ export default {
         { title: '所属城市', dataIndex: 'cityName', width: 90, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '记账费用', dataIndex: 'expense', width: 120, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
         { title: '费用承担方', dataIndex: 'splitObjName', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '财务编码', dataIndex: 'splitObjFnumber', width: 120, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '承担方财务编码', dataIndex: 'splitObjFnumber', width: 120, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '费用承担金额', dataIndex: 'splitAmount', width: 120, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
         { title: '费用承担人', dataIndex: 'childSplitObjName', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '人员平摊费用', dataIndex: 'childSplitAmount', width: 120, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
-        { title: '备注', dataIndex: 'remarks', width: 100, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true }
+        // { title: '费用归属品牌', dataIndex: 'productBrandName', width: 120, align: 'center', customRender: function (text) { return text || '--' } },
+        // { title: '费用归属品类(一级)', dataIndex: 'productTypeName1', width: 120, align: 'center', customRender: function (text) { return text || '--' } },
+        // { title: '费用归属品牌(二级)', dataIndex: 'productTypeName2', width: 120, align: 'center', customRender: function (text) { return text || '--' } },
+        // { title: '费用归属品牌(三级)', dataIndex: 'productTypeName3', width: 120, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '备注', dataIndex: 'remarks', width: 120, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true }
       ]
     }
   },

+ 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: '', // 产品说明

+ 115 - 32
src/views/reportData/allocationOrderTotal/list.vue

@@ -25,30 +25,47 @@
               </a-form-model-item>
             </a-col>
             <a-col :md="6" :sm="24">
-              <a-form-model-item label="操作员">
-                <a-select
-                  id="allocationOrderTotalList-creatorId"
-                  allowClear
-                  v-model="queryParam.creatorId"
-                  placeholder="请选择操作员"
-                  :showSearch="true"
-                  option-filter-prop="children"
-                  :filter-option="filterOption">
-                  <a-select-option v-for="item in operatorList" :key="item.sn" :value="item.sn">{{ item.name }}</a-select-option>
-                </a-select>
-              </a-form-model-item>
-            </a-col>
-            <a-col :md="6" :sm="24">
-              <a-form-model-item label="费用/调拨类型">
-                <AllocateType id="allocationDetailsList-allocateTypeSn" v-model="allocateTypeVal" :changeOnSelect="true" placeholder="请选择费用/调拨类型" @change="changeAllocatype"></AllocateType>
-              </a-form-model-item>
-            </a-col>
-            <a-col :md="6" :sm="24" v-show="isShowCustomerSearch">
-              <a-form-model-item label="客服">
-                <customerService ref="customerName" id="allocationDetailsList-customerName" v-model="queryParam.bizUserSn"></customerService>
-              </a-form-model-item>
+              <a-form-item label="客户名称">
+                <a-input id="allocationOrderTotalList-targetName" v-model.trim="queryParam.targetName" allowClear placeholder="请输入客户名称搜索"/>
+              </a-form-item>
             </a-col>
-            <a-col :md="isShowCustomerSearch?6:24" :sm="24" style="margin-bottom: 10px;" :style="{textAlign: !isShowCustomerSearch?'center':''}">
+            <template v-if="advanced">
+              <a-col :md="6" :sm="24">
+                <a-form-model-item label="客户类型">
+                  <v-select
+                    v-model="queryParam.targetType"
+                    id="allocationOrderTotalList-targetType"
+                    code="TARGET_TYPE"
+                    placeholder="请选择客户类型"
+                    allowClear></v-select>
+                </a-form-model-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-model-item label="费用/调拨类型">
+                  <AllocateType id="allocationOrderTotalList-allocateTypeSn" v-model="allocateTypeVal" :changeOnSelect="true" placeholder="请选择费用/调拨类型" @change="changeAllocatype"></AllocateType>
+                </a-form-model-item>
+              </a-col>
+              <a-col :md="6" :sm="24" v-show="isShowCustomerSearch">
+                <a-form-model-item label="客服">
+                  <customerService ref="customerName" id="allocationOrderTotalList-customerName" v-model="queryParam.bizUserSn"></customerService>
+                </a-form-model-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-model-item label="操作员">
+                  <a-select
+                    id="allocationOrderTotalList-creatorId"
+                    allowClear
+                    v-model="queryParam.creatorId"
+                    placeholder="请选择操作员"
+                    :showSearch="true"
+                    option-filter-prop="children"
+                    :filter-option="filterOption">
+                    <a-select-option v-for="item in operatorList" :key="item.sn" :value="item.sn">{{ item.name }}</a-select-option>
+                  </a-select>
+                </a-form-model-item>
+              </a-col>
+            </template>
+            <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
               <!-- <a-button
                 type="primary"
                 class="button-info"
@@ -57,6 +74,19 @@
                 id="allocationOrderTotalList-stockDate">盘点区间日期</a-button> -->
               <a-button style="margin-left: 5px" type="primary" @click="handleSearch" :disabled="disabled" id="allocationOrderTotalList-refresh">查询</a-button>
               <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="allocationOrderTotalList-reset">重置</a-button>
+              <a-button
+                style="margin-left: 5px"
+                type="primary"
+                v-if="$hasPermissions('B_allocationOrderTotalList_export')"
+                class="button-warning"
+                @click="handleExport"
+                :disabled="disabled"
+                :loading="exportLoading"
+                id="allocationOrderTotalList-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>
@@ -76,6 +106,18 @@
           bordered
           :style="{ height: tableHeight+84.5+'px' }"
           :scroll="{ y: tableHeight - 20 }">
+          <!-- 调拨类型 -->
+          <template slot="allocateType" slot-scope="text, record">
+            <div>
+              <span>{{ record.allocateSortName||'--' }}</span>
+              <span v-if="record.allocateSortName&&record.allocateTypeName">/{{ record.allocateTypeName }}</span>
+            </div>
+          </template>
+          <!-- 费用归属品类 -->
+          <template slot="productType" slot-scope="text, record">
+            <span v-if="record.productTypeName1">{{ record.productTypeName1 }}{{ record.productTypeName2?'>'+record.productTypeName2:'' }}{{ record.productTypeName3?'>'+record.productTypeName3:'' }}</span>
+            <span v-else>--</span>
+          </template>
           <template slot="footer">
             <table>
               <tr>
@@ -83,6 +125,7 @@
                 <td style="width:15%"></td>
                 <td style="width:20%"></td>
                 <td style="width:12%;text-align: center;">总数量:{{ (totalData && (totalData.totalQty || totalData.totalQty==0)) ? totalData.totalQty : '--' }}</td>
+                <td style="width:12%;text-align: right;"><span v-if="$hasPermissions('M_allocationOrderTotalList_salesPrice')">总售价:{{ (totalData && (totalData.totalPrice || totalData.totalPrice==0)) ? toThousands(totalData.totalPrice) : '--' }}</span></td>
                 <td style="width:12%;text-align: right;"><span v-if="$hasPermissions('M_allocationOrderTotalList_costPrice')">总成本价:{{ (totalData && (totalData.totalCost || totalData.totalCost==0)) ? toThousands(totalData.totalCost) : '--' }}</span></td>
                 <td style="width:12%;text-align: right;"><span v-if="$hasPermissions('M_allocationOrderTotalList_costPrice')">总毛利:{{ (totalData && (totalData.totalGrossProfit || totalData.totalGrossProfit==0)) ? toThousands(totalData.totalGrossProfit) : '--' }}</span></td>
                 <td style="width:14%"></td>
@@ -100,23 +143,26 @@ import { commonMixin } from '@/utils/mixin'
 import getDate from '@/libs/getDate.js'
 // 组件
 import { STable, VSelect } from '@/components'
+import { exportExcel } from '@/libs/JGPrint.js'
 import rangeDate from '@/views/common/rangeDate.vue'
 import AllocateType from '@/views/common/allocateType.js'
 import customerService from '@/views/common/customerService'
+import dealerSubareaScopeList from '@/views/common/dealerSubareaScopeList.vue'
 // 接口
 import { allocateTypeAllList } from '@/api/allocateType'
 import { userQueryList } from '@/api/power-user'
-import { allocateReportList, allocateReportCount } from '@/api/allocateReport'
+import { allocateReportList, allocateReportCount, allocateReportExportExcel } from '@/api/allocateReport'
 export default {
   name: 'AllocationOrderTotalList',
   mixins: [commonMixin],
-  components: { STable, VSelect, rangeDate, AllocateType, customerService },
+  components: { STable, VSelect, rangeDate, AllocateType, customerService, dealerSubareaScopeList },
   data () {
     return {
       spinning: false,
       labelCol: { span: 8 },
       wrapperCol: { span: 16 },
       tableHeight: 0, // 表格高度
+      advanced: true, // 高级搜索 展开/关闭
       //  查询条件
       queryParam: {
         // 调拨开单日期 默认值
@@ -131,7 +177,9 @@ export default {
         costTypeSn: undefined, // 费用类型
         allocateCategory: undefined, //  调拨类型1
         allocateTypeSn: undefined, //  调拨类型2
-        bizUserSn: undefined// 客服
+        bizUserSn: undefined, // 客服
+        targetName: undefined, // 客户名称
+        targetType: undefined// 客户类型
       },
       allocateTypeList: [], //  调拨类型
       allocateTypeVal: [], // 已选费用/调拨类型
@@ -171,21 +219,41 @@ export default {
     columns () {
       const _this = this
       const arr = [
-        { title: '调拨单号', dataIndex: 'allocateNo', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '调拨开单日期', dataIndex: 'allocateDate', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '序号', dataIndex: 'no', width: '6%', align: 'center' },
+        { title: '调拨单号', dataIndex: 'allocateNo', width: '13%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '调拨开单日期', dataIndex: 'allocateDate', width: '13%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '客户名称', dataIndex: 'targetName', width: '20%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '调拨数量', dataIndex: 'totalQty', width: '12%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '客户类型', dataIndex: 'targetTypeDictValue', width: '11%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '费用类型', dataIndex: 'costTypeName', width: '11%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '调拨类型', dataIndex: 'allocateSortName', width: '15%', align: 'center', scopedSlots: { customRender: 'allocateType' } },
+        { title: '费用归属品牌', dataIndex: 'productBrandName', width: '13%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '费用归属品类', dataIndex: 'productTypeName1', width: '15%', align: 'center', scopedSlots: { customRender: 'productType' } },
+        { title: '调拨数量', dataIndex: 'totalQty', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
         // { title: '成本价', dataIndex: 'totalCost', width: '12%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         // { title: '毛利', dataIndex: 'totalGrossProfit', width: '12%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '操作员', dataIndex: 'creatorName', width: '14%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true }
       ]
+      if (this.$hasPermissions('M_allocationOrderTotalList_salesPrice')) { //  成本价权限
+        arr.push({ title: '售价', dataIndex: 'totalPrice', width: '10%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+      }
       if (this.$hasPermissions('M_allocationOrderTotalList_costPrice')) { //  成本价权限
-        arr.splice(4, 0, { title: '成本价', dataIndex: 'totalCost', width: '12%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
-        arr.splice(5, 0, { title: '毛利', dataIndex: 'totalGrossProfit', width: '12%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+        arr.push({ title: '成本价', dataIndex: 'totalCost', width: '10%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+        arr.push({ title: '毛利', dataIndex: 'totalGrossProfit', width: '10%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
       }
+      arr.push({ title: '操作员', dataIndex: 'creatorName', width: '11%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true })
       return arr
     }
   },
+  watch: {
+    advanced (newValue, oldValue) {
+      const _this = this
+      this.$nextTick(() => { // 页面渲染完成后的回调
+        _this.setTableH()
+      })
+    },
+    '$store.state.app.winHeight' (newValue, oldValue) { //  窗口变更时,需同时更改表格高度
+      this.setTableH()
+    }
+  },
   methods: {
     // 费用/调拨类型 change
     changeAllocatype (val, opts) {
@@ -218,6 +286,19 @@ export default {
         }
       })
     },
+    //  导出
+    handleExport () {
+      const _this = this
+      const params = this.queryParam
+      _this.spinning = true
+      _this.exportLoading = true
+      _this.$store.state.app.curActionPermission = 'B_allocationOrderTotalList_export'
+      exportExcel(allocateReportExportExcel, params, '调拨开单报表', function () {
+        _this.spinning = false
+        _this.exportLoading = false
+        _this.$store.state.app.curActionPermission = ''
+      })
+    },
     //  查询
     handleSearch () {
       const _this = this
@@ -245,6 +326,8 @@ export default {
       this.queryParam.allocateCategory = undefined
       this.queryParam.allocateTypeSn = undefined
       this.queryParam.bizUserSn = undefined
+      this.queryParam.targetName = undefined
+      this.queryParam.targetType = undefined
       this.allocateTypeVal = []
       this.$refs.ruleForm.resetFields()
       this.totalData = null

+ 5 - 1
src/views/reportData/productRebateReport/dealerList.vue

@@ -111,6 +111,8 @@
               <a-col flex="10%">总开单金额:{{ (totalData && (totalData.totalAmount || totalData.totalAmount==0)) ? toThousands(totalData.totalAmount) : '--' }}</a-col>
               <a-col flex="10%">总实售金额:{{ (totalData && (totalData.totalRealAmount || totalData.totalRealAmount==0)) ? toThousands(totalData.totalRealAmount) : '--' }}</a-col>
               <a-col flex="10%">总差价金额:{{ (totalData && (totalData.directRebateAmount || totalData.directRebateAmount==0)) ? toThousands(totalData.directRebateAmount) : '--' }}</a-col>
+              <a-col flex="10%">原总开单金额:{{ (totalData && (totalData.totalAmountOrig || totalData.totalAmountOrig==0)) ? toThousands(totalData.totalAmountOrig) : '--' }}</a-col>
+              <a-col flex="10%">原总实售金额:{{ (totalData && (totalData.totalRealAmountOrig || totalData.totalRealAmountOrig==0)) ? toThousands(totalData.totalRealAmountOrig) : '--' }}</a-col>
             </a-row>
           </template>
         </s-table>
@@ -225,7 +227,9 @@ export default {
         { title: '总实售金额', dataIndex: 'totalRealAmount', width: 90, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
         { title: '总差价金额', dataIndex: 'directRebateAmount', width: 100, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
         { title: '差价金额', dataIndex: 'rebateAmount', width: 80, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
-        { title: '单据类型', dataIndex: 'bizTypeDictValue', width: 100, align: 'center', customRender: function (text) { return text || '--' } }
+        { title: '单据类型', dataIndex: 'bizTypeDictValue', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '原总开单金额', dataIndex: 'totalAmountOrig', width: 80, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        { title: '原总实售金额', dataIndex: 'totalRealAmountOrig', width: 80, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } }
       ]
       return arr
     }

+ 8 - 1
src/views/reportData/productRebateReport/detailList.vue

@@ -105,6 +105,8 @@
               <a-col flex="10%" >总开单金额:{{ (totalData && (totalData.totalAmount || totalData.totalAmount==0)) ? toThousands(totalData.totalAmount) : '--' }}</a-col>
               <a-col flex="10%" >总实售金额:{{ (totalData && (totalData.totalRealAmount || totalData.totalRealAmount==0)) ? toThousands(totalData.totalRealAmount) : '--' }}</a-col>
               <a-col flex="10%" >总差价金额:{{ (totalData && (totalData.rebateAmount || totalData.rebateAmount==0)) ? toThousands(totalData.rebateAmount) : '--' }}</a-col>
+              <a-col flex="10%">原总开单金额:{{ (totalData && (totalData.totalAmountOrig || totalData.totalAmountOrig==0)) ? toThousands(totalData.totalAmountOrig) : '--' }}</a-col>
+              <a-col flex="10%">原总实售金额:{{ (totalData && (totalData.totalRealAmountOrig || totalData.totalRealAmountOrig==0)) ? toThousands(totalData.totalRealAmountOrig) : '--' }}</a-col>
             </a-row>
           </template>
         </s-table>
@@ -211,8 +213,13 @@ export default {
         { title: '总开单金额', dataIndex: 'totalAmount', width: '80px', align: 'right', customRender: function (text, record) { return ((text || text == 0) && _this.getNormalVal(record.rebateParentTypeDictValue) ? _this.toThousands(text) : '--') } },
         { title: '总实售金额', dataIndex: 'totalRealAmount', width: '80px', align: 'right', customRender: function (text, record) { return ((text || text == 0) && _this.getNormalVal(record.rebateParentTypeDictValue) ? _this.toThousands(text) : '--') } },
         { title: '总差价金额', dataIndex: 'totalRebateAmount', width: '80px', align: 'right', customRender: function (text, record) { return ((text || text == 0) && _this.getNormalVal(record.rebateParentTypeDictValue) ? _this.toThousands(text) : '--') } },
-        { title: '差价金额', dataIndex: 'rebateAmount', width: '80px', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } }
+        { title: '差价金额', dataIndex: 'rebateAmount', width: '80px', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        { title: '原总开单金额', dataIndex: 'totalAmountOrig', width: '90px', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        { title: '原总实售金额', dataIndex: 'totalRealAmountOrig', width: '90px', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } }
       ]
+      if(_this.$hasPermissions('M_productRebateReportList_costPrice')){
+        arr.push({ title: '实际总成本', dataIndex: 'totalCost', width: '90px', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+      }
       return arr
     }
   },

+ 5 - 1
src/views/reportData/productRebateReport/list.vue

@@ -84,6 +84,8 @@
               <a-col flex="10%">直接差价金额:{{ (totalData && (totalData.directRebate || totalData.directRebate==0)) ? toThousands(totalData.directRebate) : '--' }}</a-col>
               <a-col flex="10%">间接差价金额:{{ (totalData && (totalData.indirectRebate || totalData.indirectRebate==0)) ? toThousands(totalData.indirectRebate) : '--' }}</a-col>
               <a-col flex="10%">总实售价金额:{{ (totalData && (totalData.totalRealAmount || totalData.totalRealAmount==0)) ? toThousands(totalData.totalRealAmount) : '--' }}</a-col>
+              <a-col flex="10%">原总开单金额:{{ (totalData && (totalData.totalBillingAmount || totalData.totalBillingAmount==0)) ? toThousands(totalData.totalBillingAmount) : '--' }}</a-col>
+              <a-col flex="10%">原总实售金额:{{ (totalData && (totalData.totalRealSaleAmount || totalData.totalRealSaleAmount==0)) ? toThousands(totalData.totalRealSaleAmount) : '--' }}</a-col>
             </a-row>
           </template>
         </s-table>
@@ -177,7 +179,9 @@ export default {
         { title: '总开单金额', dataIndex: 'totalAmount', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
         { title: '直接差价金额', dataIndex: 'directRebate', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
         { title: '间接差价金额', dataIndex: 'indirectRebate', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
-        { title: '总实售价金额', dataIndex: 'totalRealAmount', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } }
+        { title: '总实售价金额', dataIndex: 'totalRealAmount', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        { title: '原总开单金额', dataIndex: 'totalBillingAmount', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        { title: '原总实售金额', dataIndex: 'totalRealSaleAmount', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } }
       ]
       if (this.showCols.includes('directRebateAmountInfo')) {
         arr.splice(6, 0, { title: '直接上级差价', dataIndex: 'directSuperiorsAmount', width: 90, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })

+ 2 - 0
src/views/reportData/promotionSalesRealTimeReport/index.vue

@@ -168,6 +168,7 @@
                       <a-col span="4">采购额超出:{{ (totalData && (totalData.outPromoGiftsAmount || totalData.outPromoGiftsAmount==0)) ? toThousands(totalData.outPromoGiftsAmount) : '--' }}</a-col>
                       <a-col span="4">转采购额数量:{{ (totalData && (totalData.convertPromoGiftsQty || totalData.convertPromoGiftsQty==0)) ? totalData.convertPromoGiftsQty : '--' }}</a-col>
                       <a-col span="4">转采购额金额:{{ (totalData && (totalData.convertPromoGiftsAmount || totalData.convertPromoGiftsAmount==0)) ? toThousands(totalData.convertPromoGiftsAmount) : '--' }}</a-col>
+                      <a-col span="4">促销金额:{{ (totalData && (totalData.promoAmount || totalData.promoAmount==0)) ? toThousands(totalData.promoAmount) : '--' }}</a-col>
                     </a-row>
                   </a-col>
                 </a-row>
@@ -271,6 +272,7 @@ export default {
         { title: <a-tooltip placement='top' title='即促销产品转采购额金额,促销产品转采购额数量*销售价'>转采购额金额&nbsp;<a-icon type="question-circle" /></a-tooltip>, dataIndex: 'convertPromoGiftsAmount', width: '100px', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
         { title: '采购额结余', dataIndex: 'surplusPromoGiftsAmount', width: '100px', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
         { title: '采购额超出', dataIndex: 'outPromoGiftsAmount', width: '100px', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        { title: '促销金额', dataIndex: 'promoAmount', width: '90px', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
         { title: '促销品费用归属品牌', dataIndex: 'promoProductBrandName', width: '120px', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '促销品费用归属分类', dataIndex: 'promoProductTypeName', width: '120px', align: 'center', customRender: function (text) { return text || '--' } }
       ],

+ 334 - 0
src/views/reportData/regionTypeBusinessReport/list.vue

@@ -0,0 +1,334 @@
+<template>
+  <div>
+    <a-card size="small" :bordered="false" class="regionTypeBusinessReportList-wrap searchBoxNormal">
+      <!-- 搜索条件 -->
+      <div class="table-page-search-wrapper" ref="tableSearch">
+        <a-form-model
+          id="regionTypeBusinessReportList-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 label="查询月份" prop="queryDate">
+                <a-month-picker
+                  id="regionTypeBusinessReportList-monthBox"
+                  class="monthBox"
+                  :disabled-date="disabledDate"
+                  v-model="monthVal"
+                  placeholder="请选择月份"
+                  @change="onChangeMonth" />
+              </a-form-model-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-model-item label="客户名称">
+                <dealerSubareaScopeList ref="dealerSubareaScopeList" id="regionTypeBusinessReportList-dealerName" @change="custChange" />
+              </a-form-model-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-model-item label="地区">
+                <Area id="regionTypeBusinessReportList-areaList" v-model="queryParam.provinceSn" @change="areaChange" placeholder="请选择省份"></Area>
+              </a-form-model-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-button
+                type="primary"
+                @click="handleSearch"
+                :disabled="disabled"
+                id="regionTypeBusinessReportList-refresh">查询</a-button>
+              <a-button
+                style="margin-left: 8px"
+                @click="resetSearchForm"
+                :disabled="disabled"
+                id="regionTypeBusinessReportList-reset">重置</a-button>
+              <a-button
+                style="margin-left: 10px"
+                type="primary"
+                class="button-warning"
+                @click="handleExport"
+                :disabled="disabled"
+                :loading="exportLoading"
+                id="regionTypeBusinessReportList-export">导出</a-button>
+            </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"
+          ref="table"
+          size="small"
+          :rowKey="(record) => record.no"
+          rowKeyName="no"
+          :rowClassName="(record, index) => record.category.indexOf('合计') >= 0 ? 'garyBg-row':''"
+          :style="{ height: tableHeight+'px' }"
+          :columns="columns"
+          :data="loadData"
+          :scroll="{ y: tableHeight}"
+          :defaultLoadData="false"
+          :showPagination="false"
+          bordered>
+        </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 Area from '@/views/common/area.js'
+import dealerSubareaScopeList from '@/views/common/dealerSubareaScopeList.vue'
+import getDate from '@/libs/getDate'
+// 接口
+import { manageAnalysisReportQuery, manageAnalysisReportExport } from '@/api/reportData'
+const strongRow = []
+const redRow = []
+const renderContent = (value, row, index) => {
+  const ret = value || value == 0 ? value : ''
+  const retVal = ret == 0 ? '0.00' : ret
+  const isStrong = strongRow.indexOf(index) >= 0
+  const isRed = redRow.indexOf(index) >= 0
+  if (isStrong || isRed) {
+    return {
+      children: retVal == '--' ? '' : retVal,
+      attrs: {
+        style: 'font-weight: bold;color:red;font-size:14px;'
+      }
+    }
+  }
+  return retVal == '--' ? '' : retVal
+}
+export default {
+  name: 'RegionTypeBusinessReportList',
+  mixins: [commonMixin],
+  components: { STable, VSelect, Area, dealerSubareaScopeList },
+  data () {
+    return {
+      spinning: false,
+      disabled: false, //  查询、重置按钮是否可操作
+      advanced: true, // 高级搜索 展开/关闭
+      tableHeight: 0, // 表格高度
+      exportLoading: false, // 导出按钮加载状态
+      monthVal: moment().format('YYYY-MM'), // 初始化月份值
+      //  查询条件
+      queryParam: {
+        queryDate: moment().format('YYYYMM'), // 选择月份
+        beginDate: getDate.getCurrLastMonthDays().starttime, // 开始日期
+        endDate: getDate.getCurrLastMonthDays().endtime, // 结束日期
+        dealerName: undefined, // 客户名称
+        provinceName: undefined, // 省
+        provinceSn: undefined
+      },
+      rules: {
+        'queryDate': [{ required: true, message: '请选择查询月份', trigger: 'change' }]
+      },
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.disabled = true
+        this.spinning = true
+        const { beginDate, endDate, dealerName, provinceName, provinceSn } = this.queryParam
+        const params = Object.assign(parameter, { beginDate, endDate, dealerName, provinceName, provinceSn })
+        // 获取列表数据
+        return manageAnalysisReportQuery(params).then(res => {
+          let data
+          const ret = []
+          if (res.status == 200) {
+            data = res.data
+            // 计算表格序号
+            for (var i = 0; i < data.length; i++) {
+              data[i].no = i + 1
+              const isqml = data[i].category === '全品类'
+              data[i].grossMargin = (data[i].grossMargin || data[i].grossMargin == 0) && data[i].amount ? data[i].grossMargin.toFixed(2) + '%' : '--'
+              data[i].promoRatio = (data[i].promoRatio || data[i].promoRatio == 0) && data[i].amount ? data[i].promoRatio.toFixed(2) + '%' : '--'
+              data[i].cost = data[i].cost ? data[i].cost.toFixed(2) : (isqml ? '--' : '0.00')
+              data[i].amount = data[i].amount ? data[i].amount.toFixed(2) : (isqml ? '--' : '0.00')
+              data[i].gross = data[i].gross ? data[i].gross.toFixed(2) : (isqml ? '--' : '0.00')
+              data[i].promo = data[i].promo || data[i].promo == 0 ? data[i].promo.toFixed(2) : (isqml ? '--' : '0.00')
+              data[i].removePromoGross = data[i].removePromoGross ? data[i].removePromoGross.toFixed(2) : (isqml ? '--' : '0.00')
+
+              if (data[i].category.indexOf('合计') >= 0) {
+                strongRow.push(i)
+              }
+              if (data[i].category == '全品类(含NGK)' || data[i].category == '箭牌喇叭' || data[i].category == '轮胎') {
+                redRow.push(i)
+              }
+              ret.push(data[i])
+            }
+          }
+          this.disabled = false
+          this.spinning = false
+          return { list: ret, count: 0 }
+        })
+      }
+    }
+  },
+  watch: {
+    advanced (newValue, oldValue) {
+      const _this = this
+      this.$nextTick(() => { // 页面渲染完成后的回调
+        _this.setTableH()
+      })
+    },
+    '$store.state.app.winHeight' (newValue, oldValue) { //  窗口变更时,需同时更改表格高度
+      this.setTableH()
+    }
+  },
+  computed: {
+    columns () {
+      const arr = [
+        { title: '类别',
+          dataIndex: 'category',
+          width: '15%',
+          align: 'center',
+          customRender: (text, row, index) => {
+            const isStrong = row.category.indexOf('合计') >= 0
+            const isRed = row.category == '全品类(含NGK)' || row.category == '箭牌喇叭' || row.category == '轮胎'
+            if (isStrong || isRed) {
+              return <a-button size="small" type="link" class="button-error" style="font-weight:bold;font-size:14px;">{text}</a-button>
+            }
+            return <a-button size="small" type="link" class="button-default">{text}</a-button>
+          }
+        },
+        { title: '成本', dataIndex: 'cost', width: '10%', align: 'center', customRender: renderContent },
+        { title: '销售额', dataIndex: 'amount', width: '10%', align: 'center', customRender: renderContent },
+        { title: '毛利', dataIndex: 'gross', width: '10%', align: 'center', customRender: renderContent },
+        { title: '毛利率', dataIndex: 'grossMargin', width: '10%', align: 'center', customRender: renderContent },
+        { title: '促销费用', dataIndex: 'promo', width: '10%', align: 'center', customRender: renderContent },
+        { title: '减促销费用的毛利', dataIndex: 'removePromoGross', width: '10%', align: 'center', customRender: renderContent },
+        { title: '促销费用占比', dataIndex: 'promoRatio', width: '10%', align: 'center', customRender: renderContent }
+      ]
+      return arr
+    }
+  },
+  methods: {
+    // 选择月份  禁用选择当月以后日期
+    disabledDate (current) {
+      return current && current >= moment().endOf('day')
+    },
+    // 选择月份 change
+    onChangeMonth (date, dateString) {
+      this.monthVal = dateString
+      if (date && dateString != '') {
+        this.queryParam.queryDate = dateString.replace('-', '')
+        const { beginDate, endDate } = getDate.getBeDateByMonth(dateString)
+        this.queryParam.beginDate = beginDate
+        this.queryParam.endDate = endDate
+      } else {
+        this.queryParam.queryDate = void 0
+        this.queryParam.beginDate = undefined
+        this.queryParam.endDate = undefined
+      }
+    },
+    // 查询
+    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.dealerName = val.name
+    },
+    // 地区
+    areaChange (val, item) {
+      this.queryParam.provinceName = item.name
+      this.queryParam.provinceSn = val
+    },
+    //  重置
+    resetSearchForm () {
+      this.monthVal = moment().format('YYYY-MM')
+      this.queryParam.queryDate = moment().format('YYYYMM')
+      this.queryParam.provinceName = undefined
+      this.queryParam.provinceSn = undefined
+      this.queryParam.dealerName = undefined
+      this.queryParam.beginDate = getDate.getCurrLastMonthDays().starttime
+      this.queryParam.endDate = getDate.getCurrLastMonthDays().endtime
+      if (this.$refs.dealerSubareaScopeList) {
+        this.$refs.dealerSubareaScopeList.resetForm()
+      }
+      this.$refs.ruleForm.resetFields()
+      this.handleSearch()
+    },
+    //  导出  必填判断
+    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.exportLoading = true
+      _this.spinning = true
+      hdExportExcel(manageAnalysisReportExport, params, '各品类经营分析表-' + this.monthVal + '-', function () {
+        _this.exportLoading = false
+        _this.spinning = false
+      })
+    },
+    // 初始化
+    pageInit () {
+      this.$nextTick(() => { // 页面渲染完成后的回调
+        this.setTableH()
+      })
+    },
+    // 计算表格高度
+    setTableH () {
+      const tableSearchH = this.$refs.tableSearch.offsetHeight
+      this.tableHeight = window.innerHeight - tableSearchH - 160
+    }
+  },
+  mounted () {
+    if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
+      this.pageInit()
+    }
+  },
+  activated () {
+    // 如果是新页签打开,则重置当前页面
+    if (this.$store.state.app.isNewTab) {
+      this.pageInit()
+    }
+  }
+}
+</script>
+<style lang="less">
+  .sTable{
+    .garyBg-row{
+      td{
+        background: #f6f6f6!important;
+      }
+    }
+  }
+  .regionTypeBusinessReportList-wrap{
+    .monthBox{
+      width: 100%;
+      /deep/.ant-calendar-picker-icon{
+        display:none !important;
+      }
+      /deep/.ant-calendar-picker input{
+        text-align:center;
+      }
+    }
+  }
+</style>

+ 61 - 12
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"
@@ -162,7 +165,7 @@
           :data="loadData"
           :pageSize="30"
           :style="{ height: tableHeight+84.5+'px' }"
-          :scroll="{ x: 2480 , y: tableHeight - 30 }"
+          :scroll="{ x: 2480 , y: tableHeight - 50 }"
           :defaultLoadData="false"
           bordered>
           <!-- 产品编码 -->
@@ -175,17 +178,21 @@
           <template slot="footer">
             <a-row :gutter="15">
               <a-col :md="4" :sm="24">下推数量:{{ (totalData && (totalData.qty || totalData.qty==0)) ? totalData.qty : '--' }}</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')">开单金额:{{ (totalData && (totalData.totalAmount || totalData.totalAmount==0)) ? toThousands(totalData.totalAmount) : '--' }}</a-col>
               <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.realGrossMargin || totalData.realGrossMargin==0)) ? (totalData.realGrossMargin*100).toFixed(2)+'%' : '--' }}</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" 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_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" 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>
-          </template>
-        </s-table>
+            <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" 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>
       <!-- 导出提示框 -->
       <reportModal :visible="showExport" @close="showExport=false"></reportModal>
@@ -256,6 +263,7 @@ export default {
         promotionFlag: undefined, // 产品类型
         bizUserSn: undefined // 客服
       },
+      isAveragePrice: false, // 平均公斤单价
       productType: [], // 产品分类
       totalData: null, // 统计数据
       rules: {
@@ -283,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: {
@@ -319,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')) { //  市级价权限
@@ -495,3 +534,13 @@ export default {
   }
 }
 </script>
+<style lang="less" scoped>
+  .footerBox{
+    /deep/ label{
+      display: inline-block;
+      width: 135px;
+      text-align: right;
+    }
+
+  }
+</style>

+ 5 - 3
src/views/reportData/tireSubsidyReport/incrementalSubsidyList.vue

@@ -203,6 +203,7 @@ export default {
         { title: '总部退货数量', dataIndex: 'returnQty', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '总部合计数量', dataIndex: 'headTotalQty', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '转单订货数量', dataIndex: 'transferQty', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '轮胎省仓销售数量', dataIndex: 'qplsSalesQty', width: '11%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '合计订货数量', dataIndex: 'totalQty', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '季度目标', dataIndex: 'subsidyTarget', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '季度增量补贴', dataIndex: 'subsidyValue', width: '10%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
@@ -305,9 +306,10 @@ export default {
       const _this = this
       _this.exportLoading = true
       _this.spinning = true
-      const year = this.queryParam.queryDate.substr(0, 4)
-      const quarter = this.queryParam.queryDate.substr(5, 1)
-      const params = Object.assign(_this.queryParam, { bizYear: year, bizQuarter: quarter })
+      const dateStr = this.queryParam.queryDate
+      const year = dateStr.substr(0, 4)
+      const quarter = dateStr.substr(5, 1)
+      const params = Object.assign(this.queryParam, { bizYear: year, bizQuarter: quarter == 'u' ? undefined : quarter })
       hdExportExcel(subsidyStepExport, params, '增量补贴报表(' + this.queryParam.queryDate + '季度)-', function () {
         _this.exportLoading = false
         _this.spinning = false

+ 2 - 1
src/views/reportData/tireSubsidyReport/incrementalSubsidyYearList.vue

@@ -224,12 +224,13 @@ export default {
         { title: '总部退货数量', dataIndex: 'returnQty', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '总部合计数量', dataIndex: 'headTotalQty', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '转单订货数量', dataIndex: 'transferQty', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '轮胎省仓销售数量', dataIndex: 'qplsSalesQty', width: '11%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '合计订货数量', dataIndex: 'totalQty', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '年度目标', dataIndex: 'subsidyTarget', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '年度增量补贴', dataIndex: 'subsidyValue', width: '10%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
         { title: '增量补贴金额', dataIndex: 'subsidyAmount', width: '10%', align: 'right', scopedSlots: { customRender: 'subsidyAmount' } },
         { title: '增量已补金额', dataIndex: 'settleAmountFinish', width: '10%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
-        { title: '剩余增量补贴金额', dataIndex: 'settleAmountWait', width: '10%', align: 'right', scopedSlots: { customRender: 'settleAmountWait' } }
+        { title: '剩余增量补贴金额', dataIndex: 'settleAmountWait', width: '11%', align: 'right', scopedSlots: { customRender: 'settleAmountWait' } }
       ]
       return arr
     }

+ 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

@@ -80,6 +80,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>
         <!-- 列表 -->
@@ -210,12 +213,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) : '--') })

+ 9 - 0
src/views/salesManagement/pushOrderManagement/list.vue

@@ -184,12 +184,21 @@
         <!-- 查看销售单或备货单详情 -->
         <commonModal
           modalTit="销售单详情"
+<<<<<<< HEAD
           bodyPadding="0"
           width="70%"
           :showFooter="false"
           :openModal="showDetailModal"
           @cancel="closeDetailModal">
           <salesDetail v-if="showDetailModal" ref="salesDetail" :bizSn="bizSn" @close="closeDetailModal"></salesDetail>
+=======
+          bodyPadding="10px"
+          width="75%"
+          :showFooter="false"
+          :openModal="showDetailModal"
+          @cancel="closeDetailModal">
+          <salesDetail v-if="showDetailModal" pageTypeAuth="B_salesDetail" ref="salesDetail" :bizSn="bizSn"></salesDetail>
+>>>>>>> 748bf4e7c84780c768269fb28c2c81e9b76313df
         </commonModal>
 
         <!-- 发货说明 -->

+ 28 - 6
src/views/salesManagement/salesQueryNew/comps/detailProductList.vue

@@ -74,6 +74,11 @@ export default {
       type: Boolean,
       default: false
     },
+    // 是否显示平均公斤单价
+    showAveragePrice: {
+      type: Boolean,
+      default: false
+    },
     // 权限码
     authCode: {
       type: String,
@@ -182,10 +187,10 @@ export default {
       }
       // 列定义
       let arr = [
-        { title: '序号', field: 'no', key: 'a', width: 50, align: 'center', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return row[column.field] || '--' } },
-        { 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: '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: 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] || '--' } }
       ]
       // 如果是活动产品列表
@@ -226,7 +231,7 @@ export default {
         arr.push({ title: '成本价', field: 'showCost', width: 80, key: 'f', align: 'right', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return priceFormat(row[column.field]) } })
       }
       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]) } }
       ])
 
@@ -260,6 +265,17 @@ export default {
       ])
 
       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
     },
     // 是否有可转采购额
@@ -401,7 +417,7 @@ export default {
 }
 </script>
 
-  <style lang="less">
+  <style lang="less" scoped>
     .empty-data{
         color: #999;
         text-align: center;
@@ -429,4 +445,10 @@ export default {
     .ve-table .ve-table-container .ve-table-content-wrapper table.ve-table-content tbody.ve-table-body tr.ve-table-expand-tr td.table-body-cell-no{
       padding: 0;
     }
+    .ve-table .ve-table-container .ve-table-content-wrapper{
+      border-bottom: 1px solid #ddd;
+    }
+    /deep/.ve-table-header-th{
+      text-align: center !important;
+    }
   </style>

+ 893 - 0
src/views/salesManagement/salesQueryNew/comps/productList.vue

@@ -0,0 +1,893 @@
+<template>
+  <div>
+    <div class="table-page-search-wrapper" v-show="showDescBox">
+      <a-row v-if="descDetail" type="flex" justify="start">
+        <a-col span="6" style="padding: 6px;">
+          <span>促销类型:</span>
+          {{ descDetail.promotionRuleTypeDictValue||'--' }}
+        </a-col>
+        <a-col span="18" style="padding: 6px;">
+          <div style="display: flex;">
+            <div style="display: flex;">
+              <span>促销门槛:</span>
+              <div v-if="descDetail.gateFlag === '1'">
+                {{ descDetail.gateInfo }}
+              </div>
+              <span v-else>无</span>
+            </div>
+            <div style="display: flex;">
+              <div v-if="descDetail.promotionRuleType!='PROMO_PROD'&&descDetail.promotionRuleType!='BUY_PROD_GIVE_MONEY'">
+                <span style="margin-left: 50px;">限制正价产品款数:</span>{{ descDetail.restrictCategory||'无' }}
+              </div>
+              <div>
+                <span style="margin-left: 50px;">订单起订金额(元):</span>{{ descDetail.minOrderAmount||'无' }}
+                <span style="margin-left: 50px;">活动经费上限(元):</span>{{ descDetail.upperLimitAmount||'无' }}
+              </div>
+            </div>
+          </div>
+        </a-col>
+        <a-col span="24" style="padding: 6px;">
+          <div style="display: flex;">
+            <span>促销规则:</span>
+            <div class="ruleInfo" v-html="descDetail.ruleInfo"></div>
+          </div>
+        </a-col>
+      </a-row>
+    </div>
+    <!-- 筛选条件 -->
+    <div class="table-page-search-wrapper" style="margin:0" v-show="showSearchBox">
+      <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
+        <a-row :gutter="15">
+          <a-col :md="4" :sm="24">
+            <a-form-item label="出库仓库" prop="warehouseSn">
+              <chooseWarehouse :id="'salesEdit-warehouseSn-'+id" ref="warehouse" v-model="queryParam.warehouseSn" @load="warehouseLoad"></chooseWarehouse>
+            </a-form-item>
+          </a-col>
+          <a-col :md="4" :sm="24">
+            <a-form-item label="产品编码" prop="productCode">
+              <a-input :id="'salesEdit-productCode-'+id" v-model.trim="queryParam.productCode" placeholder="请输入产品编码" allowClear />
+            </a-form-item>
+          </a-col>
+          <a-col :md="4" :sm="24">
+            <a-form-item label="产品名称" prop="productName">
+              <a-input :id="'salesEdit-productName-'+id" v-model.trim="queryParam.productName" placeholder="请输入产品名称" allowClear />
+            </a-form-item>
+          </a-col>
+          <a-col :md="4" :sm="24">
+            <a-form-item label="品牌">
+              <ProductBrand :id="'salesEdit-productBrandSn-'+id" v-model="queryParam.productBrandSn"></ProductBrand>
+            </a-form-item>
+          </a-col>
+          <a-col :md="4" :sm="24">
+            <a-form-item label="产品分类">
+              <productTypeAll :id="'salesEdit-productType-'+id" placeholder="请选择产品分类" @change="changeProductType" v-model="productType"></productTypeAll>
+            </a-form-item>
+          </a-col>
+          <a-col :md="4" :sm="24" style="margin-bottom: 10px;">
+            <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" :id="'salesEdit-refresh-'+id">查询</a-button>
+            <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" :id="'salesEdit-reset-'+id">重置</a-button>
+          </a-col>
+        </a-row>
+      </a-form>
+    </div>
+
+    <div class="table-page-search-wrapper">
+      <a-row :gutter="15" type="flex" justify="space-between" align="middle">
+        <a-col :md="8" :sm="24" style="text-align:left;">
+          <span v-if="selectTotal" style="margin-right:5px;">已选{{ selectTotal }}项</span>
+        </a-col>
+        <a-col :md="12" :sm="24" style="text-align:right;">
+          <a-button
+            :id="'salesEdit-searchBox-'+id"
+            type="link"
+            class="button-info"
+            @click="showSearchBox=!showSearchBox" ><a-icon :type="showSearchBox?'close':'search'"/> 筛选</a-button>
+          <!-- // 操作按钮 -->
+          <!-- <a-button type="link" class="button-info" @click="searchThreeStock" id="salesEdit-updateStock"><a-icon type="redo"/>第三方库存</a-button> -->
+          <a-dropdown>
+            <a-menu slot="overlay" @click="handleMenuClick" :id="'salesEdit-menu-'+id">
+              <a-menu-item key="3" :disabled="disablePromo" :id="'salesEdit-menu-3-'+id">
+                全部仓库设置
+              </a-menu-item>
+              <a-menu-item key="0" :disabled="disablePromo" :id="'salesEdit-menu-0-'+id">
+                部分仓库设置
+              </a-menu-item>
+              <a-menu-divider />
+              <a-menu-item key="1" :id="'salesEdit-menu-1-'+id">
+                删除已选项
+              </a-menu-item>
+              <a-menu-item key="2" :id="'salesEdit-menu-2-'+id">
+                全部删除
+              </a-menu-item>
+              <a-menu-divider />
+              <a-menu-item key="4" :disabled="disablePromo" :id="'salesEdit-menu-4-'+id">
+                批量取消促销
+              </a-menu-item>
+            </a-menu>
+            <a-button
+              :id="'salesEdit-plaction-'+id"
+              type="link"
+              class="button-info"
+            > 批量操作 <a-icon type="down" /> </a-button>
+          </a-dropdown>
+          <!-- 导入操作 -->
+          <a-dropdown :disabled="disablePromo">
+            <a-menu slot="overlay" @click="handleImportClick" :id="'salesEdit-menu-import-'+id">
+              <a-menu-item :id="'salesEdit-menu-import-gate-'+id" key="GATE" v-if="promo&&promo.promotionRule&&promo.promotionRule.gateFlag==='1'">
+                导入门槛产品
+              </a-menu-item>
+              <a-menu-item :id="'salesEdit-menu-import-regular-'+id" key="REGULAR" v-if="promo&&promo.promotionRule&&promo.promotionRule.promotionRuleType!='PROMO_PROD'">
+                导入正价产品
+              </a-menu-item>
+              <a-menu-item :id="'salesEdit-menu-import-gift-'+id" key="GIFT" v-if="promo&&promo.promotionRule&&(promo.promotionRule.regularPromotionSameFlag==='0'||promo.promotionRule.scopeFlag==='0'||(promo.promotionRule.promotionRuleType=='BUY_PROD_GIVE_MONEY'&&promo.promotionRule.scopeFlag==='1'))">
+                导入促销产品
+              </a-menu-item>
+              <a-menu-item :id="'salesEdit-menu-import-discount-'+id" key="DISCOUNT" v-if="promo&&promo.promotionRule&&promo.promotionRule.promotionRuleType=='PROMO_PROD'">
+                导入特价产品
+              </a-menu-item>
+            </a-menu>
+            <a-button
+              :id="'salesEdit-menu-import-plaction-'+id"
+              type="link"
+              :class="disablePromo?'button-gray':'button-info'"
+            > 导入产品 <a-icon type="down" /> </a-button>
+          </a-dropdown>
+          <a-button
+            :id="'salesEdit-menu-newProduct-'+id"
+            type="link"
+            :class="disablePromo?'button-gray':'button-info'"
+            :disabled="disablePromo"
+            @click="openCpModal"><a-icon type="plus" /> 添加产品</a-button>
+        </a-col>
+      </a-row>
+    </div>
+
+    <!-- 已选配件列表 -->
+    <s-table
+      class="sTable"
+      ref="table"
+      size="small"
+      :rowKey="(record) => record.id"
+      :columns="columns"
+      :data="loadData"
+      :row-selection="{ columnWidth: '4%', getCheckboxProps: record => ({ props: { disabled: record.promotionFlag == 'GIFT'&&!!record.salesPromoDetailParentSn } }) }"
+      @rowSelection="rowSelectionFun"
+      :defaultLoadData="false"
+      :pageSize="10"
+      bordered>
+      <!-- 产品编码 -->
+      <template slot="productCode" slot-scope="text, record">
+        <span style="padding-right: 15px;">{{ text }}</span>
+        <a-badge count="促" v-if="record.promotionFlag=='GIFT'" :number-style="{ backgroundColor: '#52c41a', zoom:'80%' }"></a-badge>
+        <!-- <a-badge count="特" v-if="record.promotionFlag=='DISCOUNT'" :number-style="{ backgroundColor: '#faad14', zoom:'80%' }"></a-badge> -->
+        <a-badge count="槛" v-if="record.promotionFlag=='GATE'" :number-style="{ backgroundColor: '#108ee9', zoom:'80%' }"></a-badge>
+        <a-badge count="缺" v-if="Number(record.stockQty||0) < Number(record.unpushedQty||0)" :number-style="{ zoom:'80%' }"></a-badge>
+      </template>
+      <!-- 产品名称 -->
+      <template slot="productName" slot-scope="text, record">
+        <div class="ellipsisCon">
+          <a-tooltip placement="rightBottom">
+            <template slot="title">
+              <span>{{ text }}</span>
+            </template>
+            <span class="ellipsisText">{{ text }}</span>
+          </a-tooltip>
+          <a-badge :number-style="{ backgroundColor: '#52c41a' }" count="活动" v-if="record.promotableFlag == 1"></a-badge>
+        </div>
+      </template>
+      <!-- 销售价 -->
+      <template slot="price" slot-scope="text, record">
+        {{ toThousands(text) }}
+        <span v-if="record.promotionFlag=='GIFT'||record.promotionFlag=='DISCOUNT'" title="原价">({{ toThousands(record.origPrice) }})</span>
+      </template>
+      <!-- 折扣 -->
+      <template slot="discountPrice" slot-scope="text, record">
+        <div v-if="record.promotionFlag=='DISCOUNT'">
+          <span v-if="record.specialType=='1'">{{ record.priceLevel=='PROVINCE'? (record.provinceDiscount*100).toFixed(2):record.priceLevel=='CITY'?(record.cityDiscount*100).toFixed(2):(record.specialDiscount*100).toFixed(2) }}%</span>
+          <span v-else>{{ ((record.price/record.origPrice)*100).toFixed(2) }}%</span>
+        </div>
+        <div v-else>--</div>
+      </template>
+      <!-- 销售数量 -->
+      <template slot="salesNums" slot-scope="text, record">
+        <a-input-number
+          :id="'salesEdit-qty-'+id+'-'+record.id"
+          v-if="!(record.promotionFlag == 'GIFT'&&record.salesPromoDetailParentSn)"
+          size="small"
+          v-model="record.qty"
+          :precision="0"
+          :min="1"
+          :max="99999999"
+          placeholder="请输入"
+          @blur="e => onCellBlur(e.target.value, record)"
+          :style="{width:'100%',color:record.qty>=record.unitQtyR?'':'red'}" />
+        <span v-else>{{ record.qty }}</span>
+      </template>
+      <!-- 当前库存 -->
+      <template slot="stockQty" slot-scope="text, record">
+        <div v-if="record.stockQty || record.stockQty==0">
+          <p style="margin: 0;" v-if="Number(record.stockQty) < Number(record.unpushedQty)">{{ record.stockQty }}(<span class="redStyle">缺{{ Number(record.unpushedQty||0) - Number(record.stockQty||0) }}</span>)</p>
+          <p style="margin: 0;" v-else>{{ record.stockQty }}</p>
+        </div>
+        <span v-else>--</span>
+      </template>
+      <!-- 出库仓库 -->
+      <template slot="warehouseBox" slot-scope="text, record">
+        <a-select
+          :id="'salesEdit-warehouse-'+id+'-'+record.id"
+          size="small"
+          style="width:100%;"
+          placeholder="请选择仓库"
+          v-model="record.warehouseSn"
+          :showSearch="true"
+          @change="handleWarehouseBox(record)"
+          mode="default"
+          :filter-option="filterOption">
+          <a-select-option v-for="item in warehouseDataList" :key="item.warehouseSn" :value="item.warehouseSn">{{ item.name }}</a-select-option>
+        </a-select>
+      </template>
+      <!-- 操作 -->
+      <template slot="action" slot-scope="text, record">
+        <div>
+          <a-button
+            :id="'salesEdit-del-'+id+'-'+record.id"
+            size="small"
+            type="link"
+            :loading="delLoading"
+            class="button-error"
+            v-if="!(record.promotionFlag == 'GIFT'&&record.salesPromoDetailParentSn)"
+            @click="handleDel(record)"
+          >删除</a-button>
+
+          <a-button
+            :id="'salesEdit-upactive-'+id+'-'+record.id"
+            size="small"
+            type="link"
+            :loading="delLoading"
+            class="button-primary"
+            v-if="record.promotionFlag != 'GIFT'"
+            @click="handleUpdateActive(record)"
+          >换促销</a-button>
+        </div>
+      </template>
+      <template slot="footer" slot-scope="currentPageData">
+        <!-- 总计 -->
+        <a-alert type="info" banner :showIcon="false">
+          <div slot="message" class="alert-bar">
+            <div class="countData" v-html="boldAmounts(countData&&countData.remarks||'')"></div>
+            <div style="display: flex;">
+              <div>
+                款数:<strong>{{ countData&&(countData.totalCategory || countData.totalCategory==0) ? countData.totalCategory : 0 }}</strong>
+              </div>
+              <div style="padding: 0 10px;">
+                数量:<strong>{{ countData&&(countData.totalQty || countData.totalQty==0) ? countData.totalQty : 0 }}</strong>
+              </div>
+              <div>
+                <div v-if="$hasPermissions('B_salesEdit_salesPrice')">总金额:<strong>{{ countData&&(countData.totalAmount || countData.totalAmount==0) ? toThousands(countData.totalAmount) : '0.00' }}</strong></div>
+                <div v-if="$hasPermissions('B_salesEdit_salesPrice')&&countData&&countData.lossAmount">优惠金额:<strong>{{ toThousands(countData.lossAmount) }}</strong></div>
+              </div>
+            </div>
+          </div>
+        </a-alert>
+      </template>
+    </s-table>
+
+    <!-- 导入产品 -->
+    <importGuideModal
+      :openModal="openGuideModal"
+      :params="{salesBillSn: $route.params.sn, salesPromoSn: promo.salesPromoSn}"
+      :promoProductClz="promoProductClz"
+      @close="closeGuideModel"
+      @ok="hanldeImportOk" />
+    <!-- 仓库设置 -->
+    <setWarehouse :title="warehouseTit" :show="openWarehouseModal" @ok="chooseWarehouseOk" @cancel="openWarehouseModal=false"></setWarehouse>
+    <!-- 换促销 -->
+    <updateActiveModal ref="updateActive" :show="openUpActiveModal" @ok="upActiveOk" @cancel="openUpActiveModal=false"></updateActiveModal>
+  </div>
+</template>
+
+<script>
+import { commonMixin } from '@/utils/mixin'
+import { STable, VSelect } from '@/components'
+import ImportGuideModal from './importGuideModal.vue'
+import setWarehouse from './setWarehouse.vue'
+import updateActiveModal from './updateActiveModal.vue'
+import chooseWarehouse from '@/views/common/chooseWarehouse'
+import ProductBrand from '@/views/common/productBrand.js'
+import productTypeAll from '@/views/common/productTypeAll.js'
+import {
+  salesDetailList,
+  salesPromoDetailCount,
+  salesDetailInsert,
+  salesDetailUpdateQty,
+  salesDetailDel,
+  salesDetailBatchDel,
+  deleteAll,
+  updateWarehouse,
+  salesBatchInsert
+} from '@/api/salesDetailNew'
+
+export default {
+  name: 'ProductList',
+  mixins: [commonMixin],
+  components: {
+    STable,
+    VSelect,
+    // 导入弹框组件
+    ImportGuideModal,
+    chooseWarehouse,
+    setWarehouse, // 设置仓库组件
+    ProductBrand, // 产品品牌组件
+    productTypeAll, // 产品分类组件
+    updateActiveModal// 更换活动弹框组件
+  },
+  props: {
+    openModal: { //  弹框显示状态
+      type: Boolean,
+      default: false
+    },
+    newLoading: Boolean,
+    // 详情数据
+    detailData: {
+      type: Object,
+      default: function () { return null }
+    },
+    // 活动规则数据
+    promo: {
+      type: Object,
+      default: function () { return null }
+    },
+    // 表格id
+    id: {
+      type: String,
+      default: ''
+    },
+    // 仓库sn
+    warehouseSn: {
+      type: String,
+      default: ''
+    },
+    // 销售单sn
+    salesBillSn: {
+      type: String,
+      default: ''
+    }
+  },
+  data () {
+    return {
+      spinning: false,
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.disabled = true
+        this.disablePromo = this.promo.disabled
+        this.queryParam.salesBillSn = this.salesBillSn || ''
+        this.getCount()
+        return salesDetailList(Object.assign(parameter, this.queryParam, {
+          showStock: true,
+          promoRuleSn: this.promo.promoRuleSn,
+          promoSn: this.promo.promoSn,
+          salesPromoSn: this.promo.salesPromoSn
+        })).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].qtyBackups = data.list[i].qty
+              data.list[i].productUnit = data.list[i].productEntity && data.list[i].productEntity.unit
+              // 按数量设置
+              if (data.list[i].unitType && data.list[i].unitType == 'SL') {
+                data.list[i].unitQtyV = data.list[i].unitQty ? (data.list[i].unitQty + data.list[i].productUnit) : '--'
+                data.list[i].unitQtyR = data.list[i].unitQty
+              } else {
+                data.list[i].unitQtyV = data.list[i].packQty && data.list[i].unitQty ? ((data.list[i].unitQty + '*' + data.list[i].packQty) + data.list[i].productUnit) : '--'
+                data.list[i].unitQtyR = data.list[i].packQty * data.list[i].unitQty
+              }
+            }
+            this.dataSource = data.list
+          }
+          this.disabled = false
+          return data
+        })
+      },
+      showSearchBox: false, // 是否显示筛选条件
+      showDescBox: false, // 收起展开规则详细
+      openWarehouseModal: false, // 打开仓库设置
+      openGuideModal: false, //  导入产品引导
+      delLoading: false, // 删除logding
+      disabled: false, //  查询、重置按钮是否可操作
+      queryParam: {
+        warehouseSn: undefined, // 仓库
+        productCode: '', // 产品编码
+        productName: '', // 产品名称
+        productBrandSn: undefined, // 产品品牌
+        productTypeSn1: '', //  产品一级分类
+        productTypeSn2: '', //  产品二级分类
+        productTypeSn3: '' //  产品三级分类
+      },
+      productType: [], // 已选产品分类
+      rowSelectionInfo: null, // 已选产品数据
+      warehouseDataList: [], // 仓库列表数据
+      openUpActiveModal: false, // 更换促销活动弹框
+      descDetail: null, // 规则详细数据
+      promoProductClz: null, // 活动产品分类
+      disablePromo: false, // 是否禁用活动
+      countData: null, // 统计信息
+      warehouseTit: '', // 仓库设置唐卡标题
+      showStockCol: false // 第三方库存是否显示
+    }
+  },
+  computed: {
+    // 已选产品数量
+    selectTotal () {
+      return this.rowSelectionInfo && this.rowSelectionInfo.selectedRowKeys.length || 0
+    },
+    // 表格列
+    columns () {
+      const arr = [
+        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
+        { title: '产品编码', dataIndex: 'productEntity.code', scopedSlots: { customRender: 'productCode' }, width: '13%', align: 'center' },
+        { title: '产品名称', dataIndex: 'productEntity.name', scopedSlots: { customRender: 'productName' }, width: this.promo.promotionRule.promotionRuleType == 'PROMO_PROD' ? '14%' : '20%', align: 'left' },
+        { title: '起订量', dataIndex: 'unitQtyV', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '销售数量', scopedSlots: { customRender: 'salesNums' }, width: '6%', align: 'center' },
+        { title: '库存', dataIndex: 'stockQty', scopedSlots: { customRender: 'stockQty' }, width: '6%', align: 'center' },
+        { title: '出库仓库', scopedSlots: { customRender: 'warehouseBox' }, width: '10%', align: 'center' },
+        { title: '单位', dataIndex: 'productEntity.unit', width: '4%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: '12%', align: 'center' }
+      ]
+      if (this.showStockCol) {
+        arr.splice(6, 0, { title: '第三方库存', dataIndex: 'thirdStockQty', width: '6%', align: 'center', customRender: text => ((text || text == 0) ? text : '--') })
+      }
+      // 售价权限
+      if (this.$hasPermissions('B_salesEdit_salesPrice')) {
+        arr.splice(3, 0, { title: '售价', dataIndex: 'price', width: '6%', align: 'right', scopedSlots: { customRender: 'price' } })
+        arr.splice(4, 0, { title: '价格级别', dataIndex: 'priceLevelDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } })
+        let idx = 0
+        // 如果是特价活动,显示折扣
+        if (this.promo.promotionRule.promotionRuleType == 'PROMO_PROD') {
+          idx = idx + 1
+          arr.splice(5, 0, { title: '折扣', dataIndex: 'discountPrice', width: '6%', align: 'right', scopedSlots: { customRender: 'discountPrice' } })
+        }
+        arr.splice((this.showStockCol ? 9 : 8) + idx, 0, { title: '售价小计', dataIndex: 'totalAmount', width: '6%', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') })
+      }
+      return arr
+    }
+  },
+  watch: {
+    salesBillSn (newValue, oldValue) {
+      this.resetSearchForm()
+    },
+    spinning (a, b) {
+      if (a) {
+        this.$emit('spinning', a)
+      }
+    }
+  },
+  methods: {
+    // 仓库下拉列表筛选
+    filterOption (input, option) {
+      return (
+        option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
+      )
+    },
+    // 仓库列表加载完成
+    warehouseLoad (sn, list) {
+      this.warehouseDataList = list
+    },
+    // 显示查询条件
+    showSearch () {
+      this.showSearchBox = !this.showSearchBox
+    },
+    // 查询第三方库存
+    searchThreeStockOk () {
+      this.showStockCol = true
+      this.resetSearchForm()
+    },
+    // 显示规则详细
+    showDesc (descDetail) {
+      this.showDescBox = !this.showDescBox
+      this.descDetail = descDetail
+      this.descDetail.gateValue = Number(this.descDetail.gateValue).toFixed(2)
+      this.descDetail.quotaAmount = Number(this.descDetail.quotaAmount).toFixed(2)
+      this.$emit('showDesc', this.showDescBox)
+    },
+    // 打开产品弹框
+    openCpModal () {
+      this.$emit('openCpModal', 1, this.id, this.countData)
+    },
+    // 表格选中项
+    rowSelectionFun (obj) {
+      this.rowSelectionInfo = obj || null
+    },
+    //  选择产品分类
+    changeProductType (val, opt) {
+      this.queryParam.productTypeSn1 = val[0] ? val[0] : ''
+      this.queryParam.productTypeSn2 = val[1] ? val[1] : ''
+      this.queryParam.productTypeSn3 = val[2] ? val[2] : ''
+    },
+    // 禁用活动
+    disableActive (flag) {
+      this.disablePromo = flag
+    },
+    // 统计
+    getCount () {
+      salesPromoDetailCount(Object.assign(this.queryParam, {
+        salesBillSn: this.salesBillSn,
+        promoRuleSn: this.promo.promoRuleSn,
+        promoSn: this.promo.promoSn,
+        salesPromoSn: this.promo.salesPromoSn
+      })).then(res => {
+        if (res.status == 200) {
+          this.countData = res.data
+        }
+      })
+    },
+    //  重置查询
+    resetSearchForm (flag) {
+      this.queryParam.productCode = ''
+      this.queryParam.productName = ''
+      this.queryParam.warehouseSn = undefined
+      this.queryParam.productBrandSn = undefined
+      this.queryParam.productTypeSn1 = ''
+      this.queryParam.productTypeSn2 = ''
+      this.queryParam.productTypeSn3 = ''
+      this.productType = []
+      this.rowSelectionInfo = null
+      this.$refs.table.clearSelected()
+      this.$refs.table.refresh(!!flag)
+    },
+    // 批量取消出现产品
+    handleBatchCancelActive () {
+      const _this = this
+      const len = _this.rowSelectionInfo && _this.rowSelectionInfo.selectedRowKeys.length
+      if (!_this.rowSelectionInfo || (len < 1)) {
+        _this.$message.warning('请先选择产品后再进行批量操作!')
+        return
+      }
+      const obj = []
+      const gift = []
+      _this.rowSelectionInfo && _this.rowSelectionInfo.selectedRows.map(item => {
+        // 赠品
+        if (item.promotionFlag == 'GIFT') {
+          gift.push(item.productCode)
+        } else {
+          obj.push(item.salesBillDetailSn)
+        }
+      })
+      if (gift.length == len) {
+        this.$info({
+          title: '提示',
+          content: '所选全部为赠品,其不能转为正常产品!',
+          centered: true,
+          okText: '知道了'
+        })
+        return
+      }
+      this.$confirm({
+        title: '提示',
+        content: '已选产品' + len + '项,' + (gift.length ? '其中包含赠品' + gift.join(',') + '(赠品不能转正常产品),确认要继续批量取消促销转为正常产品吗?' : '确认要批量取消促销转为正常产品吗?'),
+        centered: true,
+        onOk () {
+          _this.spinning = true
+          const params = {
+            salesBillDetailSnList: obj,
+            salesBillSn: _this.salesBillSn,
+            oldSalesPromoSn: _this.promo.salesPromoSn
+          }
+          // 更换活动
+          _this.$emit('upActive', _this.promo, '0', params)
+        }
+      })
+    },
+    // 删除全部产品
+    handleBatchDelAll () {
+      const _this = this
+      if (_this.dataSource.length == 0) {
+        _this.$message.warning('暂无可删除的已选产品!')
+        return
+      }
+      this.$confirm({
+        title: '提示',
+        content: '确认要删除全部已选产品吗?',
+        centered: true,
+        onOk () {
+          _this.spinning = true
+          deleteAll({ salesBillSn: _this.salesBillSn, salesPromoSn: _this.promo.salesPromoSn }).then(res => {
+            if (res.status == 200) {
+              _this.$refs.table.refresh(true)
+              _this.$emit('insterOk', 'promo')
+              _this.$message.success(res.message)
+            }
+            _this.spinning = false
+          })
+        }
+      })
+    },
+    // 批量删除已选产品
+    handleBatchDel () {
+      const _this = this
+      if (!_this.rowSelectionInfo || (_this.rowSelectionInfo && _this.rowSelectionInfo.selectedRowKeys.length < 1)) {
+        _this.$message.warning('请先选择要删除的产品后再进行批量操作!')
+        return
+      }
+      const obj = []
+      _this.rowSelectionInfo && _this.rowSelectionInfo.selectedRows.map(item => {
+        obj.push(item.salesBillDetailSn)
+      })
+      this.$confirm({
+        title: '提示',
+        content: '已选产品' + obj.length + '项,确认要批量删除吗?',
+        centered: true,
+        onOk () {
+          _this.spinning = true
+          salesDetailBatchDel({
+            salesBillSn: _this.salesBillSn,
+            salesPromoSn: _this.promo.salesPromoSn,
+            salesBillDetailSnList: obj
+          }).then(res => {
+            if (res.status == 200) {
+              _this.$refs.table.refresh(false)
+              _this.$emit('insterOk', 'promo')
+              _this.$message.success(res.message)
+            }
+            _this.spinning = false
+          })
+        }
+      })
+    },
+    // 设置单个出库仓库
+    handleWarehouseBox (row) {
+      const snArr = [row.salesBillDetailSn]
+      const ajax_data = {
+        warehouseSn: row.warehouseSn,
+        salesBillDetailSnList: snArr,
+        salesBillSn: this.salesBillSn,
+        salesPromoSn: this.promo.salesPromoSn
+      }
+      this.setWarehouseInfo(ajax_data)
+    },
+    // 选择仓库确认
+    chooseWarehouseOk (sn) {
+      const _this = this
+      const snArr = []
+      _this.rowSelectionInfo.selectedRows.forEach(item => {
+        snArr.push(item.salesBillDetailSn)
+      })
+      const ajax_data = {
+        warehouseSn: sn,
+        salesBillDetailSnList: snArr,
+        salesBillSn: _this.salesBillSn,
+        salesPromoSn: _this.promo.salesPromoSn,
+        allFlag: _this.warehouseTit == '全部仓库设置' ? true : undefined
+      }
+      _this.setWarehouseInfo(ajax_data)
+    },
+    // 更改仓库信息
+    setWarehouseInfo (data) {
+      const _this = this
+      _this.spinning = true
+      updateWarehouse(data).then(res => {
+        console.log(res)
+        if (res.status == 200) {
+          _this.$message.success(res.message)
+          _this.$emit('insterOk', 'promo')
+          _this.$refs.table.refresh(false)
+          _this.$refs.table.clearSelected()
+        }
+        _this.openWarehouseModal = false
+        _this.spinning = false
+      })
+    },
+    // 更多操作下拉菜单
+    handleMenuClick (e) {
+      const _this = this
+      if (e.key == 0) { // 部分仓库设置
+        if (!_this.rowSelectionInfo || (_this.rowSelectionInfo && _this.rowSelectionInfo.selectedRowKeys.length < 1)) {
+          _this.$message.warning('请先选择要设置的产品!')
+        } else {
+          _this.warehouseTit = '部分仓库设置'
+          _this.openWarehouseModal = true
+        }
+      } else if (e.key == 1) { // 删除已选项
+        this.handleBatchDel()
+      } else if (e.key == 3) { // 全部仓库设置
+        _this.$refs.table.clearSelected()
+        _this.warehouseTit = '全部仓库设置'
+        _this.openWarehouseModal = true
+      } else if (e.key == 4) { // 批量取消促销
+        _this.handleBatchCancelActive()
+      } else { // 全部删除
+        _this.handleBatchDelAll()
+      }
+    },
+    // 打开换促销活动列表选项
+    handleUpdateActive (record) {
+      this.$refs.updateActive.getActiveList({
+        productSn: record.productSn,
+        salesBillSn: this.salesBillSn,
+        promoRuleSn: this.promo.promoRuleSn
+      }, record)
+      this.openUpActiveModal = true
+    },
+    // 已选产品数量修改
+    onCellBlur (val, record) {
+      const _this = this
+      //  光标移出,值发生改变再调用编辑接口
+      if (val && val != record.qtyBackups) {
+        _this.spinning = true
+        salesDetailUpdateQty({
+          salesBillDetailSn: record.salesBillDetailSn,
+          qty: record.qty,
+          salesBillSn: _this.salesBillSn,
+          salesPromoSn: _this.promo.salesPromoSn
+        }).then(res => {
+          if (res.status == 200) {
+            _this.$emit('insterOk', 'promo')
+            _this.$message.success(res.message)
+          }
+          _this.$refs.table.refresh(false)
+          _this.spinning = false
+        })
+      } else {
+        record.qty = record.qtyBackups
+      }
+    },
+    // 删除产品
+    handleDel (row) {
+      const _this = this
+      this.$confirm({
+        title: '提示',
+        content: '确认要删除吗?',
+        centered: true,
+        closable: true,
+        onOk () {
+          _this.delLoading = true
+          _this.spinning = true
+          salesDetailDel({ salesBillDetailSn: row.salesBillDetailSn, salesBillSn: _this.salesBillSn, salesPromoSn: _this.promo.salesPromoSn }).then(res => {
+            if (res.status == 200) {
+              _this.$refs.table.refresh(false)
+              _this.$emit('insterOk', 'promo')
+              _this.$message.success(res.message)
+            }
+            _this.delLoading = false
+            _this.spinning = false
+          })
+        }
+      })
+    },
+    // 确定更换促销活动
+    async upActiveOk (data, editRow) {
+      this.spinning = true
+      const params = {
+        salesBillDetailSn: editRow.salesBillDetailSn,
+        salesBillSn: this.salesBillSn,
+        oldSalesPromoSn: this.promo.salesPromoSn,
+        priceLevel: editRow.priceLevel
+      }
+      // 更换活动
+      this.$emit('upActive', this.promo, data, params)
+    },
+    // 更换活动成功
+    upAcitveSuccess () {
+      this.spinning = false
+      this.$refs.updateActive.confirmLoading = false
+      this.openUpActiveModal = false
+      this.$refs.table.clearSelected()
+      this.$refs.table.refresh(false)
+    },
+    // 添加产品
+    insterProduct (row, promotionFlag, promoProductClz) {
+      // 防止多次添加产品
+      if (this.isInster) { return }
+      this.saveNewProduct(row, promotionFlag, promoProductClz)
+    },
+    // 保存添加的产品到销售列表
+    saveNewProduct (row, promotionFlag, promoProductClz) {
+      this.$message.loading('正在添加产品...', 1)
+      this.isInster = true
+      this.spinning = true
+      const params = {
+        salesPromoSn: this.promo.salesPromoSn,
+        promoRuleSn: this.promo.promoRuleSn,
+        promoSn: this.promo.promoSn,
+        promoProductClz: promoProductClz,
+        packQty: row.productPackQty,
+        productSn: row.productSn,
+        showCost: row.lastStockCost,
+        price: row.productPrice,
+        origPrice: row.origPrice,
+        promotionGiftsAmount: 0,
+        usePromotionGiftsAmount: 0,
+        qty: row.salesNums,
+        salesBillSn: this.detailData.salesBillSn,
+        salesBillNo: this.detailData.salesBillNo,
+        purchaseBillSn: this.detailData.purchaseBillSn,
+        purchaseBillNo: this.detailData.purchaseBillNo,
+        priceLevel: row.priceLevel,
+        stockSn: row.stockSn,
+        promotableFlag: row.isJoinActivityProduct || 0, // 可促销标记 有活动的传1,没活动的传0
+        promotionFlag: promotionFlag, // 促销标记 正品传0,促销品传1
+        warehouseSn: row.warehouseSn
+      }
+      salesDetailInsert(params).then(res => {
+        if (res.status == 200) {
+          this.$message.success('产品添加成功', 2.5)
+          this.resetSearchForm(true)
+          this.$emit('insterOk', 'promo')
+        }
+        this.spinning = false
+        this.isInster = false
+      }).catch(err => {
+        this.isInster = false
+        this.spinning = false
+      })
+    },
+    // 导入产品
+    handleImportClick (e) {
+      console.log(e)
+      this.openGuideModal = true
+      this.promoProductClz = e.key
+    },
+    // 关闭导入弹框
+    closeGuideModel () {
+      this.openGuideModal = false
+      this.promoProductClz = ''
+    },
+    // 批量导入产品
+    hanldeImportOk (data, salesPromoSn) {
+      const params = {
+        salesBillSn: this.detailData.salesBillSn,
+        salesBillDetailList: data
+      }
+      // 活动导入
+      if (salesPromoSn) {
+        params.salesPromoSn = salesPromoSn
+        params.promoRuleSn = this.promo.promoRuleSn
+        params.promoProductClz = this.promoProductClz
+      }
+      salesBatchInsert(params).then(res => {
+        if (res.status == 200) {
+          this.$message.success('产品导入成功', 2.5)
+          this.resetSearchForm(true)
+          this.$emit('insterOk', 'promo')
+        }
+      })
+    }
+  }
+}
+</script>
+
+<style lang="less">
+   .ant-input-number-sm input{
+    text-align: center;
+   }
+   .alert-bar{
+    display: flex;
+    justify-content: space-between;
+    align-items: center;
+    .countData{
+      span{
+        margin: 0 2px;
+        color: rgb(0, 153, 255);
+      }
+      span.cor1{
+        color: rgb(248, 132, 0);
+      }
+      b{
+        font-weight: bold;
+        span{
+          color: red;
+          font-weight: normal;
+        }
+      }
+    }
+    > div{
+      &:first-child{
+        flex-grow: 1;
+        width:70%;
+        padding-right: 100px;
+      }
+    }
+   }
+</style>

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

@@ -109,7 +109,7 @@
       :scroll="showTotal ? {y:200} :{ y: tableHeight }"
       :columns="columns"
       :data="loadData"
-      :row-selection="{ columnWidth: 30 }"
+      :row-selection="{ columnWidth: '4%' }"
       @rowSelection="rowSelectionFun"
       :defaultLoadData="false"
       :showPagination="false"

+ 9 - 3
src/views/salesManagement/salesQueryNew/detail.vue

@@ -134,6 +134,7 @@
               <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-updateStock" @change="e=>getThreeStock(e)" v-if="showStock"><span style="display: inline-block;margin-top: 1px;">第三方库存</span></a-checkbox>
               <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>
@@ -380,6 +381,7 @@ export default {
       detailData: null, //  详情数据
       nowType: null, // 打印导出类型
       isCityPrice: false, //  是否显示市级价
+      isAveragePrice: false, // 是否显示
       visibleAudit: false, // 审核弹框
       spinningAudit: false, // 审核loading
       auditText: null, // 审核备注信息
@@ -873,7 +875,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
@@ -896,13 +898,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()
         })
       }
     }
@@ -964,5 +966,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>

+ 6 - 3
src/views/salesManagement/salesQueryNew/list.vue

@@ -161,8 +161,12 @@
                 <div v-if="$hasPermissions('M_salesQueryList_salesPrice')">待审核金额:<strong>{{ totalData&&(totalData.totalWaitAuditAmount || totalData.totalWaitAuditAmount==0) ? toThousands(totalData.totalWaitAuditAmount) : '0' }}</strong>;</div>
               </div>
               <div class="tongji-bar-col">
-                <div>待下推数量:<strong>{{ totalData&&(totalData.totalUnpushedQty || totalData.totalUnpushedQty==0) ? totalData.totalUnpushedQty : '0' }}</strong>;</div>
-                <div v-if="$hasPermissions('M_salesQueryList_salesPrice')">待下推金额:<strong>{{ totalData&&(totalData.totalUnpushedAmount || totalData.totalUnpushedAmount==0) ? toThousands(totalData.totalUnpushedAmount) : '0' }}</strong>;</div>
+                <div>待下推数量(含缺货):<strong>{{ totalData&&(totalData.totalUnpushedQty || totalData.totalUnpushedQty==0) ? totalData.totalUnpushedQty : '0' }}</strong>;</div>
+                <div v-if="$hasPermissions('M_salesQueryList_salesPrice')">待下推金额(含缺货):<strong>{{ totalData&&(totalData.totalUnpushedAmount || totalData.totalUnpushedAmount==0) ? toThousands(totalData.totalUnpushedAmount) : '0' }}</strong>;</div>
+              </div>
+              <div class="tongji-bar-col">
+                <div>缺货数量:<strong>{{ totalData&&(totalData.totalOosQty || totalData.totalOosQty==0) ? totalData.totalOosQty : '0' }}</strong>;</div>
+                <div>缺货金额:<strong>{{ totalData&&(totalData.totalOosAmount || totalData.totalOosAmount==0) ? toThousands(totalData.totalOosAmount) : '0' }}</strong>;</div>
               </div>
               <div class="tongji-bar-col">
                 <div>下推数量:<strong>{{ totalData&&(totalData.totalPushedQty || totalData.totalPushedQty==0) ? totalData.totalPushedQty : '0' }}</strong>;</div>
@@ -903,7 +907,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>