소스 검색

Merge commit 'ab5cd28ae519e3ef3c6cab51f7a3e3f33238d4e5' into HEAD

gitadmin 2 달 전
부모
커밋
df53e81940

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


+ 1 - 1
public/version.json

@@ -1,4 +1,4 @@
 {
-    "version": "2.2.5555",
+    "version": "2.2.551",
     "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('导出')
     }
   })

+ 27 - 0
src/api/reportData.js

@@ -1500,3 +1500,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('各品类经营分析报表导出')
+    }
+  })
+}

+ 356 - 356
src/config/productManagement.js

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

+ 25 - 0
src/config/report/salesReport.js

@@ -333,6 +333,31 @@ export default {
               }
             ]
           },
+          {
+            path: '/reportData/regionTypeBusinessReport',
+            redirect: '/reportData/regionTypeBusinessReport/list',
+            name: 'regionTypeBusinessReport',
+            component: BlankLayout,
+            meta: {
+              title: '各品类经营分析表',
+              icon: 'profile',
+              permission: 'M_regionTypeSalesReportList'
+            },
+            hideChildrenInMenu: true,
+            children: [
+              {
+                path: 'list',
+                name: 'regionTypeBusinessReportList',
+                component: () => import(/* webpackChunkName: "reportData" */ '@/views/reportData/regionTypeBusinessReport/list.vue'),
+                meta: {
+                  title: '各品类经营分析表',
+                  icon: 'profile',
+                  hidden: true,
+                  permission: 'M_regionTypeSalesReportList'
+                }
+              }
+            ]
+          },
           {
             path: '/reportData/salesPresentation',
             redirect: '/reportData/salesPresentation/list',

+ 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 {

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

+ 0 - 193
src/views/allocationManagement/transferOut/chooseImportModal.vue

@@ -1,193 +0,0 @@
-<template>
-  <a-modal
-    centered
-    class="chooseImport-modal"
-    :footer="null"
-    :maskClosable="false"
-    title="导入"
-    v-model="isShow"
-    @cancel="isShow=false"
-    :width="900">
-    <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: 200 }"
-        :pagination="false"
-        bordered>
-      </a-table>
-      <a-divider />
-      <!-- 不可导入数据 -->
-      <p class="red">不可导入数据{{ unLoadData.length }}条</p>
-      <a-table
-        class="unTable"
-        ref="unTable"
-        size="small"
-        :rowKey="(record) => record.errorDesc"
-        :columns="nowUnColumns"
-        :dataSource="unLoadData"
-        :loading="loading"
-        :scroll="{ y: 200 }"
-        :pagination="false"
-        bordered>
-      </a-table>
-      <!-- 按钮 -->
-      <div class="btn-con">
-        <a-button
-          type="primary"
-          id="chooseImport-submit"
-          size="large"
-          :class="loadData.length==0?'button-grey':'button-primary'"
-          @click="handleSubmit"
-          style="padding: 0 40px;">确认导入</a-button>
-        <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="handleError"
-          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 { allocateBillParseProducts, allocateBillFailExcel } from '@/api/allocateBill'
-export default {
-  name: 'TransferOutChooseImportModal',
-  mixins: [commonMixin],
-  props: {
-    openModal: { //  弹框显示状态
-      type: Boolean,
-      default: false
-    },
-    paramsData: {
-      type: Object,
-      default: () => {
-        return {}
-      }
-    }
-  },
-  data () {
-    return {
-      isShow: this.openModal, //  是否打开弹框
-      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: [], // 错误数据
-      loading: false// 表格加载状态
-    }
-  },
-  methods: {
-    // 获取表格数据
-    getData () {
-      const _this = this
-      this.loading = true
-      // 获取列表数据  无分页
-      allocateBillParseProducts(this.paramsData).then(res => {
-        this.loading = 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.$emit('ok', this.loadData)
-        this.isShow = 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
-      })
-    }
-  },
-  watch: {
-    //  父页面传过来的弹框状态
-    openModal (newValue, oldValue) {
-      this.isShow = newValue
-    },
-    //  重定义的弹框状态
-    isShow (newValue, oldValue) {
-      if (!newValue) {
-        this.$emit('close')
-        this.loadData = []
-        this.unLoadData = []
-      } else {
-        this.getData()
-      }
-    }
-  }
-}
-</script>
-
-<style lang="less" scoped>
-  .chooseImport-modal{
-    .chooseImport-con{
-      .red{
-        color: #f30;
-      }
-      .btn-con{
-        text-align: center;
-        margin: 30px 0 20px;
-        .button-cancel,.button-error{
-          font-size: 12px;
-        }
-      }
-    }
-  }
-</style>

+ 25 - 24
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" />
     <!-- 打印导出 -->
@@ -389,7 +388,7 @@ import { printBase64Fun, exportExcel } from '@/libs/JGPrint.js'
 import { queryStockProductForOtherPage } from '@/api/stock'
 import { productPriceInfo } from '@/api/product'
 import { departmentQueryList } from '@/api/expenseManagement'
-import { allocateBillDetailList, allocateBillDetailCount, allocateBillDetail, allocateBillDetailSave, allocateBillSubmit, allocateBillDetailDel, allocateBillDetailDelAll, allocateBillDetailPrint, allocateBillBatchInsert, allocateBillDetailExcel, updateBatchDepartment, queryStockProductPage } from '@/api/allocateBill'
+import { allocateBillDetailList, allocateBillDetailCount, allocateBillDetail, allocateBillDetailSave, allocateBillSubmit, allocateBillDetailDel, allocateBillDetailDelAll, allocateBillDetailPrint, allocateBillDetailExcel, updateBatchDepartment, queryStockProductPage } from '@/api/allocateBill'
 
 export default {
   name: 'TransferOutEdit',
@@ -621,12 +620,8 @@ export default {
     },
     // 导入产品
     handleGuideOk (obj) {
-      allocateBillBatchInsert(obj).then(res => {
-        if (res.status == 200) {
-          this.$refs.chooseTable.refresh(true)
-          this.getDetail(true)
-        }
-      })
+      this.$refs.chooseTable.refresh(true)
+      this.getDetail(true)
     },
     // 已选产品  重置
     chooseResetSearchForm (flag) {
@@ -896,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;
@@ -925,5 +923,8 @@ export default {
         margin-left: 15px;
       }
     }
+    .affix-cont{
+      position: fixed;
+    }
   }
 </style>

+ 225 - 43
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,28 +187,122 @@ export default {
           allocateSn: this.params.allocateSn || '',
           path: file
         }
+        this.loadData = []
+        this.unLoadData = []
+        this.handlerNextStep()
+      } else {
+        this.paramsData = null
       }
     },
-    // 导入
-    hanldeOk (obj) {
-      if (obj && obj.length > 0) {
-        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('添加文件后再进行下一步操作!')
       }
     },
-    // 关闭
-    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 () {
@@ -176,8 +340,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
       }
     }
   }
@@ -221,12 +392,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;
-        }
       }
     }
   }

+ 10 - 0
src/views/common/productBrand.js

@@ -34,6 +34,11 @@ const ProductBrand = {
     disabled: {
       type: Boolean,
       default: false
+    },
+    // 是否显示全品牌
+    showAllBrand:{
+      type: Boolean,
+      default: false
     }
   },
   data() {
@@ -85,6 +90,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 () {

+ 29 - 13
src/views/common/productTypeAll.js

@@ -21,7 +21,7 @@ const ProductType = {
         return []
       }
     },
-    placeholder:{
+    placeholder: {
       type: String,
       default: '请选择产品分类'
     },
@@ -35,7 +35,12 @@ const ProductType = {
     },
     isAll: {
       type: Boolean,
-      default: true
+      default: false
+    },
+    // 是否显示全分类
+    showAllType: {
+      type: Boolean,
+      default: false
     }
   },
   data () {
@@ -52,28 +57,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) {
@@ -88,14 +100,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()
         })
       }
     },
@@ -116,7 +132,7 @@ const ProductType = {
           }
         })
       }
-    },
+    }
   }
 }
 

+ 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 }
       ]
     }
   },

+ 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) : '--') } })

+ 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>

+ 1 - 2
src/views/reportData/salesDetails/list.vue

@@ -191,8 +191,7 @@
             <!--  <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-row>
-          </template>
-        </s-table>
+          </template></s-table>
       </a-spin>
       <!-- 导出提示框 -->
       <reportModal :visible="showExport" @close="showExport=false"></reportModal>