Browse Source

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

lilei 1 năm trước cách đây
mục cha
commit
0bba42812a

+ 1 - 1
public/version.json

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

+ 173 - 136
src/api/reportData.js

@@ -16,8 +16,8 @@ export const salesReportReturnBillList = (params) => {
     url: url,
     data: params,
     method: 'post',
-    headers:{
-          'module': encodeURIComponent('列表查询')
+    headers: {
+      'module': encodeURIComponent('列表查询')
     }
   })
 }
@@ -47,8 +47,8 @@ export const salesReportReturnList = (params) => {
     url: url,
     data: params,
     method: 'post',
-    headers:{
-          'module': encodeURIComponent('列表查询')
+    headers: {
+      'module': encodeURIComponent('列表查询')
     }
   })
 }
@@ -78,8 +78,8 @@ export const salesReportReturnRebateList = (params) => {
     url: url,
     data: params,
     method: 'post',
-    headers:{
-          'module': encodeURIComponent('列表查询')
+    headers: {
+      'module': encodeURIComponent('列表查询')
     }
   })
 }
@@ -100,8 +100,8 @@ export const reportSalesReturnList = (params) => {
     url: url,
     data: params,
     method: 'post',
-    headers:{
-          'module': encodeURIComponent('列表查询')
+    headers: {
+      'module': encodeURIComponent('列表查询')
     }
   })
 }
@@ -122,8 +122,8 @@ export const reportSalesReturnDetailList = (params) => {
     url: url,
     data: params,
     method: 'post',
-    headers:{
-          'module': encodeURIComponent('列表查询')
+    headers: {
+      'module': encodeURIComponent('列表查询')
     }
   })
 }
@@ -142,8 +142,8 @@ export const reportSalesReturnDetailExport = (params) => {
     data: params,
     method: 'post',
     responseType: 'blob',
-    headers:{
-          'module': encodeURIComponent('导出')
+    headers: {
+      'module': encodeURIComponent('导出')
     }
   })
 }
@@ -156,8 +156,8 @@ export const headRebateDetailReportList = (params) => {
     url: url,
     data: params,
     method: 'post',
-    headers:{
-          'module': encodeURIComponent('列表查询')
+    headers: {
+      'module': encodeURIComponent('列表查询')
     }
   })
 }
@@ -176,8 +176,8 @@ export const headRebateDetailReportExport = (params) => {
     data: params,
     method: 'post',
     responseType: 'blob',
-    headers:{
-          'module': encodeURIComponent('导出')
+    headers: {
+      'module': encodeURIComponent('导出')
     }
   })
 }
@@ -190,8 +190,8 @@ export const reportRebateReportList = (params) => {
     url: url,
     data: params,
     method: 'post',
-    headers:{
-          'module': encodeURIComponent('列表查询')
+    headers: {
+      'module': encodeURIComponent('列表查询')
     }
   })
 }
@@ -210,8 +210,8 @@ export const reportRebateExport = (params) => {
     data: params,
     method: 'post',
     responseType: 'blob',
-    headers:{
-          'module': encodeURIComponent('导出')
+    headers: {
+      'module': encodeURIComponent('导出')
     }
   })
 }
@@ -222,8 +222,8 @@ export const salesReturnsExport = (params) => {
     data: params,
     method: 'post',
     responseType: 'blob',
-    headers:{
-          'module': encodeURIComponent('导出')
+    headers: {
+      'module': encodeURIComponent('导出')
     }
   })
 }
@@ -234,8 +234,8 @@ export const salesReturnDetailExport = (params) => {
     data: params,
     method: 'post',
     responseType: 'blob',
-    headers:{
-          'module': encodeURIComponent('导出')
+    headers: {
+      'module': encodeURIComponent('导出')
     }
   })
 }
@@ -246,8 +246,8 @@ export const salesSlipExport = (params) => {
     data: params,
     method: 'post',
     responseType: 'blob',
-    headers:{
-          'module': encodeURIComponent('导出')
+    headers: {
+      'module': encodeURIComponent('导出')
     }
   })
 }
@@ -258,8 +258,8 @@ export const returnSlipExport = (params) => {
     data: params,
     method: 'post',
     responseType: 'blob',
-    headers:{
-          'module': encodeURIComponent('导出')
+    headers: {
+      'module': encodeURIComponent('导出')
     }
   })
 }
@@ -270,8 +270,8 @@ export const salesAmountExport = (params) => {
     data: params,
     method: 'post',
     responseType: 'blob',
-    headers:{
-          'module': encodeURIComponent('导出')
+    headers: {
+      'module': encodeURIComponent('导出')
     }
   })
 }
@@ -282,8 +282,8 @@ export const actualSalesExport = (params) => {
     data: params,
     method: 'post',
     responseType: 'blob',
-    headers:{
-          'module': encodeURIComponent('导出')
+    headers: {
+      'module': encodeURIComponent('导出')
     }
   })
 }
@@ -294,8 +294,8 @@ export const billingReturnExport = (params) => {
     data: params,
     method: 'post',
     responseType: 'blob',
-    headers:{
-          'module': encodeURIComponent('导出')
+    headers: {
+      'module': encodeURIComponent('导出')
     }
   })
 }
@@ -306,8 +306,8 @@ export const salesReturnExport = (params) => {
     data: params,
     method: 'post',
     responseType: 'blob',
-    headers:{
-          'module': encodeURIComponent('导出')
+    headers: {
+      'module': encodeURIComponent('导出')
     }
   })
 }
@@ -320,8 +320,8 @@ export const reportSalesBillDetailList = (params) => {
     url: url,
     data: params,
     method: 'post',
-    headers:{
-          'module': encodeURIComponent('列表查询')
+    headers: {
+      'module': encodeURIComponent('列表查询')
     }
   })
 }
@@ -340,8 +340,8 @@ export const reportSalesBillDetailExport = (params) => {
     data: params,
     method: 'post',
     responseType: 'blob',
-    headers:{
-          'module': encodeURIComponent('导出')
+    headers: {
+      'module': encodeURIComponent('导出')
     }
   })
 }
@@ -354,8 +354,8 @@ export const reportSalesBillList = (params) => {
     url: url,
     data: params,
     method: 'post',
-    headers:{
-          'module': encodeURIComponent('列表查询')
+    headers: {
+      'module': encodeURIComponent('列表查询')
     }
   })
 }
@@ -374,8 +374,8 @@ export const reportSalesBillExport = (params) => {
     data: params,
     method: 'post',
     responseType: 'blob',
-    headers:{
-          'module': encodeURIComponent('导出')
+    headers: {
+      'module': encodeURIComponent('导出')
     }
   })
 }
@@ -388,8 +388,8 @@ export const reportStockPutList = (params) => {
     url: url,
     data: params,
     method: 'post',
-    headers:{
-          'module': encodeURIComponent('列表查询')
+    headers: {
+      'module': encodeURIComponent('列表查询')
     }
   })
 }
@@ -408,8 +408,8 @@ export const reportStockPutExport = (params) => {
     data: params,
     method: 'post',
     responseType: 'blob',
-    headers:{
-          'module': encodeURIComponent('导出')
+    headers: {
+      'module': encodeURIComponent('导出')
     }
   })
 }
@@ -422,8 +422,8 @@ export const reportStockPutDetailList = (params) => {
     url: url,
     data: params,
     method: 'post',
-    headers:{
-          'module': encodeURIComponent('列表查询')
+    headers: {
+      'module': encodeURIComponent('列表查询')
     }
   })
 }
@@ -442,8 +442,8 @@ export const reportStockPutDetailExport = (params) => {
     data: params,
     method: 'post',
     responseType: 'blob',
-    headers:{
-          'module': encodeURIComponent('导出')
+    headers: {
+      'module': encodeURIComponent('导出')
     }
   })
 }
@@ -464,8 +464,8 @@ export const reportDispatchReportList = (params) => {
     url: url,
     data: params,
     method: 'post',
-    headers:{
-          'module': encodeURIComponent('列表查询')
+    headers: {
+      'module': encodeURIComponent('列表查询')
     }
   })
 }
@@ -484,8 +484,8 @@ export const reportDispatchReportExport = (params) => {
     data: params,
     method: 'post',
     responseType: 'blob',
-    headers:{
-          'module': encodeURIComponent('导出')
+    headers: {
+      'module': encodeURIComponent('导出')
     }
   })
 }
@@ -498,8 +498,8 @@ export const reportAllocateDbjdReportList = (params) => {
     url: url,
     data: params,
     method: 'post',
-    headers:{
-          'module': encodeURIComponent('列表查询')
+    headers: {
+      'module': encodeURIComponent('列表查询')
     }
   })
 }
@@ -518,8 +518,8 @@ export const reportAllocateDbjdReportExport = (params) => {
     data: params,
     method: 'post',
     responseType: 'blob',
-    headers:{
-          'module': encodeURIComponent('导出')
+    headers: {
+      'module': encodeURIComponent('导出')
     }
   })
 }
@@ -540,8 +540,8 @@ export const reportSalesReturnThjdReportList = (params) => {
     url: url,
     data: params,
     method: 'post',
-    headers:{
-          'module': encodeURIComponent('列表查询')
+    headers: {
+      'module': encodeURIComponent('列表查询')
     }
   })
 }
@@ -560,8 +560,8 @@ export const reportSalesReturnThjdReportExport = (params) => {
     data: params,
     method: 'post',
     responseType: 'blob',
-    headers:{
-          'module': encodeURIComponent('导出')
+    headers: {
+      'module': encodeURIComponent('导出')
     }
   })
 }
@@ -571,8 +571,8 @@ export const realReportSalesByProvince = (params) => {
     url: '/report/realReportSales/subareaArea/reportList',
     data: params,
     method: 'post',
-    headers:{
-          'module': encodeURIComponent('列表查询')
+    headers: {
+      'module': encodeURIComponent('列表查询')
     }
   })
 }
@@ -592,8 +592,8 @@ export const realReportSalesByProvinceExport = (params) => {
     data: params,
     method: 'post',
     responseType: 'blob',
-    headers:{
-          'module': encodeURIComponent('导出')
+    headers: {
+      'module': encodeURIComponent('导出')
     }
   })
 }
@@ -603,8 +603,8 @@ export const realReportSalesBySubArea = (params) => {
     url: '/report/realReportSales/subarea/reportList',
     data: params,
     method: 'post',
-    headers:{
-          'module': encodeURIComponent('列表查询')
+    headers: {
+      'module': encodeURIComponent('列表查询')
     }
   })
 }
@@ -615,8 +615,8 @@ export const subareaReportTitle = (params) => {
     url: url,
     data: params,
     method: 'get',
-    headers:{
-          'module': encodeURIComponent('导出')
+    headers: {
+      'module': encodeURIComponent('导出')
     }
   })
 }
@@ -627,8 +627,8 @@ export const realReportSalesBySubAreaExport = (params) => {
     data: params,
     method: 'post',
     responseType: 'blob',
-    headers:{
-          'module': encodeURIComponent('导出')
+    headers: {
+      'module': encodeURIComponent('导出')
     }
   })
 }
@@ -642,8 +642,8 @@ export const allocateReturnReportQueryPage = (params) => {
     url: url,
     data: params,
     method: 'post',
-    headers:{
-          'module': encodeURIComponent('列表查询')
+    headers: {
+      'module': encodeURIComponent('列表查询')
     }
   })
 }
@@ -663,8 +663,8 @@ export const allocateReturnReportExport = (params) => {
     data: params,
     method: 'post',
     responseType: 'blob',
-    headers:{
-          'module': encodeURIComponent('导出')
+    headers: {
+      'module': encodeURIComponent('导出')
     }
   })
 }
@@ -677,8 +677,8 @@ export const allocateReturnReportDetailQueryPage = (params) => {
     url: url,
     data: params,
     method: 'post',
-    headers:{
-          'module': encodeURIComponent('列表查询')
+    headers: {
+      'module': encodeURIComponent('列表查询')
     }
   })
 }
@@ -698,8 +698,8 @@ export const allocateReturnReportDetailExport = (params) => {
     data: params,
     method: 'post',
     responseType: 'blob',
-    headers:{
-          'module': encodeURIComponent('导出')
+    headers: {
+      'module': encodeURIComponent('导出')
     }
   })
 }
@@ -712,8 +712,8 @@ export const expenseCollectReportQueryPageByTarget = (params) => {
     url: url,
     data: params,
     method: 'post',
-    headers:{
-          'module': encodeURIComponent('列表查询')
+    headers: {
+      'module': encodeURIComponent('列表查询')
     }
   })
 }
@@ -733,8 +733,8 @@ export const expenseCollectReportExportByTarget = (params) => {
     data: params,
     method: 'post',
     responseType: 'blob',
-    headers:{
-          'module': encodeURIComponent('导出')
+    headers: {
+      'module': encodeURIComponent('导出')
     }
   })
 }
@@ -748,8 +748,8 @@ export const expenseCollectReportQueryPageByProductType = (params) => {
     url: url,
     data: params,
     method: 'post',
-    headers:{
-          'module': encodeURIComponent('列表查询')
+    headers: {
+      'module': encodeURIComponent('列表查询')
     }
   })
 }
@@ -769,8 +769,8 @@ export const expenseCollectReportExportByProductType = (params) => {
     data: params,
     method: 'post',
     responseType: 'blob',
-    headers:{
-          'module': encodeURIComponent('导出')
+    headers: {
+      'module': encodeURIComponent('导出')
     }
   })
 }
@@ -786,8 +786,8 @@ export const sparePartsReturnReportList = (params) => {
     url: url,
     data: params,
     method: 'post',
-    headers:{
-          'module': encodeURIComponent('列表查询')
+    headers: {
+      'module': encodeURIComponent('列表查询')
     }
   })
 }
@@ -808,8 +808,8 @@ export const sparePartsReturnReportExport = (params) => {
     data: params,
     method: 'post',
     responseType: 'blob',
-    headers:{
-          'module': encodeURIComponent('导出')
+    headers: {
+      'module': encodeURIComponent('导出')
     }
   })
 }
@@ -825,8 +825,8 @@ export const sparePartsReturnDetailReportList = (params) => {
     url: url,
     data: params,
     method: 'post',
-    headers:{
-          'module': encodeURIComponent('列表查询')
+    headers: {
+      'module': encodeURIComponent('列表查询')
     }
   })
 }
@@ -848,8 +848,8 @@ export const sparePartsReturnReportExportDetail = (params) => {
     data: params,
     method: 'post',
     responseType: 'blob',
-    headers:{
-          'module': encodeURIComponent('导出')
+    headers: {
+      'module': encodeURIComponent('导出')
     }
   })
 }
@@ -863,8 +863,8 @@ export const rebateQueryList = (params) => {
     url: url,
     data: params,
     method: 'post',
-    headers:{
-          'module': encodeURIComponent('列表查询')
+    headers: {
+      'module': encodeURIComponent('列表查询')
     }
   })
 }
@@ -886,8 +886,8 @@ export const rebateDetailQueryList = (params) => {
     url: url,
     data: params,
     method: 'post',
-    headers:{
-          'module': encodeURIComponent('列表查询')
+    headers: {
+      'module': encodeURIComponent('列表查询')
     }
   })
 }
@@ -914,8 +914,8 @@ export const querySupplierPage = (params) => {
     url: url,
     data: params,
     method: 'post',
-    headers:{
-          'module': encodeURIComponent('列表查询')
+    headers: {
+      'module': encodeURIComponent('列表查询')
     }
   })
 }
@@ -955,8 +955,8 @@ export const queryBillNoPage = (params) => {
     url: url,
     data: params,
     method: 'post',
-    headers:{
-          'module': encodeURIComponent('列表查询')
+    headers: {
+      'module': encodeURIComponent('列表查询')
     }
   })
 }
@@ -985,8 +985,8 @@ export const billNoExport = (params) => {
     data: params,
     method: 'post',
     responseType: 'blob',
-    headers:{
-          'module': encodeURIComponent('导出')
+    headers: {
+      'module': encodeURIComponent('导出')
     }
   })
 }
@@ -1003,8 +1003,8 @@ export const queryDetailReportPage = (params) => {
     url: url,
     data: params,
     method: 'post',
-    headers:{
-          'module': encodeURIComponent('列表查询')
+    headers: {
+      'module': encodeURIComponent('列表查询')
     }
   })
 }
@@ -1015,8 +1015,8 @@ export const exportDetailReport = (params) => {
     data: params,
     method: 'post',
     responseType: 'blob',
-    headers:{
-        'module': encodeURIComponent('导出')
+    headers: {
+      'module': encodeURIComponent('导出')
     }
   })
 }
@@ -1027,8 +1027,8 @@ export const queryGroupByprodTypeReportPage = (params) => {
     url: url,
     data: params,
     method: 'post',
-    headers:{
-          'module': encodeURIComponent('列表查询')
+    headers: {
+      'module': encodeURIComponent('列表查询')
     }
   })
 }
@@ -1063,8 +1063,8 @@ export const salesPromoReportList = (params) => {
     url: url,
     data: params,
     method: 'post',
-    headers:{
-          'module': encodeURIComponent('列表查询')
+    headers: {
+      'module': encodeURIComponent('列表查询')
     }
   })
 }
@@ -1084,8 +1084,8 @@ export const exportSalesPromoReport = (params) => {
     data: params,
     method: 'post',
     responseType: 'blob',
-    headers:{
-          'module': encodeURIComponent('导出')
+    headers: {
+      'module': encodeURIComponent('导出')
     }
   })
 }
@@ -1098,8 +1098,8 @@ export const salesPromoRealReportList = (params) => {
     url: url,
     data: params,
     method: 'post',
-    headers:{
-          'module': encodeURIComponent('列表查询')
+    headers: {
+      'module': encodeURIComponent('列表查询')
     }
   })
 }
@@ -1119,8 +1119,8 @@ export const exportSalesPromoRealReport = (params) => {
     data: params,
     method: 'post',
     responseType: 'blob',
-    headers:{
-          'module': encodeURIComponent('导出')
+    headers: {
+      'module': encodeURIComponent('导出')
     }
   })
 }
@@ -1136,8 +1136,8 @@ export const codeExportImportError = (params) => {
     data: params,
     method: 'post',
     responseType: 'blob',
-    headers:{
-          'module': encodeURIComponent('导出错误项')
+    headers: {
+      'module': encodeURIComponent('导出错误项')
     }
   })
 }
@@ -1149,8 +1149,8 @@ export const traceCodeInsertBatch = (params) => {
     url: url,
     data: params,
     method: 'post',
-    headers:{
-          'module': encodeURIComponent('确定导入')
+    headers: {
+      'module': encodeURIComponent('确定导入')
     }
   })
 }
@@ -1164,8 +1164,8 @@ export const traceCodeList = (params) => {
     url: url,
     data: params,
     method: 'post',
-    headers:{
-          'module': encodeURIComponent('列表查询')
+    headers: {
+      'module': encodeURIComponent('列表查询')
     }
   })
 }
@@ -1187,8 +1187,8 @@ export const excelOnlineList = (params) => {
     data: params,
     method: 'post',
     responseType: 'blob',
-    headers:{
-          'module': encodeURIComponent('导出')
+    headers: {
+      'module': encodeURIComponent('导出')
     }
   })
 }
@@ -1197,8 +1197,8 @@ export const getWarrantyInfo = (params) => {
   return axios({
     url: `/report/warranty/queryById/${params.id}`,
     method: 'post',
-    headers:{
-          'module': encodeURIComponent('质保信息')
+    headers: {
+      'module': encodeURIComponent('质保信息')
     }
   })
 }
@@ -1215,8 +1215,8 @@ export const queryTireList = (params) => {
     url: url,
     data: params,
     method: 'post',
-    headers:{
-          'module': encodeURIComponent('列表查询')
+    headers: {
+      'module': encodeURIComponent('列表查询')
     }
   })
 }
@@ -1236,8 +1236,45 @@ export const excelTireOnlineExport = (params) => {
     data: params,
     method: 'post',
     responseType: 'blob',
-    headers:{
-          'module': encodeURIComponent('导出')
+    headers: {
+      'module': encodeURIComponent('导出')
+    }
+  })
+}
+
+// 促销销售单报表(统计)
+export const brandTypeReportList = (params) => {
+  const url = `/report/brandTypeReport/queryPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post',
+    headers: {
+      'module': encodeURIComponent('列表查询')
+    }
+  })
+}
+
+// 促销销售单报表(统计)  统计
+export const brandTypeReportCount = (params) => {
+  return axios({
+    url: '/report/brandTypeReport/reportCount',
+    data: params,
+    method: 'post'
+  })
+}
+
+// 促销销售单报表(统计)  导出
+export const brandTypeReportExport = (params) => {
+  return axios({
+    url: '/report/brandTypeReport/excelTireOnlineList',
+    data: params,
+    method: 'post',
+    responseType: 'blob',
+    headers: {
+      'module': encodeURIComponent('导出')
     }
   })
 }

+ 24 - 0
src/api/salesNew.js

@@ -22,6 +22,20 @@ export const salesList = (params) => {
         }
     })
 }
+//  销售 待转费用单列表  有分页
+export const salesConvertExpenseList = (params) => {
+    const url = `/salesPromo/queryBatchConvertExpenseAccountPage/${params.pageNo}/${params.pageSize}`
+    delete params.pageNo
+    delete params.pageSize
+    return axios({
+        url: url,
+        data: params,
+        method: 'post',
+        headers:{
+          'module': encodeURIComponent('待转费用报销单列表')
+        }
+    })
+}
 //  销售 新增
 export const salesSave = (params) => {
     return axios({
@@ -214,6 +228,16 @@ export const queryCreateBySalesBillSn = (params) => {
     method: 'post'
   })
 }
+
+// 批量查询可生成的费用报销单
+export const queryBatchCreateBySalesBillSn = (params) => {
+  return axios({
+    url: `/expenseAccount/queryBatchCreateBySalesPromoSnList`,
+    data: params,
+    method: 'post'
+  })
+}
+
 // 保存费用报销单
 export const expenseAccountSave = (params) => {
   return axios({

+ 34 - 0
src/config/router.config.js

@@ -207,6 +207,17 @@ export const asyncRouterMap = [
                   hidden: true,
                   permission: 'B_salesDispatch'
                 }
+              },
+              {
+                path: 'waitCostOrder',
+                name: 'waitCostOrder',
+                component: () => import(/* webpackChunkName: "salesManagement" */ '@/views/salesManagement/waitCostOrder/list.vue'),
+                meta: {
+                  title: '待转费用报销单',
+                  icon: 'monitor',
+                  hidden: true,
+                  permission: 'B_salesDispatch'
+                }
               }
             ]
           },
@@ -1845,6 +1856,29 @@ export const asyncRouterMap = [
               }
             ]
           },
+          {
+            path: '/reportData/promotionSalesOrderReport',
+            redirect: '/reportData/promotionSalesOrderReport/list',
+            name: 'promotionSalesOrderReport',
+            component: BlankLayout,
+            meta: {
+              title: '促销销售单报表(统计)',
+              icon: 'profile',
+              permission: 'M_promotionSalesOrderReport'
+            },
+            hideChildrenInMenu: true,
+            children: [{
+              path: 'list',
+              name: 'promotionSalesOrderReportList',
+              component: () => import(/* webpackChunkName: "reportData" */ '@/views/reportData/promotionSalesOrderReport/list.vue'),
+              meta: {
+                title: '促销销售单报表(统计)',
+                icon: 'profile',
+                hidden: true,
+                permission: 'M_promotionSalesOrderReportList'
+              }
+            }]
+          },
           {
             path: '/reportData/tireSalesReport',
             redirect: '/reportData/tireSalesReport/list',

+ 7 - 2
src/utils/request.js

@@ -6,6 +6,7 @@ import notification from 'ant-design-vue/es/notification'
 import modal from 'ant-design-vue/es/modal'
 import { getAuthPriceCode } from './util'
 import { VueAxios } from './axios'
+import { getUserOsInfo, getBrowserType} from './util'
 
 //没有基地址 访问根目录下文件
 const GETNOBASE = async (url, params) => {
@@ -116,6 +117,12 @@ service.interceptors.request.use(config => {
     config.headers['access-token'] = token // 让每个请求携带自定义 token 请根据实际情况自行修改
   }
   
+  // 操作系统、浏览器信息
+  config.headers['os'] = getUserOsInfo()
+  config.headers['bws'] = getBrowserType()
+  // 分辨率
+  config.headers['sdr'] = window.screen.width+'X'+window.screen.height
+  
   // 获取当前时间撮
   const interFaceList = store.getters.interFaceList
   const curPath = config.url
@@ -134,8 +141,6 @@ service.interceptors.request.use(config => {
   if(currentPage&&currentPage.meta&&config.headers['module']){
     config.headers['module'] = encodeURIComponent(currentPage.meta.title||'') + ',' +config.headers['module']
   }
-  console.log(config.url)
-  console.log(decodeURIComponent(config.headers['module']))
    
   config.headers['auth-price'] = authPrice.join(',') // 价格权限
   config.retry = 3

+ 58 - 0
src/utils/util.js

@@ -1,3 +1,61 @@
+// 获取客户端操作系统信息
+export const getUserOsInfo = function () {
+  const userAgent = navigator.userAgent;
+  if (userAgent.indexOf("Windows NT 10.0") !== -1) return "Windows 10";
+  if (userAgent.indexOf("Windows NT 6.2") !== -1) return "Windows 8";
+  if (userAgent.indexOf("Windows NT 6.1") !== -1) return "Windows 7";
+  if (userAgent.indexOf("Windows NT 6.0") !== -1) return "Windows Vista";
+  if (userAgent.indexOf("Windows NT 5.1") !== -1) return "Windows XP";
+  if (userAgent.indexOf("Windows NT 5.0") !== -1) return "Windows 2000";
+  if (userAgent.indexOf("Mac") !== -1) return "Mac/iOS";
+  if (userAgent.indexOf("X11") !== -1) return "UNIX";
+  if (userAgent.indexOf("Linux") !== -1) return "Linux";
+  return "Other";
+}
+// 获取浏览器类型
+export const _mime = function (option, value) {
+  var mimeTypes = navigator.mimeTypes;
+  for (var mt in mimeTypes) {
+      if (mimeTypes[mt][option] == value) {
+          return true;
+      }
+  }
+  return false;
+}
+export const getBrowserType = function () {
+  let ua = navigator.userAgent.toLocaleLowerCase()
+  let browserType = null
+  if (ua.match(/msie/) != null || ua.match(/trident/) != null) {
+    browserType = 'IE'
+  } else if (ua.match(/firefox/) != null) {
+    browserType = 'firefox'
+  } else if (ua.match(/ucbrowser/) != null) {
+    browserType = 'UC'
+  } else if (ua.match(/opera/) != null || ua.match(/opr/) != null) {
+    browserType = 'opera'
+  } else if (ua.match(/bidubrowser/) != null) {
+    browserType = 'baidu'
+  } else if (ua.match(/metasr/) != null) {
+    browserType = 'sougou'
+  } else if (ua.match(/tencenttraveler/) != null || ua.match(/qqbrowse/) != null) {
+    browserType = 'QQ'
+  } else if (ua.match(/maxthon/) != null) {
+    browserType = 'maxthon'
+  } else if (ua.match(/chrome/) != null) {
+    var is360 = _mime('type', 'application/vnd.chromium.remoting-viewer')
+    if (is360) {
+      browserType = '360'
+    } else {
+      browserType = 'chrome'
+    }
+  } else if (ua.match(/safari/) != null) {
+    browserType = 'Safari'
+  } else {
+    browserType = 'others'
+  }
+  return browserType
+}
+
 export function timeFix () {
   const time = new Date()
   const hour = time.getHours()

+ 22 - 18
src/views/common/productType.js

@@ -5,13 +5,13 @@ const ProductType = {
         @change="handleChange"
         :change-on-select="changeOnSelect"
         :value="defaultVal"
-        expand-trigger="hover"
+        :expand-trigger="expandType"
         :options="productTypeList"
         :show-search="{ filter }"
         :fieldNames="{ label: 'productTypeName', value: 'productTypeSn', children: 'children' }"
         :id="id"
         placeholder="请选择产品分类"
-        allowClear />
+        :allowClear="true"/>
     `,
   props: {
     value: {
@@ -20,15 +20,19 @@ const ProductType = {
         return []
       }
     },
+    expandType: {
+      type: String,
+      default: 'hover'
+    },
     id: {
       type: String,
       default: ''
     },
     level: {
-      type: [String,Number],
+      type: [String, Number],
       default: ''
     },
-    changeOnSelect:{
+    changeOnSelect: {
       type: Boolean,
       default: true
     }
@@ -48,25 +52,25 @@ const ProductType = {
     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){
+    setDefValue (defaultVal) {
       this.handleChange(defaultVal)
     },
-    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)
     },
     //  产品分类列表
     getProductType () {
       productTypeQuery({}).then(res => {
         if (res.status == 200) {
-          if(this.level){
+          if (this.level) {
             this.productTypeList = this.getBylevel(res.data)
-          }else{
+          } else {
             this.productTypeList = res.data
           }
         } else {
@@ -74,23 +78,23 @@ const ProductType = {
         }
       })
     },
-    getBylevel(data){
+    getBylevel (data) {
       const ret = []
       // 显示一级分类
-      if(this.level == 1){
+      if (this.level == 1) {
         data.map(item => {
-          if(item.children){
+          if (item.children) {
             delete item.children
           }
         })
       }
       // 显示二级分类
-      if(this.level == 2){
+      if (this.level == 2) {
         data.map(item => {
-          if(item.children){
+          if (item.children) {
             item.children.map(cd => {
-              if(cd.children){
-                 delete cd.children
+              if (cd.children) {
+                delete cd.children
               }
             })
           }

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

@@ -211,8 +211,9 @@ export default {
         { title: '所属省份', dataIndex: 'provinceName', align: 'center', width: '8%', customRender: function (text) { return text || '--' } },
         { title: '所属城市', dataIndex: 'cityName', align: 'center', width: '8%', customRender: function (text) { return text || '--' } },
         { title: '记账费用', dataIndex: 'expense', align: 'center', width: '10%', customRender: function (text) { return (text == 0 || text) ? _this.toThousands(text) : '--' } },
-        { title: '费用承担方', scopedSlots: { customRender: 'fycdf' }, align: 'center', width: '20%' },
-        { title: '产品信息', scopedSlots: { customRender: 'cpxx' }, align: 'center', width: '15%' },
+        { title: '费用承担方', scopedSlots: { customRender: 'fycdf' }, align: 'center', width: '15%' },
+        { title: '产品信息', scopedSlots: { customRender: 'cpxx' }, align: 'center', width: '12%' },
+        { title: '销售单号', dataIndex: 'salesBillNo', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '备注', dataIndex: 'remarks', align: 'center', width: '10%', customRender: function (text) { return text || '--' } },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '100px', align: 'center' }
       ]

+ 5 - 4
src/views/expenseManagement/expenseReimbursement/detail.vue

@@ -146,10 +146,11 @@ export default {
         { title: '所属分区', dataIndex: 'subareaAreaName', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '所属省份', dataIndex: 'provinceName', align: 'center', width: '8%', customRender: function (text) { return text || '--' } },
         { title: '所属城市', dataIndex: 'cityName', align: 'center', width: '8%', customRender: function (text) { return text || '--' } },
-        { title: '记账费用', dataIndex: 'expense', align: 'right', width: '10%', customRender: function (text) { return (text || text == 0) ? _this.toThousands(text) : '--' } },
-        { title: '费用承担方', scopedSlots: { customRender: 'fycdf' }, align: 'center', width: '15%' },
-        { title: '产品信息', scopedSlots: { customRender: 'cpxx' }, align: 'center', width: '15%' },
-        { title: '备注', dataIndex: 'remarks', align: 'center', width: '10%', customRender: function (text) { return text || '--' } }
+        { title: '记账费用', dataIndex: 'expense', align: 'right', width: '8%', customRender: function (text) { return (text || text == 0) ? _this.toThousands(text) : '--' } },
+        { title: '费用承担方', scopedSlots: { customRender: 'fycdf' }, align: 'center', width: '14%' },
+        { title: '产品信息', scopedSlots: { customRender: 'cpxx' }, align: 'center', width: '12%' },
+        { title: '销售单号', dataIndex: 'salesBillNo', width: '7%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '备注', dataIndex: 'remarks', align: 'center', width: '8%', customRender: function (text) { return text || '--' } }
       ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {

+ 2 - 1
src/views/expenseManagement/expenseReimbursementDetail/list.vue

@@ -304,7 +304,8 @@ export default {
         { 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: '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 }
       ]
     }
   },

+ 4 - 4
src/views/promotionRulesManagement/dealerPromotions/lookUpCustomersModal.vue

@@ -79,9 +79,9 @@
             <!-- <a-badge count="未" :number-style="{ zoom:'80%' }"></a-badge> -->
           </template>
           <!-- 客户状态 -->
-          <template slot="dealerState" slot-scope="text, record">
+        <!--  <template slot="dealerState" slot-scope="text, record">
             <a-switch checkedChildren="启用" unCheckedChildren="禁用" :checked="record.isEnable" @change="changeStatus"/>
-          </template>
+          </template> -->
         </s-table>
       </a-card>
       <div style="text-align:right;color:#666;" v-if="showType ==='isEdit' || showType === 'isAudit'"><span v-if="showType === 'isAudit'">待审核,</span>增加的客户显示红色,删除的客户显示绿色</div>
@@ -195,8 +195,8 @@ export default {
         { title: '分区', dataIndex: 'subareaArea.subareaAreaName', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '经销商名称', dataIndex: 'dealerName', scopedSlots: { customRender: 'dealerName' }, width: '20%', align: 'center', ellipsis: true },
         { title: '商户类型', dataIndex: 'dealerLevelDictValue', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '商户级别', dataIndex: 'dealerTypeDictValue', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '客户状态', scopedSlots: { customRender: 'dealerState' }, width: '10%', align: 'center' }
+        { title: '商户级别', dataIndex: 'dealerTypeDictValue', width: '15%', align: 'center', customRender: function (text) { return text || '--' } }
+        // { title: '客户状态', scopedSlots: { customRender: 'dealerState' }, width: '10%', align: 'center' }
       ],
       openDealerModal: false, // 修改弹窗
       updateFlag: false

+ 439 - 0
src/views/reportData/promotionSalesOrderReport/list.vue

@@ -0,0 +1,439 @@
+<template>
+  <div>
+    <a-card size="small" :bordered="false" class="promotionSalesList-wrap searchBoxNormal">
+      <!-- 搜索条件 -->
+      <div class="table-page-search-wrapper newTableSearchName" ref="tableSearch">
+        <a-form-model
+          id="promotionSalesList-form"
+          ref="ruleForm"
+          class="form-model-con"
+          layout="inline"
+          :model="form"
+          :rules="rules"
+          @keyup.enter.native="handleSearch">
+          <a-row :gutter="15">
+            <a-col :md="6" :sm="24">
+              <a-form-model-item label="统计月份" prop="monthInfo">
+                <div class="monthBox" style="display:flex;align-item:center;">
+                  <a-month-picker
+                    :disabled-date="disabledStartDate"
+                    format="YYYY-MM"
+                    v-model="startValue"
+                    placeholder="开始月份"
+                    @openChange="handleStartOpenChange"
+                    @change="getStartDate"
+                  />
+                  <span>~</span>
+                  <a-month-picker
+                    :disabled-date="disabledEndDate"
+                    format="YYYY-MM"
+                    v-model="endValue"
+                    placeholder="结束月份"
+                    :open="endOpen"
+                    @openChange="handleEndOpenChange"
+                    @change="getEndDate"
+                  />
+                </div>
+              </a-form-model-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-model-item label="区域/分区">
+                <subarea id="promotionSalesList-allocateTypeSn" ref="subarea" @change="subareaChange"></subarea>
+              </a-form-model-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-model-item label="区域负责人">
+                <BizUser v-model="queryParam.subareaArea.bizUserSn"></BizUser>
+              </a-form-model-item>
+            </a-col>
+            <a-form-model-item label="省份">
+              <Area id="promotionSalesList-provinceSn" v-model="queryParam.provinceSn" placeholder="请选择省"></Area>
+            </a-form-model-item>
+            <template v-if="advanced">
+              <a-col :md="6" :sm="24">
+                <a-form-model-item label="客户名称">
+                  <dealerSubareaScopeList ref="custList" id="salesAmountReportList-dealerSn" @change="custChange" />
+                </a-form-model-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-item label="客户级别">
+                  <v-select
+                    v-model="queryParam.dealerLevel"
+                    ref="dealerLevel"
+                    id="promotionSalesList-dealerLevel"
+                    code="DEALER_LEVEL"
+                    placeholder="请选择客户级别"
+                    allowClear></v-select>
+                </a-form-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-item label="产品品牌">
+                  <ProductBrand id="productInfoList-productBrand" v-model="queryParam.productBrand"></ProductBrand>
+                </a-form-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-item label="产品分类">
+                  <productTypeAll
+                    expandType="click"
+                    :changeOnSelect="false"
+                    placeholder="请选择产品分类"
+                    :level="2"
+                    @change="changeProductType"
+                    v-model="productType"
+                    id="productInfoList-productType"></productTypeAll>
+                </a-form-item>
+              </a-col>
+            </template>
+            <a-col :md="24" :sm="24" style="text-align:center;margin-bottom: 10px;">
+              <a-button type="primary" @click="handleSearch" :disabled="disabled" id="promotionSalesList-refresh">查询</a-button>
+              <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="promotionSalesList-reset">重置</a-button>
+              <a-button
+                style="margin-left: 10px"
+                type="primary"
+                class="button-warning"
+                @click="handleExport"
+                :disabled="disabled"
+                :loading="exportLoading"
+                v-if="$hasPermissions('B_brandTypeReportExport')"
+                id="promotionSalesList-export">导出</a-button>
+              <a @click="advanced=!advanced" style="margin-left: 8px">
+                {{ advanced ? '收起' : '展开' }}
+                <a-icon :type="advanced ? 'up' : 'down'"/>
+              </a>
+            </a-col>
+          </a-row>
+        </a-form-model>
+      </div>
+    </a-card>
+    <a-card size="small" :bordered="false">
+      <a-spin :spinning="spinning" tip="Loading...">
+        <!-- 列表 -->
+        <s-table
+          class="sTable fixPagination"
+          ref="table"
+          size="small"
+          :defaultLoadData="true"
+          :rowKey="(record) => record.no"
+          rowKeyName="no"
+          :columns="columns"
+          :data="loadData"
+          :pageSize="30"
+          :style="{ height: tableHeight+84.5+'px' }"
+          :scroll="{ x:1890,y: tableHeight-136 }"
+          bordered>
+          <!-- 品牌-->
+          <template slot="brandName" slot-scope="text, record">
+            {{ record.allProductBrandFlag?'全品类':record.brandName?record.brandName:'--' }}
+          </template>
+          <!-- 分类 -->
+          <template slot="brandtypeName" slot-scope="text, record">
+            {{ record.allProductTypeFlag?'全分类':record.brandtypeName?record.brandtypeName:'--' }}
+          </template>
+          <template slot="footer" v-if="totalData">
+            <a-row>
+              <a-col span="24">
+                <a-row>
+                  <a-col
+                    span="4">销售额:{{ (totalData.totalSaleAmount || totalData.totalSaleAmount==0) ? toThousands(totalData.totalSaleAmount) : '--' }}</a-col>
+                  <a-col
+                    span="4">促销成本费用:{{ (totalData.promoCostFee || totalData.promoCostFee==0) ? toThousands(totalData.promoCostFee) : '--' }}</a-col>
+                  <a-col
+                    span="4">促销成本费用比:{{ totalData.promoCostFeeRate ? toThousands(totalData.promoCostFeeRate*100)+'%' : '--' }}</a-col>
+                  <a-col
+                    span="4">促销销售费用:{{ (totalData.promoSaleFee || totalData.promoSaleFee==0) ? toThousands(totalData.promoSaleFee) : '--' }}</a-col>
+                  <a-col
+                    span="4">促销销售费用比:{{ totalData.promoSaleFeeRate ? toThousands(totalData.promoSaleFeeRate*100)+'%' : '--' }}</a-col>
+                  <a-col
+                    span="4">参与活动销售额:{{ (totalData.promoSaleAmount || totalData.promoSaleAmount==0) ? toThousands(totalData.promoSaleAmount) : '--' }}</a-col>
+                  <a-col
+                    span="4">未参与活动销售额:{{ (totalData.notpromotionSale || totalData.notpromotionSale==0) ? toThousands(totalData.notpromotionSale) : '--' }}</a-col>
+                  <a-col
+                    span="4">调拨物料成本费用:{{ (totalData.allocateCost || totalData.allocateCost==0) ? toThousands(totalData.allocateCost) : '--' }}</a-col>
+                  <a-col
+                    span="4">调拨物料销售费用:{{ (totalData.allocateSaleAmount || totalData.allocateSaleAmount==0) ? toThousands(totalData.allocateSaleAmount) : '--' }}</a-col>
+                  <a-col
+                    span="4">促销成本费用+物料成本费用合计:{{ (totalData.promoCostFeeAndAllocateCost || totalData.promoCostFeeAndAllocateCost==0)? toThousands(totalData.promoCostFeeAndAllocateCost) : '--' }}</a-col>
+                  <a-col
+                    span="4">成本合计占比:{{ totalData.totalCostRate ? toThousands(totalData.totalCostRate*100)+'%' : '--' }}</a-col>
+                  <a-col
+                    span="4">促销销售费用+物料销售费用合计:{{ (totalData.promoSaleFeeAndAllocateAmount || totalData.promoSaleFeeAndAllocateAmount==0) ? toThousands(totalData.promoSaleFeeAndAllocateAmount) : '--' }}</a-col>
+                  <a-col
+                    span="4">销售合计占比:{{ totalData.totalSaleRate ? toThousands(totalData.totalSaleRate*100)+'%' : '--' }}</a-col>
+                </a-row>
+              </a-col>
+            </a-row>
+          </template>
+        </s-table>
+      </a-spin>
+      <!-- 导出提示框 -->
+      <reportModal :visible="showExport" @close="showExport=false"></reportModal>
+    </a-card>
+  </div>
+</template>
+
+<script>
+import { commonMixin } from '@/utils/mixin'
+import moment from 'moment'
+import { STable, VSelect } from '@/components'
+import ProductBrand from '@/views/common/productBrand.js'
+import productTypeAll from '@/views/common/productType.js'
+import dealerSubareaScopeList from '@/views/common/dealerSubareaScopeList.vue'
+import subarea from '@/views/common/subarea.js'
+import reportModal from '@/views/common/reportModal.vue'
+import Area from '@/views/common/area.js'
+import BizUser from '@/views/common/bizUser.js'
+import { hdExportExcel } from '@/libs/exportExcel'
+import { brandTypeReportList, brandTypeReportCount, brandTypeReportExport } from '@/api/reportData'
+export default {
+  name: 'PromotionSalesOrderReport',
+  mixins: [commonMixin],
+  components: { STable, VSelect, subarea, dealerSubareaScopeList, reportModal, Area, BizUser, ProductBrand, productTypeAll },
+  data () {
+    return {
+      spinning: false,
+      advanced: true, // 高级搜索 展开/关闭
+      tableHeight: 0,
+      showExport: false,
+      queryParam: { //  查询条件
+        brandTypeBeginDate: moment().format('YYYYMM'),
+        brandTypeEndDate: moment().format('YYYYMM'),
+        dealerSn: undefined,
+        provinceSn: undefined,
+        subareaArea: {
+          subareaSn: undefined,
+          subareaAreaSn: undefined,
+          bizUserSn: undefined
+        },
+        productBrand: undefined,
+        productTypeSn1: '', //  产品一级分类
+        productType: '', //  产品二级分类
+        dealerLevel: undefined
+      },
+      productType: [],
+      form: {
+        monthInfo: [moment().format('YYYY-MM'), moment().format('YYYY-MM')]
+      },
+      columns: [
+        { title: '区域', dataIndex: 'subareaArea.subareaName', width: '100px', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '分区', dataIndex: 'subareaArea.subareaAreaName', width: '100px', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '区域负责人', dataIndex: 'bizUserName', width: '90px', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '省份', dataIndex: 'dealerInfo.provinceName', width: '100px', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '客户名称', dataIndex: 'dealerInfo.dealerName', width: '130px', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '客户级别', dataIndex: 'dealerInfo.dealerLevelDictValue', width: '90px', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '品牌', dataIndex: 'brandName', width: '90px', align: 'center', scopedSlots: { customRender: 'brandName' } },
+        { title: '二级分类', dataIndex: 'brandtypeName', width: '90px', align: 'center', scopedSlots: { customRender: 'brandtypeName' } },
+        { title: '销售额', dataIndex: 'totalSaleAmount', width: '90px', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') },
+        { title: '促销成本费用', dataIndex: 'promoCostFee', width: '90px', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') },
+        { title: '促销成本费用比', dataIndex: 'promoCostFeeRate', width: '96px', align: 'right', customRender: text => (text ? this.toThousands(text * 100) + '%' : '--') },
+        { title: '促销销售费用', dataIndex: 'promoSaleFee', width: '90px', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') },
+        { title: '促销销售费用比', dataIndex: 'promoSaleFeeRate', width: '96px', align: 'right', customRender: text => (text ? this.toThousands(text * 100) + '%' : '--') },
+        { title: '参与活动销售额', dataIndex: 'promoSaleAmount', width: '96px', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') },
+        { title: '未参与活动销售额', dataIndex: 'notpromotionSale', width: '90px', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') },
+        { title: '调拨物料成本费用', dataIndex: 'allocateCost', width: '90px', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') },
+        { title: '调拨物料销售费用', dataIndex: 'allocateSaleAmount', width: '90px', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') },
+        { title: '促销成本费用+物料成本费用合计', dataIndex: 'promoCostFeeAndAllocateCost', width: '100px', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') },
+        { title: '成本合计占比', dataIndex: 'totalCostRate', width: '90px', align: 'right', customRender: text => (text ? this.toThousands(text * 100) + '%' : '--') },
+        { title: '促销销售费用+物料销售费用合计', dataIndex: 'promoSaleFeeAndAllocateAmount', width: '100px', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') },
+        { title: '销售合计占比', dataIndex: 'totalSaleRate', width: '90px', align: 'right', customRender: text => (text ? this.toThousands(text * 100) + '%' : '--') }
+      ],
+      rules: {
+        monthInfo: [{ required: true, message: '请选择统计月份', trigger: 'change' }]
+      },
+      disabled: false, //  查询、重置按钮是否可操作
+      exportLoading: false,
+      startValue: moment().format('YYYY-MM'), // 统计月份
+      endValue: moment().format('YYYY-MM'),
+      endOpen: false,
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.disabled = true
+        this.spinning = true
+        const newParamsPage = Object.assign(this.queryParam, { pageNo: parameter.pageNo, pageSize: parameter.pageSize }) //  有分页
+        const paramsPage = JSON.parse(JSON.stringify(newParamsPage))
+        delete paramsPage.productTypeSn1
+        if (!paramsPage.subareaArea.subareaSn && !paramsPage.subareaArea.subareaAreaSn && !paramsPage.subareaArea.bizUserSn) {
+          delete paramsPage.subareaArea
+        }
+        return brandTypeReportList(paramsPage).then(res => {
+          let data
+          if (res.status == 200) {
+            data = res.data
+            this.getCount(paramsPage)
+            const no = (data.pageNo - 1) * data.pageSize
+            for (var i = 0; i < data.list.length; i++) {
+              data.list[i].no = no + i + 1
+            }
+            this.disabled = false
+          }
+          this.spinning = false
+          return data
+        })
+      },
+      totalData: null
+    }
+  },
+  watch: {
+    advanced (newValue, oldValue) {
+      const _this = this
+      this.$nextTick(() => { // 页面渲染完成后的回调
+        _this.setTableH()
+      })
+    },
+    '$store.state.app.winHeight' (newValue, oldValue) { //  窗口变更时,需同时更改表格高度
+      this.setTableH()
+    }
+  },
+  methods: {
+    // 统计月份  选择月份限制
+    disabledStartDate (current) {
+      const endValue = this.endValue
+      const md = moment(current).startOf('month').valueOf()
+      const cd = moment().startOf('month').valueOf() // 当前月份
+      if (!current || !endValue) {
+        return md > cd
+      }
+      const ed = moment(endValue).startOf('month').valueOf()
+      return md > ed || md > cd
+    },
+    disabledEndDate (current) {
+      const startValue = this.startValue
+      const md = moment(current).startOf('month').valueOf()
+      const cd = moment().startOf('month').valueOf() // 当前月份
+      if (!current || !startValue) {
+        return md > cd
+      }
+      const sd = moment(startValue).startOf('month').valueOf()
+      return md < sd || md > cd
+    },
+    // 开始时间
+    handleStartOpenChange (open) {
+      if (!open) {
+        this.endOpen = true
+      }
+    },
+    getStartDate (date, dateString) {
+      this.form.monthInfo[0] = dateString
+      this.queryParam.brandTypeBeginDate = date ? moment(dateString).startOf('month').format('YYYYMM') : ''
+    },
+    // 结束时间
+    handleEndOpenChange (open) {
+      this.endOpen = open
+    },
+    getEndDate (date, dateString) {
+      this.form.monthInfo[1] = dateString
+      this.queryParam.brandTypeEndDate = date ? moment(dateString).endOf('month').format('YYYYMM') : ''
+    },
+    //  导出
+    handleExport () {
+      const _this = this
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          const params = _this.queryParam
+          _this.showExport = true
+          _this.exportLoading = true
+          _this.spinning = true
+          hdExportExcel(brandTypeReportExport, params, '促销销售单报表(统计)', function () {
+            _this.exportLoading = false
+            _this.spinning = false
+          })
+        } else {
+          return false
+        }
+      })
+    },
+    // 总计
+    getCount (params) {
+      brandTypeReportCount(params).then(res => {
+        if (res.status == 200) {
+          this.totalData = res.data || null
+        } else {
+          this.totalData = null
+        }
+      })
+    },
+    handleSearch () {
+      const _this = this
+      if (!_this.form.monthInfo[0] || !_this.form.monthInfo[1]) {
+        _this.$message.error('请选择统计月份')
+        return
+      }
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          _this.$refs.table.refresh(true)
+        } else {
+          _this.$message.error('请选择统计月份')
+          return false
+        }
+      })
+    },
+    // 客户名称
+    custChange (val) {
+      this.queryParam.dealerSn = val.key
+    },
+    // 区域分区
+    subareaChange (val) {
+      this.queryParam.subareaArea.subareaSn = val[0] ? val[0] : undefined
+      this.queryParam.subareaArea.subareaAreaSn = val[1] ? val[1] : undefined
+    },
+    //  产品分类  change
+    changeProductType (val, opt) {
+      this.queryParam.productTypeSn1 = val[0] ? val[0] : ''
+      this.queryParam.productType = val[1] ? val[1] : ''
+    },
+    //  重置
+    resetSearchForm () {
+      this.form.monthInfo = [moment().format('YYYY-MM'), moment().format('YYYY-MM')]
+      this.startValue = moment().format('YYYY-MM')
+      this.endValue = moment().format('YYYY-MM')
+      this.queryParam.brandTypeBeginDate = moment().format('YYYYMM')
+      this.queryParam.brandTypeEndDate = moment().format('YYYYMM')
+      this.queryParam.dealerSn = undefined
+      this.queryParam.provinceSn = undefined
+      this.queryParam.subareaArea.subareaSn = undefined
+      this.queryParam.subareaArea.subareaAreaSn = undefined
+      this.queryParam.subareaArea.bizUserSn = undefined
+      this.queryParam.productBrand = undefined
+      this.queryParam.productTypeSn1 = undefined
+      this.queryParam.productType = undefined
+      this.queryParam.dealerLevel = undefined
+
+      this.productType = []
+      this.totalData = null
+      if (this.advanced) {
+        this.$refs.custList.resetForm()
+      }
+      this.$refs.subarea.clearData()
+      this.$refs.ruleForm.resetFields()
+      this.$refs.table.refresh()
+    },
+    setTableH () {
+      const tableSearchH = this.$refs.tableSearch.offsetHeight
+      this.tableHeight = window.innerHeight - tableSearchH - 215
+    }
+  },
+  mounted () {
+    if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
+      this.setTableH()
+    }
+  },
+  activated () {
+    // 如果是新页签打开,则重置当前页面
+    if (this.$store.state.app.isNewTab) {
+      this.setTableH()
+    }
+  },
+  beforeRouteEnter (to, from, next) {
+    next(vm => {})
+  }
+}
+</script>
+<style lang="less" scoped>
+  .monthBox{
+    /deep/.ant-calendar-picker-icon{
+      display:none !important;
+    }
+    /deep/.ant-calendar-picker input{
+      text-align:center;
+    }
+  }
+</style>

+ 1 - 1
src/views/salesManagement/salesQueryNew/detail.vue

@@ -116,7 +116,7 @@
                         <a-select-option value="GIFT">
                           促销产品
                         </a-select-option>
-                        <a-select-option value="GIFT1" v-if="showConvertPromoGifts">
+                        <a-select-option value="convertPromoGiftsFlag" v-if="showConvertPromoGifts">
                           促销产品(转采购额)
                         </a-select-option>
                         <a-select-option value="GATE">

+ 8 - 2
src/views/salesManagement/salesQueryNew/list.vue

@@ -135,7 +135,10 @@
       <a-spin :spinning="spinning" tip="Loading...">
         <!-- 操作按钮 -->
         <div class="table-operator" style="display: flex;justify-content: space-between;align-items: center;">
-          <div style="padding-right: 15px;"><a-button type="primary" v-if="$hasPermissions('B_salesAdd')" @click="handleAdd">新增</a-button></div>
+          <div style="padding-right: 15px;">
+            <a-button type="primary" v-if="$hasPermissions('B_salesAdd')" @click="handleAdd">新增</a-button>
+            <a-button type="primary" class="button-info" v-if="$hasPermissions('B_convertExpense')" @click="toWaitCostOrder">批量转</a-button>
+          </div>
           <div style="flex-grow: 1;display: flex;justify-content: space-between;align-items: center;">
             <div class="tongji-bar">
               <div>
@@ -270,7 +273,7 @@
                 size="small"
                 type="link"
                 class="button-warning"
-                v-if="record.billStatus=='FINISH' &&(record.expenseClainFlag == 'N' ||record.expenseClainFlag == 'M' )"
+                v-if="record.billStatus=='FINISH' &&(record.expenseClainFlag == 'N' ||record.expenseClainFlag == 'M' )&&$hasPermissions('B_convertExpense')"
                 @click="handleExpense(record)"
               >转费用报销单</a-button>
             </div>
@@ -536,6 +539,9 @@ export default {
       this.queryParam.subareaArea.subareaSn = val[0] ? val[0] : undefined
       this.queryParam.subareaArea.subareaAreaSn = val[1] ? val[1] : undefined
     },
+    toWaitCostOrder(){
+      this.$router.push({ name: 'waitCostOrder' })
+    },
     // 新增
     handleAdd () {
       this.openModal = true

+ 349 - 0
src/views/salesManagement/waitCostOrder/list.vue

@@ -0,0 +1,349 @@
+<template>
+  <div class="salesDetail-wrap" :style="{paddingBottom:hideFooter?'0px':'45px'}">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <a-page-header :ghost="false" :backIcon="false" class="salesDetail-cont">
+        <template slot="subTitle">
+          <a href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
+        </template>
+      </a-page-header>
+      <a-card size="small" :bordered="false" class="pages-wrap">
+        <!-- 查询 -->
+        <div class="table-page-search-wrapper" ref="searchbox">
+          <div style="display: flex;justify-content: space-between;align-items: center;">
+            <div style="flex-grow: 1;width: 60%;">
+              <a-form layout="inline" @keyup.enter.native="searchTable">
+                <a-row :gutter="15" type="flex">
+                  <a-col flex="300px">
+                    <a-form-item label="促销名称/简称">
+                      <a-input v-model.trim="queryParam.promotionDescription" allowClear placeholder="请输入促销名称/简称"/>
+                    </a-form-item>
+                  </a-col>
+                  <a-col flex="300px">
+                    <a-form-item label="费用类型">
+                      <v-select
+                        v-model="queryParam.convertExpenseAccountType"
+                        code="CONVERT_EXPENSE_ACCOUNT_TYPE"
+                        placeholder="请选择费用类型"
+                        allowClear></v-select>
+                    </a-form-item>
+                  </a-col>
+                  <a-col flex="300px">
+                    <a-form-item label="客户名称">
+                      <dealerSubareaScopeList ref="dealerSubareaScopeList" @change="custChange" />
+                    </a-form-item>
+                  </a-col>
+                  <a-col flex="300px">
+                    <a-form-item label="销售单号">
+                      <a-input v-model.trim="queryParam.salesBillNo" allowClear placeholder="请输入销售单号"/>
+                    </a-form-item>
+                  </a-col>
+                  <a-col flex="300px">
+                    <a-form-item label="规则简称">
+                      <a-input v-model.trim="queryParam.promotionRuleDescription" allowClear placeholder="请输入规则简称"/>
+                    </a-form-item>
+                  </a-col>
+                  <a-col flex="150px">
+                    <a-button type="primary" :disabled="disabled" @click="searchForm">查询</a-button>
+                    <a-button style="margin-left: 10px" :disabled="disabled" @click="resetSearchForm()">重置</a-button>
+                  </a-col>
+                </a-row>
+              </a-form>
+            </div>
+          </div>
+        </div>
+        <!-- 产品列表 -->
+        <div style="padding:0 0 5px;">
+          <span>
+            已选 <template v-if="rowSelectionInfo && rowSelectionInfo.selectedRowKeys.length>0">{{ rowSelectionInfo.selectedRowKeys.length }}</template><template v-else>0</template> 项
+          </span>
+          <span style="color:red;">(注意:费用类型不一致不能批量转费用报销单)</span>
+        </div>
+        <div>
+          <s-table
+            class="sTable fixPagination"
+            ref="table"
+            :style="{ height: pageHeight+67+'px' }"
+            size="small"
+            :rowKey="(record) => record.no"
+            rowKeyName="no"
+            :columns="columns"
+            :row-selection="{ columnWidth: 40, getCheckboxProps: record => ({ props: { disabled: curExpenseAccountType ? record.convertExpenseAccountType != curExpenseAccountType : false } }) }"
+            @rowSelection="rowSelectionFun"
+            :data="loadData"
+            :scroll="{ y: pageHeight }"
+            :defaultLoadData="false"
+            bordered>
+            <!-- 操作 -->
+            <template slot="action" slot-scope="text, record">
+              <div>
+                <a-button
+                  size="small"
+                  type="link"
+                  class="button-warning"
+                  @click="handleSave(record)"
+                >转费用报销单</a-button>
+              </div>
+            </template>
+          </s-table>
+        </div>
+      </a-card>
+    </a-spin>
+    <div class="affix-cont" :style="{padding:hideFooter?0:'7px 0 4px'}">
+      <a-button
+        style="width: 100px;"
+        type="primary"
+        class="button-info"
+        @click="handleView()"
+      >
+        查看
+      </a-button>
+      <a-button
+        type="primary"
+        :disabled="spinning"
+        style="width: 100px;margin: 0 20px;"
+        @click="handleSave()"
+      >
+        提交
+      </a-button>
+    </div>
+    <!-- 新增费用单 -->
+    <baseDataModal ref="expenseModal" @expenseSaveOk="expenseSaveOk" :show="openBaseModal" @close="openBaseModal=false"></baseDataModal>
+    <!-- 查看已选费用单 -->
+    <viewSelectModal ref="viewModal" :openModal="showViewModal" @close="showViewModal=false"></viewSelectModal>
+  </div>
+</template>
+
+<script>
+import { commonMixin } from '@/utils/mixin'
+import moment from 'moment'
+import { STable, VSelect } from '@/components'
+import dealerSubareaScopeList from '@/views/common/dealerSubareaScopeList.vue'
+import baseDataModal from '@/views/expenseManagement/expenseReimbursement/baseDataModal.vue'
+import viewSelectModal from './viewSelectModal.vue'
+import { salesConvertExpenseList, expenseAccountSave, queryBatchCreateBySalesBillSn } from '@/api/salesNew'
+export default {
+  name: 'WaitCostOrder',
+  mixins: [commonMixin],
+  components: { STable, VSelect, dealerSubareaScopeList, baseDataModal, viewSelectModal },
+  data () {
+    return {
+      spinning: false,
+      disabled: false,
+      hideFooter: false,
+      openBaseModal: false, // 费用弹框
+      fromRouter: '',
+      authCode: '',
+      queryParam: {
+        promotionDescription: '',
+        convertExpenseAccountType: '',
+        salesBillNo: '',
+        promotionRuleDescription: '',
+        buyerName: ''
+      },
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.disabled = true
+        this.spinning = true
+        delete parameter.tableId
+        delete parameter.index
+        this.getPageHeight()
+        return salesConvertExpenseList(Object.assign(parameter, this.queryParam)).then(res => {
+          let data
+          if (res.status == 200) {
+            data = res.data
+            const no = (data.pageNo - 1) * data.pageSize
+            data.list.forEach((con, i) => {
+              con.no = no + i + 1
+            })
+            this.disabled = false
+          }
+          this.spinning = false
+          return data
+        })
+      },
+      rowSelectionInfo: null,
+      curExpenseAccountType: '',
+      pageHeight: 300,
+      showViewModal: false,
+      isSearch: false
+    }
+  },
+  computed: {
+    hasSelect () {
+      return this.rowSelectionInfo && this.rowSelectionInfo.selectedRowKeys.length
+    },
+    columns () {
+      const _this = this
+      const arr = [
+        { title: '序号', dataIndex: 'no', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '销售单号', dataIndex: 'salesBillNo', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '客户名称', dataIndex: 'buyerName', width: '16%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '费用类型', dataIndex: 'convertExpenseAccountTypeDictValue', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '待转金额', dataIndex: 'expense', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        { title: '促销名称', dataIndex: 'promotionTitle', width: '17%', align: 'left', customRender: function (text) { return text || '--' } },
+        { title: '促销简称', dataIndex: 'promotionDescription', width: '17%', align: 'left', customRender: function (text) { return text || '--' }, sorter: true },
+        { title: '规则简称', dataIndex: 'promotionRuleDescription', width: '15%', align: 'left', customRender: function (text) { return text || '--' }, sorter: true },
+        { title: '促销类型', dataIndex: 'promotionRuleTypeDictValue', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: '8%', align: 'center' }
+      ]
+      return arr
+    }
+  },
+  methods: {
+    //  返回
+    handleBack () {
+      this.$router.push({ name: 'salesQueryNewList' })
+    },
+    getPageHeight () {
+      this.pageHeight = window.innerHeight - 290 - (this.$refs.searchbox ? this.$refs.searchbox.clientHeight : 0)
+    },
+    // 表格选中项
+    rowSelectionFun (obj) {
+      console.log(obj)
+      this.rowSelectionInfo = obj || null
+      if (obj.selectedRows) {
+        this.curExpenseAccountType = obj.selectedRows && obj.selectedRows[0] && obj.selectedRows[0]['convertExpenseAccountType'] || ''
+        if (obj.selectedRows.length <= 1) {
+          if (!this.isSearch) {
+            this.$refs.table.refresh()
+          }
+          this.isSearch = false
+        } else {
+          // 全选
+          const ret = obj.selectedRows.filter(item => item.convertExpenseAccountType == this.curExpenseAccountType)
+          if (ret.length != obj.selectedRows.length) {
+            this.$message.warning('费用类型不一致,请重新勾选!')
+            this.$refs.table.clearSelected()
+          }
+        }
+      }
+    },
+    custChange (val) {
+      this.queryParam.buyerName = val.name || ''
+    },
+    // 提交
+    handleSave (row) {
+      const _this = this
+      const salesPromoSnList = []
+      // 单个转
+      if (row) {
+        salesPromoSnList.push(row.salesPromoSn)
+      } else {
+        const slen = _this.rowSelectionInfo.selectedRowKeys.length
+        if (!_this.rowSelectionInfo || (_this.rowSelectionInfo && slen < 1)) {
+          _this.$message.warning('请在列表勾选后再进行批量操作!')
+          return
+        }
+        // 批量转
+        this.rowSelectionInfo.selectedRows.map(item => {
+          salesPromoSnList.push(item.salesPromoSn)
+        })
+      }
+
+      this.handleExpense(salesPromoSnList)
+    },
+    // 转费用单
+    async handleExpense (snList) {
+      const _this = this
+      const hasExpense = await queryBatchCreateBySalesBillSn({ salesPromoSnList: snList }).then(res => res.data || [])
+      let result = null
+      for (const key in hasExpense) {
+        result = hasExpense[key]
+      }
+      _this.expenseSave(result)
+    },
+    // 转费用单
+    expenseSave (data) {
+      console.log(data)
+      if (data) {
+        this.openBaseModal = true
+        this.$refs.expenseModal.setDetail(data, 'sales')
+      }
+    },
+    expenseSaveOk (params) {
+      expenseAccountSave(params).then(res => {
+        if (res.status == 200) {
+          this.$message.info(res.message)
+          this.openBaseModal = false
+          this.searchForm()
+          this.$router.push({ name: 'expenseReimbursementEdit', params: { sn: res.data.expenseAccountSn } })
+        }
+      })
+    },
+    // 查看
+    handleView () {
+      if (!this.hasSelect) {
+        this.$message.warning('请先勾选!')
+        return
+      }
+      this.showViewModal = true
+      this.$refs.viewModal.setData(this.rowSelectionInfo && this.rowSelectionInfo.selectedRows)
+    },
+    //  重置
+    resetSearchForm () {
+      this.isSearch = true
+      this.queryParam.buyerName = undefined
+      this.queryParam.convertExpenseAccountType = undefined
+      this.queryParam.salesBillNo = ''
+      this.queryParam.promotionDescription = ''
+      this.queryParam.promotionRuleDescription = ''
+      this.$refs.dealerSubareaScopeList.resetForm()
+      this.$refs.table.refresh(true)
+      this.$refs.table.clearSelected()
+    },
+    searchForm () {
+      this.isSearch = true
+      this.$refs.table.refresh(true)
+      this.$refs.table.clearSelected()
+    }
+  },
+  activated () {
+    // 如果是新页签打开或者进入新的子页(例:存在列表第2条数据编辑页页签时再打开第4条数据的编辑页),则重置当前页面
+    if (this.$store.state.app.isNewTab || !this.$store.state.app.isNewSubTab) {
+      this.resetSearchForm()
+    }
+  },
+  beforeRouteEnter (to, from, next) {
+    next(vm => {
+      vm.fromRouter = from
+      vm.authCode = to.meta.permission
+    })
+  }
+}
+</script>
+
+<style lang="less">
+  .salesDetail-wrap{
+    position: relative;
+    height: 100%;
+    padding-bottom: 45px;
+    box-sizing: border-box;
+    >.ant-spin-nested-loading{
+      overflow-y: auto;
+      height: 100%;
+    }
+    .salesDetail-cont{
+      margin-bottom: 6px;
+    }
+    .active-title{
+      display: flex;
+      align-items: center;
+      justify-content: space-between;
+      padding: 10px;
+      background: #f3f8fa;
+    }
+    .flexBox{
+      display: flex;
+      justify-content: space-between;
+      align-items: center;
+    }
+    .footer-cont{
+      margin-top: 5px;
+      text-align: center;
+    }
+    .redStyle{
+      font-weight: bold;
+      color: red;
+    }
+  }
+</style>

+ 99 - 0
src/views/salesManagement/waitCostOrder/viewSelectModal.vue

@@ -0,0 +1,99 @@
+<template>
+  <a-modal centered :footer="null" :maskClosable="false" title="已选待转费用报销单" v-model="isShow" @cancel="isShow=false"
+    width="70%">
+    <div style="padding:10px;">共{{dataSource&&dataSource.length}}条</div>
+    <a-spin :spinning="spinning" tip="Loading...">
+      <div>
+        <ve-table
+            border-y
+            v-show="!showEmpty"
+            :scroll-width="0"
+            :max-height="tableHeight"
+            :row-style-option="{clickHighlight: true}"
+            :cellSelectionOption="{enable: false}"
+            :virtual-scroll-option="{enable: true}"
+            :columns="columns"
+            :table-data="dataSource"
+            row-key-field-name="no"
+            :column-width-resize-option="columnWidthResizeOption"
+          />
+        <div v-show="showEmpty" class="empty-data"><a-empty description="暂无数据" :image="simpleImage"/></div>
+      </div>
+      <div class="btn-cont" style="padding:20px 20px 0;text-align: center;">
+        <a-button type="primary" class="button-info" style="margin-left: 10px" @click="isShow=false">确定</a-button>
+      </div>
+    </a-spin>
+  </a-modal>
+</template>
+
+<script>
+  import {
+    commonMixin
+  } from '@/utils/mixin'
+  import { Empty } from 'ant-design-vue';
+  export default {
+    name: 'ViewSelectModal',
+    mixins: [commonMixin],
+    props: {
+      openModal: {
+        type: Boolean,
+        default: false
+      },
+    },
+    data() {
+      const _this = this
+      return {
+        spinning: false,
+        isShow: this.openModal,
+        simpleImage: Empty.PRESENTED_IMAGE_SIMPLE,
+        columnWidthResizeOption: {
+            // default false
+            enable: true,
+            // column resize min width
+            minWidth: 50
+        },
+        showEmpty: false,
+        tableHeight: 450,
+        dataSource: []
+      }
+    },
+    computed: {
+      columns() {
+        const arr =  [
+                { title: '序号', field: 'no',key: "a", width: 50, align: 'center',operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return row[column.field] || '--' } },
+                { title: '销售单号', field: 'salesBillNo',key: "b", width: 100, align: 'left',operationColumn: false,renderBodyCell: ({ row, column, rowIndex }, h) => { return row[column.field] || '--'} },
+                { title: '客户名称', field: 'buyerName',key: "c", width: 150, align: 'left',operationColumn: false , ellipsis: { showTitle: true },renderBodyCell: ({ row, column, rowIndex }, h) => { return row[column.field] || '--'}},
+                { title: '费用类型', field: 'convertExpenseAccountTypeDictValue',key: "d", width: 100, align: 'center',operationColumn: false,ellipsis: { showTitle: true },renderBodyCell: ({ row, column, rowIndex }, h) => { return row[column.field] || '--'} },
+                { title: '待转金额', field: 'expense',key: "e", width: 80, align: 'right',operationColumn: false,renderBodyCell: ({ row, column, rowIndex }, h) => { return row[column.field] || '--'}},
+                { title: '促销名称', field: 'promotionTitle',key: "f", width: 150, align: 'left',operationColumn: false,renderBodyCell: ({ row, column, rowIndex }, h) => { return row[column.field] || '--'}},
+                { title: '促销简称', field: 'promotionDescription',key: "g", width: 150, align: 'left',operationColumn: false,renderBodyCell: ({ row, column, rowIndex }, h) => { return row[column.field] || '--'}},
+                { title: '规则简称', field: 'promotionRuleDescription',key: "h", width: 150, align: 'center',operationColumn: false,renderBodyCell: ({ row, column, rowIndex }, h) => { return row[column.field] || '--'}},
+                { title: '促销类型', field: 'promotionRuleTypeDictValue',key: "l", width: 100, align: 'center',operationColumn: false,renderBodyCell: ({ row, column, rowIndex }, h) => { return row[column.field] || '--'}}
+            ]
+        return arr
+      }
+    },
+    methods: {
+       setData(list){
+         this.dataSource = JSON.parse(JSON.stringify(list))
+         this.dataSource.map((item,index) => {
+           item.no = index + 1
+         })
+       }
+    },
+    watch: {
+      openModal(nVal, oVal) {
+        this.isShow = nVal
+      },
+      isShow(nVal, oVal) {
+        if (!nVal) {
+          this.$emit('close')
+          this.dataSource = []
+        }
+      }
+    }
+  }
+</script>
+
+<style>
+</style>

+ 1 - 0
src/views/salesManagement/waitDispatchNew/edit.vue

@@ -5,6 +5,7 @@
         <!-- 自定义的二级文字标题 -->
         <template slot="subTitle">
           <a id="waitDispatch-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
+          <span style="margin: 0 15px;color: #666;font-weight: bold;">单号:{{ detailData&&detailData.salesBillNo }}</span>
           <span style="margin: 0 15px;color: #666;">客户名称:{{ detailData&&detailData.buyerName || '--' }}</span>
         </template>
       </a-page-header>

+ 305 - 287
src/views/salesManagement/waitDispatchNew/queryPart.vue

@@ -29,7 +29,7 @@
                 <a-select-option value="GIFT">
                   促销产品
                 </a-select-option>
-                <a-select-option value="GIFT1" v-if="showConvertPromoGifts">
+                <a-select-option value="convertPromoGiftsFlag" v-if="showConvertPromoGifts">
                   促销产品(转采购额)
                 </a-select-option>
                 <a-select-option value="GATE">
@@ -68,14 +68,26 @@
         </a-row>
       </a-form>
     </div>
-   
+
     <!-- alert -->
     <div style="margin-bottom: 10px;display: flex;align-items: center;" v-if="detailData">
       <div style="display: flex;align-items: center;">
         <a-button type="primary" :disabled="newLoading" class="button-info" @click="handlePlAdd">批量添加</a-button>
         <a-button type="primary" :disabled="newLoading" class="button-info" v-if="showConvertPromoGifts" @click="handlePlPurchase">批量转采购额</a-button>
-        <a-button type="primary" v-if="hasNormalProduct" ghost style="margin-left:6px;" :disabled="newLoading" @click="handlePlCancel">批量取消</a-button>
-        <a-button type="primary" v-if="hasPrompActive&&hasNoPushedActive" ghost style="margin-left:6px;" :disabled="newLoading" @click="handleAllCancel">整单取消</a-button>
+        <a-button
+          type="primary"
+          v-if="hasNormalProduct"
+          ghost
+          style="margin-left:6px;"
+          :disabled="newLoading"
+          @click="handlePlCancel">批量取消</a-button>
+        <a-button
+          type="primary"
+          v-if="hasPrompActive&&hasNoPushedActive"
+          ghost
+          style="margin-left:6px;"
+          :disabled="newLoading"
+          @click="handleAllCancel">整单取消</a-button>
         <a-tooltip placement="top" v-if="hasPrompActive&&hasNoPushedActive" style="margin-left:6px;">
           <template slot="title">
             <span>参加促销活动的产品,不能单独取消,只能整单取消。</span>
@@ -98,28 +110,28 @@
         <span v-if="$hasPermissions('B_salesDispatch_salesPrice')&&detailData&&detailData.totalConvertPromoGiftsAmount" style="color:red;">促销产品转采购额金额:<strong>{{ toThousands(detailData.totalConvertPromoGiftsAmount) }}</strong>;</span>
       </div>
     </div>
-    
+
     <a-spin :spinning="spinning" tip="Loading...">
-        <ve-table
-              border-y
-              v-show="!showEmpty"
-              :scroll-width="0"
-              :max-height="tableHeight"
-              :show-header="showTableHead"
-              :row-style-option="{clickHighlight: true}"
-              :cellSelectionOption="{enable: false}"
-              :virtual-scroll-option="{enable: true}"
-              :columns="columns"
-              :table-data="tableData"
-              row-key-field-name="id"
-              :cell-style-option="cellStyleOption"
-              :cell-span-option="cellSpanOption"
-              :column-width-resize-option="columnWidthResizeOption"
-              :checkbox-option="checkboxOption"
-            />
-        <div v-show="showEmpty" class="empty-data"><a-empty description="暂无产品" :image="simpleImage"/></div>
-        <!-- 活动规则详情 -->
-        <detailModal :openModal="openDetailModal" :itemSn="detailSn" @close="closeDetailModal"></detailModal>
+      <ve-table
+        border-y
+        v-show="!showEmpty"
+        :scroll-width="0"
+        :max-height="tableHeight"
+        :show-header="showTableHead"
+        :row-style-option="{clickHighlight: true}"
+        :cellSelectionOption="{enable: false}"
+        :virtual-scroll-option="{enable: true}"
+        :columns="columns"
+        :table-data="tableData"
+        row-key-field-name="id"
+        :cell-style-option="cellStyleOption"
+        :cell-span-option="cellSpanOption"
+        :column-width-resize-option="columnWidthResizeOption"
+        :checkbox-option="checkboxOption"
+      />
+      <div v-show="showEmpty" class="empty-data"><a-empty description="暂无产品" :image="simpleImage"/></div>
+      <!-- 活动规则详情 -->
+      <detailModal :openModal="openDetailModal" :itemSn="detailSn" @close="closeDetailModal"></detailModal>
     </a-spin>
 
   </div>
@@ -129,7 +141,7 @@
 import { commonMixin } from '@/utils/mixin'
 import { salesPromoQueryList } from '@/api/salesNew'
 import detailModal from '@/views/promotionRulesManagement/dealerPromotions/detailModal.vue'
-import { Empty } from 'ant-design-vue';
+import { Empty } from 'ant-design-vue'
 import { salesDetailAllList, salesPromoDetailCount, salesDetaiCount } from '@/api/salesDetailNew'
 import { STable, VSelect } from '@/components'
 import chooseWarehouse from '@/views/common/chooseWarehouse'
@@ -139,16 +151,16 @@ export default {
   components: { STable, VSelect, chooseWarehouse, detailModal },
   props: {
     newLoading: {
-        type: Boolean,
-        default: false
+      type: Boolean,
+      default: false
+    },
+    maxHeight: {
+      type: [String, Number],
+      default: '300'
     },
-    maxHeight:{
-          type: [String,Number],
-          default: '300'
-        },
     showHeader: {
-        type: Boolean,
-        default: true
+      type: Boolean,
+      default: true
     }
   },
   data () {
@@ -180,103 +192,103 @@ export default {
       tableData: [],
       cellStyleOption: {
         bodyCellClass: ({ row, column, rowIndex }) => {
-            if (row.id.indexOf('promo-')>=0 && column.field === "no") {
-                return "table-body-cell-no";
-            }
-        },
+          if (row.id.indexOf('promo-') >= 0 && column.field === 'no') {
+            return 'table-body-cell-no'
+          }
+        }
       },
       columnWidthResizeOption: {
-          // default false
-          enable: true,
-          // column resize min width
-          minWidth: 50
+        // default false
+        enable: true,
+        // column resize min width
+        minWidth: 50
       },
       cellSpanOption: {
-          bodyCellSpan: this.bodyCellSpan,
+        bodyCellSpan: this.bodyCellSpan
       },
       showEmpty: false,
       showTableHead: true,
       disableSelectedRowKeys: [],
       selectedRowKeys: [],
       colspanNums: 16,
-      hasNormalProduct: false,
+      hasNormalProduct: false
     }
   },
   computed: {
-    tableHeight(){
+    tableHeight () {
       return (this.showEmpty ? 200 : this.maxHeight) + 'px'
     },
-    hasPrompActive(){
-      return this.detailData&&this.detailData.promoFlag==1
+    hasPrompActive () {
+      return this.detailData && this.detailData.promoFlag == 1
     },
-    hasNoPushedActive(){
-      return this.detailData&&this.detailData.totalPushedQty==0||!this.detailData.totalPushedQty
+    hasNoPushedActive () {
+      return this.detailData && this.detailData.totalPushedQty == 0 || !this.detailData.totalPushedQty
     },
-    hasConvertPromoGifts(){
-      return this.detailData&&this.detailData.totalConvertPromoGiftsAmount > 0
+    hasConvertPromoGifts () {
+      return this.detailData && this.detailData.totalConvertPromoGiftsAmount > 0
     },
-    showConvertPromoGifts(){
-      return this.activeList&&this.activeList.find(item => item.promotionRule&&item.promotionRule.convertExpenseFlag==1&&item.promotionRule.promotionRuleType=='BUY_PROD_GIVE_PROD')
+    showConvertPromoGifts () {
+      return this.activeList && this.activeList.find(item => item.promotionRule && item.promotionRule.convertExpenseFlag == 1 && item.promotionRule.promotionRuleType == 'BUY_PROD_GIVE_PROD')
     },
     checkboxOption () {
       return {
-          disableSelectedRowKeys: this.disableSelectedRowKeys,
-          selectedRowKeys: this.selectedRowKeys,
-          // 行选择改变事件
-          selectedRowChange: ({ row, isSelected, selectedRowKeys }) => {
-            this.selectedRowChange({ row, isSelected, selectedRowKeys })
-          },
-          // 全选改变事件
-          selectedAllChange: ({ isSelected, selectedRowKeys }) => {
-            this.selectedAllChange({ isSelected, selectedRowKeys })
-          },
+        disableSelectedRowKeys: this.disableSelectedRowKeys,
+        selectedRowKeys: this.selectedRowKeys,
+        // 行选择改变事件
+        selectedRowChange: ({ row, isSelected, selectedRowKeys }) => {
+          this.selectedRowChange({ row, isSelected, selectedRowKeys })
+        },
+        // 全选改变事件
+        selectedAllChange: ({ isSelected, selectedRowKeys }) => {
+          this.selectedAllChange({ isSelected, selectedRowKeys })
+        }
       }
     },
     columns () {
       const _this = this
-          const priceFormat = function(record,data,h){
-            return (
-              <div>
-                {_this.toThousands(data)}
-                {record.promotionFlag == 'GIFT' || record.promotionFlag == 'DISCOUNT' ? (
-                  <span title="原价">({ _this.toThousands(record.origPrice)})</span>
-                ):''}
-              </div>
-            )
-          }
-          const numsFormat = function(data){
-            return data || data == 0 ? data : '--'
-          }
-          const codeFormat = function(record,data,h){
-            let ftext = ''
-            let fcolor = ''
-            if(record.promotionFlag == 'GIFT'){
-              ftext = '促'
-              fcolor = '#52c41a'
-            }
-            if(record.promotionFlag == 'GATE'){
-              ftext = '槛'
-              fcolor = '#108ee9'
-            }
-             
-            return (
-                    <div>
-                        <span style="padding-right: 15px;">{data}</span>
-                        {ftext?(<a-badge count={ftext} number-style={{ backgroundColor: fcolor, zoom:'80%' }}></a-badge>):''}
-                        {record.bakConvertPromoGiftsQty?(<a-badge count="转" number-style={{ backgroundColor: '#ffaa00', zoom:'80%' }}></a-badge>):''}
-                        {Number(record.stockQty||0) < Number(record.unpushedQty||0)?(<a-badge count="缺" number-style={{ zoom:'80%' }}></a-badge>):''}
-                    </div>
-                )
-          }
+      const priceFormat = function (record, data, h) {
+        return (
+          <div>
+            {_this.toThousands(data)}
+            {record.promotionFlag == 'GIFT' || record.promotionFlag == 'DISCOUNT' ? (
+              <span title="原价">({ _this.toThousands(record.origPrice)})</span>
+            ) : ''}
+          </div>
+        )
+      }
+      const numsFormat = function (data) {
+        return data || data == 0 ? data : '--'
+      }
+      const codeFormat = function (record, data, h) {
+        let ftext = ''
+        let fcolor = ''
+        if (record.promotionFlag == 'GIFT') {
+          ftext = '促'
+          fcolor = '#52c41a'
+        }
+        if (record.promotionFlag == 'GATE') {
+          ftext = '槛'
+          fcolor = '#108ee9'
+        }
+
+        return (
+          <div>
+            <span style="padding-right: 15px;">{data}</span>
+            {ftext ? (<a-badge count={ftext} number-style={{ backgroundColor: fcolor, zoom: '80%' }}></a-badge>) : ''}
+            {record.bakConvertPromoGiftsQty ? (<a-badge count="转" number-style={{ backgroundColor: '#ffaa00', zoom: '80%' }}></a-badge>) : ''}
+            {Number(record.stockQty || 0) < Number(record.unpushedQty || 0) ? (<a-badge count="缺" number-style={{ zoom: '80%' }}></a-badge>) : ''}
+          </div>
+        )
+      }
       // 取消数量输入框
-      const inputFormat = function(record,data,h) {
-        if(record.unpushedQty>0){
+      const inputFormat = function (record, data, h) {
+        if (record.unpushedQty > 0) {
           return (
             <div>
               <a-input-number
                 size="small"
                 value={record.cancelNums}
-                onChange={e => _this.cancelNumsChange(e,record)}
+                onChange={e => _this.cancelNumsChange(e, record)}
                 precision={0}
                 min={0}
                 max={record.unpushedQty}
@@ -288,16 +300,16 @@ export default {
         return '--'
       }
       // 转采购额数量输入框
-      const inputFormat1 = function(record,data,h) {
-        if(record.unpushedQty>=0 && record.convertPromoGiftsFlag){
+      const inputFormat1 = function (record, data, h) {
+        if (record.unpushedQty >= 0 && record.convertPromoGiftsFlag) {
           // 已选
-          if(_this.selectedRowKeys.includes(record.id)){
+          if (_this.selectedRowKeys.includes(record.id)) {
             return (
               <div>
                 <a-input-number
                   size="small"
                   value={record.convertPromoGiftsQty}
-                  onChange={e => _this.convertPromoGiftsChange(e,record)}
+                  onChange={e => _this.convertPromoGiftsChange(e, record)}
                   precision={0}
                   min={0}
                   max={record.maxConvertNums}
@@ -305,100 +317,107 @@ export default {
                   placeholder="请输入" />
               </div>
             )
-          }else{
+          } else {
             return record.convertPromoGiftsQty || 0
           }
         }
         return '--'
       }
       // 操作按钮
-      const actionFormat = function(record,data,h) {
-        if(record.unpushedQty>0){
+      const actionFormat = function (record, data, h) {
+        if (record.unpushedQty > 0) {
           return (
             <div>
-               <a-button
+              <a-button
                 size="small"
                 type="link"
                 class="button-info"
-                onClick={()=>_this.handleAdd(record)}
-                >添加</a-button>
+                onClick={() => _this.handleAdd(record)}
+              >添加</a-button>
             </div>
           )
         }
         return '--'
       }
       // 编号,并且格式化活动分类行
-      const noFormat = function(record,data,h){
-        const isBuyPSendP = record.promo && record.promo.promotionRule.convertExpenseFlag==1&&record.promo.promotionRule.promotionRuleType=='BUY_PROD_GIVE_PROD'
+      const noFormat = function (record, data, h) {
+        const isBuyPSendP = record.promo && record.promo.promotionRule.convertExpenseFlag == 1 && record.promo.promotionRule.promotionRuleType == 'BUY_PROD_GIVE_PROD'
         return (
           <div>
-            {record.id.indexOf('promo-')>=0 ? (
+            {record.id.indexOf('promo-') >= 0 ? (
               <div class="active-title">
-                {record.promo?(
+                {record.promo ? (
                   <div>
                     <strong style="font-size:14px;">{record.promo.promotion.description} </strong>
                     <span>({record.promo.promotionRule.description})</span>
-                    <span style="margin-left:20px;color:#00aaff;cursor: pointer;" onClick={()=>_this.showDesc(record.promo)}>
+                    <span style="margin-left:20px;color:#00aaff;cursor: pointer;" onClick={() => _this.showDesc(record.promo)}>
                       <a-icon title="查看活动详情" type="eye"/> 活动详情
                     </span>
                   </div>
-                ):(<div></div>)}
+                ) : (<div></div>)}
                 <div>
-                  款数:<strong>{record.total&&record.total.totalCategory||'--'}</strong>;
-                  数量:<strong>{record.total&&record.total.totalQty||'--'}</strong>;
-                  {_this.$hasPermissions('B_salesEdit_salesPrice') ? (<span>总金额:<strong>{record.total&&record.total.totalAmount||'--'}</strong>;</span>):('')}
-                  {_this.$hasPermissions('B_salesEdit_salesPrice')&&record.promo&&record.total&&record.total.lossAmount ? (<span>优惠金额:<strong>{record.total.lossAmount}</strong>;</span>):('')}
-                  {_this.$hasPermissions('B_salesEdit_salesPrice')&&record.promo&&record.total&&record.total.cgejyAmount>0&&!isBuyPSendP ? (<span>采购额结余:<strong>{_this.toThousands(record.total.cgejyAmount)}</strong>;</span>):('')}
-                  {_this.$hasPermissions('B_salesEdit_salesPrice')&&record.promo&&record.total&&record.total.cgejyAmount<0&&!isBuyPSendP ? (<span>采购额超出:<strong>{_this.toThousands(record.total.cgeccAmount)}</strong>;</span>):('')}
-                  {_this.$hasPermissions('B_salesEdit_salesPrice')&&record.promo&&record.total&&record.total.totalPromoGiftsAmount&&isBuyPSendP ? (<span>促销产品转采购额金额:<strong>{_this.toThousands(record.total&&record.total.totalPromoGiftsAmount)||'--'}</strong>;</span>):('')}
-                  {record.expenseAccountFlag!='WAIT' ? record.expenseAccountFlagDictValue : ''}
+                  款数:<strong>{record.total && record.total.totalCategory || '--'}</strong>;
+                  数量:<strong>{record.total && record.total.totalQty || '--'}</strong>;
+                  {_this.$hasPermissions('B_salesEdit_salesPrice') ? (<span>总金额:<strong>{record.total && record.total.totalAmount || '--'}</strong>;</span>) : ('')}
+                  {_this.$hasPermissions('B_salesEdit_salesPrice') && record.promo && record.total && record.total.lossAmount ? (<span>优惠金额:<strong>{record.total.lossAmount}</strong>;</span>) : ('')}
+                  {_this.$hasPermissions('B_salesEdit_salesPrice') && record.promo && record.total && record.total.cgejyAmount > 0 && !isBuyPSendP ? (<span>采购额结余:<strong>{_this.toThousands(record.total.cgejyAmount)}</strong>;</span>) : ('')}
+                  {_this.$hasPermissions('B_salesEdit_salesPrice') && record.promo && record.total && record.total.cgejyAmount < 0 && !isBuyPSendP ? (<span>采购额超出:<strong>{_this.toThousands(record.total.cgeccAmount)}</strong>;</span>) : ('')}
+                  {_this.$hasPermissions('B_salesEdit_salesPrice') && record.promo && record.total && record.total.totalPromoGiftsAmount && isBuyPSendP ? (<span>促销产品转采购额金额:<strong>{_this.toThousands(record.total && record.total.totalPromoGiftsAmount) || '--'}</strong>;</span>) : ('')}
+                  {record.expenseAccountFlag != 'WAIT' ? record.expenseAccountFlagDictValue : ''}
                 </div>
               </div>
-            ):(<span>{data}</span>)}
+            ) : (<span>{data}</span>)}
           </div>
         )
       }
-       
-      let arr= [
-            { title: "", field: "", key: "acheck", width: 50, type: "checkbox", align: "center" },
-            { title: '序号', field: 'no',key: "a", width: 50, align: 'center', operationColumn: false,renderBodyCell: ({ row, column, rowIndex }, h) => { return noFormat(row,row[column.field],h)} },
-            { title: '产品编码', field: 'productCode',key: "b", width: 150, align: 'left',operationColumn: false,renderBodyCell: ({ row, column, rowIndex }, h) => { return codeFormat(row,row[column.field],h)} },
-            { title: '产品名称', field: 'productName',key: "c", width: 250, align: 'left',operationColumn: false , ellipsis: { showTitle: true },renderBodyCell: ({ row, column, rowIndex }, h) => { return row[column.field] || '--'}},
-            { title: '原厂编码', field: 'productOrigCode',key: "d", width: 150, align: 'left',operationColumn: false,ellipsis: { showTitle: true },renderBodyCell: ({ row, column, rowIndex }, h) => { return row[column.field] || '--'} },
-            { title: '出库仓库', field: 'warehouseName',key: "e", width: 100, align: 'center',operationColumn: false,renderBodyCell: ({ row, column, rowIndex }, h) => { return row[column.field] || '--'}}
-        ]
+
+      let arr = [
+        { title: '', field: '', key: 'acheck', width: 50, type: 'checkbox', align: 'center' },
+        { title: '序号', field: 'no', key: 'a', width: 50, align: 'center', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return noFormat(row, row[column.field], h) } },
+        { title: '产品编码', field: 'productCode', key: 'b', width: 150, align: 'left', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return codeFormat(row, row[column.field], h) } },
+        { title: '产品名称', field: 'productName', key: 'c', width: 250, align: 'left', operationColumn: false, ellipsis: { showTitle: true }, renderBodyCell: ({ row, column, rowIndex }, h) => { return row[column.field] || '--' } },
+        { title: '原厂编码', field: 'productOrigCode', key: 'd', width: 150, align: 'left', operationColumn: false, ellipsis: { showTitle: true }, renderBodyCell: ({ row, column, rowIndex }, h) => { return row[column.field] || '--' } },
+        { title: '出库仓库', field: 'warehouseName', key: 'e', width: 100, align: 'center', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return row[column.field] || '--' } }
+      ]
       this.colspanNums = this.showConvertPromoGifts ? 7 : 6
       if (this.$hasPermissions('B_salesDispatch_salesPrice')) { //  售价权限
         this.colspanNums = this.colspanNums + 1
-        arr.push({ title: '销售价', field: 'price', width: 80,key: "f", align: 'right',operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return priceFormat(row,row[column.field],h)} })
+        arr.push({ title: '销售价', field: 'price', width: 80, key: 'f', align: 'right', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return priceFormat(row, row[column.field], h) } })
       }
       if (this.$hasPermissions('B_salesDispatch_costPrice')) {
         this.colspanNums = this.colspanNums + 1
-        arr.push({ title: '成本价', field: 'showCost', width: 80,key: "g", align: 'right',operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return _this.toThousands(row[column.field])||'--'} })
-      }    
+        arr.push({ title: '成本价', field: 'showCost', width: 80, key: 'g', align: 'right', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return _this.toThousands(row[column.field]) || '--' } })
+      }
       this.colspanNums = this.colspanNums + 8
       arr = arr.concat([
-          { title: '单位', field: 'productOrigUnit',key: "i", width: 80, align: 'center',operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return row[column.field] || '--'}},
-          { title: '可用库存', field: 'stockQty', width: 80,key: "j", align: 'center',fixed: 'right',operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return numsFormat(row[column.field])} },
-          { title: '销售数量', field: 'qty', width: 80,key: "k", align: 'center',operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return numsFormat(row[column.field])} },
-          { title: '已取消', field: 'cancelQty', width: 80,key: "o", align: 'center',operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return numsFormat(row[column.field])} },
-          { title: '已下推', field: 'pushedQty', width: 80,key: "p", align: 'center',operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return numsFormat(row[column.field])} },
-          { title: '待下推', field: 'unpushedQty', width: 80,key: "q", align: 'center',operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return numsFormat(row[column.field])} },
-          { title: '取消数量', field: 'cancelNums', width: 80,key: "r", align: 'center',fixed: 'right',operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return inputFormat(row,row[column.field],h)} },
-        ])
-      if(this.showConvertPromoGifts){
-        arr.push({ title: '转采购额数量', field: 'convertPromoGiftsQty', width: 80,key: "z", align: 'center',fixed: 'right',operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { 
-          return inputFormat1(row,row[column.field],h)
-        } })
+        { title: '单位', field: 'productOrigUnit', key: 'i', width: 80, align: 'center', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return row[column.field] || '--' } },
+        { title: '可用库存', field: 'stockQty', width: 80, key: 'j', align: 'center', fixed: 'right', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return numsFormat(row[column.field]) } },
+        { title: '销售数量', field: 'qty', width: 80, key: 'k', align: 'center', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return numsFormat(row[column.field]) } },
+        { title: '已取消', field: 'cancelQty', width: 80, key: 'o', align: 'center', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return numsFormat(row[column.field]) } },
+        { title: '已下推', field: 'pushedQty', width: 80, key: 'p', align: 'center', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return numsFormat(row[column.field]) } },
+        { title: '待下推', field: 'unpushedQty', width: 80, key: 'q', align: 'center', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return numsFormat(row[column.field]) } },
+        { title: '取消数量', field: 'cancelNums', width: 80, key: 'r', align: 'center', fixed: 'right', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return inputFormat(row, row[column.field], h) } }
+      ])
+      if (this.showConvertPromoGifts) {
+        arr.push({ title: '转采购额数量',
+          field: 'convertPromoGiftsQty',
+          width: 80,
+          key: 'z',
+          align: 'center',
+          fixed: 'right',
+          operationColumn: false,
+          renderBodyCell: ({ row, column, rowIndex }, h) => {
+            return inputFormat1(row, row[column.field], h)
+          } })
       }
-      arr.push({ title: '操作', field: 'action', width: 80,key: "s", align: 'center',fixed: 'right',operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return actionFormat(row,row[column.field],h)} })
-      
+      arr.push({ title: '操作', field: 'action', width: 80, key: 's', align: 'center', fixed: 'right', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return actionFormat(row, row[column.field], h) } })
+
       return arr
     }
   },
   methods: {
     // 查看活动详情
-    showDesc(row){
+    showDesc (row) {
       this.detailSn = row.promoRuleSn
       this.openDetailModal = true
     },
@@ -408,159 +427,159 @@ export default {
       this.openDetailModal = false
     },
     // 合并活动分类单元格
-    bodyCellSpan({ row, column, rowIndex }) {
-      if (row.id.indexOf('promo-')>=0) {
-        if(column.field=='no'){
+    bodyCellSpan ({ row, column, rowIndex }) {
+      if (row.id.indexOf('promo-') >= 0) {
+        if (column.field == 'no') {
           return {
-                    rowspan: 1,
-                    colspan: this.colspanNums,
-                };
-        }else{
+            rowspan: 1,
+            colspan: this.colspanNums
+          }
+        } else {
           return {
-                rowspan: 0,
-                colspan: 0,
-            }
+            rowspan: 0,
+            colspan: 0
+          }
         }
       }
     },
-    cancelNumsChange(v,record){
+    cancelNumsChange (v, record) {
       record.cancelNums = v
       this.dataSource.splice()
     },
-    convertPromoGiftsChange(v,record){
+    convertPromoGiftsChange (v, record) {
       record.convertPromoGiftsQty = v
       this.dataSource.splice()
     },
     // 选择单元格
-    selectedRowChange({ row, isSelected, selectedRowKeys }){
+    selectedRowChange ({ row, isSelected, selectedRowKeys }) {
       // console.log(row, isSelected, selectedRowKeys);
-      this.selectedRowKeys = selectedRowKeys;
-      if(!isSelected){
+      this.selectedRowKeys = selectedRowKeys
+      if (!isSelected) {
         row.convertPromoGiftsQty = row.bakConvertPromoGiftsQty
       }
     },
     // 全选行
-    selectedAllChange({ isSelected, selectedRowKeys }){
-      this.selectedRowKeys = selectedRowKeys;
+    selectedAllChange ({ isSelected, selectedRowKeys }) {
+      this.selectedRowKeys = selectedRowKeys
       // 取消全选后,重置数量
-      if(!isSelected && this.showConvertPromoGifts){
-        this.dataSource.filter(item=>item.convertPromoGiftsQty).map(item => {
+      if (!isSelected && this.showConvertPromoGifts) {
+        this.dataSource.filter(item => item.convertPromoGiftsQty).map(item => {
           item.convertPromoGiftsQty = item.bakConvertPromoGiftsQty
         })
       }
     },
     // 获取销售单参与的活动列表
-    getActiveList(){
+    getActiveList () {
       salesPromoQueryList({ salesBillSn: this.salesBillSn }).then(res => {
-        if(res.status == 200){
+        if (res.status == 200) {
           this.activeList = res.data.filter(item => item.enabledFlag == 1) || []
         }
-        this.$nextTick(()=>{
+        this.$nextTick(() => {
           this.searchTable()
         })
       })
     },
-    async searchTable(){
-        this.selectedRowKeys = []
-        this.disableSelectedRowKeys = []
-        this.dataSource = []
-        this.disabled = true
-        this.spinning = true
-        this.queryParam.salesBillSn = this.salesBillSn
-        this.queryParam.showStock = true
-        const params = this.queryParam
-        console.log(params)
-        const active = this.activeList
-        // 正常产品
-        const hasSearchNormal = !params.promotionFlag || params.promotionFlag == 0
-        const proList = hasSearchNormal ? await salesDetailAllList(params).then(res => res.data) : []
-        const norTotal = hasSearchNormal ? await salesDetaiCount(params).then(res => res.data) : null
-        // 是否有正常产品
-        this.hasNormalProduct = proList.length > 0
-        //没有活动时不显示统计
-        let listData = active.length ? (proList.length ? [{
-            id: 'promo-normal',
-            total: norTotal
-          },...proList] : []) : proList
-        
-        if(params.promotionFlag != 0){
-          // 循环获取活动产品
-          for(let i=0;i<active.length;i++){
-            const promo = active[i]
-            const activeParams = {
-              promoRuleSn: promo.promoRuleSn,
-              promoSn: promo.promoSn,
-              salesPromoSn: promo.salesPromoSn,
-              ...params
-            }
-            
-            // 获取活动产品统计
-            const acTotal = await salesPromoDetailCount(activeParams).then(res => res.data)
-            if(acTotal){
-              // 采购额结余
-              acTotal.cgejyAmount = (Number(acTotal.totalPromoGiftsAmount||0) - Number(acTotal.totalUsePromoGiftsAmount||0)).toFixed(2)
-              // 采购额超出
-              acTotal.cgeccAmount = (Number(acTotal.totalUsePromoGiftsAmount||0) - Number(acTotal.totalPromoGiftsAmount||0)).toFixed(2)
-            }
-             
-            // 有数据时才调用接口,避免做无用的调用
-            if(acTotal&&acTotal.totalQty){
-              // 获取活动产品列表
-              const aclist = await salesDetailAllList(activeParams).then(res => res.data)
-              const retList = aclist.length ? [{
-                id: 'promo-'+i,
-                promo: promo,
-                total: acTotal
-              },...aclist] : []
-              // 将活动产品数据拼接
-              listData = aclist&&aclist.length ? listData.concat(retList) : listData
-            }
+    async searchTable () {
+      this.selectedRowKeys = []
+      this.disableSelectedRowKeys = []
+      this.dataSource = []
+      this.disabled = true
+      this.spinning = true
+      this.queryParam.salesBillSn = this.salesBillSn
+      this.queryParam.showStock = true
+      const params = this.queryParam
+      console.log(params)
+      const active = this.activeList
+      // 正常产品
+      const hasSearchNormal = !params.promotionFlag || params.promotionFlag == 0
+      const proList = hasSearchNormal ? await salesDetailAllList(params).then(res => res.data) : []
+      const norTotal = hasSearchNormal ? await salesDetaiCount(params).then(res => res.data) : null
+      // 是否有正常产品
+      this.hasNormalProduct = proList.length > 0
+      // 没有活动时不显示统计
+      let listData = active.length ? (proList.length ? [{
+        id: 'promo-normal',
+        total: norTotal
+      }, ...proList] : []) : proList
+
+      if (params.promotionFlag != 0) {
+        // 循环获取活动产品
+        for (let i = 0; i < active.length; i++) {
+          const promo = active[i]
+          const activeParams = {
+            promoRuleSn: promo.promoRuleSn,
+            promoSn: promo.promoSn,
+            salesPromoSn: promo.salesPromoSn,
+            ...params
           }
-    
-          // 如果活动没有任何产品
-          if(active.length){
-            const hasAcp = listData.filter(item => item.id!='promo-normal').filter(item => item.id.indexOf("promo-")>=0)
-            if(hasAcp && hasAcp.length==0){
-              listData = listData.filter(item => item.id.indexOf("promo-")<0) || []
-            }
+
+          // 获取活动产品统计
+          const acTotal = await salesPromoDetailCount(activeParams).then(res => res.data)
+          if (acTotal) {
+            // 采购额结余
+            acTotal.cgejyAmount = (Number(acTotal.totalPromoGiftsAmount || 0) - Number(acTotal.totalUsePromoGiftsAmount || 0)).toFixed(2)
+            // 采购额超出
+            acTotal.cgeccAmount = (Number(acTotal.totalUsePromoGiftsAmount || 0) - Number(acTotal.totalPromoGiftsAmount || 0)).toFixed(2)
           }
-        }
-        console.log(listData)
-        this.dataSource = listData
 
-        // 格式化数据
-        let f = 0
-        this.dataSource.map((item,i) => {
-          const isTjRow = item.id.indexOf('promo-')>=0
-          if(isTjRow){f = f - 1}
-          item.no = i + 1 + f
-          const productCode = (item.productEntity && item.productEntity.code) || (item.dealerProductEntity && item.dealerProductEntity.code)
-          const productName = (item.productEntity && item.productEntity.name) || (item.dealerProductEntity && item.dealerProductEntity.name)
-          const productOrigCode = (item.productEntity && item.productEntity.origCode) || (item.dealerProductEntity && item.dealerProductEntity.origCode)
-          const productOrigUnit = (item.productEntity && item.productEntity.unit) || (item.dealerProductEntity && item.dealerProductEntity.unit)
-          item.productCode = productCode || '--'
-          item.productName = productName || '--'
-          item.productOrigCode = productOrigCode == ' ' ? '--' : productOrigCode
-          item.productOrigUnit = productOrigUnit || '--'
-          item.cancelNums = item.unpushedQty
-          
-          if(item.convertPromoGiftsFlag == 1){
-            item.maxConvertNums = item.unpushedQty + item.convertPromoGiftsQty
-          }else{
-            item.maxConvertNums = 0
+          // 有数据时才调用接口,避免做无用的调用
+          if (acTotal && acTotal.totalQty) {
+            // 获取活动产品列表
+            const aclist = await salesDetailAllList(activeParams).then(res => res.data)
+            const retList = aclist.length ? [{
+              id: 'promo-' + i,
+              promo: promo,
+              total: acTotal
+            }, ...aclist] : []
+            // 将活动产品数据拼接
+            listData = aclist && aclist.length ? listData.concat(retList) : listData
           }
-          
-          item.bakConvertPromoGiftsQty = item.convertPromoGiftsQty
-          
-          // 库存为0或待下推数为0,不可添加
-          if(!item.convertPromoGiftsQty && (!item.unpushedQty || item.unpushedQty<0) || isTjRow){
-            this.disableSelectedRowKeys.push(item.id)
+        }
+
+        // 如果活动没有任何产品
+        if (active.length) {
+          const hasAcp = listData.filter(item => item.id != 'promo-normal').filter(item => item.id.indexOf('promo-') >= 0)
+          if (hasAcp && hasAcp.length == 0) {
+            listData = listData.filter(item => item.id.indexOf('promo-') < 0) || []
           }
-        })
-        this.showEmpty = this.dataSource.length <= 0
-        this.tableData = this.dataSource
-        this.spinning = false
-        this.disabled = false
+        }
+      }
+      console.log(listData)
+      this.dataSource = listData
+
+      // 格式化数据
+      let f = 0
+      this.dataSource.map((item, i) => {
+        const isTjRow = item.id.indexOf('promo-') >= 0
+        if (isTjRow) { f = f - 1 }
+        item.no = i + 1 + f
+        const productCode = (item.productEntity && item.productEntity.code) || (item.dealerProductEntity && item.dealerProductEntity.code)
+        const productName = (item.productEntity && item.productEntity.name) || (item.dealerProductEntity && item.dealerProductEntity.name)
+        const productOrigCode = (item.productEntity && item.productEntity.origCode) || (item.dealerProductEntity && item.dealerProductEntity.origCode)
+        const productOrigUnit = (item.productEntity && item.productEntity.unit) || (item.dealerProductEntity && item.dealerProductEntity.unit)
+        item.productCode = productCode || '--'
+        item.productName = productName || '--'
+        item.productOrigCode = productOrigCode == ' ' ? '--' : productOrigCode
+        item.productOrigUnit = productOrigUnit || '--'
+        item.cancelNums = item.unpushedQty
+
+        if (item.convertPromoGiftsFlag == 1) {
+          item.maxConvertNums = item.unpushedQty + item.convertPromoGiftsQty
+        } else {
+          item.maxConvertNums = 0
+        }
+
+        item.bakConvertPromoGiftsQty = item.convertPromoGiftsQty
+
+        // 库存为0或待下推数为0,不可添加
+        if (!item.convertPromoGiftsQty && (!item.unpushedQty || item.unpushedQty < 0) || isTjRow) {
+          this.disableSelectedRowKeys.push(item.id)
+        }
+      })
+      this.showEmpty = this.dataSource.length <= 0
+      this.tableData = this.dataSource
+      this.spinning = false
+      this.disabled = false
     },
     //  重置
     resetSearchForm (detailData) {
@@ -579,7 +598,7 @@ export default {
       this.clearSelectTable()
       this.searchTable()
 
-      if(detailData){
+      if (detailData) {
         this.detailData = detailData
       }
     },
@@ -591,7 +610,7 @@ export default {
     },
     // 清空选项
     clearSelectTable () {
-       this.selectedRowKeys = []
+      this.selectedRowKeys = []
     },
     // 添加
     handleAdd (row) {
@@ -602,14 +621,14 @@ export default {
       }
     },
     // 批量转采购额
-    handlePlPurchase(){
+    handlePlPurchase () {
       const _this = this
       const chooseList = this.selectedRowKeys
       if (chooseList.length == 0) {
         _this.$message.warning('请先选择产品!')
         return
       }
-      const chooseRow = this.dataSource.filter(item => chooseList.includes(item.id) && item.convertPromoGiftsFlag==1)
+      const chooseRow = this.dataSource.filter(item => chooseList.includes(item.id) && item.convertPromoGiftsFlag == 1)
       const noChooseRow = this.dataSource.filter(item => chooseList.includes(item.id) && !item.convertPromoGiftsFlag)
       const obj = []
       const noObj = []
@@ -622,11 +641,11 @@ export default {
           'salesBillDetailSn': item.salesBillDetailSn
         })
       })
-      
-      if(obj.length){
+
+      if (obj.length) {
         this.$confirm({
           title: '提示',
-          content: <div><div style="text-align:center;padding:10px 0;font-weight:bold;">确定将选中的促销产品转成采购额吗?</div>{noObj.length?<div style="text-align:center;"><div>总共选择了 {chooseList.length} 个产品,其中 {obj.length} 个产品可转采购额。</div><div style="color:red;"> 产品 ({noObj.toString()}) 不可转采购额!</div></div>:''}<div style="font-size:12px;color:#999;padding:10px 0;text-align:center;">
+          content: <div><div style="text-align:center;padding:10px 0;font-weight:bold;">确定将选中的促销产品转成采购额吗?</div>{noObj.length ? <div style="text-align:center;"><div>总共选择了 {chooseList.length} 个产品,其中 {obj.length} 个产品可转采购额。</div><div style="color:red;"> 产品 ({noObj.toString()}) 不可转采购额!</div></div> : ''}<div style="font-size:12px;color:#999;padding:10px 0;text-align:center;">
 当该销售单完结后,可将采购额转成费用报销单。</div></div>,
           centered: true,
           closable: true,
@@ -635,7 +654,7 @@ export default {
             _this.$emit('convertPromoGifts', obj)
           }
         })
-      }else{
+      } else {
         _this.$message.warning('所选产品都不可转采购额!')
       }
     },
@@ -659,10 +678,10 @@ export default {
         noObj.push(item.productCode)
       })
 
-      if(obj.length){
+      if (obj.length) {
         this.$confirm({
           title: '提示',
-          content: <div><div style="text-align:center;padding:10px 0;font-weight:bold;">确认要批量添加到待下推列表吗?</div>{noObj.length?<div><div>总共选择了 {chooseList.length} 个产品,其中 {obj.length} 个产品可添加。</div><div> 产品 ({noObj.toString()}) 因库存为0不可添加!</div></div>:''}</div>,
+          content: <div><div style="text-align:center;padding:10px 0;font-weight:bold;">确认要批量添加到待下推列表吗?</div>{noObj.length ? <div><div>总共选择了 {chooseList.length} 个产品,其中 {obj.length} 个产品可添加。</div><div> 产品 ({noObj.toString()}) 因库存为0不可添加!</div></div> : ''}</div>,
           centered: true,
           closable: true,
           class: 'confirm-center',
@@ -670,10 +689,9 @@ export default {
             _this.$emit('addProduct', obj)
           }
         })
-      }else{
+      } else {
         _this.$message.warning('所选产品库存都为0,不可添加!')
       }
-      
     },
     // 整单取消
     handleAllCancel () {
@@ -696,9 +714,9 @@ export default {
         _this.$message.warning('请先选择产品!')
         return
       }
-      const chooseRow = this.dataSource.filter(item => chooseList.includes(item.id) && item.id.indexOf('promo-')<0)
+      const chooseRow = this.dataSource.filter(item => chooseList.includes(item.id) && item.id.indexOf('promo-') < 0)
       const hasActive = chooseRow && chooseRow.filter(item => item.promotionFlag != 0)
-      if(hasActive.length>0){
+      if (hasActive.length > 0) {
         _this.$message.warning('参与促销的产品只可进行整单取消!')
         return
       }
@@ -730,11 +748,11 @@ export default {
       background: #f3f8fa;
     }
   }
-  .ve-table .ve-table-container .ve-table-content-wrapper table.ve-table-content tbody.ve-table-body tr.ve-table-body-tr td.table-body-cell-no, 
+  .ve-table .ve-table-container .ve-table-content-wrapper table.ve-table-content tbody.ve-table-body tr.ve-table-body-tr td.table-body-cell-no,
   .ve-table .ve-table-container .ve-table-content-wrapper table.ve-table-content tbody.ve-table-body tr.ve-table-expand-tr td.table-body-cell-no{
     padding: 0;
-  } 
+  }
   .ve-table .ve-table-container .ve-table-content-wrapper{
       border-bottom: 1px solid #ddd;
     }
-</style>
+</style>

+ 1 - 1
vue.config.js

@@ -108,7 +108,7 @@ const vueConfig = {
     // If you want to turn on the proxy, please remosve the mockjs /src/main.jsL11
     proxy: {
       '/api': {
-        // target: 'http://192.168.2.117:8602/ocs-admin',
+        // target: 'http://192.168.2.111/ocs-admin',
         // target: 'https://t.ocs.360arrow.com/ocs-admin', //  练习
         target: 'https://p.ocs.360arrow.com/ocs-admin', //  预发布
         ws: false,

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 370 - 375
yarn.lock


Một số tệp đã không được hiển thị bởi vì quá nhiều tập tin thay đổi trong này khác